/* T-49 History — the shared view's styles (src/core/history-view.js), loaded by the website and the extension. Built only on the
   tokens both pages define (--line, --line-strong, --surface, --surface-2, --ink, --ink-2, --brand, --ok/-bg, --warn/-bg, --bad/-bg,
   --radius, --radius-s, --fs-0, --fs-1), so light and dark follow each page's own theme. Phone width first (13 Oct screenshots at 400 px):
   the three views share the width, the dates sit side by side, every row is one column of text beside its tick box. Its OWN class names
   (.hv-*) only — the page's .hist / .field rules never reach in. */
.hv{display:grid;gap:12px;min-width:0;container:hv / inline-size}   /* T-511: the view measures its OWN width (the rows below follow it, never the window) */
/* T-529 (his pick B, 20 Nov: "B (chips) + the picked chip's text bold"; mock-up ~/projects/tm30-scratch-keep/t529-mock): the filter chips,
   the Guests tab's round chips (src/core/guest-card.css .gc-filters): All · Scanned · Downloaded · Submitted on ONE line at 360 px; the picked
   one filled (--chip-on, powder blue, black words in both themes) with BOLD words, the others outlined, normal weight. Each chip is a label
   round its radio (drawn hidden; its focus ring shows on the chip). Below 360 px they may wrap, never clip. No counts (the line under says it) */
.hv .hv-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.hv .hv-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 12px;margin:0;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:400;line-height:1;white-space:nowrap;cursor:pointer;box-sizing:border-box}
.hv .hv-chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.hv .hv-chip:has(input:checked){background:var(--chip-on);border-color:var(--chip-on);color:var(--chip-on-ink);font-weight:700}
.hv .hv-chip:has(input:focus-visible){outline:2px solid var(--focus);outline-offset:2px}
@media (hover:hover){.hv .hv-chip:not(:has(input:checked)):hover{background:var(--surface-2)}}
@container hv (max-width:339px){.hv .hv-chips{gap:4px}.hv .hv-chip{padding:0 9px;font-size:12.5px}}   /* the website's view at a 360 px phone is 298 px: the four still fit one line */
@container hv (max-width:299px){.hv .hv-chip{padding:0 7px;font-size:12px}}
.hv-tools{display:grid;gap:8px 10px;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
.hv-date{display:grid;gap:2px;min-width:0;font-size:var(--fs-0);color:var(--ink-2)}
.hv-q{grid-column:1 / -1}
/* T-511 (Lane A's find 18 Nov): the dates and the search on one row only when THE VIEW is wide enough for the search to keep its whole hint
   (two 11.5em dates + ~220 px of search; T-516b took "Download All" off this row, so 640 px, was 800). Keyed on the view, never the window:
   the extension's panel, capped at 560 px, keeps them stacked. The calendar pop-up is not held by the container: date-field.js lifts it to
   the page's body while open (test/t511-history-tools.test.js checks it opens under its date) */
@container hv (min-width:640px){.hv-tools{grid-template-columns:11.5em 11.5em minmax(0,1fr)}.hv-q{grid-column:auto}}
.hv input[type=text],.hv input[type=search]{width:100%;min-width:0;min-height:44px;padding:8px 10px;box-sizing:border-box;border:1px solid var(--field-line,var(--line-strong,var(--line)));border-radius:var(--radius-s,6px);background:var(--surface);color:var(--ink);font:inherit;font-variant-numeric:tabular-nums}
.hv input[type=text]:focus,.hv input[type=search]:focus{border-color:var(--brand-text);box-shadow:0 0 0 3px var(--brand-glow,transparent);outline:2px solid var(--focus);outline-offset:1px}
.hv .dt .dt-row > input.dt-text{padding-right:calc(var(--dt-size,44px) + 2px)}
.hv-sync{margin:0;padding:8px 12px;border-radius:var(--radius-s);background:var(--warn-bg);color:var(--warn);font-size:var(--fs-1)}
/* T-516 (his pick 19 Nov, option A "the tidy box"; mock-up ~/projects/tm30-scratch-keep/t516-mock section A), the computer panel, the phone
   app tab and the website alike, Scanned and Excel downloaded. Narrow: row 1 = "N selected" (bold) at the left, Select All · Clear as quiet
   links at the right (real buttons with the link look: --brand-text, no fill); row 2 = Restore (N) (red since T-517) and Download (N)
   (outlined since T-517) at EQUAL width, 44 px tall. Wide (the VIEW 520 px or more): one line, the count and the links, then the two at the right.
   Tokens only (dark follows). Before T-516: T-509's pair beside filled Select All / Clear buttons that never lined up */
.hv-selbar{display:grid;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius,var(--radius-s));background:var(--surface-2);min-width:0}
.hv-selbar[hidden]{display:none}
/* T-529 (his pick B): nothing ticked → the bar is ONE plain line under the chips, "54 guests" (bold) left, Select All right; the tidy box
   (above) only once a guest is ticked (.hv-on) */
