/* Tendril OS — shared look for the floor tools.
   One palette and one set of parts (header, toolbar, tiles, table, drawer, pills…)
   used by the newer pages, plus a "legacy skin" at the bottom that restyles the
   class names the older pages use so everything reads as one app.
   Link it LAST so its rules win over a page's inline <style>. */

:root {
  --bg: #111113; --surface: #1c1c20; --surface-raised: #242429; --surface-hover: #2c2c33;
  --border: #333339; --border-strong: #44444c; --text: #e6e6eb; --text-dim: #87878f; --text-mute: #6b6b74;
  --green: #6bc94a; --green-bg: #0d3326; --red: #f87171; --red-bg: #3b1515;
  --blue: #5ba9dd; --blue-bg: #0b2a3a; --yellow: #f7c635; --yellow-bg: #3b3209;
  --purple: #c084fc; --purple-bg: #2b1a4a; --orange: #fb923c; --orange-bg: #3d2008;
  --cyan: #22d3ee; --cyan-bg: #0b3340; --pink: #f472b6; --pink-bg: #3d1530;
  --sun: var(--yellow); --sun-bg: var(--yellow-bg); --teal: var(--cyan); --teal-bg: var(--cyan-bg); --sky: var(--blue); --sky-bg: var(--blue-bg);
  --green-dim: #4c9a35; --sun-dim: #c99a1f;
  --f-ui: 'DM Sans', system-ui, sans-serif; --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 10px; --r-sm: 8px;
}
html, body { background: var(--bg); }
body { margin:0; }   /* no browser 8 px edge around the header (shared look, CL-6296c65a1a) */
body { font-family: var(--f-ui); color: var(--text); }
button, input, select, textarea { font-family: inherit; }

/* ── Header ─────────────────────────────────────────────────────── */
.t-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--surface); position:sticky; top:0; z-index:5; flex-wrap:wrap; }
.t-brand { display:flex; align-items:center; gap:10px; min-width:0; }
.t-brand-icon { width:30px; height:30px; border-radius:6px; display:grid; place-items:center; color:#111; font-weight:700; font-size:13px; flex:none; background:var(--green); }
/* light view (Amy, 2026-11-21: "should be white not black icon for light theme"): its colors are darker, so letters and icons on a filled
   color are white — the page tile (Configure's gear too), filled date badges and filled color buttons (CL-2b227e8883) */
html[data-tview="light"] .t-brand-icon, html[data-tview="light"] .brand-icon, html[data-tview="light"] .t-brand-icon svg,
html[data-tview="light"] .cell.today .dn > span:first-child, html[data-tview="light"] .ac-btns .ac-go { color:#fff; }
.t-brand h1 { font-size:16px; font-weight:600; white-space:nowrap; margin:0; }
.t-brand h1 span { color:var(--text-dim); font-weight:400; }
.t-live { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }   /* wraps on 320px phones instead of pushing past the edge */
.t-status { font-size:12px; color:var(--text-dim); white-space:nowrap; }

/* ── Controls ───────────────────────────────────────────────────── */
.t-btn { padding:8px 12px; background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--r-sm); color:var(--text); font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; line-height:1.2; }
.t-btn:hover { background:var(--surface-hover); }
.t-btn:disabled { opacity:.45; cursor:default; }
.t-btn[hidden], .t-header .t-btn.icon[hidden] { display:none !important; }   /* a hidden button stays hidden whatever display the shared look gives it */
.t-btn.go { background:var(--green-bg); border-color:var(--green); color:var(--green); }
.t-btn.danger { background:var(--red-bg); border-color:var(--red); color:var(--red); }
.t-btn.warn { background:var(--yellow-bg); border-color:var(--yellow); color:var(--yellow); }
.t-btn.icon { padding:8px 10px; font-size:15px; line-height:1; }
.t-btn.small { padding:5px 9px; font-size:11.5px; }
.t-btn.spin { animation:t-spin 1s linear infinite; }
@keyframes t-spin { to { transform:rotate(360deg); } }
.t-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.t-search { flex:1 1 180px; min-width:0; padding:8px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); color:var(--text); font-size:13px; outline:none; }
.t-sel { padding:8px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); color:var(--text); font-size:13px; outline:none; max-width:100%; }
.t-search:focus, .t-sel:focus, .t-input:focus { border-color:var(--green); }
.t-input { width:100%; padding:8px 10px; background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--r-sm); color:var(--text); font-size:13px; outline:none; }
.t-label { font-size:10.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--text-dim); display:block; margin-bottom:4px; }
.t-field { display:grid; gap:2px; }
.t-seg { display:inline-flex; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); overflow:hidden; }
.t-seg button { padding:8px 11px; background:none; border:none; border-right:1px solid var(--border); color:var(--text-dim); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.t-seg button:last-child { border-right:none; }
.t-seg button.on { background:var(--surface-raised); color:var(--text); box-shadow:inset 0 -2px 0 var(--green); }
.t-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-dim); white-space:nowrap; cursor:pointer; padding:7px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); }
.t-chip input { accent-color:var(--green); }
.t-spacer { flex:1; }

