/* ===== App size controls — change these two numbers to resize the whole app =====
   --ui-zoom:    0.85 = whole app 15% smaller (spacing, buttons, boxes, text)
   --font-scale: 0.80 = text a further 20% smaller
   Set both to 1 to go back to the original size. Printed quotes are not affected. */
:root { --ui-zoom: 0.85; --font-scale: 0.8; }
html { font-size: calc(100% * var(--ui-zoom)); }
@media print { html { font-size: 100%; } :root { --ui-zoom: 1; --font-scale: 1; } }

/* Inter, served from our own server (no trip to Google Fonts). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter.woff2") format("woff2"); }
:root {
  --ink: #16213A;
  --ink-2: #2B3754;
  --paper: #EEF1F3;
  --surface: #FFFFFF;
  --line: #D3D9DF;
  --muted: #5A6577;
  --r-phase: #C0362C;
  --y-phase: #F2B705;
  --b-phase: #2453A6;
  --earth: #1D7A4C;
  --head: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", Roboto, system-ui, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 calc(16px * var(--ui-zoom, 1) * var(--font-scale, 1))/1.5 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--b-phase); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: calc(1.75rem * var(--font-scale, 1)); font-weight: 700; }
h2 { font-size: calc(1.25rem * var(--font-scale, 1)); font-weight: 600; }
h3 { font-size: calc(1.05rem * var(--font-scale, 1)); font-weight: 600; }
p { margin: 0 0 .75rem; }
small { font-size: calc(.8rem * var(--font-scale, 1)); }
code { background: var(--paper); padding: .1rem .3rem; border-radius: 4px; font-size: .85em; }
:focus-visible { outline: 3px solid var(--y-phase); outline-offset: 2px; }

/* The cable stripe: R, Y, B phases and earth */
.cable { display: flex; height: 5px; padding-top: env(safe-area-inset-top, 0px); background: var(--ink); }
.cable i { flex: 1; }
.cable i:nth-child(1) { background: var(--r-phase); }
.cable i:nth-child(2) { background: var(--y-phase); }
.cable i:nth-child(3) { background: var(--b-phase); }
.cable i:nth-child(4) { background: var(--earth); }

