/* Self-hosted brand fonts (variable woff2, latin) — served same-origin so the
   strict CSP (font-src 'self') allows them. OFL-licensed, bundled in /fonts. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/fonts/schibsted-grotesk.woff2') format('woff2');
}

/* Ops Console — Anaqa brand skin.
   Palette + type mirror the merchant admin (src/admin) so the ops console reads
   as the same product: warm cream canvas, near-black ink, coral accent,
   Schibsted Grotesk / Inter display type, hairline borders, whisper shadows. */
:root {
  /* surfaces */
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #faf9f6;
  /* lines + text */
  --border: #eceae4; --border-s: #ddd9d1;
  --ink: #0e0e10; --muted: #6b6b6f;
  /* coral action */
  --primary: #ff4a1c; --primary-h: #e83e14; --primary-bg: #fff1ec; --primary-ink: #ffffff;
  /* darker coral for TEXT/links — bright coral on white is ~3.3:1 (fails AA);
     this passes AA for normal text while the bright coral stays for fills */
  --primary-text: #c8380f;
  /* status tones */
  --success: #1f8a5b; --success-bg: #e7f4ec;
  --warn: #946800; --warn-solid: #d9a413; --warn-bg: #fff6e8;
  --danger: #c62828; --danger-bg: #fdeceb; --danger-border: #f0b3ad;
  /* shape — three radii and nothing else. The six literals these used to sit
     beside (3/4/6/9/999) are gone: a token that is bypassed by a literal changes
     a third of the surfaces when you edit it and reads as a partial regression. */
  --radius: 10px;        /* cards, panels, modals */
  --radius-s: 6px;       /* controls: buttons, inputs, chips-with-corners */
  --radius-pill: 999px;  /* pills + bars. 50% stays a literal — it is a shape, not a scale */
  /* type — six steps. No half-pixels (they compound: a bare <small> inside a
     12.5px label rendered at 10.4167px, a size nobody chose) and nothing under 11px. */
  --fs-xs: 11px; --fs-s: 12px; --fs-m: 13px; --fs-l: 15px; --fs-xl: 20px; --fs-2xl: 28px;
  --shadow: 0 0 0 1px rgba(0,0,0,.03), 0 1px 2px rgba(0,0,0,.06);
  --shadow-pop: 0 4px 14px rgba(0,0,0,.12);
  --display: 'Schibsted Grotesk','Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-m); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
h1, h2, h3, .brand, .crumb, .stat-num, .page-head h1, .empty-state h1 {
  font-family: var(--display); letter-spacing: -.02em;
}
a { color: var(--primary-text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: var(--radius-s); }

.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-logo { height: 24px; width: auto; display: block; align-self: center; }
.brand-suffix {
  font-family: var(--display); font-weight: 700; font-size: var(--fs-l);
  color: var(--primary); letter-spacing: -.02em;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-s); padding: 9px 16px;
  font-family: inherit; font-weight: 600; font-size: var(--fs-m); line-height: 1;
  cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-h); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-s); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-inline { width: auto; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 34px 30px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card .brand { justify-content: center; margin-bottom: 2px; }
.login-card .brand-logo { height: 30px; }
.login-card .brand-suffix { font-size: var(--fs-xl); }
.login-card .btn-primary { width: 100%; padding: 11px 16px; }
.login-sub { margin: -6px 0 8px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-s); font-weight: 600; color: var(--muted); }
.field input {
  border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 10px 12px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-l); font-family: inherit;
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.login-error { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-s); padding: 9px 12px; font-size: var(--fs-m); }

/* ── App shell ── */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; }
.sidebar .brand { padding: 4px 10px 20px; font-size: var(--fs-xl); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: var(--radius-s); color: var(--ink);
  text-decoration: none; font-weight: 500; font-size: var(--fs-m); transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 650; }
.nav-item.disabled { color: var(--muted); cursor: default; pointer-events: none; }
.nav-item em { font-style: normal; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2); color: var(--muted); padding: 2px 6px; border-radius: var(--radius-s); }

/* Nav groups. Four jobs — fleet / support / records / you — instead of nine items
   in source order. The label is a signpost, not a control: it is not focusable and
   the group it names carries the aria-labelledby. */