/* ── Tiles ──────────────────────────────────────────────────────── */
.t-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
.t-tile { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:12px 14px; }
.t-tile .lbl { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); margin-bottom:6px; }
.t-tile .val { font-family:var(--f-mono); font-size:22px; font-weight:600; line-height:1.1; }
.t-tile .val small { font-size:12px; color:var(--text-dim); font-weight:400; margin-left:4px; font-family:var(--f-ui); }
.t-tile .sub { font-size:12px; color:var(--text-dim); margin-top:4px; }

/* ── Table ──────────────────────────────────────────────────────── */
.t-table-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); overflow:auto; }
.t-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.t-table th, .t-table td { padding:9px 12px; text-align:left; border-bottom:1px solid var(--border); white-space:nowrap; vertical-align:middle; }
.t-table th { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); font-weight:600; background:var(--surface-raised); position:sticky; top:0; z-index:1; }
.t-table th.sortable { cursor:pointer; user-select:none; }
.t-table th.sortable::after { content:''; margin-left:5px; opacity:.5; }
.t-table th.sort-asc::after { content:'▲'; } .t-table th.sort-desc::after { content:'▼'; }
.t-table th.num, .t-table td.num { text-align:right; font-family:var(--f-mono); font-variant-numeric:tabular-nums; }
.t-table tbody tr:hover { background:var(--surface-hover); }
.t-table tbody tr.clickable { cursor:pointer; }
.t-table tbody tr:last-child td { border-bottom:none; }
.t-table td .sub { display:block; font-size:11.5px; color:var(--text-dim); font-family:var(--f-mono); margin-top:2px; }
.t-table td .muted { color:var(--text-dim); }
.t-table tr.group td { background:var(--surface-raised); font-weight:600; color:var(--text-dim); }

/* ── Pills ──────────────────────────────────────────────────────── */
.t-pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; letter-spacing:.03em; background:var(--surface-raised); color:var(--text-dim); white-space:nowrap; }
.t-pill.green { background:var(--green-bg); color:var(--green); } .t-pill.blue { background:var(--blue-bg); color:var(--blue); }
.t-pill.yellow { background:var(--yellow-bg); color:var(--yellow); } .t-pill.red { background:var(--red-bg); color:var(--red); }
.t-pill.purple { background:var(--purple-bg); color:var(--purple); } .t-pill.orange { background:var(--orange-bg); color:var(--orange); }
.t-pill.cyan { background:var(--cyan-bg); color:var(--cyan); } .t-pill.pink { background:var(--pink-bg); color:var(--pink); }
.t-pill.outline { background:none; border:1px dashed var(--text-dim); }