.hv-selbar:not(.hv-on){display:flex;align-items:center;justify-content:space-between;padding:0 2px;border:0;background:none}
.hv .hv-selbar:not(.hv-on) .hv-selhead{flex:1 1 auto;justify-content:space-between}   /* the count left, Select All right, at every width (the wide box's flex-start is for the ticked box) */
.hv-sellinks > [hidden]{display:none}
.hv-selhead{display:flex;align-items:center;justify-content:space-between;gap:6px 8px;flex-wrap:wrap;min-width:0}   /* the count and the links share row 1 down to a 320 px phone (the website's view: 258 px) */
.hv-seltext{font-weight:700;font-size:var(--fs-1,14px);color:var(--ink);white-space:nowrap}
.hv-sellinks{display:inline-flex;align-items:center;gap:2px;color:var(--ink-2)}
.hv .hv-selbar button.hv-link{min-height:32px;padding:4px;margin:0;border:0;border-radius:var(--radius-s,6px);background:none;box-shadow:none;color:var(--brand-text);font:inherit;font-weight:600;font-size:var(--fs-1,14px);line-height:1.2;text-decoration:none;cursor:pointer;transform:none}
.hv .hv-selbar button.hv-link:disabled{opacity:.5;cursor:default}
@media (hover:hover){.hv .hv-selbar button.hv-link:not(:disabled):hover{background:none;color:var(--ink);text-decoration:underline;text-underline-offset:2px}}
.hv .hv-selbar button.hv-link:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.hv-selpair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
.hv-selpair:has(> [hidden]){grid-template-columns:minmax(0,1fr)}   /* one action shown (Download only: Submitted, or every row already in her list): it takes the row */
.hv-selpair[hidden],.hv-selpair > [hidden]{display:none}
.hv .hv-selpair > button{min-width:0;min-height:44px;margin:0;padding:8px 10px;border-radius:var(--radius-s,6px);font:inherit;font-weight:600;font-size:var(--fs-1,14px);line-height:1.2;white-space:normal;text-wrap:balance;justify-content:center;text-align:center}
/* T-517 pick 1 (his 19 Nov: "Restore button can maybe be our tertiary red colour?"; his rule: the ONE main call-to-action of a screen is
   red): Restore (N) is History's main action (--action, the panel's slight fall to --action-2, its own hover); Download (N) drops to
   outlined (--sec-*), also when it stands alone (Submitted), so the bar has one filled button. The rows' Restore / Delete stay links */
.hv .hv-selpair > button.hv-selbring{background:var(--action);background-image:linear-gradient(180deg,var(--action),var(--action-2,var(--action)));color:var(--action-ink);border:1px solid transparent;box-shadow:none}
.hv .hv-selpair > button.hv-selcsv{background:var(--sec-bg);color:var(--sec-ink);border:1px solid var(--sec-line);box-shadow:none}
@media (hover:hover){.hv .hv-selpair > button.hv-selbring:not(:disabled):hover{background:var(--action-hover);background-image:none;border-color:transparent;color:var(--action-ink)}
  .hv .hv-selpair > button.hv-selcsv:not(:disabled):hover{background:var(--surface-2);border-color:var(--ink-2);color:var(--sec-ink)}}