.top {
  position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; flex-wrap: wrap;
}
.brand { font: 700 calc(1.35rem * var(--font-scale, 1))/1 var(--head); color: inherit; text-decoration: none; letter-spacing: .01em; }
.brand::after { content: ""; display: inline-block; width: .45em; height: .45em; margin-left: .2em; border-radius: 50%; background: var(--y-phase); vertical-align: .1em; }
.brand.standalone { display: block; text-align: center; margin: 2rem 0 1rem; font-size: calc(1.8rem * var(--font-scale, 1)); color: var(--ink); }
.top .nav { display: flex; gap: .25rem; overflow-x: auto; order: 3; width: 100%; scrollbar-width: none; }
.top .nav a { color: #C9D2E3; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; white-space: nowrap; font-weight: 500; }
.top .nav a:hover { color: #fff; background: var(--ink-2); }
.top .out { margin-left: auto; color: #C9D2E3; font-size: calc(.9rem * var(--font-scale, 1)); }
@media (min-width: 760px) {
  .top .nav { order: 0; width: auto; }
}

.plan-bar { background: #FFF3C4; color: #5B4500; padding: .5rem 1rem; font-size: calc(.92rem * var(--font-scale, 1)); }
.plan-bar.ended { background: #FBE1DE; color: #7A1F17; }
.plan-bar a { color: inherit; font-weight: 600; }

.wrap { max-width: 980px; margin: 0 auto; padding: 1rem; }
.wrap.narrow { max-width: 440px; }
.page-title { margin: .5rem 0 1rem; }
.page-title small { font: 400 calc(1rem * var(--font-scale, 1)) var(--body); }
.muted { color: var(--muted); }
.small { font-size: calc(.88rem * var(--font-scale, 1)); }
.center { text-align: center; }
.block { display: block; }
.danger { color: var(--r-phase) !important; }
.warn { color: #8A6300; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
details.card > summary { cursor: pointer; font: 600 calc(1.1rem * var(--font-scale, 1)) var(--head); }
details.card[open] > summary { margin-bottom: .75rem; }
details.more summary { cursor: pointer; color: var(--b-phase); font-size: calc(.92rem * var(--font-scale, 1)); margin: .25rem 0 .5rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 5px solid var(--earth); background: #E3F2EA; }
.flash.err { border-left-color: var(--r-phase); background: #FBE1DE; }
.flash.reveal .cred { font: 500 calc(1.05rem * var(--font-scale, 1))/1.7 var(--head); margin: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--surface); color: var(--ink); font: 600 calc(1rem * var(--font-scale, 1)) var(--head); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--paper); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.ghost { border-color: var(--line); }
.btn.wa { background: #1F8B4C; border-color: #1F8B4C; color: #fff; }
.btn.small { min-height: 36px; padding: .3rem .7rem; font-size: calc(.92rem * var(--font-scale, 1)); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; padding: .25rem; color: var(--b-phase); font: inherit; cursor: pointer; text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }

/* forms */
.form label, .filter-bar label { display: flex; flex-direction: column; gap: .25rem; font-size: calc(.9rem * var(--font-scale, 1)); font-weight: 500; color: var(--ink-2); margin-bottom: .75rem; }
input, select, textarea {
  font: 400 calc(1rem * var(--font-scale, 1)) var(--body); color: var(--ink); background: #fff;
  border: 1px solid #B9C2CC; border-radius: 8px; padding: .55rem .65rem; min-height: 44px; width: 100%;
}
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--b-phase); outline: 2px solid rgba(36, 83, 166, .2); }
input:disabled, textarea:disabled, select:disabled { background: var(--paper); color: var(--muted); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; align-items: end; }
.grid-form > h2, .grid-form > h3, .grid-form > .span2, .grid-form > .form-actions { grid-column: 1 / -1; }
.grid-form.tight label { margin-bottom: .5rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
@media (min-width: 760px) {
  .grid-form { grid-template-columns: repeat(3, 1fr); }
  .grid-form.four { grid-template-columns: repeat(4, 1fr); }
  .grid-form .span2 { grid-column: span 2; }
  .grid-form > .form-actions { grid-column: auto; }
}
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form input[type=file] { flex: 1 1 220px; }
.filter-bar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-bar input { flex: 2 1 200px; }
.filter-bar select { flex: 1 1 140px; width: auto; }

/* dashboard */
.actions { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(3, 1fr); } }
.action {
  display: block; padding: 1rem 1rem 1rem 1.1rem; border-radius: var(--radius); text-decoration: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 6px solid var(--b-phase);
}
.action:nth-child(1) { border-left-color: var(--r-phase); }
.action:nth-child(2) { border-left-color: var(--y-phase); }
.action strong { display: block; font: 600 calc(1.2rem * var(--font-scale, 1)) var(--head); }
.action span { color: var(--muted); font-size: calc(.92rem * var(--font-scale, 1)); }
.action.disabled { opacity: .5; pointer-events: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.setup { border-left: 6px solid var(--y-phase); }

.quote-list { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quote-list li + li { border-top: 1px solid var(--line); }
.quote-list a { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; padding: .75rem 1rem; text-decoration: none; color: var(--ink); align-items: center; }
.quote-list a:hover { background: #F7F9FA; }
.qno { font: 600 calc(.95rem * var(--font-scale, 1)) var(--head); color: var(--muted); }
.qcust { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qcust small { display: block; color: var(--muted); }
.qamt, .num { font-family: var(--head); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.qamt { font-weight: 600; font-size: calc(1.05rem * var(--font-scale, 1)); }
.stats { margin-top: 1.5rem; }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.list-table { width: 100%; border-collapse: collapse; font-size: calc(.95rem * var(--font-scale, 1)); }
.list-table th { text-align: left; font: 600 calc(.85rem * var(--font-scale, 1)) var(--head); color: var(--muted); padding: .5rem; border-bottom: 2px solid var(--line); }
.list-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list-table tr.off td { opacity: .55; }
.row-btns { white-space: nowrap; text-align: right; }
.row-btns form, .admin-actions form { display: inline; }
.admin-actions select { width: auto; min-height: 36px; padding: .2rem .4rem; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }

/* rate card */
.disc-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.disc-row label { flex: 1 1 140px; }
.rate-controls label { margin-bottom: .5rem; }
.rate-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.rate-table th { font: 600 calc(1rem * var(--font-scale, 1)) var(--head); text-align: right; padding: .6rem .75rem; background: var(--ink); color: #fff; white-space: nowrap; }
.rate-table th:first-child { text-align: left; border-radius: 8px 0 0 0; }
.rate-table th:last-child { border-radius: 0 8px 0 0; }
.rate-table th small { display: block; font-weight: 500; color: var(--y-phase); }
.rate-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rate-table td:first-child { text-align: left; font: 600 calc(1rem * var(--font-scale, 1)) var(--head); }
.rate-table td b { font: 700 calc(1.15rem * var(--font-scale, 1)) var(--head); display: block; }
.rate-table td small { color: var(--muted); }
.rate-table td.na { color: var(--line); }
.rate-table tbody tr:nth-child(even) td { background: #F6F8F9; }
.share-row { margin-top: 1rem; }

/* editor */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.size-grid label { display: grid; grid-template-columns: 1fr 80px; align-items: center; gap: .5rem; margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; }
.size-grid span { font: 600 calc(1rem * var(--font-scale, 1)) var(--head); }
.size-grid span small { display: block; font: 400 calc(.78rem * var(--font-scale, 1)) var(--body); color: var(--muted); }
.size-grid input { text-align: center; font: 600 calc(1.1rem * var(--font-scale, 1)) var(--head); }
.search-add { position: relative; margin-bottom: .75rem; }
.s-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; list-style: none; margin: 0; padding: .25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(22, 33, 58, .16);
}
.s-results li.muted { padding: .6rem; }
.s-results button { display: flex; justify-content: space-between; gap: .75rem; width: 100%; text-align: left; padding: .6rem; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; border-radius: 6px; }
.s-results button:hover, .s-results button:focus { background: var(--paper); }
.s-results small { color: var(--muted); white-space: nowrap; font-family: var(--head); }

.lines { display: flex; flex-direction: column; gap: .5rem; }
.line { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; background: #FBFCFC; }
.line-top { display: flex; gap: .5rem; margin-bottom: .4rem; }
.line-top .l-name { font-weight: 500; }
.x { flex: 0 0 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: calc(1.4rem * var(--font-scale, 1)); color: var(--r-phase); cursor: pointer; }
.line-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; align-items: end; }
.line-nums label { display: flex; flex-direction: column; font-size: calc(.78rem * var(--font-scale, 1)); color: var(--muted); gap: .15rem; }
.line-nums input { padding: .4rem; min-height: 40px; font-family: var(--head); font-size: calc(1.05rem * var(--font-scale, 1)); }
.line-nums .chk { flex-direction: row; align-items: center; gap: .35rem; font-size: calc(.9rem * var(--font-scale, 1)); color: var(--ink); min-height: 40px; }
.line-nums .chk input { width: 20px; min-height: 20px; height: 20px; }
.l-amt { grid-column: span 2; text-align: right; font-family: var(--head); font-variant-numeric: tabular-nums; }
.l-amt small { display: block; color: var(--muted); }
.l-amt b { font-size: calc(1.2rem * var(--font-scale, 1)); }
@media (min-width: 760px) {
  .line-nums { grid-template-columns: 90px 120px 90px auto 1fr; }
  .l-amt { grid-column: auto; }
}
.summary dl, .doc-totals { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; margin: .5rem 0 0; font-variant-numeric: tabular-nums; }
.summary dd, .doc-totals dd { margin: 0; text-align: right; font-family: var(--head); font-size: calc(1.05rem * var(--font-scale, 1)); }
.summary .grand, .doc-totals .grand { font: 700 calc(1.3rem * var(--font-scale, 1)) var(--head); border-top: 2px solid var(--ink); padding-top: .3rem; }

body.has-totalbar main { padding-bottom: 6rem; }
.totalbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff;
}
.tb-amount small { display: block; color: #C9D2E3; font-size: calc(.8rem * var(--font-scale, 1)); }
.tb-amount strong { font: 700 calc(1.6rem * var(--font-scale, 1))/1 var(--head); color: var(--y-phase); font-variant-numeric: tabular-nums; }
.totalbar .btn.primary { background: var(--y-phase); color: var(--ink); border-color: var(--y-phase); min-width: 140px; }

/* quotation document */
.doc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.doc-actions form { display: inline; }
.doc {
  background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem; max-width: 900px; margin: 0 auto;
  font-size: calc(.92rem * var(--font-scale, 1));
}
.doc-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: .75rem; margin-bottom: .75rem; }
.doc-head p { margin: 0; }
.doc-company { font-size: calc(1.7rem * var(--font-scale, 1)); margin-bottom: .25rem; }
.doc-meta { text-align: right; }
.doc-meta h2 { font-size: calc(1.3rem * var(--font-scale, 1)); margin: 0; color: var(--b-phase); }
.doc-meta p { margin: 0; }
.doc-to { margin-bottom: .75rem; }
.doc-to h3, .doc-notes h3 { font-size: calc(.85rem * var(--font-scale, 1)); color: var(--muted); margin-bottom: .1rem; }
.doc-to p, .doc-notes p { margin: 0; white-space: pre-line; }
.doc-table, .hsn-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-table th, .hsn-table th { background: var(--paper); font: 600 calc(.82rem * var(--font-scale, 1)) var(--head); text-align: left; padding: .4rem; border-bottom: 1px solid var(--ink); }
.doc-table td, .hsn-table td { padding: .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th.num, .hsn-table th.num { text-align: right; }
.doc-bottom { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 680px) { .doc-bottom { grid-template-columns: 1.3fr 1fr; } }
.words { font-style: italic; margin-top: .5rem; }
.savings { color: var(--earth); font-weight: 600; margin-top: .75rem; }
.doc-notes { margin-top: .75rem; }
.doc-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.doc-foot .made { color: var(--muted); font-size: calc(.75rem * var(--font-scale, 1)); }
body.doc-page .wrap { max-width: 940px; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .cable, .top, .plan-bar, .no-print, .flash { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; font-size: 10.5pt; }
  .doc-bottom { grid-template-columns: 1.3fr 1fr; }
  .table-scroll { overflow: visible; }
  .doc-table tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* landing */
.landing .wrap { max-width: 1080px; }
.land-top { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0 1rem; }
.land-top .brand { color: var(--ink); font-size: calc(1.6rem * var(--font-scale, 1)); }
.hero { display: grid; gap: 2rem; padding: 1.5rem 0 2.5rem; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 1fr; padding: 3rem 0 4rem; } }
.hero h1 { font-size: calc(clamp(2rem, 5vw, 3.2rem) * var(--font-scale, 1)); font-weight: 700; line-height: 1.05; max-width: 16ch; }
.hero p { font-size: calc(1.1rem * var(--font-scale, 1)); max-width: 46ch; color: var(--ink-2); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.ratecard-demo { margin: 0; background: var(--ink); color: #fff; border-radius: 14px; padding: 1.1rem 1.1rem .6rem; transform: rotate(-1.2deg); }
.ratecard-demo figcaption { font: 600 calc(1.15rem * var(--font-scale, 1)) var(--head); color: var(--y-phase); margin-bottom: .5rem; }
.ratecard-demo table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ratecard-demo th { font: 500 calc(.9rem * var(--font-scale, 1)) var(--head); color: #C9D2E3; text-align: right; padding: .35rem .5rem; border-bottom: 1px solid #3A4766; }
.ratecard-demo th:first-child, .ratecard-demo td:first-child { text-align: left; }
.ratecard-demo th small { display: block; color: var(--y-phase); }
.ratecard-demo td { font: 600 calc(1.2rem * var(--font-scale, 1)) var(--head); text-align: right; padding: .45rem .5rem; border-bottom: 1px solid #2B3754; }
.ratecard-demo td:first-child { font-weight: 500; font-size: calc(1rem * var(--font-scale, 1)); color: #C9D2E3; }
.land-grid { display: grid; gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .land-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; } }
.land-grid p { color: var(--ink-2); max-width: 52ch; }
.pricing { padding: 2rem 0; border-top: 1px solid var(--line); }
.plans { display: grid; gap: 1rem; margin: 1rem 0 1.5rem; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.plan.best { border: 2px solid var(--ink); }
.plan h3 { margin: 0; }
.plan .price { font: 700 calc(2.2rem * var(--font-scale, 1)) var(--head); margin: .25rem 0; }
.land-foot { padding: 2rem 0 3rem; color: var(--muted); font-size: calc(.9rem * var(--font-scale, 1)); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .ratecard-demo { transform: none; } }

/* fixes */
[hidden] { display: none !important; }
.doc-totals { column-gap: 0; }
.doc-totals dd { padding-left: 1rem; }
@media (max-width: 520px) {
  .rate-table th, .rate-table td { padding: .5rem .4rem; }
  .rate-table td b { font-size: calc(1.05rem * var(--font-scale, 1)); }
  .rate-table td:first-child { font-size: calc(.92rem * var(--font-scale, 1)); }
  .card { padding: .85rem; }
  .wrap { padding: .75rem; }
  .size-grid { grid-template-columns: 1fr 1fr; }
  .size-grid label { grid-template-columns: 1fr 58px; padding: .35rem .4rem; }
  .size-grid input { padding: .3rem; }
  .top .nav a { padding: .35rem .45rem; }
}

/* home: the two quote choices */
.choose { display: grid; gap: .9rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .choose { grid-template-columns: 1fr 1fr; } }
.choice {
  position: relative; display: block; padding: 1.25rem 1.25rem 1.25rem 4.6rem; min-height: 120px;
  border-radius: 14px; text-decoration: none; color: #fff; background: var(--ink);
}
.choice.dynamic { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); }
.choice-no {
  position: absolute; left: 1.1rem; top: 1.1rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center; font: 700 calc(1.5rem * var(--font-scale, 1)) var(--head); background: var(--y-phase); color: var(--ink);
}
.choice.dynamic .choice-no { background: var(--ink); color: #fff; }
.choice strong { display: block; font: 700 calc(1.6rem * var(--font-scale, 1))/1.1 var(--head); margin-bottom: .3rem; }
.choice span:last-child { display: block; font-size: calc(.95rem * var(--font-scale, 1)); opacity: .85; max-width: 34ch; }
.choice.wire { border-bottom: 6px solid var(--y-phase); }
.choice.disabled { opacity: .5; pointer-events: none; }

/* ============ one look for the whole app (matches the Wire Quotation design) ============ */
:root {
  --ink: #1A1207;
  --ink-2: #3A2E1F;
  --paper: #F4EFE6;
  --surface: #FFFFFF;
  --line: #E4DACB;
  --muted: #7A6A52;
  --r-phase: #C2412A;
  --y-phase: #E4572E;
  --b-phase: #B9461F;
  --earth: #2E7D4F;
  --accent: #E4572E;
  --frame: #FBF7F0;
  --head: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --body: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
}
body { font-size: calc(15.5px * var(--ui-zoom, 1) * var(--font-scale, 1)); }
h1 { font-weight: 800; letter-spacing: -.02em; }
h2, h3 { font-weight: 700; }
.cable { display: none; }
.top { background: var(--ink); padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); }
.top .nav a { color: #CBBDA9; }
.top .nav a:hover, .top .nav a.on { color: #fff; background: #2E2416; }
.top .out { color: #CBBDA9; }
.brand::after { background: var(--accent); }
.card { border-radius: 16px; }
.btn { border-radius: 999px; font-family: var(--body); font-weight: 700; border-color: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #CF4B25; }
.btn.ghost { background: transparent; }
input, select, textarea { border-color: var(--line); background: var(--frame); border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(228, 87, 46, .2); }
.flash { border-radius: 12px; }
.flash.ok { background: #EAF4EE; border-left-color: var(--earth); }
.flash.err { background: #FBEEE9; border-left-color: var(--accent); }
.plan-bar { background: #FCE3DA; color: #7A2A12; }
.action, .choice { border-radius: 16px; }
.choice.wire { border-bottom-color: var(--accent); }
.choice-no { background: var(--accent); color: #fff; }
.choice.dynamic .choice-no { background: var(--ink); }
.quote-list { border-radius: 16px; }
.qno { font-family: var(--body); }
.qamt, .num, .l-amt, .tb-amount strong, .summary dd, .doc-totals dd { font-family: var(--body); }
.rate-table th { background: var(--ink); }
.rate-table th small { color: #F7A487; }
.totalbar { background: var(--ink); }
.totalbar .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-amount strong { color: #fff; }
.doc-meta h2 { color: var(--accent); }
.home-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.page-title small { font-family: var(--body); }
details.card > summary h2.inline { display: inline; font-size: calc(1.05rem * var(--font-scale, 1)); }
details.card > summary { list-style-position: inside; }
.lines-head { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }

/* ---------- header: home logo + price lists + settings ---------- */
.top { gap: .5rem; flex-wrap: nowrap; }
.home-logo { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; font-size: calc(1.15rem * var(--font-scale, 1)); letter-spacing: -.01em; flex-shrink: 0; }
.home-logo img { display: block; border-radius: 10px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.topnav .pill { color: #FFF9F1; text-decoration: none; font-weight: 600; font-size: calc(.88rem * var(--font-scale, 1)); padding: .45rem .8rem; border-radius: 999px; border: 1px solid #4A3B28; white-space: nowrap; }
.topnav .pill:hover, .topnav .pill.on { background: #2E2416; border-color: #6A563B; }
.topnav .gear { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #CBBDA9; border: 1px solid #4A3B28; }
.topnav .gear:hover, .topnav .gear.on { color: #fff; background: #2E2416; }
@media (max-width: 430px) {
  .home-logo span { display: none; }
  .topnav .pill { padding: .42rem .7rem; font-size: calc(.84rem * var(--font-scale, 1)); }
}
.title-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.title-row .page-title { margin-bottom: .75rem; }

/* home: just the two choices */
.wrap.home { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 140px); max-width: 760px; }
.home-choose .choice { min-height: 150px; padding-top: 1.6rem; padding-bottom: 1.6rem; }
.home-choose .choice strong { font-size: calc(1.8rem * var(--font-scale, 1)); }

/* scan a list (dynamic quote) */
.scan-card { border: 2px dashed var(--line); }
.scan-head p { margin: 0 0 .7rem; }
.scan-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.scan-btns .btn { min-height: 48px; }
.scan-busy { display: flex; align-items: center; gap: .6rem; color: var(--muted); padding: .5rem 0; }
.scan-spin { width: 18px; height: 18px; flex: none; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: scanspin .8s linear infinite; }
@keyframes scanspin { to { transform: rotate(360deg); } }
body.scan-locked { overflow: hidden; }
.scan-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(26, 18, 7, .55); display: flex; align-items: flex-end; justify-content: center; }
.scan-sheet { background: var(--paper); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0;
  padding: 1.1rem 1rem 0; }
@media (min-width: 800px) { .scan-overlay { align-items: center; } .scan-sheet { border-radius: 20px; } }
.scan-sheet h2 { margin-bottom: .2rem; }
.scan-warn { background: #FBEEE9; border: 1px solid #F0C9BC; color: #A6462B; border-radius: 9px; padding: .6rem .8rem; font-size: calc(.88rem * var(--font-scale, 1)); margin: .6rem 0; }
.scan-cust { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .7rem 0; }
.scan-cust label, .scan-line label { display: flex; flex-direction: column; font-size: calc(.8rem * var(--font-scale, 1)); color: var(--muted); gap: .2rem; }
.scan-cust input, .scan-line input, .scan-line select { font: inherit; font-size: calc(.95rem * var(--font-scale, 1)); min-height: 42px; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
.scan-line { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .7rem; margin-bottom: .55rem; }
.scan-line.need { border-color: #F0C9BC; box-shadow: inset 4px 0 0 #E4572E; }
.scan-line.off { opacity: .45; }
.scan-read { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; font-size: calc(.85rem * var(--font-scale, 1)); color: var(--muted); margin-bottom: .4rem; }
.scan-read b { color: var(--ink); font-weight: 600; }
.scan-read .x { border: 0; background: none; font-size: calc(1.3rem * var(--font-scale, 1)); line-height: 1; color: var(--muted); cursor: pointer; padding: 0 .2rem; }
.scan-grid { display: grid; grid-template-columns: 1fr 5.5rem; gap: .5rem; }
.scan-custom { display: grid; grid-template-columns: 1fr 6.5rem; gap: .5rem; margin-top: .5rem; }
.scan-flag { display: inline-block; margin-top: .4rem; background: #FBEEE9; border: 1px solid #F0C9BC; color: #A6462B; font-size: calc(.74rem * var(--font-scale, 1)); font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.scan-foot { position: sticky; bottom: 0; display: flex; gap: .6rem; justify-content: flex-end; background: var(--paper);
  padding: .7rem 0 calc(.8rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) { .scan-spin { animation-duration: 2.4s; } }

/* admin: scan key */
.pill-on, .pill-off { display: inline-block; vertical-align: middle; font: 700 calc(.75rem * var(--font-scale, 1))/1 var(--body); padding: .3rem .55rem; border-radius: 999px; margin-left: .3rem; }
.pill-on { background: #E3F2EA; color: #1D7A4C; }
.pill-off { background: #FBE1DE; color: #7A1F17; }
.scan-key-form { display: flex; gap: .6rem; flex-wrap: wrap; margin: .3rem 0 .5rem; }
.scan-key-form input { flex: 1 1 260px; min-height: 46px; font: inherit; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 10px; }

/* admin: scans per customer, publishing */
.scan-cell { min-width: 9.5rem; }
.scan-cell .ok-text { color: #1D7A4C; font-weight: 600; }
.scan-add { display: flex; gap: .35rem; align-items: center; margin-top: .35rem; flex-wrap: wrap; }
.scan-add select, .scan-add input { font: inherit; font-size: calc(.85rem * var(--font-scale, 1)); min-height: 34px; padding: .15rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 6.2rem; }
.publish-form label { display: flex; flex-direction: column; gap: .3rem; }
.publish-form select { font: inherit; min-height: 46px; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.publish-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0 .4rem; }
.scan-month { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0 .4rem; }
.scan-month > div { background: var(--paper, #FBF7F0); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; display: flex; flex-direction: column; }
.scan-month b { font-size: calc(1.25rem * var(--font-scale, 1)); }
.scan-plans-h { margin: 1rem 0 .4rem; }

/* customer dashboard: LiveScan + price updates */
.home-extra { display: grid; gap: .8rem; margin-top: 1rem; }
.ls-card { display: flex; gap: .9rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ls-card h2 { margin: 0; font-size: calc(1.1rem * var(--font-scale, 1)); }
.ls-card h2 .ls-mark { color: var(--accent); }
.ls-meter { flex: 1 1 100%; height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.ls-meter i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.ls-card .ls-num { font-weight: 800; font-size: calc(1.05rem * var(--font-scale, 1)); }
.ls-card.out { border: 1px solid #F0C9BC; background: #FFF8F4; }
.update-card { border: 1px solid #BFE0CC; background: #F1FAF4; }
.update-card h2 { margin: 0 0 .25rem; font-size: calc(1.05rem * var(--font-scale, 1)); }
.update-card form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.scan-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.scan-title h2 { margin: 0; }
.ls-mark { color: var(--accent); }
.ls-left { background: #E3F2EA; color: #1D7A4C; font-weight: 700; font-size: calc(.78rem * var(--font-scale, 1)); padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.ls-left.low { background: #FBEEE9; color: #A6462B; }
.scan-card.out { border-color: #F0C9BC; background: #FFF8F4; }
.scan-out p { margin: 0 0 .6rem; }
.scan-out .btn { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.scan-out .muted { margin: .5rem 0 0; text-align: center; }
.land-ls { grid-column: 1 / -1; background: #1A1207; color: #FFF9F1; border-radius: 16px; padding: 1.1rem 1.2rem; }
.land-ls p { color: rgba(255, 249, 241, .82); margin-bottom: 0; }
.land-ls .ls-mark { color: #F2B705; }
.plan-ls { font-weight: 700; color: var(--accent); margin-top: .4rem; }

/* quotation view on phones: keep the page layout and shrink it to fit */
.doc-fitbox { overflow: hidden; }
.doc-fit { transform-origin: 0 0; }
@media screen and (max-width: 640px) {
  .doc-fit .doc { width: 600px; max-width: none; }
  .doc-fit .doc .table-scroll { overflow: visible; }
  .doc-fit .doc .doc-bottom { grid-template-columns: 1.3fr 1fr; }
}
@media print {
  .doc-fit { transform: none !important; }
  .doc-fitbox { height: auto !important; overflow: visible; }
  .doc-fit .doc { width: auto; }
}

/* =====================================================================
   EMERALD RESERVE theme: deep emerald, brass, DM Serif Display headings.
   Screen only. Quotation documents stay white paper (see .doc below).
   ===================================================================== */
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/dm-serif-display.woff2") format("woff2"); }
@media screen {
  :root {
    color-scheme: dark;
    --ink: #F1ECDF; --ink-2: #D6D0C2; --paper: #0E2621; --surface: #133129; --line: #2B4A40;
    --muted: #A9B8AE; --r-phase: #F0A08F; --y-phase: #C2A061; --b-phase: #D9BC82; --earth: #7FD1A6;
    --accent: #C2A061; --frame: #0E2621;
    --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
    --deep: #0A1D19; --raised: #183A31;
  }
  body { background: var(--paper); color: var(--ink); }
  h1, h2, .page-title, .choice strong, .plan .price, .pl-h { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
  h1 { font-size: calc(2rem * var(--font-scale, 1)); }
  h2 { font-size: calc(1.35rem * var(--font-scale, 1)); }
  a, .link, details.more summary { color: var(--b-phase); }
  code { background: var(--raised); }
  option { background: #133129; color: #F1ECDF; }

  .top { background: var(--deep); border-bottom: 1px solid var(--line); }
  .home-logo { color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: calc(1.3rem * var(--font-scale, 1)); letter-spacing: 0; }
  .top .nav a, .top .out { color: var(--muted); }
  .top .nav a:hover, .top .nav a.on { color: var(--ink); background: var(--raised); }
  .topnav .pill { color: var(--ink); border-color: var(--line); }
  .topnav .pill:hover, .topnav .pill.on { background: var(--raised); border-color: var(--accent); }
  .topnav .gear { color: var(--muted); border-color: var(--line); }
  .topnav .gear:hover, .topnav .gear.on { color: var(--accent); background: var(--raised); }

  .plan-bar { background: rgba(194, 160, 97, .14); color: #E5CF9E; }
  .plan-bar.ended { background: rgba(240, 160, 143, .14); color: #F5B7A9; }
  .flash, .flash.ok { background: rgba(127, 209, 166, .10); border-left-color: var(--earth); color: var(--ink); }
  .flash.err { background: rgba(240, 160, 143, .12); border-left-color: var(--r-phase); }
  .warn { color: #E9C46A; }

  .card { background: var(--surface); border-color: var(--line); }
  .btn { background: var(--surface); color: var(--ink); border-color: var(--line); }
  .btn:hover { background: var(--raised); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #0E2621; }
  .btn.primary:hover { background: #D9BC82; border-color: #D9BC82; }
  .btn.ghost { background: transparent; }
  .btn.wa { background: #1F8B4C; border-color: #1F8B4C; color: #fff; }
  .btn.ghost.danger { border-color: rgba(240, 160, 143, .4); }

  input, select, textarea { background: #0E2621; color: var(--ink); border-color: var(--line); }
  input::placeholder, textarea::placeholder { color: #7F9187; }
  input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(194, 160, 97, .3); }
  input:disabled, textarea:disabled, select:disabled { background: var(--surface); color: var(--muted); }
  input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

  /* home */
  .choice, .choice.dynamic { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
  .choice.wire { border-bottom: 1px solid var(--line); }
  .choice:hover { border-color: var(--accent); }
  .choice-no, .choice.dynamic .choice-no { background: transparent; color: var(--accent); border: 1px solid var(--accent);
    font: 400 calc(1.35rem * var(--font-scale, 1))/1 var(--serif); }
  .action { background: var(--surface); border-color: var(--line); border-left-color: var(--accent); }
  .action:nth-child(1), .action:nth-child(2), .setup { border-left-color: var(--accent); }
  .quote-list { background: var(--surface); border-color: var(--line); }
  .quote-list a:hover { background: var(--raised); }
  .ls-meter { background: var(--line); }
  .ls-left { background: rgba(127, 209, 166, .14); color: #7FD1A6; }
  .ls-left.low { background: rgba(240, 160, 143, .14); color: #F5B7A9; }
  .ls-card.out, .scan-card.out { background: rgba(240, 160, 143, .06); border-color: rgba(240, 160, 143, .35); }
  .update-card { background: rgba(127, 209, 166, .07); border-color: rgba(127, 209, 166, .35); }

  /* tables, editor */
  .rate-table th { background: var(--deep); color: var(--ink); }
  .rate-table th small { color: var(--accent); }
  .rate-table tbody tr:nth-child(even) td { background: #112D26; }
  .list-table th { color: var(--muted); }
  .s-results { background: var(--surface); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
  .line { background: #112D26; }
  .x { background: transparent; color: var(--r-phase); }
  .summary .grand { border-top-color: var(--accent); }
  .totalbar { background: var(--deep); border-top: 1px solid var(--line); }
  .tb-amount small { color: var(--muted); }
  .tb-amount strong { color: var(--ink); font-family: var(--serif); font-weight: 400; }
  .totalbar .btn.primary { background: var(--accent); border-color: var(--accent); color: #0E2621; }

  /* LiveScan + reviews */
  .scan-card { border-color: var(--line); }
  .scan-overlay { background: rgba(4, 14, 11, .72); }
  .scan-line { background: var(--surface); }
  .scan-cust input, .scan-line input, .scan-line select { background: #0E2621; color: var(--ink); }
  .scan-line.need { border-color: rgba(240, 160, 143, .45); box-shadow: inset 4px 0 0 var(--r-phase); }
  .scan-warn, .scan-flag { background: rgba(240, 160, 143, .12); border-color: rgba(240, 160, 143, .35); color: #F5B7A9; }

  /* admin */
  .pill-on { background: rgba(127, 209, 166, .14); color: #7FD1A6; }
  .pill-off { background: rgba(240, 160, 143, .14); color: #F5B7A9; }
  .scan-cell .ok-text { color: #7FD1A6; }
  .scan-add select, .scan-add input, .publish-form select, .scan-key-form input { background: #0E2621; color: var(--ink); }
  .scan-month > div { background: #0E2621; }

  /* landing */
  .land-top .brand, .brand.standalone { color: var(--ink); font-family: var(--serif); font-weight: 400; }
  .brand::after { background: var(--accent); }
  .ratecard-demo { background: var(--deep); border: 1px solid var(--line); }
  .ratecard-demo figcaption { color: var(--accent); font-family: var(--serif); font-weight: 400; }
  .ratecard-demo th { color: var(--muted); border-bottom-color: var(--line); }
  .ratecard-demo td { border-bottom-color: var(--line); }
  .ratecard-demo td:first-child { color: var(--muted); }
  .plan.best { border: 1px solid var(--accent); }
  .land-ls { background: var(--deep); border: 1px solid var(--accent); }
  .land-ls .ls-mark { color: var(--accent); }
  .hero p, .land-grid p { color: var(--ink-2); }

  /* quotation documents keep their white-paper look on screen */
  .doc {
    --ink: #1A1207; --ink-2: #3A2E1F; --paper: #F2EFE8; --surface: #FFFFFF; --line: #E2DACC; --muted: #6B5D48;
    --accent: #1F5A4A; --earth: #2E7D4F; --b-phase: #1F5A4A; --r-phase: #B23A28;
    background: #fff; color: var(--ink); color-scheme: light;
  }
  .doc h1, .doc h2, .doc h3 { font-family: var(--body); font-weight: 700; }
  .doc-meta h2 { color: #1F5A4A; }
}
/* printed quotations: the same emerald title as on screen */
.doc-meta h2 { color: #1F5A4A; }
.plan .price small { font: 400 calc(.95rem * var(--font-scale, 1)) var(--body); color: var(--muted); margin-left: .2rem; }

/* billing */
.bill-now { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bill-now > div { display: flex; flex-direction: column; gap: .15rem; }
.bill-now b { font: 400 calc(1.5rem * var(--font-scale, 1)) var(--serif, var(--body)); }
.bill-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: .6rem; }
.bill-opt { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.bill-opt.best { border-color: var(--accent); }
.bill-opt .btn { margin-top: .5rem; }
.bill-price { font: 400 calc(1.9rem * var(--font-scale, 1))/1.1 var(--serif, var(--body)); }
.bill-price small { font: 400 calc(.9rem * var(--font-scale, 1)) var(--body); color: var(--muted); }
.upd-status { margin: .6rem 0 0; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); }
.upd-status.busy { color: var(--muted); }
.upd-status.ok { color: #7FD1A6; border-color: rgba(127, 209, 166, .4); }
.upd-status.bad { color: #F5B7A9; border-color: rgba(240, 160, 143, .4); }
.check-row { flex-direction: row !important; align-items: flex-start; gap: .6rem !important; }
.check-row input { width: 20px; min-height: 20px; height: 20px; margin-top: .15rem; flex: none; }

/* bottom tab bar on phones (the top buttons stay on wider screens) */
.tabbar { display: none; }
@media screen and (max-width: 759px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--deep, #0A1D19); border-top: 1px solid var(--line); padding: .3rem .2rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 52px;
    text-decoration: none; color: var(--muted); font-size: calc(.7rem * var(--font-scale, 1)); font-weight: 600; text-align: center; line-height: 1.1; }
  .tabbar a.on { color: var(--accent); }
  body:has(.tabbar) main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
  body:has(.tabbar) .topnav { display: none; }
  body.has-totalbar .tabbar, body.doc-page .tabbar, body.scan-locked .tabbar { display: none; }
  body.has-totalbar .topnav, body.doc-page .topnav { display: flex; }
}
@media print { .tabbar { display: none !important; } }

/* switch price-list import */
.ii-file { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.ii-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; justify-content: space-between; }
.ii-head b { font: 400 calc(1.3rem * var(--font-scale, 1)) var(--serif, var(--body)); }
.ii-head .muted { overflow-wrap: anywhere; }
.ii-gst { display: flex !important; flex-direction: row !important; gap: .55rem; align-items: flex-start; padding: .6rem .7rem; border-radius: 9px;
  background: rgba(233, 196, 106, .08); border: 1px solid rgba(233, 196, 106, .4); color: #EBD9A6; font-size: calc(.88rem * var(--font-scale, 1)); margin: .5rem 0; }
.ii-gst input { width: 18px; min-height: 18px; height: 18px; margin-top: .2rem; flex: none; }
.ii-gst small { display: block; margin-top: .3rem; color: #CDBB86; }
.ii-show { display: flex; gap: 1rem; flex-wrap: wrap; margin: .4rem 0; font-size: calc(.9rem * var(--font-scale, 1)); }
.ii-show label { display: flex; gap: .35rem; align-items: center; }
.ii-show input { width: 18px; min-height: 18px; height: 18px; }
.ii-t { width: 100%; border-collapse: collapse; font-size: calc(.88rem * var(--font-scale, 1)); }
.ii-t th { text-align: left; font-size: calc(.72rem * var(--font-scale, 1)); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .3rem .4rem; }
.ii-t td { padding: .35rem .4rem; border-top: 1px solid var(--line); vertical-align: top; }
.ii-t td input { width: 20px; min-height: 20px; height: 20px; }
.ii-t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ii-t tr.changed td { background: rgba(233, 196, 106, .10); }
.ii-t tr.changed .pct { color: #E9C46A; font-weight: 700; }
.ii-t tr.new td { background: rgba(127, 209, 166, .08); }
.ii-t tr.new .pct { color: #7FD1A6; font-weight: 700; }
.ii-t tr.same td { color: var(--muted); }

/* admin: the big "update prices" entry */
.ap-hero { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; padding: 1.1rem 1.2rem; border-radius: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--accent); color: var(--ink); }
.ap-hero:hover { background: var(--raised, #183A31); }
.ap-hero > span:first-child { font-size: calc(2rem * var(--font-scale, 1)); }
.ap-hero > span:nth-child(2) { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.ap-hero b { font: 400 calc(1.35rem * var(--font-scale, 1)) var(--serif, var(--body)); }
.ap-hero small { color: var(--muted); font-size: calc(.9rem * var(--font-scale, 1)); }
.ap-hero > span:last-child { font-size: calc(2rem * var(--font-scale, 1)); color: var(--accent); }

/* scan review: the photo, to compare */
.scan-photo { display: flex; align-items: center; gap: .8rem; width: 100%; margin: .6rem 0; padding: .5rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--muted); font: inherit; font-size: calc(.88rem * var(--font-scale, 1)); cursor: zoom-in; text-align: left; }
.scan-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.scan-zoom { position: fixed; inset: 0; z-index: 120; background: #050E0B; display: flex; flex-direction: column; }
.scan-zoom[hidden] { display: none; }
.scan-zoom > .btn, .scan-zoom > .wq-btn { margin: calc(.6rem + env(safe-area-inset-top, 0px)) .6rem .6rem auto; min-height: 44px; }
.scan-zoom-img { flex: 1; overflow: auto; touch-action: pan-x pan-y pinch-zoom; }
.scan-zoom-img img { display: block; width: 160%; max-width: none; }
@media (min-width: 900px) { .scan-zoom-img img { width: 100%; } }
.scan-mem { color: #7FD1A6; font-style: normal; font-size: calc(.78rem * var(--font-scale, 1)); font-weight: 700; }
.ii-t tr.warn td { background: rgba(240, 160, 143, .12) !important; }
.ii-t tr.warn .pct { color: #F5B7A9; }

/* your codes (O01, OP2…) and brand change */
.tc-chip { display: inline-block; font: 600 calc(.72rem * var(--font-scale, 1))/1 var(--body, inherit); letter-spacing: .02em; padding: .22rem .4rem;
  border-radius: 6px; background: transparent; color: var(--accent); border: 1px solid var(--accent);
  vertical-align: middle; white-space: nowrap; }
.line-top .tc-chip { align-self: center; margin-right: .35rem; }
.l-warn { margin: .35rem 0 0; font-size: calc(.85rem * var(--font-scale, 1)); color: var(--accent); }
.tc-warn { color: var(--accent); }
.tc-pick { display: flex; align-items: center; gap: .35rem; margin-top: .3rem; font-size: calc(.8rem * var(--font-scale, 1)); }
.tc-pick select { font-size: calc(.8rem * var(--font-scale, 1)); padding: .15rem .3rem; max-width: 14rem; }
.tc-pick.tc-check { color: var(--accent); font-weight: 600; }
.sw-out { margin: .5rem 0; }
.code-card h2 { margin-top: 0; }
.code-grid label span { display: flex; flex-direction: column; font-size: calc(.85rem * var(--font-scale, 1)); }
.code-grid label.pad-off { opacity: .45; }
.choice-card .grid-form label[hidden] { display: none; }

/* step-by-step questions after a scan */
.wiz h2 { margin: .2rem 0 .8rem; }
.wiz-opts { display: grid; gap: .6rem; margin: .5rem 0 1rem; }
.wiz-opt { width: 100%; justify-content: center; padding: .9rem 1rem; font-size: calc(1.05rem * var(--font-scale, 1)); }
.wiz-num { width: 100%; font-size: calc(1.4rem * var(--font-scale, 1)); padding: .7rem; }
.wiz-foot { display: flex; gap: .6rem; justify-content: space-between; margin-top: 1rem; position: sticky; bottom: 0; background: inherit; padding: .5rem 0; }
.wiz-list { display: grid; gap: .5rem; }
.wiz-row { display: grid; grid-template-columns: 1fr 5.5rem; gap: .5rem; align-items: center; padding: .55rem; border: 1px solid var(--line); border-radius: 10px; }
.wiz-row select { width: 100%; margin-top: .3rem; font-size: calc(.85rem * var(--font-scale, 1)); }
.wiz-row input { font-size: calc(1.05rem * var(--font-scale, 1)); text-align: right; }
.wiz-sec { margin: .9rem 0 .45rem; font-size: calc(.8rem * var(--font-scale, 1)); letter-spacing: .06em; text-transform: uppercase; color: var(--muted, inherit); }

.gst-note { margin: .8rem 0 0; font-weight: 600; font-size: calc(.9rem * var(--font-scale, 1)); }

/* simple price update page */
.pe-table { border-collapse: collapse; min-width: 100%; }
.pe-table th, .pe-table td { padding: .3rem .35rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.pe-table th:first-child, .pe-table td.pe-name { text-align: left; white-space: normal; min-width: 9.5rem; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pe-table input { width: 5.6rem; text-align: right; padding: .35rem .4rem; }
.pe-table input.pe-changed { outline: 2px solid var(--accent); }
.pe-pct input { width: 5rem; margin: 0 .3rem; }
.pe-bar { justify-content: space-between; align-items: center; }
.pe-card h2 { margin-top: 0; }
.ranges-card .range-list { display: grid; gap: .5rem; }
.ranges-card .range-list a { display: flex; justify-content: space-between; align-items: center; }
.admin-ranges { margin-top: .4rem; }
.admin-ranges .rgrid { display: grid; gap: .2rem; margin: .4rem 0; }

textarea.l-name { resize: none; min-height: 2.6rem; line-height: 1.3; font: inherit; font-weight: 500; overflow: hidden; }
#s-results .tc-chip { margin-right: .25rem; }

/* one calm "Add your list" card */
details.choice-card > summary { cursor: pointer; list-style: none; }
details.choice-card > summary::-webkit-details-marker { display: none; }
details.choice-card > summary::after { content: "Change"; float: right; font-size: calc(.85rem * var(--font-scale, 1)); color: var(--accent); }
details.choice-card[open] > summary::after { content: "Close"; }
#ch-sum { display: block; margin-top: .15rem; }
.summary .gst-note { margin: .5rem 0 0; font-size: calc(.85rem * var(--font-scale, 1)); }

/* compact line: qty, rate, disc and amount in one row */
.line-nums { grid-template-columns: .8fr 1fr .8fr 1.2fr; gap: .35rem; }
.line-nums .l-amt { grid-column: auto; align-self: end; padding-bottom: .3rem; }
.line-nums .l-amt b { font-size: calc(1.05rem * var(--font-scale, 1)); }
.line-sub { display: flex; justify-content: space-between; align-items: center; margin-top: .25rem; }
.line-sub .chk { display: flex; flex-direction: row; align-items: center; margin: 0; gap: .35rem; font-size: calc(.82rem * var(--font-scale, 1)); color: var(--muted); }
.line-sub .chk input { width: 18px; height: 18px; min-height: 18px; }
.line-sub .l-net { color: var(--muted); }
@media (min-width: 760px) { .line-nums { grid-template-columns: 100px 130px 100px 1fr; } }
.card .line .line-sub label.chk { display: flex; flex-direction: row; align-items: center; gap: .35rem; margin: 0; }
.card .line .line-sub label.chk input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 0; padding: 0; }
.card .line .line-sub label.chk { font-size: calc(.82rem * var(--font-scale, 1)); color: var(--muted); white-space: nowrap; }

/* ---------- quote page cards, same look as the wire quote: LiveScan → codes → additional items → quote */
.qs-card { padding: 1rem 1.1rem; margin-bottom: .85rem; }
.qs-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.qs-label { margin: 0; font: 800 calc(.8rem * var(--font-scale, 1))/1.2 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.qs-count { letter-spacing: .02em; text-transform: none; font-weight: 600; }
.qs-two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.qs-two[hidden] { display: none; }
.qs-drop { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 11px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1.5px dashed var(--accent); color: var(--accent);
  font: 700 calc(.98rem * var(--font-scale, 1)) var(--body); padding: .4rem; }
.qs-pill { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .45rem 1rem; font: 700 calc(.9rem * var(--font-scale, 1)) var(--body); color: var(--ink); cursor: pointer; white-space: nowrap; }
.qs-quick { width: 100%; min-height: 50px; padding: .65rem .9rem; border-radius: 10px; border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent); font: 400 calc(1.02rem * var(--font-scale, 1)) var(--body); color: var(--ink); }
.qs-empty { color: var(--muted); font-size: calc(.92rem * var(--font-scale, 1)); margin: .1rem 0 0; }
.qs-empty[hidden] { display: none; }
.qs-codes { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; font-size: calc(.82rem * var(--font-scale, 1)); color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .7rem; }
.qs-codes[hidden] { display: none; }
.qs-codes b { color: var(--accent); margin-right: .25rem; }
.qs-card .search-add { margin-bottom: 0; }
.qs-card .muted.small { margin: .6rem 0 0; }
.scan-card.qs-card { border: 1px solid var(--line); }
.scan-card .scan-busy { min-height: 52px; }

.code-boq { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: stretch; }
.code-boq .tc-warn, .code-boq .qs-empty { grid-column: 1 / -1; margin: 0; }
.cb-list { grid-column: 1 / -1; display: grid; gap: .4rem; margin-top: .15rem; }
.cb-list[hidden], .cb-next[hidden] { display: none; }
.cb-row { display: grid; grid-template-columns: auto 1fr 4.2rem auto; gap: .6rem; align-items: center; padding: .45rem .55rem;
  border: 1px solid var(--line); border-radius: 10px; }
.cb-row .cb-nm { font-size: calc(.92rem * var(--font-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-row input { min-height: 2.3rem; padding: .2rem .4rem; text-align: center; }
.cb-row .cb-x { background: none; border: 0; font-size: calc(1.25rem * var(--font-scale, 1)); line-height: 1; padding: .3rem .45rem; color: var(--muted); cursor: pointer; }
.cb-next { grid-column: 1 / -1; width: 100%; min-height: 50px; margin-top: .25rem; }
.title-row { margin-bottom: .9rem; }
details.qs-card > summary { display: block; }
details.qs-card > summary .qs-label { display: inline; }
details.qs-card[open] > summary { margin-bottom: .7rem; }
details.qs-card { position: relative; }
details.qs-card > summary .qs-label, details.qs-card > summary h2.qs-label { font: 800 calc(.8rem * var(--font-scale, 1))/1.2 var(--body); letter-spacing: .09em; color: var(--muted); }
details.qs-card > summary { padding-right: 4.5rem; }
details.qs-card > summary::after { position: absolute; right: 1.1rem; top: 1rem; float: none; font: 700 calc(.85rem * var(--font-scale, 1)) var(--body); }
.doc-fit .sheet { max-width: 760px; margin: 0 auto; }
@media screen and (max-width: 640px) { .doc-fit .sheet { width: 440px; max-width: none; } }
@media print { .doc-fit .sheet { width: auto; } }

/* ---------- admin: customers first, renewals on top, settings folded away */
.cu-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
.cu-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .7rem .85rem; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 calc(.82rem * var(--font-scale, 1)) var(--body); text-align: left; }
.cu-tile b { font: 400 calc(1.6rem * var(--font-scale, 1))/1.1 var(--serif, var(--body)); }
.cu-tile span { color: var(--muted); }
.cu-tile.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cu-tile.warn b { color: #E5A54B; }
.cu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .85rem; }
.cu-actions .btn { justify-content: center; min-height: 48px; }
.cu-search { margin-bottom: .7rem; }
.cu-list { display: grid; gap: .6rem; }
.cu-row { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .85rem; }
.cu-row[hidden] { display: none; }
.cu-row.due { border-color: color-mix(in srgb, #E5A54B 55%, var(--line)); }
.cu-row.off { opacity: .65; }
.cu-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.cu-name { font-size: calc(1.02rem * var(--font-scale, 1)); }
.cu-badge { flex: none; font: 700 calc(.74rem * var(--font-scale, 1)) var(--body); padding: .22rem .6rem; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.cu-badge.warn { color: #E5A54B; border-color: #E5A54B; }
.cu-badge.bad, .cu-badge.off { color: #E57B6B; border-color: #E57B6B; }
.cu-sub { margin: .3rem 0 .6rem; color: var(--muted); font-size: calc(.84rem * var(--font-scale, 1)); line-height: 1.4; }
.cu-do { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cu-renew { display: flex; gap: .5rem; flex: 1; min-width: 0; }
.cu-renew select { flex: 1; min-width: 0; min-height: 40px; padding: .3rem .5rem; }
.cu-do .btn.small { min-height: 40px; padding: .35rem .95rem; }
.cu-do .wa { background: #1F8B4C; border-color: #1F8B4C; color: #fff; }
.cu-more { margin-top: .55rem; }
.cu-more > summary { cursor: pointer; color: var(--accent); font: 600 calc(.86rem * var(--font-scale, 1)) var(--body); list-style: none; }
.cu-more > summary::-webkit-details-marker { display: none; }
.cu-more > summary::after { content: " ▾"; }
.cu-more[open] > summary::after { content: " ▴"; }
.cu-more-in { display: grid; gap: .6rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: calc(.86rem * var(--font-scale, 1)); }
.cu-line { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cu-inline { display: flex; gap: .4rem; align-items: center; }
.cu-inline select, .cu-inline input { width: auto; max-width: 7.5rem; min-height: 36px; padding: .2rem .45rem; }
.cu-links { justify-content: flex-start; gap: 1.2rem; }
.cu-ranges > summary { cursor: pointer; color: var(--muted); }
.cu-ranges .rgrid { margin: .5rem 0; }
.cu-set-h { font: 800 calc(.8rem * var(--font-scale, 1))/1.2 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .6rem; }
details.cu-set > summary { cursor: pointer; }
details.cu-set > summary .pill-on, details.cu-set > summary .pill-off { margin-left: .4rem; vertical-align: middle; }

/* a line that can't be saved yet: no price or no quantity */
.line.need { border-color: #E5A54B !important; }
.line[data-need="rate"] input[data-f="rate"], .line[data-need="qty"] input[data-f="qty"] { border-color: #E5A54B; }
.l-need { margin: .35rem 0 0; color: #E5A54B; font-size: calc(.86rem * var(--font-scale, 1)); font-weight: 600; }
.l-need[hidden], .need-msg[hidden] { display: none; }
.need-msg { margin: 0 0 .6rem; padding: .55rem .75rem; border-radius: 10px; border: 1px solid #E5A54B; color: #E5A54B;
  background: color-mix(in srgb, #E5A54B 10%, transparent); font-size: calc(.9rem * var(--font-scale, 1)); font-weight: 600; }

/* earlier versions of a quote: for the shop only */
.rev-note { margin: 0 0 .8rem; padding: .7rem .85rem; border-radius: 10px; border: 1px solid #E5A54B; color: #E5A54B; font-size: calc(.92rem * var(--font-scale, 1)); line-height: 1.45; }
.rev-note a { color: inherit; font-weight: 700; display: inline-block; margin-top: .3rem; }
.rev-list { margin: 0 0 .8rem; font-size: calc(.9rem * var(--font-scale, 1)); color: var(--muted); }
.rev-list summary { cursor: pointer; }
.rev-list ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.rev-list li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; }
.rev-list a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* switch prices: delete a range, or the whole list */
.range-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.range-row form { display: contents; }
.range-row .range-del { min-width: 48px; justify-content: center; padding: 0 .8rem; }
.btn.danger { color: #E57B6B; border-color: color-mix(in srgb, #E57B6B 55%, transparent); }
.danger-zone > summary { cursor: pointer; color: #E57B6B; font-weight: 600; }
.danger-zone .inline-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.danger-zone input { flex: 1; min-width: 9rem; }

/* wires inside a dynamic quote */
.wc-codes span { white-space: nowrap; }
.wc-set { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr 1fr .9fr; gap: .5rem; margin-top: .2rem; }
.wc-set[hidden] { display: none; }
.wc-set label { font-size: calc(.78rem * var(--font-scale, 1)); color: var(--muted); display: grid; gap: .2rem; }
.wc-set select, .wc-set input { min-height: 40px; padding: .3rem .45rem; }
#wc-grade-w[hidden] { display: none; }
.cb-row.wc-row { grid-template-columns: auto 1fr 4.2rem auto; }
.cb-row .wc-miss { color: #E5A54B; font-size: calc(.78rem * var(--font-scale, 1)); display: block; }
@media (max-width: 420px) { .wc-set { grid-template-columns: 1fr 1fr; } }
.cb-row.wc-row .cb-nm { white-space: normal; line-height: 1.3; }

.scan-zoom-img img + img { margin-top: 10px; }

/* admin: one customer's page */
.cu-name { color: var(--ink); text-decoration: none; font-weight: 700; }
.cu-name span { color: var(--accent); }
.ac-back { margin: 0 0 .4rem; } .ac-back a { color: var(--accent); text-decoration: none; font-weight: 600; }
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.ac-head .page-title { margin: 0; }
.ac-big { margin: 0 0 .7rem; font-weight: 600; }
.ac-wide { width: 100%; justify-content: center; min-height: 48px; margin-top: .4rem; }
.ac-quotes li { display: flex; justify-content: space-between; gap: .6rem; }
.qs-card .cu-line + .cu-line { margin-top: .5rem; }
a.qs-pill { text-decoration: none; color: var(--ink); }

/* iPhone zooms the page in when you tap a box with text under 16px — keep typing boxes at 16px there. */
@supports (-webkit-touch-callout: none) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}

/* =====================================================================
   CALM LAYOUT: more breathing room, fewer heavy outlines.
   Screen only; printed quotes are not touched.
   ===================================================================== */
@media screen {
  /* room at the screen edges and between sections */
  .wrap { padding: 18px 16px 28px; }
  .card { padding: 18px 16px; margin-bottom: 14px; border-color: rgba(43, 74, 64, .55); box-shadow: none; }
  .card h2 { margin-bottom: 12px; }
  .page-title { margin: 6px 0 18px; }
  .page-title small { display: block; margin-top: 6px; color: var(--muted); }

  /* forms: one clear gap between fields, softer boxes */
  .form label { gap: 6px; margin-bottom: 14px; color: var(--muted); }
  .grid-form { column-gap: 12px; }
  input, select, textarea { border-color: rgba(43, 74, 64, .7); background: var(--deep, var(--frame)); }
  .form-actions, .row-actions { gap: 10px; }
  .form-actions { margin-top: 4px; }

  /* folded sections (e.g. "+ Add an item") */
  details.card.fold > summary { color: var(--accent); list-style: none; }
  details.card.fold > summary::-webkit-details-marker { display: none; }
  details.card.fold[open] > summary { display: none; }
  details.card.fold > form { margin: 0; }

  /* Account shortcuts as a simple tappable list */
  .link-list { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .link-list a { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px;
    color: var(--ink); text-decoration: none; font-weight: 500; }
  .link-list a + a { border-top: 1px solid rgba(43, 74, 64, .55); }
  .link-list a::after { content: "\203A"; color: var(--muted); font-size: 1.3em; line-height: 1; }
  .link-list a:hover { background: var(--raised, var(--surface)); }
  .logout-row { margin-top: 26px; }

  /* wire rate card: space between Brand and the discount boxes */
  .rate-controls > label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; color: var(--muted); }
  .rate-controls .disc-row label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
}

/* QUOTE SCREEN: calmer item lines */
@media screen {
  .lines { gap: 10px; }
  .line { padding: 12px; border-color: rgba(43, 74, 64, .7); }
  .line-top { align-items: flex-start; margin-bottom: 8px; }
  /* item name reads as text; shows a box only while you edit it */
  .line .l-name { border-color: transparent; background: transparent; padding: 4px 2px; font-weight: 600; resize: none; }
  .line .l-name:focus { border-color: var(--accent); background: var(--deep, var(--frame)); padding: 4px 8px; }
  .line .x { border: 0; background: transparent; color: var(--muted); min-width: 36px; min-height: 36px; font-size: 1.4em; line-height: 1; }
  .line .x:hover { color: var(--r-phase); }
  .line-nums label { gap: 4px; }
  .line-sub { margin-top: 8px; }
  #summary { margin-top: 14px; }
}

/* FOLLOW-UP list on Home + "opened" notes */
@media screen {
  .follow-card h2 { margin-bottom: 4px; }
  .follow-list { list-style: none; margin: 12px 0 0; padding: 0; }
  .follow-list li { padding: 14px 0; border-top: 1px solid rgba(43, 74, 64, .55); }
  .fu-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink); text-decoration: none; }
  .fu-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fu-meta { margin: 4px 0 10px; color: var(--muted); font-size: calc(.88rem * var(--font-scale, 1)); }
  .seen { color: var(--earth, #7FD1A6); font-weight: 600; }
  .quote-list .seen { display: block; }
  .fu-meta .seen, .fu-meta .not-seen { display: block; margin-top: 2px; }
  .fu-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
  .fu-later { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px 4px; }
  .seen-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(127, 209, 166, .08);
    color: var(--ink); font-size: calc(.9rem * var(--font-scale, 1)); }
}

/* sales tracking status labels (quote list, settings) */
.qstatus { display: inline-block; margin: .2rem .4rem 0 0; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid currentColor; color: var(--muted); }
.qstatus.qs-won { color: #3FA66B; } .qstatus.qs-lost { color: #D46A5A; } .qstatus.qs-expired { color: #B9952F; } .qstatus.qs-following { color: #5B9BD5; }

/* sales tracking: call list, report, customer page */
.follow-list .late { color: #D46A5A; font-weight: 700; }
.fu-why { margin: .25rem 0 .4rem; font-size: calc(.85rem * var(--font-scale, 1)); opacity: .85; }
.fu-rec { margin-top: .45rem; }
.fu-rec summary { list-style: none; display: inline-block; cursor: pointer; }
.fu-rec summary::-webkit-details-marker { display: none; }
.fu-form { display: grid; gap: .45rem; margin-top: .5rem; max-width: 26rem; }
.fu-form label { display: flex; gap: .5rem; align-items: center; }
.attn-card { border-color: #D46A5A; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.kpi { display: block; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.kpi b { display: block; font-size: 1.35rem; }
.kpi small { display: block; color: var(--muted); }
.bars { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .45rem; }
.bars li { display: grid; gap: .2rem; }
.bars .bar { height: 8px; border-radius: 6px; background: #D46A5A; opacity: .75; }
.bars a { color: inherit; }
.def { font-size: calc(.8rem * var(--font-scale, 1)); color: var(--muted); }
.table-wrap { overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: calc(.9rem * var(--font-scale, 1)); }
.team-table th, .team-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.team-table th:first-child, .team-table td:first-child { text-align: left; }
.range-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 1rem; }
.filter-note { margin: 0 0 .8rem; }

/* quotes: customer name and mobile first, then the rest of the quote */
body.need-cust .gated { display: none !important; }
.cust-gate { margin: .6rem 0 0; font-size: calc(.9rem * var(--font-scale, 1)); color: #E5A54B; }
.follow-list .nx { margin: .35rem 0 .5rem; padding: .55rem .65rem; border-radius: 10px; border: 1px dashed rgba(127,127,127,.55); }
.follow-list .nx-t { margin: 0 0 .4rem; line-height: 1.35; }
.follow-list .nx-tag { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.follow-list .nx-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.follow-list .nx-dismiss { display: inline; }
.follow-list .nx-dismiss .link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; opacity: .8; font: inherit; }
.qstatus.qs-partial { color: #9C7FD6; }

/* after saving, the row you edited is brought back into view and glows for a moment */
[id^="item-"], [id^="wp-"], #status, #calls { scroll-margin-top: 84px; }
tr.just-saved > td, li.just-saved { animation: lq-saved 2.4s ease-out; }
@keyframes lq-saved { 0%, 35% { background: rgba(212, 175, 55, .28); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.just-saved > td, li.just-saved { animation: none; background: rgba(212, 175, 55, .2); } }
/* settings: a tick box with its explanation beside it */
label.check { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 .8rem; line-height: 1.4; }
label.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; flex: none; }

/* bigger taps for small buttons */
.btn.small { min-height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; }