/* ── Drawer / modal ─────────────────────────────────────────────── */
.t-scrim { position:fixed; top:0; right:0; bottom:0; left:0; background:rgba(0,0,0,.55); display:none; z-index:20; }
.t-scrim.show { display:block; }
.t-drawer { position:fixed; top:0; right:0; bottom:0; width:min(460px,100%); background:var(--surface); border-left:1px solid var(--border); z-index:21; transform:translateX(100%); transition:transform .18s ease; overflow:auto; padding:16px; display:grid; gap:12px; align-content:start; }
.t-drawer.show { transform:none; }
.t-drawer { overflow-x:hidden; box-sizing:border-box; }          /* width:100% must include the padding on phones */
.t-drawer *, .t-grid2 > * { min-width:0; }
.t-drawer .t-section, .t-drawer details, .t-drawer .confirm { max-width:100%; overflow-wrap:anywhere; }
.t-drawer .t-actions .t-btn { white-space:normal; }
.t-drawer input, .t-drawer select, .t-drawer textarea { max-width:100%; box-sizing:border-box; }
.t-drawer h2, .t-drawer .sub, .t-drawer dd { overflow-wrap:anywhere; }
.t-drawer h2 { font-size:18px; margin:0; padding-right:40px; }
.t-drawer .sub { color:var(--text-dim); font-size:13px; margin-top:-8px; }
.t-drawer .close { position:absolute; top:10px; right:10px; }
.t-drawer .kv { display:grid; grid-template-columns:130px 1fr; gap:6px 12px; font-size:13px; }
.t-drawer .kv dt { color:var(--text-dim); } .t-drawer .kv dd { margin:0; font-family:var(--f-mono); }
.t-drawer .kv dd.txt { font-family:var(--f-ui); }
.t-actions { display:flex; flex-wrap:wrap; gap:8px; }
.t-section { border-top:1px solid var(--border); padding-top:12px; display:grid; gap:10px; }
.t-section h3 { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); margin:0; }
.t-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }

/* ── Misc ───────────────────────────────────────────────────────── */
.t-wrap { padding:14px 16px 40px; max-width:1300px; margin:0 auto; }
.t-empty { padding:30px 16px; text-align:center; color:var(--text-dim); font-size:14px; }
.t-error { margin-bottom:12px; padding:10px 12px; background:var(--red-bg); color:var(--red); border-radius:var(--r-sm); font-size:13px; }
.t-foot { margin-top:12px; font-size:12px; color:var(--text-dim); line-height:1.5; }
.t-legend { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:12px; color:var(--text-dim); margin-bottom:10px; }
.t-toast { position:fixed; bottom:20px; left:50%; transform:translate(-50%, 80px); background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--r-sm); padding:11px 16px; font-size:13px; box-shadow:0 8px 28px rgba(0,0,0,.5); opacity:0; transition:all .22s ease; z-index:60; max-width:90vw; }
.t-toast.show { transform:translate(-50%, 0); opacity:1; }
.t-toast.err { border-color:var(--red); color:var(--red); }
.t-cards { display:grid; gap:8px; }
.t-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:10px 12px; cursor:pointer; }
.t-card:hover { background:var(--surface-hover); }
.t-card .v { font-weight:600; font-size:14px; }
.t-card .m { font-size:12px; color:var(--text-dim); margin-top:2px; }
.t-scroll-hint { display:none; font-size:11px; color:var(--text-dim); margin:-6px 0 8px; }
@media (max-width:700px) {
  .t-brand h1 span { display:none; }
  .t-tile .val { font-size:18px; }
  .t-drawer { left:0; width:100%; border-left:none; padding:14px 12px; }   /* full-width sheet: nothing to scroll sideways */
  .t-drawer .kv { grid-template-columns:1fr; gap:2px 0; } .t-drawer .kv dd { margin-bottom:6px; }
  .t-drawer .kv dd, .t-drawer .sub, .t-drawer h2 { white-space:normal; }
  .t-grid2 { grid-template-columns:1fr; }
  html, body { overflow-x:hidden; overflow-x:clip; }   /* clip (not hidden) keeps the sticky header stuck to the window; hidden first for old browsers */
  /* iOS zooms the page when a focused field's text is under 16px, which is what lets it pan sideways */
  .t-drawer input, .t-drawer select, .t-drawer textarea, .modal input, .modal select, .modal textarea, .t-input, .t-sel, .t-search, .qty-in { font-size:16px; }
  .t-scroll-hint { display:block; }
}

