/* QuotePaint · tokens + components.
 * Tokens from docs/SPEC.md section 11; layout and the extra neutrals from docs/prototype. */

/* Self-hosted Inter (OFL, fonts/LICENSE.txt). No third-party font requests. */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #1E6B52;
  --green-dk: #14503C;
  --green-bg: #DDEBE4;
  --ink: #1B1F23;
  --muted: #5B6360;
  --line: #DCDFDA;
  --bg: #F4F5F3;
  --orange: #B4421A;
  --orange-bg: #FDF3EC;
  --blue-bg: #E3EEF8;
  --blue: #1F4E79;
  --white: #FFFFFF;

  /* Prototype neutrals and status colours */
  --line-strong: #C9CDC6;
  --line-soft: #ECEEEA;
  --head-bg: #F8F9F7;
  --faint: #9AA19D;
  --draft-bg: #FFF1C2;
  --draft: #6B4E00;
  --draft-field: #FFF8E6;
  --invoiced-bg: #FBE9E1;
  --invoiced: #8A3312;
  --paid: #3B3F46;
  --current-row: #FFFDF4;

  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-card: 12px;
  --r-btn: 10px;
  --r-input: 8px;
  --tap: 44px;

  --gutter: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pricebar-h: 136px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--green); }
a:hover { color: var(--green-dk); }
button { font: inherit; color: inherit; }
svg { flex: none; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[data-screen]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 767.98px) { .wide-only { display: none !important; } }
@media (min-width: 768px) { .phone-only { display: none !important; } }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter) 8px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  min-width: 0;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--green);
}
.brand-mark svg { width: 14px; height: 14px; fill: none; stroke: var(--white); stroke-width: 2.2; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }

.free-chip {
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
body:not([data-route="quote"]):not([data-route="settings"]) .free-chip { display: none; }
.free-chip.is-paid { background: var(--green-bg); color: var(--green-dk); }
body[data-route="quote"] .free-chip.is-paid { display: none; }

/* Phone header: business name on Quote, the screen title elsewhere (P4, P6) */
.header-title { margin: 0 auto 0 0; font-size: 18px; font-weight: 700; }
.header-note { font-size: 11px; color: var(--muted); }
.header-note:empty { display: none; }
body[data-route="quote"] .header-title, body[data-route="quote"] .header-note { display: none; }
@media (max-width: 767.98px) {
  .topbar { min-height: 61px; }
  body:not([data-route="quote"]) .brand { display: none; }
  /* Screen headings are in the bar on phone; keep them for screen readers */
  .t-head, .ql-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Tabs: bottom bar on phone, inline in the top bar when wide ---------- */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  padding: 6px 0 calc(14px + var(--safe-b));
  background: var(--white);
  border-top: 1px solid var(--line);
}

.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
}
.tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--green); font-weight: 600; }

/* ---------- Main + screens ---------- */

main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
body[data-route="quote"] main { padding-bottom: calc(var(--tabbar-h) + var(--pricebar-h) + var(--safe-b) + 16px); }

[data-screen] { display: grid; gap: 10px; }
[data-quote-root] { display: grid; gap: 10px; min-width: 0; }

.boot-msg { color: var(--muted); padding: 24px 0; }
.boot-msg.is-error { color: var(--orange); }

/* ---------- Components ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
}

.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.hint { color: var(--muted); font-size: 11px; }
.empty { color: var(--muted); font-size: 13px; padding: 4px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font: 600 14px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dk); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line-strong); font-weight: 500; }
.btn-secondary:hover { background: var(--head-bg); }
.btn-ghost { background: none; color: var(--green); font-weight: 600; }
.btn-ghost:hover { background: var(--green-bg); }
.btn-danger { background: var(--white); color: var(--orange); border-color: var(--line-strong); font-weight: 500; }
.btn-light { background: var(--white); color: var(--green); font-size: 15px; font-weight: 700; min-height: 48px; }
.btn-light svg { width: 16px; height: 16px; stroke-width: 2.2; }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field label, .field .label { font-size: 10px; font-weight: 500; color: var(--muted); }
.field input, .status-field {
  width: 100%;
  min-height: var(--tap);
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--white);
  color: var(--ink);
  font: 16px var(--font);          /* 16px stops iOS zooming into the field */
}
.field input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
.status-field { display: flex; align-items: center; background: var(--draft-field); font-size: 13px; }

.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1;
  min-height: var(--tap);
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 600; }

