/* Starfall Ops — the console's one stylesheet, in three layers: tokens (the game's palette from Starfall.uss, type,
   spacing), components (shell, cards, buttons, fields, tables, dialogs, charts...), then page-specific rules. Later
   phases reuse the tokens and components and add their page rules at the end. No inline styles anywhere (the CSP
   forbids them); scripts only set CSSOM properties such as widths and transforms. */

/* =========================================================================================== fonts */

@font-face { font-family: "Chakra Petch"; src: url("/fonts/ChakraPetch-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/fonts/ChakraPetch-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* =========================================================================================== tokens */

:root {
  color-scheme: dark;

  /* The game's palette (Unity/Assets/Starfall/Resources/UI/Starfall.uss). */
  --sf-bg: rgb(6, 10, 26);
  --sf-bg-deep: rgb(3, 6, 16);
  --sf-panel: rgb(10, 16, 34);
  --sf-panel-2: rgba(8, 14, 30, 0.92);
  --sf-panel-raised: rgb(14, 22, 44);
  --sf-inset: rgba(3, 6, 16, 0.78);
  --sf-line: rgba(120, 160, 230, 0.15);
  --sf-line-strong: rgba(120, 160, 230, 0.3);
  --sf-text: rgb(225, 238, 255);
  --sf-text-2: rgb(150, 170, 210);
  --sf-text-3: rgb(143, 163, 189);
  --sf-accent: rgb(80, 220, 255);
  --sf-accent-rgb: 80, 220, 255;
  --sf-accent-ink: rgb(4, 16, 28);
  --sf-gold: rgb(255, 210, 120);
  --sf-gold-rgb: 255, 210, 120;
  --sf-danger: rgb(255, 90, 80);
  --sf-danger-rgb: 255, 90, 80;
  --sf-warn: rgb(255, 190, 90);
  --sf-warn-rgb: 255, 190, 90;
  --sf-flux: rgb(215, 140, 255);
  --sf-flux-rgb: 215, 140, 255;
  --sf-ok: rgb(70, 230, 180);
  --sf-ok-rgb: 70, 230, 180;
  --sf-blue: rgb(120, 190, 255);
  --sf-blue-rgb: 120, 190, 255;
  --sf-grey-rgb: 130, 145, 175;

  /* The game server's states. */
  --st-running: var(--sf-ok-rgb);
  --st-draining: var(--sf-gold-rgb);
  --st-maintenance: var(--sf-warn-rgb);
  --st-stopped: var(--sf-grey-rgb);
  --st-crashed: var(--sf-danger-rgb);
  --st-starting: var(--sf-accent-rgb);
  --st-external: var(--sf-blue-rgb);

  /* Chart slots: the game's cyan, gold and flux stepped into the dark-surface band (OKLCH L 0.48-0.67); validated
     as a set (every pair clears the colour-vision and normal-vision floors on --sf-panel). */
  --viz-1: #10a4c3;
  --viz-2: #b78c2d;
  --viz-3: #944bb9;
  /* A value below the axis (a day's refunds): the amber the pages use for a negative amount, stepped into the band. */
  --viz-neg: #b8742a;
  --viz-grid: rgba(120, 160, 230, 0.1);
  --viz-axis: rgba(120, 160, 230, 0.26);

  /* Type. Chakra Petch for headings, figures and the nav; Barlow Condensed for labels; the system font for reading. */
  --font-display: "Chakra Petch", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --font-label: "Barlow Condensed", "Bahnschrift SemiCondensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 28px;
  --fs-title: 15px;
  --fs-label: 11px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
  --glow: 0 0 0 1px rgba(var(--sf-accent-rgb), 0.5), 0 0 18px rgba(var(--sf-accent-rgb), 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --top-h: 56px;
  --nav-w: 232px;
  --nav-rail: 64px;
}

/* =========================================================================================== base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--sf-text);
  background-color: var(--sf-bg);
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(var(--sf-accent-rgb), 0.075), transparent 62%),
    radial-gradient(900px 600px at 108% 112%, rgba(var(--sf-flux-rgb), 0.055), transparent 60%),
    linear-gradient(rgba(120, 160, 230, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 230, 0.028) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* A sparse star field behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 13% 22%, rgba(225, 238, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 67% 14%, rgba(225, 238, 255, 0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 61%, rgba(var(--sf-accent-rgb), 0.5), transparent 60%),
    radial-gradient(1px 1px at 38% 78%, rgba(225, 238, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 91% 88%, rgba(225, 238, 255, 0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 24% 54%, rgba(var(--sf-flux-rgb), 0.35), transparent 60%),
    radial-gradient(1px 1px at 55% 41%, rgba(225, 238, 255, 0.25), transparent 60%);
}

#app { position: relative; z-index: 1; min-height: 100vh; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 var(--sp-2); }
p:last-child { margin-bottom: 0; }
a { color: var(--sf-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
b, strong, .strong { font-weight: 600; color: var(--sf-text); }
ul.plain-list, ol.plain-list { margin: var(--sp-1) 0 0; padding-left: 18px; color: var(--sf-text-2); }
ul.plain-list li, ol.plain-list li { margin: 2px 0; }
hr { border: 0; border-top: 1px solid var(--sf-line); margin: var(--sp-4) 0; }
.muted { color: var(--sf-text-3); }
.dim { color: var(--sf-text-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--sf-accent-rgb), 0.3); color: var(--sf-text); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; border-radius: 2px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 160, 230, 0.22); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(120, 160, 230, 0.36); }

.sf-icon { flex: none; display: block; }

/* =========================================================================================== boot */

.boot-splash {
  display: grid; place-items: center; min-height: 100vh;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.2em; color: var(--sf-text-3); font-size: var(--fs-sm);
}
.noscript { padding: var(--sp-8); text-align: center; }
.boot-fail { max-width: 520px; margin: 14vh auto 0; padding: 0 var(--sp-4); display: grid; gap: var(--sp-6); }
.boot-brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: 0.14em; text-transform: uppercase; }

/* =========================================================================================== shell */

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  grid-template-areas: "top top" "nav main";
  min-height: 100vh;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -60px; z-index: 100;
  background: var(--sf-accent); color: var(--sf-accent-ink); padding: 8px 14px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 10px; }

.topbar {
  grid-area: top;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-5) 0 var(--sp-4);
  background: rgba(5, 9, 22, 0.86);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--sf-line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--sf-accent-rgb), 0.55) 18%, rgba(var(--sf-accent-rgb), 0.1) 52%, transparent 100%);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--sf-text); flex: none; min-width: calc(var(--nav-w) - 32px); }
.brand:hover { text-decoration: none; }
.brand-mark .bm-ring { fill: rgba(var(--sf-accent-rgb), 0.06); stroke: rgba(var(--sf-accent-rgb), 0.55); stroke-width: 1.4; }
.brand-mark .bm-star { fill: var(--sf-accent); filter: drop-shadow(0 0 4px rgba(var(--sf-accent-rgb), 0.7)); }
.brand-mark .bm-core { fill: var(--sf-bg); }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; letter-spacing: 0.2em; text-transform: uppercase; line-height: 1; }
.brand-b { color: var(--sf-accent); margin-left: 0.45em; }

/* The global search (components/search.js): the box, and its results under it grouped by kind. */
.topsearch { position: relative; flex: 1 1 340px; max-width: 460px; min-width: 0; align-self: center; }
.topsearch-box { position: relative; display: flex; align-items: center; }
.topsearch-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--sf-text-3); pointer-events: none; }
.topsearch-input {
  width: 100%; height: 34px; padding: 0 34px 0 34px;
  background: rgba(3, 6, 16, 0.6); border: 1px solid var(--sf-line); border-radius: var(--radius);
  color: var(--sf-text); font: inherit; font-size: var(--fs-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.topsearch-input:hover:not(:disabled) { border-color: var(--sf-line-strong); }
.topsearch-input:focus { border-color: var(--sf-accent); box-shadow: 0 0 0 1px var(--sf-accent); outline: none; background: var(--sf-inset); }
.topsearch-input::placeholder { color: var(--sf-text-3); }
/* One clear cross at most: the browser's own is hidden (Escape clears the box; the phone overlay has its close button). */
.topsearch-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.topsearch-key {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 3px;
  display: grid; place-items: center; font: 600 11px/1 var(--font-mono); color: var(--sf-text-3); border: 1px solid var(--sf-line-strong); pointer-events: none;
}
.topsearch-input:focus ~ .topsearch-key, .topsearch-input:not(:placeholder-shown) ~ .topsearch-key { display: none; }
/* The phone's open/close buttons: off elsewhere. Two classes, so .icon-btn's own display (defined later) doesn't win. */
.topsearch .topsearch-open, .topsearch .topsearch-close { display: none; }
.topsearch-pop {
  position: absolute; left: 0; top: calc(100% + 6px); width: 100%; max-width: calc(100vw - 24px); max-height: min(70vh, 520px); overflow-y: auto; z-index: 60;
  background: var(--sf-panel-raised); border: 1px solid var(--sf-line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 6px;
}
.topsearch-pop.is-loading .topsearch-hit { opacity: 0.55; }
.topsearch-group + .topsearch-group { border-top: 1px solid var(--sf-line); margin-top: 4px; padding-top: 4px; }
.topsearch-group-label { padding: 6px 10px 4px; font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.topsearch-hit { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius); color: var(--sf-text); min-width: 0; }
.topsearch-hit:hover { background: rgba(120, 160, 230, 0.08); text-decoration: none; }
.topsearch-hit.is-active { background: rgba(var(--sf-accent-rgb), 0.12); box-shadow: inset 2px 0 0 var(--sf-accent); text-decoration: none; }
.topsearch-hit-icon { color: var(--sf-text-3); flex: none; }
.topsearch-hit.is-active .topsearch-hit-icon { color: var(--sf-accent); }
.topsearch-hit-text { display: grid; min-width: 0; }
.topsearch-hit-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topsearch-hit-sub { color: var(--sf-text-3); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topsearch-note { padding: 10px 12px; color: var(--sf-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.topsearch-note.is-error { color: var(--sf-danger); }
/* A tooltip that opens downwards (the top bar has nothing above it). */
.tip-wrap.tip-below[data-tip]:not([data-tip=""]):hover::after, .tip-wrap.tip-below[data-tip]:not([data-tip=""]):focus-within::after { bottom: auto; top: calc(100% + 8px); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.srv-button {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px;
  border: 1px solid transparent; border-radius: 999px; color: var(--sf-text-2); font-size: var(--fs-sm);
  transition: border-color 0.15s, background 0.15s;
}
.srv-button:hover { text-decoration: none; border-color: var(--sf-line-strong); background: rgba(120, 160, 230, 0.06); }
.srv-meta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.srv-button.is-busy .srv-meta { color: var(--sf-gold); }

.tz-toggle { display: inline-flex; border: 1px solid var(--sf-line); border-radius: var(--radius); overflow: hidden; }
.tz-opt {
  background: transparent; border: 0; color: var(--sf-text-3); cursor: pointer;
  font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px;
}
.tz-opt + .tz-opt { border-left: 1px solid var(--sf-line); }
.tz-opt:hover { color: var(--sf-text); }
.tz-opt.is-on { background: rgba(var(--sf-accent-rgb), 0.14); color: var(--sf-accent); }
.tz-opt:focus-visible { outline-offset: -2px; }

.sudo-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  color: var(--sf-gold); background: rgba(var(--sf-gold-rgb), 0.1); border: 1px solid rgba(var(--sf-gold-rgb), 0.35);
  font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}

.op-menu { position: relative; }
.op-menu-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--sf-text); cursor: pointer; font: inherit;
}
.op-menu-btn:hover, .op-menu-btn[aria-expanded="true"] { border-color: var(--sf-line-strong); background: rgba(120, 160, 230, 0.06); }
.op-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--sf-accent-rgb), 0.35), rgba(var(--sf-flux-rgb), 0.3));
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--sf-text);
  box-shadow: inset 0 0 0 1px rgba(var(--sf-accent-rgb), 0.4);
}
.op-menu-label { font-weight: 600; font-size: var(--fs-sm); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; z-index: 60;
  background: var(--sf-panel-raised); border: 1px solid var(--sf-line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 6px; display: grid; gap: 2px;
}
.op-menu-who { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 8px 10px 10px; border-bottom: 1px solid var(--sf-line); margin-bottom: 4px; }
.op-menu-name { font-weight: 600; }
.op-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  background: transparent; border: 0; color: var(--sf-text); font: inherit; text-align: left; cursor: pointer;
}
.op-menu-item:hover, .op-menu-item:focus-visible { background: rgba(var(--sf-accent-rgb), 0.1); text-decoration: none; color: var(--sf-text); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--sf-text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--sf-text); border-color: var(--sf-line-strong); }
/* Icon buttons take the inputs' cyan hairline when focused from the keyboard, not the thick outline. */
.icon-btn:focus-visible { outline: none; color: var(--sf-text); border-color: var(--sf-accent); box-shadow: 0 0 0 1px var(--sf-accent); }
.nav-toggle[aria-expanded="true"] { color: var(--sf-accent); }
.nav-toggle { display: none; }

/* ---- the nav */

.sidenav {
  grid-area: nav;
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3) var(--sp-4);
  background: linear-gradient(180deg, rgba(8, 14, 30, 0.72), rgba(6, 10, 26, 0.4));
  border-right: 1px solid var(--sf-line);
  display: flex; flex-direction: column; gap: var(--sp-3);
  z-index: 30;
}
/* A short window can't hold every group: the nav scrolls on its own and fades where it has more (shell.js). */
.sidenav.has-more-below { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 56px), transparent); }
.sidenav.has-more-above { -webkit-mask-image: linear-gradient(180deg, transparent, #000 40px); mask-image: linear-gradient(180deg, transparent, #000 40px); }
.sidenav.has-more-above.has-more-below {
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(180deg, transparent, #000 40px, #000 calc(100% - 56px), transparent);
}
.nav-group-label {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin: 0; padding: 0 12px 4px;
  background: none; border: 0; border-radius: var(--radius); cursor: pointer; text-align: left;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sf-text-2);
}
.nav-group-label:hover { color: var(--sf-text); }
.nav-group-label .sf-icon { opacity: 0.7; transition: transform 0.15s; }
/* A folded group (a short window, not the current page's): its name only, its chevron turned. */
.nav-group.is-folded .nav-list { display: none; }
.nav-group.is-folded .nav-group-label { padding-bottom: 0; }
.nav-group.is-folded .nav-group-label .sf-icon { transform: rotate(-90deg); }
/* While some are folded, every group's name reads as a button, alike: the open group's no dimmer than the folded ones. */
.sidenav:has(.nav-group.is-folded) .nav-group-label { color: var(--sf-text); }
.sidenav:has(.nav-group.is-folded) .nav-group-label .sf-icon { opacity: 1; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px;
  border-radius: var(--radius); color: var(--sf-text-2);
  font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--sf-text); background: rgba(120, 160, 230, 0.07); text-decoration: none; }
.nav-link[aria-current="page"] {
  color: var(--sf-accent);
  background: linear-gradient(90deg, rgba(var(--sf-accent-rgb), 0.16), rgba(var(--sf-accent-rgb), 0.02) 75%, transparent);
}
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--sf-accent); box-shadow: 0 0 12px rgba(var(--sf-accent-rgb), 0.8);
}
.nav-icon { display: grid; place-items: center; width: 20px; }
.nav-foot { margin-top: auto; padding: 0 12px; }
.nav-foot-text { font-size: 11px; color: var(--sf-text-2); }

.main { grid-area: main; min-width: 0; padding: var(--sp-6) var(--sp-8) 56px; }
.main:focus { outline: none; }

/* =========================================================================================== page frame */

.page { max-width: 1440px; margin: 0 auto; display: grid; gap: var(--sp-5); animation: page-in 0.32s var(--ease) backwards; }
/* "backwards", not "both": once in, a section keeps no transform (a kept one puts it on its own layer, which can set its
   corner brackets half a device pixel off its border). */
.page > * { animation: rise 0.42s var(--ease) backwards; }
.page > *:nth-child(2) { animation-delay: 0.04s; }
.page > *:nth-child(3) { animation-delay: 0.08s; }
.page > *:nth-child(4) { animation-delay: 0.12s; }
.page > *:nth-child(5) { animation-delay: 0.16s; }
.page > *:nth-child(n + 6) { animation-delay: 0.2s; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
/* One gap under the header on every page: 24px (the page grid's 20 and 4 more). */
.page > .page-head { margin-bottom: var(--sp-1); }
.page-eyebrow {
  font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--sf-accent); display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.page-eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2xl); letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.1; }
