/* Design: ChatGPT spec 2026-11-13 ("bright, precise field notebook").
   Tokens below are its HEX values verbatim. Phone rules first; desktop at 1024+. */
:root {
  --canvas: #F2F6F7; --surface: #FCFEFE; --subtle: #E8F0F2;
  --ink: #142D38; --muted: #4F6570; --line: #CCDADD; --control: #71858E;
  --primary: #075B68; --primary-hover: #064B56; --primary-pressed: #043C46; --primary-soft: #DCEFF1; --on-primary: #FCFEFE;
  --danger: #A32932; --danger-soft: #FCECEF; --success: #236143; --success-soft: #E5F2E9;
  --disabled-bg: #DFE7E9; --disabled-text: #536872;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --tabs-h: calc(64px + env(safe-area-inset-bottom));
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 16px/24px Archivo, Arial, sans-serif; font-variant-numeric: tabular-nums;
  padding-bottom: var(--tabs-h);
}
body.has-dock { padding-bottom: calc(var(--tabs-h) + 76px); }
body.kb-open { padding-bottom: 24px; }
body.kb-open .tabs { display: none; }
body.kb-open .dock-wrap { position: static; box-shadow: none; }
body.bare { padding-bottom: 0; }
body.bare .tabs, body.bare .top, body.bare .side { display: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 28px; line-height: 34px; font-weight: 700; }
h2 { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: normal; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
main:focus, h1:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.xs { width: 12px; height: 12px; }

/* ---------- shell ---------- */
.top { min-height: 64px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; }
.top-brand { font-size: 14px; line-height: 20px; font-weight: 600; }
.acct { position: relative; }
.pop {
  position: absolute; right: 0; top: 52px; z-index: 30; min-width: 200px; padding: 8px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #142D3824;
  transform-origin: top right; animation: pop-in 160ms var(--ease);
}
.pop a, .pop button { display: flex; align-items: center; min-height: 48px; padding: 0 16px; width: 100%; background: none; border: 0; text-align: left; color: var(--ink); text-decoration: none; font-weight: 500; cursor: pointer; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.98); } }
.side { display: none; }
main { padding: 0 16px 32px; max-width: 720px; margin: 0 auto; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--tabs-h); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 12px; line-height: 16px; font-weight: 600; }
.tabs a .pill { display: grid; place-items: center; width: 48px; height: 28px; border-radius: 8px; }
.tabs a[aria-current="page"] { color: var(--primary); }
.tabs a[aria-current="page"] .pill { background: var(--primary-soft); }
.dock-wrap {
  position: fixed; left: 0; right: 0; bottom: var(--tabs-h); z-index: 19; padding: 12px 16px;
  background: var(--surface); box-shadow: 0 -4px 16px #142D3810;
}
.dock-wrap > * { max-width: 688px; margin: 0 auto; }
.offline { position: sticky; top: 0; z-index: 40; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 600; padding: 8px 16px; text-align: center; }
.backbar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; margin: 0 -8px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 8px; color: var(--primary); text-decoration: none; font-weight: 600; }

/* ---------- type helpers ---------- */
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.sub { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.sec { margin-top: 32px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 48px; }
.count { color: var(--muted); font-weight: 400; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: 8px; border: 1px solid var(--control); background: var(--surface); color: var(--ink);
  font-size: 16px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), background-color 120ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:active { background: var(--primary-pressed); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--primary); min-height: 48px; padding: 0 8px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: var(--on-primary); }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--disabled-bg); color: var(--disabled-text); cursor: not-allowed; transform: none; }
.btn.quiet[disabled] { background: transparent; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn.primary { background: var(--primary); color: var(--on-primary); }
.spin { animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: var(--primary-hover); }
  .btn:not(.primary):not([disabled]):hover { background: var(--subtle); }
  .btn.quiet:hover { background: var(--subtle); }
  .row:hover, .pop a:hover, .pop button:hover { background: var(--subtle); }
}

/* contact row: Call / Text / Go */
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contact .btn { min-height: 48px; padding: 0 8px; }
.contact-hint { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--muted); }

