/* Rive Clair Estimation — styles (tablet first: iPad Pro, phone and desktop). */
/* Fonts served with the app (SIL OFL, fonts/OFL-barlow.txt): no call to Google, same look without internet. */
@font-face { font-family: Barlow; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/barlow-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/barlow-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
/* Design system (owner, Nov 19, 2026: "rework our estimation app to make it more premium and polished and easier to
   use"; "Looks plain / not premium"): navy and blue with the brand orange #fe5e00 as the accent, never pink or peach;
   soft layered shadows, larger corners, Barlow and Barlow Condensed; iPad first, touch targets of 44px or more. */
:root {
  --deep: #0b2a4d; --deep-2: #103a69;
  --blue: #12508f; --blue-dark: #0b3766; --blue-soft: #ebf2fa; --blue-line: #c6d8ee;
  --orange: #fe5e00; --orange-dark: #c74a00; --orange-soft: #fff6e0;
  --ink: #102036; --muted: #5a6a7e; --faint: #8796a8; --line: #e0e7ef; --line-2: #d3dce7; --bg: #f3f6fa; --card: #fff;
  /* (Nov 25, 2026, the dark screens) the same colours as before, named so the dark version can change them; --paper: the
     white behind the product drawings and catalogue pictures (white in both versions) */
  --paper: #fff; --blue-ink: #12508f; --blue-ink-2: #0b3766; --hover: #f7faff; --sunk: #f6f8fb; --sunk-2: #fafbfc; --line-soft: #eef1f5; --chip: #eef1f5;
  --text-2: #2b3b50; --text-3: #46566a; --warn-line: #f2d699; --warn-ink: #6c4500; --hover-line: #b9c6d6; --glass: rgba(255, 255, 255, .96);
  --side-end: #fbfcfe; --ok-line: #b9dfc7; --err-line: #d9a9a3; --ok-ink: #1f6b3a; --err-ink: #b3261e;
  --ok: #1d7a45; --ok-soft: #e5f4eb; --warn: #9a6200; --warn-soft: #fff4dc; --err: #b42318; --err-soft: #f1f3f6;
  --radius: 16px; --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 32, 54, .06);
  --shadow: 0 1px 2px rgba(16, 32, 54, .05), 0 2px 6px rgba(16, 32, 54, .04), 0 10px 24px -8px rgba(16, 32, 54, .08);
  --shadow-lg: 0 2px 6px rgba(16, 32, 54, .08), 0 18px 48px -10px rgba(16, 32, 54, .28);
  --ring: 0 0 0 4px rgba(18, 80, 143, .16);
  --tap: 44px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
/* iPad (owner, Oct 23, 2026: "moving too much when zooming in"): no text enlarged by Safari when the iPad turns, no
   double-tap zoom on buttons (pinch zoom still works) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { font: 16px/1.45 Barlow, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Barlow Condensed", Barlow, sans-serif; letter-spacing: .01em; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
/* the app's type scale (the printed pages keep theirs: they are outside #app) */
:where(#app) h1 { font-size: 34px; letter-spacing: .005em; line-height: 1.12; }
:where(#app) h2 { font-size: 23px; } :where(#app) h3 { font-size: 19px; }
a { color: var(--blue-ink); }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.big { font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; font-weight: 700; font-size: 32px; line-height: 1.1; color: var(--ink); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(254, 94, 0, .55); outline-offset: 2px; }

/* --- top bar: deep navy, a thin orange line under it */
.top { position: sticky; top: 0; z-index: 30; background: linear-gradient(180deg, var(--deep-2) 0%, var(--deep) 100%); color: #fff;
  padding: env(safe-area-inset-top) 16px 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 6px 20px -8px rgba(8, 28, 52, .55); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--orange) 0%, rgba(254, 94, 0, 0) 60%); opacity: .9; }
.top-in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .07em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: #fe5e00; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px -2px rgba(254, 94, 0, .45); }
.brand-mark svg { display: block; }
.brand small { font-weight: 600; letter-spacing: .03em; opacity: .7; font-size: 16px; }
.nav { display: flex; gap: 2px; margin-left: 10px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #c9d8ea; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; min-height: 40px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.badge-n { background: var(--orange); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.top .spacer { flex: 1; }
.userbtn { background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .12); color: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; display: flex; gap: 8px; align-items: center; cursor: pointer; min-height: 44px; }
.userbtn:hover { background: rgba(255, 255, 255, .16); }
/* the moon / sun button: dark or light screens in one tap (owner, Nov 25, 2026) */
.theme-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .12); transition: background .15s; }
.theme-btn:hover { background: rgba(255, 255, 255, .16); }
.theme-btn svg { display: block; }
:root[data-theme="dark"] .theme-btn { color: #ffd27a; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.menu { position: absolute; right: 16px; top: 64px; background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line); min-width: 270px; padding: 8px; z-index: 50; }
.menu button, .menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 44px; }
.menu button:hover, .menu a:hover { background: var(--blue-soft); }
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-theme { padding: 8px 12px 10px; display: grid; gap: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0; }
.menu-theme .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.menu-theme .seg button { width: auto; text-align: center; padding: 0 8px; min-height: 40px; border: 1px solid var(--line-2); }

