/* VarianceIQ (demo for Strides GCC, a fictional retailer). Mobile first, light and dark.
   Look and feel adapted from AdminKit (MIT licence, (c) 2020-2024 AdminKit Authors, https://adminkit.io):
   its colours, Inter type, cards, navigation and tables, recreated here without Bootstrap.
   Inter is served from /fonts (SIL Open Font License, see fonts/Inter-LICENSE.txt). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); }
:root {
  color-scheme: light;
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #f1f4f9; --border: #dee2e6;
  --text: #212529; --text-2: #495057; --text-3: #5c656d;
  --accent: #2b69c4; --accent-ink: #ffffff; --accent-soft: #e6effb;
  /* Dark enough for 4.5:1 as small badge text on their own soft backgrounds (accessibility pass, 11 November 2026). */
  --good: #177332; --warn: #8a5c00; --crit: #c42b2b; --info: #2260bd;
  --good-soft: #e1f5ee; --warn-soft: #fff4d9; --crit-soft: #fbe4e6; --info-soft: #e6effb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --grid: #e9ecef; --axis: #adb5bd;
  --nav-bg: #222e3c; --nav-text: #e9ecef; --nav-muted: #a3adb8; --nav-active: #2b3947;
  --radius: 6px; --shadow: 0 0 .875rem 0 rgba(33, 37, 41, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #19212b; --surface: #222e3c; --surface-2: #2a3846; --border: #354657;
    --text: #eef1f4; --text-2: #c2ccd6; --text-3: #9dabb9;
    --accent: #6aa5f5; --accent-ink: #0f1722; --accent-soft: #233a57;
    --good: #4cc26a; --warn: #e0b040; --crit: #ef6b6b; --info: #6aa5f5;
    --good-soft: #1d3a2e; --warn-soft: #3d3420; --crit-soft: #452628; --info-soft: #233a57;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --grid: #2f3d4c; --axis: #6f7f8f;
    --nav-bg: #141b23; --nav-text: #e9ecef; --nav-muted: #8d99a6; --nav-active: #222e3c; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #19212b; --surface: #222e3c; --surface-2: #2a3846; --border: #354657;
  --text: #eef1f4; --text-2: #c2ccd6; --text-3: #9dabb9;
  --accent: #6aa5f5; --accent-ink: #0f1722; --accent-soft: #233a57;
  --good: #4cc26a; --warn: #e0b040; --crit: #ef6b6b; --info: #6aa5f5;
  --good-soft: #1d3a2e; --warn-soft: #3d3420; --crit-soft: #452628; --info-soft: #233a57;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --grid: #2f3d4c; --axis: #6f7f8f;
  --nav-bg: #141b23; --nav-text: #e9ecef; --nav-muted: #8d99a6; --nav-active: #222e3c; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", "Helvetica Neue", Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, select, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.4rem; font-weight: 600; } h2 { font-size: 1.05rem; font-weight: 600; } h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
.muted { color: var(--text-2); } .small { font-size: .85rem; } .tiny { font-size: .78rem; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
/* Page frame, after AdminKit: a dark sidebar beside the page. Laptop: open by default, folds away with the
   menu button (remembered). Phone (under 900 px): the sidebar slides in over the page. */
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 260px; background: var(--nav-bg); color: var(--nav-text);
  overflow-y: auto; z-index: 45; padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 6px; transition: transform .2s ease; }
.sidebar .brand { color: #fff; text-decoration: none; margin: 0 0 14px; }
.sidebar .brand span { color: var(--nav-muted); }
.nav-h { margin: 14px 4px 6px; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nav-muted); }
.ctx { display: flex; flex-direction: column; gap: 10px; }
.ctx label { font-size: .75rem; color: var(--nav-muted); display: flex; flex-direction: column; gap: 4px; }
.ctx select { width: 100%; background: var(--nav-active); color: var(--nav-text); border: 1px solid transparent; }
.ctx select:focus-visible { outline-color: #8ab4f8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 9px 12px; border-radius: 4px; color: var(--nav-muted);
  cursor: pointer; font-size: .9rem; border-left: 3px solid transparent; }
.nav-item:hover, .nav-item:focus-visible { background: var(--nav-active); color: #fff; }
.nav-item:focus-visible { outline: 2px solid #8ab4f8; outline-offset: -2px; }
.nav-foot { margin-top: auto; padding: 16px 4px 0; font-size: .75rem; color: var(--nav-muted); overflow-wrap: anywhere; }
.page { margin-left: 260px; min-width: 0; transition: margin .2s ease; }
header.top { background: var(--surface); box-shadow: 0 0 2rem 0 rgba(33, 37, 41, .1); position: sticky; top: 0; z-index: 20; }
.topbar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 22px; }
.burger { all: unset; box-sizing: border-box; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.burger span, .burger span::before, .burger span::after { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; position: relative; content: ""; }
.burger span::before { position: absolute; top: -7px; } .burger span::after { position: absolute; top: 7px; }
.burger:hover { background: var(--surface-2); } .burger:focus-visible { outline: 2px solid var(--accent); }
.top-user { color: var(--text-3); }
.btn.sm.top-out { min-height: 44px; color: var(--text-2); }   /* beats .btn.sm, so it is a full-size tap target */
.nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 44; }
body.nav-folded .sidebar { transform: translateX(-100%); }
body.nav-folded .page { margin-left: 0; }
@media (max-width: 899px) {
  .page { margin-left: 0; }
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 2rem rgba(0, 0, 0, .3); }
  body.nav-open .sidebar { transform: none; }
  .top-user { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .page { transition: none; } }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); flex: none; }
.brand b { display: block; font-size: .95rem; } .brand span { display: block; font-size: .78rem; color: var(--text-2); }
/* The top bar shows the brand only when the sidebar (which carries it) is folded away, or on a phone. */
.brand.top-brand { display: none; color: inherit; text-decoration: none; }
body.nav-folded .brand.top-brand { display: flex; }
@media (max-width: 899px) { .brand.top-brand { display: flex; } }
main { padding: 18px 0 96px; }
footer.foot { border-top: 1px solid var(--border); padding: 16px 0 90px; font-size: .8rem; color: var(--text-3); }