/* ── Shared look (Amy, 2026-11-21, CL-6296c65a1a "Shared look for every page"; colors and fonts come from Look & feel, CL-ed28456cdd) ──
   Header right side, in this order: status, page buttons, ? , refresh, gear (all .t-btn.icon, 32 px). Page tabs: .t-ptabs under the header.
   View switches: .t-seg. Types and states: .t-pill (soft fill). Warnings: .t-flag (outlined with !). Settings: .t-switch. Cards: .t-group. */
.t-header .t-btn.icon { width:32px; height:32px; padding:0; display:inline-grid; place-items:center; font-size:15px; }
.t-header .t-btn { min-height:32px; }
.t-ptabs { display:flex; gap:4px; padding:0 16px; background:var(--surface); border-bottom:1px solid var(--border); overflow-x:auto; scrollbar-width:none; }
.t-ptabs > a, .t-ptabs > button { padding:11px 14px; font:inherit; font-size:14px; font-weight:600; color:var(--text-dim); text-decoration:none; background:none; border:0;
  border-bottom:2px solid transparent; white-space:nowrap; cursor:pointer; }
.t-ptabs > a:hover, .t-ptabs > button:hover { color:var(--text); }
.t-ptabs > .on, .t-ptabs > [aria-current="page"], .t-ptabs > [aria-selected="true"] { color:var(--text); border-bottom-color:var(--green); }
.t-flag { --fc:var(--yellow); display:inline-flex; align-items:center; gap:5px; padding:1px 8px 1px 3px; border-radius:6px; border:1.5px solid var(--fc); color:var(--fc);
  font-size:12px; font-weight:600; white-space:nowrap; background:none; }
.t-flag::before { content:'!'; width:14px; height:14px; border-radius:999px; background:var(--fc); color:var(--bg); display:inline-grid; place-items:center; font-size:10px; font-weight:800; flex:none; }
.t-flag.orange { --fc:var(--orange); } .t-flag.red { --fc:var(--red); }
.t-banner { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:baseline; padding:9px 14px; border-radius:var(--r); border:1.5px solid var(--yellow); color:var(--yellow); font-size:13px; margin-bottom:12px; }
.t-banner.orange { border-color:var(--orange); color:var(--orange); } .t-banner.red { border-color:var(--red); color:var(--red); }
.t-banner > b::before { content:'! '; } .t-banner .more { color:inherit; }
.t-banner.green { border-color:var(--green); color:var(--green); } .t-banner.green > b::before { content:''; }
/* the ⋯ menu in a phone header (brand/hdr-more.js): hidden on wider screens, a dropdown of the header's other buttons on phones */
.t-more { position:relative; display:none; }
@media (max-width:700px) { .t-more { display:inline-flex; } .t-header { flex-wrap:nowrap; } .t-header .t-live { flex-wrap:nowrap; min-width:0; }
  .t-header .t-brand { min-width:0; flex:1 1 0; } .t-header .t-live { flex:0 0 auto; } .t-header .t-brand h1 { overflow:hidden; text-overflow:ellipsis; min-width:0; } }
.t-more-btn { font-size:18px !important; line-height:1; } .t-more-btn[hidden] { display:none !important; }
.t-more-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:60; min-width:220px; max-width:calc(100vw - 24px); max-height:70vh; overflow:auto;
  background:var(--surface-raised); border:1px solid var(--border-strong); border-radius:var(--r); box-shadow:0 12px 32px rgba(0,0,0,.45); padding:6px;
  display:flex; flex-direction:column; gap:4px; }
.t-more-menu[hidden] { display:none; }
.t-more-menu > * { width:100%; box-sizing:border-box; }
.t-more-menu > .t-btn, .t-more-menu > a, .t-more-menu > button { display:flex; align-items:center; justify-content:flex-start; gap:8px; min-height:44px; padding:8px 12px; border:0;
  background:none; border-radius:var(--r-sm); text-align:left; white-space:normal; color:var(--text); }