/* --- page */
.page { max-width: 1280px; margin: 0 auto; padding: 26px 20px 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 + .muted { margin-top: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h2 { margin-bottom: 12px; }
.section-title { font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-ink); margin: 0 0 10px; }

/* --- buttons: secondary (white), primary (blue), accent (orange), ghost, danger */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:hover { border-color: var(--blue-line); background: var(--hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, #1a5fa6 0%, var(--blue) 100%); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(11, 55, 102, .25), 0 6px 14px -6px rgba(18, 80, 143, .55); }
.btn.primary:hover { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%); }
.btn.accent { background: linear-gradient(180deg, #ff6d17 0%, var(--orange) 55%, #f05800 100%); border-color: #f05800; color: #fff; box-shadow: 0 1px 2px rgba(180, 64, 0, .3), 0 6px 14px -6px rgba(254, 94, 0, .6); }
.btn.accent:hover { background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%); }
/* a disabled orange or blue button turns grey (a faded orange would look peach; owner: never pink or peach) */
.btn.accent:disabled, .btn.primary:disabled { background: #b9c4d1; border-color: #b9c4d1; color: #fff; opacity: 1; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err-line); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn .ic { font-size: 18px; line-height: 1; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; box-shadow: 0 0 0 3px rgba(254, 94, 0, .18); }

/* --- form */
label.f, .f { display: grid; gap: 6px; align-content: start; }
.f > span:first-child, .lab { font-size: 14px; font-weight: 600; color: var(--muted); }
.req::after { content: " *"; color: var(--orange); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: var(--tap); padding: 9px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--card); outline: none;
  box-shadow: inset 0 1px 2px rgba(16, 32, 54, .04); transition: border-color .15s, box-shadow .15s;
}
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--hover-line); }
/* a quiet chevron on the selects */
select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6a7e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
select:not([multiple]):disabled { background-color: var(--bg); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--ring); }
select:disabled, input:disabled { background: var(--bg); color: var(--faint); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; user-select: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.check:hover:not(.dis) { border-color: var(--blue-line); }
.check input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; flex: none; }
.check.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.check.dis { opacity: .55; cursor: not-allowed; }
.check .price-tag { margin-left: auto; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; font-weight: 600; color: var(--text-2);
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.seg button:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--blue-line); background: var(--hover); }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, #1a5fa6 0%, var(--blue) 100%); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(11, 55, 102, .25), 0 4px 10px -4px rgba(18, 80, 143, .5); }
.seg button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
/* calmer hints: small and grey; a long one shows two lines and opens with its ⓘ (owner, Nov 19, 2026) */
.hint { font-size: 13px; line-height: 1.4; color: var(--faint); }
.hint.long { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; cursor: pointer; }
.hint.long.open { display: block; -webkit-line-clamp: unset; }
.hint.long::before { content: 'ⓘ '; color: var(--blue-ink); font-weight: 700; }
/* egress status in the window form (Nov 19, 2026): the exit-sign logo when the window is big enough */
.egress-status { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.egress-status.ok { color: var(--ok-ink); }
.egress-logo-ui svg { display: block; }
.egress-hint.ok { color: var(--ok-ink); }
.egress-hint.bad { color: var(--err-ink); }

/* --- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; letter-spacing: .01em; }
.chip.draft, .chip.sent, .chip.accepted, .chip.lost { padding-left: 9px; }
.chip.draft::before, .chip.sent::before, .chip.accepted::before, .chip.lost::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.draft { background: var(--chip); color: var(--text-3); }
.chip.sent { background: var(--blue-soft); color: var(--blue-ink); }
.chip.accepted { background: var(--ok-soft); color: var(--ok); }
.chip.lost { background: #f1eeee; color: #7b6b6b; }
.chip.pending, .chip.follow { background: var(--warn-soft); color: var(--warn); }
.chip.follow { border-color: var(--warn-line); }
.chip.approved { background: var(--ok-soft); color: var(--ok); }
.chip.declined { background: var(--err-soft); color: var(--err); }
.chip.lang { background: var(--card); color: var(--text-3); border-color: var(--line-2); padding: 2px 8px; }

/* --- messages */
.msg { border-radius: 10px; padding: 10px 12px; font-size: 14.5px; display: grid; gap: 4px; }
.msg.err { background: var(--card); color: var(--err); border: 1px solid var(--line); border-left: 4px solid var(--err); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.info { background: var(--blue-soft); color: var(--blue-ink-2); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
/* items built from the plans and not checked yet (the asterisk, Oct 20, 2026): white with an orange bar */
.msg.todo-msg { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); }
.todo-star { color: var(--orange); font-weight: 800; }
.todo-box { margin-top: 6px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.todo-box b { color: var(--orange-dark); }
.todo-box ul { margin: 4px 0 6px; padding-left: 18px; }
.plans-build { display: grid; gap: 6px; }
.msg ul { margin: 0; padding-left: 18px; }
.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-start; }
.banner.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); }