.status { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--line-soft); color: var(--paid); }
.st-draft { background: var(--draft-bg); color: var(--draft); }
.st-sent { background: var(--blue-bg); color: var(--blue); }
.st-won { background: var(--green-bg); color: var(--green-dk); }
.st-invoiced { background: var(--invoiced-bg); color: var(--invoiced); }
.st-paid { background: var(--line-soft); color: var(--paid); }
.st-lost { background: var(--line-soft); color: var(--muted); }
button.status { position: relative; border: 0; font-family: inherit; cursor: pointer; }
button.status::after { content: ""; position: absolute; inset: -10px -6px; }   /* 44px tap area */
button.status:hover { filter: brightness(0.96); }

.late { color: var(--orange); font-weight: 500; }
.good { color: var(--green); font-weight: 500; }

.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { min-height: 32px; padding: 0 4px; border: 0; background: none; color: #9FE0C4; font-weight: 700; cursor: pointer; }

/* M1 placeholder cards, replaced screen by screen */
.placeholder { display: grid; gap: 8px; border-style: dashed; }
.store-status { color: var(--muted); font-size: 14px; }

.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: var(--r-btn);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(27, 31, 35, 0.18);
}

/* ---------- Sheet ---------- */

.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 90vh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--white);
  color: var(--ink);
  overflow: auto;
}
.sheet::backdrop { background: rgba(27, 31, 35, 0.45); }

.sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px calc(16px + var(--safe-b)); }
.sheet-body h2 { font-size: 18px; font-weight: 700; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet-grid .field label { font-size: 12px; }
.span-2 { grid-column: span 2; }
.sheet-preview { padding: 10px 12px; border-radius: var(--r-input); background: var(--bg); color: var(--muted); font-size: 13px; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn-primary { flex: 1; }
.sheet .hint { font-size: 13px; margin-top: -8px; }

.pick-list { display: flex; flex-direction: column; }
.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  cursor: pointer;
}
.pick-row:hover { background: var(--head-bg); }
.pick-row span { display: flex; flex-direction: column; font-weight: 500; }
.pick-row small { color: var(--muted); font-size: 12px; font-weight: 400; }

.cost-lines { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Send sheet (P2) ---------- */

.sheet:has(.send-sheet) { border-radius: 22px 22px 0 0; }
.send-sheet { padding-top: 10px; }
.grabber { width: 40px; height: 4px; margin: 0 auto -4px; border-radius: 2px; background: var(--line); }
.send-head { display: flex; flex-direction: column; gap: 2px; }
.send-head .hint { font-size: 12px; margin: 0; }

.send-opts { display: flex; flex-direction: column; gap: 8px; }
.send-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  color: var(--ink);
  text-decoration: none;
}
.send-opt:hover { color: var(--ink); background: var(--head-bg); }
.send-opt svg { width: 22px; height: 22px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.send-opt .chev { width: 16px; height: 16px; stroke: var(--muted); }
.so-text { flex: 1; display: flex; flex-direction: column; }
.so-text b { font-weight: 600; }
.so-text small { font-size: 11px; color: var(--muted); }
.send-primary { background: var(--green); border-color: var(--green); color: var(--white); }
.send-primary:hover { background: var(--green-dk); color: var(--white); }
.send-primary svg, .send-primary .chev { stroke: currentColor; }
.send-primary .so-text b { font-weight: 700; }
.send-primary .so-text small { color: inherit; opacity: 0.85; }

.send-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.send-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.send-small:hover { background: var(--head-bg); }
.send-small svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.msg-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-card); background: var(--bg); }
.msg-label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.msg-edit { padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: none; cursor: pointer; text-decoration: underline; }
.msg-text { padding: 0; border: 0; background: none; font-size: 13px; line-height: 1.5; text-align: left; cursor: text; }
.msg-link { color: var(--green); font-weight: 600; text-decoration: underline; word-break: break-all; }
.msg-editor { display: flex; flex-direction: column; gap: 6px; }
.msg-input {
  width: 100%;
  min-height: 132px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--white);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  resize: vertical;
}
.msg-box .hint { margin: 0; font-size: 11px; }
.link-card { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); }
.lc-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r-input); background: var(--green); }
.lc-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--white); stroke-width: 2; }
.lc-text { display: flex; flex-direction: column; min-width: 0; }
.lc-text b { font-size: 12px; font-weight: 600; }
.lc-text small { font-size: 11px; color: var(--muted); }
.back-link { min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }

