/* ============================================================================
   Vintage Mio — Assisted Intake & Grading pipeline (flagship).
   Extends the shared design tokens; loaded after admin.css. Dark-first, gold
   accent, one accent reserved for the primary action / current step.
   ========================================================================== */

/* mode + queue header ------------------------------------------------------ */
.intake-top { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
  justify-content: space-between; margin-bottom: var(--sp-5); }
.mode-switch { display: inline-flex; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; }
.mode-switch button { border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-weight: var(--fw-semibold); padding: 8px 18px; min-height: 40px;
  border-radius: var(--r-pill); cursor: pointer; transition: background 160ms ease, color 160ms ease; }
.mode-switch button[aria-selected="true"] { background: var(--gold-500); color: #16110a; }
.mode-switch button:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; }

.queue-counts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.qc { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm);
  color: var(--text-muted); background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 6px 12px; }
.qc b { color: var(--text); font-variant-numeric: tabular-nums; }
.qc[data-k="published"] b { color: var(--gold-300); }

/* stepper ------------------------------------------------------------------ */
.stepper { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.stepper .step { display: flex; align-items: center; gap: 10px; flex: 1 1 120px; font: inherit; text-align: left; cursor: default;
  min-width: 120px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-muted);
  font-size: var(--fs-sm); }
.stepper .step .n { width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; font-size: 13px; }
.stepper .step.active { border-color: var(--gold-500); color: var(--text); }
.stepper .step.active .n { background: var(--gold-500); color: #16110a; border-color: var(--gold-500); }
.stepper .step.done .n { background: var(--success); color: #08130c; border-color: transparent; }
.stepper .step.done { color: var(--text); }
.stepper .step.can-go { cursor: pointer; }
.stepper .step.can-go:hover { border-color: var(--gold-500); color: var(--ink-050); }
.stepper .step.can-go:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

/* candidate list ----------------------------------------------------------- */
.cand-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.cand { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--sp-3);
  align-items: center; padding: var(--sp-3); border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface-1);
  transition: border-color 160ms ease, transform 120ms ease; }
.cand:hover { border-color: var(--ink-500); }
.cand .thumb { width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; }
.cand .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cand .thumb svg { width: 30px; height: 30px; color: var(--text-faint); }
.cand .c-title { font-weight: var(--fw-semibold); color: var(--text); }
.cand .c-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; }
.cand .c-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cand .c-meta span { font-size: var(--fs-xs); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px 8px;
  font-variant-numeric: tabular-nums; }

/* enrichment preview ------------------------------------------------------- */
.enrich-preview { display: grid; grid-template-columns: 160px 1fr; gap: var(--sp-5);
  align-items: start; }
.enrich-preview .cover { width: 160px; height: 160px; border-radius: var(--r-md); }
.enrich-preview dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-4);
  margin: 0; }
.enrich-preview dt { color: var(--text-faint); font-size: var(--fs-sm); }
.enrich-preview dd { margin: 0; color: var(--text); font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; }
.src-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  color: var(--text-muted); }
.src-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint); }
.src-tag.ok::before { background: var(--success); }