.page-title:focus { outline: none; }
.page-sub { color: var(--sf-text-2); margin-top: 6px; max-width: 640px; text-wrap: balance; }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.page-narrow { max-width: 640px; margin: 8vh auto 0; }
.page-error { max-width: 640px; margin: 6vh auto 0; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.align-start { align-items: start; }
.grid-3 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.spacer { flex: 1; }

/* =========================================================================================== cards */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(14, 22, 44, 0.9), rgba(9, 15, 32, 0.92));
  border: 1px solid var(--sf-line);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 10px 30px rgba(0, 0, 0, 0.18);
  min-width: 0;
}
/* HUD corner brackets, drawn just inside the border (not over it at -1px: a 1px border is one device pixel at 150 %,
   a -1px offset is one and a half, and the bracket came out beside the border instead of on it). Longhands only, so
   the colour isn't reset by a border shorthand. */
.card::before, .card::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border-style: solid; border-width: 0; border-color: rgba(225, 238, 255, 0.8);
}
.card::before { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.card::after { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  padding: 13px var(--sp-5); border-bottom: 1px solid var(--sf-line); min-height: 52px;
}
.card-h-text { min-width: 0; }
.card-eyebrow { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-title); letter-spacing: 0.06em; text-transform: uppercase; color: var(--sf-text); }
.card-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.card-b { padding: var(--sp-5); min-width: 0; }
.card-flush > .card-b { padding: 0; }
.card-b > .table-block .table-wrap { margin: 0; }
.card-note { color: var(--sf-text-3); font-size: var(--fs-sm); }

/* =========================================================================================== buttons */

.btn {
  --btn-bg: transparent; --btn-fg: var(--sf-text); --btn-bd: var(--sf-line-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 3px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-family: var(--font-label); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s, filter 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { --btn-bg: var(--sf-accent); --btn-fg: var(--sf-accent-ink); --btn-bd: var(--sf-accent); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--glow); filter: brightness(1.06); }
.btn-ghost:hover:not(:disabled), .btn:not([class*="btn-"]):hover:not(:disabled) { background: rgba(120, 160, 230, 0.09); border-color: rgba(120, 160, 230, 0.45); }
.btn-danger { --btn-bg: var(--sf-danger); --btn-fg: rgb(28, 4, 4); --btn-bd: var(--sf-danger); }
.btn-danger:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(var(--sf-danger-rgb), 0.5), 0 0 18px rgba(var(--sf-danger-rgb), 0.35); }
.btn-danger-ghost { --btn-fg: var(--sf-danger); --btn-bd: rgba(var(--sf-danger-rgb), 0.55); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--sf-danger); color: rgb(28, 4, 4); border-color: var(--sf-danger); }
.btn-warn { --btn-bg: var(--sf-warn); --btn-fg: rgb(30, 18, 2); --btn-bd: var(--sf-warn); }
.btn-warn:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(var(--sf-warn-rgb), 0.5), 0 0 18px rgba(var(--sf-warn-rgb), 0.3); }
.btn-warn-ghost { --btn-fg: var(--sf-warn); --btn-bd: rgba(var(--sf-warn-rgb), 0.5); }
.btn-warn-ghost:hover:not(:disabled) { background: rgba(var(--sf-warn-rgb), 0.1); }
.btn-gold { --btn-bg: rgba(var(--sf-gold-rgb), 0.12); --btn-fg: var(--sf-gold); --btn-bd: rgba(var(--sf-gold-rgb), 0.5); }
/* A main answer in a row of plain ones (Resolve): the accent as an outline. */
.btn-accent-ghost { --btn-fg: var(--sf-accent); --btn-bd: rgba(var(--sf-accent-rgb), 0.55); }
.btn-accent-ghost:hover:not(:disabled) { background: rgba(var(--sf-accent-rgb), 0.1); border-color: var(--sf-accent); }
/* Quiet until pointed at, then amber (Void: a row of them shouldn't shout). */
.btn-quiet-warn { --btn-fg: var(--sf-text-2); --btn-bd: var(--sf-line-strong); }
.btn-quiet-warn:hover:not(:disabled), .btn-quiet-warn:focus-visible { color: var(--sf-warn); border-color: rgba(var(--sf-warn-rgb), 0.6); background: rgba(var(--sf-warn-rgb), 0.1); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13.5px; gap: 6px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 16px; }
.btn-block { width: 100%; }
/* Unavailable looks the same whatever the variant: no tint, half faded, its outline kept; the reason is in the tooltip
   (guard.js). */
.btn:disabled, .btn[aria-disabled="true"] {
  background: transparent; border-color: rgba(150, 175, 215, 0.6); color: var(--sf-text-2);
  opacity: 0.5; cursor: not-allowed; box-shadow: none; filter: none;
}
/* Busy (a request on its way) is not unavailable: the button keeps its own fill and outline, and the spinner is drawn in
   its ink, so it reads as "working", not "off". */
.btn.is-loading, .btn.is-loading:disabled {
  background: var(--btn-bg); border-color: var(--btn-bd); color: transparent; opacity: 1; cursor: progress; pointer-events: none;
}
/* Faded, not hidden: the label stays the button's accessible name while it is busy (aria-busy, setLoading()). */
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; left: calc(50% - 8px); top: calc(50% - 8px);
  border-radius: 50%; border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn-sm.is-loading::after { width: 14px; height: 14px; left: calc(50% - 7px); top: calc(50% - 7px); }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }

/* A tooltip on anything wrapped in .tip-wrap (disabled buttons get no pointer events, their wrapper does). */
.tip-wrap { position: relative; display: inline-flex; border-radius: 3px; }
.tip-wrap:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
.tip-wrap[data-tip]:not([data-tip=""]):hover::after,
.tip-wrap[data-tip]:not([data-tip=""]):focus-within::after,
.nav-link[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 80; width: max-content; max-width: 280px; white-space: normal; text-align: left;
  padding: 6px 9px; border-radius: var(--radius); background: rgb(2, 4, 12); border: 1px solid var(--sf-line-strong);
  color: var(--sf-text); font: 500 12px/1.35 var(--font-body); letter-spacing: 0; text-transform: none;
  box-shadow: var(--shadow); pointer-events: none;
}
.nav-link[data-tip]:hover::after { display: none; }
/* At the right end of a row or a card's header the tip opens leftwards (centred, it would run off the edge). */
td:last-child .tip-wrap[data-tip]:hover::after, td:last-child .tip-wrap[data-tip]:focus-within::after,
.card-actions > .tip-wrap[data-tip]:last-child:hover::after, .card-actions > .tip-wrap[data-tip]:last-child:focus-within::after,
.statusbar .control-group:last-child .tip-wrap[data-tip]:hover::after, .statusbar .control-group:last-child .tip-wrap[data-tip]:focus-within::after {
  left: auto; right: 0; transform: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================================== badges & pills */

.badge {
  --b: var(--sf-grey-rgb);
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 3px; vertical-align: middle;
  font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1; white-space: nowrap;
  color: rgb(var(--b)); background: rgba(var(--b), 0.12); border: 1px solid rgba(var(--b), 0.34);
}
.badge-neutral { --b: 170, 188, 222; }
.badge-muted { --b: var(--sf-grey-rgb); }
.badge-accent { --b: var(--sf-accent-rgb); }
.badge-ok { --b: var(--sf-ok-rgb); }
.badge-warn { --b: var(--sf-warn-rgb); }
.badge-danger { --b: var(--sf-danger-rgb); }
.badge-danger-solid { --b: var(--sf-danger-rgb); color: rgb(28, 4, 6); background: rgb(var(--b)); border-color: rgb(var(--b)); }
.badge-gold { --b: var(--sf-gold-rgb); }
.badge-flux { --b: var(--sf-flux-rgb); }
.badge-blue { --b: var(--sf-blue-rgb); }
.count-chip { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(var(--sf-accent-rgb), 0.16); color: var(--sf-accent); font-size: 11px; font-weight: 700; }

.status-pill {
  --t: var(--st-stopped);
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; white-space: nowrap;
  background: rgba(var(--t), 0.1); border: 1px solid rgba(var(--t), 0.42); color: rgb(var(--t));
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.3;
}
.status-pill[data-tone="running"] { --t: var(--st-running); }
.status-pill[data-tone="draining"] { --t: var(--st-draining); }
.status-pill[data-tone="maintenance"] { --t: var(--st-maintenance); }
.status-pill[data-tone="stopped"] { --t: var(--st-stopped); }
.status-pill[data-tone="crashed"] { --t: var(--st-crashed); }
.status-pill[data-tone="starting"] { --t: var(--st-starting); }
.status-pill[data-tone="external"] { --t: var(--st-external); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--t)); box-shadow: 0 0 0 3px rgba(var(--t), 0.16), 0 0 10px rgba(var(--t), 0.85); flex: none; }
.status-pill[data-tone="stopped"] .pill-dot { box-shadow: 0 0 0 3px rgba(var(--t), 0.16); }
.status-pill[data-tone="running"] .pill-dot { animation: breathe 2.8s ease-in-out infinite; }
.status-pill[data-tone="starting"] .pill-dot, .status-pill[data-tone="draining"] .pill-dot { animation: blink 1.1s ease-in-out infinite; }
.status-pill[data-tone="crashed"] .pill-dot { animation: blink 0.9s steps(2, jump-none) infinite; }
.pill-detail { color: var(--sf-text-2); font-family: var(--font-body); font-weight: 500; letter-spacing: 0; text-transform: none; }
.status-pill-sm { font-size: 10.5px; padding: 2px 9px 2px 7px; }
.status-pill-sm .pill-dot { width: 7px; height: 7px; }
.status-pill-lg { font-size: 14px; padding: 6px 15px 6px 12px; gap: 9px; }
.status-pill-lg .pill-dot { width: 10px; height: 10px; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 3px rgba(var(--t), 0.16), 0 0 8px rgba(var(--t), 0.6); } 50% { box-shadow: 0 0 0 5px rgba(var(--t), 0.08), 0 0 16px rgba(var(--t), 1); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* =========================================================================================== fields */

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-2); }
.field-hint { font-size: var(--fs-sm); color: var(--sf-text-3); }
.field-error { font-size: var(--fs-sm); color: var(--sf-danger); }
.field-warn { font-size: var(--fs-sm); color: var(--sf-warn); }
.has-warn .input { border-color: rgba(var(--sf-warn-rgb), 0.75); }
.has-warn .input:focus { border-color: var(--sf-warn); box-shadow: 0 0 0 1px var(--sf-warn); }
/* The characters count sits under the box, at its right, clear of the resize grip. */
.field-counter { justify-self: end; margin-top: 3px; font-size: 11px; color: var(--sf-text-3); pointer-events: none; font-variant-numeric: tabular-nums; }
.area-wrap { display: grid; }
.input {
  width: 100%; min-height: 36px; padding: 7px 11px;
  background: var(--sf-inset); color: var(--sf-text); border: 1px solid var(--sf-line-strong); border-radius: 3px;
  font: inherit; font-size: var(--fs-md); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover:not(:disabled):not([readonly]) { border-color: rgba(120, 160, 230, 0.48); }
.input:focus { border-color: var(--sf-accent); box-shadow: 0 0 0 1px var(--sf-accent); outline: none; }
.input::placeholder { color: var(--sf-text-3); }
.input[readonly] { color: var(--sf-text-2); background: rgba(3, 6, 16, 0.4); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input-mono { font-family: var(--font-mono); font-size: 13px; }
.input-number { font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.input-number::-webkit-outer-spin-button, .input-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-area { resize: vertical; min-height: 64px; line-height: 1.45; }
.has-error .input { border-color: rgba(var(--sf-danger-rgb), 0.75); }
/* An invalid field stays red while it has the focus too: the ring says "fix this", not "you are here". */
.has-error .input:focus { border-color: var(--sf-danger); box-shadow: 0 0 0 1px var(--sf-danger); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border-right: 1.75px solid var(--sf-text-2); border-bottom: 1.75px solid var(--sf-text-2); transform: rotate(45deg);
}
.input-select { appearance: none; padding-right: 34px; cursor: pointer; }
.input-select option { background: var(--sf-panel-raised); color: var(--sf-text); }

.field-check { gap: 4px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; width: fit-content; }
.check-input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }
.check-box {
  position: relative; width: 18px; height: 18px; flex: none; border-radius: 3px;
  border: 1px solid var(--sf-line-strong); background: var(--sf-inset); transition: background 0.15s, border-color 0.15s;
}
.check-input:checked + .check-box { background: var(--sf-accent); border-color: var(--sf-accent); }
.check-input:checked + .check-box::after {
  content: ""; position: absolute; left: 5.5px; top: 2px; width: 5px; height: 9px;
  border-right: 2px solid var(--sf-accent-ink); border-bottom: 2px solid var(--sf-accent-ink); transform: rotate(45deg);
}
.check-input:focus-visible + .check-box { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
.check-input:disabled + .check-box { opacity: 0.5; }
.check-label { color: var(--sf-text); }
.field-check .field-hint { padding-left: 28px; }

.segmented { display: inline-flex; border: 1px solid var(--sf-line-strong); border-radius: 3px; background: var(--sf-inset); padding: 2px; gap: 2px; flex-wrap: wrap; width: fit-content; }
.seg { position: relative; cursor: pointer; }
.seg-input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-text {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 2px;
  font-family: var(--font-label); font-weight: 600; font-size: 14.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sf-text-2);
  transition: background 0.15s, color 0.15s;
}
.seg:hover .seg-text { color: var(--sf-text); }
.seg-input:checked + .seg-text { background: rgba(var(--sf-accent-rgb), 0.16); color: var(--sf-accent); box-shadow: inset 0 0 0 1px rgba(var(--sf-accent-rgb), 0.45); }
.seg-input:focus-visible + .seg-text { outline: 2px solid var(--sf-accent); outline-offset: 1px; }
.field-compact .seg-text { height: 26px; padding: 0 10px; font-size: 13.5px; }

.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.form-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.form-message { min-height: 22px; font-size: var(--fs-sm); display: flex; align-items: center; }
.form-message[data-tone="error"] { color: var(--sf-danger); }
.form-message[data-tone="warn"] { color: var(--sf-warn); }
.form-message[data-tone="ok"] { color: var(--sf-ok); }
.form-message[data-tone="notice"] { color: var(--sf-text-2); }

/* =========================================================================================== tables */

.table-block { min-width: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left; padding: 10px 14px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-2);
  border-bottom: 1px solid var(--sf-line-strong); background: rgba(3, 6, 16, 0.25);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--sf-line); vertical-align: middle; font-size: 13px; line-height: 1.35; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:not(.row-detail):not(.row-skeleton):hover td { background: rgba(120, 160, 230, 0.075); }
.table tbody tr:not(.row-detail) { height: 48px; }
.table-dense tbody tr:not(.row-detail) { height: 36px; }
/* The first and last columns line up with the card's title. */
.table th:first-child, .table td:first-child { padding-left: var(--sp-5); }
.table th:last-child, .table td:last-child { padding-right: var(--sp-5); }
.table th.col-toggle, .table td.col-toggle { padding-left: 12px; }
.table .col-toggle + th, .table .col-toggle + td { padding-left: 6px; }
.outcome-ok { color: var(--sf-text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.table-dense th { padding: 7px 10px; }
.table-dense td { padding: 6px 10px; font-size: var(--fs-sm); }
.table .al-right { text-align: right; }
/* A number column (right-aligned) followed by a text column (left-aligned) gets room between them. */
.table th.al-right + th:not(.al-right), .table td.al-right + td:not(.al-right) { padding-left: 32px; }
.table .al-center { text-align: center; }
.table.is-refreshing tbody { opacity: 0.55; transition: opacity 0.2s; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table .row-current td { background: rgba(var(--sf-accent-rgb), 0.05); }
.table .row-failed td:first-child { box-shadow: inset 2px 0 0 var(--sf-danger); }
.col-toggle { width: 34px; padding-right: 0 !important; }
.row-toggle {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 3px; color: var(--sf-text-3); cursor: pointer;
}
.row-toggle:hover { color: var(--sf-text); border-color: var(--sf-line-strong); }
.row-toggle .sf-icon { transition: transform 0.18s var(--ease); }
.row-toggle[aria-expanded="true"] .sf-icon { transform: rotate(90deg); }
.row-detail > td { background: rgba(3, 6, 16, 0.4); padding: var(--sp-4) var(--sp-5); }
.table-foot { display: flex; justify-content: center; padding: var(--sp-3); border-top: 1px solid var(--sf-line); }
.table-status:empty { display: none; }
.cell-main { font-weight: 600; color: var(--sf-text); }
.cell-sub { color: var(--sf-text-3); font-size: var(--fs-sm); }
.cell-stack { display: grid; gap: 1px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* =========================================================================================== states */

.state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: var(--sp-8) var(--sp-5); }
.state-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--sf-line-strong); color: var(--sf-text-3); margin-bottom: 4px; background: rgba(3, 6, 16, 0.4); }
.state-title { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.state-text { color: var(--sf-text-2); max-width: 60ch; }
.state .btn { margin-top: var(--sp-2); }
.state-error .state-icon { color: var(--sf-danger); border-color: rgba(var(--sf-danger-rgb), 0.45); }
.state-notice .state-icon { color: var(--sf-accent); border-color: rgba(var(--sf-accent-rgb), 0.4); }
.state-compact { padding: var(--sp-4); }

.skeleton { display: grid; gap: 10px; padding: var(--sp-2) 0; }
.skeleton-line {
  display: block; height: 12px; border-radius: 3px; width: 100%;
  background: linear-gradient(90deg, rgba(120, 160, 230, 0.07) 0%, rgba(120, 160, 230, 0.16) 40%, rgba(120, 160, 230, 0.07) 80%);
  background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.short { width: 58%; }
.row-skeleton td { padding-top: 14px; padding-bottom: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.banner {
  --b: var(--sf-warn-rgb);
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: 12px 14px;
  background: linear-gradient(90deg, rgba(var(--b), 0.12), rgba(var(--b), 0.04)); border: 1px solid rgba(var(--b), 0.36); border-radius: var(--radius);
}
.banner-ok { --b: var(--sf-ok-rgb); }
.banner-warn { --b: var(--sf-warn-rgb); }
.banner-danger { --b: var(--sf-danger-rgb); }
.banner-info { --b: var(--sf-accent-rgb); }
.banner-icon { color: rgb(var(--b)); padding-top: 1px; }
.banner-body { flex: 1; min-width: 0; }
.banner-title { font-weight: 600; color: var(--sf-text); }
.banner-text { color: var(--sf-text-2); overflow-wrap: anywhere; }
.banner-action { flex: none; align-self: center; }

/* The dividers between rows are each fact's 1px shadow just below it. The grid clips the one under its last row, whatever
   the column count (a part-filled last row or a wide one included), so no divider or stub of one hangs under the facts.
   Only the bottom edge is clipped (a polygon reaching far past the other three, so a focus ring or tooltip still can),
   and 1px inside it: the last row's padding is lost there, never a hairline's antialiased edge. */
.facts {
  margin: 0; display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  clip-path: polygon(-100vmax -100vmax, calc(100% + 100vmax) -100vmax, calc(100% + 100vmax) calc(100% - 1px), -100vmax calc(100% - 1px));
}
.fact { padding: 10px 0; box-shadow: 0 1px 0 var(--sf-line); min-width: 0; padding-right: var(--sp-4); }
.fact dt { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.fact dd { margin: 2px 0 0; color: var(--sf-text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fact-wide { grid-column: 1 / -1; }
.facts-list { grid-template-columns: 1fr; }
.facts-list .fact { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--sp-3); align-items: baseline; padding: 8px 0; }
.facts-list .fact dd { margin: 0; }

/* =========================================================================================== tabs */

.tabs { display: grid; gap: var(--sp-5); min-width: 0; }
.tabs-list { display: flex; gap: 2px; border-bottom: 1px solid var(--sf-line); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  background: transparent; border: 0; color: var(--sf-text-2); cursor: pointer; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase;
}
.tab:hover { color: var(--sf-text); }
.tab.is-active { color: var(--sf-accent); }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--sf-accent); box-shadow: 0 0 10px rgba(var(--sf-accent-rgb), 0.8); }
.tab:focus-visible { outline-offset: -3px; }
.tab-badge:empty { display: none; }
.tab-panel { display: grid; gap: var(--sp-5); min-width: 0; }
.tab-panel:focus { outline: none; }

/* =========================================================================================== dialogs */

.dialog { padding: 0; border: 0; background: transparent; color: var(--sf-text); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: visible; }
.dialog::backdrop { background: rgba(2, 4, 12, 0.72); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in 0.2s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.dialog-frame {
  position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 48px);
  background: linear-gradient(180deg, rgb(15, 24, 47), rgb(10, 16, 34)); border: 1px solid var(--sf-line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog-sm .dialog-frame { width: 460px; }
.dialog-md .dialog-frame { width: 580px; }
.dialog-lg .dialog-frame { width: 820px; }
.dialog-frame, .dialog-sm .dialog-frame, .dialog-md .dialog-frame, .dialog-lg .dialog-frame { max-width: calc(100vw - 32px); }
.dialog-tier-c2 .dialog-frame, .dialog-tier-c3 .dialog-frame { border-top: 2px solid var(--sf-danger); }
.dialog-h { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 16px 20px 12px; border-bottom: 1px solid transparent; transition: border-color 0.15s, box-shadow 0.15s; }
/* Once the body scrolls under it, the header gets a divider and a soft shadow. */
.dialog-frame.is-scrolled > .dialog-h { border-bottom-color: var(--sf-line-strong); box-shadow: 0 8px 16px rgba(2, 4, 12, 0.45); }
.dialog-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; }
.dialog-x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--radius); background: transparent; border: 1px solid transparent; color: var(--sf-text-2); cursor: pointer; }
.dialog-x:hover:not(:disabled) { color: var(--sf-text); border-color: var(--sf-line-strong); }
.dialog-body { padding: 0 20px 18px; overflow-y: auto; }
.dialog-f { display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-2); padding: 14px 20px; border-top: 1px solid var(--sf-line); background: rgba(3, 6, 16, 0.35); }
/* What the confirm button still waits for ("Type SEND, write a reason and enter your password"), left of the buttons. */
.dialog-f-hint { margin-right: auto; padding-right: var(--sp-3); font-size: var(--fs-sm); color: var(--sf-text-2); line-height: 1.35; }
.dialog-f-hint:empty { display: none; }
.confirm-form { display: grid; gap: var(--sp-4); }
.dialog-intro { color: var(--sf-text-2); }
.dialog-intro p { margin-bottom: 6px; }
.tier-chip {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 2px 8px; border-radius: 3px;
  font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sf-accent); background: rgba(var(--sf-accent-rgb), 0.1); border: 1px solid rgba(var(--sf-accent-rgb), 0.3);
}
.tier-chip[data-tier="C2"], .tier-chip[data-tier="C3"] { color: var(--sf-danger); background: rgba(var(--sf-danger-rgb), 0.1); border-color: rgba(var(--sf-danger-rgb), 0.35); }
.dialog-preview { border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgba(3, 6, 16, 0.45); padding: 10px 14px 6px; }
.preview-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); margin-bottom: 2px; }
.dialog-preview .facts { grid-template-columns: 1fr; }
.preview-slot { display: grid; gap: 8px; padding: 6px 0 8px; }
/* The word to type: readable at a glance (bright text, 13.5 px), on a subtle tint. */
.confirm-word { padding: 2px 7px; border-radius: 3px; background: rgba(var(--sf-danger-rgb), 0.16); color: var(--sf-text); font-size: 13.5px; letter-spacing: 0.06em; font-weight: 600; text-transform: none; }
.dialog-message { min-height: 22px; display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); }
/* A message (an error, a server's refusal) stays in view at the bottom of a long dialog, just above its buttons. */
.confirm-form > .dialog-message:not(:empty) {
  position: sticky; bottom: 0; z-index: 1; padding: 9px 12px; border-radius: var(--radius);
  background: rgb(13, 20, 41); border: 1px solid var(--sf-line-strong); box-shadow: 0 -8px 16px rgba(2, 4, 12, 0.5);
}
.confirm-form > .dialog-message[data-tone="error"]:not(:empty) { border-color: rgba(var(--sf-danger-rgb), 0.55); }
.confirm-form > .dialog-message[data-tone="warn"]:not(:empty) { border-color: rgba(var(--sf-warn-rgb), 0.55); }
/* An empty message line stays in the page (a live region must exist before it speaks) but takes no room. */
.dialog-message:empty { min-height: 0; margin-top: calc(var(--sp-4) * -1); }
.dialog-message[data-tone="error"] { color: var(--sf-danger); }
.dialog-message[data-tone="warn"] { color: var(--sf-warn); }
.dialog-message[data-tone="notice"] { color: var(--sf-text-2); }
.dialog-message .sf-icon { margin-top: 2px; }
.sudo-note { display: flex; align-items: center; gap: 8px; color: var(--sf-gold); font-size: var(--fs-sm); }
.dialog.is-busy .dialog-frame { cursor: progress; }