/* ---------- Quote detail sheet ---------- */

.ds-head { display: flex; flex-direction: column; gap: 2px; }
.ds-head .hint { margin: 0; font-size: 12px; }
.status-pick { margin: 0; padding: 0; border: 0; }
.status-pick legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.status-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.status-opt { position: relative; cursor: pointer; }
.status-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.status-opt .status { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--tap); padding: 0 10px; border-radius: var(--r-input); font-size: 13px; }
.status-opt input:checked + .status { box-shadow: 0 0 0 2px var(--ink); }
.status-opt input:focus-visible + .status { outline: 2px solid var(--green); outline-offset: 3px; }
.ds-due { min-height: 16px; margin-top: -4px; color: var(--muted); font-size: 12px; }
.ds-due.late { color: var(--orange); }

/* ---------- Quotes list ---------- */

[data-quotes-root], [data-today-root], [data-jobs-root], [data-settings-root] { display: grid; gap: 10px; min-width: 0; }
.ql-head { display: flex; flex-direction: column; gap: 4px; }
.ql-head .hint { font-size: 12px; }
.ql-list { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.ql-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.ql-row:last-child { border-bottom: 0; }
.ql-main { flex: 1; display: flex; flex-direction: column; min-width: 0; color: var(--ink); text-decoration: none; }
.ql-main:hover { color: var(--ink); }
.ql-client { font-weight: 600; }
.ql-job { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-meta { color: var(--muted); font-size: 12px; }
.ql-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ql-side b { font-weight: 600; }

/* ---------- Today (P4) ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 500; }
.stat-num { font-size: 18px; font-weight: 700; }
.stat-num.late { color: var(--orange); }
.stat-num.collected { color: var(--green); }
.stat-sub { font-size: 10px; color: var(--muted); }

.chase { display: flex; flex-direction: column; gap: 10px; }
.chase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 2px 0; }
.chase-head .hint { font-size: 11px; }
.chase-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cc-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-client { font-weight: 600; }
.cc-reason { color: var(--muted); font-size: 12px; font-weight: 500; }
.cc-reason.late { color: var(--orange); }
.cc-amount { font-weight: 700; }
.cc-msg { padding: 8px 10px; border-radius: var(--r-input); background: var(--bg); color: var(--muted); font-size: 12px; line-height: 1.45; }
.cc-actions { display: flex; gap: 8px; }
.cc-send { flex: 1; font-size: 13px; }
.tick-btn {
  display: grid; place-items: center; flex: none;
  width: var(--tap); min-height: var(--tap);
  border: 1px solid var(--line-strong); border-radius: var(--r-btn);
  background: var(--white); color: var(--muted); cursor: pointer;
}
.tick-btn:hover { color: var(--green); border-color: var(--green); }
.tick-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { padding: 16px 14px; color: var(--muted); font-size: 13px; background: var(--white); border: 1px dashed var(--line); border-radius: var(--r-card); }
.chase-table .empty-state { border: 0; border-radius: 0; }

.chase-table { padding: 0; overflow: hidden; }
.row-send { display: flex; gap: 8px; }
.btn-sm { padding: 0 12px; font-size: 13px; }
.done-box { width: 22px; height: 22px; margin: 0; accent-color: var(--green); cursor: pointer; }
.msg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.msg-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.msg-preview { padding: 12px; border-radius: var(--r-input); background: var(--head-bg); font-size: 13px; line-height: 1.55; }

/* ---------- Locks (free plan) ---------- */

.locked { position: relative; min-height: 220px; }
.locked-content { filter: blur(3px); opacity: 0.55; pointer-events: none; user-select: none; display: flex; flex-direction: column; gap: 10px; }
.locked-overlay { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start; padding-top: 36px; }
.lock-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 300px; padding: 14px 18px; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 20px rgba(27, 31, 35, 0.12);
  color: var(--ink); text-decoration: none;
}
.lock-card:hover { color: var(--ink); }
.lock-card svg { width: 20px; height: 20px; fill: none; stroke: var(--green); stroke-width: 2; }
.lock-card b { font-weight: 700; }
.lock-card > span:not(.btn) { color: var(--muted); font-size: 12px; }
.lock-card .btn { margin-top: 4px; min-height: 40px; }
.cc-compact { flex-direction: row; }
.cc-compact .cc-top { flex: 1; }

/* ---------- Unlock (P5) ---------- */

[data-unlock-root] { display: flex; flex-direction: column; gap: 18px; max-width: 520px; margin: 0 auto; width: 100%; }
.ul-top { display: flex; align-items: center; justify-content: space-between; }
.ul-top .hint { font-size: 11px; }
.ul-back { color: var(--ink); }
.ul-back svg { width: 20px; height: 20px; stroke-width: 2.2; }
.ul-body { display: flex; flex-direction: column; gap: 18px; padding: 0 8px; }
.ul-intro { display: flex; flex-direction: column; gap: 6px; }
.ul-intro h1, .ul-body > h1 { font-size: 26px; line-height: 1.15; }
.ul-intro .lead, .ul-body > .lead { color: var(--muted); line-height: 1.5; }
.ul-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 2px solid var(--green); border-radius: 16px; background: var(--white); }
.ul-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ul-card-top > b { font-size: 16px; font-weight: 700; }
.ul-price { display: flex; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ul-price b { color: var(--green); font-size: 28px; font-weight: 700; }
.ul-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.ul-list li { display: flex; gap: 10px; align-items: flex-start; }
.ul-list svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ul-buy { min-height: 50px; border-radius: var(--r-card); font-size: 15px; font-weight: 700; }
.ul-note { text-align: center; font-size: 11px; }
.ul-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ul-facts div { display: flex; gap: 8px; }
.ul-facts dt { flex: none; width: 110px; color: var(--ink); font-weight: 600; }
.ul-facts dd { margin: 0; }
.ul-foot { display: flex; flex-direction: column; gap: 10px; padding: 0 8px 12px; }
.ul-key { min-height: 48px; border-radius: var(--r-card); }
.ul-key svg { width: 16px; height: 16px; }
.link-quiet { min-height: var(--tap); border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
@media (max-width: 767.98px) {
  /* P5 is a full-screen page: its own back arrow, no app bars */
  body[data-route="unlock"] .topbar, body[data-route="unlock"] .tabs { display: none; }
  body[data-route="unlock"] main { padding: 14px var(--gutter) calc(16px + var(--safe-b)); background: var(--white); min-height: 100vh; }
  body[data-route="unlock"] { background: var(--white); }
}

/* ---------- Settings: licence card (P6) ---------- */

.licence-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.licence-card h2 { font-size: 14px; }
.lc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.lc-ok { display: flex; align-items: center; gap: 6px; color: var(--green-dk); font-size: 13px; font-weight: 600; }
.lc-ok svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.lc-form { display: flex; flex-direction: column; gap: 3px; }
.lc-form label { color: var(--muted); font-size: 11px; }
.lc-input { display: flex; gap: 8px; }
.lc-input input {
  flex: 1; min-width: 0; min-height: var(--tap); padding: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-input);
  font: 16px var(--font); text-transform: uppercase;
}
.lc-input input::placeholder { text-transform: none; }
.lc-input input[aria-invalid="true"] { border-color: var(--orange); }
.lc-msg { min-height: 0; font-size: 12px; }
.lc-revoked { padding: 10px 12px; border-radius: var(--r-input); background: var(--orange-bg); color: var(--invoiced); font-size: 13px; font-weight: 600; }
.lc-revoked a { color: inherit; }
.lc-other summary { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--green); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.lc-other summary::-webkit-details-marker { display: none; }
.lc-other[open] summary { margin-bottom: 6px; }
.lc-msg:empty { display: none; }

/* ---------- Backup banner (Today) ---------- */

.backup-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 6px 4px 14px; border-radius: var(--r-card);
  background: var(--orange-bg); color: var(--invoiced); font-size: 13px; font-weight: 500;
}
.backup-banner .link-btn { flex: none; font-size: 13px; color: var(--invoiced); text-decoration: underline; padding: 0 8px; }