.nav-group + .nav-group { margin-top: 16px; }
.nav-group-label {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 6px;
}
.nav-group-items { display: flex; flex-direction: column; gap: 2px; }
/* An item that needs a subtitle stacks; the rest stay single-line. "Audit log" and
   "Event log" sit adjacent with near-identical names and unrelated contents. */
.nav-item.has-sub { flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 12px; }
.nav-sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; line-height: 1.3; }
.nav-item.active .nav-sub { color: var(--primary-text); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.crumb { font-weight: 700; font-size: var(--fs-l); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-badge { color: var(--muted); font-size: var(--fs-s); }

.content { padding: 28px 26px; max-width: 1120px; }
.empty-state {
  max-width: 620px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.empty-state h1 { margin: 0 0 10px; font-size: var(--fs-xl); }
.empty-state p { margin: 0 0 8px; }
.muted { color: var(--muted); }

/* Topbar left cluster (hamburger + breadcrumb); hamburger is desktop-hidden. */
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--border-s); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-overlay { display: none; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  /* Sidebar becomes an off-canvas drawer toggled by the hamburger. */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 240px; z-index: 80;
    transform: translateX(-100%); transition: transform .22s ease;
    overflow-y: auto;
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app.nav-open .nav-overlay { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35); }
  .nav-toggle { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ── Shops + subscriptions ── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: var(--fs-xl); }
/* A panel's own control strip. NOT .page-head — the Revenue tab used one, which put a
   second page title bar inside a page (and needed an empty <div> and an inline margin
   to fake the alignment). */
.panel-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* Pagination. There were zero paginators in this console; four views shared a
   "Load more" that appended, so reaching row 300 meant scrolling past 299. */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px;
         margin-top: 14px; flex-wrap: wrap; }
.pager-range { font-size: var(--fs-s); color: var(--muted); font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; gap: 8px; }
.pager-btns .btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

/* ══ Fleet analytics ══════════════════════════════════════════════════════════════════════
   Every value below comes from the token scale — the console's budget is 6 type sizes and
   4 radii console-wide, asserted by the probe, and a new screen is exactly where that
   quietly grows to 9. */
.page-sub { margin: 4px 0 0; font-size: var(--fs-m); color: var(--muted); max-width: 68ch; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.card-sub { margin: 2px 0 14px; font-size: var(--fs-s); color: var(--muted); max-width: 70ch; }

.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.an-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
           box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--border-s); }
.an-tile.tone-good { border-top-color: var(--success); }
.an-tile.tone-bad  { border-top-color: var(--danger); }
.an-tile-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.an-tile-value { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em;
                 margin: 6px 0 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.an-tile-sub { font-size: var(--fs-s); color: var(--muted); }

/* Two columns where there is room, one where there is not. `minmax(0,…)` and not `1fr`:
   a wide table inside a grid child otherwise refuses to shrink and pushes the page sideways. */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
           gap: 16px; margin-bottom: 16px; }
.an-grid > * { min-width: 0; }
.an-chart-card { grid-column: 1 / -1; }

/* ── charts ── */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: var(--fs-m);
               border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }
.ch-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-ytick, .ch-xtick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ch-dot { cursor: crosshair; }

