/* EZSM dashboard: the AutoDelivery.gg operator console's design (EZSM Console, Design System), night theme first,
   the light theme on the same tokens. Sections, in order: 1 tokens · 2 reset and base · 3 typography helpers ·
   4 shell (sidebar, top bar, content) · 5 page head · 6 components, one block per macro in _components.html, same
   class names (pill, code, kpi, panel, sect, ftabs, selchips, btn, forms, banner, tl, bavatar, phase, pbar, sstrip,
   empty, tables, thumbs, src, prob, sla, age, feedrow) · 7 the page-level classes every page still uses (kept until
   each page is restyled; nothing a template references is removed).
   Nothing moves under the pointer: no entrance animations, no hover transforms. */

/* ══ 1 · tokens ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root, [data-theme="dark"] {
  --bg: #050608; --panel: #0b0d11; --panel-2: #101318; --sunk: #07080b; --line: #1a1e26; --line-2: #262b35;
  --ink: #f1f3f6; --ink-2: #a8aeb9; --ink-3: #7b828f; --on-ink: #050608;
  --accent: #4b8dff; --accent-bg: #0e1b35; --btn: #2a74f5; --btn-hover: #3b82ff; --on-btn: #ffffff; --brand: #ffcc4d;
  --neutral: #b3b9c3; --neutral-bg: #181b21; --wait: #5cc8e6; --wait-bg: #0b222b; --info: #6aa5ff; --info-bg: #0e1c38;
  --run: #a98bff; --run-bg: #1a1535; --ok: #4fd18b; --ok-bg: #0c2318; --warn: #f2c35b; --warn-bg: #271f0c;
  --attn: #ff9757; --attn-bg: #2c180c; --bad: #ff6b74; --bad-bg: #2f1014; --mute: #868d98; --mute-bg: #15181d;
  --glow: none; /* a flat background: no coloured glow behind the pages */
  --panel-grad: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0) 40%), #0b0d11;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset; --pop: 0 24px 60px rgba(0,0,0,.65), 0 0 0 1px #1f2430;
  --scrim: rgba(2,3,5,.72); --stripe: rgba(255,255,255,.03); --logo-filter: none; --on-attn: #000000;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #f7f8fa; --sunk: #eceef2; --line: #e3e6eb; --line-2: #d3d7de;
  --ink: #11141a; --ink-2: #454b56; --ink-3: #646b77; --on-ink: #ffffff;
  --accent: #1f5fd6; --accent-bg: #e7efff; --btn: #1f66e5; --btn-hover: #1857c9; --on-btn: #ffffff; --brand: #e0a400;
  --neutral: #535a64; --neutral-bg: #eceef1; --wait: #0b677f; --wait-bg: #e0f1f5; --info: #2150c4; --info-bg: #e7eefc;
  --run: #6438bd; --run-bg: #efe9fb; --ok: #1b7440; --ok-bg: #e2f2e7; --warn: #875700; --warn-bg: #faefd6;
  --attn: #ad3f08; --attn-bg: #fde8da; --bad: #b0202a; --bad-bg: #fbe4e5; --mute: #636871; --mute-bg: #eeeff1;
  --glow: none;
  --panel-grad: #ffffff; --shadow: 0 1px 2px rgba(20,22,26,.04); --pop: 0 16px 40px rgba(20,22,26,.16), 0 0 0 1px #e3e6eb;
  --scrim: rgba(20,22,26,.38); --stripe: rgba(20,22,26,.045); --logo-filter: invert(1) hue-rotate(180deg) saturate(1.4); --on-attn: #ffffff;
  color-scheme: light;
}
:root {
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* shape: 6 pills and tags · 9 buttons, inputs, nav · 14 panels, cards, banners; spacing on a 4 px grid */
  --r: 14px; --r-sm: 9px; --r-xs: 6px; --sidebar-w: 232px; --top-h: 60px; --content-w: 1480px;
  /* the names the page templates were written with, kept so every inline style follows the theme */
  --fg: var(--ink); --fg-muted: var(--ink-2); --fg-faint: var(--ink-3); --bg-elev: var(--panel); --bg-elev-2: var(--panel-2);
  --line-strong: var(--line-2); --accent-strong: var(--btn); --accent-soft: var(--accent-bg); --good: var(--ok);
  --good-soft: var(--ok-bg); --warn-soft: var(--warn-bg); --bad-soft: var(--bad-bg); --info-soft: var(--info-bg);
  --radius: var(--r); --radius-sm: var(--r-sm); --font: var(--sans); --font-display: var(--sans);
}

/* ══ 2 · reset and base ═══════════════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--glow); }
button, input, select, textarea { font: inherit; color: inherit; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::placeholder { color: var(--ink-3); }
::selection { background: var(--accent-bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
img { max-width: 100%; }
/* A picture that does not load (a Roblox headshot, a game icon, a marketplace logo, an item picture) shows its tile's
   background, never the browser's broken-image icon: a broken <img> renders as a normal box, so the pseudo-element
   covers it. Only the <img> gets the cover: the no-picture <span> the macros emit (initials, stripes) is content. */
.avatar, img.bavatar__img, img.thumbs__img, .glogo, .mlogo, .me__pic, .brand__logo, .thumb, .src__mk, .src__game { position: relative; }
.avatar::before, img.bavatar__img::before, img.thumbs__img::before, .glogo::before, .mlogo::before, .me__pic::before, .brand__logo::before, .thumb::before, .src__mk::before, .src__game::before { content: ""; position: absolute; inset: 0; background: var(--panel-2); border-radius: inherit; }
form { margin: 0; }
.inline-form { display: inline-flex; }
[x-cloak] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* A sideways two-finger swipe on a Mac trackpad means "Back" in Chrome and Safari; sideways-scrolling tables made
   it easy to trigger by accident. The page itself never goes back on an overscroll. */
html, body { overscroll-behavior-x: none; }
.tablewrap, .card--flush, .feed, .matrix, .panel__scroll { overscroll-behavior-x: contain; }

/* ══ 3 · typography ═══════════════════════════════════════════════════════════════════════════════════════════ */
/* Page title Geist 24/500 · KPI 28/600 · panel title 14.5/500 · body and cells 13/400 · Geist Mono 12.5 for ids,
   codes, money and durations · meta 12/400 ink-3 */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.cell-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num, .table td.num, .table th.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.icon { flex: none; display: block; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-3); }
.help { border-bottom: 1px dotted var(--accent); }
.is-ok, .is-good { color: var(--ok); } .is-warn { color: var(--warn); } .is-bad { color: var(--bad); } .is-attn { color: var(--attn); }
.is-run { color: var(--run); } .is-wait { color: var(--wait); } .is-info { color: var(--info); } .is-mute { color: var(--mute); }