.t-more-menu > .t-btn:hover, .t-more-menu > a:hover, .t-more-menu > button:hover { background:var(--surface-hover); }
.t-more-menu > .t-btn.danger { color:var(--red); }
.t-more-menu > [data-mlabel]::after { content:attr(data-mlabel); font-size:14px; font-weight:600; }
.t-header .t-more-menu > .t-btn.icon, .t-header .t-more-menu > .t-btn { width:100%; height:auto; min-height:44px; display:flex; place-items:initial; justify-content:flex-start; white-space:nowrap; font-size:14px; }
.t-more-menu > select, .t-more-menu > label, .t-more-menu > .t-sel { min-height:44px; }
.t-more-menu > [hidden] { display:none !important; }

/* a link to another page, in a header or a toolbar: blue text ending in › (no box) */
.t-hlink, a.to-page, .hdr-link, .hlink { color:var(--blue); font-size:13px; font-weight:600; text-decoration:none; white-space:nowrap; }
.t-hlink:hover, a.to-page:hover, .hdr-link:hover, .hlink:hover { text-decoration:underline; }
a.t-btn { color:var(--text); }
.t-switch { position:relative; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; }
.t-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.t-switch .knob { width:36px; height:20px; border-radius:999px; background:var(--border-strong); position:relative; transition:background .15s; flex:none; }
.t-switch .knob::after { content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:999px; background:var(--text); transition:transform .15s; }
.t-switch input:checked + .knob { background:var(--green); } .t-switch input:checked + .knob::after { transform:translateX(16px); background:var(--bg); }
.t-switch input:focus-visible + .knob { outline:2px solid var(--blue); outline-offset:2px; }
.t-group { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); overflow:hidden; }
.t-group > .t-group-bar { display:flex; align-items:center; gap:10px; padding:8px 16px; background:var(--surface-raised); border-bottom:1px solid var(--border);
  font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); }
.t-group > .t-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:10px 16px; border-bottom:1px solid var(--border); font-size:13px; }
.t-group > .t-row:last-child { border-bottom:none; }
.t-group .t-row .name { font-weight:700; } .t-group .t-row .hint { font-size:12px; color:var(--text-dim); }
/* "Show more" fold (CL-3219be0325): <details class="t-fold"><summary>Title <span class="sub">count</span></summary>…</details> */
.t-fold { border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface); min-width:0; }
.t-fold > summary { cursor:pointer; list-style:none; padding:9px 12px; font-weight:600; font-size:13px; display:flex; justify-content:space-between; gap:8px; align-items:center; min-height:36px; box-sizing:border-box; }
.t-fold > summary::-webkit-details-marker { display:none; }
.t-fold > summary .sub { margin-left:auto; color:var(--text-dim); font-weight:400; font-size:12px; margin-top:0; }
.t-fold > summary::after { content:'▸'; color:var(--text-dim); transition:transform .15s; }
.t-fold[open] > summary::after { transform:rotate(90deg); }
.t-fold[open] > summary { border-bottom:1px solid var(--border); }
@media (prefers-reduced-motion:reduce) { .t-fold > summary::after { transition:none; } }
.t-input, .t-sel, .t-search { min-height:36px; box-sizing:border-box; }
@media (max-width:700px) { .t-header .t-status { display:none; } .t-ptabs { padding:0 8px; } .t-input, .t-sel, .t-search, select, input[type=text], input[type=number], input[type=search], input[type=date] { font-size:16px; } }