/* photo capture grid ------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-4); }
.photo-slot { position: relative; border: 1px dashed var(--border); border-radius: var(--r-md);
  background: var(--surface-1); aspect-ratio: 1 / 1; overflow: hidden;
  display: grid; place-items: center; cursor: pointer; text-align: center;
  transition: border-color 160ms ease, background 160ms ease; }
.photo-slot:hover { border-color: var(--gold-500); }
.photo-slot.filled { border-style: solid; }
/* The inputs are hidden; the two buttons below open them (see renderPhotoGrid). */
.photo-slot input[type=file] { display: none; }
.photo-slot { cursor: default; }
.photo-slot .ps-actions { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.photo-slot.filled .ps-actions { opacity: 0; transition: opacity 120ms ease; }
.photo-slot.filled:hover .ps-actions, .photo-slot.filled:focus-within .ps-actions { opacity: 1; }
@media (hover: none) { .photo-slot.filled .ps-actions { opacity: 1; } }  /* a finger cannot hover */
.photo-slot .ps-body { padding: var(--sp-3); color: var(--text-muted); }
.photo-slot .ps-body svg { width: 30px; height: 30px; color: var(--text-faint); }
.photo-slot .ps-kind { display: block; font-weight: var(--fw-semibold); color: var(--text);
  font-size: var(--fs-sm); margin-top: 8px; }
.photo-slot .ps-hint { display: block; font-size: var(--fs-xs); margin-top: 2px; }
.photo-slot img.shot { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.photo-slot .ps-tag { position: absolute; left: 8px; top: 8px; z-index: 2;
  background: rgba(0,0,0,.62); color: #fff; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  padding: 3px 8px; border-radius: var(--r-pill); }
.photo-slot .ps-clear { position: absolute; right: 8px; top: 8px; z-index: 3;
  border: 0; width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.62); color: #fff; display: none; place-items: center; }
.photo-slot.filled .ps-clear { display: grid; }
.photo-slot.filled .ps-body { display: none; }
img.shot.rake { filter: grayscale(1) contrast(2.1) brightness(1.15); }

.defect-block { margin-top: var(--sp-3); }
.defect-block h4 { font-size: var(--fs-sm); text-transform: uppercase;
  letter-spacing: var(--tracking-caps); color: var(--text-faint); margin: 0 0 8px; }
.defect-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.defect-chips button { border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-muted); border-radius: var(--r-pill); padding: 6px 12px; min-height: 36px;
  font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: all 140ms ease; }
.defect-chips button[aria-pressed="true"] { background: var(--gold-500); color: #16110a;
  border-color: var(--gold-500); }
.defect-chips button:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; }

/* grade suggestion --------------------------------------------------------- */
.grade-suggest { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4);
  margin-bottom: var(--sp-4); }
.grade-card { border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-1); padding: var(--sp-4); }
.grade-card .gc-k { font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: var(--tracking-caps); color: var(--text-faint); }
.grade-card .gc-ai { font-size: var(--fs-sm); color: var(--text-muted); margin: 8px 0; }
.grade-card select { width: 100%; min-height: 44px; }
.conf-bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2);
  overflow: hidden; margin: 6px 0; }
.conf-bar span { display: block; height: 100%; background: var(--gold-500);
  transition: width 300ms cubic-bezier(.25,1,.5,1); }

/* value table -------------------------------------------------------------- */
.price-grid { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.price-grid th, .price-grid td { text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.price-grid td.num, .price-grid th.num { text-align: right; }
.price-grid tr.match td { color: var(--gold-200); font-weight: var(--fw-semibold); }
.hv-flag { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3);
  border-radius: var(--r-md); background: rgba(217,171,66,.12);
  border: 1px solid var(--gold-600); color: var(--gold-100); margin-bottom: var(--sp-4); }
.hv-flag svg { width: 22px; height: 22px; flex: none; color: var(--gold-300); }

/* review + publish --------------------------------------------------------- */
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-4); }
.review-grid .r { background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-3); }
.review-grid .r .rk { font-size: var(--fs-xs); color: var(--text-faint);
  text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.review-grid .r .rv { font-weight: var(--fw-semibold); color: var(--text); margin-top: 4px;
  font-variant-numeric: tabular-nums; }

.publish-done { text-align: center; padding: var(--sp-6) var(--sp-4); }
.publish-done .disc { width: 64px; height: 64px; color: var(--gold-400); margin: 0 auto var(--sp-3); }

/* batch queue panel -------------------------------------------------------- */
.intake-layout { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
.intake-layout.with-queue { grid-template-columns: minmax(0,1fr) 320px; }
.queue-panel { border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface-1); padding: var(--sp-4); align-self: start;
  position: sticky; top: calc(var(--sp-5)); max-height: calc(100vh - 120px); overflow: auto; }
.queue-panel h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-md); }
.queue-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--sp-3); }
.q-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--ink-850);
  cursor: pointer; transition: border-color 140ms ease; }