/* ---------- Settings (P6, desktop Settings) ---------- */

.set-top { display: grid; gap: 10px; }
.backup-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.bk-head { display: flex; align-items: center; gap: 10px; }
.bk-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-btn); background: var(--green-bg); }
.bk-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--green-dk); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bk-text { display: flex; flex-direction: column; }
.bk-text b { font-weight: 600; }
.bk-text small { color: var(--muted); font-size: 12px; }
.bk-status { padding: 10px 12px; border-radius: var(--r-input); font-size: 12px; font-weight: 600; }
.bk-status.warn { background: var(--orange-bg); color: var(--invoiced); }
.bk-status.ok { background: var(--green-bg); color: var(--green-dk); }
.bk-save { min-height: 48px; font-weight: 700; }
.bk-save svg { width: 16px; height: 16px; stroke-width: 2.2; }
.backup-card .hint { font-size: 11px; line-height: 1.5; }
.backup-card .hint b { color: var(--ink); font-weight: 600; }
.bk-restore { min-height: 48px; font-weight: 600; }

.set-list { padding: 0; overflow: hidden; }
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: none; text-align: left; cursor: pointer;
}
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: var(--head-bg); }
.set-label { font-weight: 500; }
.set-sum { color: var(--muted); font-size: 12px; text-align: right; }
.set-sum.late { color: var(--orange); font-weight: 600; }