/* ══ 4 · shell: sidebar, top bar, content ═════════════════════════════════════════════════════════════════════ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.shell--bare { display: block; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; border-right: 1px solid var(--line); overflow-y: auto; background: transparent; z-index: 30; }
/* brand: the client's logo and name, the tagline */
.brand { flex: none; display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__logo { width: 30px; height: 30px; border-radius: 9px; flex: none; object-fit: cover; background: var(--panel-2); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__tag { font-size: 11px; color: var(--ink-3); }
/* nav: 38 px rows (36 under "Manage"), the attention count on Overview */
.nav { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.nav__item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav__group ~ .nav__item { height: 36px; }
.nav__item:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav__item.is-active { background: var(--panel-2); color: var(--ink); }
.nav__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__count { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--attn); color: var(--on-attn); font: 600 11px/18px var(--mono); text-align: center; }
.nav__count:empty { display: none; }
.nav__group { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); padding: 16px 11px 6px; }
.nav__group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* the foot: the user card and "Powered by" */
.sidebar__foot { flex: none; margin-top: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.sbug { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--ink-3); font-size: 12.5px; }
.sbug:hover, .sbug.is-active { color: var(--ink); background: var(--panel); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.me__avatar { position: relative; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2); display: grid; place-items: center; font: 600 11px/1 var(--mono); overflow: hidden; }
.me__pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.me__pic.is-empty { display: none; }
.me__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.me__name { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__name:hover { text-decoration: none; color: var(--accent); }
.me__role { font-size: 11px; color: var(--ink-3); }
.iconbtn { width: 30px; height: 30px; flex: none; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-3); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.powered { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 7px; padding: 0 4px; color: var(--ink-3); font-size: 10.5px; min-width: 0; }
.powered > span:first-child { white-space: nowrap; }
.powered a { display: block; flex: none; }
.powered img { height: 11px; width: auto; display: block; filter: var(--logo-filter); opacity: .55; }
.powered a:hover img { opacity: .9; }
.powered__ver { margin-left: auto; white-space: nowrap; font: 10px/1.4 var(--mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the top bar: search with its "/" hint, then the Logs button and the theme toggle */
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.search { display: flex; align-items: center; gap: 8px; height: 38px; flex: 1; min-width: 0; max-width: 520px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--ink-3); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 10.5px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-3); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar__menu { display: none; }
/* the theme button shows where it goes: a sun in the dark, a moon in the light */
[data-theme="light"] .theme-sun, :root:not([data-theme="light"]) .theme-moon { display: none; }
/* content: 24/32 padding, the page centred at 1480 px */
.main { flex: 1; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; align-items: stretch; }
.main > .page { flex: 1; width: 100%; max-width: var(--content-w); margin: 0 auto; }
.main > .flash { width: 100%; max-width: var(--content-w); margin: 0 auto 16px; }
.scrim { display: none; }
.footer { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-102%); transition: transform .18s ease; background: var(--bg); box-shadow: var(--pop); }
  .shell.is-open .sidebar { transform: none; }
  .shell.is-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
  .topbar { padding: 0 12px; }
  .topbar__menu { display: inline-grid; }
  .main { padding: 14px 12px 24px; }
}

/* ══ 5 · page head: the title with the rule line ("Today ───"), the subtitle, actions at the right ═══════════ */
.page__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page__head > :first-child { order: 0; min-width: 0; }
.page__head:has(+ .tabs) { border-bottom: 0; padding-bottom: 0; }
.page__head > :not(:first-child) { order: 2; }
.page__head > .row { align-self: flex-start; }
.page__title { font-size: 24px; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
.page__title em { font-style: normal; color: var(--accent); }
.page__sub { color: var(--ink-3); margin-top: 4px; font-size: 13px; }
.page__head .row a.muted { color: var(--ink-3); }
.page__crumb { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.page__crumb:hover { color: var(--ink); text-decoration: none; }
.page--center { display: grid; place-items: center; text-align: center; min-height: 60vh; gap: 10px; }
.page > * + * { margin-top: 16px; }
.page > .page__head + * { margin-top: 0; }
@media (max-width: 760px) { .page__head { margin-bottom: 14px; padding-bottom: 12px; gap: 10px; } .page__title { font-size: 19px; } }

/* ══ 6 · components ═══════════════════════════════════════════════════════════════════════════════════════════ */

/* ── status chip: .pill (chip()) and the older .badge, one look: glyph + word on the tone's tint ── */
.pill, .badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 500; white-space: nowrap; border: 0; background: var(--neutral-bg); color: var(--neutral); vertical-align: middle; line-height: 1; }
.pill__g { font: 10.5px/1 var(--mono); }
.pill--sm { height: 20px; padding: 0 7px 0 6px; } .pill--sm .pill__g { font-size: 10px; }
.pill--lg { height: 24px; padding: 0 9px 0 8px; border-radius: 7px; font-size: 12.5px; font-weight: 600; } .pill--lg .pill__g { font-size: 11px; }
.pill--neutral, .badge--neutral { background: var(--neutral-bg); color: var(--neutral); }
.pill--wait, .badge--wait { background: var(--wait-bg); color: var(--wait); }
.pill--info, .badge--info { background: var(--info-bg); color: var(--info); }
.pill--run, .badge--run, .badge--accent { background: var(--run-bg); color: var(--run); }
.pill--ok, .badge--ok, .badge--good { background: var(--ok-bg); color: var(--ok); }
.pill--warn, .badge--warn { background: var(--warn-bg); color: var(--warn); }
.pill--attn, .badge--attn { background: var(--attn-bg); color: var(--attn); }
.pill--bad, .badge--bad { background: var(--bad-bg); color: var(--bad); }
.pill--mute, .badge--mute { background: var(--mute-bg); color: var(--mute); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot--neutral { background: var(--neutral); } .dot--wait { background: var(--wait); } .dot--info { background: var(--info); } .dot--run { background: var(--run); }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); } .dot--attn { background: var(--attn); } .dot--bad { background: var(--bad); } .dot--mute { background: var(--mute); }
.badge .mlogo { width: 14px; height: 14px; border-radius: 3px; margin: -2px 0; }

/* ── problem code: the mono badge (code()) ── */
.code { display: inline-block; font: 600 10.5px/16px var(--mono); padding: 0 5px; border-radius: 4px; border: 1px solid color-mix(in oklab, var(--attn) 40%, transparent); color: var(--attn); white-space: nowrap; vertical-align: middle; }
.code--attn { border-color: color-mix(in oklab, var(--attn) 40%, transparent); color: var(--attn); }
.code--bad { border-color: color-mix(in oklab, var(--bad) 40%, transparent); color: var(--bad); }
.code--warn { border-color: color-mix(in oklab, var(--warn) 45%, transparent); color: var(--warn); }
.code--ok { border-color: color-mix(in oklab, var(--ok) 40%, transparent); color: var(--ok); }
.code--info { border-color: color-mix(in oklab, var(--info) 40%, transparent); color: var(--info); }
.code--neutral, .code--mute { border-color: var(--line-2); color: var(--ink-3); }
.code--run { border-color: color-mix(in oklab, var(--run) 40%, transparent); color: var(--run); }
.code--wait { border-color: color-mix(in oklab, var(--wait) 40%, transparent); color: var(--wait); }

/* ── KPI tile (kpi(), kpis()) and the older .stat ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { display: grid; grid-template-rows: auto 1fr auto; row-gap: 8px; min-height: 116px; min-width: 0; padding: 16px 18px; background: var(--panel-grad); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--line-2); }
.kpi__label { font-size: 13px; line-height: 18px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value { align-self: center; font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__unit { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi__delta, .kpi__note { font: 500 11.5px/16px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.kpi__delta--ok { color: var(--ok); } .kpi__delta--bad { color: var(--bad); } .kpi__delta--warn { color: var(--warn); } .kpi__delta--neutral { color: var(--ink-3); }
.kpi--bad .kpi__value { color: var(--bad); } .kpi--warn .kpi__value { color: var(--warn); } .kpi--ok .kpi__value { color: var(--ok); } .kpi--attn .kpi__value { color: var(--attn); }
/* the older tiles: label on top, the number under it, the detail at the foot, whatever order the template writes them in */
.stat { display: flex; flex-direction: column; gap: 8px; min-height: 116px; }
.stat__label { order: -1; color: var(--ink-2); font-size: 13px; }
.stat__value, .stat .stat__value.num { text-align: left; font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; color: var(--ink); }
.stat > .faint:last-child, .stat > .muted:last-child { margin-top: auto; font-size: 12px; }
.stat .progress { margin-top: 2px; }
.stat__value small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.stat--hero .stat__value { font-size: 28px; }
.stat--hero.is-bad .stat__value { color: var(--bad); }
.stat--hero.is-warn .stat__value { color: var(--warn); }
.progress { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.progress__fill { height: 100%; background: var(--ok); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { min-height: 0; padding: 14px; } .kpi__value { font-size: 24px; } }

/* ── panels: .panel (sections of a page) with card_head(); .card (the older padded panel) ── */
.panel { background: var(--panel-grad); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.panel__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.panel__icon { display: inline-grid; place-items: center; flex: none; color: var(--ink-3); }
.panel__icon--attn { color: var(--attn); } .panel__icon--bad { color: var(--bad); } .panel__icon--warn { color: var(--warn); } .panel__icon--ok { color: var(--ok); } .panel__icon--info { color: var(--info); }
.panel__title { margin: 0; font-size: 14.5px; font-weight: 500; letter-spacing: -.005em; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel__count { height: 20px; padding: 0 7px; border-radius: 10px; background: var(--attn); color: var(--on-attn); font: 600 11px/20px var(--mono); flex: none; }
.panel__count--neutral, .panel__count--mute { background: var(--panel-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.panel__count--bad { background: var(--bad); color: var(--on-attn); } .panel__count--warn { background: var(--warn); color: var(--on-attn); } .panel__count--ok { background: var(--ok); color: var(--on-attn); } .panel__count--info { background: var(--accent); color: var(--on-btn); }
.panel__meta { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.panel__end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.panel__link { margin-left: auto; font-size: 12px; font-weight: 500; white-space: nowrap; }
.panel__meta + .panel__end, .panel__meta + .panel__link { margin-left: 0; }
.panel__body { padding: 14px 18px; }
.panel__body--flush { padding: 0; }
.panel__foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
.panel__scroll { overflow: auto; }
.panel > .table, .panel__scroll > .table { margin: 0; }
.panel .table th:first-child, .panel .table td:first-child { padding-left: 18px; }
.panel .table th:last-child, .panel .table td:last-child { padding-right: 18px; }
.panel .table tbody tr:last-child td { border-bottom: 0; }
.panel__empty { padding: 32px 18px; text-align: center; color: var(--ink-3); }
.card { background: var(--panel-grad); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
.card--inset { background: var(--panel-2); box-shadow: none; padding: 12px 14px; border-radius: 12px; }
.card__title { font-size: 14.5px; font-weight: 500; color: var(--ink); margin-bottom: 12px; letter-spacing: -.005em; }
.row > .card__title, .row--between > .card__title { margin-bottom: 0; }
.card > .row--between:first-child { margin-bottom: 12px; }
.card > .row--between:first-child .card__title { margin-bottom: 0; }
.card > .table:last-child, .card > .tablewrap:last-child { margin-bottom: -6px; }
.card > .panel__head:first-child { margin: -16px -18px 14px; }
/* A card that is only a table: the table runs to the card's edges, its first and last columns keep the card's gutter. */
.card--flush { padding: 0; overflow: auto; }
.card--flush > .card__title, .card--flush > .row--between:first-child { padding: 16px 18px 0; }
.card--flush > .panel__head:first-child { margin: 0; }
.card--flush > .table, .card--flush > .tablewrap { margin: 0; }
.card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: 18px; }
.card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: 18px; }
.card--flush .table tbody tr:last-child td { border-bottom: 0; }
.card--flush > .ftabs, .panel > .ftabs { border-radius: var(--r) var(--r) 0 0; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.stats { align-items: stretch; }
@media (max-width: 1100px) { .grid--3, .grid--4, .grid--main { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); } }
/* On a phone: KPI tiles two by two, and wide tables scroll sideways instead of folding every cell. */
@media (max-width: 760px) { .grid--4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat { min-height: 0; padding: 14px; } .stat__value { font-size: 24px; } .card--flush .table td, .tablewrap .table td, .panel .table td { white-space: nowrap; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; align-content: start; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── section title with the rule line (section_title()) ── */
.sect { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sect__title { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sect__rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); min-width: 24px; }
.sect__meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sect__end { display: flex; align-items: center; gap: 6px; flex: none; }
.sect--sm .sect__title { font-size: 16px; }

/* ── filter tabs with counts (filter_tabs()) and the toolbar they sit in ── */
.ftabs { display: flex; flex-wrap: wrap; gap: 0 2px; padding: 0 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.ftabs--bare { border-bottom: 0; padding: 0; }
.ftab { display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ftab:hover { color: var(--ink); text-decoration: none; }
.ftab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.ftab__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ftab__n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--panel-2); color: var(--ink-2); font: 600 11px/18px var(--mono); text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.ftab.is-active .ftab__n { background: var(--accent-bg); color: var(--accent); box-shadow: none; }
.ftab__n--attn, .ftab.is-active .ftab__n--attn { background: var(--attn); color: var(--on-attn); box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-grad); min-width: 0; }
.toolbar > .ftabs { border-bottom: 0; padding: 0; }
.toolbar .ftab { height: 48px; }
.toolbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 7px 0; flex-wrap: wrap; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filterbar__sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 2px; }
.filterbar__count { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.filterbar .input, .filterbar select, .filterbar .dd { width: auto; min-width: 130px; }
@media (max-width: 760px) { .ftab { height: 40px; padding: 0 8px; } .toolbar .ftab { height: 42px; } }

/* ── select chips: one-of-a-few (select_chips()) ── */
.selchips { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); max-width: 100%; flex-wrap: wrap; }
.selchips__label { font-size: 12px; color: var(--ink-3); padding: 0 4px 0 7px; }
.selchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.selchip:hover { color: var(--ink); text-decoration: none; }
.selchip.is-active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.selchip img, .selchip .glogo, .selchip .mlogo { width: 16px; height: 16px; border-radius: 4px; display: block; vertical-align: 0; }
.selchip__n { font: 11px/1 var(--mono); color: var(--ink-3); }
.selchip.is-active .selchip__n { color: var(--accent); }

/* ── buttons (btn(), post_btn()) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-size: 12.5px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--panel-2); border-color: var(--line-2); text-decoration: none; }
.btn:active { background: var(--sunk); }
.btn--primary { background: var(--btn); border-color: var(--btn); color: var(--on-btn); font-weight: 600; padding: 0 14px; }
.btn--primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
/* destructive is a red label, never a red fill, until the confirm dialog */
.btn--danger { background: var(--panel); border-color: var(--line-2); color: var(--bad); font-weight: 500; }
.btn--danger:hover { background: var(--bad-bg); border-color: color-mix(in oklab, var(--bad) 45%, transparent); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn--sm.btn--primary { padding: 0 11px; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 13.5px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.btn__g { font: 11px/1 var(--mono); }
.btn--sm .btn__g { font-size: 10px; }

/* ── forms and inputs ── */
.form { display: grid; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-self: start; }
.field__label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field__help { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.input, select, textarea { width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background-color: var(--panel); color: var(--ink); outline: none; min-width: 0; transition: border-color .12s, box-shadow .12s; }
select { padding-right: 28px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b828f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
select option { background: var(--panel); color: var(--ink); }
textarea { height: auto; min-height: 110px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--btn); margin: 0; flex: none; vertical-align: middle; }
input[type="file"] { height: auto; padding: 7px 10px; }
.input--sm { height: 28px; padding: 0 8px; font-size: 12px; border-radius: 8px; }
select.input--sm { padding-right: 24px; background-position: right 7px center; }
label.row { cursor: pointer; }
.code-input { height: 52px; font: 600 26px/1 var(--mono); letter-spacing: .35em; text-align: center; padding: 0 14px; }
/* segmented choice (one of a few): radio buttons drawn as a strip */
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); width: fit-content; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg label > span { display: block; padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg input:checked + span { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.45; }
.check input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--btn); }

/* ── dropdowns (dropdown.js): every <select> is drawn as a button and the console's own list, never the system
   menu. The select stays in the page, hidden, and stays the truth; the button wears its classes and inline style,
   so .input, .input--sm and the page rules size it, and it is as wide as its longest option, like a select. The
   list (.dd-pop) is the Orders filter menu's (.ddl__menu) look, placed on <body> with a fixed position. ── */
select.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; max-width: 1px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip-path: inset(50%); }
.dd { display: inline-flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 9px 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer; outline: none; min-width: 0; max-width: 100%; vertical-align: middle; transition: border-color .12s, box-shadow .12s, background-color .12s; }
.dd.input--sm { height: 28px; padding: 0 7px 0 8px; gap: 6px; font-size: 12px; border-radius: 8px; }
.dd:hover:not(:disabled) { background: var(--panel-2); }
.dd:focus-visible, .dd.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.dd.is-invalid { border-color: var(--bad); }
.dd:disabled { opacity: .55; cursor: not-allowed; }
.dd[hidden] { display: none !important; }
.dd__face { flex: 1 1 auto; min-width: 0; display: grid; }
.dd__value, .dd__ghost { grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd__ghost { visibility: hidden; height: 0; }
.dd__chev { flex: none; display: inline-grid; color: var(--ink-3); transition: transform .15s; }
.dd.is-open .dd__chev { transform: rotate(180deg); }
.dd-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; min-width: 160px; padding: 5px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--pop); color: var(--ink); font: 500 12.5px/1.35 var(--sans); overflow: hidden; }
.dd-pop__search { flex: none; height: 30px; margin: 0 0 5px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 400 12.5px var(--sans); outline: none; min-width: 0; }
.dd-pop__search:focus { border-color: var(--accent); }
.dd-pop__list { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.dd-opt { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 7px 8px 7px 10px; border-radius: 8px; cursor: pointer; }
.dd-opt__text { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.dd-opt__check { flex: none; display: inline-grid; visibility: hidden; }
.dd-opt.is-active { background: var(--line); }
.dd-opt[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); }
.dd-opt[aria-selected="true"] .dd-opt__check { visibility: visible; }
.dd-opt[aria-selected="true"].is-active { background: color-mix(in oklab, var(--accent-bg) 82%, var(--accent)); }
.dd-opt[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }
.dd-opt[aria-disabled="true"].is-active { background: transparent; }
.dd-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.dd-group:not(:first-child) { margin-top: 2px; }
.dd-empty { padding: 9px 10px; color: var(--ink-3); }
.dd-pop--sm { font-size: 12px; }
.dd-pop--sm .dd-opt { min-height: 30px; padding-top: 5px; padding-bottom: 5px; }
.dd-tip { position: fixed; z-index: 1001; max-width: calc(100vw - 32px); padding: 7px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in oklab, var(--bad) 40%, transparent); box-shadow: var(--pop); font-size: 12px; }
@media (pointer: coarse) { .dd-opt, .dd-pop--sm .dd-opt { min-height: 40px; } .dd-pop__search { height: 36px; font-size: 16px; } }

/* ── banners (banner(), problem_banner()), flashes and toasts ── */
.banner { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border-radius: 12px; border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); background: var(--warn-bg); color: var(--ink); line-height: 1.5; }
.banner--warn { border-color: color-mix(in oklab, var(--warn) 30%, transparent); background: var(--warn-bg); }
.banner--attn { border-color: color-mix(in oklab, var(--attn) 30%, transparent); background: var(--attn-bg); }
.banner--bad { border-color: color-mix(in oklab, var(--bad) 30%, transparent); background: var(--bad-bg); }
.banner--info { border-color: color-mix(in oklab, var(--info) 30%, transparent); background: var(--info-bg); }
.banner--good, .banner--ok { border-color: color-mix(in oklab, var(--ok) 30%, transparent); background: var(--ok-bg); }
.banner--run { border-color: color-mix(in oklab, var(--run) 30%, transparent); background: var(--run-bg); }
.banner--wait { border-color: color-mix(in oklab, var(--wait) 30%, transparent); background: var(--wait-bg); }
.banner--neutral, .banner--mute { border-color: var(--line-2); background: var(--panel-2); }
.banner .btn { margin-left: 6px; }
.banner--row { align-items: center; }
.banner--row .btn { margin-left: 0; }
.page > .banner + .banner { margin-top: 10px; }
.banner--full { flex-wrap: nowrap; padding: 14px 16px; }
.banner__glyph { width: 26px; height: 26px; flex: none; border-radius: 9px; background: var(--panel); display: grid; place-items: center; font: 600 12px/1 var(--mono); }
.banner--attn .banner__glyph { color: var(--attn); } .banner--warn .banner__glyph, .banner__glyph { color: var(--warn); } .banner--bad .banner__glyph { color: var(--bad); }
.banner--ok .banner__glyph, .banner--good .banner__glyph { color: var(--ok); } .banner--info .banner__glyph { color: var(--info); } .banner--run .banner__glyph { color: var(--run); }
.banner--wait .banner__glyph { color: var(--wait); } .banner--neutral .banner__glyph, .banner--mute .banner__glyph { color: var(--ink-3); }
.banner__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.banner__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.banner__title strong { font-weight: 600; color: var(--ink); }
.banner__text { color: var(--ink-2); text-wrap: pretty; }
.banner__next { color: var(--ink); text-wrap: pretty; }
.banner__next strong { font-weight: 600; }
.banner__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.banner__actions .btn { margin-left: 0; }
.flash, .toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); }
.flash { margin-bottom: 16px; }
.flash--good, .toast--good, .flash--ok, .toast--ok { border-color: color-mix(in oklab, var(--ok) 55%, transparent); background: var(--ok-bg); }
.flash--bad, .toast--bad { border-color: color-mix(in oklab, var(--bad) 55%, transparent); background: var(--bad-bg); }
.flash--warn, .toast--warn { border-color: color-mix(in oklab, var(--warn) 55%, transparent); background: var(--warn-bg); }
.flash--info, .toast--info { border-color: color-mix(in oklab, var(--info) 55%, transparent); background: var(--info-bg); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; max-width: calc(100% - 36px); }
.toast { min-width: 260px; max-width: 420px; box-shadow: var(--pop); pointer-events: auto; background: var(--panel-2); }

/* ── timeline (timeline(), timeline_step()) ── */
.tl { list-style: none; margin: 0; padding: 0; }
.tl__step { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; position: relative; padding: 7px 0; }
.tl__line { position: absolute; left: 9px; top: 24px; bottom: -8px; width: 2px; background: var(--line); }
.tl__step:last-child .tl__line { display: none; }
.tl__step--done .tl__line { background: var(--ok); }
.tl__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--panel); color: var(--ink-3); display: grid; place-items: center; font: 600 9.5px/1 var(--mono); position: relative; z-index: 1; }
.tl__step--done .tl__dot { border-color: var(--ok); background: var(--ok); color: var(--panel); }
.tl__step--current .tl__dot { border-color: var(--run); color: var(--run); }
.tl__step--fail .tl__dot { border-color: var(--attn); color: var(--attn); }
.tl__step--warn .tl__dot { border-color: var(--warn); color: var(--warn); }
.tl__step--cancel .tl__dot { border-color: var(--mute); color: var(--mute); }
.tl__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tl__title { font-weight: 500; color: var(--ink); }
.tl__step--todo .tl__title { color: var(--ink-3); font-weight: 400; }
.tl__note { font: 12px/1.35 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.tl__step--fail .tl__note { color: var(--attn); } .tl__step--warn .tl__note { color: var(--warn); }
.tl__time { font: 11.5px/20px var(--mono); color: var(--ink-3); white-space: nowrap; }

/* ── bot pieces: the avatar with the game badge (bot_avatar()), the phase box (phase_line()), the bar (phase_bar()) ── */
.bavatar { --sz: 42px; position: relative; display: inline-block; flex: none; width: var(--sz); height: var(--sz); vertical-align: middle; }
.bavatar__img { display: grid; place-items: center; width: var(--sz); height: var(--sz); border-radius: calc(var(--sz) * .29); background: var(--panel-2); border: 1px solid var(--line-2); object-fit: cover; color: var(--ink-2); font: 600 calc(var(--sz) * .3) / 1 var(--mono); overflow: hidden; }
.bavatar--round .bavatar__img { border-radius: 50%; }
.bavatar__img--empty { letter-spacing: .02em; }
.bavatar__img.is-empty { color: transparent; }
.bavatar__game { position: absolute; right: calc(var(--sz) * -.12); bottom: calc(var(--sz) * -.12); border-radius: calc(var(--sz) * .14); border: 2px solid var(--panel); background: var(--panel-2); display: block; vertical-align: 0; }
.phase { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); min-width: 0; }
.phase__row { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.phase__g { font: 10px/1 var(--mono); flex: none; }
.phase--neutral .phase__g { color: var(--neutral); } .phase--wait .phase__g { color: var(--wait); } .phase--info .phase__g { color: var(--info); } .phase--run .phase__g { color: var(--run); }
.phase--ok .phase__g { color: var(--ok); } .phase--warn .phase__g { color: var(--warn); } .phase--attn .phase__g { color: var(--attn); } .phase--bad .phase__g { color: var(--bad); } .phase--mute .phase__g { color: var(--mute); }
.phase__word { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.phase__for { font: 11.5px/1 var(--mono); color: var(--ink-3); flex: none; }
.pbar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 100%; }
.pbar__s { height: 4px; border-radius: 1px; background: var(--line-2); }
.pbar__s--done, .pbar__s--current { background: var(--run); }
.pbar__s--current:last-child { background: var(--ok); }
.pbar__s--fail { background: var(--bad); }
.pbar__s--warn { background: var(--warn); }
.pbar--lg .pbar__s { height: 6px; border-radius: 2px; } .pbar--lg { gap: 3px; }

/* ── stat strip (stat_strip()): small labelled values under a page head or at a card's foot ── */
.sstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); min-width: 0; }
.sstrip__cell { background: var(--panel-2); padding: 9px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sstrip__label { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sstrip__value { font: 500 13px/1.3 var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sstrip__value--sans { font-family: var(--sans); }
.sstrip__value--ok { color: var(--ok); } .sstrip__value--warn { color: var(--warn); } .sstrip__value--bad { color: var(--bad); } .sstrip__value--attn { color: var(--attn); } .sstrip__value--mute { color: var(--ink-3); } .sstrip__value--run { color: var(--run); } .sstrip__value--info { color: var(--info); }
.sstrip--inline { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; background: transparent; border-top: 0; }
.sstrip--inline .sstrip__cell { background: transparent; padding: 0; gap: 2px; }
.sstrip--inline .sstrip__label { font-size: 11px; }
.sstrip--inline .sstrip__value { font-size: 12.5px; line-height: 1.2; white-space: normal; }
.panel > .sstrip:last-child { border-bottom: 0; }

/* ── empty state (empty_state()) ── */
.empty { padding: 28px 18px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty__icon { width: 44px; height: 44px; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; font: 18px/1 var(--mono); color: var(--ink-3); margin-bottom: 2px; }
.empty__title { color: var(--ink); font-weight: 600; font-size: 15px; }
.empty__text { margin: 0; color: var(--ink-2); max-width: 440px; text-wrap: pretty; }
.empty__action { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.empty--compact { padding: 22px 16px; border: 0; }
.empty--compact .empty__icon { width: 36px; height: 36px; font-size: 15px; }
.empty--compact .empty__title { font-size: 14px; }

/* ── tables: .table, the row link (row_link()), the one empty row (table_empty()) ── */
.tablewrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--ink-3); font-weight: 500; font-size: 12.5px; padding: 10px 12px; border-bottom: 1px dashed var(--line-2); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px dashed var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--stripe); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table--compact td, .table--compact th { padding-top: 7px; padding-bottom: 7px; }
.table--sticky thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.card > .table, .card > .tablewrap { margin-top: 2px; }
.table .row-link { cursor: pointer; }
.table .row-link:hover td, .table .row-link:focus-visible td { background: var(--panel-2); }
.table .row-link:focus-visible { outline: none; } .table .row-link:focus-visible td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table tr.is-attn td { background: color-mix(in oklab, var(--attn-bg) 55%, transparent); }
.table tr.is-attn:hover td { background: var(--attn-bg); }
.table__empty td { padding: 32px 16px; text-align: center; color: var(--ink-3); }
.table .ref { font: 600 12.5px/1 var(--mono); color: var(--ink); }
.table .mono-cell { font-family: var(--mono); font-size: 12.5px; }
.table .cell-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }

/* ── pictures in rows: stacked item thumbnails (thumb_stack()) and the source tile (source_tile()) ── */
.thumbs { --sz: 30px; display: inline-flex; flex: none; vertical-align: middle; }
.thumbs__img { width: var(--sz); height: var(--sz); border-radius: calc(var(--sz) * .27); object-fit: cover; border: 2px solid var(--panel); background: var(--panel-2); display: block; }
.thumbs__img + .thumbs__img { margin-left: calc(var(--sz) * -.27); }
.thumbs__img--empty { background: repeating-linear-gradient(135deg, var(--stripe) 0 5px, var(--panel-2) 5px 10px); }
.src { --sz: 40px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--sz); height: var(--sz); border-radius: calc(var(--sz) * .27); background: var(--panel-2); border: 1px solid var(--line-2); vertical-align: middle; }
.src__mk { border-radius: 5px; display: block; vertical-align: 0; }
.src__txt { font: 600 calc(var(--sz) * .3) / 1 var(--mono); color: var(--ink-2); }
.src__game { position: absolute; right: calc(var(--sz) * -.15); bottom: calc(var(--sz) * -.15); border-radius: 6px; border: 2px solid var(--panel); background: var(--panel-2); display: block; vertical-align: 0; }

/* ── the problem cell (problem()) ── */
.prob { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.prob__icon { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--attn-bg); color: var(--attn); display: grid; place-items: center; }
.prob--bad .prob__icon { background: var(--bad-bg); color: var(--bad); } .prob--warn .prob__icon { background: var(--warn-bg); color: var(--warn); }
.prob__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prob__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prob__title strong { font-weight: 600; }
.prob__text, .prob__next { font-size: 12px; color: var(--ink-2); text-wrap: pretty; }
.prob__next { color: var(--ink); } .prob__next strong { font-weight: 600; }

/* ── the SLA bar (sla()), the age tag (age()), the feed row (feed_row()) ── */
.sla { display: inline-block; width: 44px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; vertical-align: middle; }
.sla__fill { display: block; height: 100%; }
.sla__fill--ok { background: var(--ok); } .sla__fill--warn { background: var(--warn); } .sla__fill--bad { background: var(--bad); }
.age { display: inline-block; font: 500 11px/18px var(--mono); padding: 0 6px; border-radius: 5px; white-space: nowrap; vertical-align: middle; color: var(--ink-3); background: var(--panel-2); }
.age--ok { color: var(--ok); background: var(--ok-bg); } .age--warn { color: var(--warn); background: var(--warn-bg); } .age--bad { color: var(--bad); background: var(--bad-bg); } .age--attn { color: var(--attn); background: var(--attn-bg); } .age--neutral { color: var(--ink-3); background: var(--panel-2); }
.feedrow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 18px; border-bottom: 1px dashed var(--line); color: var(--ink); text-align: left; }
.feedrow:last-child { border-bottom: 0; }
a.feedrow:hover { background: var(--panel-2); text-decoration: none; }
.feedrow__tile { width: 22px; height: 22px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; position: relative; }
.feedrow__tile img, .feedrow__tile .mlogo, .feedrow__tile .glogo { width: 12px; height: 12px; border-radius: 2px; display: block; vertical-align: 0; }
.feedrow__dot { position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--panel); }
.feedrow__text { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedrow__time { font: 11px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }

/* ── misc pictures and bits ── */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; border: 1px solid var(--line-2); }
.avatar--lg { width: 56px; height: 56px; }
.thumb { border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); object-fit: cover; }
.thumb--xs { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; }
.thumb--sm { width: 40px; height: 40px; }
.thumb--empty { display: inline-block; background: var(--stripe); border: 1px solid var(--line); }
.thumb.is-missing, .picture img.is-missing { background: repeating-linear-gradient(135deg, var(--stripe) 0 6px, transparent 6px 12px); opacity: .6; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.spinner { display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--run) 35%, transparent); border-top-color: var(--run); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* fold-outs: one look everywhere, a chevron that turns, and a whole-row target on a card */
details > summary { cursor: pointer; list-style: none; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary:not(.btn) { display: flex; align-items: center; gap: 8px; width: fit-content; }
details > summary:not(.btn)::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 0 1px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .12s; opacity: .75; }
details[open] > summary:not(.btn)::before { transform: rotate(45deg); }
details > summary:not(.btn):hover { color: var(--ink); }
details > summary.btn::before { content: none; }
details.card > summary { width: auto; margin: -16px -18px; padding: 16px 18px; border-radius: var(--r); }
details.card > summary:hover { background: var(--stripe); }
details.card[open] > summary { margin-bottom: 4px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.inline > summary::before { content: none; }
details.inline > summary strong { border-bottom: 1px dotted var(--ink-3); }
details.inline .pop { margin-top: 4px; font-size: 12px; color: var(--ink-2); white-space: normal; max-width: 360px; text-align: left; }

/* ══ 7 · page-level classes, kept until each page is restyled on the components above ═════════════════════════ */

/* ── the older timeline (orders/_timeline.html, onboarding steps, bot history) ── */
/* The line is drawn inside each row, through the dot's centre (a border on the list sat beside the dots, and a
   scrolling list clipped anything left of it): dot 9 px wide at 0, line 1 px at 4 px. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 6px 0 6px 20px; }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:first-child::after { top: 16px; }
.timeline li:last-child::after { bottom: auto; height: 16px; }
.timeline li:only-child::after { display: none; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); box-shadow: 0 0 0 3px var(--panel); z-index: 1; }
.timeline li.is-good::before { background: var(--ok); }
.timeline li.is-bad::before { background: var(--bad); }
.timeline li.is-warn::before { background: var(--warn); }
/* older timelines write a message and a time in a .row--between: keep the time on the message's line */
.timeline li > .row--between { flex-wrap: nowrap; align-items: baseline; gap: 12px; }
.timeline li > .row--between > :first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.timeline li > .row--between > :last-child { flex: none; white-space: nowrap; font-size: 12px; }
.timeline__head { display: flex; align-items: baseline; gap: 12px; }
.timeline__msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.timeline__when { flex: none; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.timeline__kind { color: var(--ink-3); opacity: .8; font-size: 11px; font-family: var(--mono); margin-top: 2px; }
.timeline__note { font-size: 12px; margin-bottom: 6px; }

/* ── login ── */
.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login .card { padding: 26px 24px; box-shadow: var(--pop); }
.login__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

/* ── tabs and the action bar ── */
.tabs { display: flex; align-items: center; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; height: 38px; padding: 0 12px; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs__end { margin-left: auto; display: flex; align-items: center; gap: 6px; padding-bottom: 6px; }
.tabs a.tabs__end { font-size: 12px; }
.tabs.tabs--inline { margin-bottom: 0; border-bottom: 0; gap: 4px; }
.tabs.tabs--inline a { height: 30px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--r-sm); margin: 0; font-size: 12.5px; }
.tabs.tabs--inline a.is-active { border-color: var(--line-2); background: var(--panel-2); }
.actionbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.actionbar .btn.is-active { border-color: var(--accent); color: var(--ink); background: var(--accent-bg); }
.actionbar__sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.checklist { margin-bottom: 16px; }
.checklist ol { margin: 6px 0 0; padding-left: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }

/* ── order detail ── */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery figure { margin: 0; width: 160px; }
.gallery figcaption { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.gallery--reads figure { width: 212px; }
.gallery--reads .thumb { width: 212px; height: auto; max-height: 120px; object-fit: contain; background: #0b0d12; }
.gallery .thumb { width: 160px; height: 90px; cursor: zoom-in; display: block; }
.phases { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.phases li { font-size: 11px; height: 20px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--r-xs); background: var(--neutral-bg); color: var(--ink-2); }
.phases li.is-bad { background: var(--bad-bg); color: var(--bad); }
.phases li.is-good { background: var(--ok-bg); color: var(--ok); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; }
.lightbox::backdrop { background: var(--scrim); }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--r); }
.video { width: 100%; max-width: 640px; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.chat li { padding: 8px 10px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.chat li.is-out { border-color: var(--line-2); }
.chat li.is-failed { border-color: var(--bad); }

/* ── stock matrix and row states ── */
.matrix th, .matrix td { white-space: nowrap; }
.matrix__item { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 220px; white-space: normal; }
.cell--zero { color: var(--ink-3); }
.cell--excluded { color: var(--ink-3); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--stripe) 6px 8px); }
tr.is-low td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
tr.is-low td:first-child, tr.is-bad td:first-child { padding-left: 10px; }
tr.is-muted td { opacity: .55; }
tr.is-bad td:first-child { box-shadow: inset 2px 0 0 var(--bad); }
tr.is-warn td:first-child { box-shadow: inset 2px 0 0 var(--warn); padding-left: 10px; }
td.is-good, .is-good.num { color: var(--ok); }
td.is-bad, .is-bad.num { color: var(--bad); }
td.is-warn { color: var(--warn); }
a.is-warn, div.is-warn, span.is-warn { color: var(--warn); }
div.is-bad, span.is-bad { color: var(--bad); }

/* ── rules page ── */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; }
.rule__n { font: 600 18px/1.3 var(--mono); color: var(--accent); min-width: 28px; }
.rule__title { font-weight: 600; margin-bottom: 2px; }

/* ── listings ── */
.group__head { margin-bottom: 8px; }
.preview__text { white-space: pre-wrap; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; max-height: 260px; overflow: auto; }
.bulkbar { position: sticky; top: calc(var(--top-h) + 8px); z-index: 5; padding: 10px 12px; box-shadow: var(--pop); }
.filters .input, .filters select, .filters .dd, .bulkbar .input, .bulkbar select, .bulkbar .dd { width: auto; min-width: 130px; }

/* ── machines ── */
.desk { width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunk); }
.desk__bg { fill: var(--sunk); }
.desk__rect { fill: color-mix(in oklab, var(--accent) 6%, transparent); stroke: var(--line-2); stroke-width: 4; }
.desk__slot.is-busy .desk__rect { fill: color-mix(in oklab, var(--ok) 12%, transparent); stroke: var(--ok); }
.desk__label { fill: var(--ink); font-size: 44px; font-family: var(--sans); font-weight: 600; }
.desk__sub { fill: var(--ink-2); font-size: 34px; font-family: var(--sans); }
.desk__meta { fill: var(--ink-3); font-size: 26px; font-family: var(--mono); }
.slots-mini { display: flex; gap: 4px; }
.slots-mini__slot { width: 26px; height: 15px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-2); }
.slots-mini__slot.is-busy { background: var(--ok-bg); border-color: var(--ok); }