/* ── funnel ── */
.fn { display: flex; flex-direction: column; gap: 12px; }
.fn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fn-label { font-size: var(--fs-m); font-weight: 600; }
.fn-val { font-size: var(--fs-m); font-weight: 700; font-variant-numeric: tabular-nums; }
.fn-track { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-top: 5px; }
.fn-bar { height: 100%; background: var(--primary); border-radius: var(--radius-pill); }
.fn-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* ── ranked bars ── */
.bl { display: flex; flex-direction: column; gap: 11px; }
.bl-row { display: block; }
.bl-link { text-decoration: none; color: inherit; border-radius: var(--radius-s); }
.bl-link:hover .bl-label { color: var(--primary-text); }
.bl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bl-label { font-size: var(--fs-m); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-val { font-size: var(--fs-s); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bl-track { height: 7px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-top: 4px; }
.bl-bar { height: 100%; background: var(--primary); border-radius: var(--radius-pill); }
.bl-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }

/* ── sortable table headers ── */
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--ink); }
table.tbl th.sortable.sorted { color: var(--primary-text); }
table.tbl th.sortable.sorted::after { content: ' \2193'; }
/* A unit qualifier in a header, so "Sessions" cannot be read as all-time. */
.th-note { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: .8; }
/* A notice that is a paragraph rather than an inline aside. */
.notice-block { display: block; background: var(--warn-bg); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 14px; max-width: 100ch; }
/* The shops summary reuses .q-stat; these are the health tones it needs. */
.q-stat.q-unknown { border-left: 3px solid var(--border-s); }
.searchbar { display: flex; gap: 8px; flex: 1; max-width: 440px; }
.searchbar input {
  flex: 1; border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 9px 12px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-m); font-family: inherit;
}
.searchbar input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Multi-control filter bar (wraps instead of crushing its controls, unlike the
   single-input .searchbar). Used by the Event log filter. */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filterbar input, .filterbar select, .select {
  border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 9px 11px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-m); font-family: inherit; min-width: 130px;
}
.filterbar input:focus, .filterbar select:focus, .select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: var(--fs-l); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-m); min-width: 640px; }
table.tbl th, table.tbl td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
table.tbl tbody tr { cursor: pointer; transition: background .1s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); letter-spacing: .01em; }
.badge-plan { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.badge-comp { background: var(--primary-bg); color: var(--primary); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 9px 16px; font-size: var(--fs-m); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-s); font-weight: 600; color: var(--muted); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 9px 11px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-m); font-family: inherit; font-weight: 400;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.form-field.inline-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.form-field.inline-check input { width: auto; }
/* Inline field hint. Was a bare <small>, which the UA sizes at 0.8333em — inside a
   12.5px label that landed on 10.4167px, a size no author CSS ever picked. */