.set-panel { display: flex; flex-direction: column; gap: 12px; }
.set-panel h2 { font-size: 15px; }
.set-panel .hint { font-size: 12px; line-height: 1.5; }
.set-panel.in-sheet { gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 9px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-input);
  background: var(--white); color: var(--ink); font: 16px/1.45 var(--font);
}
.field textarea { resize: vertical; }
.field select:focus, .field textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
.set-panel .field label { font-size: 11px; }

.affix { display: inline-flex; align-items: center; gap: 4px; width: 100%; }
.affix > span { color: var(--muted); font-size: 13px; }
.affix input { flex: 1; min-width: 0; }

.rate-rows { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.rate-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.rate-row:last-child { border-bottom: 0; }
.rate-row label { flex: 1 1 160px; }
.rate-row .affix { width: auto; }
.rate-row input {
  width: 84px; min-height: var(--tap); padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-input);
  font: 600 16px var(--font); text-align: right;
}
.rate-row input:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.rate-row.needs-look { margin: 0 -8px; padding: 8px; border-radius: var(--r-input); background: var(--orange-bg); }
.rate-row.needs-look input { border-color: #C8622F; }
.rate-row .flag { color: var(--invoiced); font-weight: 600; }
.rate-row .link-btn { font-size: 12px; }

.pb-card { padding: 0; overflow: hidden; }
.pb-table { min-width: 640px; font-size: 13px; }
.pb-table td { padding: 2px 4px; }
.pb-table td.name { padding-left: 12px; }
.pb-table td.calc { padding: 10px; background: var(--bg); color: var(--muted); text-align: right; }
.pb-table th.calc { background: var(--line-soft); text-align: right; }
.pb-table input {
  width: 100%; min-width: 60px; min-height: var(--tap); padding: 6px;
  border: 1px solid transparent; border-radius: 6px; background: var(--white); font: 13px var(--font);
}
.pb-table td.num input { width: 96px; flex: none; text-align: right; }
.pb-table td.num .affix { justify-content: flex-end; }
.pb-table td.name input { min-width: 150px; font-weight: 500; }
.pb-table input:hover { border-color: var(--line); }
.pb-table input:focus { outline: 2px solid var(--green); outline-offset: -2px; }
.pb-table th.del, .pb-table td.del { width: 48px; padding: 0 4px 0 0; }
.pb-table td.add-cell { padding: 0; }
.in-sheet .table-wrap { margin: 0 -16px; }
.in-sheet .pb-table { min-width: 560px; }

.sample-card { display: flex; flex-direction: column; gap: 10px; }
.sample-card h2 { font-size: 14px; }
.sample-card .hint { font-size: 12px; line-height: 1.5; }
.sample-card .btn { align-self: flex-start; }

/* ---------- Landing (first-time visitors) ---------- */

/* The landing is the whole page for first-time visitors: nothing of the app behind or below it. */
html:not(.landing-mode) .landing { display: none !important; }
.landing-mode .topbar, .landing-mode main, .landing-mode .tabs { display: none !important; }
.landing { min-height: 100vh; }
.landing { background: var(--bg); }
.ld-hero {
  display: flex; flex-direction: column; gap: 18px;
  padding: 28px var(--gutter) 32px;
  background: var(--green); color: var(--white);
}
.ld-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.ld-brand .brand-mark { background: var(--white); }
.ld-brand .brand-mark svg { stroke: var(--green); }
.ld-hero h1 { max-width: 820px; font-size: 30px; line-height: 1.12; letter-spacing: -0.01em; }
.ld-lines { display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.45; }
.ld-lines li { position: relative; padding-left: 28px; opacity: 0.95; }
.ld-lines li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.ld-cta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ld-try { min-height: 52px; padding: 0 28px; border-radius: var(--r-card); background: var(--white); color: var(--green-dk); font-size: 17px; font-weight: 700; }
.ld-try:hover { background: var(--green-bg); }
.ld-cta p { font-size: 13px; opacity: 0.85; }
.ld-shot { width: min(300px, 82%); margin: 6px auto 0; }
.ld-shot img {
  display: block; width: 100%; height: auto;
  border: 6px solid rgba(255, 255, 255, 0.16); border-radius: 26px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  background: var(--bg);
}
.ld-faq { display: flex; flex-direction: column; gap: 8px; padding: 24px var(--gutter) 28px; }
.ld-faq h2 { font-size: 18px; margin-bottom: 4px; }
.ld-faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.ld-faq summary { min-height: var(--tap); display: flex; align-items: center; padding: 10px 14px; font-weight: 600; cursor: pointer; }
.ld-faq details p { padding: 0 14px 14px; color: var(--muted); line-height: 1.5; }
.ld-links { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* ---------- Jobs ---------- */

.jobs-grid, .jobs-side, .job-cards { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { color: inherit; text-decoration: underline; }
.strong { font-weight: 600; }

.margin-chip { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.margin-chip.good { background: var(--green-bg); color: var(--green-dk); }
.margin-chip.bad { background: #F6D9C8; color: var(--invoiced); }

.job-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); }
.job-card.is-under { background: var(--orange-bg); }
.jc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jc-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.jc-name small { color: var(--muted); font-size: 12px; font-weight: 400; }
.jc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.jc-nums div { display: flex; flex-direction: column; gap: 1px; }
.jc-nums dt { color: var(--muted); font-size: 11px; }
.jc-nums dd { margin: 0; font-size: 13px; }

.rate-box { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--white); border: 2px solid var(--green); border-radius: var(--r-card); }
.rate-box h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rate-box h2 svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; }
.rate-item { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.5; }
.rate-head { font-weight: 600; }
.rate-head.bad { color: var(--invoiced); }
.rate-head.good { color: var(--green-dk); }
.rate-tip { margin-top: 4px; padding: 10px; border-radius: var(--r-input); background: var(--head-bg); font-weight: 600; }
.rate-reprice { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); }
.rate-cta { align-self: flex-start; }