/* ── overview strips, settings, bars ── */
.strip { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.strip li { padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.strip li:first-child { padding-top: 2px; }
.strip li:last-child { border-bottom: 0; padding-bottom: 0; }
.strip a { color: inherit; text-decoration: none; }
.strip a:hover strong { color: var(--accent); }
.feed { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.settings { display: grid; gap: 2px; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line-2); }
.setting:last-child { border-bottom: 0; }
.setting__label strong { font-weight: 500; }
.setting__input { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
@media (max-width: 760px) { .setting { grid-template-columns: minmax(0, 1fr); gap: 8px; } .setting__input { justify-content: flex-start; } }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 160px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.bar__label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__track { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar__fill.is-bad { background: var(--bad); }
.bars--cols { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px 0 0; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.col { flex: 1; max-width: 42px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 14px; }
.col__fill { width: 100%; background: var(--panel-2); border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; min-height: 2px; }
.col__inner { width: 100%; background: var(--ok); border-radius: 3px 3px 0 0; }
.col__label { font-size: 10px; color: var(--ink-3); margin-top: 4px; font-family: var(--mono); }

/* ── remote viewer ── */
.viewer { display: flex; flex-direction: column; gap: 10px; }
.viewer__bar, .viewer__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewer__stat { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.viewer__stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; outline: none; min-height: 240px; }
.viewer__stage:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.viewer__stage:fullscreen { border: 0; border-radius: 0; }
.viewer__canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.viewer__overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,6,8,.82); color: var(--ink-2); }
.viewer__wait { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 13px; }
.viewer--browser .viewer__stage { max-width: 1280px; }
.viewer--browser .viewer__canvas { cursor: default; }
.viewer__cursor { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--accent); pointer-events: none; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.viewer .spinner { width: 22px; height: 22px; margin: 0; border-color: var(--line-2); border-top-color: var(--accent); }

/* ── onboarding checklist and the human step ── */
ul.checklist { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 2px; }
.checklist__item { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.checklist__mark { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 600 10.5px/1 var(--mono); color: var(--ink-3); background: var(--panel-2); }
.checklist__item.is-done .checklist__mark { color: var(--ok); background: var(--ok-bg); }
.checklist__item.is-failed .checklist__mark { color: var(--bad); background: var(--bad-bg); }
.checklist__item.is-human .checklist__mark, .checklist__item.is-current .checklist__mark { color: var(--warn); background: var(--warn-bg); }
.checklist__item.is-pending { color: var(--ink-3); }
@media (max-width: 760px) { .checklist__item .mono { display: none; } }
.human { border: 1px solid color-mix(in oklab, var(--warn) 45%, transparent); background: linear-gradient(180deg, var(--warn-bg), transparent 140%), var(--panel); display: grid; gap: 14px; }
.human__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.human__steps { margin: 10px 0 14px; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.codeform { display: grid; gap: 14px; max-width: 440px; }
.codeform .code-input { height: 60px; font-size: 30px; letter-spacing: .45em; }
.codeform .code-input::placeholder { color: var(--ink-3); letter-spacing: .3em; }
.human__head { display: flex; gap: 14px; align-items: flex-start; }
.human__icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--warn); background: var(--warn-bg); }
.human__wait { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); color: var(--ink-2); }
.human__wait .spinner { width: 18px; height: 18px; margin: 0; }
.human__more > summary { margin-bottom: 0; }
.human__more[open] > summary { margin-bottom: 12px; }

/* ── analytics: the breakdown tables get the wider middle column ── */
.analytics-mix { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .analytics-mix { grid-template-columns: minmax(0, 1fr); } }

/* ── settings: one section at a time (tabs), and a save bar that is always reachable ── */
.settings-page { max-width: 1040px; }
.settings-tabs { position: sticky; top: var(--top-h); z-index: 4; background: var(--bg); padding-top: 4px; }
.settings-tabs .tabs__danger { color: var(--bad); }
.settings-tabs .tabs__danger.is-active { border-bottom-color: var(--bad); }
.settings-body { display: grid; gap: 12px; }
.card--danger { border-color: color-mix(in oklab, var(--bad) 55%, var(--line-2)); }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: color-mix(in oklab, var(--panel) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.savebar .btn { margin-left: auto; }
.savebar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.savebar.is-dirty { border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.savebar.is-dirty .savebar__dot { background: var(--accent); }

/* ── "what happens next" on an order, and why a bot cannot start ── */
.next { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; background: var(--panel); display: grid; gap: 12px; border-left-width: 4px; }
.next--wait { border-left-color: var(--wait); } .next--run { border-left-color: var(--run); } .next--ok { border-left-color: var(--ok); }
.next--warn { border-left-color: var(--warn); } .next--bad { border-left-color: var(--bad); } .next--attn { border-left-color: var(--attn); } .next--info, .next--mute, .next--neutral { border-left-color: var(--line-2); }
.next__head { display: flex; gap: 12px; align-items: flex-start; }
.next__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--ink-3); }
.next--wait .next__dot { background: var(--wait); animation: pulse 1.6s ease-in-out infinite; } .next--run .next__dot { background: var(--run); animation: pulse 1.1s ease-in-out infinite; }
.next--ok .next__dot { background: var(--ok); } .next--warn .next__dot { background: var(--warn); } .next--bad .next__dot { background: var(--bad); } .next--attn .next__dot { background: var(--attn); }
.next__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.next__detail { color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.next__buyer { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); font-size: 13px; }
.next__label { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.next__blockers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.blocker { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent); background: var(--warn-bg); }
.blocker__text { min-width: 0; } .blocker form { flex: none; }
.blocker--pending { border-color: color-mix(in oklab, var(--run) 45%, transparent); background: var(--run-bg); }
/* a warning under the next step: worth knowing (old code on the PC), not stopping anything */
.blocker--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.next__actions { gap: 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); line-height: 1.5; } .steps strong { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .next__dot { animation: none !important; } .spinner { animation: none; } }

/* ── item pictures ── */
.picture { aspect-ratio: 4 / 3; max-height: 220px; border-radius: 12px; overflow: hidden; background: var(--stripe); display: grid; place-items: center; }
.picture img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--bg-2, var(--stripe)); }
.picture--empty { border: 1px dashed var(--line); }
.picture__hint { display: grid; justify-items: center; gap: 8px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 12.5px; max-width: 260px; }
.item-layout { grid-template-columns: 1.4fr 1fr 0.8fr 1fr; }
@media (max-width: 1300px) { .item-layout { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .item-layout { grid-template-columns: 1fr; } }

/* ── item names: the pet's variant badges in front of its name, drawn like the ones on Adopt Me's own tiles: flat
   green N, blue F and pink R circles, a purple M square for Mega Neon, the capital in Nunito Black (the nearest open
   font to the game's letters, self-hosted: only M N F R, its metrics centre the letter in a 1em line); then game
   logo tiles and marketplace logos ── */
@font-face {
  font-family: "Nunito Badge"; font-weight: 900; font-style: normal; font-display: block;
  src: url("fonts/nunito/Nunito-Black-MNFR.woff2?v=1") format("woff2"); unicode-range: U+20, U+46, U+4D-4E, U+52;
}
.iname { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.iname__text { min-width: 0; }
.vmarks { --vm: 18px; --vm-gap: 4px; display: inline-flex; align-items: center; gap: var(--vm-gap); flex: none; }
.vmark { display: inline-grid; place-items: center; width: var(--vm, 18px); height: var(--vm, 18px); border-radius: 50%; flex: none; color: #fff; font: 900 calc(var(--vm, 18px) * .72) / 1 "Nunito Badge", "Nunito", "Arial Rounded MT Bold", var(--sans); font-synthesis: none; }
.vmark--neon { background: #8dc540; }
.vmark--fly { background: #3298c8; }
.vmark--ride { background: #ea2e77; }
.vmark--mega { width: calc(var(--vm, 18px) * 1.03); height: calc(var(--vm, 18px) * 1.03); border-radius: calc(var(--vm, 18px) * .06); background: linear-gradient(180deg, #ad52f1, #5207de); }
/* MM2's Chroma tag: the game's rainbow bar with a heavy white, dark-edged word on it */
.vmark--chroma { width: auto; padding: 0 calc(var(--vm, 18px) * .3); border-radius: calc(var(--vm, 18px) * .17); background: linear-gradient(90deg, #e3262c 0%, #f4861c 15%, #f6e21a 32%, #3cc23a 50%, #1cb9d9 66%, #2c4fd0 82%, #8e2fd8 100%); font: 800 calc(var(--vm, 18px) * .6) / 1 "Arial Rounded MT Bold", "Nunito", var(--sans); letter-spacing: .01em; -webkit-text-stroke: calc(var(--vm, 18px) * .035) #1d1326; paint-order: stroke fill; text-shadow: 0 1px 0 rgb(0 0 0 / .35); }
.glogo { width: 18px; height: 18px; border-radius: 5px; vertical-align: -4px; flex: none; }
.glogo--lg { width: 28px; height: 28px; border-radius: 8px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mlogo { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; flex: none; }
.mchip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gamepick { display: flex; flex-wrap: wrap; gap: 6px; }
.gamepick__opt { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); font-size: 13px; cursor: pointer; }
.gamepick__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.gamepick__opt:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, var(--panel-2)); }
.gamepick__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.gamepick__opt.is-off { opacity: .5; cursor: not-allowed; }

/* ── logs page ── */
.logfilters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 10px 14px; margin-bottom: 12px; }
.field--inline { gap: 3px; }
.field--inline .field__label { font-size: 11px; }
.logctx .badge { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
/* filter chips (the Logs page's presets) and the PC's log tails */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
.chip.is-on { background: color-mix(in oklab, var(--accent) 16%, transparent); border-color: color-mix(in oklab, var(--accent) 55%, transparent); color: var(--ink); }
.logtail { max-height: 360px; overflow: auto; font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; }

/* ── stock table: every cell is a button that opens the small stock form ── */
.cellbtn { all: unset; display: block; width: 100%; min-height: 28px; padding: 4px 6px; margin: -4px -6px; text-align: right; border-radius: 6px; cursor: pointer; box-sizing: content-box; }
.cellbtn:hover, .cellbtn:focus-visible { background: color-mix(in oklab, var(--accent) 14%, transparent); outline: 1px solid color-mix(in oklab, var(--accent) 50%, transparent); }
.cell--na { color: var(--ink-3); }
.cellscrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.cellform { width: min(440px, 100%); display: grid; gap: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }

/* ── the live view of a test order: the bot's window, marked up, one picture a second ── */
.live { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0b0d12; }
.live__frame { aspect-ratio: 960 / 690; max-height: 70vh; background: #0b0d12; display: flex; align-items: center; justify-content: center; }
.live__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; }
.live__cap { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink); min-width: 0; }
.live__phase { font-weight: 600; white-space: nowrap; }
.live__text { flex: 1; min-width: 0; color: var(--ink-2); }
.live__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); animation: live-pulse 1.2s ease-in-out infinite; }
.live--done .live__dot { background: var(--ink-3); box-shadow: none; animation: none; }
.live--stale .live__dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); animation: none; }
@keyframes live-pulse { 50% { opacity: .4; } }

/* ── the order's whole story (owner only): one time-ordered list of log lines, reads and pictures ── */
.story__head { margin-top: 16px; }
.story__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.story__chips { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.story__chip { border: 0; background: transparent; color: var(--ink-2); border-radius: 7px; padding: 4px 9px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.story__chip:hover { color: var(--ink); }
.story__chip.is-on { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.story__n { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.story__chip.is-on .story__n { color: var(--accent); }
.story__cut { font-size: 12px; color: var(--warn); margin-bottom: 6px; }
.story__hint { font-size: 12.5px; margin-bottom: 8px; }
.story__section { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 12px 0 4px; }
.story__rows { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); font-size: 12.5px; }
.story__day { position: sticky; top: 0; z-index: 1; padding: 4px 10px; font-size: 11px; color: var(--ink-3); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.story__row { display: flex; gap: 10px; align-items: flex-start; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.story__row:last-child { border-bottom: 0; }
.story__time { flex: none; width: 92px; color: var(--ink-3); font-size: 11.5px; padding-top: 2px; }
.story__mark { flex: none; width: 56px; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 5px; padding: 2px 0; margin-top: 1px; background: var(--neutral-bg); color: var(--neutral); }
.story__mark--debug { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.story__mark--info { background: var(--info-bg); color: var(--info); }
.story__mark--success { background: var(--ok-bg); color: var(--ok); }
.story__mark--warn { background: var(--warn-bg); color: var(--warn); }
.story__mark--error { background: var(--bad-bg); color: var(--bad); }
.story__mark--read { background: var(--wait-bg); color: var(--wait); }
.story__mark--picture { background: var(--run-bg); color: var(--run); }
.story__body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; overflow-wrap: anywhere; }
.story__row--debug .story__text { color: var(--ink-2); }
.story__row--warn .story__text { color: var(--warn); }
.story__row--error .story__text { color: var(--bad); }
.story__meta { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.story__region { color: var(--ink-3); }
.story__none { color: var(--warn); }
.story__matched { font-weight: 600; color: var(--ok); }
.story__note { font-weight: 500; color: var(--ink); }
.story__thumb { width: 150px; max-height: 84px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #0b0d12; cursor: zoom-in; display: block; }
.story__thumb--map { width: 300px; max-height: 300px; } /* a scan map: every word the OCR saw, readable at a glance */
.story__pic { flex: 1; min-width: 180px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.story--phases .story__row:not(.story__row--phases), .story--thinking .story__row:not(.story__row--thinking), .story--reads .story__row:not(.story__row--reads) { display: none; }
/* an item's rarity from its game's catalog (item_rarity()): Adopt Me, MM2 and Steal a Brainrot tiers, in the games' colours */
.rarity { --rc: var(--neutral); display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 6px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: middle; line-height: 1; color: var(--rc); background: color-mix(in oklab, var(--rc) 16%, transparent); }
.rarity--common { --rc: #9aa6b4; }
.rarity--uncommon { --rc: #5cc54e; }
.rarity--rare { --rc: #3ea6e8; }
.rarity--ultra_rare { --rc: #b06ae8; }
.rarity--legendary { --rc: #f0a830; }
[data-theme="light"] .rarity--common { --rc: #5c6673; }
[data-theme="light"] .rarity--uncommon { --rc: #2f8a22; }
[data-theme="light"] .rarity--rare { --rc: #1a72b0; }
[data-theme="light"] .rarity--ultra_rare { --rc: #7a35b8; }
[data-theme="light"] .rarity--legendary { --rc: #a86400; }
/* MM2's tiers above Legendary, and Steal a Brainrot's */
.rarity--godly { --rc: #ff5c8a; }
.rarity--vintage { --rc: #d9b26b; }
.rarity--ancient { --rc: #a77bff; }
.rarity--unique { --rc: #e8e05a; }
.rarity--epic { --rc: #b06ae8; }
.rarity--mythic { --rc: #ff5c5c; }
.rarity--brainrot_god { --rc: #f7c843; }
.rarity--secret { --rc: #c9d1dc; }
.rarity--og { --rc: #4fd1c5; }
[data-theme="light"] .rarity--godly { --rc: #c2185b; }
[data-theme="light"] .rarity--vintage { --rc: #8a6420; }
[data-theme="light"] .rarity--ancient { --rc: #6a3fd1; }
[data-theme="light"] .rarity--unique { --rc: #8a7d00; }
[data-theme="light"] .rarity--epic { --rc: #7a35b8; }
[data-theme="light"] .rarity--mythic { --rc: #c62828; }
[data-theme="light"] .rarity--brainrot_god { --rc: #9a6b00; }
[data-theme="light"] .rarity--secret { --rc: #3c4652; }
[data-theme="light"] .rarity--og { --rc: #00796b; }