/* Controls */
select, input[type=text], input[type=email], input[type=number], textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--crit); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; min-height: 36px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent-soft); color: var(--text); font-weight: 600; }

/* Cards */
.card { background: var(--surface); border: 0; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid.four { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.four { grid-template-columns: repeat(4, 1fr); } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* Stat tiles */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.tile .v { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .8rem; color: var(--text-2); }
.tile .d { font-size: .75rem; color: var(--text-3); margin-top: 2px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
/* An earlier record that a later one replaced (Activity on the item page). */
.list > li.replaced { color: var(--text-3); } .list > li.replaced b { font-weight: 500; }
.replaced-tag { font-size: .78rem; font-weight: 600; }
.item-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 4px; text-decoration: none; color: inherit; align-items: center; }
.item-row:hover { background: var(--surface-2); }
.item-row .t { font-weight: 600; }
.item-row .sub { font-size: .82rem; color: var(--text-2); }
.item-row .r { text-align: right; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.open { background: var(--info-soft); color: var(--info); }
.badge.resolved { background: var(--good-soft); color: var(--good); }
.badge.escalated { background: var(--warn-soft); color: var(--warn); }
.badge.crit { background: var(--crit-soft); color: var(--crit); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge.q-clean { background: var(--good-soft); color: var(--good); }
.badge.q-incomplete { background: var(--warn-soft); color: var(--warn); }
.badge.q-data_unavailable { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.delta-neg { color: var(--crit); font-weight: 600; } .delta-pos { color: var(--info); font-weight: 600; }

/* Item detail */
.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .numbers { grid-template-columns: repeat(4, 1fr); } }
.path-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.path-card.top { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.path-head { display: flex; gap: 10px; align-items: flex-start; }
.path-rank { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.conf { font-size: .8rem; color: var(--text-2); }
.conf b { color: var(--text); }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; max-width: 160px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.evidence { margin: 10px 0 0; padding-left: 18px; font-size: .88rem; }
.checks { margin: 8px 0 0; padding-left: 20px; font-size: .88rem; }
.checks li { margin: 2px 0; }
details > summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin-top: 8px; }
.finding-opts { display: grid; gap: 6px; margin: 10px 0; }
.finding-opts label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.finding-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.finding-opts .owner { font-size: .75rem; color: var(--text-3); display: block; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: .88rem; }
.notice.warn { background: var(--warn-soft); } .notice.good { background: var(--good-soft); } .notice.info { background: var(--info-soft); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.t th, table.t td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t th { font-size: .75rem; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.inline-bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 12px; }
.chart .gridline { stroke: var(--grid); }
.chart .axis { stroke: var(--axis); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: .8rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 5; min-width: 140px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.rank-row:first-child { border-top: 0; }
.rank-row:hover { background: var(--surface-2); }
.rank-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.rank-bar { height: 10px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.rank-findings { padding: 4px 0 6px 14px; }
.rank-findings .rank-bar { background: var(--s1); opacity: .55; height: 7px; }

/* Overlay */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; max-width: 520px; width: 100%; padding: 22px; max-height: 90vh; overflow: auto; }
.steps-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.steps-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--border); }
.steps-dots i.on { background: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: .9rem; max-width: 90vw; }

/* Sign-in */
.signin { max-width: 420px; margin: 8vh auto; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: .8rem; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.crumbs { font-size: .85rem; margin-bottom: 10px; }
.empty { text-align: center; padding: 30px 10px; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 12px; background: var(--surface); color: var(--text); border: 2px solid var(--accent); border-radius: 6px; } .skip-link:focus { top: 8px; }
main:focus { outline: none; }
.rank-top .num { white-space: nowrap; }

/* v3: evidence labels, statuses, checklist, allocations */
.badge.recorded { background: var(--info-soft); color: var(--info); }
.badge.reviewed { background: var(--good-soft); color: var(--good); }
.badge.cannot_determine { background: var(--surface-2); color: var(--text-2); }
.chip { display: inline-flex; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.chip.direct { color: var(--good); } .chip.suggestive { color: var(--warn); } .chip.conflicting { color: var(--info); } .chip.unexpl { color: var(--text-2); }
/* Photos on an item (migration 0027): three small pictures, each opening full size. */
.chip.ev-photo { color: var(--info); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.photo-view { all: unset; cursor: pointer; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo-view:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.photo-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .btn { min-height: 44px; }
.photo-modal { max-width: min(92vw, 1000px); }
.photo-modal img { width: 100%; height: auto; max-height: 75vh; object-fit: contain; display: block; margin-bottom: 10px; }
.chip.ev-supported { color: var(--good); } .chip.ev-partly_supported { color: var(--warn); } .chip.ev-reported { color: var(--text-2); }
.path-tests { margin: 8px 0 0; font-size: .86rem; display: grid; gap: 2px; }
.path-tests b { font-weight: 600; }
.past { font-size: .8rem; color: var(--text-2); margin-top: 4px; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.steps li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: .88rem; padding: 6px 0; border-top: 1px solid var(--border); }
.steps select { font-size: .8rem; padding: 4px 6px; }
.steps .st-done { color: var(--good); } .steps .st-na, .steps .st-unavailable { color: var(--text-3); }
.pre { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .88rem; }
.pre .ok::before { content: "Data OK · "; color: var(--text-3); font-size: .85em; } .pre .warn::before { content: "! "; color: var(--warn); font-weight: 700; } .pre .blocked::before { content: "✕ "; color: var(--crit); font-weight: 700; }
.contra { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; color: var(--text-2); }
/* Record step: tap cards for the causes, a panel under the grid for the details (tap chips, a units stepper).
   Three or more columns on a tablet, two on a phone, never a sideways scroll. Every tap target is at least 44 px. */
.cause-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .cause-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.cause-card { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-content: start;
  min-height: 44px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  cursor: pointer; overflow-wrap: anywhere; }
.cause-card:hover { background: var(--surface-2); }
.cause-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cause-card[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.cause-icon { color: var(--accent); display: grid; place-items: start center; padding-top: 1px; }
.cause-text { display: grid; gap: 2px; font-size: .9rem; min-width: 0; }
.cause-text b { font-weight: 600; }
.cause-card .badge { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 560px) { .cause-card { grid-template-columns: minmax(0, 1fr); padding: 10px; } }
.pick-h { margin: 0 0 8px; }
.cause-panel { margin-top: 10px; border: 1px solid var(--accent); border-radius: 8px; padding: 14px; background: var(--surface-2); display: grid; gap: 10px; min-width: 0; }
.cause-panel input[type=text] { width: 100%; }
.cause-pick.other-way { border-left: 3px solid var(--warn); padding-left: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tap-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); cursor: pointer; font-size: .88rem; overflow-wrap: anywhere; }
.tap-chip:hover { border-color: var(--accent); }
.tap-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tap-chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.tap-chip:disabled { opacity: .55; cursor: not-allowed; }
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper .btn { min-width: 52px; min-height: 52px; padding: 0; font-size: 1.4rem; font-weight: 700; }
.stepper input[type=number] { width: 84px; min-height: 52px; text-align: center; font-size: 1.15rem; }
.link-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: .9rem; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; }
.rec-item .btn { min-height: 44px; }
/* "A new version is available": shown once after a release, under the top bar. */
.update-bar { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 55; display: flex; gap: 12px; align-items: center;
  max-width: calc(100vw - 32px); padding: 8px 10px 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: .9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.update-bar .btn.sm { min-height: 40px; }
.alloc-sum { font-size: .9rem; font-variant-numeric: tabular-nums; }
.alloc-sum.bad { color: var(--crit); font-weight: 700; }
.split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.split-bar > i { display: block; height: 100%; }
.split-bar .e { background: var(--accent); } .split-bar .r { background: var(--good); } .split-bar .u { background: var(--surface-2); }
.def { font-size: .72rem; color: var(--text-3); margin-top: 4px; line-height: 1.35; }
.grid.five { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .grid.five { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid.five { grid-template-columns: repeat(5, 1fr); } }
.rank-row .split-bar { height: 8px; margin: 4px 0 2px; }
.split-bar { box-shadow: inset 0 0 0 1px var(--border); }
.split-bar .cd { background: var(--warn); } .split-bar .x { background: var(--crit); }
#data-tasks form label { display: block; } #data-tasks form input { display: block; margin-top: 2px; } #data-tasks form input[type=text] { width: 100%; min-width: 180px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; box-shadow: inset 0 0 0 1px var(--border); }
.legend-dot.r { background: var(--good); } .legend-dot.e { background: var(--accent); } .legend-dot.cd { background: var(--warn); }
.legend-dot.x { background: var(--crit); } .legend-dot.u { background: var(--surface-2); }
.legend.tiny i { height: 8px; box-shadow: inset 0 0 0 1px var(--border); }
/* Excel-style filter tables */
.grid-bar { gap: 8px; margin-bottom: 8px; align-items: center; }
.grid-t th { position: relative; white-space: nowrap; }
.grid-t th button.gh { all: unset; cursor: pointer; font: inherit; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; padding: 2px 4px; border-radius: 4px; }
.grid-t th button.gh:hover, .grid-t th button.gh:focus-visible { background: var(--surface-2); outline: 2px solid var(--accent); outline-offset: 1px; }
.grid-t th button.gh.on { color: var(--accent); }
.grid-t th button.gh .fi { font-size: .7em; opacity: .7; }
.grid-t th.n button.gh { flex-direction: row-reverse; }
.grid-t td.sel, .grid-t th.sel, .t td.sel, .t th.sel { width: 32px; text-align: center; }
.grid-t tr.link-row { cursor: pointer; }
.grid-t tr.link-row:hover td { background: var(--surface-2); }
.gpanel { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 240px; max-width: 300px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 12px; display: flex; flex-direction: column; gap: 8px; font-weight: 400; white-space: normal; text-align: left;
  text-transform: none; letter-spacing: normal; font-size: .9rem; color: var(--text); }
.grid-t th.n .gpanel { left: auto; right: 0; }
.gpanel input[type=number], .gpanel input[type=search], .gpanel select { width: 100%; }
.gpanel .row input[type=number] { flex: 1; min-width: 0; }
.glist { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.glist label { display: flex; gap: 6px; align-items: center; }
@media (min-width: 641px) { .table-wrap:has(.gpanel) { overflow: visible; } }
.badge.not_investigated { background: var(--surface-2); color: var(--text-2); }
@media (max-width: 640px) { .gpanel { position: fixed; left: 12px !important; right: 12px !important; top: auto; bottom: 12px; max-width: none; } }
.grid-t td.wide { min-width: 190px; }
.list-tools { gap: 6px 12px; align-items: center; }

/* Store associate queue: value-first triage without the manager-style grid. */
.queue-tools { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) minmax(130px, .7fr) minmax(165px, .9fr); gap: 10px; align-items: end; margin-top: 4px; }
.queue-tools-title { grid-column: 1 / -1; color: var(--text-2); font-size: .76rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.queue-tools label { color: var(--text-2); font-size: .75rem; }
.queue-tools input { width: 100%; min-height: 44px; margin-top: 3px; }
.queue-sort { min-height: 44px; color: var(--accent); border-color: var(--accent); font-weight: 700; }
.work-cause-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; margin-top: 14px; padding: 16px; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--text); cursor: pointer; }
.work-cause-card b { display: block; color: var(--accent); font-size: .76rem; letter-spacing: .03em; text-transform: uppercase; }
.work-cause-card strong, .work-cause-card small { display: block; }
.work-cause-count { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.work-cause-action { padding: 10px 14px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; }
.queue-heading { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 8px; font-size: .85rem; color: var(--text-2); }
.store-queue { display: grid; gap: 10px; }
.store-queue-row { display: grid; grid-template-columns: 105px minmax(160px, 1.25fr) 105px minmax(170px, 1fr) 18px; gap: 12px; align-items: center; min-height: 76px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; border-left: 5px solid var(--accent); }
.store-queue-row:hover { filter: brightness(.985); }
.queue-gap { font-weight: 800; }
.queue-gap.short { color: var(--danger); }
.queue-gap.over { color: var(--accent); }
.queue-item small, .queue-cause small { display: block; color: var(--text-2); }
.queue-value { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.queue-cause { min-width: 0; }
.queue-arrow { color: var(--text-2); font-size: 1.5rem; }
@media (max-width: 760px) {
  .queue-tools { grid-template-columns: 1fr 1fr; }
  .queue-sort { grid-column: 1 / -1; }
  .store-queue-row { grid-template-columns: 90px 1fr auto; }
  .queue-item { grid-column: 2; }
  .queue-value { grid-column: 3; grid-row: 1; }
  .queue-cause { grid-column: 2 / 4; }
  .queue-arrow { display: none; }
}
@media (max-width: 480px) {
  .work-cause-card { grid-template-columns: auto 1fr; }
  .work-cause-action { grid-column: 1 / -1; text-align: center; }
}
/* The store user's list on a tablet or phone: one card per item, each value with its column name; the column headers
   become a row of sort and filter buttons (UX audit, 20 October 2026, Priority 2). */
@media (max-width: 1024px) {
  .grid-t.as-cards, .grid-t.as-cards tbody { display: block; }
  .grid-t.as-cards thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  table.grid-t.as-cards thead th { display: block; border: 0; padding: 0; width: auto; }
  .grid-t.as-cards th button.gh { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; min-height: 32px; font-weight: 500; }
  .grid-t.as-cards tbody tr { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  table.grid-t.as-cards td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; }
  .grid-t.as-cards td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--text-3); }
  .grid-t.as-cards td:not([data-label])::before, .grid-t.as-cards td.col-item::before { content: none; }
  .grid-t.as-cards td.col-item { grid-column: 1 / -1; font-size: .95rem; padding-right: 40px; }
  .grid-t.as-cards td.sel { position: absolute; top: 10px; right: 4px; width: auto; }
  .grid-t.as-cards td.sel input { width: 22px; height: 22px; }
  .grid-t.as-cards td.empty, .grid-t.as-cards td[colspan] { grid-column: 1 / -1; }
  .grid-t.as-cards .chip, .grid-t.as-cards .badge { text-align: left; }
}

/* The hidden attribute always wins, even on elements whose class sets a display. */
[hidden] { display: none !important; }

/* Folded sections on the item page: one summary line, open for the full content. */
details.fold > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-weight: 400; font-size: inherit; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2, details.fold > summary h3 { margin: 0; }
.fold-line { flex: 1 1 240px; min-width: 0; font-size: .85rem; color: var(--text-2); }
.fold-cue { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--accent); }
.fold-cue::before { content: "Open"; }
details.fold[open] > summary .fold-cue::before { content: "Close"; }
details.fold[open] > summary .fold-line { display: none; }
.fold-body { margin-top: 12px; }
.pre .how { margin: 2px 0 0 14px; }

/* Lists fit a 1280 px laptop: tighter cells, headers and long text wrap. Phones scroll inside the table. */
.grid-t { font-size: .84rem; }
table.grid-t th, table.grid-t td { padding: 6px 5px; }
.grid-t th { white-space: normal; vertical-align: bottom; }
.grid-t td { overflow-wrap: break-word; }
.grid-t .chip, .grid-t .badge { white-space: normal; text-align: center; }
.grid-t td.wide { min-width: 150px; }
@media (min-width: 900px) { .grid-t td.wide { min-width: 0; } }

/* Walkthrough tour: the target is outlined and the rest of the screen dims; the card points at it. */
.overlay.tour { display: block; padding: 0; }
.overlay.tour:not(.spot) { display: grid; place-items: center; padding: 16px; }
.overlay.tour.spot { background: transparent; }
.tour-ring { position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px var(--accent-soft), 0 0 0 9999px rgba(0, 0, 0, .5);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-card { overflow: visible; max-height: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.tour-body { position: relative; }
.tour-tip { position: absolute; width: 16px; height: 16px; background: var(--surface); transform: rotate(45deg); border-radius: 2px; }
.tour-tip.up { top: -8px; } .tour-tip.down { bottom: -8px; }
.tour-tip.left { left: -8px; } .tour-tip.right { right: -8px; }
.tour-text { margin-bottom: 14px; }
.tour-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; font-size: .9rem; }
.tour-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: start; }
.tour-list .chip { justify-self: start; white-space: normal; }
@media (max-width: 480px) { .tour-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* Guided video tour: the app plays itself. The page underneath is blocked, the part being shown is outlined, a pointer
   taps it, and the caption with its controls sits at the bottom. */
.vt-shield { position: fixed; inset: 0; z-index: 60; }
.vt-ring { position: fixed; z-index: 61; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px var(--accent-soft), 0 0 0 9999px rgba(0, 0, 0, .35);
  transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.vt.centre .vt-shield { background: rgba(0, 0, 0, .35); }
.vt-hand { position: fixed; z-index: 62; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
  background: rgba(59, 125, 221, .35); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  transition: left .5s ease, top .5s ease, transform .15s ease; }
.vt-hand.press { transform: scale(.7); background: rgba(59, 125, 221, .7); }
.vt-bar { position: fixed; z-index: 63; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(640px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  max-height: 45vh; overflow: auto; }
.vt.centre .vt-bar { bottom: 50%; transform: translate(-50%, 50%); }
.vt-head { display: flex; align-items: baseline; gap: 10px; }
.vt-head h2 { margin: 0; font-size: 1.1rem; }
.vt-step { color: var(--text-3); white-space: nowrap; }
.vt-text { margin: 6px 0 10px; }
.vt-prog { height: 4px; border-radius: 2px; background: var(--surface-2); margin-bottom: 10px; overflow: hidden; }
.vt-prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.vt-ctl .btn { min-height: 44px; }
.vt.paused .vt-prog i { background: var(--warn); }
@media (prefers-reduced-motion: reduce) { .vt-ring, .vt-hand { transition: none; } }

/* Pareto chart (leadership): names in text ink with a surface halo so the cumulative line never cuts through them. */
.chart .pareto text.name { fill: var(--text); font-size: 13px; }
.chart .pareto text.num { fill: var(--text-2); font-variant-numeric: tabular-nums; }
.chart .pareto text.halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .pareto .ref { stroke: var(--axis); }
.chart .pareto .sel { fill: var(--surface-2); }
.chart .pareto rect.hit { cursor: pointer; outline: none; }
.chart .pareto rect.hit:focus-visible { stroke: var(--accent); stroke-width: 2px; }
.rank-findings { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
/* The Pareto chart scrolls sideways inside its card when the causes need more room (phones); the page never does. */
.chart-scroll { overflow-x: auto; }
/* A table or chart that scrolls sideways takes keyboard focus (util.js, watchScrollRegions), so it shows where focus is. */
.table-wrap:focus-visible, .chart-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* "About these figures": one line above, the definitions and caveats folded under it. */
details.about > summary { font-weight: 500; color: var(--text-2); margin-top: 4px; }
.about-list { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.about-list li { margin: 2px 0; }
.chart .pareto text.name { font-size: 12px; }
.chart .pareto text.share { fill: var(--text-3); font-size: 11px; }
.overlay.tour:not(.spot) .tour-card { max-height: calc(100vh - 32px); overflow: auto; }  /* short screens: the centred card scrolls */

/* Learning: what the app learned from your answers and from approved lessons. Text stays in text ink. */
.learned { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.learned ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.learned-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.chip.learned-chip { color: var(--accent); background: var(--surface); }
.learned-note { margin-top: 6px; font-size: .85rem; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.proposal { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.proposal .meta { font-size: .8rem; color: var(--text-3); }
.lesson-editor { border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.lesson-editor input[type=text] { width: 100%; }

/* AdminKit look: borderless tiles, uppercase card titles in muted ink, compact controls. */
.tile { border: 0; box-shadow: var(--shadow); padding: 16px 18px; }
.tile .l { font-weight: 600; color: var(--text-3); }
.btn { border-radius: 4px; font-weight: 500; }
.btn.primary { box-shadow: 0 1px 2px rgba(59, 125, 221, .25); }
select, input[type=text], input[type=email], input[type=number], textarea { border-radius: 4px; border-color: var(--border); }
.path-card { border-color: var(--border); box-shadow: var(--shadow); }
.notice { border-radius: 4px; }
.brand-mark { background: var(--accent); border-radius: 6px; }

/* Block 2: next step and assignee panel, follow-up actions */
.work-panel { padding: 12px 16px; font-size: .9rem; }
.work-panel select { min-width: 220px; max-width: 100%; }
.action-row { border-top: 1px solid var(--border); padding: 10px 0; display: grid; gap: 2px; }
.action-row:first-of-type { border-top: 0; }

/* Guided journey panel: small, bottom right above the feedback button; along the bottom on a phone. */
.journey { position: fixed; right: 16px; bottom: 68px; z-index: 35; width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22); }
.journey h3 { margin: 0; font-size: 1rem; }
.journey .steps-dots { margin-bottom: 0; }
.journey-h { gap: 8px; flex-wrap: nowrap; }
.journey-text { margin: 0; font-size: .9rem; }
body.journey-on main { padding-bottom: 300px; }
body.touring .journey { display: none; }
@media (max-width: 560px) {
  .journey { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 50vh; overflow: auto; }
}

/* Record finding right on a suggestion card, and the store manager's Team findings table. */
.path-card [data-record-card] { min-height: 44px; }
.path-card .card-actions select { min-height: 44px; }
.team-t td { vertical-align: top; }
.team-t td.small > div + div { margin-top: 4px; }
.team-actions.stack > * + * { margin-top: 6px; }
.team-actions .btn { white-space: nowrap; }
.team-t td:first-child { min-width: 120px; }
.team-t td:nth-child(4) { min-width: 170px; }
/* Closing this count: three steps (web/js/closing.js). One column on phones. */
.cbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--good); }
.csteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cstep { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.cstep.now { border-color: var(--info); background: var(--info-soft); }
.cstep.done { background: var(--good-soft); border-color: transparent; }
.cnum { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--surface-2); color: var(--text-2); }
.cstep.now .cnum { background: var(--info); color: #fff; }
.cstep.done .cnum { background: var(--good); color: #fff; }
.ctitle { font-weight: 600; margin-bottom: 2px; }
@media (max-width: 760px) { .csteps { grid-template-columns: minmax(0, 1fr); } }
/* Landing page (web/js/landing.js): the signed-out screen. Hero text beside the sign-in card on a laptop, stacked on a phone. */
.landing { display: flex; flex-direction: column; gap: 22px; padding-top: 6vh; padding-bottom: 40px; }
.landing .hero { display: grid; gap: 24px; align-items: center; }
.landing .signin { margin: 0; max-width: none; }
.hero-title { font-size: 2rem; font-weight: 700; line-height: 1.15; }
.hero-lead { font-size: 1.05rem; color: var(--text-2); max-width: 60ch; }
.plain-list { margin: 0; padding-left: 18px; } .plain-list li + li { margin-top: 8px; }
.landing-foot { text-align: center; }
@media (min-width: 900px) { .landing .hero { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); } }
@media (max-width: 560px) { .hero-title { font-size: 1.6rem; } .landing { padding-top: 16px; } }

/* ---------- Quick capture (store list, "Quick capture" tab) ---------- */
.qc-top { gap: 8px; align-items: center; }
.qc-title { font-size: 1.2rem; margin: 0; }
.count-details { gap: 10px; }
.qc-bar { position: sticky; top: var(--top-h, 0px); z-index: 5; background: var(--bg); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.qc-search { flex: 1 1 280px; }
.qc-search input { width: 100%; min-height: 48px; font-size: 1.05rem; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); color: var(--text); }
.qc-search input:focus { border-color: var(--accent); outline: none; }
.qc-count { font-size: .9rem; color: var(--text-2); }
.qc-saved-slot { flex: 1 1 100%; } .qc-saved-slot:empty { display: none; }
.qc-units { font-size: 1.15rem; }
.qc-gap { text-align: right; }
@media (max-width: 560px) { .qc-head { flex-direction: column; gap: 4px; } .qc-gap { text-align: left; } }
.qc-pace { margin: 2px 0 0; }
.qc-card { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); margin-top: 10px; border: 2px solid transparent; }
.qc-card.active { border-color: var(--accent); }
.qc-card.done { opacity: .75; }
.qc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.qc-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.qc-gap { white-space: nowrap; }
.qc-done { margin: 0; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-card.active > .qc-chips:not(.qc-acts) > .qc-chip:first-child { flex: 1 1 100%; }
/* The best lead: what, why and what to check, then two big answers, always in the same place (3 and 4 Nov 2026). */
.qc-lead { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.qc-lead > .qc-chip-main { font-size: 1.05rem; font-weight: 600; }
.qc-lead > small { display: block; font-size: .75rem; color: var(--text-2); margin-bottom: 4px; }
.qc-lead p { margin: 4px 0 0; }
/* On a card taller than the screen the two answers stay in reach at the bottom of the screen; scrolling shows what is under them. */
.qc-best { margin-top: 8px; position: sticky; bottom: 8px; z-index: 2; }
@media (max-width: 560px) { .qc-focus-label { display: none; } .qc-card > .qc-chips.qc-best > .qc-chip, .qc-card.active > .qc-chips.qc-best > .qc-chip:first-child { min-height: 56px; padding: 8px 10px; font-size: .98rem; } }
/* A place that holds the item but was not counted: above the answer, in amber (3 Nov 2026 audit item 2). */
.qc-warn { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius); }
.qc-card > .qc-chips.qc-best > .qc-chip, .qc-card.active > .qc-chips.qc-best > .qc-chip:first-child { flex: 1 1 40%; min-width: 0; min-height: 68px; padding: 12px 16px; border-width: 2px; font-size: 1.05rem; font-weight: 600; justify-content: center; align-items: center; text-align: center; }
.qc-card.active > .qc-chips.qc-best > .qc-chip:only-child:not([data-checked]) { flex-basis: 100%; align-items: flex-start; text-align: left; }
.qc-best > .qc-chip small { font-weight: 400; }
.qc-card.done.needs-check { opacity: 1; border-color: var(--warn); }
.qc-card .qc-check { margin: 4px 0 0; }
.dn-lead { display: flex; flex-direction: column; gap: 4px; }
.qc-focus-label { margin: 8px 0 6px; color: var(--text-2); font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.qc-other { margin-top: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.qc-other > summary { min-height: 44px; display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-size: .88rem; font-weight: 650; }
.qc-other > .qc-chips { padding: 0 10px 10px; }
.qc-chip { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 48px; min-width: 120px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text); cursor: pointer; text-align: left; text-decoration: none; font: inherit; flex: 1 1 200px; max-width: 100%; }
.qc-chip small { font-size: .75rem; color: var(--text-2); }
.qc-chip:hover { filter: brightness(.97); }
.qc-chip:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.qc-chip.alt, .qc-chip.ghost { background: var(--surface); border-color: var(--border); flex: 0 1 auto; justify-content: center; }
.qc-h { margin: 18px 0 0; }
.qc-legend { margin: 0 0 6px; }
.cause-folded .match-row { display: none; }
.qc-guide { margin: 0 0 10px; } .qc-guide-list { margin: 0; padding-left: 18px; } .qc-guide-list li { margin: 2px 0; }
/* Short cause label with its units badge in one fixed place (UX audit, 20 October 2026, item 4). */
.qc-chip-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; }
.qc-badge { flex: none; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.qc-source { margin: 6px 0 0; } .qc-source > summary { cursor: pointer; list-style: none; min-height: 32px; display: flex; align-items: center; }
.qc-source > summary::-webkit-details-marker { display: none; } .qc-source > summary::after { content: " ▸"; } .qc-source[open] > summary::after { content: " ▾"; }
.qc-final { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.qc-undo-acts { display: flex; gap: 6px; } .qc-undo-acts .btn { min-height: 44px; }
@media (max-width: 640px) { .qc-find { display: none; } }
.foot-more > summary { cursor: pointer; }
.how-read > summary { cursor: pointer; color: var(--text-3); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--text-3); } .facts dd { margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 6px; } }
.how-read > div { margin-top: 2px; }
.qc-partial { color: var(--warn); }
.qc-note { display: block; margin: 0 0 8px; }
.qc-note input { width: 100%; min-height: 44px; }
.dn-defer { border-top: 1px solid var(--border); padding-top: 10px; }
/* The saved line sits in the page under the scan box, never over a button (UX audit, 20 October 2026, item 1). */
.qc-undo { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; background: var(--good-soft); color: var(--text);
  padding: 4px 4px 4px 12px; border-radius: 10px; font-size: .9rem; min-height: 52px; }
.qc-undo .btn { min-height: 44px; }
.qc-undo span > small { display: block; margin-top: 2px; color: var(--text-2); }
.qc-undo.pending { background: var(--accent-soft); }
@media (max-width: 560px) { .qc-chip { flex-basis: 100%; } .qc-chip.alt { flex: 1 1 40%; } }
/* Not sure and More are secondary on every card (store-user audit item 15): compact, still 44 px tall, after the answers. */
.qc-chip.alt { min-width: 0; padding: 6px 12px; font-size: .88rem; color: var(--text-2); }
@media (min-width: 561px) { .qc-chip.alt { flex: 0 0 auto; } }
/* The answers keep their own row; Come back later, Split or other cause and Ask manager sit in the row below. */
.qc-acts { margin-top: 8px; } .qc-acts:empty { display: none; }
@media (max-width: 560px) { .qc-chip.alt { flex: 1 1 30%; } }
/* A tab shows it is loading at once (item 16): the pane dims and says so until the new view is drawn. */
.tab-loading { opacity: .55; pointer-events: none; transition: opacity .1s; }
.seg [aria-busy=true]::after { content: " …"; }

/* Step status and "Not this?" are tap buttons, not dropdowns: they stay thumb-sized on a tablet. */
.steps li { grid-template-columns: 1fr; }
.step-chips { margin: 6px 0 4px; flex-basis: 100%; }
.reason-chips { margin-top: 8px; }
.tap-chip.found[aria-pressed=false] { border-style: dashed; }

/* Quick capture split: a few reasons on the same card, units that start from what is left. */
.qc-split { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qc-split-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.qc-split-what { flex: 1 1 200px; min-width: 0; }
.qc-step { display: inline-flex; align-items: center; gap: 8px; }
.qc-step .btn { min-width: 48px; min-height: 48px; padding: 0; font-size: 1.3rem; font-weight: 700; }
.qc-step b { min-width: 2ch; text-align: center; font-size: 1.15rem; }
.qc-chip.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); justify-content: center; }

/* Item page for the store user: decide now first, the rest folded. */
.decide-now { border: 2px solid var(--accent); }
.dn-main { display: flex; flex-direction: column; gap: 8px; } .dn-main > .btn { width: 100%; }
.btn.big { min-height: 56px; width: 100%; justify-content: center; font-size: 1.05rem; white-space: normal; text-align: center; padding: 10px 16px; }
.dn-more { display: flex; flex-wrap: wrap; gap: 8px; }
.dn-why > summary { cursor: pointer; color: var(--text-3); min-height: 32px; }
/* The store user's item page (UX audit, 20 October 2026, items 2 and 3): the numbers in one line, the checks folded. */
.fact-strip { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 16px; }
.fact-strip .fs-gap { font-size: 1.3rem; }
details.checks-strip > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; min-height: 44px; }
details.checks-strip > summary::-webkit-details-marker { display: none; }
details.checks-strip > summary::after { content: "Open"; margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--accent); }
details.checks-strip[open] > summary::after { content: "Close"; }
.ck-warn { order: 2; flex-basis: 100%; color: var(--warn); font-weight: 600; }
.dn-more .btn { min-height: 44px; }
.btn.ghost { background: transparent; border-color: var(--border); font-weight: 400; }
.ck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ck { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.ck-st { flex: 0 0 5.8em; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); }
.ck.done .ck-st { color: var(--good, #1a7f37); }
.ck.pending .ck-st, .ck.unavailable .ck-st { color: var(--warn, #9a6700); }
details.more-opts { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
details.more-opts > summary { list-style: none; cursor: pointer; padding: 14px 16px; min-height: 48px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
details.more-opts > summary::-webkit-details-marker { display: none; }
details.more-opts > summary::after { content: "Open"; margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--accent); }
details.more-opts[open] > summary::after { content: "Close"; }
details.more-opts > .more-body { padding: 0 8px 12px; }
details.more-opts > .more-body > .card { box-shadow: none; }

.qc-keys { display: none; margin: 2px 0 0; }
@media (pointer: fine) { .qc-keys { display: block; } }
.qc-recent { margin-top: 14px; }
.qc-recent-list { margin: 0; padding: 0 16px; }

/* Several items fit a name search: a short list to pick the one in hand (21 Oct 2026). */
.qc-pick { margin-top: 10px; }
.qc-unpick { display: inline-block; margin: 10px 0 0; min-height: 44px; }
/* Products that match the system, at the end of All items: greyed, nothing to record. */
.matching-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 4px; color: var(--text-2); }

/* Less to read on a narrow screen (21 Oct 2026): a long units badge moves under the cause instead of squeezing it to one
   word per line; the note under Decide now is one short line plus a source cue to tap. */
.qc-chip-main { flex-wrap: wrap; }
.qc-chip-main > span:first-child { flex: 1 1 150px; min-width: 0; }
.dn-note { margin: 4px 0 0; color: var(--text-2); line-height: 1.9; }
/* The evidence label under the main button keeps clear of it (Ishan, 23 Oct 2026: the pill touched the blue button). */
.dn-note > .chip:first-child { margin-top: 4px; }
.dn-note .qc-source { margin: 2px 0; }

/* The store user's item page (22 Oct 2026): one status line under the gap, short record lines, plain action row. */
.fs-status { flex-basis: 100%; font-size: .9rem; color: var(--text-2); }
.your-record .list li { padding: 4px 0; }
.dn-plain .dn-more { margin: 0; }

/* Done, part done and to do read at a glance (22 Oct 2026, Ishan's tablet check): green done, amber part done. */
.done-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--good-soft); color: var(--text); box-shadow: inset 4px 0 0 var(--good); }
.done-banner .done-tick { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--good); color: #fff; font-weight: 700; font-size: 1.2rem; flex: none; }
.done-banner .done-text { flex: 1; min-width: 12em; }
.done-banner .done-text b { color: var(--good); }
.badge.done-badge { background: var(--good-soft); color: var(--good); }
.fact-strip.fs-done .fs-gap { color: var(--text-2); }
.fs-status.part { color: var(--warn); }
.fs-status.part b { color: var(--warn); }
.alloc-sum.complete b { color: var(--good); }
.alloc-sum.complete .split-bar .e { background: var(--good); }

/* All items: a finished item, shown again with "Show done" (22 Oct 2026). */
.grid-t tr.row-done td { background: var(--good-soft); }
/* Two movements that offset, one line each (22 Oct 2026). */
.moves { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.btn.moves-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; white-space: normal; }
.btn.moves-btn .moves-total { font-weight: 600; }
.qc-chip .moves { font-weight: 400; }
/* One Add proof (22 Oct 2026): the choices, and a document on the Proof card. */
.proof-menu { gap: 8px; flex-wrap: wrap; }
.qc-proof-menu { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.photo.doc .doc-view { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 96px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); cursor: pointer; word-break: break-word; }
.photo.doc .doc-icon { font-size: 1.8rem; }
.photos .proof-yes { color: var(--good); }
/* Sent to the store manager: amber, with the next item (23 Oct 2026). */
.done-banner.wait { background: var(--warn-soft); box-shadow: inset 4px 0 0 var(--warn); }
.done-banner.wait .done-tick { background: var(--warn); }
.done-banner.wait .done-text b { color: var(--warn); }
/* None of these and Guide me on the suggestion card (23 Oct 2026). */
.dn-head { align-items: center; gap: 8px; }
.dn-others-h { color: var(--text-2); margin-top: 4px; }
.dn-others { display: flex; flex-wrap: wrap; gap: 8px; }
.dn-others .btn { min-height: 44px; }
.dn-none-btn { border-color: var(--warn); color: var(--warn); }
.dn-none, .guide { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.guide-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.guide-steps li.later { color: var(--text-3); }
.guide-steps li.done { color: var(--text-3); text-decoration: line-through; }
/* My answers (23 Oct 2026): the tab row keeps the button on the right; the count line opens it too. */
.tabs-row { align-items: center; gap: 8px; flex-wrap: wrap; }
.answers-group { gap: 6px; }
.answer-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.answer-row:first-child { border-top: 0; }
.qc-count.to-answers { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ans-gap { margin-left: 6px; white-space: nowrap; }

/* Audit of 7 Nov 2026: what happens next, how suggestions work, cause headings, To do groups */
.qc-best > .qc-chip small { display: block; margin-top: 2px; }
.qc-chip.primary small { color: inherit; opacity: .92; }
.next-note { margin: 4px 0 0; }
.how-ask { margin-top: 8px; }
.how-sug > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-2); }
.how-sug ul { margin: 0 0 8px; padding-left: 18px; }
.how-sug li { margin-bottom: 4px; }
.cause-group + .cause-group { margin-top: 12px; }
.cause-group-h { margin: 0 0 6px; font-size: .8rem; font-weight: 700; color: var(--text-2); }
.cause-group .cause-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 560px) { .cause-group .cause-grid { grid-template-columns: minmax(0, 1fr); } .cause-group .cause-card { grid-template-columns: auto minmax(0, 1fr); } }
.queue-group { margin-top: 14px; }
.queue-group-h { margin: 0; font-size: .95rem; }
.queue-group-note { margin: 2px 0 8px; }
/* Audit of 7 Nov 2026: every control on a touch screen is a full-size tap target */
@media (pointer: coarse) {
  .btn, .btn.sm, .seg button, .qc-source > summary, .qc-count.to-answers, #answers-go, details > summary { min-height: 44px; }
  .qc-count.to-answers { display: inline-flex; align-items: center; }
}

/* Skipped list (8 Nov 2026) */
.skipped-group { border-left: 4px solid var(--accent); }
.skip-h { margin: 8px 0 0; font-size: .95rem; }
.check-box { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.check-acts { gap: 8px; flex-wrap: wrap; }
a.qc-chip { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* Split or other cause: every cause on the card (8 Nov 2026) */
.qc-all-h { margin: 8px 0 4px; color: var(--text-2); font-weight: 700; }

/* Leadership audit, 10 November 2026: the source banner, and a first column that stays put when the table scrolls sideways. */
.demo-banner { display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--warn); padding: 10px 14px; }
.t.sticky-first th:first-child, .t.sticky-first td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* Leadership "Where to look first": three tiles that open the drill-down. */
a.priority-tile { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--good); }
a.priority-tile:hover { background: var(--surface-2); }

/* Leadership: the loss-against-sales headline figure. */
.loss-rate { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Senior leadership, What needs attention (ChatGPT audit, 11 November 2026): the decision layer above the detail. */
#attention { border-left: 4px solid var(--accent); }
ol.attention { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: attention; }
ol.attention > li { counter-increment: attention; position: relative; padding: 2px 0 2px 44px; }
ol.attention > li::before { content: counter(attention); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--text-2); }
ol.attention > li.tone-resolved::before { background: var(--good-soft); color: var(--good); }
ol.attention > li.tone-escalated::before { background: var(--warn-soft); color: var(--warn); }
ol.attention > li.tone-crit::before { background: var(--crit-soft); color: var(--crit); }
@media (min-width: 900px) { ol.attention { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } ol.attention > li:only-child { grid-column: 1 / -1; } }
/* A link-style button that sits inside a sentence. */
.link-btn.inline { display: inline; min-height: 0; font-size: inherit; }
@media (pointer: coarse) { .link-btn.inline { padding: 10px 0; } }
tr.row-flash > td { background: var(--warn-soft) !important; }
/* Senior leadership on a phone (ChatGPT audit, 11 November 2026): the markets table and the follow-up actions table
   become one card per row, so nothing is squeezed to a word a line or scrolled sideways. Each value carries its column
   name (data-label). Wider screens keep the table. */
@media (max-width: 560px) {
  table.t.cards, table.t.cards tbody { display: block; width: 100%; }
  table.t.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.t.cards tr { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; background: var(--surface); }
  table.t.cards td { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); column-gap: 12px; padding: 5px 0; border: 0;
    text-align: left !important; white-space: normal !important; font-size: .88rem; position: static !important; }
  table.t.cards td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; font-size: .78rem; color: var(--text-3); line-height: 1.35; }
  table.t.cards td > * { grid-column: 2; min-width: 0; white-space: normal !important; overflow-wrap: anywhere; }
  table.t.cards td .badge, table.t.cards td div { white-space: normal !important; }
  table.t.cards td:empty { display: none; }
  table.t.cards td.card-title { display: block; padding: 0 0 4px !important; font-size: 1rem; font-weight: 600; }
  table.t.cards td.card-title::before, table.t.cards td.card-top::before { content: none; }
  table.t.cards td.card-top { display: block; order: -1; padding: 0 0 6px; }
  table.t.cards td .split-bar { margin-top: 5px; }
  table.t.cards tr.mk-row { border-left: 4px solid var(--accent); }
  table.t.cards tr.st-row { margin-left: 14px; }
  table.t.cards tr.st-row td.card-title { font-size: .95rem; }
}