.type-bars { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.type-bars h2 { font-size: 15px; }
.type-bar { display: flex; flex-direction: column; gap: 6px; }
.tb-top { display: flex; justify-content: space-between; font-size: 13px; }
.tb-top b { font-weight: 600; }
.tb-track { position: relative; height: 10px; border-radius: 5px; background: var(--line-soft); }
.tb-fill { height: 100%; border-radius: 5px; background: var(--green); }
.tb-fill.under { background: #C8622F; }
.tb-target { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0.55; }
.type-bars .hint { font-size: 12px; }

/* ---------- Quote screen · phone (P1) ---------- */

.q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.q-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.q-grid, .q-main, .q-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.q-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.q-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px; }
.field-type, .more { grid-column: 1 / -1; }
.more summary { min-height: 32px; display: flex; align-items: center; color: var(--green); font-size: 12px; font-weight: 600; cursor: pointer; }
.more-grid { display: grid; gap: 8px; padding-top: 4px; }

.q-rooms { overflow: hidden; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.block-head .link-btn { margin-left: auto; }

.room-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  cursor: pointer;
}
.room-row:hover { background: var(--head-bg); }
.rr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rr-name { font-weight: 500; }
.rr-sub { font-size: 11px; color: var(--muted); }
.rr-num { display: flex; flex-direction: column; text-align: right; }
.rr-num b { font-weight: 600; }
.rr-num span { font-size: 11px; color: var(--muted); }

.add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.add-row svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }

.q-extras .block-head { padding: 0 14px; border: 0; }
.extras { display: flex; flex-direction: column; padding: 0 14px 6px; }
.extra-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.ex-name { flex: 1; min-width: 0; }
.ex-qty { color: var(--muted); }
.ex-total { font-weight: 600; }

/* Sticky price bar, sits on the tab bar */
.price-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  background: var(--green);
  color: var(--white);
}
.pb-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pb-left, .pb-right { display: flex; flex-direction: column; }
.pb-label, .pb-right { font-size: 11px; opacity: 0.85; }
.pb-right { text-align: right; }
.pb-price { font-size: 30px; font-weight: 700; line-height: 1.1; }
.pb-actions { display: flex; gap: 8px; }
.pb-actions .btn-light { flex: 1; }

