/* Layout: top faceplate bar + single working column; boards scroll sideways inside their own box. */
:root {
  --bg: #eef0f2;          /* brushed-aluminium paper */
  --panel: #ffffff;
  --panel-2: #f6f7f8;
  --line: #d5d9de;
  --fg: #1c2127;
  --muted: #5f6873;
  --face: #23282e;        /* black faceplate */
  --face-fg: #e9ecef;
  --accent: #c97a12;      /* dial-lamp amber */
  --accent-soft: #fbefd9;
  --accent-fg: #ffffff;
  --ok: #2e7d4f;  --ok-soft: #e1f2e7;
  --warn: #b26a00; --warn-soft: #fff1d6;
  --bad: #b3261e; --bad-soft: #fbe3e1;
  --info: #2b5c9e; --info-soft: #e2ecf8;
  --display: 'Michroma', 'Eurostile', 'Arial Black', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --radius: 6px;
  --badge-clear: 84px;  /* keeps floating controls above Netlify's 'Powered by Netlify' badge */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --panel: #1c2024; --panel-2: #22272c; --line: #333a41;
    --fg: #e6e9ec; --muted: #9aa3ad; --face: #0b0d0f; --face-fg: #e9ecef;
    --accent: #f0a53a; --accent-soft: #3a2c16; --accent-fg: #1a1205;
    --ok: #6cc893; --ok-soft: #173225; --warn: #f3b44c; --warn-soft: #3a2b12;
    --bad: #ff8a80; --bad-soft: #3d1a18; --info: #8db8f2; --info-soft: #172a42;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.row { display: flex; align-items: center; flex-wrap: wrap; } .gap { gap: .5rem; } .gap-lg { gap: 1rem; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

.faceplate-label { font-family: var(--display); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: .4rem; font: 500 .9rem var(--body); padding: .5rem .85rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .8rem; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; letter-spacing: .02em; }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .6rem; }
textarea { resize: vertical; }
.field { min-width: 0; }
.grid { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--face); color: var(--face-fg);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-block: .6rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--face); }
.brand .faceplate-label { color: var(--accent); font-size: .85rem; }
/* Todd, Nov 20: the shop name opens the store website (new tab, so the app stays open). */
a.faceplate-label { text-decoration: none; }
a.faceplate-label:hover, a.faceplate-label:focus-visible { text-decoration: underline; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.tabs a { color: var(--face-fg); opacity: .72; text-decoration: none; padding: .4rem .65rem; border-radius: var(--radius); font-size: .9rem; white-space: nowrap; }
.tabs a.active { opacity: 1; background: rgba(255,255,255,.08); box-shadow: inset 0 -2px 0 var(--accent); }
.top-actions { display: flex; gap: .4rem; }
.top-actions .btn { background: transparent; color: var(--face-fg); border-color: rgba(255,255,255,.2); }
.top-actions .btn.ghost { border-color: transparent; }
.badge { background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-size: .7rem; padding: 0 .4rem; margin-left: .2rem; font-weight: 600; }

.view { padding-block: 1.2rem 10rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1400px; margin: 0 auto; }
.view-head { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.view-head h1 { font-family: var(--display); font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase; }
.serial-sug { margin-top: .7rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: .35rem; }
.msg-tpl { border-top: 1px solid var(--line); padding: .55rem 0; }
.msg-tpl > summary { cursor: pointer; list-style-position: outside; }
.msg-tpl-body { display: grid; gap: .5rem; margin-top: .6rem; }
.msg-tpl code { font-family: var(--mono); font-size: .78rem; }
.msg-preview { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: .6rem .7rem; background: var(--panel-2); border-radius: var(--radius); font: inherit; font-size: .88rem; }
.msg-problems { color: var(--bad); margin: 0; padding-left: 1.1rem; }
.msg-problems:empty { display: none; }
.warn-text { color: var(--warn); }
.jump-menu { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 1rem; }
.jump-menu:empty { display: none; }
.jump-top { position: fixed; z-index: 15; left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.jump-top[hidden] { display: none; }
@media print { .jump-menu, .jump-top { display: none !important; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.panel + .panel { margin-top: 1rem; }
.panel h2 { font-size: .8rem; font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.two-col { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* Pills / chips */
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.chip { font-family: var(--mono); font-size: .75rem; color: var(--accent); }

/* Bench board */
.stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat b { display: block; font: 500 1.5rem var(--mono); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
.board-wrap { overflow-x: auto; padding-bottom: .5rem; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: .75rem; min-width: min-content; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.col-head h3 { font-size: .72rem; font-family: var(--display); letter-spacing: .1em; text-transform: uppercase; }
.col-head .num { color: var(--muted); font-size: .85rem; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); padding: .55rem .65rem; margin-bottom: .5rem; color: var(--fg); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card.rush { border-left-color: var(--accent); } .card.late { border-left-color: var(--bad); }
.card .no { font-family: var(--mono); font-size: .78rem; color: var(--accent); }
.card .model { font-weight: 600; }
.card .meta { font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters input { max-width: 260px; } .filters select { width: auto; }

/* Stage stepper */
.stepper { display: flex; gap: 2px; overflow-x: auto; margin: .25rem 0 1rem; }
.stepper button { flex: 1 0 auto; font: 600 .72rem var(--body); letter-spacing: .04em; text-transform: uppercase; padding: .55rem .6rem; border: 0; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.stepper button:first-child { border-radius: var(--radius) 0 0 var(--radius); } .stepper button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper button.done { background: var(--accent-soft); color: var(--accent); }
.stepper button.current { background: var(--accent); color: var(--accent-fg); }
.stepper button:disabled { cursor: default; }
.stepper button:disabled:not(.done):not(.current) { opacity: .6; }
.closed-banner { border-left: 4px solid var(--ok); background: var(--ok-soft); margin-bottom: 1rem; }
.ready-notice { border-left: 4px solid var(--warn, #b45309); background: var(--warn-soft, #fef3c7); margin-bottom: 1rem; }
.ready-notice p { margin-top: 0; }
.closed-banner h2 { margin-top: 0; }
select option:disabled { color: var(--muted); }

/* Work log timeline */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.log time { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.log .kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; margin-right: .4rem; }
@media (max-width: 520px) { .log li { grid-template-columns: minmax(0,1fr); gap: .1rem; } }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figure button { position: absolute; top: 4px; right: 4px; }
.photos figure.cover { outline: 2px solid var(--accent); }
.upload { display: grid; place-items: center; aspect-ratio: 1; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: .8rem; cursor: pointer; text-align: center; padding: .4rem; }
.upload input { display: none; }

/* KV list */
.kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: .35rem 1rem; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
/* Money & taxes: long labels and values wrap on phones */
.kv.wrap { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); } .kv.wrap dt, .kv.wrap dd { overflow-wrap: anywhere; }

.copy-box { position: relative; }
.copy-box textarea { font-size: .88rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.note-md { white-space: pre-wrap; font-size: .93rem; }
.note-md h1, .note-md h2, .note-md h3 { font-size: 1rem; margin: .6rem 0 .2rem; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--face); padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border-radius: 10px; padding: 1.6rem; display: grid; gap: .6rem; }
.login-card .faceplate-label { color: var(--accent); }

/* Assistant */
.mic-fab { position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(var(--badge-clear) + env(safe-area-inset-bottom, 0px)); width: 62px; height: 62px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-fg); box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; z-index: 40; display: grid; place-items: center; }
.assistant { position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(var(--badge-clear) + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 24px)); max-height: min(calc(100vh - var(--badge-clear) - 90px), 680px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3); z-index: 50; display: flex; flex-direction: column; }
.assistant-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: var(--face); color: var(--accent); border-radius: 10px 10px 0 0; }
.assistant-head .btn { margin-left: auto; color: var(--face-fg); }
.assistant-log { padding: .8rem; overflow-y: auto; flex: 1; display: grid; gap: .6rem; align-content: start; }
.msg { padding: .5rem .7rem; border-radius: 8px; font-size: .9rem; max-width: 92%; white-space: pre-wrap; }
.msg.you { background: var(--panel-2); justify-self: end; }
.msg.bot { background: var(--accent-soft); }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg ul { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .82rem; }
.assistant-form { padding: .7rem .8rem .8rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; }
.assistant-form .row { justify-content: flex-end; }
.btn.mic.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.rec-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--bad); display: inline-block; }
.btn.mic.on .rec-dot { background: #fff; animation: blink 1s infinite; }
.meter { display: flex; gap: 3px; height: 8px; } .meter i { flex: 1; background: var(--panel-2); border-radius: 2px; }
.meter.live i { animation: vu 0.9s infinite ease-in-out; } .meter.live i:nth-child(n+5) { background: var(--accent); }
.meter.live i:nth-child(2){animation-delay:.1s}.meter.live i:nth-child(3){animation-delay:.2s}.meter.live i:nth-child(4){animation-delay:.3s}.meter.live i:nth-child(5){animation-delay:.4s}.meter.live i:nth-child(6){animation-delay:.5s}.meter.live i:nth-child(7){animation-delay:.6s}
@keyframes vu { 0%,100% { background: var(--ok); opacity: .35 } 50% { opacity: 1 } }
@keyframes blink { 50% { opacity: .2 } }
@media (prefers-reduced-motion: reduce) { .meter.live i, .btn.mic.on .rec-dot { animation: none; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--face); color: var(--face-fg); padding: .6rem 1rem; border-radius: var(--radius); z-index: 60; font-size: .9rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

@media (max-width: 720px) {
  .top-actions .btn.ghost { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  /* Phones: the tab row scrolls sideways. Show a thin scrollbar and fade the edges so it's clear there are more tabs
     (Todd, Oct 22: Price guide was off-screen with no sign it was there). */
  .tabs { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; padding-bottom: 4px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%); }
  .tabs::-webkit-scrollbar { height: 4px; }
  .tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 2px; }
}
/* Desktop/laptop: a mouse can't swipe the tab row, so wrap the tabs onto a second line instead of hiding them off-screen. */
@media (min-width: 721px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
}
@media (min-width: 721px) and (max-width: 1439px) {
  .tabs { order: 3; flex-basis: 100%; }
}

/* Printable claim tag */
@media print {
  .topbar, .mic-fab, .assistant, .no-print, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .view { padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.claim-tag { border: 2px solid #000; padding: 1rem; max-width: 420px; font-family: var(--body); color: #000; }
.claim-tag .big { font: 700 2rem var(--mono); }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .88rem; cursor: pointer; justify-self: start; text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.camera-btn { margin-top: .6rem; justify-content: center; width: 100%; padding: .8rem; font-size: 1rem; cursor: pointer; }
.appraisal .sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .8rem 0 .2rem; }
.appraisal .kv { margin: .6rem 0; }
ul.tight { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
ul.tight li { margin: .15rem 0; }
.buy { border-left: 3px solid var(--warn); margin-bottom: 1rem; }

/* Checkout checklists */
.checklist-panel { border-left: 3px solid var(--line); }
.checklist-panel.todo { border-left-color: var(--warn); } .checklist-panel.doing { border-left-color: var(--accent); } .checklist-panel.done { border-left-color: var(--ok); }
.cl-meter { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin: .4rem 0; } .cl-meter i { display: block; height: 100%; background: var(--accent); }
.cl-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.cl-step { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .8rem; align-items: center; }
.cl-step.pass { border-left-color: var(--ok); } .cl-step.fail { border-left-color: var(--bad); background: var(--bad-soft); } .cl-step.na { border-left-color: var(--muted); }
.cl-text { font-weight: 500; } .cl-n { font-family: var(--mono); color: var(--muted); margin-right: .5rem; font-size: .85rem; }
.cl-inputs { grid-column: 1; display: flex; gap: .4rem; flex-wrap: wrap; } .cl-inputs input { width: auto; flex: 1 1 140px; padding: .35rem .5rem; font-size: .88rem; }
.cl-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .3rem; }
.cl-btns .btn { min-width: 3.4rem; justify-content: center; padding: .55rem .6rem; }
.cl-btns .res-pass.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.cl-btns .res-fail.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.cl-btns .res-na.on { background: var(--muted); border-color: var(--muted); color: #fff; }
.cl-who { grid-column: 1 / -1; }
@media (max-width: 600px) { .cl-step { grid-template-columns: minmax(0, 1fr); } .cl-btns { grid-column: 1; grid-row: auto; } .cl-btns .btn { flex: 1; } }
.gate-warn { color: var(--warn); background: var(--warn-soft); padding: .4rem .6rem; border-radius: var(--radius); margin-top: .4rem; flex-basis: 100%; }
.tpl-steps { padding-left: 1.4rem; display: grid; gap: .4rem; margin: .8rem 0; }
.tpl-steps li { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tpl-steps .t-text { flex: 1 1 260px; } .tpl-steps .t-unit { width: 5rem; }
.t-opt { display: inline-flex; align-items: center; gap: .25rem; margin: 0; font-weight: 500; color: var(--fg); font-size: .82rem; } .t-opt input { width: auto; }
.t-move { display: inline-flex; gap: .2rem; }

.spark { display: block; margin: .4rem 0; max-width: 100%; }

/* Approvals (marketing): one card per drafted listing; big tap targets on phones. */
.approve-card h2 { font-size: 1.15rem; }
.approve-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 520px; }
.approve-card details { border-top: 1px solid var(--line); padding: .55rem 0; }
.approve-card details:last-of-type { border-bottom: 1px solid var(--line); }
.approve-card summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.posts { display: grid; gap: .6rem; }
.post { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .65rem; display: grid; gap: .4rem; }
.post textarea { font-size: .88rem; }
.approve-actions { margin-top: 1rem; }
.hand-row, .loose-post { display: grid; gap: .45rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.hand-row:first-of-type, .loose-post:first-of-type { border-top: 0; }
@media (max-width: 600px) {
  .approve-actions .btn { flex: 1 1 auto; justify-content: center; }
  .approve-actions .btn.primary { flex: 1 1 100%; justify-content: center; padding: .75rem; font-size: 1rem; }
  .hand-row .btn.small { padding: .5rem .7rem; font-size: .85rem; }
}

/* ─────────────── Scout role (migration 013) ─────────────── */
/* Scouts and logins without a role see only their own screen: no shop tabs, quick buttons or assistant. */
body.scout-mode #tabs, body.scout-mode .top-actions a { display: none !important; }
.verdict { font-weight: 600; padding: .35rem .7rem; border-radius: 6px; display: inline-block; }
.verdict.worth_it { background: var(--ok-soft, #e1f2e7); color: var(--ok, #2e7d4f); }
.verdict.maybe { background: var(--warn-soft, #fff1d6); color: var(--warn, #a86400); }
.verdict.pass { background: var(--bad-soft, #fbe3e1); color: var(--bad, #b3261e); }
.choice-row { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.find { border-top: 1px solid var(--line, #ddd); padding: .8rem 0; display: grid; gap: .4rem; }
.find:first-child { border-top: 0; }
.find .thumbs { display: flex; gap: .4rem; flex-wrap: wrap; }
.find .thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 4px; }
/* Phones hide the header Sign out for staff; scouts have no other screen, so keep it for them. */
body.scout-mode .top-actions .btn.ghost { display: inline-flex !important; }

/* Phone line (Sprint 5) */
.phone-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.phone-item { padding: .5rem .6rem; border-bottom: 1px dashed var(--line); }
.phone-item.open { border-left: 3px solid var(--warn, #c77700); }
.phone-item p { margin: .3rem 0 0; overflow-wrap: anywhere; }
.phone-item audio { max-width: 100%; height: 2rem; }
.phone-item.outbound p { color: var(--muted); }
.text-pics { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; align-items: center; }
.text-pic { display: grid; place-items: center; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel, #fff); }
.text-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Texting opt-in dialogs (card-s6-sms-optin part 2) */
.optin-dlg { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); padding: 1.2rem; }
.optin-dlg::backdrop { background: rgb(0 0 0 / .45); }
.optin-dlg h2 { margin-top: 0; }
.optin-dlg [role=radiogroup] { margin: .8rem 0; flex-wrap: wrap; }
.optin-box { display: flex; gap: .7rem; align-items: flex-start; font-size: 1.05rem; line-height: 1.45; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2, var(--bg)); }
.optin-box input { width: 1.6rem; height: 1.6rem; flex: none; margin-top: .1rem; }
.sig-wrap { position: relative; margin: .8rem 0 .4rem; }
.sig-wrap canvas { display: block; width: 100%; height: 11rem; background: #fff; border: 2px dashed var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: .8rem; bottom: .5rem; font-size: .8rem; color: #888; pointer-events: none; }
.optin-dlg .stack { display: grid; gap: .5rem; margin: .8rem 0; }
.optin-dlg .form-img { display: block; max-width: 100%; height: auto; margin-bottom: .8rem; border: 1px solid var(--line); background: #fff; }
.optin-dlg label:has(> input[type=radio]), .optin-dlg label:has(> input[type=checkbox]), .optin-check { display: flex; gap: .55rem; align-items: center; font-size: .95rem; font-weight: 400; color: var(--fg); letter-spacing: 0; }
.optin-dlg input[type=radio], .optin-dlg input[type=checkbox], .optin-check input { width: 1.25rem; height: 1.25rem; flex: none; margin: 0; }
.optin-dlg label.optin-box { align-items: flex-start; font-size: 1.05rem; }
.optin-dlg .optin-box input { width: 1.6rem; height: 1.6rem; margin-top: .1rem; }
.optin-dlg .stack label input:not([type]) { width: auto; flex: 1 1 8rem; min-width: 0; }
.optin-dlg .stack > label { min-width: 0; }
/* Consignment agreement signing (migration 028) */
.agree-dlg { width: min(52rem, calc(100vw - 2rem)); }
/* Todd, Nov 20 1:35 PM: on the tablet the Save button of the signing dialog couldn't be reached: the dialog was taller
   than the screen and swiping over the agreement text or the signature box doesn't scroll the dialog. The buttons now
   stay pinned to the bottom of the dialog, and the text and signature box get shorter on short screens. */
.optin-dlg .dlg-actions { position: sticky; bottom: -1.2rem; z-index: 1; margin: .6rem -1.2rem -1.2rem; padding: .5rem 1.2rem 1rem; background: var(--panel); border-top: 1px solid var(--line); }
.optin-dlg .dlg-actions p:empty { display: none; }
@media (max-height: 820px) { .optin-dlg .agree-text { max-height: 26vh; } .sig-wrap canvas { height: 8.5rem; } }
@media (max-height: 650px) { .optin-dlg .agree-text { max-height: 15vh; } .sig-wrap canvas { height: 7rem; } .optin-dlg [role=radiogroup] { margin: .4rem 0; } }
.agree-text { max-height: 40vh; overflow: auto; padding: .8rem 1rem; margin: .6rem 0 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #111; font-size: .95rem; line-height: 1.45; }
.agree-text h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.agree-text p { margin: 0 0 .55rem; }

/* Estimate replies by text (migration 041) */
#estReplies ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .7rem; }
#estReplies li p { margin: .35rem 0 0; }
/* Item status (Nov 9): bench-to-shelf steps grouped; parts / discarded apart */
.st-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: 1rem; }
.steps-st { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 100%; }
.steps-st .btn { border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.steps-st .btn:last-child { border-right: 0; }
.steps-st .n { font: 600 .72rem var(--mono, monospace); opacity: .7; }
.st-side { display: inline-flex; gap: .4rem; flex-wrap: wrap; padding-left: .8rem; border-left: 2px solid var(--line); }
@media (max-width: 600px) {
  .steps-st { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .steps-st .btn { border-right: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; padding-block: .55rem; }
  .steps-st .btn:last-child { border-bottom: 0; }
  .st-side { border-left: 0; padding-left: 0; }
}
/* Invoice (Sales, migration 047) */
.invoice { color: var(--fg); }
@media screen { .invoice { overflow-x: auto; } }  /* a wide invoice table scrolls inside its panel on phones, not the page */
.invoice table { width: 100%; border-collapse: collapse; margin: .8rem 0; }
.invoice th, .invoice td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.invoice .num { text-align: right; }
.inv-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.inv-head h2 { margin: 0 0 .2rem; }
/* Letterhead: new sign logo + phone (Todd, Nov 11) */
.inv-brand { display: grid; gap: .15rem; justify-items: start; }
.inv-logo { display: block; width: 260px; max-width: 100%; height: auto; margin-bottom: .3rem; }
.inv-phone { font-weight: 700; font-size: 1.1rem; }
.tag-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto .4rem; }
.tag-phone { text-align: center; font-weight: 700; margin-bottom: .5rem; }
@media print { .inv-logo { width: 2.6in; } .tag-logo { max-width: 2.8in; } }
.inv-meta { text-align: right; }
.inv-totals { max-width: 22rem; margin-left: auto; }
.inv-terms { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.inv-terms p { margin: .3rem 0; }
@media print {
  .invoice { box-shadow: none; border: 0; padding: 0; color: #000; }
  .invoice th, .invoice td { border-color: #999; }
}
/* Label preview + printable estimate / repair invoice (card-bl-estimatepdf) */
.label-preview { display: block; width: 100%; max-width: 406px; height: auto; border: 1px solid var(--line); image-rendering: pixelated; background: #fff; margin: .4rem 0; }
@media print {
  /* Printing one document from a page prints ONLY that document: the rest of the ticket (notes, repair log, unclaimed
     equipment steps) never goes on the customer's paper (found Nov 16). */
  body[data-print] .view > :not(.print-only) { display: none !important; }
  /* data-print on <body> picks the one document to print; without it the claim tag prints, as before */
  body[data-print] .print-only { display: none !important; }
  body[data-print="tag"] .print-only.p-tag,
  body[data-print="estimate"] .print-only.p-docs, body[data-print="invoice"] .print-only.p-docs { display: block !important; }
  body[data-print="estimate"] .p-doc:not(.p-estimate), body[data-print="invoice"] .p-doc:not(.p-invoice) { display: none !important; }
  body:not([data-print]) .print-only.p-docs { display: none !important; }
  body[data-print="credit"] .print-only.p-credit { display: block !important; }  /* store credit slip (097) */
}
/* Hand-back screen after check-in signing */
.handback { text-align: center; padding: 3rem 1.5rem; max-width: 36rem; margin: 2rem auto; }
.handback h1 { font-size: 1.8rem; margin: 0 0 1rem; }
.handback p { font-size: 1.15rem; }
/* Camera scan dialog (scan-to-sell) */
.scan-dlg video { display: block; width: 100%; max-width: 480px; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 6px; }
/* Reason dialog (askReason) */
dialog.reason-dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg); padding: 1rem; max-width: calc(100vw - 32px); }
dialog.reason-dlg::backdrop { background: rgba(0, 0, 0, .45); }
.inbox-filter { margin: 0 0 .7rem; align-items: center; }

/* Teardown recorder (card-bl-bench-video): stays at the bottom of the screen while the camera is on or a video is uploading */
.video-dock[hidden] { display: none; }
.video-dock { position: fixed; right: .5rem; bottom: .5rem; width: min(26rem, calc(100vw - 1rem)); max-height: 85vh; overflow: auto; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.35); }

/* Display cards (card-bl-display-cards): quarter page, 4.25 x 5.5 in, black on white on screen and paper */
.dc-list label { flex-wrap: wrap; padding: .3rem 0; align-items: center; }
.dc-list input { width: auto; }
.dc-preview { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.dc-one { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; max-width: 100%; }
.dcard { box-sizing: border-box; width: 4.25in; height: 5.49in; overflow: hidden; padding: .3in; background: #fff; color: #111; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .05in; font: 10.5pt/1.35 system-ui, Arial, sans-serif; border: 1px solid #999; overflow-wrap: anywhere; }
.dcard > * { margin: 0; flex-shrink: 0; max-width: 100%; }
.dcard .dc-logo { width: 1.25in; height: auto; }
.dcard .dc-name { font-size: 16pt; line-height: 1.15; color: #111; }
.dcard .dc-sub { font-size: 9.5pt; }
.dcard .dc-price { font-size: 24pt; font-weight: 700; line-height: 1.15; }
.dcard .dc-grade { font-weight: 700; }
.dcard .dc-about { white-space: pre-line; font-size: 10pt; }
.dcard .dc-notes { font-size: 8.5pt; white-space: pre-line; }
.dcard .dc-no { margin-top: auto; font-size: 8pt; align-self: flex-end; }
@media (max-width: 480px) { .dc-preview .dcard { zoom: .8; } }
.dc-dlg { width: 32rem; }
@media print {
  body:not([data-print="cards"]) .print-only.p-cards { display: none !important; }
  body[data-print="cards"] .print-only.p-cards { display: block !important; }
  body[data-print="cards"] { margin: 0; padding: 0; background: #fff; }
  body[data-print="cards"] #app, body[data-print="cards"] main, body[data-print="cards"] .view { margin: 0; padding: 0; max-width: none; }
  .dc-sheet { width: 8.5in; height: 10.98in; display: grid; grid-template-columns: 4.25in 4.25in; grid-template-rows: 5.49in 5.49in; break-after: page; }
  .dc-sheet:last-child { break-after: auto; }
  .p-cards .dcard { border: 0; outline: 1px dashed #999; outline-offset: -1px; }
}