.field-hint { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.btn-danger.btn-inline, .btn-inline { width: auto; }

.toast { padding: 8px 13px; border-radius: var(--radius-s); font-size: var(--fs-m); font-weight: 600; }
.toast-ok { background: var(--success-bg); color: var(--success); }
.toast-err { background: var(--danger-bg); color: var(--danger); }
.notice { color: var(--muted); font-size: var(--fs-m); }
.link-back { color: var(--primary-text); text-decoration: none; font-size: var(--fs-m); font-weight: 600; }
/* ── Async region states: loading / empty / error, as three DISTINCT things ──────────────────
   `.state` is retained only so an un-migrated call site still renders something legible; every
   view now uses the three below. Making them look alike is what made a broken fleet and an
   empty one indistinguishable at a glance. */
.state { padding: 44px 10px; text-align: center; color: var(--muted); }
.st-loading { padding: 18px 2px; color: var(--muted); font-size: var(--fs-m); }

/* Skeleton. Shaped like the content, so nothing jumps when data arrives. */
.sk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sk-cell { display: block; height: 11px; border-radius: var(--radius-s); background: var(--surface-2); }
.sk-cell.sk-tall { height: 22px; }
.sk-row { display: flex; gap: 18px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sk-row-head { background: var(--surface-2); }
.sk { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sk-cards, .sk-stats { display: grid; gap: 16px; padding: 16px; }
.sk-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sk-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .sk-stats { grid-template-columns: repeat(2, 1fr); } }
.sk-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px;
           border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sk-lines { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
/* The shimmer is the only thing that says "working" rather than "broken". Honoured only when
   motion is welcome; otherwise the shapes sit still and the sr-only "Loading…" carries it. */
@media (prefers-reduced-motion: no-preference) {
  .sk-cell { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
             background-size: 200% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
}
@keyframes sk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty: quiet, and it names the next action. */
.st-empty, .st-error { padding: 34px 22px; border-radius: var(--radius); text-align: center; }
.st-empty { background: var(--surface-2); border: 1px dashed var(--border); }
/* Error: a semantic tint and a real border, so "broken" is legible without reading the words. */
.st-error { background: var(--danger-bg); border: 1px solid var(--danger-border); }
.st-title { font-weight: 700; font-size: var(--fs-l); color: var(--ink); margin: 0; }
.st-error .st-title { color: var(--danger); }
.st-body { font-size: var(--fs-m); color: var(--muted); margin: 6px auto 0; max-width: 52ch; }
.st-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* A state living inside a <td colspan>: drop the cell's own padding so the state's padding is
   the only one, otherwise the row is twice as tall as it should be. */
table.tbl td.st-cell { padding: 14px; background: var(--surface); white-space: normal; }
.sk-sr-row td { padding: 0; border: 0; height: 0; }

/* ── Tickets ── */
.reply { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; margin: 10px 0; background: var(--surface-2); }
.reply-internal { background: var(--danger-bg); border-color: var(--danger-border); }
.reply-head { font-size: var(--fs-s); margin-bottom: 6px; }
.reply-body { font-size: var(--fs-l); white-space: normal; word-break: break-word; }

/* ── Activity + audit ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat-num { font-size: var(--fs-2xl); font-weight: 800; }
.stat-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; font-weight: 600; }
.stat-sub { font-size: var(--fs-s); color: var(--muted); margin-top: 6px; }
.health-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.health-row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-l); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--success); }
.dot-warn { background: var(--warn-solid); }
.dot-bad { background: var(--danger); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }

/* ── Phase 5: store 360° (tabs, bars, health, revenue) ─────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border: none; background: none; cursor: pointer; font-family: inherit; font-size: var(--fs-m); font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.hstatus { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill); }
.hstatus-ok { background: var(--success-bg); color: var(--success); }
.hstatus-warn { background: var(--warn-bg); color: var(--warn); }
.hstatus-bad { background: var(--danger-bg); color: var(--danger); }

.check-row { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: none; }
.check-row .dot { margin-top: 5px; }
.check-label { font-weight: 600; font-size: var(--fs-m); }
.check-detail { color: var(--muted); font-size: var(--fs-s); margin-top: 1px; }

.bar { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: var(--radius-pill); }
.bar.over > span { background: var(--danger); }
.usage-row { margin-bottom: 14px; }
.usage-head { display: flex; justify-content: space-between; font-size: var(--fs-m); }
.usage-head b { font-weight: 700; }

.prod-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-m); }
.prod-row:last-child { border-bottom: none; }
.prod-row .prod-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row .prod-val { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qchip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 10px; font-size: var(--fs-s); margin: 0 6px 6px 0; }
.qchip b { color: var(--muted); font-weight: 700; }
.range-sel { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 3px; }
.range-sel button { border: none; background: none; padding: 5px 10px; border-radius: var(--radius-s); font-size: var(--fs-s); font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; }
.range-sel button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ── Phase 6: fleet command center ─────────────────────────── */
.section-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.spark { width: 100%; height: 30px; display: block; margin-top: 10px; }
.hbar { display: flex; height: 12px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-2); margin: 6px 0 10px; }
.hbar > span { display: block; height: 100%; }
.hbar-ok { background: var(--success); }
.hbar-warn { background: var(--warn-solid); }
.hbar-bad { background: var(--danger); }
.hbar-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-m); color: var(--muted); }
.hbar-legend .dot { margin-right: 5px; }
.attn-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: var(--fs-m); }
.attn-row:last-child { border-bottom: none; }
.attn-row:hover { background: var(--surface-2); }
.attn-shop { font-weight: 600; }
.attn-why { color: var(--muted); margin-left: auto; font-size: var(--fs-s); }

/* ── Toast (persistent, survives view re-renders) ─────────────────────────── */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 340px; pointer-events: none; }
.toast-host .toast { box-shadow: var(--shadow-pop); pointer-events: auto; }
.toast-pop { animation: toast-in .22s ease; }
.toast-hide { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast-pop { animation: none; } .toast-hide { transition: none; } }

/* ── Notification bell + dropdown ─────────────────────────────────────────── */
.notif-wrap { position: relative; display: inline-flex; }
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border-s); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .12s; }
.notif-bell:hover { background: var(--primary-bg); color: var(--primary); }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--primary); color: var(--primary-ink); font-size: var(--fs-xs); font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notif-dropdown { position: absolute; top: 44px; right: 0; width: 340px; max-width: 88vw; background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 60; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: var(--fs-m); }
.notif-markall { border: none; background: none; color: var(--primary); font-size: var(--fs-s); font-weight: 600; cursor: pointer; padding: 0; }
.notif-markall:hover { text-decoration: underline; }
.notif-list { max-height: min(60vh, 420px); overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-bg); }
.notif-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; visibility: hidden; }
.notif-item.unread .notif-dot { visibility: visible; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: var(--fs-m); font-weight: 600; color: var(--ink); line-height: 1.35; }
.notif-sub { font-size: var(--fs-s); color: var(--muted); margin-top: 2px; line-height: 1.4; overflow-wrap: anywhere; }
.notif-time { font-size: var(--fs-xs); color: var(--muted); opacity: .8; margin-top: 3px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: var(--fs-m); }