.hv .hv-selpair > button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
@container hv (min-width:520px){
  .hv-selbar{display:flex;align-items:center;gap:12px}
  .hv-selhead{flex:1 1 auto;justify-content:flex-start;flex-wrap:nowrap}
  .hv-selpair{flex:0 0 auto;grid-template-columns:1fr 1fr}   /* still the grid: the two at EQUAL width (the wider one's), as below 520 px (one shown: :has above keeps one column) */
  .hv .hv-selpair > button{white-space:nowrap;padding-left:14px;padding-right:14px}
}
/* T-496 (his review 17 Nov 11:08: "a short description of the 2 differences") → T-513: the internal file's one line under the bar, close to it */
.hv-seldesc{display:grid;gap:2px;margin-top:-6px;padding:0 12px;font-size:var(--fs-0);color:var(--ink-2)}
.hv-seldesc p{margin:0}
.hv-seldesc[hidden],.hv-seldesc p[hidden]{display:none}
/* what a Restore that failed says (the sync line's look) */
.hv-filemsg{margin:0;padding:8px 12px;border-radius:var(--radius-s);background:var(--warn-bg);color:var(--warn);font-size:var(--fs-1)}
.hv-body{display:grid;gap:14px;min-width:0}
.hv-empty{margin:0;padding:18px 14px;border:1px dashed var(--line);border-radius:var(--radius);color:var(--ink-2);text-align:center}
.hv-list{list-style:none;margin:0;padding:0;display:grid;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);min-width:0}
.hv-row{display:grid;grid-template-columns:28px minmax(0,1fr);column-gap:10px;row-gap:3px;align-items:start;padding:12px}
.hv-row + .hv-row{border-top:1px solid var(--line)}
.hv-pick{grid-column:1;grid-row:1;display:grid;place-items:center;width:44px;height:44px;margin:-8px}   /* T-187 E3: a 44 px tap target round the 18 px box */
.hv-pick input{width:18px;height:18px;margin:0}
.hv-main,.hv-sub,.hv-acts{grid-column:2;min-width:0}
.hv-main{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;min-height:28px}
.hv-name{overflow-wrap:anywhere}
.hv-sub{font-size:var(--fs-0);color:var(--ink-2);overflow-wrap:anywhere}
.hv-changed{color:var(--warn);font-weight:600}   /* T-171 (R4): "Dates changed after this. Submit again." */
.hv-acts{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding-top:6px}
.hv-inlist{font-size:var(--fs-0);color:var(--ok);font-weight:600;margin-right:4px}
.hv-pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:6px;font-size:var(--fs-0);font-weight:600;white-space:nowrap}
.hv-pill.ok{background:var(--ok-bg);color:var(--ok)}
.hv-pill.warn{background:var(--warn-bg);color:var(--warn)}
.hv-pill.bad{background:var(--bad-bg);color:var(--bad)}
.hv-group{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2);min-width:0}
.hv-ghead{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;justify-content:space-between}
.hv-gtitle{min-width:0;overflow-wrap:anywhere}
.hv-gsub{color:var(--ink-2)}
.hv-acts.hv-gacts{grid-column:1 / -1;padding-top:0}   /* a file's / Save's buttons span the box — the rows' column-2 rule is for rows only */
.hv-nonum{max-width:36em}
.hv-past-h{margin:0;font-size:var(--fs-1)}
.hv-pastrow{grid-template-columns:minmax(0,1fr)}
.hv-pastrow .hv-name,.hv-pastrow .hv-sub{grid-column:1}
.hv-keep,.hv-siteonly{margin:0}
.hv-msg:empty{display:none}
/* (T-187 D3's sliding highlight under the three views went with T-529's chips) */
/* T-182 #1 (short list R6): the banner "3 guests scanned on iPhone today." [Add to list] [Not now] — the top of the Guests tab on both
   surfaces (HistoryView.arrivals); its own class names, the tokens both pages define */