/* =========================================================================================== toasts */

/* Hung from the top bar's edge, clear of a page head's buttons below. */
.toasts { position: fixed; top: calc(var(--top-h) + 4px); right: 18px; z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.toasts-polite, .toasts-assertive { display: grid; gap: 8px; }
.toast {
  --b: var(--sf-ok-rgb);
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 12px;
  background: rgba(11, 18, 38, 0.97); border: 1px solid var(--sf-line-strong); border-left: 3px solid rgb(var(--b)); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: toast-in 0.24s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateX(10px); transition: opacity 0.18s, transform 0.18s; }
.toast-notice { --b: var(--sf-accent-rgb); }
.toast-warn { --b: var(--sf-warn-rgb); }
.toast-error { --b: var(--sf-danger-rgb); }
.toast-icon { color: rgb(var(--b)); padding-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; }
.toast-text { color: var(--sf-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.toast-title + .toast-text { margin-top: 1px; }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; background: transparent; border: 0; color: var(--sf-text-3); cursor: pointer; border-radius: 3px; }
.toast-close:hover { color: var(--sf-text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* =========================================================================================== KPI tiles */

.kpis { display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-item { display: grid; min-width: 0; }
.kpi {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 16px 10px; color: inherit;
  background: linear-gradient(180deg, rgba(14, 22, 44, 0.9), rgba(9, 15, 32, 0.9)); border: 1px solid var(--sf-line); border-radius: var(--radius-lg);
  transition: border-color 0.15s, transform 0.15s;
}
a.kpi:hover { text-decoration: none; border-color: var(--sf-line-strong); transform: translateY(-1px); }
.kpi::before { content: ""; position: absolute; left: 16px; top: -1px; width: 28px; height: 2px; background: var(--sf-accent); box-shadow: 0 0 10px rgba(var(--sf-accent-rgb), 0.7); border-radius: 0 0 2px 2px; }
.kpi-danger::before { background: var(--sf-danger); box-shadow: 0 0 10px rgba(var(--sf-danger-rgb), 0.7); }
/* Red only when there is something to see: a zero or no reading keeps the calm accent. */
.kpi-danger:is(.is-zero, .is-empty)::before { background: var(--sf-accent); box-shadow: 0 0 10px rgba(var(--sf-accent-rgb), 0.7); }
.kpi-gold::before { background: var(--sf-gold); box-shadow: 0 0 10px rgba(var(--sf-gold-rgb), 0.7); }
.kpi-head { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--sf-text-3); }
.kpi-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-2); }
.kpi-figure { display: flex; align-items: baseline; gap: 6px; min-height: 46px; margin-top: 2px; }
.kpi-value { font-family: var(--font-display); font-weight: 600; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--sf-text); }
/* A zero (or no reading) is set in the muted text, about half as bright as a real number. */
.kpi.is-zero .kpi-value { color: var(--sf-text-3); }
.kpi.is-empty .kpi-value { color: var(--sf-text-3); }
.kpi-unit { color: var(--sf-text-3); font-size: var(--fs-sm); }
.kpi-delta { margin-left: auto; font-size: var(--fs-sm); color: var(--sf-text-2); font-variant-numeric: tabular-nums; }
.kpi-delta[data-good="yes"] { color: var(--sf-ok); }
.kpi-delta[data-good="no"] { color: var(--sf-danger); }
.kpi-caption { color: var(--sf-text-3); font-size: 12px; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-spark { margin: 6px -4px 0; height: 32px; }
.kpi-nohistory { height: 30px; margin: 0 4px; border-bottom: 1px dotted rgba(140, 170, 225, 0.5); }

/* =========================================================================================== charts */

.chart { position: relative; min-width: 0; }
.chart-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 22px; margin-bottom: 6px; }
.chart-mini .chart-top { display: none; }
.chart-plot { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; touch-action: pan-y; }
.chart-svg:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 3px; border-radius: 2px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sf-text-3); font-size: var(--fs-sm); border: 1px dashed transparent; }
.chart-mini .chart-empty { font-size: var(--fs-xs); justify-items: start; }
.chart-empty-over { pointer-events: none; z-index: 1; }
.chart-empty-over span { padding: 4px 12px; border-radius: 3px; background: rgba(3, 6, 16, 0.8); color: var(--sf-text-2); }
.chart-empty-inline { position: absolute; top: 0; right: 0; display: flex; align-items: center; color: var(--sf-text-2); font-size: var(--fs-sm); pointer-events: none; }
.chart-grid .chart-slot { stroke: rgba(120, 160, 230, 0.06); }
.chart-grid line { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid .chart-axis, .chart-axis { stroke: var(--viz-axis); }
.chart-grid .chart-xtick { stroke: var(--viz-axis); }
.chart-ylabel, .chart-xlabel { fill: var(--sf-text-3); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.chart-series { --c: var(--viz-1); }
.chart-series[data-slot="2"] { --c: var(--viz-2); }
.chart-series[data-slot="3"] { --c: var(--viz-3); }
.chart-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--c); opacity: 0.12; }
.chart-dot-solo { fill: var(--c); }
.chart-end { fill: var(--sf-accent); stroke: var(--sf-panel); stroke-width: 2; }
.chart-mini .chart-line { stroke-width: 1.75; }
.chart-bar { fill: var(--c); transition: filter 0.12s; }
.chart-bar.is-active { filter: brightness(1.45); }
.chart-cross-line { stroke: rgba(225, 238, 255, 0.38); stroke-width: 1; shape-rendering: crispEdges; }
.chart-cross-dot { --c: var(--viz-1); fill: var(--c); stroke: var(--sf-panel); stroke-width: 2; }
.chart-cross-dot[data-slot="2"] { --c: var(--viz-2); }
.chart-cross-dot[data-slot="3"] { --c: var(--viz-3); }
.chart-hit { cursor: crosshair; }
.chart-tip {
  position: absolute; z-index: 20; pointer-events: none; min-width: 120px;
  padding: 7px 10px; border-radius: var(--radius); background: rgba(3, 6, 16, 0.96); border: 1px solid var(--sf-line-strong); box-shadow: var(--shadow);
  font-size: var(--fs-sm); white-space: nowrap;
}
.tip-time { color: var(--sf-text-3); font-size: 11.5px; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--viz-1); flex: none; }
.tip-key[data-slot="2"] { background: var(--viz-2); }
.tip-key[data-slot="3"] { background: var(--viz-3); }
.tip-key-box { height: 8px; width: 8px; border-radius: 2px; }
.tip-value { font-weight: 600; color: var(--sf-text); font-variant-numeric: tabular-nums; }
.tip-name { color: var(--sf-text-2); }
.chart-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--sf-text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-key { width: 14px; height: 2px; border-radius: 1px; background: var(--viz-1); }
.legend-key[data-slot="2"] { background: var(--viz-2); }
.legend-key[data-slot="3"] { background: var(--viz-3); }
.chart-table-toggle {
  margin-left: auto; background: transparent; border: 1px solid transparent; color: var(--sf-text-3); cursor: pointer; border-radius: 3px;
  font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px;
}
.chart-table-toggle:hover, .chart-table-toggle.is-on { color: var(--sf-text); border-color: var(--sf-line-strong); }
.chart-table-wrap { max-height: 260px; overflow: auto; margin-top: var(--sp-3); border: 1px solid var(--sf-line); border-radius: var(--radius); }

/* =========================================================================================== steps */