/* ── Command-center dashboard ─────────────────────────────────────────────── */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-text); }
.dash-title { font-family: var(--display); font-size: var(--fs-2xl); letter-spacing: -.02em; margin: 6px 0 4px; }
.dash-lede { color: var(--muted); font-size: var(--fs-l); margin: 0; }
.dash-quick { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-row { grid-template-columns: 1fr; } }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 12px;
  overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s;
}
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #ff8a5c); opacity: .9; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-num { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--fs-s); color: var(--muted); }
/* .dash-delta was the dashboard's own copy of the delta chip; charts.js's .ch-delta is now
   the only one. The selectors are kept together so the two can never drift apart again. */
.dash-delta, .ch-delta { font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: var(--radius-pill); white-space: nowrap; }
.dash-delta.up, .ch-delta.up { color: var(--success); background: var(--success-bg); }
.dash-delta.down, .ch-delta.down { color: var(--danger); background: var(--danger-bg); }
.dash-spark { width: 100%; height: 40px; display: block; margin-top: 10px; }

.dash-cols { display: grid; grid-template-columns: minmax(300px, 1fr) 1.4fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-ring-card h2, .dash-feed-card h2 { margin-bottom: 14px; }
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring-canvas { position: relative; width: 168px; height: 168px; flex: none; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 800; line-height: 1; }
.ring-center span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 3px; }
.ring-legend { display: flex; flex-direction: column; gap: 9px; font-size: var(--fs-m); min-width: 160px; }
.ring-legend .lg { display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: var(--radius-s); padding: 2px 4px; }
.ring-legend .lg:hover { background: var(--surface-2); }
.ring-legend .lg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.ring-legend .lg-total { font-size: var(--fs-s); color: var(--muted); margin-top: 2px; }

.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.feed-row:last-child { border-bottom: none; }
.feed-row[role="link"] { cursor: pointer; border-radius: var(--radius-s); }
.feed-row[role="link"]:hover { background: var(--surface-2); }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-size: var(--fs-m); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-sub { font-size: var(--fs-s); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.sev { width: 4px; align-self: stretch; border-radius: var(--radius-pill); flex: none; }
.sev-warn { background: var(--warn-solid); }
.sev-bad { background: var(--danger); }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-s); flex: none; }

/* ── ⌘K command palette ───────────────────────────────────────────────────── */
.cmdk { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-start; justify-content: center; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(14,14,16,.38); backdrop-filter: blur(2px); }
.cmdk-panel {
  position: relative; margin-top: 12vh; width: 100%; max-width: 560px;
  background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column;
  animation: cmdk-in .14s ease;
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmdk-panel { animation: none; } }
.cmdk-input {
  border: none; border-bottom: 1px solid var(--border); padding: 16px 18px; font-size: var(--fs-l);
  font-family: inherit; color: var(--ink); background: var(--surface); outline: none; width: 100%;
}
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 5px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); cursor: pointer; }
.cmdk-item.active, .cmdk-item:hover { background: var(--primary-bg); }
.cmdk-label { font-size: var(--fs-m); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-sub { font-size: var(--fs-s); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .badge { margin-left: auto; }
.cmdk-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: var(--fs-m); }
.cmdk-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); }
.cmdk-foot kbd { font-family: ui-monospace, Menlo, monospace; background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 1px 5px; font-size: var(--fs-xs); margin-right: 2px; }