.hv-arr{display:grid;gap:8px;margin:0 0 12px;padding:12px 14px;border:1px solid var(--brand-text);border-radius:var(--radius);background:var(--surface-2);color:var(--ink);min-width:0}
.hv-arr[hidden],.hv-arr-line[hidden],.hv-arr-acts[hidden],.hv-arr-msg[hidden]{display:none}
.hv-arr-line{margin:0;font-weight:600;overflow-wrap:anywhere}
.hv-arr-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.hv-arr-msg{margin:0;font-size:var(--fs-1);color:var(--ink-2);overflow-wrap:anywhere}
/* T-221 (his ask 15 Oct, with a screenshot of ~230 px a guest; plan §5d): THE compact row — tick · name · pill on line 1, ONE meta line
   under it, the actions at the row's right (both surfaces); the extension's actions are small inline text buttons (≥ 28 px tap targets),
   the website's small buttons. Notes (dates changed, already in a file) take a line only when there is one. Wraps at 400 px. */
.hv-row.hv-compact{grid-template-columns:28px minmax(0,1fr) auto;column-gap:10px;row-gap:1px;align-items:center;padding:8px 10px}
.hv-compact .hv-pick{grid-row:1 / span 2;align-self:start}   /* T-529: the tick on the name's line (the mock-up), the 44 px target round it */
.hv-compact .hv-main{grid-column:2;grid-row:1;min-height:24px;gap:2px 8px}
.hv-compact .hv-line2{grid-column:2 / 4;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;min-width:0;line-height:1.35}
.hv-compact .hv-meta{white-space:normal;line-height:1.35;min-width:0}
.hv-compact .hv-racts{grid-column:3;grid-row:1;padding-top:0;gap:2px 4px;flex-wrap:nowrap;justify-content:flex-end}
.hv-compact > .hv-sub:not(.hv-meta){grid-column:2 / 4;line-height:1.35}
.hv-compact .hv-name{font-size:var(--fs-1,14px)}
/* T-517 spot 16 + pick 4 A: the rows' Restore · Delete are these small text links on BOTH surfaces (the website's were boxed buttons) */
.hv-compact .hv-link{min-height:28px;min-width:28px;margin:0;padding:2px 4px;border:0;background:transparent;color:var(--brand-text);font:inherit;font-size:var(--fs-0,13px);font-weight:600;line-height:1.2;border-radius:var(--radius-s,6px);cursor:pointer;box-shadow:none;white-space:nowrap}
.hv-compact .hv-link:hover{background:var(--surface-2)}
.hv-compact .hv-link:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
.hv-compact .hv-link.hv-del{color:var(--bad)}
/* T-517 pick 4 A: the name is a button that opens the row's details (scan time, device, property, number kept until): it reads as the bold
   name with a small chevron (turned when open); the details line spans the row under the meta. The page's own button looks never reach it */
.hv .hv-compact button.hv-open{display:flex;justify-content:flex-start;align-items:center;gap:6px;min-height:0;margin:0;padding:0;border:0;border-radius:var(--radius-s,6px);background:none;box-shadow:none;color:var(--ink);font:inherit;font-weight:700;font-size:var(--fs-1,14px);line-height:1.2;text-align:left;cursor:pointer;transform:none}
.hv .hv-compact button.hv-open:hover{background:none;color:var(--ink);text-decoration:underline;text-underline-offset:2px}
.hv .hv-compact button.hv-open:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.hv .hv-compact button.hv-open::after{content:"";flex:none;width:6px;height:6px;margin-top:-3px;border:solid var(--ink-2);border-width:0 1.5px 1.5px 0;transform:rotate(45deg);transition:transform .15s ease}
.hv .hv-compact button.hv-open[aria-expanded="true"]::after{margin-top:3px;transform:rotate(-135deg)}
.hv-compact > .hv-more{grid-column:2 / 4;line-height:1.35}
.hv-more[hidden]{display:none}
.hv-keepmore{color:var(--brand-text);font-weight:600}
/* 0.3.5 (the preview shots, 21 Oct 15:50: "a row whose name is long pushes its Ready pill onto a second line … 82–103 px high instead
   of the 72 px"): in the extension's rows (≈ 175 px for the name and the pill at 400 px) the pill KEEPS the name's line — the name wraps
   first, at its spaces (a single word longer than the room still breaks), its lines a little tighter so two lines still fit 72 px; the
   pill centred on the name's first line; a little less room round the two links (.hv-link: 4 px a side, still ≥ 28 px targets).
   T-243 (21 Oct): never at the name's cost — the name keeps at least 5.5em (about 7 letters); a pill that leaves it less (the long
   "TM30 showed an error", or a panel narrower than 400 px) goes under the name as before, wrapping its own words if it must. The website's
   rows: unchanged */