/* --- quotes list */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 360px; padding-left: 40px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%238796a8' stroke-width='2'/%3E%3Cpath d='M20 20l-4-4' stroke='%238796a8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 13px center; }
.qlist { display: grid; gap: 10px; }
.qrow { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px 18px; text-decoration: none; color: inherit; position: relative;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.qrow:hover { border-color: var(--blue-line); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.qrow::after { content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); opacity: 0; transition: opacity .15s; }
.qrow:hover::after { opacity: 1; }
.qstat { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.qstat .zone-dot { width: 12px; height: 12px; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.qno { font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; font-weight: 700; font-size: 20px; color: var(--blue-ink); letter-spacing: .01em; }
.qno small { display: block; font-family: Barlow, system-ui, sans-serif; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.qclient { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qtotal { font-weight: 700; font-size: 19px; text-align: right; min-width: 104px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* --- quote editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 76px; }
.lines { display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; padding: 14px; align-items: start; }
.line .thumb { background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fa 100%); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.line .thumb svg { width: 100%; height: auto; display: block; }
.line .loc { font-weight: 700; font-size: 17px; }
.line .desc { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--text-2); display: grid; gap: 2px; }
.line .amt { text-align: right; display: grid; gap: 4px; min-width: 120px; }
.line .amt .big { font-size: 19px; font-weight: 700; font-family: inherit; }
.line .acts { display: flex; gap: 4px; justify-content: flex-end; margin-top: 6px; }
.addbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.addbtn { min-height: 68px; border: 1.5px dashed var(--blue-line); background: #fbfdff; border-radius: var(--radius); cursor: pointer; font-weight: 700; font-size: 16.5px; color: var(--blue-ink); display: grid; place-items: center; gap: 2px; padding: 10px; text-align: center;
  transition: background .15s, border-color .15s, box-shadow .15s; }
.addbtn:hover:not(:disabled) { background: var(--blue-soft); border-color: var(--blue); border-style: solid; box-shadow: var(--shadow); }
.addbtn small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.addbtn:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; background: var(--sunk-2); }
.totals { display: grid; gap: 4px; }
.totals .t { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.totals .t.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 22px; font-weight: 700; font-family: "Barlow Condensed", Barlow, sans-serif; letter-spacing: .01em; }
.totals .t.sub { color: var(--muted); font-size: 15px; }
.disc { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; margin: 8px 0; }
.disc input { text-align: right; font-weight: 700; }
.comm { background: var(--orange-soft); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.comm b { font-size: 20px; color: var(--orange-dark); }
.adminbox { background: var(--sunk); border: 1px dashed var(--blue-line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; font-size: 15px; }
.adminbox .t { display: flex; justify-content: space-between; }

/* --- configurator (full screen sheet) */
.sheet { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto 1fr; }
.sheet-head { background: var(--glass); border-bottom: 1px solid var(--line); padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 14px -10px rgba(16, 32, 54, .35); position: relative; z-index: 2; }
.sheet-head h2 { flex: 1; }
.sheet-body { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.cfg-form { overflow-y: auto; padding: 20px 20px 140px; display: grid; gap: 16px; align-content: start; -webkit-overflow-scrolling: touch; }
.cfg-side { border-left: 1px solid var(--line); background: linear-gradient(180deg, var(--card) 0%, var(--side-end) 100%); overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.cfg-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; display: grid; gap: 14px; box-shadow: var(--shadow); }
/* cleaner section headers (owner, Nov 19, 2026): the step number in a soft blue square, a hairline under the title */
.cfg-sec h3 { display: flex; align-items: center; gap: 12px; font-size: 20px; padding-bottom: 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line-soft); }
.cfg-sec h3 .n { width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue-line); display: inline-grid; place-items: center; font-size: 15px; font-weight: 700; font-family: Barlow, system-ui, sans-serif; flex: none; }
.drawing { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow-xs); }
.drawing svg { width: 100%; height: auto; display: block; }
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.design { border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); padding: 6px 6px 8px; cursor: pointer; display: grid; gap: 4px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
.design:hover:not(:disabled):not([aria-pressed="true"]) { border-color: var(--blue-line); box-shadow: var(--shadow); }
.design svg { width: 100%; height: auto; display: block; }
.design[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(18, 80, 143, .16), var(--shadow); }
.design small { font-weight: 500; color: var(--muted); font-size: 12px; }
.design-grp { display: grid; gap: 6px; margin-bottom: 10px; }
.design-grp .grp { font-weight: 700; font-size: 13px; color: var(--muted); }
.designs-sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.designs-sm .design { font-size: 13px; padding: 5px 5px 7px; }
.design:disabled { cursor: not-allowed; }
.door-tile img { display: block; height: 150px; width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.designs-sm .door-tile img { height: 112px; }
.door-draw { display: block; height: 112px; } .door-draw svg { height: 100%; width: auto; margin: 0 auto; display: block; }
.design.soon { border-style: dashed; background: var(--sunk-2); }
.design.soon .why { color: var(--muted); font-weight: 600; }
.glass-tiles .design img { display: block; height: 128px; width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.glass-more, .hw-more { margin-top: 10px; } .glass-more summary, .hw-more summary { cursor: pointer; font-weight: 700; color: var(--blue-ink); padding: 6px 0; }
.glass-more .designs, .hw-more .designs { margin-top: 8px; }
.glass-pic { display: flex; gap: 12px; align-items: center; text-align: left; margin-top: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: zoom-in; width: 100%; font: inherit; color: var(--ink); }
.glass-pic img { height: 120px; width: auto; display: block; }
.glass-pic span { display: grid; gap: 2px; } .glass-pic small { color: var(--muted); }
.door-pics { display: flex; gap: 10px; justify-content: center; }
.door-pics button { display: grid; gap: 4px; justify-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 6px 8px; cursor: zoom-in; font: inherit; color: var(--ink); }
.door-pics img { height: 150px; width: auto; display: block; }
.door-pics small { font-size: 12px; color: var(--muted); }
/* the door hardware pictures (owner, Nov 19, 2026: "make them hq", "can you not do screenshots", "remove the background"): drawn, on white */
.hw-block { display: grid; gap: 10px; margin-top: 4px; }
.hw-pics { display: flex; flex-wrap: wrap; gap: 12px; }
.hw-pic { display: grid; gap: 8px; justify-items: stretch; align-content: start; width: 168px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
  padding: 0 0 10px; overflow: hidden; font: inherit; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 32, 56, .06); }
button.hw-pic { cursor: zoom-in; }
.hw-ph { display: flex; align-items: center; justify-content: center; height: 128px; padding: 8px; box-sizing: border-box; }
.hw-ph img, .hw-ph .svgwrap, .hw-ph .svgwrap svg { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.hw-zoom { width: min(80vw, 560px); height: min(70vh, 560px); display: flex; align-items: center; justify-content: center; background: var(--paper); border-radius: 18px; }
.hw-zoom svg { width: 82%; height: 82%; }
.hw-pic small { padding: 0 10px; font-size: 12px; line-height: 1.3; color: var(--muted); text-align: center; }
.hw-sw { display: inline-block; width: 10px; height: 10px; border: 1px solid #8a94a0; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hw-tiles .design .hw-ph { height: 136px; border-radius: 10px; margin-bottom: 4px; }
.pricebox { border-radius: var(--radius); background: radial-gradient(120% 140% at 100% 0%, #1d63ab 0%, var(--blue) 45%, var(--blue-dark) 100%); color: #fff; padding: 16px 18px; display: grid; gap: 4px;
  box-shadow: 0 2px 4px rgba(11, 55, 102, .2), 0 14px 30px -12px rgba(11, 55, 102, .6); position: relative; }
.pricebox::after { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange); }
.pricebox .lbl { opacity: .85; font-size: 14px; font-weight: 600; letter-spacing: .03em; }
.pricebox .val { font-size: 34px; font-weight: 700; font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; letter-spacing: .02em; line-height: 1.1; }
.pricebox .sub { font-size: 14px; opacity: .88; }
.pricebox.bad { background: linear-gradient(180deg, #8f9cad 0%, #7b899b 100%); box-shadow: var(--shadow); }
.pricebox.bad::after { display: none; }
/* the price stays in view while the side panel scrolls, pinned to its top or its bottom (iPad landscape and computer;
   owner, Nov 19, 2026) */
@media (min-width: 861px) {
  .cfg-side > .pricebox { position: sticky; top: -16px; bottom: -16px; z-index: 3; }
  /* the drawing leaves room for the price under it, so the price never covers the drawing */
  .cfg-side > .drawing svg { max-height: calc(100vh - 330px); }
}
.breakdown { font-size: 14px; border-collapse: collapse; width: 100%; }
.breakdown td { padding: 4px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.breakdown td.num { text-align: right; padding-left: 8px; white-space: nowrap; }
.price-tag { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cfg-foot { display: none; }

/* --- admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.tabs a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
table.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl input { min-height: 36px; padding: 6px 8px; }
.pgrid { overflow-x: auto; }
.pgrid table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.pgrid th, .pgrid td { border: 1px solid var(--line); padding: 4px 6px; text-align: right; white-space: nowrap; }
.pgrid th { background: var(--sunk); font-weight: 600; }
.pgrid td.na { background: #f3f3f3; color: var(--faint); text-align: center; }
.pgrid input { width: 84px; min-height: 32px; padding: 4px 6px; text-align: right; border-radius: 6px; }
.pgrid input.changed { border-color: var(--orange); background: var(--orange-soft); }
.req-card { display: grid; gap: 10px; padding: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }

/* --- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%); }
.login .card { width: 100%; max-width: 420px; padding: 28px; display: grid; gap: 16px; }
.login .brand { color: var(--blue-ink); }
.login .brand-mark { background: var(--blue); color: #fff; }

/* --- modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(10, 24, 42, .48); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 24px; display: grid; gap: 14px; box-shadow: 0 30px 80px -10px rgba(8, 20, 36, .45); border: 1px solid rgba(255, 255, 255, .6); }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 90; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; animation: tin .18s ease-out; }
.toast.err { background: var(--err); } .toast.ok { background: var(--ok); } .toast.warn { background: var(--warn); color: #fff; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }

/* --- responsive */
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr) 320px; }
  .sheet-body { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  .editor { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .sheet-body { grid-template-columns: 1fr; overflow-y: auto; }
  /* iPad portrait and phones (owner, Oct 23, 2026: "moving too much"): the drawing stays on top at a fixed height; the
     price, checks and messages, which change while typing, come after the form, so the fields never move under the
     fingers (the bottom bar keeps the price and the Add button; "see why" scrolls to the messages) */
  .cfg-side { display: contents; }
  .cfg-side > * { order: 2; margin: 0 16px 14px; }
  .cfg-side > .drawing { order: -1; margin: 16px 16px 0; height: 220px; overflow: hidden; }
  .cfg-side > .drawing > .svgwrap, .cfg-side > .drawing svg { width: 100%; height: 100%; }
  .cfg-form { overflow: visible; order: 1; padding-bottom: 4px; }
  .sheet-body { align-content: start; }
  .sheet-body::after { content: ''; order: 9; height: calc(84px + env(safe-area-inset-bottom)); } /* room above the bottom bar */
  .cfg-side > .pricebox { scroll-margin-top: 12px; }
  .cfg-foot .p { cursor: pointer; }
  .cfg-side .breakdown-wrap, .cfg-side .add-wrap { display: none; }
  .door-pics img { height: 96px; }
  .cfg-foot { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 12px; align-items: center; }
  .cfg-foot .p { flex: 1; font-weight: 700; font-size: 20px; }
  .line { grid-template-columns: 110px minmax(0, 1fr); }
  .line .amt { grid-column: 1 / -1; grid-template-columns: 1fr auto; text-align: left; align-items: center; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qrow { grid-template-columns: 70px minmax(0, 1fr) auto; row-gap: 6px; }
  .qrow:not(.archived) .qno { grid-row: 1 / span 2; }
  .qrow:not(.archived) .qstat { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .qrow:not(.archived) .qtotal { grid-column: 3; grid-row: 1 / span 2; }
  .brand small { display: none; }
}
@media (max-width: 560px) {
  .cfg-foot .p { font-size: 16px; } /* "Not priced yet: see why" on one line */
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .addbar { grid-template-columns: 1fr; }
  .page { padding: 18px 14px 110px; }
  h1 { font-size: 28px; }
}

/* --- print (client quote): page styles are in quote.css */
#print-root { display: none; }
body.printing #app, body.printing #toasts { display: none; }
body.printing #print-root { display: block; }
body.printing { background: #e9edf2; }
/* the team chat bubble never on a printed page (quote, installer sheet, plain spec sheet; Nov 17, 2026: it printed on an
   admin's quote and on the sheets, where client mode does not hide it) */
body.printing .rcchat-b, body.printing .rcchat-p { display: none !important; }
@media print {
  @page { size: letter; margin: 0; }
  body, body.printing { background: #fff; }
}


/* ---- bundle credit, gauge, red-zone lock (Oct 2026) ---- */
.credit { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 8px 0 4px; }
.credit-in { display: flex; align-items: center; gap: 6px; }
.credit-in input { width: 96px; text-align: right; font-weight: 700; }
.credit-in span { color: var(--muted); font-size: 13px; }
.gauge { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; background: var(--card); }
.gauge.ok { border-color: var(--ok); } .gauge.warn { border-color: #d99a00; } .gauge.err { border-color: var(--err); }
.gauge-top { display: flex; align-items: center; gap: 8px; }
.gauge-top .spacer { flex: 1; }
.gauge-amt { font-size: 24px; color: var(--ink); }
.zone-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; }
.zone-dot.ok { background: var(--ok); } .zone-dot.warn { background: #e0a800; } .zone-dot.err { background: var(--err); }

/* ---- client mode PIN pad ---- */
.pin-modal { max-width: 360px; text-align: center; }
.pin-dots { font-size: 28px; letter-spacing: .3em; min-height: 40px; margin: 6px 0 2px; color: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 4px; }
.pin-key { height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 24px; font-weight: 600; color: var(--ink); cursor: pointer; }
.pin-key:active { background: #eef3f9; }
.pin-key.ok { background: var(--blue, #12508f); color: #fff; border-color: transparent; font-size: 18px; }

/* ---- dashboard ---- */
.progress { height: 14px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress-in { height: 100%; border-radius: 999px; background: var(--ok); }
.progress-in.warn { background: #e0a800; }

/* ---- commission statement (printable) ---- */
.statement { max-width: 760px; margin: 0 auto 40px; padding: 28px 32px; background: var(--paper); color: #111a26; display: grid; gap: 16px; font-size: 14px; }
.st-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #fe5e00; padding-bottom: 12px; }
.st-title { font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.st-co { text-align: right; font-size: 13px; }
.st-box { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.st-row { display: flex; justify-content: space-between; gap: 12px; }
.st-part { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; display: grid; gap: 6px; }
.st-cond { display: flex; gap: 8px; font-size: 13px; }
@media print { .statement { margin: 0; padding: 0; } }

/* window builder: shape picker, clickable sketch, opening types not allowed at a section's size */
.shape-row { display: flex; align-items: center; gap: 12px; }
.shape-row .grow { flex: 1; min-width: 0; }
.shape-cur { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 4px; flex: none; }
.shape-cur .svgwrap, .shape-tile .svgwrap { width: 100%; height: 100%; }
.shape-cur svg, .shape-tile svg { width: 100%; height: 100%; display: block; }
.shape-pick { display: grid; gap: 8px; }
.shape-pick .grp { font-weight: 700; margin-top: 4px; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.shape-tile { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); padding: 4px; cursor: pointer; }
.shape-tile[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.sketch { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 6px; touch-action: manipulation; }
.sketch svg { width: 100%; height: auto; max-height: 380px; display: block; }
.design.no { opacity: .6; border-style: dashed; }
.design .why { color: var(--err); font-weight: 600; }

/* ---- sales dashboard (My sales / Sales) ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px 14px; display: grid; gap: 4px; align-content: start; border-top: 4px solid var(--line); }
.kpi.blue { border-top-color: var(--blue); } .kpi.orange { border-top-color: var(--orange); } .kpi.green { border-top-color: var(--ok); } .kpi.ink { border-top-color: var(--ink); }
.kpi .k-lbl { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .k-val { font-family: "Barlow Condensed", "Arial Narrow", Barlow, system-ui, sans-serif; font-weight: 700; font-size: 36px; line-height: 1.1; color: var(--ink); }
.kpi.orange .k-val { color: var(--orange-dark); }
.kpi .k-sub { font-size: 15px; font-weight: 600; }
.kpi .k-note { font-size: 13.5px; color: var(--muted); }
.dash-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.dash-row.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row > .card { height: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.payline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.payline b { font-size: 19px; }
table.tbl.sold td, table.tbl.sold th { padding: 7px 4px; }
table.tbl .num, table.tbl th.num { text-align: right; }
table.tbl tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.fu a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.fu a:hover { background: var(--blue-soft); }
.fu b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.late { color: var(--err); font-weight: 600; }
table.tbl.jobs td { vertical-align: top; }
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .dash-row, .dash-row.half { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .kpi .k-val { font-size: 32px; } }
/* ---- quote totals by salesperson (owner, Nov 29, 2026) ---- */
.tot-ctl { display: grid; gap: 12px; margin-bottom: 14px; }
.tot-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tot-nav > .btn:not(.ghost) { min-width: var(--tap); padding: 0 12px; font-size: 22px; line-height: 1; }
.tot-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tot-when b { font-family: "Barlow Condensed", Barlow, sans-serif; font-size: 23px; font-weight: 700; }
.tot-card { overflow-x: auto; }
table.tbl.tot-tbl { font-size: 16px; }
table.tbl.tot-tbl th, table.tbl.tot-tbl td { padding: 12px 16px; }
table.tbl.tot-tbl tfoot td { font-size: 17px; border-top: 2px solid var(--ink); border-bottom: 0; }
table.tbl.tot-tbl td.num { white-space: nowrap; }
.tot-name { font-weight: 600; }
.tot-note { max-width: 860px; }
@media (max-width: 560px) {
  table.tbl.tot-tbl { font-size: 14.5px; }
  table.tbl.tot-tbl th, table.tbl.tot-tbl td { padding: 10px 6px; }
  table.tbl.tot-tbl th:first-child, table.tbl.tot-tbl td:first-child { padding-left: 12px; }
  table.tbl.tot-tbl th:last-child, table.tbl.tot-tbl td:last-child { padding-right: 12px; }
  table.tbl.tot-tbl tfoot td { font-size: 15px; }
  .tot-when b { font-size: 20px; }
}

/* ---- iPad upright (Oct 23, 2026): a tighter menu so the owner's entries fit without sliding sideways ---- */
@media (min-width: 701px) and (max-width: 1000px) {
  .nav { margin-left: 0; gap: 2px; }
  .nav a { padding: 8px 8px; font-size: 15px; }
  .top-in { gap: 10px; }
  .userbtn > .small { display: none; }
  .userbtn { padding: 4px; }
}
/* ---- phone: the menu goes on its own row under the brand (Oct 15, 2026) ---- */
@media (max-width: 700px) {
  .top-in { flex-wrap: wrap; row-gap: 0; }
  .nav { order: 3; flex-basis: 100%; margin: 0 0 6px; flex-wrap: wrap; overflow: visible; }
  .nav a { padding: 6px 10px; }
}

/* ---- quote editor polish (Oct 15, 2026): client summary, bundle credit, delivery, closed quotes, bottom bar ---- */
.client-sum .cs-name { font-size: 20px; font-weight: 700; margin: 2px 0 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.client-sum .small > div { margin-top: 2px; }
/* admins: who has the client, and the button to change it (Oct 24, 2026) */
/* admins: a window type over Vinyl Pro's maximum that can be allowed (Oct 28, 2026) */
.design.over { border-style: dashed; border-color: var(--warn); }
.design .why.over { color: var(--warn); font-weight: 600; }
.owner-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.credit2 { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0; }
.credit2 .credit-in input { width: 92px; }
/* agreed price (Oct 24, 2026): the total typed in full, the Apply button beside it */
.credit2 .agreed-in input { flex: 1 1 auto; width: auto; min-width: 0; }
.dbox { padding: 8px 0; border-top: 1px solid var(--line); }
.banner.info { background: var(--card); border: 1px solid var(--blue-line); border-left: 4px solid var(--blue); color: var(--ink); }
.banner.info > b:first-child { color: var(--blue-ink); }
@media (min-width: 861px) { .totals-card.sticky { max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; } }
/* the total beside the items (owner, Oct 23, 2026: "arrange the total next to our quote building, it is sliding left
   and right"): smaller text so everything fits the panel's width, and the panel never scrolls sideways */
.totals-card { overflow-x: hidden; font-size: 15px; grid-template-columns: minmax(0, 1fr); } /* its column never grows wider than the panel (owner, Nov 25, 2026: "fix the ipad total panel sliding sideways") */
/* the total beside the items (iPad upright or sideways, computer): the owner's profit by product type shows products, GP and GP %; the
   product cost is the line above the table (the bold "All products" row did not fit the 360px panel with the cost column, Nov 25, 2026) */
@media (min-width: 761px) { .totals-card .gp-table th:nth-child(3), .totals-card .gp-table td:nth-child(3) { display: none; } }
.totals-card .totals .t.sub, .totals-card .adminbox { font-size: 14px; }
.totals-card .totals .t.grand { font-size: 20px; }
.totals-card .gauge-amt { font-size: 22px; }
.totals-card .gp-table { font-size: 12px; }
.totals-card .gp-table th { font-size: 11px; padding: 3px 2px; }
.totals-card .gp-table td { padding: 3px 2px; }
.totals-card .gp-table td:first-child { white-space: normal; }
.totals-card .gauge-top { flex-wrap: wrap; row-gap: 4px; }
.totals-card .totals .t > :first-child, .totals-card .adminbox .t > :first-child { min-width: 0; }
.mbar { display: none; }
/* iPad upright (761-860px wide): the total stays beside the items, as on a wider screen, in a narrower column */
@media (min-width: 761px) and (max-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
  .editor .sticky { position: sticky; top: 76px; }
  .totals-card.sticky { max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; }
  .totals-card { font-size: 14px; padding: 14px; }
  .totals-card .gauge { padding: 10px; }
  .totals-card .adminbox { padding: 8px; }
}
@media (max-width: 760px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(18, 35, 58, .08);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 14px; align-items: center; }
  .mbar > div:first-child { flex: 1; }
  .mbar b { font-size: 19px; }
  .mbar-z { display: flex; align-items: center; gap: 6px; }
  .mbar-z b { font-size: 15px; }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---- settings: jump links and a save bar that stays in view ---- */
.jump { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jump button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 14px; color: var(--blue-ink); cursor: pointer; }
.jump button:hover { background: var(--blue-soft); }
.page section.card { scroll-margin-top: 80px; }
/* zoomed in with two fingers (app.js sets html.pinched): the pinned bars stay in the page instead of floating over it */
html.pinched .top, html.pinched .sticky, html.pinched .savebar, html.pinched .mbar, html.pinched .cfg-foot { position: static; }
html.pinched .totals-card.sticky { max-height: none; overflow: visible; }
/* Safari zooms the page into any field under 16px when it is tapped: fields stay at 16px on touch screens */
@media (pointer: coarse) { input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: max(16px, 1em); } }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(18, 35, 58, .10); }
.b-warn { color: var(--warn); font-weight: 600; }

/* --- plans and client request on a quote (Oct 15, 2026): staff only, never printed */
.chip.staff { background: var(--blue-soft); color: var(--blue-ink); }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.plan-tile { position: relative; aspect-ratio: 1; }
.plan-face { width: 100%; height: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 6px; text-decoration: none; color: var(--ink); }
.plan-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plan-face:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.plan-face.pdf { background: var(--blue-soft); border-color: var(--blue-line); }
.plan-face.doc .pdf-mark { background: var(--orange); }
.pdf-mark { font: 700 20px/1 "Barlow Condensed", Barlow, sans-serif; color: #fff; background: var(--blue); border-radius: 6px; padding: 6px 10px; letter-spacing: .04em; }
.plan-name { font-size: 12.5px; color: var(--muted); padding: 0 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-tile.up .plan-face { cursor: default; color: var(--blue-ink); background: #fafcff; border-style: dashed; }
.plan-del { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .94);
  color: var(--err); font-weight: 700; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(18, 35, 58, .15); }
.plan-del:hover { background: var(--paper); border-color: #d9a9a3; }
.creq { border-top: 1px solid var(--line); padding-top: 12px; }
.plan-dims-in { min-height: 150px; }
.plan-dims .req-notes { max-height: 260px; overflow: auto; }
.req-op-list { display: grid; gap: 8px; }
.req-op { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2.4fr) auto; gap: 8px; align-items: center; }
.req-ops { display: grid; gap: 4px; }
.req-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.req-kv dt { color: var(--muted); } .req-kv dd { margin: 0; }
.req-notes { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.lb { position: fixed; inset: 0; z-index: 75; background: rgba(9, 18, 31, .94); display: grid; grid-template-rows: auto 1fr; color: #fff; }
.lb-bar { display: flex; gap: 10px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.lb-cap { flex: 1; min-width: 0; display: grid; } .lb-cap span { font-size: 13px; color: #b9c6d6; }
.lb-cap b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
.lb-img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; background: var(--paper); border-radius: 4px; }
.lb[data-state="loading"] .lb-img { opacity: .6; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
@media (max-width: 560px) {
  .req-op { grid-template-columns: 1fr auto; } .req-op input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- ENERGY STAR / NRCan of a window (Oct 20, 2026) */
.esbox { border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; border: 1px solid var(--blue-line); background: var(--blue-soft); color: var(--blue-ink-2); }
.esbox.me { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.esbox.none { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.esbox .small { color: var(--ink); word-break: break-word; }
.es-line { margin-top: 4px; font-size: 13.5px; color: var(--blue-ink-2); }
.es-line.me { color: var(--ok); }

/* ---- contracts signed on the iPad (Oct 20, 2026) */
.ctbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.ct-line { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; font-size: 14px; }
.ct-line > span:first-child { font-weight: 700; color: var(--muted); }
.ct-line.ok > span:first-child { color: var(--ok); }
.ct-line.err > span:first-child, .ct-line.err > span:last-child { color: var(--err); }
.ok-t { color: var(--ok); font-weight: 600; } .err-t { color: var(--err); font-weight: 600; }
.signing { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.signing-head { display: flex; align-items: center; gap: 16px; padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.signing-head > div:first-child { flex: 1; min-width: 0; }
.signing-head b { font-size: 18px; }
.signing-total { display: grid; justify-items: end; }
.signing-total b { font-size: 20px; }
.signing-doc { overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.signing-doc .qd { margin: 0 auto; }
.signing-foot { background: var(--paper); border-top: 1px solid var(--line); padding: 12px 18px calc(env(safe-area-inset-bottom) + 12px); display: grid; gap: 10px; box-shadow: 0 -4px 14px rgba(17, 26, 38, .08); }
.signing-ok { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; font-weight: 600; }
.signing-ok input { width: 24px; height: 24px; flex: none; margin-top: 1px; }
.signing-pads { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: end; }
@media (max-width: 700px) { .signing-pads { grid-template-columns: 1fr; } }
.sigpad { position: relative; border: 1px solid var(--blue-line); border-radius: 10px; background: var(--paper); touch-action: none; height: 200px; }
.sigpad.sm { height: 120px; }
@media (max-height: 900px) { .signing .sigpad { height: 150px; } .signing .sigpad.sm { height: 84px; } .signing-foot { gap: 8px; padding-top: 10px; } }
.sigpad-c { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigpad-line { position: absolute; left: 16px; right: 16px; bottom: 34px; border-bottom: 1px solid #8a94a3; pointer-events: none; }
.sigpad-l { position: absolute; left: 16px; bottom: 10px; font-size: 13px; color: var(--muted); pointer-events: none; }
.sigpad-x { position: absolute; right: 6px; top: 6px; }
.btn.lg { font-size: 18px; padding: 12px 26px; }
.jamb-more { display: flex; gap: 8px; align-items: flex-end; }
.jamb-more > .f { flex: 1; }
.jamb-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 2px 0 6px; }
/* moving and selecting items (owner, Oct 22, 2026) */
.line .acts { flex-wrap: wrap; }
.line .pick { width: 22px; height: 22px; margin-right: 8px; vertical-align: -4px; accent-color: var(--blue); }
.line.picked { outline: 2px solid var(--blue); }
.select-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--blue-soft); }
.select-bar b { margin-right: auto; }
/* every item shows its credit (owner, Oct 22, 2026): brand orange, no pink */
.line .amt .line-credit { color: var(--orange-dark); display: grid; gap: 2px; }
.line .amt .line-credit b { color: var(--ink); }
/* profit by product type (owner, Oct 23, 2026): owner and admin screens only */
.gp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.gp-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.gp-table td { padding: 4px; border-bottom: 1px solid var(--line); }
.gp-table .num { text-align: right; white-space: nowrap; }
.gp-table .gp-all td { font-weight: 700; border-top: 2px solid var(--blue); border-bottom: 0; }
/* quote versions (owner, Oct 29, 2026): RIV2701 / A / B… under the quote's title, tap one to open it */
.versions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-top: 8px; }
.versions-t { align-self: center; text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.version { display: grid; grid-template-columns: auto auto; gap: 1px 8px; align-items: center; text-align: left; padding: 6px 10px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; font: inherit; cursor: pointer; }
.version > b { font-size: 14px; } .version .chip { justify-self: end; font-size: 11px; padding: 1px 8px; }
.version > .small, .version > .tiny { grid-column: 1 / -1; }
.version.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-soft); cursor: default; }
.version.off { opacity: .55; }
.version .up { color: var(--orange-dark); font-weight: 600; } .version .down { color: var(--ok); font-weight: 600; }
.vtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.vtable th, .vtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.vtable .num { text-align: right; } .vtable tr.on td { background: var(--blue-soft); }
/* change several items (owner, Oct 31, 2026) */
.bulk-kind { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; gap: 8px; }
.bulk-all { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.bulk-items { display: grid; gap: 2px; padding-left: 4px; }
.bulk-item { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 14px; }
.bulk-all input, .bulk-item input { width: 22px; height: 22px; flex: none; }
.bulk-changes { padding-top: 6px; border-top: 1px dashed var(--line); }

/* the Rive Clair CRM on the quote (Nov 3, 2026): its client file, or "Find in the CRM" */
.crm-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--blue-line); background: var(--blue-soft); border-radius: 10px; }
.crm-file.pending { border-style: dashed; }
.crm-find input[type=search] { width: 100%; }
.crm-results:empty { display: none; }
.crm-results { gap: 6px; max-height: 340px; overflow-y: auto; }
.crm-person { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.crm-deals { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-deals .btn { white-space: normal; text-align: left; }

/* Team chat bubble (web/chat.js, a copy of the CRM's): bottom right (owner, Nov 4, 2026: "move the chat bubble to the right
   bottom"); lifted above the item's price bar (≤ 860 px) and the quote's bottom bar (≤ 760 px) so it never covers their buttons */
@media (max-width: 860px) { body:has(.cfg-foot) .rcchat-b { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (max-width: 760px) { body:has(.mbar) .rcchat-b { bottom: calc(84px + env(safe-area-inset-bottom)); } }
/* the kinds of door glass (Nov 7, 2026): how many of each */
.glass-kinds small { font-weight: 500; opacity: .7; }

/* extra work on a quote (owner, Nov 9, 2026) */
.xw-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.xw-edit { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .xw-edit { grid-template-columns: minmax(0, 1fr) 100px auto; } }

/* deleted quotes (owner, Nov 9, 2026) */
.qrow.archived { grid-template-columns: 90px minmax(0, 1fr) auto auto; cursor: default; }
.archive-act { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .qrow.archived { grid-template-columns: minmax(0, 1fr) auto; } .qrow.archived .qno { display: none; } .archive-act { grid-column: 1 / -1; } }
/* the eye (owner, Nov 17, 2026): hides the commission, GP and cost; the PIN shows them again */
.eye-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: 4px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--blue-ink); cursor: pointer; flex: none; }
.eye-btn.off { color: var(--orange-dark); border-color: var(--orange); }
.adminbox.fig-off { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Notes for this project: their own box under the client, printed on the quote and the contract (owner, Nov 17, 2026) */
.notes-card textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.45; }
/* what would make a window Most Efficient at the same size (owner, Nov 17, 2026) */
.me-ideas { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--blue-line); border-radius: 8px; background: var(--blue-soft); margin-top: 6px; }
.me-ideas .me-idea { justify-content: space-between; text-align: left; white-space: normal; display: flex; gap: 8px; }
.me-ideas .me-idea small { color: var(--muted); white-space: nowrap; }
.me-ideas .me-group { display: grid; gap: 6px; }
.me-ideas .me-gt { margin-top: 4px; font-weight: 600; }

/* ---- premium pass (owner, Nov 19, 2026: "more premium and polished and easier to use"; "Too many buttons / cluttered") ---- */
/* the quote's head: back link, title, one line of status; on the right only Save, Client view, Print / PDF and ⋯ More */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 4px; min-height: 28px; }
.back-link:hover { color: var(--blue-ink); }
.head-meta { gap: 8px; margin-top: 6px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
/* the "⋯ More" menu */
.more-wrap { position: relative; }
.more-btn .dots { font-size: 22px; line-height: 0; letter-spacing: 0; margin-top: -2px; color: var(--blue-ink); }
.more-wrap.open .more-btn { border-color: var(--blue); background: var(--blue-soft); box-shadow: var(--ring); }
.more-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: 360px; max-width: calc(100vw - 24px); max-height: min(calc(100vh - 190px), 680px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 6px; animation: mm-in .14s ease-out; transform-origin: top right; }
.more-menu[hidden] { display: none; }
@keyframes mm-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.more-group { display: grid; gap: 1px; padding: 4px 0; }
.more-group + .more-group { border-top: 1px solid var(--line-soft); }
.more-title { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 6px 12px 4px; }
.mi { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; min-height: 52px; padding: 9px 10px; border: 0; border-radius: 12px; background: none;
  text-align: left; cursor: pointer; color: var(--ink); white-space: normal; transition: background .12s; }
.mi:hover:not(:disabled), .mi:focus-visible { background: var(--blue-soft); }
.mi:disabled { opacity: .5; cursor: not-allowed; }
.mi-ic { width: 32px; height: 32px; border-radius: 9px; background: #f1f5fa; display: grid; place-items: center; font-size: 16px; color: var(--blue-ink); }
.mi-tx { display: grid; gap: 1px; min-width: 0; padding-top: 1px; }
.mi-t { font-weight: 600; font-size: 15.5px; }
.mi-s { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.mi.danger { color: var(--err); }
.mi.danger .mi-ic { background: #fbeeec; color: var(--err); }
.mi.danger:hover:not(:disabled) { background: #fbf3f2; }
/* phone: the menu opens as a sheet from the bottom */
@media (max-width: 560px) {
  .more-menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 78vh; z-index: 70; border-radius: 20px; transform-origin: bottom center; }
  .more-wrap.open::before { content: ''; position: fixed; inset: 0; background: rgba(10, 24, 42, .35); z-index: 69; }
  .head-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .head-actions > .btn, .head-actions .more-btn { width: 100%; }
  body:has(.more-wrap.open) .rcchat-b { display: none; }
}
/* the quote's cards: a little more air, the titles in the brand's condensed type */
.editor .card h2 { font-size: 22px; }
.totals-card { border-top: 3px solid var(--blue); }
@media (min-width: 861px) { .totals-card { padding: 18px; } } /* the narrow total panel keeps its padding: nothing slides sideways */
.gauge { border-radius: var(--radius-sm); }
.comm { border-radius: var(--radius-sm); }
.version { border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); }
.ctbox { border-radius: var(--radius-sm); }
.msg { border-radius: var(--radius-sm); }
.banner { border-radius: var(--radius); }
.kpi { border-radius: var(--radius); }
.tabs a { border-radius: var(--radius-sm); min-height: 40px; display: inline-flex; align-items: center; }
.tabs a.on { background: linear-gradient(180deg, #1a5fa6 0%, var(--blue) 100%); }
.cfg-foot { box-shadow: 0 -6px 18px -8px rgba(16, 32, 54, .25); }
.mbar { box-shadow: 0 -6px 18px -8px rgba(16, 32, 54, .25); }
/* touch screens: every button at least 44px high (owner, Nov 19, 2026: iPad first) */
@media (pointer: coarse) {
  .btn.sm { min-height: var(--tap); }
  .eye-btn { width: 40px; height: 40px; }
}
/* phone: the quote's number above the client's name, so the name has the whole width */
@media (max-width: 560px) {
  .qrow:not(.archived) { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; column-gap: 12px; padding: 14px 16px; }
  .qrow:not(.archived) .qno { grid-column: 1; grid-row: 1; font-size: 15px; }
  .qrow:not(.archived) > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .qrow:not(.archived) .qstat { grid-column: 1; grid-row: 3; margin-top: 4px; }
  .qrow:not(.archived) .qtotal { grid-column: 2; grid-row: 1 / span 3; min-width: 0; }
}

/* --- Dark screens (owner, Nov 25, 2026: "can you make me a dark version of the estimation app also"). Chosen on each device in
   the user menu: Light (as before), Dark, or Automatic (the iPad's own setting); web/theme.js sets <html data-theme> before the
   page shows. Navy and orange stay the brand colours; the product drawings and catalogue pictures keep their white paper
   (--paper); the printed quotes, contracts and PDFs are never dark (screen only, and the quote pages have their own colours). */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --deep: #071526; --deep-2: #0b2241;
    --blue: #1f63ad; --blue-dark: #174f8c; --blue-soft: #16304f; --blue-line: #2d4f78; --blue-ink: #7db6f2; --blue-ink-2: #9cc8f5;
    --orange-soft: #33230f;
    --ink: #e8eef6; --muted: #a4b3c6; --faint: #7c8ea5; --line: #243447; --line-2: #31445b; --bg: #0a1420; --card: #121e2d;
    --ok: #4cc283; --ok-soft: #10301f; --warn: #e8ad45; --warn-soft: #30250f; --err: #f2766b; --err-soft: #2c1c1e;
    --hover: #18293e; --sunk: #0f1a28; --sunk-2: #0f1a28; --line-soft: #1d2b3c; --chip: #1f2e41;
    --text-2: #cfd9e6; --text-3: #b3c1d2; --warn-line: #6b5420; --warn-ink: #f1c879; --hover-line: #46607f; --glass: rgba(18, 30, 45, .96);
    --side-end: #0f1a28; --ok-line: #24573a; --err-line: #6e3a37; --ok-ink: #6fd39c; --err-ink: #f2918a;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .25), 0 10px 24px -8px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 48px -10px rgba(0, 0, 0, .7);
    --ring: 0 0 0 4px rgba(125, 182, 242, .25);
  }
  :root[data-theme="dark"] .toast { background: #22334a; }
  :root[data-theme="dark"] .btn.accent:disabled, :root[data-theme="dark"] .btn.primary:disabled { background: #2a3a4e; border-color: #2a3a4e; color: #8295ad; }
  :root[data-theme="dark"] .chip.lost { background: #2a2326; color: #c9b8b8; }
  :root[data-theme="dark"] .addbtn { background: var(--card); }
  :root[data-theme="dark"] .pgrid td.na { background: var(--sunk); }
  :root[data-theme="dark"] .pin-key:active { background: var(--hover); }
  :root[data-theme="dark"] .plan-tile.up .plan-face { background: var(--card); }
  :root[data-theme="dark"] .plan-del:hover { border-color: var(--err-line); }
  :root[data-theme="dark"] .mi-ic { background: var(--chip); }
  :root[data-theme="dark"] .mi.danger .mi-ic { background: var(--err-soft); }
  :root[data-theme="dark"] .mi.danger:hover:not(:disabled) { background: var(--err-soft); }
  :root[data-theme="dark"] body.printing { background: #1a2433; }
  :root[data-theme="dark"] .qd-toolbar { background: rgba(26, 36, 51, .94); }
  /* the picture tiles and drawings on white paper: their text in the light version's colours */
  :root[data-theme="dark"] :is(.design, .glass-pic, .door-pics button, .hw-pic, .hw-zoom, .shape-cur, .shape-tile, .sketch, .plan-face, .statement, .signing-head, .signing-foot, .sigpad, .drawing) {
    --ink: #102036; --muted: #5a6a7e; --faint: #8796a8; --line: #e0e7ef; --line-2: #d3dce7; --card: #fff; --bg: #f3f6fa;
    --blue: #12508f; --blue-soft: #ebf2fa; --blue-line: #c6d8ee; --blue-ink: #12508f; --blue-ink-2: #0b3766; --text-2: #2b3b50; --text-3: #46566a;
    --hover: #f7faff; --sunk: #f6f8fb; --sunk-2: #fafbfc; --chip: #eef1f5; --line-soft: #eef1f5;
    color: var(--ink);
  }
  /* the line's small drawing: on its white paper, like the big drawing */
  :root[data-theme="dark"] .line .thumb { background: var(--paper); border-color: var(--line-2); }
}