/* ── Legacy skin: the class names the older pages use ───────────── */
header:not(.t-header) { background:var(--surface) !important; border-bottom:1px solid var(--border) !important; }
header:not(.t-header) h1 { font-size:16px !important; font-weight:600 !important; }
header:not(.t-header) h1 span { color:var(--text-dim) !important; font-weight:400 !important; }
header:not(.t-header) .brand-icon { border-radius:6px !important; }
.btn:not(.t-btn) { border-radius:var(--r-sm) !important; font-weight:600 !important; font-size:13px !important; }
.btn-go, .btn-green, .btn-check { background:var(--green-bg) !important; border:1px solid var(--green) !important; color:var(--green) !important; }
.btn-go:hover, .btn-green:hover { background:#124a33 !important; }
.btn-ghost { background:var(--surface-raised) !important; border:1px solid var(--border) !important; color:var(--text) !important; }
.btn-ghost:hover { background:var(--surface-hover) !important; }
.btn-audit, .btn-edit, .btn-split { background:var(--surface-raised) !important; border:1px solid var(--border) !important; color:var(--text) !important; }
.search:not(.t-search), .filter-select:not(.t-sel), .form-input, .form-select, .field-input, .text-input, .qty-input, .select-inline, .date-input, .num-input, .scan-input {
  background:var(--surface) !important; border:1px solid var(--border) !important; border-radius:var(--r-sm) !important; color:var(--text) !important;
}
.search:not(.t-search):focus, .filter-select:not(.t-sel):focus, .form-input:focus, .form-select:focus, .field-input:focus, .scan-input:focus { border-color:var(--green) !important; outline:none; }
.table-wrap:not(.t-table-wrap) { background:var(--surface) !important; border:1px solid var(--border) !important; border-radius:var(--r) !important; }
.table-wrap:not(.t-table-wrap) th { font-size:11px !important; letter-spacing:.08em !important; text-transform:uppercase !important; color:var(--text-dim) !important; background:var(--surface-raised) !important; font-weight:600 !important; }
.table-wrap:not(.t-table-wrap) td { border-bottom:1px solid var(--border) !important; }
.toast:not(.t-toast) { background:var(--surface-raised) !important; border:1px solid var(--border) !important; border-radius:var(--r-sm) !important; box-shadow:0 8px 28px rgba(0,0,0,.5) !important; }
.state { color:var(--text-dim) !important; }
.record-card, .results-card, .selected-batch-card, .create-batch-item, .batch-item, .search-results, .modal-box, .checkout-log, .camera-wrap {
  background:var(--surface) !important; border:1px solid var(--border) !important; border-radius:var(--r) !important;
}
.create-batch-item.selected, .batch-item.selected { border-color:var(--green) !important; background:var(--green-bg) !important; }
.mode-tabs { background:var(--surface) !important; border-bottom:1px solid var(--border) !important; }
.mode-tab { color:var(--text-dim) !important; font-weight:600 !important; }
.mode-tab.active { color:var(--green) !important; border-bottom-color:var(--green) !important; }
.btn-camera { background:var(--surface-raised) !important; border:1px solid var(--border) !important; border-radius:var(--r-sm) !important; color:var(--text) !important; font-weight:600 !important; }
.btn-camera.active { background:var(--red-bg) !important; border-color:var(--red) !important; color:var(--red) !important; }
.btn-save { background:var(--green-bg) !important; border:1px solid var(--green) !important; border-radius:var(--r-sm) !important; color:var(--green) !important; font-weight:600 !important; }
.btn-scan { background:var(--green-bg) !important; border:1px solid var(--green) !important; border-radius:var(--r-sm) !important; color:var(--green) !important; font-weight:600 !important; }

/* Native form controls follow the dark theme (iOS/WebKit drew filter selects white with near-invisible text) */
select, input, textarea { color-scheme: dark; }

/* a tick box alone in a table cell: the whole cell ticks it (brand/tap-area.js, CL-6296c65a1a) */
td:has(> input[type=checkbox]:only-child), th:has(> input[type=checkbox]:only-child) { cursor:pointer; }

/* ── Pop-ups (Amy, 2026-11-21: every pop-up matches the shared look, same as the confirm box in brand/progress.js) ──
   New pop-ups: .t-modal-bg (.show) > .t-modal (.wide) > .t-modal-h (h2 + .t-modal-x) + .t-modal-b + .t-modal-f (buttons right, .t-btn.go = main).
   Older pop-ups keep their own classes (page scripts use them); the skin below gives them the same panel, title, close and buttons. */
.t-modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:60; display:none; align-items:flex-start; justify-content:center; padding:6vh 16px; overflow-y:auto; box-sizing:border-box; }
.t-modal-bg.show { display:flex; }
.t-modal { width:min(520px,100%); display:flex; flex-direction:column; box-sizing:border-box; }
.t-modal.wide { width:min(760px,100%); }
.t-modal-h { display:flex; align-items:center; gap:8px; padding:16px 16px 8px; }
.t-modal-h h2, .t-modal-h h3 { flex:1; min-width:0; margin:0; }
.t-modal-h .sub { color:var(--text-dim); font-size:12.5px; }
.t-modal-b { padding:4px 16px 12px; display:grid; gap:10px; font-size:13px; min-width:0; }
.t-modal-b > * { min-width:0; }
.t-modal-f { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; padding:12px 16px; border-top:1px solid var(--border); }
html body :is(.t-modal, .me-dlg > .me-box, .scrim > .modal, .modal-wrap > .modal, .modal-scrim > .modal, .dlg-bg > .dlg, .scrim > .sheet,
  .td-pop-bg > .td-pop, .pk-pop, .mf, .mbg > .mdl, .modal-overlay > .modal-box, .ac-box, dialog:not(.t-raw)) {
  background:var(--surface); color:var(--text); border:1px solid var(--border-strong); border-radius:var(--r); box-shadow:0 18px 50px rgba(0,0,0,.6);
  font-family:var(--f-ui); }