.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { --s: var(--sf-grey-rgb); position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.step::before { content: ""; position: absolute; left: 11.5px; top: 24px; bottom: 0; width: 1px; background: var(--sf-line-strong); }
.step:last-child::before { display: none; }
.step:last-child { padding-bottom: 0; }
.step-mark {
  position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(var(--s), 0.55); background: var(--sf-panel); color: rgb(var(--s));
}
.step[data-state="ok"] { --s: var(--sf-ok-rgb); }
.step[data-state="ok"] .step-mark { background: rgba(var(--s), 0.14); }
.step[data-state="failed"] { --s: var(--sf-danger-rgb); }
.step[data-state="failed"] .step-mark { background: rgba(var(--s), 0.16); }
.step[data-state="waiting"] { --s: var(--sf-warn-rgb); }
.step[data-state="waiting"] .step-mark { background: rgba(var(--s), 0.14); animation: blink 1.4s ease-in-out infinite; }
.step[data-state="running"] { --s: var(--sf-accent-rgb); }
.step[data-state="running"] .step-mark { border-color: rgba(var(--s), 0.25); }
.step[data-state="running"] .step-mark::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 2px solid transparent; border-top-color: rgb(var(--s)); border-right-color: rgb(var(--s));
  animation: spin 0.9s linear infinite;
}
.step[data-state="skipped"] .step-mark::after { content: ""; width: 8px; height: 1.5px; background: rgba(var(--s), 0.8); }
.step[data-state="pending"] .step-mark { border-style: dashed; }
.step-line { display: flex; align-items: baseline; gap: var(--sp-2); min-height: 24px; padding-top: 2px; }
.step-name { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--sf-text); }
.step[data-state="pending"] .step-name, .step[data-state="skipped"] .step-name { color: var(--sf-text-3); }
.step[data-state="running"] .step-name { color: var(--sf-accent); }
.step-time { margin-left: auto; color: var(--sf-text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-detail { color: var(--sf-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.step[data-state="skipped"] .step-detail { color: var(--sf-text-3); }

/* =========================================================================================== log view */

.logview { position: relative; border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgba(2, 5, 14, 0.88); min-width: 0; }
.logview-scroller { position: relative; height: 420px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
.logview-spacer { position: relative; }
.logview-rows { position: absolute; inset: 0; }
.logview-probe { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
/* Lines wrap like text (spaces, the <wbr> after "\" and "/", inside a word only when it is longer than the line), with
   a hanging indent: after the timestamp when there is one, else 2ch. The numbered gutter sits in the first line.
   log-view.js measures each line on screen; its first guess uses the same widths. */
.log-line {
  position: absolute; left: 0; right: 0; min-height: 20px;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
  padding: 0 12px 0 calc(12px + 2ch); text-indent: -2ch; color: rgb(196, 210, 236);
}
.log-line.has-ts { padding-left: calc(12px + 25ch); text-indent: -25ch; }
.logview-numbered .log-line { padding-left: calc(12px + 64px + 2ch); text-indent: calc(-64px - 2ch); }
.logview-numbered .log-line.has-ts { padding-left: calc(12px + 64px + 25ch); text-indent: calc(-64px - 25ch); }
.log-line:hover { background: rgba(120, 160, 230, 0.06); }
.log-line[data-level="warn"] { color: var(--sf-warn); box-shadow: inset 2px 0 0 rgba(var(--sf-warn-rgb), 0.7); background: rgba(var(--sf-warn-rgb), 0.04); }
.log-line[data-level="error"] { color: rgb(255, 128, 118); box-shadow: inset 2px 0 0 var(--sf-danger); background: rgba(var(--sf-danger-rgb), 0.06); }
.log-line[data-level="fatal"] { color: rgb(255, 160, 150); box-shadow: inset 2px 0 0 var(--sf-danger); background: rgba(var(--sf-danger-rgb), 0.16); font-weight: 700; }
.log-ts { color: var(--sf-text-3); }
.log-line[data-level] .log-ts { color: inherit; opacity: 0.7; }
.log-n { display: inline-block; width: 52px; margin-right: 12px; text-indent: 0; color: var(--sf-text-3); text-align: right; user-select: none; }
.log-line mark { background: rgba(var(--sf-gold-rgb), 0.3); color: var(--sf-text); border-radius: 2px; box-shadow: 0 0 0 1px rgba(var(--sf-gold-rgb), 0.5); }
.logview-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sf-text-3); pointer-events: none; font-size: var(--fs-sm); }
.logview-jump {
  position: absolute; right: 18px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; background: var(--sf-accent); color: var(--sf-accent-ink); border: 0; cursor: pointer;
  font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--glow);
}
.logview.is-paused { border-color: rgba(var(--sf-gold-rgb), 0.35); }

/* =========================================================================================== json */

.json-view { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; }
.json-node > summary { cursor: pointer; list-style: none; }
.json-node > summary::-webkit-details-marker { display: none; }
.json-node > summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--sf-text-3); transition: transform 0.15s; }
.json-node[open] > summary::before { transform: rotate(90deg); }
.json-children { padding-left: 18px; border-left: 1px dashed var(--sf-line); margin-left: 5px; }
.json-row { padding-left: 14px; }
.json-k { color: var(--sf-blue); }
.json-colon, .json-brace { color: var(--sf-text-3); }
.json-string { color: rgb(160, 230, 200); overflow-wrap: anywhere; }
.json-number { color: var(--sf-gold); }
.json-boolean { color: var(--sf-flux); }
.json-null { color: var(--sf-text-3); font-style: italic; }
.diff-summary { color: var(--sf-text-2); margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.diff-table .diff-path { font-family: var(--font-mono); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--sf-text-2); }
.diff-changed td { background: rgba(var(--sf-gold-rgb), 0.06); }
.diff-added td:last-child { background: rgba(var(--sf-ok-rgb), 0.08); }
.diff-removed td:nth-child(2) { background: rgba(var(--sf-danger-rgb), 0.08); }

/* =========================================================================================== operation panel */

.op-panel { border-color: rgba(var(--sf-accent-rgb), 0.3); }
.op-panel.is-missing { border-color: var(--sf-line-strong); }
.op-missing { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 18px; color: var(--sf-text-2); font-size: var(--fs-sm); }
.op-missing > .sf-icon { flex: none; color: var(--sf-accent); }
.op-missing-text { flex: 1; min-width: 0; }
.op-head { align-items: flex-start; }
.op-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 2px; }
.op-target { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--sf-accent); font-weight: 500; }
.op-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--sf-text-2); font-size: var(--fs-sm); margin-top: 4px; }
.op-reason { color: var(--sf-text); font-style: italic; }
.op-elapsed { font-variant-numeric: tabular-nums; }
.op-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sf-text-3); }
.op-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sf-text-3); }
.op-live[data-state="live"] { color: var(--sf-accent); }
.op-live[data-state="live"] .op-live-dot { background: var(--sf-accent); box-shadow: 0 0 8px var(--sf-accent); animation: blink 1.6s ease-in-out infinite; }
.op-live[data-state="reconnecting"] { color: var(--sf-warn); }
.op-live[data-state="reconnecting"] .op-live-dot { background: var(--sf-warn); }
.op-body { display: grid; gap: var(--sp-4); }
.op-banners:empty, .op-result:empty { display: none; }
.op-banners { display: grid; gap: var(--sp-2); }
.op-grid { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.6fr); gap: var(--sp-5); align-items: start; }
.op-log .logview-scroller { height: 300px; }
.op-decision {
  display: grid; gap: var(--sp-2); padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid rgba(var(--sf-warn-rgb), 0.55); background: linear-gradient(90deg, rgba(var(--sf-warn-rgb), 0.12), rgba(var(--sf-warn-rgb), 0.03));
  box-shadow: 0 0 24px rgba(var(--sf-warn-rgb), 0.08);
}
.op-decision-head { display: flex; align-items: center; gap: 8px; color: var(--sf-warn); font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.op-decision-prompt { color: var(--sf-text); font-size: var(--fs-lg); margin: 0; }
.op-decision-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.op-decision-note { font-size: var(--fs-sm); min-height: 18px; color: var(--sf-text-2); }
.op-decision-note:empty { min-height: 0; margin-top: calc(var(--sp-2) * -1); }
.op-decision-note[data-tone="error"] { color: var(--sf-danger); }

/* =========================================================================================== game server down */

.game-down {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-5); align-items: start;
  padding: var(--sp-6); border-radius: var(--radius-lg); border: 1px solid rgba(var(--sf-grey-rgb), 0.35);
  background:
    repeating-linear-gradient(135deg, rgba(var(--sf-gold-rgb), 0.035) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, rgba(14, 22, 44, 0.9), rgba(9, 15, 32, 0.92));
}
.gd-art { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--sf-line-strong); color: var(--sf-text-3); background: rgba(3, 6, 16, 0.5); }
.gd-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 6px; }
.gd-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; }
.gd-text { color: var(--sf-text-2); }
.gd-message { color: var(--sf-text); font-family: var(--font-mono); font-size: 12.5px; }
.gd-message:empty { display: none; }
.gd-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

/* =========================================================================================== login */

.login-host {
  min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4);
  background:
    radial-gradient(700px 420px at 50% 38%, rgba(var(--sf-accent-rgb), 0.09), transparent 70%),
    radial-gradient(500px 300px at 50% 62%, rgba(var(--sf-flux-rgb), 0.06), transparent 70%);
}
.login { width: min(420px, 100%); display: grid; gap: var(--sp-6); position: relative; }
.login-orbit {
  position: absolute; left: 50%; top: 40px; width: 560px; height: 560px; margin-left: -280px; margin-top: -240px; pointer-events: none; z-index: -1;
  border-radius: 50%; border: 1px solid rgba(var(--sf-accent-rgb), 0.08);
  box-shadow: inset 0 0 80px rgba(var(--sf-accent-rgb), 0.03);
}
.login-orbit::before {
  content: ""; position: absolute; inset: 70px; border-radius: 50%; border: 1px dashed rgba(var(--sf-accent-rgb), 0.12); animation: spin 90s linear infinite;
}
.login-orbit::after {
  content: ""; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--sf-accent); box-shadow: 0 0 12px var(--sf-accent); transform-origin: 3px 283px; animation: spin 24s linear infinite;
}
.login-brand { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; }
.login-brand .brand-mark { filter: drop-shadow(0 0 18px rgba(var(--sf-accent-rgb), 0.35)); }
.login-title { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: 0.24em; text-transform: uppercase; line-height: 1; }
.login-title .brand-b { margin-left: 0.4em; }
.login-sub { font-family: var(--font-label); font-weight: 600; font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sf-text-3); }
.login-card { padding: var(--sp-6); display: grid; gap: var(--sp-4); }
.login-card .btn { height: 42px; font-size: 16px; }
.login-note { text-align: center; color: var(--sf-text-3); font-size: var(--fs-xs); }
.login-message { min-height: 44px; }

/* =========================================================================================== page: overview & server */

/* Overview's server strip: state + release + uptime | the build's facts in one row | a link to the Server page. */
.strip {
  --t: var(--st-stopped);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px var(--sp-6);
  min-height: 76px; padding: 14px var(--sp-5);
  box-shadow: inset 3px 0 0 rgba(var(--t), 0.85);
  background:
    radial-gradient(420px 120px at 0% 50%, rgba(var(--t), 0.1), transparent 70%),
    linear-gradient(180deg, rgba(14, 22, 44, 0.92), rgba(9, 15, 32, 0.94));
}
.strip[data-tone="running"] { --t: var(--st-running); }
.strip[data-tone="draining"] { --t: var(--st-draining); }
.strip[data-tone="crashed"] { --t: var(--st-crashed); }
.strip[data-tone="starting"] { --t: var(--st-starting); }
.strip[data-tone="external"] { --t: var(--st-external); }
.strip[data-tone="stopped"] { --t: var(--st-stopped); }
.strip-state { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; min-width: 0; }
.strip-release { font-size: 15px; font-weight: 600; color: var(--sf-text); overflow-wrap: anywhere; }
.strip-sub { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--sf-text-3); }
.strip-uptime { color: var(--sf-text-2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.strip-tags:empty { display: none; }
.strip-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin: 0; padding-left: var(--sp-6); border-left: 1px solid var(--sf-line); min-width: 0; }
.strip-fact { display: grid; gap: 3px; }
.strip-fact dt { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.strip-fact dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--sf-text); white-space: nowrap; }
.strip-link {
  display: inline-flex; align-items: center; gap: 2px; padding: 6px 4px 6px 10px; border-radius: 3px;
  font-family: var(--font-label); font-weight: 600; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-accent); white-space: nowrap;
}
.strip-link:hover { text-decoration: none; background: rgba(var(--sf-accent-rgb), 0.08); }
.strip-message { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: var(--radius); background: rgba(var(--t), 0.07); border: 1px solid rgba(var(--t), 0.25); color: var(--sf-text); font-size: 13.5px; overflow-wrap: anywhere; }