.hv-row.hv-compact{column-gap:8px}   /* T-517 pick 4 A: the website's rows are the extension's (were .hv-ext only) */
.hv-compact .hv-main{flex-wrap:wrap;align-items:flex-start;gap:4px 6px}
.hv-compact .hv-name{flex:1 1 5.5em;min-width:0;line-height:1.2}
.hv-compact .hv-pill{flex:none;max-width:100%;white-space:normal;padding:2px 7px;font-size:11.5px;font-weight:700;line-height:1.3}   /* T-529: on line 2 now, the stage tag's size */
.hv-compact .hv-racts{gap:2px;flex-wrap:nowrap}
.hv-already{color:var(--ink-2);font-weight:600}   /* §10f 3b: "Already in a file (14 Oct)" */
.hv-tm30{color:var(--bad);overflow-wrap:anywhere}   /* T-243: “TM30 said: …” under a TM30 error */
/* T-517 pick 4's extra (his 19 Nov: "delete and restore should be on the same line"): the two links stay side by side on the name's line at
   every width (were: wrapping at 420 px; the website's boxed pair on its own line under 480 px) */
/* T-529 (his pick B, 20 Nov): the stage tag on line 2, in All only — Scanned (neutral, a thin ring) · Downloaded (the brand's soft fill) ·
   Submitted (green; its tick DRAWN here, never typed into the words, T-187 A12). The tag that asks for a look (To check, amber) sits after it */
.hv-stage{display:inline-flex;align-items:center;gap:4px;flex:none;padding:2px 7px;border-radius:6px;font-size:11.5px;font-weight:700;line-height:1.3;white-space:nowrap}
.hv-stage-scanned{background:var(--surface-2);color:var(--ink-2);box-shadow:inset 0 0 0 1px var(--line-strong)}
.hv-stage-downloaded{background:var(--brand-soft);color:var(--brand-text)}
.hv-stage-submitted{background:var(--ok-bg);color:var(--ok)}
.hv-stage-submitted::before{content:"";width:7px;height:4px;margin:-2px 1px 0 0;border:solid currentColor;border-width:0 0 2px 2px;transform:rotate(-45deg)}
/* T-529 (the mock-up): a ticked row is tinted, so what Restore (N) / Download (N) take is seen at a glance */
.hv-row.hv-compact:has(> .hv-pick input:checked){background:var(--brand-soft)}
/* T-529: the scan day's small header inside the one list ("Today · 20 Nov") */
.hv-day{padding:6px 12px;background:var(--surface-2);color:var(--ink-2);font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;line-height:1.3}
.hv-day:first-child{border-radius:var(--radius) var(--radius) 0 0}
.hv-day:not(:first-child),.hv-row + .hv-day{border-top:1px solid var(--line)}
.hv-day + .hv-row{border-top:0}
/* T-529 (the mock-up's wide picture): the view 640 px or wider (the website at a computer) → one line a row, in columns: tick · name ·
   line 2 (tags + details) · Restore / Delete; the details / notes lines under them, from the name's column */
@container hv (min-width:640px){
  .hv-row.hv-compact{grid-template-columns:28px minmax(10em,1fr) minmax(0,2fr) auto;column-gap:12px}
  /* the columns line up from row to row: every row takes the LIST's columns (subgrid); the day headers span them */
  @supports (grid-template-columns:subgrid){
    .hv-list:has(> .hv-compact){grid-template-columns:28px minmax(10em,1fr) minmax(0,2fr) auto;column-gap:12px}
    .hv-list > li{grid-column:1 / -1}
    .hv-row.hv-compact{grid-template-columns:subgrid}
  }
  .hv-compact .hv-pick{grid-row:1;align-self:center}
  .hv-compact .hv-main{grid-column:2;grid-row:1}
  .hv-compact .hv-line2{grid-column:3;grid-row:1}
  .hv-compact .hv-racts{grid-column:4;grid-row:1}
  .hv-compact > .hv-sub:not(.hv-meta),.hv-compact > .hv-more{grid-column:2 / -1}
}