/* Price card (desktop side + phone price details sheet) */
.price-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: var(--r-card);
  background: var(--green);
  color: var(--white);
}
.pc-label { font-size: 12px; opacity: 0.85; }
.pc-price { font-size: 34px; font-weight: 700; line-height: 1.1; }
.pc-sub { font-size: 13px; opacity: 0.9; }
.pc-note { font-size: 12px; opacity: 0.85; }
.pc-round { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; }
.pc-round label { opacity: 0.85; }
.pc-round > span:last-child { opacity: 0.85; }
.pc-money {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-input);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}
.pc-money input {
  width: 72px;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: 600 16px var(--font);
}
.pc-money input:focus { outline: none; }
.pc-money:focus-within { outline: 2px solid var(--white); outline-offset: 1px; }
.sheet-price { margin-top: 2px; }

.line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.line b { font-weight: 600; white-space: nowrap; }
.line.total { padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.line.total span { font-weight: 600; }
.line.total b { font-weight: 700; }

/* ---------- Tables (desktop) ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--head-bg); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
th, td { padding: 10px; }
th.num, td.num, th.calc, td.calc { text-align: right; }
tr > :first-child { padding-left: 18px; }
tr > :last-child { padding-right: 18px; }
tbody tr { border-top: 1px solid var(--line-soft); }

.room-table { min-width: 720px; font-size: 13px; }
.room-table th.calc { background: var(--line-soft); }
.room-table td.calc { background: var(--bg); color: var(--muted); }
.room-table td:not(.calc) { padding: 2px 4px; }
.room-table td.name { padding-left: 12px; }
.room-table input {
  width: 100%;
  min-width: 44px;
  min-height: var(--tap);
  padding: 6px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: 13px var(--font);
  text-align: right;
}
.room-table td.name input { min-width: 116px; text-align: left; font-weight: 500; }
.room-table input:hover { border-color: var(--line); }
.room-table input:focus { outline: 2px solid var(--green); outline-offset: -2px; }
.room-table th.del, .room-table td.del { width: 48px; padding: 0 4px 0 0; }
.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--r-input);
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.icon-btn:hover { background: var(--orange-bg); color: var(--orange); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.room-table td.add-cell { padding: 0; }
.add-inline {
  width: 100%;
  min-height: var(--tap);
  padding: 0 18px;
  border: 0;
  background: none;
  color: var(--faint);
  text-align: left;
  cursor: pointer;
}
.add-inline:hover { color: var(--green); background: var(--head-bg); }
.room-table tfoot tr { border-top: 2px solid var(--line); background: var(--head-bg); font-weight: 600; }

.list-table { min-width: 860px; font-size: 13px; }
.list-table td { padding: 9px 10px; }
.list-table th { padding: 9px 10px; }
.list-table tr > :first-child { padding-left: 18px; }
.list-table tr.is-current { background: var(--current-row); }
.list-table .muted, .list-table .muted a { color: var(--muted); }
.list-table a { text-decoration: none; }
.list-table a:hover { text-decoration: underline; }
.list-table .strong { font-weight: 500; }
.list-table td.num.strong { font-weight: 600; }
.list-table .late { color: var(--orange); font-weight: 500; }

/* ---------- Wide ---------- */

@media (min-width: 768px) {
  :root { --gutter: 28px; --pricebar-h: 0px; }

  body[data-route="quote"] main,
  main { padding: 24px var(--gutter) 48px; }

  h1 { font-size: 26px; }
  h2 { font-size: 15px; }
  .hint { font-size: 13px; }

  .topbar { gap: 16px; padding: 10px var(--gutter); }
  .brand { gap: 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .brand-mark svg { width: 18px; height: 18px; stroke-width: 2; }
  .brand-name { font-weight: 600; }

  .tabs {
    position: static;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
  }
  .tabs a {
    flex: none;
    flex-direction: row;
    gap: 0;
    padding: 0 14px;
    border-radius: var(--r-btn);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
  }
  .tabs a svg { display: none; }
  .tabs a:hover { background: var(--bg); color: var(--ink); }
  .tabs a[aria-current="page"] { background: var(--green); color: var(--white); font-weight: 600; }
  .tabs .phone-nav-only { display: none; }

  [data-screen], [data-quote-root] { gap: 20px; }

  .q-head { align-items: flex-end; flex-wrap: wrap; gap: 16px; }
  .q-titles { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 280px; }
  .lead { color: var(--muted); }
  .q-actions { display: flex; flex-wrap: wrap; gap: 8px; }

  .q-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

  /* One card holds details, rooms and extras, as in the desktop mock */
  .q-main {
    gap: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    overflow: hidden;
  }
  .q-block { border: 0; border-radius: 0; }
  .q-block + .q-block { border-top: 1px solid var(--line-soft); }

  .q-details { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; }
  .field-type { grid-column: auto; }
  .field label, .field .label { font-size: 11px; }
  .field input, .status-field { font-size: 13px; padding: 8px 10px; }
  .seg-btn { padding: 6px; }
  .more-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

  .block-head { justify-content: flex-start; padding: 12px 18px; }
  .q-extras .block-head { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
  .extras { padding: 0; }
  .extra-row { min-height: var(--tap); padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
  .extra-row:last-child { border-bottom: 0; }
  .extra-row:hover { background: var(--head-bg); }
  .ex-total { width: 80px; text-align: right; }
  .extras .empty { padding: 12px 18px; }

  .q-side { gap: 14px; }
  .cost-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
  .after-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
  .after-card .hint { line-height: 1.5; }
  .after-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .after-grid input { padding: 8px; }

  .all-quotes { padding: 0; overflow: hidden; }

  /* Today, desktop */
  [data-quotes-root], [data-today-root], [data-jobs-root], [data-settings-root] { gap: 20px; }
  .t-head { display: flex; flex-direction: column; gap: 4px; }
  .stats { gap: 14px; }
  .stat { gap: 6px; padding: 16px 18px; }
  .stat-label { font-size: 12px; }
  .stat-num { font-size: 28px; }
  .stat-num.collected { color: var(--ink); }
  .stat-sub { font-size: 12px; }
  .chase-table .block-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
  .chase-table .list-table td { padding: 12px; vertical-align: middle; }
  .chase-table .list-table tr > :first-child { padding-left: 18px; }
  .chase-table .list-table tr > :last-child { padding-right: 18px; }
  .chase-table .list-table { min-width: 900px; }

  /* Settings, desktop */
  .set-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .backup-card, .licence-card { padding: 18px; }
  .set-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .set-panel { padding: 18px; }
  .pb-card .block-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
  .sample-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 18px; }
  .sample-card .btn { align-self: center; flex: none; }
  .field select, .field textarea { font-size: 13px; }
  .rate-row input { font-size: 13px; }

  /* Landing, desktop */
  .ld-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto auto auto 1fr; column-gap: 56px; row-gap: 22px; align-items: start;
    padding: 56px max(var(--gutter), calc((100% - 1240px) / 2 + var(--gutter))) 56px;
  }
  .ld-hero > * { grid-column: 1; }
  .ld-hero > .ld-shot { grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 100%; margin: 0; }
  .ld-hero h1 { font-size: 46px; }
  .ld-lines { font-size: 18px; gap: 12px; }
  .ld-cta { flex-direction: row; align-items: center; gap: 18px; }
  .ld-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: start; max-width: 1240px; margin: 0 auto; padding: 32px var(--gutter) 40px; }
  .ld-faq h2, .ld-links { grid-column: 1 / -1; }

  /* Jobs, desktop */
  .jobs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .jobs-side { gap: 14px; }
  .jobs-table { padding: 0; overflow: hidden; }
  .jobs-table .block-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
  .jobs-table .list-table { min-width: 700px; }
  .jobs-table .list-table td { padding: 11px 10px; }
  .jobs-table .list-table tr > :first-child { padding-left: 18px; }
  .jobs-table .list-table tr > :last-child { padding-right: 18px; }
  .jobs-table tr.is-under { background: var(--orange-bg); }
  .rate-box, .type-bars { padding: 18px; }

  /* Quotes list, desktop */
  .ql-head .hint { font-size: 14px; }
  .ql-row { padding: 12px 18px; }
  .all-quotes .block-head { border-bottom: 0; }

  .sheet {
    width: min(460px, calc(100% - 32px));
    max-height: 85vh;
    margin: auto;
    border-radius: var(--r-card);
  }
  .sheet-body { padding: 22px 22px 20px; }
  .sheet:has(.send-sheet) { border-radius: var(--r-card); }
}

@media (min-width: 1100px) {
  .q-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .q-main { grid-column: span 2; }
  .jobs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jobs-table { grid-column: span 2; }
  .set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