/* Overview's bottom row: both cards as tall as the row; a short crash card centres its content. */
.overview-bottom { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
.crash-card { display: flex; flex-direction: column; }
.crash-card > .card-b { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* The Server page's status bar: state, release, uptime, what needs attention, and the controls, on one row. */
.statusbar { --t: var(--st-stopped); display: grid; gap: 10px; padding: 14px var(--sp-5); box-shadow: inset 3px 0 0 rgba(var(--t), 0.85); }
.statusbar[data-tone="running"] { --t: var(--st-running); }
.statusbar[data-tone="draining"] { --t: var(--st-draining); }
.statusbar[data-tone="crashed"] { --t: var(--st-crashed); }
.statusbar[data-tone="starting"] { --t: var(--st-starting); }
.statusbar[data-tone="external"] { --t: var(--st-external); }
.sb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; min-height: 40px; }
.sb-state { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.sb-id { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.sb-release { font-size: 15px; font-weight: 600; color: var(--sf-text); overflow-wrap: anywhere; }
.sb-sub { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--sf-text-3); }
.sb-uptime { color: var(--sf-text-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sb-flags:empty { display: none; }
.sb-message { margin: 0; padding: 8px 12px; border-radius: var(--radius); background: rgba(var(--t), 0.07); border: 1px solid rgba(var(--t), 0.25); color: var(--sf-text); font-size: 13.5px; overflow-wrap: anywhere; }
.statusbar .controls-note { margin-top: 0; }
.icon-btn-sm { width: 28px; height: 28px; }
.tabs-sticky > .tabs-list {
  position: sticky; top: var(--top-h); z-index: 25;
  background: linear-gradient(180deg, rgba(6, 10, 26, 0.97) 70%, rgba(6, 10, 26, 0.88)); backdrop-filter: blur(8px);
}
/* More tabs to one side: that side fades out. */
.tabs-list.is-more-right { mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.tabs-list.is-more-left { mask-image: linear-gradient(90deg, transparent, #000 48px); }
.tabs-list.is-more-left.is-more-right { mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.path-value { display: inline-flex; align-items: flex-start; gap: 4px; max-width: 100%; }
.path-value > .mono { min-width: 0; overflow-wrap: anywhere; padding-top: 4px; }
.card-toolbar { padding: 14px var(--sp-5); border-bottom: 1px solid var(--sf-line); }
.card-toolbar-notice { padding: 14px var(--sp-5) 0; }
.card-toolbar-notice:has(> .notice-slot:empty) { display: none; }
.left-behind:empty, .op-slot:empty, .op-notice:empty, .build-state:empty { display: none; }
.kpi.is-alert { border-color: rgba(var(--sf-danger-rgb), 0.5); }
.kpi.is-alert .kpi-value { color: var(--sf-danger); }

.ops-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ops-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sf-line); }
.ops-item:last-child { border-bottom: 0; }
.ops-item > .badge { justify-self: start; }
.ops-kind { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.ops-kind .mono { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ops-sub { color: var(--sf-text-3); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-when { color: var(--sf-text-3); font-size: var(--fs-sm); text-align: right; white-space: nowrap; }

.crash-lines { margin: 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: var(--radius); background: rgba(2, 5, 14, 0.88); border: 1px solid var(--sf-line); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre; color: rgb(196, 210, 236); }

.controls { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--sp-2); }
.control-group { display: flex; gap: var(--sp-2); padding: 0 14px; }
.control-group:first-child { padding-left: 0; }
.control-group:last-child { padding-right: 0; }
.control-group + .control-group { border-left: 1px solid var(--sf-line-strong); }
.controls-note { color: var(--sf-text-3); font-size: var(--fs-sm); margin-top: var(--sp-3); display: flex; align-items: center; gap: 6px; }
.controls-note:empty { display: none; }

.wizard { display: grid; gap: var(--sp-5); }
.wizard-steps { display: flex; gap: 0; counter-reset: wz; flex-wrap: wrap; }
.wz-step {
  counter-increment: wz; position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 22px 8px 0; color: var(--sf-text-3);
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase;
}
.wz-step::before {
  content: counter(wz); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--sf-line-strong); font-size: 12px; letter-spacing: 0;
}
.wz-step::after { content: ""; width: 26px; height: 1px; background: var(--sf-line-strong); margin-left: 12px; }
.wz-step:last-child::after { display: none; }
.wz-step.is-current { color: var(--sf-accent); }
.wz-step.is-current::before { border-color: var(--sf-accent); background: rgba(var(--sf-accent-rgb), 0.14); box-shadow: 0 0 12px rgba(var(--sf-accent-rgb), 0.4); }
.wz-step.is-done { color: var(--sf-text-2); }
.wz-step.is-done::before { content: "✓"; border-color: rgba(var(--sf-ok-rgb), 0.6); color: var(--sf-ok); background: rgba(var(--sf-ok-rgb), 0.1); }
.wz-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.wz-left, .wz-right { padding-top: 8px; padding-bottom: 8px; }
.wz-left { padding-right: 28px; }
.wz-right { padding-left: 28px; border-left: 1px solid var(--sf-line); }
.wz-step.is-current { color: var(--sf-accent); }
.wz-step.is-current::after { background: var(--sf-line-strong); }
.compare { width: 100%; }
.compare th[scope="row"] { font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sf-text-3); width: 150px; }
.compare td.changed { color: var(--sf-gold); }
.commit-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgba(3, 6, 16, 0.4); }
.commit-list li { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--sf-line); font-size: var(--fs-sm); }
.commit-list li:last-child { border-bottom: 0; }
.commit-sha { font-family: var(--font-mono); color: var(--sf-accent); flex: none; }
.commit-list.removed .commit-sha { color: var(--sf-danger); }

.leases .badge { margin-left: 6px; }

/* =========================================================================================== page: logs */

.logs-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.logs-bar .field { min-width: 180px; }
.logs-bar .grow { flex: 1 1 260px; }
.logs-status { display: flex; gap: var(--sp-4); align-items: center; color: var(--sf-text-3); font-size: var(--fs-sm); flex-wrap: wrap; min-height: 22px; }
.logs-page .logview-scroller { height: calc(100vh - 330px); min-height: 360px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-dot.is-live { color: var(--sf-accent); }
.live-dot.is-live::before { box-shadow: 0 0 8px currentColor; animation: blink 1.6s ease-in-out infinite; }

/* =========================================================================================== page: config */

/* Two sections side by side on a wide screen, values with more room than names (1 : 1.4); long values wrap at their
   separators (breakable()), never mid-word unless a word is longer than the cell. */
.config-groups { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); align-items: start; }
.config-table { table-layout: fixed; }
.config-table td:first-child { font-family: var(--font-mono); font-size: 12.5px; color: var(--sf-text-2); width: 42%; }
.config-table td:first-child .cell-sub { font-family: var(--font-body); font-size: var(--fs-sm); }
.config-table td:last-child { text-align: left; overflow-wrap: anywhere; }
.config-note { margin: 0; font-size: var(--fs-sm); }
.config-long { display: flex; align-items: center; gap: 4px; min-width: 0; }
.config-long > .truncate { flex: 1; min-width: 0; max-width: none; }
.dev-key { display: inline-flex; align-items: center; gap: 7px; color: var(--sf-text-2); font-size: 12.5px; }
.dev-key-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sf-warn); box-shadow: 0 0 6px rgba(var(--sf-warn-rgb), 0.6); }
.secret-chip { display: inline-flex; align-items: center; gap: 6px; }
.raw-json > summary { cursor: pointer; color: var(--sf-text-2); font-size: var(--fs-sm); width: fit-content; }
.raw-json > summary:hover { color: var(--sf-text); }
.raw-json[open] > summary { margin-bottom: var(--sp-3); }
.config-value { font-family: var(--font-mono); font-size: 12.5px; }

/* =========================================================================================== page: audit */

.filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.filters .field { min-width: 170px; flex: 0 1 240px; }
.filters-note { align-self: center; margin: 0; }
.row-nowrap { flex-wrap: nowrap; }
.notice-slot:empty { display: none; }
.audit-when { white-space: nowrap; color: var(--sf-text-2); }
.audit-cmd { font-family: var(--font-mono); font-size: 12.5px; color: var(--sf-text); }
.audit-detail { color: var(--sf-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* =========================================================================================== pages: support */

/* Shared bits (components/people.js): an id with its copy button, signed changes, dimmed rows, a link-looking button. */
.id-copy { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.id-copy > .mono { overflow-wrap: anywhere; }
/* A value cut to its cell (a long hash): an ellipsis, never past the card's edge. */
.clip { display: inline-block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.id-copy > .mono.clip { overflow-wrap: normal; }
.fact dd { min-width: 0; }
/* A label's time window ("· 30 days", "· 24 hours") in its own case, after a label set in capitals. */
.label-window { text-transform: none; letter-spacing: 0.02em; }
/* A card's status on the left of its header ("3 open · newest first"), read as text, not as a label. */
.card-eyebrow > .card-status { text-transform: none; letter-spacing: 0.01em; font-size: var(--fs-sm); font-weight: 500; color: var(--sf-text-2); }
.delta-up { color: var(--sf-ok); }
.delta-down { color: var(--sf-danger); }
.table .row-dim td { color: var(--sf-text-3); }
.table .row-dim .cell-main { color: var(--sf-text-2); font-weight: 500; }
.link-btn { padding: 0; border: 0; background: none; color: var(--sf-accent); font: inherit; cursor: pointer; font-variant-numeric: tabular-nums; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.stack-tight { display: grid; gap: 6px; }
.title-row { display: flex; align-items: center; gap: 6px 12px; min-width: 0; flex-wrap: wrap; }
.title-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.title-chips:empty { display: none; }
.filters-seg .field { flex: 0 0 auto; min-width: 0; }
.ledger-filters .field-seg { flex: 0 1 auto; }
.ledger-filters .field:not(.field-seg) { flex: 0 1 260px; }
.field-seg.is-dim { opacity: 0.45; }
.ledger-source { max-width: 220px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
/* A player's or clan's name keeps its own letters inside a heading set in capitals; long ones wrap rather than run out. */
.as-written { text-transform: none; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.player-title { overflow-wrap: anywhere; text-transform: none; letter-spacing: 0.02em; }
/* One look for every link to a player, battle or clan: the accent, semi-bold, underlined on hover. */
.ref-link { color: var(--sf-accent); font-weight: 600; }
.ref-link.mono { font-weight: 500; }
.ref-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table .ref-link.truncate { max-width: 100%; }
/* Players' and operators' text in a table (reasons, notes, details): read as the row's main text, not as a footnote. */
.cell-text { color: var(--sf-text); overflow-wrap: anywhere; }
.vs-line { display: inline-flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.vs { color: var(--sf-text-3); font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.vs-ai { display: inline-flex; align-items: center; gap: 4px; }
.match-title .vs { font-size: 0.55em; margin: 0 0.35em; vertical-align: middle; }

/* Players: the search beside the list chips; exact tag/id hits above the table. */
.player-filters { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: var(--sp-4) var(--sp-6); align-items: start; }
.player-lists { display: grid; gap: 6px; min-width: 0; }
.exact-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.exact-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.exact-hit {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 10px; border-radius: var(--radius); min-width: 0; max-width: 100%;
  border: 1px solid rgba(var(--sf-accent-rgb), 0.35); background: rgba(var(--sf-accent-rgb), 0.07); color: var(--sf-text);
}
.exact-hit:hover { text-decoration: none; border-color: var(--sf-accent); }
.exact-hit .cell-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exact-kind { font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-accent); }

/* A player's header: the state banners, then the tag and id beside the actions, then the facts in one type scale. */
.player-head .card-b { display: grid; gap: var(--sp-4); }
.ph-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); flex-wrap: wrap; }
.ph-ident { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; min-width: 0; }
.ph-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; color: var(--sf-text); }
.ph-tag .mono { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.ph-id { display: inline-flex; align-items: center; gap: 8px; color: var(--sf-text-2); min-width: 0; }
.ph-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
/* The header's facts have no dividers, so nothing is clipped either: their text sits on the bottom edge. */
.ph-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); clip-path: none; }
.ph-facts .fact { box-shadow: none; padding-bottom: 0; }
.ph-big { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.15; }
.ph-flags { font-family: var(--font-mono); font-size: 12.5px; color: var(--sf-text-2); white-space: pre-wrap; }
.ph-flag-why { color: var(--sf-text); }
.ph-who { color: var(--sf-text-2); font-weight: 400; }
.ph-live { display: grid; gap: var(--sp-2); }
.ph-note { display: flex; align-items: center; gap: 8px; margin: 0; }
/* The actions, by intent: the main ones, More, then the admin's danger group set apart (or a lock below admin). */
.ph-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; }
.ph-main-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ph-danger { display: flex; align-items: center; gap: var(--sp-2); padding-left: var(--sp-3); border-left: 1px solid var(--sf-line-strong); }
.ph-locked {
  align-items: center; gap: 6px; padding: 0 2px 0 var(--sp-3); border-left: 1px solid var(--sf-line); height: 28px; color: var(--sf-text-3);
  font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; cursor: default;
}
.ph-actions .tip-wrap[data-tip]:not([data-tip=""]):hover::after, .ph-actions .tip-wrap[data-tip]:not([data-tip=""]):focus-within::after { left: auto; right: 0; transform: none; }
.kpi-static { padding-bottom: 14px; }

/* A menu of actions under a button (components/menu.js). */
.menu { position: relative; display: inline-flex; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; z-index: 60; display: grid; gap: 2px; padding: 6px;
  background: var(--sf-panel-raised); border: 1px solid var(--sf-line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.menu-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius); text-align: left; cursor: pointer;
  background: transparent; border: 0; color: var(--sf-text); font: inherit; font-size: var(--fs-md);
}
.menu-item .sf-icon { margin-top: 2px; color: var(--sf-text-2); }
.menu-item:hover:not([aria-disabled="true"]), .menu-item:focus-visible { background: rgba(var(--sf-accent-rgb), 0.1); outline: none; }
.menu-item[aria-disabled="true"] { color: var(--sf-text-3); cursor: not-allowed; }
.menu-item[aria-disabled="true"]:focus-visible { background: rgba(120, 160, 230, 0.07); }
.menu-item-text { display: grid; gap: 1px; }
.menu-item-why { font-size: var(--fs-xs); color: var(--sf-text-3); }

/* Grant and take back: the amounts on a grid (the four pod tiers in one row) and one line of limits under them. */
.grant-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grant-pods { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grant-pods-wrap { display: grid; gap: 6px; }
.grant-pods .field-label { white-space: nowrap; }
.limits-line {
  margin: 0; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--sf-line); background: rgba(3, 6, 16, 0.35);
  font-size: var(--fs-sm); color: var(--sf-text-2); font-variant-numeric: tabular-nums;
}

/* The recovery code: big, mono, copyable, shown once. */
.recovery-code {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 14px 16px; border-radius: var(--radius);
  border: 1px dashed rgba(var(--sf-gold-rgb), 0.6); background: rgba(var(--sf-gold-rgb), 0.07);
}
.recovery-value { font-size: 24px; font-weight: 600; letter-spacing: 0.18em; color: var(--sf-gold); user-select: all; overflow-wrap: anywhere; }
.dialog-recovery .facts { grid-template-columns: 1fr 1fr; }

/* Collection: a card's level as a bar; the decks. */
.level { display: inline-flex; align-items: center; gap: 10px; }
.level-text { min-width: 54px; }
.level-bar { position: relative; width: 64px; height: 4px; border-radius: 2px; background: rgba(120, 160, 230, 0.16); overflow: hidden; }
.level-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sf-accent); box-shadow: 0 0 6px rgba(var(--sf-accent-rgb), 0.6); }
.deck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.deck { padding: 10px 12px; border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgba(3, 6, 16, 0.3); display: grid; gap: 4px; }
.deck.is-active { border-color: rgba(var(--sf-accent-rgb), 0.45); }
.deck-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deck-name { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.deck-cards { color: var(--sf-text-2); font-size: var(--fs-sm); }

/* History: the restore preview's list of what is undone. */
.history-hint { font-size: var(--fs-sm); }
.history-result:empty { display: none; }
.preview-list { max-height: 260px; overflow: auto; margin: 8px 0 6px; border: 1px solid var(--sf-line); border-radius: var(--radius); }
.preview-list .table th:first-child, .preview-list .table td:first-child { padding-left: 10px; }
.preview-list .table th:last-child, .preview-list .table td:last-child { padding-right: 10px; }

/* A battle's seats: two cards of the same height, the same facts on each. */
.seat-cards { align-items: stretch; }
.seat-card { display: flex; flex-direction: column; }
.seat-card > .card-b { flex: 1; }
.seat-card .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 4px; clip-path: none; }
/* No dividers between the seat's facts (a half-width one under a single fact looked broken); a closer title. */
.seat-card .fact { box-shadow: none; padding: 6px var(--sp-4) 6px 0; }
.seat-card > .card-h { min-height: 0; padding-bottom: 10px; }
.seat-card > .card-b { padding-top: 10px; }
.seat-card .card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-summary .facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* History's pick boxes: brighter edges, so an unpicked one still reads as a box. */
.check-bright .check-box { border-color: rgba(150, 175, 215, 0.75); }

/* A clan's feed. */
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-item { display: grid; grid-template-columns: 110px auto minmax(0, 1fr); gap: var(--sp-3); align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--sf-line); }
.feed-item:last-child { border-bottom: 0; }
.feed-when { color: var(--sf-text-3); font-size: var(--fs-sm); white-space: nowrap; }
.feed-text { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.feed-text .truncate { max-width: 220px; }
.feed-phrase { color: var(--sf-text); overflow-wrap: anywhere; }

/* Moderation: the anomalies' kinds as toggles. */
.kind-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; align-self: center; }
.kind-chips:empty { display: none; }
.kind-label { color: var(--sf-text-3); font-size: var(--fs-sm); margin-right: 2px; }
.kind-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--sf-line-strong); background: transparent; color: var(--sf-text-2); font: inherit; font-size: var(--fs-sm);
}
.kind-chip:hover { color: var(--sf-text); border-color: rgba(120, 160, 230, 0.5); }
.kind-chip.is-on { color: var(--sf-accent); border-color: var(--sf-accent); background: rgba(var(--sf-accent-rgb), 0.1); }

/* =========================================================================================== pages: business */

/* A Business page's sections, at the page grid's gap; the bands on top (what the figures are, test purchases included). */
.biz-body { display: grid; gap: var(--sp-5); min-width: 0; }
.biz-notes { display: grid; gap: var(--sp-3); }
.biz-notes:empty { display: none; }
.biz-controls { gap: var(--sp-2) var(--sp-4); }
.biz-controls .field-seg { align-self: center; }
.biz-note { margin: 0; color: var(--sf-text-2); font-size: var(--fs-sm); text-wrap: pretty; }
/* A negative amount (a day that refunded more than it sold, a shortfall): clear in amber with its minus, not an alarm. */
.money-neg { color: var(--sf-warn); }
.kpi.is-negative .kpi-value { color: var(--sf-warn); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* A tile whose caption may take two lines (a payer note); the row's tiles stay one height, each laid out from its top, so
   the values keep one line across the row and a long caption grows downward. */
.kpi-wrap { align-content: start; }
.kpi-wrap .kpi-caption { white-space: normal; overflow: visible; text-overflow: clip; }
/* Tables that share one column layout: fixed widths where given, the rest share what is left (By product and By region;
   the store's groups), so their columns line up and no figure sits far from its name. */
.table-spread, .table-fixed { table-layout: fixed; }
.table-spread td, .table-fixed td { overflow-wrap: anywhere; }
/* Needs attention: a reason Recheck can't run that every such row shares, said once above the list. */
.attention-note { padding: 12px var(--sp-5); border-bottom: 1px solid var(--sf-line); }
.attention-note:empty { display: none; }
/* A type is a neutral outline: colour belongs to the state. */
.badge-outline { --b: var(--sf-grey-rgb); background: transparent; color: var(--sf-text-2); }
/* A count of things waiting on someone (Needs attention). */
.count-chip-warn { background: rgba(var(--sf-warn-rgb), 0.18); color: var(--sf-warn); }
/* A long table shown short: the "Show all N" row under it. */
.table-more { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--sf-line); }
.table-more[hidden] { display: none; }
/* Groups of rows inside one card (the store's crystal packs, bundles and offers, the Pass). */
.table-group + .table-group { border-top: 1px solid var(--sf-line-strong); }
.table-group-title {
  margin: 0; padding: 12px var(--sp-5) 4px;
  font-family: var(--font-label); font-weight: 600; font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sf-accent);
}
/* Purchases: the state, store and product filters on one row when they fit, the select as tall as the segmented ones. */
.purchase-filters .field-seg { flex: 0 0 auto; }
.purchase-filters .field:not(.field-seg) { flex: 0 1 280px; }
.purchase-filters .input-select { min-height: 32px; height: 32px; padding-top: 4px; padding-bottom: 4px; }
.clear-filters { margin-left: 10px; font-size: var(--fs-sm); text-transform: none; letter-spacing: 0.01em; font-weight: 500; }
.clear-filters[hidden] { display: none; }
/* A stuck row's why: its chip as wide as its words, then the sentence; what Recheck can't do here in a quieter tone. */
.why-cell { justify-items: start; gap: 4px; }
.why-text { white-space: normal; max-width: 60ch; text-wrap: pretty; }
.why-off { color: var(--sf-text-3); }
.why-name { color: var(--sf-text); font-weight: 600; }
/* A purchase's life: recorded → granted → consumed, a dot on a line per step; a refund is a red marker off the path
   (a dashed red line to it), there only when it was refunded. */