.q-item:hover { border-color: var(--ink-500); }
.q-item.current { border-color: var(--gold-500); }
.q-item .q-ref { font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item .q-st { font-size: var(--fs-xs); color: var(--text-faint); }
.q-item .q-st[data-s="published"] { color: var(--gold-300); }
.q-item .q-st[data-s="graded"] { color: var(--gold-200); }
.q-item .q-x { margin-left: auto; border: 0; background: transparent; color: var(--text-faint);
  cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
.q-item .q-x:hover { color: var(--danger); background: var(--surface-2); }

@media (max-width: 900px) {
  .intake-layout.with-queue { grid-template-columns: 1fr; }
  .queue-panel { position: static; max-height: none; }
  .enrich-preview { grid-template-columns: 1fr; }
  .enrich-preview .cover { width: 120px; height: 120px; }
  .grade-suggest { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .conf-bar span, .mode-switch button, .cand, .photo-slot { transition: none; }
}

/* ── The counter (#/admin/register) ──────────────────────────────────────────
   Till ergonomics: big targets, the total always visible, and print rules so a
   receipt prints clean (a thermal printer just prints the page). */
.till { display: grid; grid-template-columns: 1fr 340px; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .till { grid-template-columns: 1fr; } }
.till-side { position: sticky; top: var(--sp-4); }
.till-hits { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.till-hit { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-1); color: var(--text); cursor: pointer; min-height: 56px; }
.till-hit:hover:not(:disabled) { border-color: var(--gold-400); }
.till-hit:disabled { opacity: .5; cursor: not-allowed; }
.till-hit .th-title { font-weight: 650; }
.till-hit .th-meta { grid-column: 1; font-size: var(--fs-xs); color: var(--text-muted); }
.till-hit .th-price { grid-row: 1 / span 2; align-self: center; font-weight: 700; color: var(--gold-300); }
.till-empty, .till-none { padding: 22px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 12px; }
.till-list { display: flex; flex-direction: column; gap: 8px; }
.till-line { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); }
.till-line .tl-title { font-weight: 650; }
.till-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 999px; background: var(--surface-2);
  color: var(--gold-300); border: 1px solid var(--border); }
/* ---- Store credit -------------------------------------------------------
   The CODE is the gift card — there is no plastic. If the customer walks out
   without it written down they have nothing, so it is set large, spaced, and in
   a monospace face where 8 and B cannot be confused. It must survive a receipt
   printer, so it prints black-on-white rather than inheriting the dark theme. */
/* The applied-credit row on the till. The code is long enough to wrap a
   label-and-amount row, which orphans the minus sign — so the code gets its own
   line under the label and the amount stays on the baseline beside it. */
.till-credit { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-top: 8px; }
.till-credit .tc-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-xs); letter-spacing: .06em; color: var(--gold-300); }
.gift-slip { margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px dashed var(--gold-300); background: var(--surface-2); }
.gift-slip-row { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; }
.gift-code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: var(--fs-lg); letter-spacing: .12em; color: var(--gold-300); }
@media print {
  .gift-slip { border-color: #000; background: #fff; }
  .gift-code { color: #000; }
}
/* ---- Cover art review ---------------------------------------------------
   A contact sheet. The image is the content, so the tile is mostly image and the
   controls sit under it rather than on top of it. */
.cov-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.cov-stat { flex: 1 1 120px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-1); display: flex;
  flex-direction: column; gap: 2px; }
.cov-stat b { font-size: var(--fs-lg); }
.cov-stat span { font-size: var(--fs-xs); color: var(--text-muted); }
.cov-stat.is-warn b { color: #e8b07c; }
/* Explains the empty tiles at the top of the list — see the note in covers.js. */
.cov-note { margin: var(--sp-4) 0 0; padding: 11px 15px; max-width: 78ch;
  border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: var(--fs-sm); line-height: 1.5; }
.cov-note b { color: var(--text); }
.cov-check { display: flex; align-items: center; gap: 8px; color: var(--text-secondary);
  font-size: var(--fs-sm); white-space: nowrap; }
.cov-check input { width: 18px; height: 18px; min-height: 0; }
.cov-grid { display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cov-tile { border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface-1); display: flex; flex-direction: column; }
.cov-img { position: relative; aspect-ratio: 1; background: var(--ink-850); }
.cov-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cov-blank { width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: var(--fs-sm);
  border-bottom: 1px dashed var(--border); }
.cov-flag { position: absolute; top: 8px; left: 8px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px;
  border-radius: 999px; background: rgba(0,0,0,.72); color: #e8b07c; }
.cov-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.cov-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.3;
  overflow-wrap: anywhere; }
.cov-sub { font-size: var(--fs-xs); }
.cov-src { color: var(--text-muted); }
/* Discogs is the one carrying a contract on top of copyright — make it findable
   by eye, not just by filter. */
.cov-src-discogs { color: #e8b07c; font-weight: var(--fw-semibold); }
.cov-src-owner { color: var(--gold-300); font-weight: var(--fw-semibold); }
.cov-src-none { color: #e08b7c; font-weight: var(--fw-semibold); }

/* How confident we are that this sleeve belongs to THIS pressing. Deliberately a
   separate line from the source: where a cover came from and whether it is the
   right one are two different questions, and merging them is how "Cover Art
   Archive" came to read as "verified" when it never meant that. */
.cov-conf { margin-top: 3px; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
            letter-spacing: .02em; cursor: help; }
.cov-conf .muted { font-weight: var(--fw-regular); }
.cov-conf-ok   { color: var(--success); }
.cov-conf-warn { color: var(--gold-300, #e6be5c); }
.cov-conf-bad  { color: #e08b7c; }
.cov-conf-mute { color: var(--text-muted); font-weight: var(--fw-regular); }
.cov-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cov-actions .btn { flex: 0 0 auto; }
.cov-upload { cursor: pointer; margin: 0; }
.cov-danger { color: #e08b7c; }

/* Catalog-at-the-counter panel — a form on a till, so the touch targets stay
   big and the two checkboxes read as sentences rather than settings. */
.till-add { margin-bottom: var(--sp-3); }
.till-add input, .till-add select { min-height: 44px; }
.till-check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  color: var(--text-secondary); font-size: var(--fs-sm); }
.till-check input { width: 20px; height: 20px; min-height: 0; flex: none; }
.till-totals .row { padding: 5px 0; }
.till-grand { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px !important;
  font-size: var(--fs-lg); font-weight: 700; }
.till-change { margin-top: 8px; font-size: var(--fs-sm); }
.till-due { color: var(--gold-300); font-weight: 700; }
.till-short { color: #e08b7c; font-weight: 700; }
#pay-cash, #pay-card, #pay-email { min-height: 44px; }
/* Star TSP100 (80mm roll, ~72mm printable). It installs as a normal OS printer,
   so the browser print dialog drives it — but the page must be sized for the roll
   or every receipt wastes most of a full sheet's worth of paper feed. */
@page { size: 72mm auto; margin: 0; }
@media print {
  body * { visibility: hidden; }
  #receipt, #receipt * { visibility: visible; }
  #receipt {
    position: absolute; top: 0; left: 0; width: 72mm; border: 0; padding: 4mm 3mm;
    background: #fff !important; color: #000 !important;
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11pt; line-height: 1.35;
  }
  #receipt * { background: transparent !important; color: #000 !important; }
  #receipt button, #receipt .btn { display: none !important; }
  #receipt .till-grand { border-top: 1px dashed #000; }
  #receipt h3 { font-size: 13pt; margin: 0 0 2mm; }
}

/* ---- Day Book verdicts --------------------------------------------------
   ⚑ THREE STATES, AND THE THIRD IS THE WHOLE POINT. A check that could not run
   must never be drawn like one that passed. Its own component rather than .chip:
   a chip is an interactive filter control, a verdict is a label. */
.db-verdict { display:inline-block; white-space:nowrap; font-size:10px;
  text-transform:uppercase; letter-spacing:.06em; font-weight:var(--fw-semibold);
  padding:3px 9px; border-radius:999px; border:1px solid transparent; }
.db-pass { background:var(--success-wash); color:var(--success);
  border-color:color-mix(in srgb, var(--success) 40%, transparent); }
.db-fail { background:var(--danger-wash); color:var(--danger);
  border-color:color-mix(in srgb, var(--danger) 40%, transparent); }
.db-unchecked { background:var(--warning-wash); color:var(--warning);
  border-color:color-mix(in srgb, var(--warning) 40%, transparent); }
.db-check { display:flex; justify-content:space-between; align-items:flex-start;
  gap:14px; padding:10px 0; border-bottom:1px solid var(--border); }
.db-check:last-child { border-bottom:0; }
.db-check code { font-size:var(--fs-xs); color:var(--text-secondary); }

/* ---- Printing a day ledger ----------------------------------------------
   ⚑ WHAT HE PRINTS HAS TO BE THE LEDGER, NOT A SCREENSHOT OF THE APP. Printing
   the page as-is puts the sidebar, the buttons and a dark background on the
   paper — and a dark background either wastes a cartridge or comes out as white
   text on white. So print resets to black on white and hides everything except
   the ledger card itself. */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .admin-nav, .admin-sidebar, nav, header, .btn, #db-export-month,
  #db-print, #db-csv, .db-day td:last-child { display: none !important; }
  #db-ledger-card {
    background: #fff !important; color: #000 !important;
    border: 0 !important; box-shadow: none !important; padding: 0 !important;
  }
  #db-ledger-card table { width: 100%; border-collapse: collapse; }
  #db-ledger-card th, #db-ledger-card td {
    border-bottom: 1px solid #ccc; padding: 4px 6px; color: #000 !important;
  }
  /* The verdict colours are the one thing worth keeping legible on paper, but
     as text rather than filled pills that swallow ink. */
  .db-verdict { background: none !important; border: 1px solid #666 !important;
                color: #000 !important; }
  @page { margin: 14mm; }
}

/* quick add ---------------------------------------------------------------- */
/* Grids that wrap on a phone. Fixed four-column rows overflowed a 375px screen
   by 24px and pushed the photo button and Add off the right edge (2026-09-20). */
.qa-grid { display: grid; gap: var(--sp-3); align-items: end; }
.qa-grid-top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.qa-grid-3 { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
.qa-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qa-grid .field input, .qa-grid .field select { min-width: 0; width: 100%; }
@media (max-width: 640px) {
  .qa-grid-top { grid-template-columns: 1fr; }
  .qa-grid-top .btn { width: 100%; }
  .qa-grid-3 { grid-template-columns: 1fr 1fr; }
  .qa-grid-3 > :first-child { grid-column: 1 / -1; }
  .qa-grid-4 { grid-template-columns: 1fr 1fr; }
  .cand { grid-template-columns: 56px 1fr; }
  .cand > .btn, .cand > .muted { grid-column: 1 / -1; justify-self: start; }
  .cand .c-meta { display: flex; flex-wrap: wrap; gap: 4px; }
}

/* Four mode tabs do not fit a phone side by side; wrapped, each became three
   lines and 93px tall (regression run, 2026-09-20). One row that scrolls. */
@media (max-width: 640px) {
  .intake-top { display: block; }
  .mode-switch { display: flex; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin-bottom: var(--sp-3); }
  .mode-switch::-webkit-scrollbar { display: none; }
  .mode-switch button { white-space: nowrap; flex: 0 0 auto; padding: 8px 14px; }
}
