/* Tommy Repair styles
   Same look as Tommy Fleet: one narrow column, black-and-white, color only marks status. */

/* ---------- theme tokens (day by default, night via system or toggle) ---------- */
:root {
  --bg: #ffffff; --surface: #ffffff; --ink: #141817; --muted: #6c7472; --faint: #a3aaa8; --line: #e8ebea; --hover: #f5f7f6;
  --accent: #0f6f63; --accent-ink: #ffffff;
  --c-green: #178a4c; --c-blue: #2563c9; --c-amber: #b2700c; --c-red: #c63a2b; --c-gray: #8a9290; --c-purple: #7a4fd0;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1111; --surface: #141817; --ink: #e7ebea; --muted: #99a29f; --faint: #626b69; --line: #222827; --hover: #1a1f1e;
    --accent: #3fbfa9; --accent-ink: #06201c;
    --c-green: #41c17c; --c-blue: #6aa1f2; --c-amber: #e7a53c; --c-red: #f06d5c; --c-gray: #7d8784; --c-purple: #a98cf2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1111; --surface: #141817; --ink: #e7ebea; --muted: #99a29f; --faint: #626b69; --line: #222827; --hover: #1a1f1e;
  --accent: #3fbfa9; --accent-ink: #06201c;
  --c-green: #41c17c; --c-blue: #6aa1f2; --c-amber: #e7a53c; --c-red: #f06d5c; --c-gray: #7d8784; --c-purple: #a98cf2;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.fine { font-size: 12.5px; color: var(--faint); margin: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

/* ---------- controls ---------- */
.btn { color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 13px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.big { padding: 11px 16px; font-size: 15px; border-radius: 10px; width: 100%; }
.btn.danger:hover { color: var(--c-red); }
.btn:disabled { opacity: .45; cursor: default; }
.in { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 11px; font-size: 14px; width: 100%; color: var(--ink); }
.in:focus { border-color: var(--ink); outline: none; }
textarea.in { resize: vertical; min-height: 64px; }
.back { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.back:hover { color: var(--ink); }
.textbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--faint); font-size: 13px; }
.textbtn:hover { color: var(--ink); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.theme-btn svg { width: 16px; height: 16px; }

/* ---------- setup ---------- */
.setup { min-height: 100%; display: grid; place-items: center; padding-inline: 16px; padding-block: 48px; }
.card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.card h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; font-weight: 600; }
.punch-sm { margin: -12px 0 0; font-weight: 600; color: var(--muted); }
.setup-top { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; white-space: nowrap; color: inherit; text-decoration: none; }
.logo .mark { width: 34px; height: 34px; display: block; flex: none; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.logo .sub { color: var(--muted); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.card-form { display: flex; flex-direction: column; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- app shell ---------- */
.top { max-width: 720px; margin: 0 auto; padding-inline: 16px; height: 60px; display: flex; align-items: center; gap: 14px; }
/* three pages, like Tommy Fleet: Jobs · New job · Settings */
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { padding: 6px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 500; }
.tab-ic { display: none; }

/* team, like Tommy Fleet */
.box h3 .tcount { font-weight: 400; font-size: 13px; margin-left: 6px; }
.tlist { display: flex; flex-direction: column; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.trow:last-child { border-bottom: 0; }
.temail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname { color: var(--ink); font-weight: 500; }
.tmail { color: var(--faint); font-size: 12.5px; }
.ttag { font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.trole { width: 84px; flex-shrink: 0; }
.tmeta { font-size: 13px; color: var(--muted); padding-left: 4px; }
.rolesel { appearance: none; -webkit-appearance: none; background: none; border: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; padding: 2px 4px; width: 100%; }
.rolesel:hover { color: var(--ink); }
.tx, .tx-sp { width: 18px; flex-shrink: 0; }
.tx { background: none; border: 0; padding: 0; font-size: 16px; line-height: 1; color: var(--faint); cursor: pointer; }
.tx:hover { color: var(--c-red); }
.tform { display: flex; gap: 8px; }
.tform #inviteEmail { flex: 1; min-width: 0; }
.tform #inviteRole { width: auto; }
.ws { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
main { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 64px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head h2 { font-size: 22px; margin: 0 auto 0 0; letter-spacing: -.02em; font-weight: 600; }

/* ---------- invoice list ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.f { background: none; border: 0; padding: 2px 0; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.f b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--faint); }
.f[aria-pressed="true"], .f[aria-pressed="true"] b { color: var(--ink); }
.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 90px; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:hover { background: var(--hover); }
.row .no { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.row .who { min-width: 0; display: flex; flex-direction: column; }
.row .who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- plan usage and picker ---------- */
.usage { margin: -8px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.usage.near { color: var(--c-amber); }
.usage.over { color: var(--c-red); }
.usage .textbtn { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.plans-pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plans-pick legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.pp { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.pp:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pp input { accent-color: var(--ink); margin: 0; }
.pp > span { display: flex; flex-direction: column; }
.pp > span span { color: var(--muted); font-size: 13px; }
.pp em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }

/* limit reached: an alert on the invoice list, and a note next to Send */
.limit { border: 1px solid color-mix(in srgb, var(--c-amber) 45%, var(--line)); background: color-mix(in srgb, var(--c-amber) 8%, var(--surface)); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.limit > b { font-size: 15px; }
.limit > span { color: var(--muted); }
.limit > span b { color: var(--ink); font-weight: 600; }
.limit .acts { margin-top: 8px; }
.extra-note { margin-right: auto; align-self: center; font-size: 13px; color: var(--c-amber); }
.extra-note .textbtn { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- locations: city tabs like Tommy Fleet ---------- */
.cities { display: flex; gap: 6px; flex-wrap: wrap; }
.ct { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.ct b { font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.ct:hover { border-color: var(--muted); }
.ct[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ct[aria-pressed="true"] b { color: var(--bg); opacity: .7; }
.in.compact { width: auto; padding: 4px 8px; font-size: 13px; }
.ghead { display: flex; gap: 8px; align-items: center; width: 100%; padding: 16px 6px 10px; font: inherit; font-size: 13px; color: var(--faint); text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ghead:first-child { padding-top: 6px; }
@media (hover: hover) { .ghead:hover .gname { text-decoration: underline; text-underline-offset: 2px; } }
.gname { font-weight: 600; color: var(--ink); font-size: 15px; }
.chev { display: inline-block; width: 12px; font-size: 18px; line-height: 1; color: var(--muted); transition: transform .15s; }
.ghead[aria-expanded="true"] .chev { transform: rotate(90deg); }
.loc-list { display: flex; flex-direction: column; gap: 6px; }
.loc-list { gap: 4px; }
.loc-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 54px 20px; gap: 6px; align-items: center; }
.loc-row .in, .loc-row .btn { padding: 5px 8px; font-size: 14px; border-radius: 7px; }
.loc-row .x { width: 20px; height: 20px; }
.loc-head { font-size: 11.5px; color: var(--muted); }
.loc-add { grid-template-columns: minmax(0, 1fr) 64px auto; margin-top: 2px; }
.rate { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12.5px; }
.rate .in { text-align: right; padding-inline: 6px; }

/* ---------- invoice editor ---------- */
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec > h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.lines { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.line .in { border-color: transparent; padding: 6px 4px; }
.line .in:hover { border-color: var(--line); }
.line .in:focus { border-color: var(--ink); }
.line .price { text-align: right; font-variant-numeric: tabular-nums; }
.x { background: none; border: 0; color: var(--faint); cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
.x:hover { color: var(--c-red); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-size: 14px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); text-align: right; }
.totals dd { margin: 0; text-align: right; min-width: 90px; }
.totals .grand { color: var(--ink); font-weight: 600; font-size: 17px; }
.bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ph { margin: 0; position: relative; }
.ph-open { padding: 0; border: 0; background: var(--hover); cursor: zoom-in; border-radius: 10px; overflow: hidden; aspect-ratio: 1; width: 100%; display: block; }
.ph-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; font-size: 11px; opacity: 0; }
.ph:hover .ph-del, .ph-del:focus-visible { opacity: 1; }
@media (hover: none) { .ph-del { opacity: 1; } }
.ph-add { aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--hover); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 13px; text-align: center; padding: 8px; }
.ph-add:hover { border-color: var(--muted); color: var(--ink); }
.ph-add svg { width: 20px; height: 20px; }
.lightbox { position: fixed; inset: 0; z-index: 36; background: rgba(0, 0, 0, .85); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 60px); border-radius: 8px; display: block; }
.lightbox .close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; font-size: 15px; }

/* ---------- business view of a sent invoice ---------- */
.box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.box h3 { margin: 0; font-size: 15px; font-weight: 600; }
/* Profile: Locations and Team drop down */
.fold summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary h3 { flex: 1; }
.fold summary .muted { font-size: 14px; }
.fold summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 2px 0 4px; transition: transform .15s; }
.fold[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.fold:not([open]) { gap: 0; }
/* Paid tab: Today · This week · Calendar */
.chips { display: flex; gap: 6px; }
.chip { flex: 1; font: inherit; font-size: 14px; padding: 8px 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.psum { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin: 0 2px -6px; }
.psum b { color: var(--ink); font-weight: 600; }
.center-acts { justify-content: center; }
.pub-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 18vh; text-align: center; }
.pub-empty h1 { font-size: 22px; margin: 8px 0 0; color: var(--ink); }
.pub-empty p { margin: 0; color: var(--muted); }
.sum-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sum-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.sum-tile span { font-size: 13px; color: var(--muted); }
.sum-tile b { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.sum-tile em { font-style: normal; font-size: 12.5px; color: var(--faint); }
.sum-tile.owed b { color: var(--c-amber, var(--ink)); }
.cal { background: var(--surface); border-radius: 14px; padding: 12px; }
.calh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; }
.calh b { font-weight: 600; }
.calnav { width: 32px; height: 32px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.cgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cdn { font-size: 11.5px; color: var(--faint); padding-bottom: 4px; }
.cd { position: relative; font: inherit; font-size: 14px; padding: 7px 0 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; }
.cd.fut { color: var(--faint); cursor: default; }
.cd.cd-today { font-weight: 600; }
.cd.cd-paid::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--c-green); }
.cd.cd-sel { background: var(--ink); color: var(--bg); }
.cd.cd-sel::after { background: var(--bg); }
.privacy { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.link-row { display: flex; gap: 8px; }
.link-row .in { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; color: var(--faint); }
.steps li .tick { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); justify-self: center; }
.steps li.done { color: var(--ink); }
.steps li.done .tick { background: var(--ink); border-color: var(--ink); }
.steps li time { font-size: 12.5px; color: var(--muted); }
.meta { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- customer page ---------- */
.cust { max-width: 520px; }
.bizhead { display: flex; flex-direction: column; gap: 2px; }
.bizhead h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.notice { border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--hover); }
.notice b { font-size: 15px; }
.notice.ok { background: color-mix(in srgb, var(--c-green) 12%, var(--surface)); }
.notice.ok b { color: var(--c-green); }
.notice.bad { background: color-mix(in srgb, var(--c-red) 10%, var(--surface)); }
.notice.bad b { color: var(--c-red); }
.ready { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.items li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.items li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.pm span { color: var(--muted); font-size: 12.5px; }
.pm[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.agree input { margin-top: 3px; accent-color: var(--ink); }
.demo-tag { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }

/* ---------- receipt ---------- */
.receipt { border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 18px; background: var(--surface); }
.rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rc-top h1 { margin: 0; font-size: 20px; font-weight: 600; }
.paid-stamp { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; border: 1.5px solid var(--c-green); color: var(--c-green); padding: 3px 9px; border-radius: 6px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 8px 8px 16px; border-radius: 10px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; z-index: 40; max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: var(--bg); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px 8px; }

/* ---------- jobs board: one column per step ---------- */
main.wide, .top.wide { max-width: 1200px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--hover); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col h3 { margin: 2px 4px 2px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.col h3 b { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-empty { margin: 0 4px 4px; color: var(--faint); font-size: 13px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.job-open { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; min-width: 0; }
.job-open:hover b { text-decoration: underline; text-underline-offset: 2px; }
.job-top { display: flex; justify-content: space-between; gap: 8px; }
.job-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-top .amt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.job-item { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { color: var(--faint); font-size: 12px; }
.flag { font-size: 12.5px; color: var(--c-amber); font-weight: 500; font-style: normal; }
.btn.next { margin: 0 10px 10px; padding: 8px 10px; }
.foot-links { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }

/* ---------- photo-first intake ---------- */
.take { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 17px; }
.take svg { width: 26px; height: 26px; }
.take:hover { border-color: var(--muted); }
.line { grid-template-columns: minmax(0, 1fr) 100px auto 28px; }
.opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.opt input { accent-color: var(--ink); margin: 0; }
.issue { margin: 0; white-space: pre-wrap; }
.warranty-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.warranty-edit textarea { min-height: 96px; resize: vertical; }
.rc-warranty { margin-top: 16px; }
.items em { font-style: normal; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.items li.skipped span:first-child { color: var(--faint); }
.items li.pick label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.items li.pick input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.center { text-align: center; align-self: center; }

/* ---------- questions ---------- */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; align-self: flex-start; background: var(--hover); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: var(--ink); color: var(--bg); border-radius: 12px 12px 4px 12px; }
.msg .who { font-size: 11.5px; opacity: .65; }
.msg p { margin: 2px 0 0; white-space: pre-wrap; }
.ask { display: flex; flex-direction: column; gap: 8px; }

/* ---------- the shop's logo ---------- */
.bizmark { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; flex: none; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.bizmark.letter { display: grid; place-items: center; background: #000; color: #fff; font-weight: 700; font-size: 15px; }
.bizmark.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
.bizline { display: flex; align-items: center; gap: 10px; font-size: 16px; min-width: 0; }
.bizline b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.logo-row .btn { cursor: pointer; }

/* ---------- email preview (always light, like an inbox) ---------- */
.email { background: #fff; color: #141817; border: 1px solid #e8ebea; border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.email .bizmark { box-shadow: 0 0 0 1px #e8ebea; }
.email p { margin: 0; }
.em-head { display: flex; align-items: center; gap: 12px; font-size: 17px; padding-bottom: 12px; border-bottom: 1px solid #e8ebea; }
.em-subj { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.em-box { background: #f1f7f5; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.em-box span { font-size: 12.5px; color: #6c7472; }
.em-box b { font-size: 17px; }
.email .items, .email .items li { border-color: #e8ebea; }
.email .totals dt { color: #6c7472; }
.email .totals .grand, .email .totals dd { color: #141817; }
.em-btn { align-self: flex-start; background: #141817; color: #fff; text-decoration: none; border-radius: 9px; padding: 10px 16px; font-weight: 600; }
.em-foot { font-size: 12.5px; color: #8a9290; border-top: 1px solid #e8ebea; padding-top: 12px; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .col { background: none; padding: 0; }
  .col h3 { margin: 6px 0 0; font-size: 14px; }
  .col-empty { display: none; }
}
@media (max-width: 600px) {
  /* phones: Jobs · New job · Settings move to a bottom tab bar, like a native app (same as Tommy Fleet) */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0; gap: 0; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 4px 2px; font-size: 11px; border-radius: 0; }
  .tab-ic { display: block; width: 26px; height: 26px; }
  .tab[aria-current="page"] .tab-ic { stroke-width: 2.1; }
  /* no brand up top on phones: the page title sits right under the notch, dark-mode button beside it */
  .top.app { height: 0; position: relative; z-index: 5; }
  .top.app .theme-btn { position: absolute; right: 16px; top: 16px; }
  .top:not(.app) .end { margin-left: auto; }
  .top.app ~ main { padding-top: 14px; }
  /* a plain strip behind the clock so the page doesn't scroll under it */
  body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 30; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .bar { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who amt" "st no"; gap: 2px 12px; }
  .row .who { grid-area: who; } .row .amt { grid-area: amt; } .row .status { grid-area: st; } .row .no { grid-area: no; text-align: right; }
  .line { grid-template-columns: minmax(0, 1fr) 96px 28px; grid-template-areas: "d d d" "p o x"; }
  .line [data-ldesc] { grid-area: d; } .line .price { grid-area: p; text-align: left; } .line .opt { grid-area: o; } .line .x { grid-area: x; }
  /* phone-first: bigger tap targets at the workbench */
  .btn { padding: 10px 15px; font-size: 15px; }
  .btn.next { padding: 11px 12px; }
  .bar .btn.big-m { flex: 1; padding: 13px 16px; }
  .in { font-size: 16px; padding: 10px 12px; }
  .top .btn.primary { padding: 8px 13px; }
  .two { grid-template-columns: 1fr; }
  .ws { display: none; }
  .meta { grid-template-columns: 90px 1fr; }
  .receipt { padding: 18px; }
}

/* ---------- print: only the receipt ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #555; --faint: #888; --line: #ddd; }
  .top, .no-print, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .receipt { border: 0; padding: 0; }
}

/* compact settings rows (team invite, like Locations) */
.tform .in, .tform .btn { padding: 5px 8px; font-size: 14px; border-radius: 7px; }

/* first-time nudge on the jobs screen (e.g. add your ZIP code) */
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--hover); font-size: 13.5px; }
.nudge .btn { padding: 5px 12px; font-size: 13.5px; flex: none; }

.box.ok { border-color: color-mix(in srgb, var(--c-green) 40%, var(--line)); background: color-mix(in srgb, var(--c-green) 6%, var(--surface)); }
.box.ok h3 { color: var(--c-green); }

/* "Leo paid $37.45 · Start repair" on the Jobs screen */
.paidbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c-green) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-green) 35%, var(--line)); }
.paidbar a { flex: 1; display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; }
.paidbar b { color: var(--c-green); font-size: 15px; }
.paidbar span { color: var(--muted); font-size: 13px; }

/* Jobs screen: tighter spacing so tabs and the list sit higher */
main.jobs { gap: 10px; padding-top: 12px; }
main.jobs .usage { margin: -6px 0 2px; }
main.jobs .paidbar { padding: 8px 12px; border-radius: 10px; }
main.jobs .paidbar b { font-size: 14px; }
main.jobs .paidbar span { font-size: 12.5px; }
main.jobs .filters { padding-bottom: 8px; }

.plans-pick .usage { margin: 0 0 4px; }

.plans-pick legend { display: flex; justify-content: space-between; width: 100%; }
.plans-pick legend span { color: var(--faint); font-size: 12.5px; }

#pickupAt { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; }

.share-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.share-row .btn { padding: 9px 6px; font-size: 14px; }

/* ---------- one-screen New (invoice or estimate) ---------- */
.newinv { gap: 10px; }
.card2 { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); text-align: left; color: inherit; font: inherit; width: 100%; }
.card2 > label { font-size: 13px; color: var(--muted); }
.card2 input:not([type=checkbox]), .card2 textarea { border: 0; padding: 4px 0; font-size: 16px; background: transparent; color: var(--ink); width: 100%; outline: none; }
.card2 textarea { resize: vertical; min-height: 48px; }
.card2 input::placeholder, .card2 textarea::placeholder { color: var(--faint); }
.two2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two2 input { font-size: 14px !important; color: var(--muted) !important; }
.amt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.amt-row label { font-size: 13px; color: var(--muted); }
.amt-row input { font-size: 24px !important; font-weight: 600; text-align: right; max-width: 160px; }
.addit { align-self: flex-start; background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.card2 .lines .in { border: 1px solid transparent; }
.row2 { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.row2 svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.row2 b { font-weight: 500; flex: 1; }
.opt2 { color: var(--faint); font-size: 13px; }
.sw-row { cursor: pointer; flex-direction: row; }
.sw-txt { flex: 1; display: flex; flex-direction: column; }
.sub2 { font-size: 13px; color: var(--muted); }
.sw { width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.sw-row.on .sw { background: var(--ink); }
.sw-row.on .sw::after { left: 21px; }
.bizhead .for { margin: 2px 0 0; font-size: 16px; color: var(--muted); }

/* location dropdown on Invoices */
.locpick { align-self: flex-start; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; padding: 6px 30px 6px 12px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-size: 5px 5px; background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-repeat: no-repeat; }
.locpick:hover { border-color: var(--muted); }

/* ---------- Invoices page: soft background, white cards, Waiting / Paid ---------- */
:root { --soft: #f4f5f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --soft: #0e1111; } }
:root[data-theme="dark"] { --soft: #0e1111; }
body.soft { background: var(--soft); }
body.soft .tabs { background: var(--surface); }
body.soft::before { background: var(--soft); }
.inv { gap: 14px; }
.ihead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ihead h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.inv .locpick { border-radius: 999px; padding: 6px 28px 6px 12px; font-size: 13.5px; }
.inv .paidbar { border: 0; border-radius: 14px; padding: 10px 12px; gap: 12px; }
.pb-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--c-green); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 12px; padding: 3px; }
.seg.seg3 { grid-template-columns: 1fr 1fr 1fr; }
.seg button { border: 0; background: none; padding: 8px; border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button b { font-weight: 500; color: var(--faint); margin-left: 3px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ilist { display: flex; flex-direction: column; gap: 10px; }
.icard { background: var(--surface); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.icard-top { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.icard .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.icard .who b { font-weight: 500; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .who span { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .amt { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.icard .amt b { font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.pill { font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.pill.est { background: color-mix(in srgb, var(--c-amber) 13%, var(--surface)); color: var(--c-amber); }
.pill.ok { background: color-mix(in srgb, var(--c-green) 12%, var(--surface)); color: var(--c-green); }
.pill.no { background: color-mix(in srgb, var(--c-red) 10%, var(--surface)); color: var(--c-red); }
.ready-btn { width: 100%; padding: 11px; border-radius: 12px; }
.notified { margin: 0; text-align: center; font-size: 13.5px; color: var(--c-green); }
/* slimmer Waiting / Paid switch */
.seg { border-radius: 10px; padding: 2px; }
.seg button { padding: 5px 8px; font-size: 13.5px; border-radius: 8px; }
.paidbar .pb-ic { color: #fff; font-size: 14px; font-weight: 700; }

/* locations: name + remove only */
.loc-row { grid-template-columns: minmax(0, 1fr) 20px; }
.loc-add { grid-template-columns: minmax(0, 1fr) auto; }

/* Send bar: no line on top; while typing on a phone the tab bar hides and Send sits at the bottom */
.bar { border-top: 0; }
@media (max-width: 600px) {
  body.typing .tabs { display: none; }
  body.typing .bar { bottom: 0; }
  body.typing main { padding-bottom: 24px; }
}

.nopick { align-self: center; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: -4px; }
.nopick:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Ready for pickup | No pickup needed, side by side, then a confirm */
.pick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick2 .btn { padding: 10px 6px; font-size: 14px; border-radius: 12px; white-space: normal; }
.confirm { display: flex; flex-direction: column; gap: 8px; }
.confirm > span { font-size: 14px; text-align: center; color: var(--ink); }

/* Show QR to pay in person: full screen, always white so any camera reads it */
.qr-ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
.qr-screen { position: fixed; inset: 0; z-index: 60; background: #fff; color: #141817; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.qr-screen .close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #f1f2f2; color: #141817; font-size: 16px; cursor: pointer; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; width: 100%; max-width: 340px; }
.qr-card .muted { color: #6c7472; }
.qr-amt { font-size: 40px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qr-code { width: 100%; max-width: 300px; margin-top: 14px; padding: 12px; border-radius: 18px; box-shadow: 0 0 0 1px #e8ebea; }
.qr-code svg { width: 100%; height: auto; display: block; }
.qr-tip { margin: 12px 0 0; font-size: 15px; color: #141817; }

/* deposit switch on New, and the balance note */
.card2.dep { gap: 8px; }
.card2.dep .sw-row { padding: 0; border: 0; background: none; width: 100%; font: inherit; color: inherit; text-align: left; }
.card2.dep.on .sw-row .sw { background: var(--ink); }
.card2.dep.on .sw-row .sw::after { left: 21px; }
.card2.dep .amt-row { border-top: 1px solid var(--line); padding-top: 8px; }
.notified.amber { color: var(--c-amber); }
.notified.no { color: var(--muted); }
/* Sign in: the emailed code */
.code-in { font-family: "Geist Mono", ui-monospace, monospace; font-size: 22px; letter-spacing: .3em; text-align: center; }
/* Sign in: logo in the middle, Apple / Google / email at the bottom */
.signin { box-sizing: border-box; min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; padding: 24px 24px 12px; } /* body already pads around the notch */
.si-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.si-hero .mark { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 14px; box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.12); }
.si-hero h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.si-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.si-panel { display: flex; flex-direction: column; gap: 14px; }
.si-panel .card-form { gap: 12px; }
.sso { display: flex; flex-direction: column; gap: 10px; }
.si-btn { width: 100%; height: 54px; border-radius: 999px; font-size: 16px; font-weight: 600; gap: 10px; }
.si-btn svg { width: 20px; height: 20px; flex: none; }
.sso-apple { background: #000; color: #fff; border-color: #000; }
.sso-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.sso-mail { background: color-mix(in srgb, var(--ink) 7%, transparent); border-color: transparent; }
:root[data-theme="dark"] .sso-apple { background: #fff; color: #000; border-color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sso-apple { background: #fff; color: #000; border-color: #fff; } }
.si-in { height: 54px; border-radius: 16px; font-size: 17px; padding: 0 18px; }
.si-in.code-in { font-size: 24px; }
.si-back { align-self: center; padding: 6px; }
.si-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.si-panel > .textbtn { align-self: center; }
.si-top { display: flex; justify-content: flex-end; min-height: 32px; } /* Not now / Try demo: top right, like Skip in most apps */
.si-skip { background: none; border: 0; padding: 6px 2px; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; cursor: pointer; }
/* Free trial: last few days */
.trialbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: color-mix(in srgb, var(--c-amber) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-amber) 35%, var(--line)); }
.trialbar .textbtn { color: var(--ink); font-weight: 600; font-size: 14px; }
.plans-pick .fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.plans-pick .fine .textbtn { color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