.timeline { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) 0; }
.timeline.has-off { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 0.8fr); }
.timeline.has-off .tl-step:nth-child(3)::before { background: repeating-linear-gradient(90deg, rgba(var(--sf-danger-rgb), 0.7) 0 5px, transparent 5px 10px); }
.tl-step { position: relative; display: grid; gap: 2px; padding: 20px var(--sp-4) 0 0; min-width: 0; }
.tl-step::before { content: ""; position: absolute; left: 14px; right: 2px; top: 6px; height: 2px; background: var(--sf-line-strong); }
.tl-step:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--sf-panel); border: 2px solid var(--sf-line-strong); }
.tl-label { font-size: var(--fs-sm); font-weight: 600; color: var(--sf-text-3); }
.tl-time { font-size: var(--fs-sm); color: var(--sf-text-2); font-variant-numeric: tabular-nums; }
.tl-done .tl-dot { background: var(--sf-ok); border-color: var(--sf-ok); }
.tl-done::before { background: rgba(var(--sf-ok-rgb), 0.45); }
.tl-done .tl-label { color: var(--sf-text); }
.tl-wait .tl-dot { background: var(--sf-warn); border-color: var(--sf-warn); box-shadow: 0 0 8px rgba(var(--sf-warn-rgb), 0.6); }
.tl-wait .tl-label { color: var(--sf-warn); }
.tl-off .tl-dot { background: var(--sf-danger); border-color: var(--sf-danger); border-radius: 3px; transform: rotate(45deg) scale(0.9); }
.tl-off .tl-label, .tl-off .tl-time { color: var(--sf-danger); }
.purchase-facts { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* Mark refunded's summary: key and value; what it takes back now set apart. */
.intro-lines p { margin: 0 0 3px; }
.take-back { font-weight: 700; font-size: 15px; color: var(--sf-danger); }
.dialog-preview .kv-preview .fact { grid-template-columns: 130px minmax(0, 1fr); padding: 3px 0; }
/* A password-confirmed dialog is the tallest: a little tighter, and room under its last hint above the footer. */
.dialog-tier-c3 .confirm-form { gap: 12px; padding-bottom: 12px; }
.dialog-tier-c3 .confirm-form > .dialog-message:empty { margin-top: -12px; }
/* The store: the arena picker in the odds card's header; the Pass's facts in a row without dividers. */
.arena-pick { min-width: 230px; }
.card-actions .arena-pick { grid-auto-flow: column; align-items: center; gap: 10px; }
.card-actions .arena-pick .input-select { min-height: 32px; height: 32px; padding-top: 4px; padding-bottom: 4px; }
.pass-facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); clip-path: none; }
.pass-facts .fact { box-shadow: none; padding-bottom: 0; padding-top: 0; }
/* A bar chart's part below the axis (refunds under sales), in the negative colour. */
.chart-bar-below { fill: var(--viz-neg); }
.tip-key-below { background: var(--viz-neg); }
.tip-key-none { background: transparent; }

/* =========================================================================================== pages: game */

/* Which battles a Game page covers: one row of labelled filters in a slim card, the selects as tall as the segmented
   (a long release id ends in an ellipsis; its whole name is the select's tooltip). */
.filters-card > .card-b { padding: 14px var(--sp-5) 16px; }
.game-filters { gap: var(--sp-3) var(--sp-5); }
.game-filters .field-seg { flex: 0 0 auto; }
.game-filters .field:not(.field-seg) { flex: 0 1 280px; min-width: 200px; }
.game-filters .input-select { min-height: 32px; height: 32px; padding-top: 4px; padding-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* A segmented control in a card's header, its label beside it. */
.card-actions .field-inline-label { grid-auto-flow: column; align-items: center; gap: 10px; }

/* Headings a table sorts by: the label and a small caret (both ways, faint, until it is the one sorted by). */
.th-sort {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.th-sort:hover { color: var(--sf-text); }
.th-sort:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; border-radius: 2px; }
.al-right > .th-sort { flex-direction: row-reverse; }
.th-sort-mark { width: 7px; height: 9px; flex: none; background: currentColor; opacity: 0.35; clip-path: polygon(50% 0, 100% 38%, 0 38%, 0 62%, 100% 62%, 50% 100%); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--sf-accent); }
th[aria-sort="ascending"] .th-sort-mark { opacity: 1; clip-path: polygon(50% 15%, 100% 80%, 0 80%); }
th[aria-sort="descending"] .th-sort-mark { opacity: 1; clip-path: polygon(0 20%, 100% 20%, 50% 85%); }

/* A flag is its own sign, never a rarity's: an outline with an arrow, in ember (strong) or violet (weak), colours no
   rarity uses (the violet bluer than the epic's flux, redder than the rare's blue). The Game pages use the pair for one
   meaning everywhere: ember over, violet under (a flag, a breakdown row against the whole, an AI cell against its aim).
   "Too few" stays a neutral outline. */
:root { --flag-strong-rgb: 255, 120, 72; --flag-weak-rgb: 155, 125, 255; }
.badge-strong, .badge-weak { background: transparent; border-width: 1.5px; }
.badge-strong { --b: var(--flag-strong-rgb); }
.badge-weak { --b: var(--flag-weak-rgb); }

/* An interval chart (components/interval-chart.js intervalChart): a row per item, label | track | figure (| side), the
   track's marks placed in percent. The point is the series' cyan, its 95 % range a whisker with end caps, the reference a
   dashed line, the second marker a hollow gold diamond drawn over the point and a little larger than it (a point that
   lands on it is framed, not hidden), a card's own rate a dashed gold line down every row; an "over" row is tinted ember,
   an "under" one violet. A side column is a number of its own, never cut. */
.ichart-rows { display: grid; }
.ichart-row {
  display: grid; grid-template-columns: minmax(110px, 210px) minmax(0, 1fr) 190px; align-items: center; column-gap: var(--sp-4);
  min-height: 28px; border-radius: 2px;
}
.ichart-compact .ichart-row { grid-template-columns: minmax(84px, 150px) minmax(0, 1fr) 118px; column-gap: var(--sp-3); }
.ichart-has-side .ichart-row { grid-template-columns: minmax(110px, 210px) minmax(0, 1fr) 132px 76px; }
.ichart-side { justify-self: end; white-space: nowrap; color: var(--sf-text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ichart-side-head { align-self: end; padding-bottom: 2px; color: var(--sf-text-3); font-family: var(--font-label); font-weight: 600; font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.ikey-side { padding: 1px 5px; border: 1px solid var(--sf-line-strong); border-radius: 3px; color: var(--sf-text-2); font-family: var(--font-label); font-weight: 600; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; }
.ichart-row:not(.ichart-axis):hover { background: rgba(120, 160, 230, 0.06); }
.ichart-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: var(--fs-sm); }
.ichart-label .cell-main { font-weight: 500; color: var(--sf-text); }
.ichart-row.is-none .ichart-label .cell-main { color: var(--sf-text-3); }
.ichart-track { position: relative; align-self: stretch; min-height: 28px; }
.ichart-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--viz-grid); }
.ichart-ref { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(225, 238, 255, 0.38); }
.ichart-whisker { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: rgba(16, 164, 195, 0.75); }
.ichart-whisker::before, .ichart-whisker::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: inherit; }
.ichart-whisker::before { left: -1px; }
.ichart-whisker::after { right: -1px; }
.ichart-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--viz-1); box-shadow: 0 0 0 2px var(--sf-panel); }
.ichart-mark { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; transform: rotate(45deg); border: 2px solid var(--viz-2); background: transparent; }
/* The own-rate line runs the row's full height; the rows touch, so it reads as one line down the chart. */
.ichart-own { position: absolute; top: 0; bottom: 0; width: 0; margin-left: -1px; border-left: 2px dashed var(--viz-2); }
.ichart-row.is-over .ichart-dot { background: rgb(var(--flag-strong-rgb)); }
.ichart-row.is-over .ichart-whisker { background: rgba(var(--flag-strong-rgb), 0.7); }
.ichart-row.is-over .ichart-label > * { color: rgb(var(--flag-strong-rgb)); }
.ichart-row.is-under .ichart-dot { background: rgb(var(--flag-weak-rgb)); }
.ichart-row.is-under .ichart-whisker { background: rgba(var(--flag-weak-rgb), 0.7); }
.ichart-row.is-under .ichart-label > * { color: rgb(var(--flag-weak-rgb)); }
.ichart-value { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-variant-numeric: tabular-nums; }
.ichart-figure { min-width: 50px; text-align: right; font-weight: 600; color: var(--sf-text); font-size: var(--fs-sm); }
.ichart-row.is-none .ichart-figure { color: var(--sf-text-3); font-weight: 500; }
.ichart-aside { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sf-text-3); font-size: var(--fs-xs); }
.ichart-axis, .ichart-axis .ichart-track { min-height: 20px; }
.ichart-axis-label { position: absolute; top: 3px; transform: translateX(-50%); color: var(--sf-text-3); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ichart-empty { display: grid; place-items: center; min-height: 72px; color: var(--sf-text-3); font-size: var(--fs-sm); }
/* Its legend's keys. */
.ikey { position: relative; display: inline-block; flex: none; }
.ikey-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--viz-1); }
.ikey-dot.ikey-over { background: rgb(var(--flag-strong-rgb)); }
.ikey-dot.ikey-under { background: rgb(var(--flag-weak-rgb)); }
.ikey-own { width: 0; height: 14px; margin: 0 3px; border-left: 2px dashed var(--viz-2); }
.ikey-whisker { width: 18px; height: 2px; background: rgba(16, 164, 195, 0.75); }
.ikey-whisker::before, .ikey-whisker::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: inherit; }
.ikey-whisker::before { left: 0; }
.ikey-whisker::after { right: 0; }
.ikey-ref { width: 0; height: 12px; border-left: 1px dashed rgba(225, 238, 255, 0.55); }
.ikey-mark { width: 9px; height: 9px; margin: 0 2px; transform: rotate(45deg); border: 2px solid var(--viz-2); }
.legend-band { height: 8px; opacity: 0.35; border-radius: 2px; }
.legend-note { color: var(--sf-text-3); }

/* A win rate in a table: the figure, then its range on a bar from 30 to 70 % (the 50 % line dashed, faint ticks at 40 and
   60 %). Under the page's minimum it is dimmed: the flag says why. */
.win-cell { display: inline-flex; align-items: center; gap: 12px; }
.win-figure { min-width: 36px; text-align: right; font-weight: 600; }
.win-cell.is-few .win-figure { color: var(--sf-text-3); font-weight: 500; }
.win-cell.is-few .ibar { opacity: 0.5; }
.ibar { position: relative; display: inline-block; flex: none; width: 112px; height: 16px; background: linear-gradient(var(--viz-grid), var(--viz-grid)) center / 100% 1px no-repeat; }
.ibar-zoom { width: 164px; }
.ibar-tick { position: absolute; top: 3px; bottom: 3px; width: 1px; background: rgba(120, 160, 230, 0.22); }
.ibar .ichart-dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; box-shadow: 0 0 0 1.5px var(--sf-panel); }
.ibar .ichart-mark { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-width: 1.5px; }
/* A flagged row's bar in a table: its point and range in the flag's ember or violet, as the chart's rows. */
.ibar.is-over .ichart-dot { background: rgb(var(--flag-strong-rgb)); }
.ibar.is-over .ichart-whisker { background: rgba(var(--flag-strong-rgb), 0.7); }
.ibar.is-under .ichart-dot { background: rgb(var(--flag-weak-rgb)); }
.ibar.is-under .ichart-whisker { background: rgba(var(--flag-weak-rgb), 0.7); }
/* In a table the own-rate line reaches past the bar to the row's edges (a dense row with a card's art is 48 px, the bar
   16), so the same line in every row is one line down the column. */
.ibar .ichart-own { top: -16px; bottom: -16px; border-left-width: 1.5px; }
.ibar .ichart-whisker::before, .ibar .ichart-whisker::after { top: -3px; height: 8px; width: 1.5px; }
.chart-band { fill: var(--c); opacity: 0.16; }
.chart-band-tick { stroke: var(--c); stroke-width: 3; opacity: 0.3; }
/* Today's day, still under way: an outlined bar, a dashed last segment on a hollow point. */
.chart-bar-partial { fill-opacity: 0.22; stroke: var(--c); stroke-width: 1.5; stroke-dasharray: 3 2; }
.chart-line-partial { stroke-dasharray: 4 4; }
.chart-dot-partial { fill: var(--sf-panel); stroke: var(--c); stroke-width: 2; }

/* Cards: the art beside the name (a tile with a retired card's initials when there is none). A flagship has no picture:
   its name and its class under it, as tall as a card's row. */
.art-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.card-art { display: block; flex: none; object-fit: cover; border-radius: 3px; border: 1px solid var(--sf-line-strong); background: var(--sf-inset); }
.card-art-sm { width: 28px; height: 35px; }
.card-art-lg { width: 80px; height: 100px; border-radius: 4px; box-shadow: 0 0 22px rgba(var(--sf-accent-rgb), 0.14); }
.card-art-none { display: grid; place-items: center; color: var(--sf-text-3); font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: 0.04em; }
.card-art-lg.card-art-none { font-size: 22px; }
.flagship-cell { min-height: 35px; align-content: center; }
/* A table's flexible column (the Flagships table's names): it takes the slack, the figures keep their widths. */
.table th.col-flex, .table td.col-flex { min-width: 220px; }
/* A card's page: its art beside what it is. */
.card-head-body { display: flex; align-items: center; gap: var(--sp-6); }
.card-head-facts { flex: 1; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* Its recorded battles: by level across the card, then the two lists of cards side by side, then what the diamond is. */
.drill-level { padding-bottom: var(--sp-3); }
.drill-level > .ichart { padding: 0 var(--sp-5); }
.drill-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--sf-line-strong); }
.drill-pairs > .table-group + .table-group { border-top: 0; border-left: 1px solid var(--sf-line); }
.drill-note { padding: 10px var(--sp-5) 14px; border-top: 1px solid var(--sf-line); }
/* Battle stats: how they ended, a group's row then its reasons, each with its share as a bar. */
.endings-table .row-group td { background: rgba(120, 160, 230, 0.05); }
.endings-table .row-group .cell-sub { font-size: var(--fs-xs); }
.ending-reason { display: inline-block; padding-left: 18px; color: var(--sf-text-2); }
.share-cell { display: inline-flex; align-items: center; gap: 12px; }
.share-cell > .num { min-width: 48px; text-align: right; }
.share-bar { position: relative; display: inline-block; width: 180px; height: 6px; border-radius: 3px; background: var(--viz-grid); overflow: hidden; }
.share-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--viz-1); }
.endings-table .row-group .share-fill { background: rgba(225, 238, 255, 0.55); }
/* AI fairness by arena: each cell the rate won and its battles, coloured by how far it landed from the aim (above in
   ember, below in violet, the flags' own pair; a second step further), dashed and fainter under the API's minimum, grey
   figures without a colour under 10 battles; the key above the table (the colours as chips, the rest as notes). The
   figures keep 4.5:1 on every fill. */
.ai-cell { --h: 120, 160, 230; justify-items: end; padding: 2px 6px; border: 1px solid transparent; border-radius: 3px; }
.heat-up-1, .heat-up-2 { --h: var(--flag-strong-rgb); }
.heat-down-1, .heat-down-2 { --h: var(--flag-weak-rgb); }
.heat-up-1, .heat-down-1 { background: rgba(var(--h), 0.34); }
.heat-up-2, .heat-down-2 { background: rgba(var(--h), 0.58); }
.heat-even { background: rgba(120, 160, 230, 0.08); }
.heat-up-1.heat-light, .heat-down-1.heat-light { background: rgba(var(--h), 0.17); }
.heat-up-2.heat-light, .heat-down-2.heat-light { background: rgba(var(--h), 0.29); }
.heat-even.heat-light { background: rgba(120, 160, 230, 0.04); }
.ai-cell.heat-light { border-style: dashed; border-color: rgba(var(--h), 0.7); }
.ai-cell .cell-sub { color: rgba(225, 238, 255, 0.85); }
.ai-cell.heat-up-2 .cell-sub, .ai-cell.heat-down-2 .cell-sub { color: var(--sf-text); }
.heat-few, .heat-few > .num, .ai-cell.heat-few .cell-sub { color: var(--sf-text-3); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0; list-style: none; }
.heat-key { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 3px; font-size: var(--fs-xs); color: var(--sf-text); }
.heat-note { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: var(--fs-xs); color: var(--sf-text-3); }
.heat-swatch { display: inline-block; width: 18px; height: 14px; border: 1px dashed rgba(225, 238, 255, 0.6); border-radius: 3px; }
/* Player stats' new accounts: newest first, who came back as "n of N · %" (a share of under 10 accounts greyed), a
   weighted total under them. */
.cohort-table td, .cohort-table th { white-space: nowrap; }
.back-cell { display: inline-flex; align-items: baseline; gap: 8px; }
.back-count { color: var(--sf-text-3); font-size: var(--fs-xs); }
.back-rate { min-width: 40px; text-align: right; font-weight: 600; }
.back-rate.is-small { color: var(--sf-text-3); font-weight: 500; }
.not-yet { font-size: var(--fs-xs); letter-spacing: 0.02em; }
.table .row-total td { font-weight: 600; border-top: 1px solid var(--sf-line-strong); background: rgba(3, 6, 16, 0.3); }
/* A view that didn't load again: what was on screen stays, dimmed, under a band that says so (components/game-section.js). */
.stale-note { margin-bottom: var(--sp-4); }
.is-stale > :not(.stale-note) { opacity: 0.5; transition: opacity 0.2s; }
/* The Fill from replays dialog: a lead line and three short points. */
.intro-lead { margin: 0 0 6px; color: var(--sf-text); }
.intro-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--sf-text-2); }

/* =========================================================================================== pages: live ops */