/* ── SLA queue ────────────────────────────────────────────────────────────── */
.q-mine { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-m); font-weight: 600; color: var(--muted); cursor: pointer; }
.q-summary { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
/* The tiles are FILTERS now, not read-outs — they were the only thing that could have
   spared an operator scrolling a 2,199px page to reach the overdue tickets. */
.q-stat { flex: 1; min-width: 120px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; font-size: var(--fs-s);
  color: var(--muted); font-weight: 600; text-align: left; font-family: inherit; cursor: pointer;
  transition: border-color .12s, box-shadow .12s; }
.q-stat:hover { border-color: var(--border-s); }
.q-stat.active { border-color: var(--ink); box-shadow: var(--shadow-pop); }
.q-stat b { display: block; font-family: var(--display); font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: 3px; }
.q-stat.q-bad { border-left: 3px solid var(--danger); }
.q-stat.q-warn { border-left: 3px solid var(--warn-solid); }
.q-stat.q-ok { border-left: 3px solid var(--success); }

/* Rows, not cards. Eighteen tickets as ~98px full-width cards showing four facts each
   produced a 2,199px page; 200 open tickets would produce ~24,000px, all of it laid out
   before the operator can act. The severity now lives in a left rail on the row. */
.q-tbl td { vertical-align: middle; }
/* The rail is a border on the first CELL, not a box-shadow on the row: in a
   border-collapse table Chrome paints an inset row shadow over the whole row, which
   turned every overdue ticket into a solid red band. */
.q-row { cursor: pointer; }
.q-row:hover { background: var(--surface-2); }
.q-row > td:first-child { border-left: 3px solid var(--border); }
/* qsev-, not sev-. `.sev-bad` and `.sev-warn` are GLOBAL classes that set a solid
   background for the dashboard's activity rail, and a <tr> wearing one turned the whole
   row into a red band. The old cards escaped it only because `.q-card` happened to be
   declared later with its own background — a collision waiting for the next element that
   isn't. */
.q-row.qsev-bad  > td:first-child { border-left-color: var(--danger); }
.q-row.qsev-warn > td:first-child { border-left-color: var(--warn-solid); }
.q-row.qsev-ok   > td:first-child { border-left-color: var(--success); }
.q-id { font-size: var(--fs-s); color: var(--muted); font-variant-numeric: tabular-nums; }
.q-subject { font-weight: 650; }
.q-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 1px; }
.q-pill { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.q-pill.q-bad { background: var(--danger-bg); color: var(--danger); }
.q-pill.q-warn { background: var(--warn-bg); color: var(--warn); }
.q-pill.q-ok { background: var(--success-bg); color: var(--success); }
.q-actcol { text-align: right; white-space: nowrap; }

/* ── Bulk actions + saved views (tickets) ─────────────────────────────────── */
.tk-cbcell { width: 34px; text-align: center; }
.tk-cbcell input { cursor: pointer; }
.chips-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip-view { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius-pill); padding: 4px 6px 4px 12px; font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.chip-view:hover { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-text); }
.chip-x { border: none; background: none; color: var(--muted); cursor: pointer; font-size: var(--fs-l); line-height: 1; padding: 0 4px; border-radius: 50%; }
.chip-x:hover { color: var(--danger); }
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--primary-bg); border: 1px solid var(--primary); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 14px;
}
.bulk-count { font-weight: 700; color: var(--primary-text); font-size: var(--fs-m); }
.bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── 2FA enrollment (QR) ──────────────────────────────────────────────────── */
.enroll-2fa { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.qr-box { flex: none; width: 200px; height: 200px; background: #fff; border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 8px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.enroll-steps { flex: 1; min-width: 260px; }
.enroll-steps p { margin: 0 0 8px; }

/* ── Staff management ─────────────────────────────────────────────────────── */
.st-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-actions .btn { padding: 6px 10px; font-size: var(--fs-s); }

/* ── Login extras (forgot / reset) ────────────────────────────────────────── */
.linklike { background: none; border: none; color: var(--primary-text); font: inherit; font-size: var(--fs-m); font-weight: 600; cursor: pointer; padding: 4px; align-self: center; }
.linklike:hover { text-decoration: underline; }
.login-note { background: var(--success-bg); color: var(--success); border-radius: var(--radius-s); padding: 9px 12px; font-size: var(--fs-m); line-height: 1.5; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14,14,16,.42); }
.modal-card { position: relative; width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 88vh; overflow-y: auto; animation: cmdk-in .14s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: var(--fs-l); }
.modal-x { border: none; background: none; font-size: var(--fs-xl); line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 18px; }
.modal-body p { margin: 0 0 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; border: 1px solid var(--border-s); border-radius: var(--radius-s); padding: 8px 10px; font-size: var(--fs-s); font-family: ui-monospace, Menlo, monospace; color: var(--ink); background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none; } }