html body :is(.scrim, .modal-wrap, .modal-scrim, .me-dlg, .dlg-bg, .td-pop-bg, .pk-pop-bg, .mf-bg, .mbg, .modal-overlay, .ac-ov) { background:rgba(0,0,0,.6); }
html body dialog::backdrop { background:rgba(0,0,0,.6); }
/* title: the first heading in the pop-up, as in the confirm box */
html body :is(.t-modal-h, .me-box, .scrim > .modal, .modal-wrap > .modal, .modal-scrim > .modal, .dlg, .scrim > .sheet, .td-pop-head, .pk-pop, .mf-h, .mdl, .ac-box, dialog) > :is(h2, h3):first-of-type,
html body :is(.scrim > .modal, .modal-wrap > .modal, .td-pop, .mdl, .ac-box) > :first-child > :is(h2, h3):first-of-type {
  font-size:16px; font-weight:600; letter-spacing:0; text-transform:none; color:var(--text); }
/* close ✕: plain, dim, the same size everywhere */
html body :is(.t-modal-x, .t-modal .close, .modal .x, .modal .close, .td-pop-head button, #mX, .mf-h .x, .ac-x, dialog .x) {
  background:none; border:none; color:var(--text-dim); font-size:20px; line-height:1; padding:4px 6px; min-width:32px; min-height:32px; cursor:pointer; border-radius:var(--r-sm); }
html body :is(.t-modal-x, .modal .x, .modal .close, .td-pop-head button, #mX, .ac-x, dialog .x):hover { color:var(--text); background:var(--surface-hover); }
/* the buttons row: right side, main button green (.t-btn.go) */
html body :is(.me-box, .modal, .dlg, .sheet, .td-pop, .pk-pop, .mdl, dialog, dialog > form) > :is(.t-actions, .foot, .actions, .btns, .row):last-child { justify-content:flex-end; }
@media (max-width:480px) {
  /* a short pop-up sits at the bottom; a tall one scrolls from its title (flex-end would cut off its top) */
  .t-modal-bg { align-items:flex-start; padding:8px; } .t-modal-bg > .t-modal { margin-top:auto; }
  .t-modal-f .t-btn { flex:1; justify-content:center; }
}

/* ── Selection bar: the one bar above a list once rows are ticked (Amy, Nov 23, 2026, CL-3bceeb501f: one shared selection bar). "<b>N</b> selected",
   the actions for the ticked rows, Clear. Kept at the top while scrolling (Amy, Nov 21: "i dont like the actions at the bottom of the page").
   TP.selBar(el, n, buttonsHtml, onClear) fills one; a page with a fixed bar in its HTML just gives it class t-selbar. */
.t-selbar { position:sticky; top:env(safe-area-inset-top, 0px); z-index:6; background:var(--surface-raised, var(--surface)); border:1px solid var(--border-strong, var(--border)); border-radius:var(--r);
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:8px 12px; margin-bottom:10px; font-size:13px; }
.t-selbar[hidden] { display:none; }   /* display:flex above would beat the hidden attribute */
.t-selbar .cnt { margin-right:auto; } .t-selbar .cnt b, .t-selbar > span > b:first-child { font-family:var(--f-mono); }
.t-selbar .t-sel { max-width:200px; }