/* Maintenance, Live settings, Broadcasts (phase E): their sections in one column, the page's gap apart. */
.live-body { display: grid; gap: var(--sp-5); min-width: 0; }
/* "Overridden live: 800 ms" by a launch or boot value (Config, Launch settings): a quiet link to Live settings. */
.live-mark {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 2px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--sf-flux);
}
.live-mark:hover { text-decoration: underline; text-underline-offset: 3px; }
.live-ignored { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); color: var(--sf-warn); }
.live-ignored .sf-icon { margin-top: 2px; flex: none; }
.live-stored { color: var(--sf-warn); }
.table .row-warn td:first-child { box-shadow: inset 2px 0 0 var(--sf-warn); }
.live-more { justify-content: space-between; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-5); }
.table-note { margin: 0; padding: 10px var(--sp-5) 12px; border-top: 1px solid var(--sf-line); }
.table .row-below td { background: rgba(var(--sf-warn-rgb), 0.06); }
/* A broadcast's body in a player's Notices tab, with its line breaks. */
.notice-body { white-space: pre-line; color: var(--sf-text-2); }
/* In a sentence or a fact a time never parts at a line's end ("03:14 EDT", "Oct 13 01:52"); tables keep their own rule. */
.banner time, .facts time, .sum time, .live-body .cell-stack time { white-space: nowrap; }
/* A setting's name and a value with its unit as written, inside an uppercased title or button ("CHANGE BotFillMinMs"). */
.key-name, .as-is { text-transform: none; letter-spacing: 0; }
.key-name { font-family: var(--font-mono); font-size: 0.92em; font-weight: 600; }
/* An audit row that changed nothing ("off → off"). */
.table .row-muted td { opacity: 0.55; }
.audit-folded { justify-content: center; padding: 8px var(--sp-5); }
.audit-folded.is-alone { border-top: 0; padding: 14px var(--sp-5); }
/* A long basis: its sentence, then the counted line. */
.basis-lines { display: grid; gap: 2px; }

/* "What happens" in a dangerous confirmation (components/summary.js): large figures, a callout, two columns of facts. */
.sum { display: grid; gap: 10px; padding: 4px 0 6px; }
/* The figures' dividers are each one's hairline on its left and top, clipped at the box: a row that wraps short leaves
   no lit empty cell. */
.sum-figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden;
  border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgb(9, 15, 32);
}
.sum-fig { display: grid; gap: 3px; align-content: start; min-width: 0; padding: 10px 12px 11px; box-shadow: -1px -1px 0 var(--sf-line); }
.sum-fig-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.sum-fig-value { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.2; color: var(--sf-text); overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.sum-fig-value .mono { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.sum-fig-wide { grid-column: span 2; }
.sum-fig-full { grid-column: 1 / -1; }
.sum-figures:has(> .sum-fig-full) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* A phone's dialog: two to a row (a third of about 340 px wraps a 21 px "Not offered"). */
@media (max-width: 480px) {
  .sum-figures:has(> .sum-fig-full) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sum-release { display: grid; gap: 2px; }
.sum-release .mono:first-child { font-size: 19px; }
.sum-fig-value .sum-id { font-size: 11.5px; font-weight: 500; color: var(--sf-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-fig-sub .nowrap { white-space: nowrap; }
/* A figure's unit, small after it ("3,500 crystals"); several amounts side by side, each kept whole. */
.sum-unit { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--sf-text-2); }
.sum-amounts { display: flex; flex-wrap: wrap; gap: 0 12px; }
.sum-amount { white-space: nowrap; }
.sum-fig-sub { font-size: var(--fs-xs); line-height: 1.35; color: var(--sf-text-3); }
.sum-fig[data-tone="warn"] .sum-fig-value { color: var(--sf-warn); }
.sum-fig[data-tone="danger"] .sum-fig-value { color: var(--sf-danger); }
.sum-none { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-md); color: var(--sf-text-2); }
.sum-callout {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid rgba(var(--sf-warn-rgb), 0.5); background: rgba(var(--sf-warn-rgb), 0.08); color: var(--sf-text);
}
.sum-callout > .sf-icon { flex: none; margin-top: 2px; color: var(--sf-warn); }
.sum-callout[data-tone="danger"] { border-color: rgba(var(--sf-danger-rgb), 0.5); background: rgba(var(--sf-danger-rgb), 0.08); }
.sum-callout[data-tone="danger"] > .sf-icon { color: var(--sf-danger); }
.sum-callout-title { font-weight: 600; color: var(--sf-warn); }
.sum-callout-text { font-size: var(--fs-sm); color: var(--sf-text); }
.dialog-preview .sum-grid, .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sum-grid .fact { padding: 7px var(--sp-4) 7px 0; }
/* A gift per player: a crystal, a coin or a pod in its tier's colour, with its amount. */
.gift-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gift-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; border-radius: 999px;
  border: 1px solid var(--sf-line-strong); background: rgba(3, 6, 16, 0.5);
  font-family: var(--font-body); font-size: var(--fs-md); font-weight: 600; white-space: nowrap;
}
.gift-chip-name { font-weight: 400; color: var(--sf-text-2); }
.gift-chip-art { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.gift-chip-crystals .gift-chip-art { clip-path: polygon(50% 100%, 0 36%, 22% 0, 78% 0, 100% 36%); background: linear-gradient(135deg, rgb(200, 248, 255), rgb(96, 204, 255) 40%, rgb(44, 116, 232)); }
.gift-chip-credits .gift-chip-art { border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgb(255, 238, 168), rgb(250, 190, 52) 50%, rgb(200, 120, 20)); }
.gift-chip-pod .gift-chip-art { --pod: 200, 210, 228; border-radius: 5px; color: rgb(20, 16, 30); background: rgba(var(--pod), 0.9); }
.gift-chip-bronze .gift-chip-art { --pod: 214, 140, 70; }
.gift-chip-gold .gift-chip-art { --pod: 255, 200, 72; }
.gift-chip-stellar .gift-chip-art { --pod: 196, 146, 255; }

/* Maintenance. */
.mt-state.is-on { border-color: rgba(var(--st-maintenance), 0.45); box-shadow: 0 0 0 1px rgba(var(--st-maintenance), 0.12), 0 10px 30px rgba(0, 0, 0, 0.18); }
.mt-headline { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-lg); color: var(--sf-text); }
.mt-headline .badge { height: 24px; font-size: 14px; padding: 0 9px; }
/* The ETA and the end, each a choice and its minutes: the minutes fields line up in one column. */
.mt-pair { display: grid; grid-template-columns: minmax(0, 380px) 170px; justify-content: start; gap: var(--sp-3); align-items: end; }
.mt-consequence { margin: 4px 0 8px; color: var(--sf-text); }
.mt-phones .phone { --pp-w: 236px; }
/* The phones beside the QA accounts: the phones' card takes the room two of them need side by side, and the phones scale
   with it (a container's width: down to 180 px each) rather than stack. */
.mt-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.mt-phones-card .pp-figure { container-type: inline-size; }
.mt-phones-card .pp-row { flex-wrap: nowrap; }
.mt-phones-card .phone { --pp-w: clamp(180px, calc((100cqi - var(--sp-5)) / 2), 264px); }
/* A deploy with maintenance ticked: its figure in the maintenance tone. */
.mt-fig.is-on { color: var(--sf-warn); }
/* The way back in (the command line), under the page: what to do, the two lines to type, and what to check. */
.mt-cli { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: var(--fs-sm); color: var(--sf-text-3); }
.mt-cli > .sf-icon { flex: none; margin-top: 3px; }
.mt-cli-body { display: grid; gap: 6px; min-width: 0; }
.mt-cli-body p { margin: 0; }
.mt-cli-lines {
  margin: 0; padding: 8px 10px; border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgb(9, 15, 32);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.mt-cli code { color: var(--sf-text-2); }
.qa-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Broadcasts: the composer is a card on the page, its fields beside the phone and the estimate. */
.composer-slot:empty { display: none; }
.composer { border-color: rgba(var(--sf-accent-rgb), 0.4); }
.bc-compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-6); align-items: start; }
.bc-fields { display: grid; gap: var(--sp-4); min-width: 0; }
.bc-section { display: grid; gap: var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--sf-line); }
.bc-window { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3) var(--sp-4); }
/* A choice and its number side by side ("Active recently" and its days); a number field at a number's width. */
.bc-inline { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3) var(--sp-4); }
.field.bc-num { width: 150px; }
.bc-big.is-none { color: var(--sf-warn); font-size: 15px; }
.bc-aside { display: grid; gap: var(--sp-4); justify-items: stretch; position: sticky; top: calc(var(--top-h) + 16px); }
.bc-phone .pp-figure { justify-items: center; }
/* The notice at 1.2 times the connection screens (its text was 7-9 px). */
.phone.phone-notice { --pp-w: 316px; }
.bc-weigh { display: grid; gap: 6px; padding: 10px 14px 12px; border: 1px solid var(--sf-line); border-radius: var(--radius); background: rgba(3, 6, 16, 0.45); }
.bc-weigh .facts-list .fact { grid-template-columns: minmax(0, 1fr) auto; }
.bc-weigh .facts-list .fact dd { text-align: right; }
.bc-big { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.bc-caps { margin-top: 4px; }
.bc-actions { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--sf-line); }
.bc-plan { margin: 0; font-size: var(--fs-sm); color: var(--sf-text-2); }
.bc-plan[data-tone="warn"] { color: var(--sf-warn); }
p.bc-plan[data-tone="warn"] { padding: 9px 12px; border: 1px solid rgba(var(--sf-warn-rgb), 0.4); border-radius: var(--radius); background: rgba(var(--sf-warn-rgb), 0.07); }
.bc-actions p.bc-plan[data-tone="warn"] { padding: 0; border: 0; background: none; }
.bc-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-5); align-items: start; }
.bc-reach-wrap { container-type: inline-size; }
.bc-reach { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.bc-reach .sum-fig-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 620px) {
  .bc-reach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The broadcasts list at 1280: the title, the gift and the audience each keep a readable width. */
.table th.bc-col-title, .table td.bc-col-title { min-width: 170px; }
.table th.bc-col-text, .table td.bc-col-text { min-width: 150px; }
.table th.bc-col-audience, .table td.bc-col-audience { min-width: 175px; }
/* Live settings: the setting's column keeps room for its description; its rule is one line. */
.table th.col-setting, .table td.col-setting { min-width: 300px; }
.table td.col-actions .cell-actions { flex-wrap: nowrap; }
.rule-chip {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin-top: 4px; padding: 1px 8px;
  border: 1px solid var(--sf-line-strong); border-radius: 999px; font-size: var(--fs-xs); color: var(--sf-text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rule-chip-k { font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }

/* A phone, drawn small: the game's popups from the tokens (components/phone-preview.js). Sizes are in em of the
   phone's own font size, a 24th of its width, so one --pp-w scales the whole of it. */
.pp-figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.pp-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--sp-5); }
.pp-item { display: grid; gap: 8px; justify-items: center; }
.pp-label { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sf-text-3); }
.pp-captions { display: grid; gap: 4px; max-width: 520px; text-align: center; font-size: var(--fs-xs); color: var(--sf-text-3); }
.pp-note { color: var(--sf-text-2); font-size: var(--fs-sm); }
.phone {
  --pp-w: 264px; --pp-gold: rgb(255, 200, 72); --pp-text: rgb(214, 226, 246); --pp-dim: rgb(143, 163, 192);
  flex: none; width: var(--pp-w); aspect-ratio: 9 / 18.5; padding: calc(var(--pp-w) * 0.026); border-radius: calc(var(--pp-w) * 0.12);
  font-size: calc(var(--pp-w) / 24);
  background: linear-gradient(160deg, rgb(58, 66, 88), rgb(16, 20, 32) 38%, rgb(34, 40, 58));
  box-shadow: 0 0 0 1px rgba(150, 170, 210, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.55);
}
.phone-screen {
  position: relative; height: 100%; overflow: hidden; border-radius: calc(var(--pp-w) * 0.095);
  display: flex; flex-direction: column; align-items: center; padding: 0 0.9em;
  background: rgb(3, 5, 12);
}
/* The loading screen's key art, as a glow: the connection dialogs sit on it under the game's name. */
.phone-connect .phone-screen {
  background:
    radial-gradient(90% 45% at 15% 72%, rgba(170, 70, 30, 0.38), transparent 70%),
    radial-gradient(70% 40% at 85% 28%, rgba(60, 120, 210, 0.22), transparent 70%),
    linear-gradient(180deg, rgb(8, 12, 26), rgb(4, 6, 14));
}
/* The game's name on top, the dialog in the middle of the screen (as on the phone). */
.pp-wordmark { position: absolute; top: 2.4em; left: 0; right: 0; display: grid; justify-items: center; line-height: 1; font-family: var(--font-display); font-weight: 700; }
.pp-wordmark span:first-child {
  font-size: 2.15em; letter-spacing: 0.03em; color: rgb(214, 222, 238);
  background: linear-gradient(180deg, rgb(236, 242, 252) 10%, rgb(150, 162, 186) 58%, rgb(226, 160, 80) 92%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pp-wordmark span:last-child { margin-top: 0.2em; padding: 0.15em 0.75em; font-size: 0.95em; letter-spacing: 0.36em; color: rgb(140, 196, 255); border: 1px solid rgba(140, 196, 255, 0.5); }
/* The Home screen the notices open over, dim: a nebula, the top bar's resources, the arena, BATTLE and the nav bar as
   silhouettes, under the app's scrim. */
.phone-notice .phone-screen {
  background:
    radial-gradient(70% 40% at 25% 30%, rgba(120, 60, 200, 0.35), transparent 70%),
    radial-gradient(60% 35% at 80% 62%, rgba(40, 120, 210, 0.3), transparent 70%),
    linear-gradient(180deg, rgb(10, 14, 32), rgb(5, 8, 18));
}
.pp-hud { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; padding: 1.2em 0.9em 0.9em; }
.pp-hud-top { justify-self: stretch; display: flex; align-items: center; gap: 0.5em; }
.pp-hud-chip { width: 4.6em; height: 1.3em; border-radius: 0.7em; background: rgba(150, 175, 225, 0.32); }
.pp-hud-dot { width: 1.6em; height: 1.6em; margin-left: auto; border-radius: 50%; background: rgba(150, 175, 225, 0.32); }
.pp-hud-arena { align-self: center; width: 11em; height: 11em; border-radius: 50%; background: radial-gradient(circle at 38% 32%, rgba(190, 140, 255, 0.5), rgba(70, 50, 140, 0.35) 55%, transparent 72%); }
.pp-hud-battle { width: 9em; height: 2.6em; margin-bottom: 1.4em; border-radius: 0.45em; background: rgba(255, 200, 72, 0.45); }
.pp-hud-nav { justify-self: stretch; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4em; }
.pp-hud-nav span { height: 2.4em; border-radius: 0.4em; background: rgba(150, 175, 225, 0.22); }
.pp-scrim { position: absolute; inset: 0; background: rgba(2, 4, 12, 0.68); }
.phone-notice .pp-dialog { z-index: 1; }
/* What is typed can't be sent as it is: greyed, under amber stripes. */
.phone.is-invalid .phone-screen > * { filter: grayscale(1) brightness(0.72); }
.phone.is-invalid .phone-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(var(--sf-warn-rgb), 0.12) 0 0.6em, transparent 0.6em 1.2em);
}
/* Withdrawn or ended: nobody can collect it now. */
.phone.is-over .pp-dialog { border-color: rgba(150, 170, 210, 0.45); }
.phone.is-over .pp-dialog > :not(.pp-stamp) { filter: grayscale(0.8); opacity: 0.5; }
.pp-stamp {
  position: absolute; top: -1.45em; right: -0.55em; z-index: 3; transform: rotate(6deg);
  padding: 0.3em 0.8em; border-radius: 0.3em; border: 0.12em solid rgba(220, 230, 250, 0.75); background: rgb(10, 16, 32);
  box-shadow: 0 0.3em 0.8em rgba(0, 0, 0, 0.6);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1em; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(230, 238, 252);
}
.phone-screen { justify-content: center; }
.pp-dialog {
  position: relative; z-index: 1; width: 100%; margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.15em 0.95em 1.05em; border-radius: 0.45em;
  background: linear-gradient(180deg, rgb(21, 33, 66), rgb(12, 20, 44));
  border: 0.15em solid rgb(150, 170, 210);
  box-shadow: inset 0 0 0 0.12em rgba(8, 14, 30, 0.9), 0 0.6em 1.6em rgba(0, 0, 0, 0.6);
  font-family: var(--font-display); font-weight: 600; color: var(--pp-text);
}
.pp-title {
  align-self: stretch; margin-bottom: 0.65em; padding: 0 0.3em 0.5em; border-bottom: 0.11em solid rgba(255, 198, 70, 0.45);
  font-weight: 700; font-size: 1.2em; line-height: 1.15; letter-spacing: 0.04em; color: var(--pp-gold);
  text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.6); overflow-wrap: anywhere;
}
.pp-body { align-self: stretch; font-size: 1em; line-height: 1.35; text-align: left; white-space: pre-line; text-wrap-style: balance; overflow-wrap: anywhere; }
.pp-body.is-centred { text-align: center; }
.pp-buttons { align-self: stretch; display: grid; gap: 0.55em; margin-top: 1.1em; padding: 0 0.5em; }
.pp-notice .pp-buttons { padding: 0 24%; }
.pp-btn {
  display: grid; place-items: center; height: 2.55em; border-radius: 0.35em;
  font-weight: 700; font-size: 1.12em; letter-spacing: 0.08em; color: rgb(24, 16, 4);
  box-shadow: inset 0 0.12em 0 rgba(255, 255, 255, 0.45), 0 0.18em 0 rgba(0, 0, 0, 0.45);
}
.pp-btn-gold { background: linear-gradient(180deg, rgb(255, 216, 108), rgb(242, 168, 38)); }
.pp-btn-blue { background: linear-gradient(180deg, rgb(124, 184, 255), rgb(52, 112, 230)); color: rgb(8, 14, 34); }
.pp-countdown { margin-top: 0.75em; font-size: 0.8em; color: var(--pp-dim); }
/* UNDER MAINTENANCE: two meshing gears turning opposite ways, then the ETA's lead and gold hero over its time. */
.pp-gears { position: relative; flex: none; width: 5em; height: 3.6em; margin-bottom: 0.35em; color: rgb(255, 185, 40); }
.pp-gear { position: absolute; display: grid; }
.pp-gear-big { left: 0.15em; top: 0.4em; animation: pp-turn 18s linear infinite; }
.pp-gear-big .sf-icon { width: 3.2em; height: 3.2em; }
.pp-gear-small { left: 2.85em; top: 0; animation: pp-turn-back 11.6s linear infinite; }
.pp-gear-small .sf-icon { width: 2.1em; height: 2.1em; }
@keyframes pp-turn { to { transform: rotate(360deg); } }
@keyframes pp-turn-back { to { transform: rotate(-360deg); } }
.pp-eta { display: grid; justify-items: center; gap: 0.15em; margin-top: 0.85em; }
.pp-eta-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 0.35em; font-weight: 700; letter-spacing: 0.04em; }
.pp-eta-lead { font-size: 1.1em; color: var(--pp-text); }
.pp-eta-hero { font-size: 1.45em; color: var(--pp-gold); text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.6); }
.pp-eta-time { font-size: 0.82em; color: var(--pp-dim); }
/* An older app's CAN'T REACH THE SERVER: a struck-through globe stands in for its signal icon. */
.pp-offline { position: relative; display: grid; margin-bottom: 0.5em; color: rgb(255, 96, 84); }
.pp-offline .sf-icon { width: 2.5em; height: 2.5em; }
.pp-offline::after { content: ""; position: absolute; left: 50%; top: 50%; width: 125%; height: 0.15em; border-radius: 1em; background: currentColor; transform: translate(-50%, -50%) rotate(-45deg); }
/* UPDATE REQUIRED: the app's icon (a flagship stands in) with a green "update" badge. */
.pp-app {
  position: relative; display: grid; place-items: center; width: 3.5em; height: 3.5em; margin: 0.1em 0 0.85em; border-radius: 0.8em;
  border: 0.12em solid rgb(150, 170, 210); background: radial-gradient(circle at 40% 30%, rgb(44, 96, 158), rgb(10, 20, 44)); color: rgb(232, 240, 255);
}
.pp-app > .sf-icon { width: 2.2em; height: 2.2em; }
.pp-app-badge { position: absolute; right: -0.55em; bottom: -0.35em; display: grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 50%; background: rgb(46, 168, 96); border: 0.12em solid rgb(200, 240, 212); color: #fff; }
.pp-app-badge .sf-icon { width: 1em; height: 1em; }
/* A broadcast's gift: one gift leads with its picture on turning rays; two or more are tiles (picture, amount, name). */
.pp-kind-crystals { --ray: 80, 220, 255; }
.pp-kind-credits { --ray: 255, 200, 72; }
.pp-kind-pod { --ray: 255, 230, 170; }
.pp-rays {
  position: absolute; left: 50%; top: 50%; width: 5.4em; height: 5.4em; margin: -2.7em 0 0 -2.7em; border-radius: 50%;
  background: repeating-conic-gradient(rgba(var(--ray), 0.55) 0deg 8deg, transparent 8deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 68%); mask-image: radial-gradient(circle, #000 15%, transparent 68%);
  animation: pp-turn 30s linear infinite;
}
.pp-hero { position: relative; flex: none; display: grid; place-items: center; width: 6em; height: 5em; margin: -0.3em 0 0.35em; }
.pp-hero .pp-rays { width: 8em; height: 8em; margin: -4em 0 0 -4em; }
.pp-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35em 0.5em; margin-top: 0.85em; }
.pp-tile { display: grid; justify-items: center; min-width: 5.2em; }
.pp-tile-art { position: relative; display: grid; place-items: center; width: 4em; height: 3.3em; }
.pp-amount { margin-top: 0.1em; font-weight: 700; font-size: 1.5em; line-height: 1.1; letter-spacing: 0.02em; color: var(--pp-text); text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.85); }
.pp-tile.is-bare .pp-amount { margin-top: 0; }
.pp-kind-crystals .pp-amount { color: rgb(96, 214, 255); }
.pp-kind-credits .pp-amount { color: var(--pp-gold); }
.pp-tile-name { font-weight: 700; font-size: 0.72em; letter-spacing: 0.1em; color: rgb(170, 186, 214); }
.pp-gem, .pp-coin, .pp-pod { position: relative; z-index: 1; }
.pp-gem {
  width: 2.2em; height: 1.85em; clip-path: polygon(50% 100%, 0 36%, 22% 0, 78% 0, 100% 36%);
  background: linear-gradient(135deg, rgb(200, 248, 255) 0%, rgb(96, 204, 255) 34%, rgb(44, 116, 232) 68%, rgb(28, 58, 170) 100%);
}
.pp-coin {
  width: 2em; height: 2em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgb(255, 238, 168), rgb(250, 190, 52) 45%, rgb(200, 120, 20));
  box-shadow: inset 0 0 0 0.15em rgba(140, 80, 0, 0.55), 0 0 0.6em rgba(255, 190, 60, 0.4);
}
.pp-coin::after { content: ""; position: absolute; inset: 27%; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); background: rgba(150, 88, 0, 0.55); }
.pp-pod { --pod: 200, 210, 225; display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 0.55em; color: rgb(20, 16, 30);
  background: linear-gradient(180deg, rgba(var(--pod), 0.95), rgba(var(--pod), 0.5)); box-shadow: 0 0 0.6em rgba(var(--pod), 0.45); }