/* ---------- lists ---------- */
.panel { background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.panel > * + * { border-top: 1px solid var(--line); }
.row { display: block; padding: 16px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.row:active { background: var(--subtle); }
a.row { cursor: pointer; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name { font-size: 18px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.addr { overflow-wrap: anywhere; }
.chev { color: var(--muted); }
.job { padding: 16px; }
.job-main { display: block; color: inherit; text-decoration: none; margin: -16px -16px 0; padding: 16px 16px 0; }
.job-time { font-weight: 600; }
.rep { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; line-height: 20px; }
.job .name { margin-top: 8px; }
.warn { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.job .contact { margin-top: 16px; }
.done-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.done-row .tick { color: var(--success); }
.empty { padding: 24px 16px; }
.empty h3 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: normal; }
.empty p { margin-top: 4px; color: var(--muted); }
.empty .btn { margin-top: 16px; }
.skel { height: 88px; background: var(--subtle); }
.panel > .skel + .skel { border-top: 1px solid var(--surface); }

/* status chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.chip.draft { color: #465B65; background: #E8EEF0; }
.chip.sent, .chip.scheduled { color: #075B68; background: #DCEFF1; }
.chip.approved, .chip.done { color: #236143; background: #E5F2E9; }
.chip.declined, .chip.expired { color: #A32932; background: #FCECEF; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--subtle); font-size: 14px; line-height: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- forms ---------- */
.field { display: block; margin-top: 20px; }
.field > span { display: block; font-size: 14px; line-height: 20px; font-weight: 600; margin-bottom: 8px; }
.field .hint { display: block; margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 52px; padding: 12px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface);
  font-size: 16px; line-height: 24px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F6570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] { background: var(--subtle); }
.invalid input, .invalid select, .invalid textarea, input.invalid { border-color: var(--danger); }
.err { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--danger); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair > .field { margin-top: 20px; }
.csz { display: grid; grid-template-columns: 1fr 96px; gap: 12px; }
.disclose { display: flex; align-items: center; gap: 8px; margin-top: 24px; min-height: 48px; padding: 0; border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; }
.disclose[aria-expanded="true"] svg { transform: rotate(180deg); }
.form-err { margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 14px; line-height: 20px; font-weight: 600; }
.ok-msg { margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--success-soft); color: var(--success); font-weight: 600; animation: fade 120ms linear; }
@keyframes fade { from { opacity: 0; } }

/* ---------- detail blocks ---------- */
.dl { margin: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.dl > div:first-child { border-top: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.crow { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.crow small { display: block; color: var(--muted); font-size: 14px; line-height: 20px; }
.ctx { margin-top: 12px; color: var(--muted); }
.ctx b { color: var(--ink); font-weight: 600; }
.when { margin-top: 12px; font-size: 20px; line-height: 26px; font-weight: 600; }

/* quote editor */
.li { padding: 16px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .pair .field { margin-top: 12px; }
.li > .field:first-child { margin-top: 0; }
.li-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.li-amt { font-size: 18px; line-height: 24px; font-weight: 600; }
/* ChatGPT review 2026-11-13: remove is quieter than add/save; schedule text readable in daylight */
.li-foot .rm { color: var(--muted); font-size: 14px; font-weight: 500; }
.vrow .small { font-size: 16px; line-height: 22px; }
.li-ro { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.li-ro:first-child { border-top: 0; }
.total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.total b { font-size: 28px; line-height: 34px; font-weight: 700; }
.mismatch { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 14px; line-height: 20px; font-weight: 600; }
.picker { display: flex; gap: 8px; margin-top: 16px; }
.picker select { flex: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn-row .btn { flex: 1 1 140px; }
.share-pre { margin-top: 12px; padding: 12px; background: var(--subtle); border-radius: 8px; white-space: pre-wrap; font-size: 14px; line-height: 20px; user-select: all; }
.examples { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 14px; line-height: 20px; }

/* schedule */
.weekbar { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; min-height: 48px; }
.weekbar strong { font-size: 16px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 12px; }
.days button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.days button small { font-size: 12px; line-height: 16px; color: var(--muted); }
.days button b { font-size: 16px; line-height: 20px; font-weight: 600; }
.days button.today b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.days button[aria-pressed="true"] { background: var(--primary-soft); }
.day { margin-top: 24px; scroll-margin-top: 16px; }
.day h3 { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: normal; margin-bottom: 8px; }
.vrow { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 16px; color: inherit; text-decoration: none; min-height: 88px; }
.vrow .t { font-weight: 600; }
.none { padding: 12px 16px; color: var(--muted); }

/* sign in */
.signin { max-width: 400px; margin: 0 auto; padding: calc(96px + env(safe-area-inset-top)) 24px 48px; }
.signin .brand { font-size: 18px; line-height: 24px; font-weight: 600; }
.signin h1 { margin-top: 32px; }
.signin .lede { margin-top: 8px; color: var(--muted); }
.signin form { margin-top: 32px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw button { position: absolute; right: 2px; top: 2px; height: 48px; padding: 0 12px; border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; }
.signin .btn { margin-top: 16px; }
.signin .pw-note { margin-top: 12px; }
.signin .pw-note:empty { display: none; }

/* public quote page */
.pub { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.pub .brand { font-size: 18px; line-height: 24px; font-weight: 600; }

@media (min-width: 768px) { main { padding: 0 24px 40px; } .dock-wrap { padding: 12px 24px; } }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  body, body.has-dock { padding: 0 0 0 224px; }
  body.bare { padding: 0; }
  .tabs, .top { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 224px; padding: 24px; background: var(--surface); border-right: 1px solid var(--line); }
  .side-brand { font-size: 16px; line-height: 24px; font-weight: 700; }
  .side-nav { margin-top: 40px; display: grid; gap: 4px; }
  .side-foot { margin-top: auto; display: grid; gap: 4px; }
  .nav-item { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 20px; font-weight: 600; border: 0; background: none; cursor: pointer; width: 100%; }
  .nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
  main { max-width: 1120px; margin: 0; padding: 40px; }
  main.narrow { max-width: 800px; }
  h1 { font-size: 32px; line-height: 40px; }
  .total b { font-size: 32px; line-height: 40px; }
  .dock-wrap { position: static; box-shadow: none; padding: 0 40px 40px; background: none; max-width: 1120px; }
  .dock-wrap > * { margin: 0; max-width: 400px; }
  .page-search { max-width: 400px; }
  /* Today rows become table-like */
  .job { display: grid; grid-template-columns: 112px 1fr 150px 260px; gap: 16px; align-items: center; }
  .job-main { display: contents; }
  .job .name { margin-top: 0; }
  .job .contact { margin-top: 0; }
  .job .who { min-width: 0; }
  /* Customers as a table */
  .ctable .row { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr 1fr 24px; gap: 16px; align-items: center; min-height: 72px; }
  .ctable .row .m-only { display: none; }
  .ctable .d-only { display: block; }
  .cols { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: start; }
  .cols .sec:first-child { margin-top: 0; }
  .vrow { grid-template-columns: 112px 1fr; }
}
.d-only { display: none; }
@media (prefers-reduced-motion: reduce) {
  .btn, .pop { transition: none; animation: none; }
  .btn:active { transform: none; }
  .spin { animation: none; }
}

/* additions: search field, stacked headings, job/customer columns */
.search { position: relative; margin-top: 16px; }
.search svg { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.search input { padding-left: 44px; }
.page-head.stack { flex-direction: column; align-items: stretch; gap: 24px; }
.lastop { margin-left: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px; border: 1px solid var(--control); border-radius: 8px; background: var(--subtle); }
.results { margin-top: 8px; }
.results button { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; background: none; cursor: pointer; min-height: 56px; }
.results button + button { border-top: 1px solid var(--line); }
.svc { display: grid; grid-template-columns: 1fr 88px 104px 48px; gap: 8px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc .field { margin-top: 0; }
.svc .field > span { font-size: 12px; line-height: 16px; margin-bottom: 4px; }
.confirm { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--subtle); }
.confirm p { font-weight: 600; }
.confirm .btn-row { margin-top: 12px; }
.dock-confirm { display: flex; align-items: center; gap: 8px; }
.dock-confirm p { flex: 1; font-weight: 600; }
.dock-confirm .btn { min-height: 48px; padding: 0 14px; }
.next-line { margin-bottom: 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--primary); text-align: center; }
@media (max-width: 1023px) { .svc { grid-template-columns: 1fr 1fr 48px; } .svc .field:first-child { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .page-head.stack { flex-direction: row; align-items: center; }
  .job .row-line { display: contents; }
  .job .job-time { order: 1; } .job .who { order: 2; } .job .rep { order: 3; } .job .contact { order: 4; }
  .ctable .row-line { display: contents; }
  .ctable .row .chev { justify-self: end; }
  .jcols { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
  .jside { position: sticky; top: 24px; }
  .li-table .li { display: grid; grid-template-columns: 1fr 96px 128px 128px 48px; gap: 12px; align-items: end; }
  .li-table .li .pair, .li-table .li .li-foot { display: contents; }
  .li-table .li .field, .li-table .li .pair .field { margin-top: 0; }
  .li-table .li .li-amt { text-align: right; align-self: center; padding-top: 28px; order: 4; }
  .li-table .li .rm { order: 5; width: 48px; min-width: 48px; padding: 0; justify-content: center; align-self: end; }
  .li-table .li .rm span { display: none; }
}
.mt0 { margin-top: 0; } .mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; }
.sel { user-select: all; -webkit-user-select: all; }
.done-row .muted:last-child { margin-left: auto; white-space: nowrap; }