/* ── Dev-store badge + secondary domain ───────────────────────────────────── */
.badge-dev { background: #ebf3fb; color: #1f5199; border: 1px solid #bcd6f5; }
.sub-domain { font-size: var(--fs-s); color: var(--muted); margin-top: 2px; }

/* ── Entitlement chain: WHY a shop is on this plan (Phase 6 step 6) ────────────
   A 4-column grid rather than a table: the rows are a sequence, not tabular data,
   and the winning step needs to be findable without reading any of them. Only the
   winner gets ink and weight; the losers stay legible but recede, because they are
   context for the decision, not the decision. */
.chain-head { font-family: var(--display); font-size: var(--fs-m); font-weight: 700;
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.chain { list-style: none; margin: 0; padding: 0; }

/* Plain, unbulleted lists used where a card lists facts rather than tabulating them: the
   category menu on Suggestions and the step list on Setup progress. Both shipped referring to
   a `.plain-list` class that did not exist, so they fell back to UA list styling — bullets and
   a browser margin. The same mistake as an invented `.input`: harmless-looking, and the reason
   the console gets measured by RENDERING it rather than by reading the markup. */
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plain-list li { font-size: var(--fs-m); }

/* A bare `.dot` (no state modifier) is a step not reached yet — deliberately neutral rather
   than red: "not started" is not a failure. */
.setup-steps li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.setup-steps .dot { align-self: center; background: var(--border-s); }
.setup-steps .dot-ok { background: var(--success); }
.setup-steps .dot-warn { background: var(--warn-solid); }
.setup-steps .dot-bad { background: var(--danger); }
.chain-step { display: grid; grid-template-columns: 18px 150px 110px 1fr; gap: 10px;
  align-items: baseline; padding: 7px 8px; border-radius: var(--radius-s);
  font-size: var(--fs-m); color: var(--muted); }
.chain-step + .chain-step { border-top: 1px solid var(--border); }
.chain-mark { color: var(--success); font-weight: 700; text-align: center; }
.chain-name { font-weight: 500; }
.chain-value { font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-s); }
.chain-note { font-size: var(--fs-s); }
/* The winner. Tinted fill + full-strength ink, so scanning the block answers the
   question before any prose is read. */
.chain-win { background: var(--success-bg); color: var(--ink); }
.chain-win .chain-name { font-weight: 700; }
.chain-feats { display: flex; flex-wrap: wrap; gap: 6px; }
.chain-limits { margin-top: 12px; }
.notice-danger { color: var(--danger); background: var(--danger-bg);
  border: 1px solid var(--danger-border); border-radius: var(--radius-s);
  padding: 8px 10px; margin: 0 0 10px; }
@media (max-width: 720px) {
  /* Below this the 4 columns collide; the note is the longest field, so it wraps
     to its own full-width row rather than being squeezed to two words per line. */
  .chain-step { grid-template-columns: 18px 1fr 110px; }
  .chain-note { grid-column: 2 / -1; }
}

/* ── Store detail: figures read from the app backend (Phase 3) ─────────────────────────── */
/* Every number on the store's Revenue, AI cost and Diagnostics tabs is fetched from the app's
   own reports rather than recomputed here. `src-note` says so on the page, because a figure
   whose provenance is invisible is one someone will eventually re-derive by hand. */
.src-note { margin-top: 10px; font-size: var(--fs-xs); color: var(--muted); }
.delta-row { margin: 8px 0 4px; font-size: var(--fs-s); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.app-link-warn { margin-bottom: 14px; }

/* Numeric columns right-align so magnitudes are comparable down the column; tabular figures
   stop the digits jittering between rows. */
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.nowrap { white-space: nowrap; }
.tbl td.wrap   { white-space: normal; word-break: break-word; max-width: 42ch; }

.pre-meta {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  font-size: var(--fs-xs); line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow: auto;
}