.pp-pod .sf-icon { width: 1.45em; height: 1.45em; }
.pp-pod-bronze { --pod: 214, 140, 70; }
.pp-pod-silver { --pod: 200, 210, 228; }
.pp-pod-gold { --pod: 255, 200, 72; }
.pp-pod-stellar { --pod: 196, 146, 255; }
.pp-hero .pp-gem { width: 3.4em; height: 2.85em; }
.pp-hero .pp-coin { width: 3.1em; height: 3.1em; }
.pp-hero .pp-pod { width: 3.2em; height: 3.2em; }
.pp-hero .pp-pod .sf-icon { width: 2.1em; height: 2.1em; }

/* =========================================================================================== responsive */

@media (max-width: 1440px) {
  .main { padding: var(--sp-5) var(--sp-6) 48px; }
  .tab { padding: 0 11px; letter-spacing: 0.1em; }
  .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  /* The icon rail (with its tooltips) is the nav here; the menu button is for a phone, where the rail goes away. */
  .shell { grid-template-columns: var(--nav-rail) minmax(0, 1fr); }
  .brand { min-width: 0; }
  .sidenav { padding: var(--sp-4) 8px; gap: var(--sp-3); overflow: visible; }
  /* The rail doesn't scroll (its tooltips reach past it): no fade. */
  .sidenav.has-more-below, .sidenav.has-more-above { -webkit-mask-image: none; mask-image: none; }
  .nav-group-label, .nav-text, .nav-foot { display: none; }
  .nav-group + .nav-group { border-top: 1px solid var(--sf-line); padding-top: var(--sp-3); }
  .nav-link { justify-content: center; padding: 0; height: 42px; }
  .nav-link[aria-current="page"]::before { left: -8px; }
  .nav-link[data-tip]:hover::after {
    display: block; left: calc(100% + 10px); bottom: auto; top: 50%; transform: translateY(-50%);
    font-family: var(--font-body); font-size: 12.5px;
  }
  .shell.nav-open .sidenav {
    width: var(--nav-w); box-shadow: var(--shadow); background: rgb(8, 13, 29); padding: var(--sp-4) var(--sp-3);
  }
  .shell.nav-open .nav-text, .shell.nav-open .nav-foot { display: block; }
  .shell.nav-open .nav-group-label { display: flex; }
  .shell.nav-open .nav-link { justify-content: flex-start; padding: 0 12px; }
  .shell.nav-open .nav-link[data-tip]:hover::after { display: none; }
  .shell.nav-open .nav-group + .nav-group { border-top: 0; padding-top: 0; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: minmax(0, 1fr) auto; }
  .strip-facts { grid-column: 1 / -1; grid-row: 2; padding-left: 0; border-left: 0; }
  .op-grid { grid-template-columns: minmax(0, 1fr); }
  /* The composer's phone and estimate go under its fields; a broadcast's phone under its figures. */
  .bc-compose, .bc-detail, .mt-grid { grid-template-columns: minmax(0, 1fr); }
  .bc-aside { position: static; }
}

@media (max-width: 1000px) {
  .wz-pick { grid-template-columns: minmax(0, 1fr); }
  .wz-left { order: 1; padding-right: 0; }
  .wz-right { order: 2; padding-left: 0; border-left: 0; }
  /* The search stays: narrower, without its "/" hint. */
  .topsearch { flex-basis: 180px; }
  .topsearch-key { display: none; }
  .srv-meta { display: none; }
  .main { padding: var(--sp-4) var(--sp-4) 40px; }
  .grid-2, .grid-3, .overview-bottom, .drill-pairs { grid-template-columns: minmax(0, 1fr); }
  .drill-pairs > .table-group + .table-group { border-left: 0; border-top: 1px solid var(--sf-line); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ichart-row { grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 120px; column-gap: var(--sp-3); }
  .ichart-has-side .ichart-row { grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 110px 64px; }
  .config-groups { grid-template-columns: minmax(0, 1fr); }
  .player-filters { grid-template-columns: minmax(0, 1fr); }
  .op-menu-label { display: none; }
  .page-title { font-size: 23px; }
}

/* A phone: the top bar keeps the menu, the mark, the server's state, the time zone and the operator's avatar. */
@media (max-width: 560px) {
  .topbar { gap: var(--sp-2); padding: 0 var(--sp-3) 0 var(--sp-2); }
  .topbar-right { gap: var(--sp-2); }
  .brand-text, .op-menu-btn > .badge { display: none; }
  .kpi { padding-left: 14px; padding-right: 14px; }
  .feed-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .grant-pods, .seat-card .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-window, .mt-pair { grid-template-columns: minmax(0, 1fr); }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-step:nth-child(2)::before { display: none; }
  /* An interval chart keeps its label, track and figure (and a side number, never cut); the row's battles are in its
     sentence and its table. A row without a value still says so, in place of its dash. */
  .ichart-row, .ichart-compact .ichart-row { grid-template-columns: 84px minmax(0, 1fr) 56px; column-gap: var(--sp-2); }
  .ichart-has-side .ichart-row { grid-template-columns: 84px minmax(0, 1fr) 52px 44px; }
  .ichart-side-head { font-size: 10px; letter-spacing: 0.02em; }
  .ichart-aside { display: none; }
  .ichart-row.is-none .ichart-figure { display: none; }
  .ichart-row.is-none .ichart-aside.ichart-none { display: block; overflow: visible; text-align: right; }
  .card-head-body { flex-direction: column; align-items: flex-start; }
  .ph-danger, .ph-locked { border-left: 0; padding-left: 0; }
  .recovery-value { font-size: 20px; letter-spacing: 0.12em; }
  /* The control groups wrap onto lines of their own: no dividers at a line's start. */
  .controls { column-gap: var(--sp-2); }
  .control-group, .control-group:first-child, .control-group:last-child { padding: 0; }
  .control-group + .control-group { border-left: 0; }
  /* The wizard's steps are numbered dots; only the current one keeps its name on screen (the others keep theirs for
     screen readers). */
  .wz-step { padding-right: 10px; gap: 8px; }
  .wz-step::after { display: none; }
  .wz-step:not(.is-current) .wz-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* The password window's chip keeps its lock and countdown (the tooltip says what it is). */
  .sudo-label { display: none; }
  /* The search folds into a button; open, it covers the top bar (with its own close button). */
  .topsearch { flex: none; max-width: none; margin-left: auto; }
  .topsearch .topsearch-open { display: inline-grid; }
  .topsearch-box { display: none; }
  .topsearch.is-open .topsearch-box {
    display: flex; position: fixed; left: 8px; right: 8px; top: 8px; height: 40px; z-index: 70; gap: 6px;
    background: rgb(8, 13, 29); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .topbar-right { margin-left: 0; }
  .topsearch.is-open .topsearch-input { height: 40px; padding-right: 10px; flex: 1; min-width: 0; }
  .topsearch.is-open .topsearch-close { display: inline-grid; flex: none; }
  .topsearch.is-open .topsearch-open { display: none; }
  .topsearch.is-open .topsearch-pop { position: fixed; left: 8px; right: 8px; top: 54px; width: auto; max-width: none; }
  /* The menu button opens the nav over the page; no rail beside it. */
  .nav-toggle { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .sidenav { display: none; }
  .shell.nav-open .sidenav {
    display: flex; position: fixed; top: var(--top-h); left: 0; bottom: 0; height: auto; align-self: stretch; width: min(var(--nav-w), 86vw); z-index: 45; overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .status-pill, .badge, .btn { border: 1px solid CanvasText; }
  .chart-line { stroke: CanvasText; }
}
.refund-checked { font-size: var(--fs-sm); }

/* T21: the event screen's preview (the app's WEEKEND EVENT popup): the rule set in the game's violet, the win track's rows. */
.pp-event-name { margin-top: 0.15em; font-family: var(--font-display); font-weight: 700; font-size: 1.35em; letter-spacing: 0.12em; color: rgb(205, 170, 255); }
.pp-event-time { margin-bottom: 0.5em; font-size: 0.8em; font-weight: 700; letter-spacing: 0.06em; color: rgb(110, 220, 255); }
.pp-event-track { align-self: stretch; display: grid; gap: 0.3em; margin-top: 0.7em; }
.pp-event-track-title { font-weight: 700; font-size: 0.85em; letter-spacing: 0.12em; color: var(--pp-gold); }
.pp-event-step { display: grid; grid-template-columns: 1.6em 1fr auto; align-items: center; gap: 0.5em; padding: 0.3em 0.45em; border-radius: 0.35em;
  background: rgba(10, 16, 36, 0.7); font-size: 0.82em; }
.pp-event-wins { display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1px solid rgba(150, 175, 225, 0.6); font-weight: 700; }
.pp-event-goal { color: var(--pp-text); }
.pp-event-reward { font-weight: 700; color: var(--pp-gold); white-space: nowrap; }

/* Player stats' Feature use (iteration 11, T22): Cadet week's steps as bars, the comeback gift's and the Album's figures, the
   weekend events' table. */
.feature-use__grid { gap: var(--sp-4); }
.feature-block { min-width: 0; }
.feature-block__title { margin: 0 0 2px 0; font-size: var(--fs-md, 14px); font-weight: 700; }
.feature-block__sub { margin: 0 0 var(--sp-3) 0; font-size: var(--fs-sm); }
.feature-steps { display: grid; gap: 4px; }
.feature-step { display: grid; grid-template-columns: 52px minmax(0, 1fr) 56px; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.feature-step__bar { height: 8px; border-radius: 4px; background: rgba(var(--sf-accent-rgb), 0.12); overflow: hidden; }
.feature-step__fill { display: block; height: 100%; border-radius: 4px; background: rgba(var(--sf-accent-rgb), 0.75); }
.feature-step__n { text-align: right; }
.feature-epics { margin: var(--sp-3) 0 0 0; font-size: var(--fs-sm); }
.feature-figures { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-figure { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: rgba(var(--sf-accent-rgb), 0.06); }
.feature-figure__value { font-size: 20px; font-weight: 700; }
.feature-figure__label { color: var(--sf-text-3); font-size: var(--fs-sm); }
.feature-events td .muted { white-space: nowrap; }
.feature-use__capped { margin: 0 0 var(--sp-3) 0; }
.feature-figure__note { font-size: var(--fs-sm); }
