@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Overpass Mono"; src: url("../fonts/overpass-mono-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

/* RhudMOD track.
   Palette from the game's own stone: deepslate panels, calcite text (and a calcite light theme), copper for
   whatever is selected or clickable, verdigris for "live / healthy", glowstone amber for warnings, redstone for
   danger. Flat surfaces and hairline rules; colour only where it means something. Type is Overpass (drawn from US
   highway-sign lettering) with Overpass Mono for every coordinate, count and clock - both hosted in public/fonts,
   since the CSP lets nothing external load. */

:root {
  color-scheme: dark;
  --bg: #121416;
  --panel: #191c1e;
  --raised: #202427;
  --sunken: #0e1012;
  --line: #2c3135;
  --line-strong: #40464b;
  --ink: #e2e1da;
  --ink-2: #b4b5ad;
  --muted: #878c88;
  --accent: #d08b5f;
  --accent-ink: #1b0f07;
  --accent-soft: rgb(208 139 95 / .12);
  --verdigris: #6fb39b;
  --amber: #e8b33f;
  --amber-soft: rgb(232 179 63 / .14);
  --red: #e2564a;
  --red-soft: rgb(226 86 74 / .14);
  --focus: #e7a272;
  --map-bg: #10151a;
  --map-grid: rgb(170 190 200 / .07);
  --map-grid-major: rgb(170 190 200 / .14);
  --map-axis: rgb(208 139 95 / .4);
  --map-label: rgb(190 205 212 / .55);
  --map-landmark: rgb(210 220 225 / .5);
  --map-halo: rgb(10 14 17 / .85);
  --map-ink: #ecebe4;
  --shadow: 0 8px 22px rgb(0 0 0 / .45);
  --copper: #d08b5f;
  --slot: #2a2e31; --slot-hi: #3d4246; --slot-lo: #141618;

  --font: "Overpass", Bahnschrift, "Segoe UI", system-ui, sans-serif;
  --mono: "Overpass Mono", "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 0;
  --r: 2px;
  --rail: 196px;
  --topbar: 52px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #dcdcd4; --panel: #f1f0ea; --raised: #fbfaf6; --sunken: #e4e3db; --line: #d3d2c9; --line-strong: #b4b3a9;
    --ink: #1d2022; --ink-2: #41474b; --muted: #676c70; --accent: #a3582d; --accent-ink: #ffffff; --accent-soft: rgb(163 88 45 / .1);
    --verdigris: #2f7a62; --amber: #8a5800; --amber-soft: rgb(196 132 20 / .16); --red: #b8291f; --red-soft: rgb(184 41 31 / .1); --focus: #a3582d;
    --map-bg: #eef0eb; --map-grid: rgb(40 60 70 / .08); --map-grid-major: rgb(40 60 70 / .16); --map-axis: rgb(163 88 45 / .45);
    --map-label: rgb(40 55 62 / .62); --map-landmark: rgb(40 55 62 / .55); --map-halo: rgb(245 247 243 / .9); --map-ink: #1d2022;
    --copper: #a3582d; --slot: #c9c8bf; --slot-hi: #e4e3db; --slot-lo: #a6a59c;
    --shadow: 0 6px 18px rgb(30 30 25 / .16);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dcdcd4; --panel: #f1f0ea; --raised: #fbfaf6; --sunken: #e4e3db; --line: #d3d2c9; --line-strong: #b4b3a9;
    --ink: #1d2022; --ink-2: #41474b; --muted: #676c70; --accent: #a3582d; --accent-ink: #ffffff; --accent-soft: rgb(163 88 45 / .1);
    --verdigris: #2f7a62; --amber: #8a5800; --amber-soft: rgb(196 132 20 / .16); --red: #b8291f; --red-soft: rgb(184 41 31 / .1); --focus: #a3582d;
    --map-bg: #eef0eb; --map-grid: rgb(40 60 70 / .08); --map-grid-major: rgb(40 60 70 / .16); --map-axis: rgb(163 88 45 / .45);
    --map-label: rgb(40 55 62 / .62); --map-landmark: rgb(40 55 62 / .55); --map-halo: rgb(245 247 243 / .9); --map-ink: #1d2022;
    --copper: #a3582d; --slot: #c9c8bf; --slot-hi: #e4e3db; --slot-lo: #a6a59c;
    --shadow: 0 6px 18px rgb(30 30 25 / .16);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { accent-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.005em; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; }
.mono, code, kbd, time.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 8px; top: -40px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; border-radius: var(--r); }
.skip:focus { top: 8px; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 11px; color: var(--ink-2); }

.boot { display: grid; place-items: center; align-content: center; gap: 10px; height: 100dvh; color: var(--muted); }
.brand-mark { color: var(--accent); flex: none; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-weight: 500;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--raised); border-color: var(--line); }
.btn--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, var(--line)); background: transparent; }
.btn--danger-armed { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; }
.btn--small { min-height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn--icon { width: 32px; padding: 0; }
.btn--wide { width: 100%; }
.btn svg { width: 14px; height: 14px; fill: currentColor; }

.seg { display: inline-flex; gap: 14px; align-items: flex-end; }
.seg button {
  min-height: 28px; padding: 4px 0 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 5px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink); }

input:not([type="checkbox"], [type="radio"], [type="range"]), select {
  min-height: 32px; padding: 4px 9px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--sunken); color: var(--ink); min-width: 0;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:user-invalid { border-color: var(--red); background: var(--red-soft); }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ctl { display: inline-flex; align-items: center; gap: 6px; }
.ctl > label { color: var(--muted); font-size: 12.5px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field label { color: var(--ink-2); font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; }
.form__error { color: var(--red); min-height: 1.2em; font-size: 13px; }
.form__error:empty { min-height: 0; }
.form__row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--map-bg);
}
.auth__panel { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line-strong); padding: 26px 26px 22px; display: grid; gap: 22px; }
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__product { font-size: 18px; font-weight: 600; }
.auth__sub { color: var(--muted); font-size: 13px; }
.auth__title { font-size: 20px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100dvh; }
.rail { display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); min-height: 0; }
.rail__top { display: flex; align-items: center; justify-content: space-between; height: var(--topbar); padding: 0 14px; border-bottom: 1px solid var(--line); }
.rail__menu { display: none; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand__name { font-weight: 800; font-size: 15px; }
.brand__tag { color: var(--accent); font-weight: 500; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-size: 14px; border-left: 2px solid transparent;
}
.nav a svg { width: 15px; height: 15px; fill: currentColor; opacity: .75; flex: none; }
.nav a svg .o { fill: none; stroke: currentColor; stroke-width: 1.4; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--accent); font-weight: 700; }
.nav a[aria-current="page"] svg { opacity: 1; color: var(--accent); }
.rail__user { border-top: 1px solid var(--line); padding: 8px; position: relative; }
.user-btn {
  width: 100%; display: grid; text-align: left; gap: 0; padding: 7px 10px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.user-btn:hover { background: var(--raised); border-color: var(--line); }
.user-btn__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.user-btn__role { color: var(--muted); font-size: 12px; }

.menu {
  margin: 0; inset: auto; position: fixed; min-width: 190px; padding: 5px;
  background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.menu button {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer; color: var(--ink);
}
.menu button:hover, .menu button:focus-visible { background: var(--raised); color: var(--ink); outline: none; }
.menu__group { border-block: 1px solid var(--line); margin: 4px 0; padding: 4px 0; }
.menu__label { display: block; padding: 2px 10px; color: var(--muted); font-size: 12px; }
.menu [aria-checked="true"]::after { content: "  ✓"; color: var(--accent); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: var(--topbar); padding: 8px 18px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.topbar h1 { font-size: 20px; margin-right: auto; }
.topbar h1:focus { outline: none; }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 18px; }
.view:focus { outline: none; }
.view--fill { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

/* ---------- generic blocks ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); }
.panel__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.panel__head h2 { margin-right: auto; font-size: 15px; }
.panel__body { padding: 14px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack > * { min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.summary { color: var(--ink-2); }
.summary strong { color: var(--ink); }

.state { display: grid; justify-items: start; gap: 6px; padding: 28px 22px; max-width: 60ch; }
.state--center { justify-items: center; text-align: center; margin: auto; }
.state__title { font-size: 16px; font-weight: 600; }
.state__body { color: var(--muted); }
.state--error .state__title { color: var(--red); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { padding: 7px 12px; border-radius: var(--r); background: var(--red-soft); color: var(--red); font-size: 13px; }
.banner--warn { background: var(--amber-soft); color: var(--amber); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; height: 18px;
  font: 600 11px var(--mono); border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; vertical-align: middle;
}
.badge--member { border-color: color-mix(in srgb, var(--verdigris) 60%, transparent); color: var(--verdigris); }
.badge--amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.badge--grey { color: var(--muted); border-style: dashed; }
.badge--red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge--stance-ally { color: var(--verdigris); }
.badge--stance-hostile, .badge--stance-pos { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); vertical-align: middle; }
.dot--on { background: var(--verdigris); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .35); }
.pname { font-weight: 600; text-decoration: none; }
a.pname:hover { text-decoration: underline; }

/* stat tiles (Live) */
.tiles { display: flex; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.tile { flex: 1 1 0; min-width: 130px; background: var(--panel); padding: 9px 16px 8px; display: grid; gap: 0; }
.tile__value { font-family: var(--mono); font-size: 24px; line-height: 1.1; font-weight: 600; }
.tile__label { color: var(--muted); font-size: 12.5px; }
.tile--alert .tile__value { color: var(--red); }
.tile--warn .tile__value { color: var(--amber); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; container-type: inline-size; max-width: 100%; position: relative; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
table.data caption { text-align: left; padding: 0 0 8px; color: var(--muted); }
table.data th, table.data td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 12.5px;
  border-bottom-color: var(--line-strong);
}
table.data th.num, table.data td.num { text-align: right; }
table.data tbody tr:hover { background: var(--raised); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr.is-selected { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
table.data td.wrap { white-space: normal; min-width: 18ch; }
.sort-btn { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; color: inherit; }
.sort-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sort-btn::after { content: ""; width: 0; height: 0; border: 4px solid transparent; opacity: .35; border-top-color: currentColor; margin-top: 4px; }
th[aria-sort="ascending"] .sort-btn::after { border-top-color: transparent; border-bottom-color: currentColor; margin-top: -4px; opacity: 1; }
th[aria-sort="descending"] .sort-btn::after { opacity: 1; }
th[aria-sort] { color: var(--ink) !important; }
.countdown--soon { color: var(--amber); }
.countdown--urgent { color: var(--red); font-weight: 600; }
.countdown--past { color: var(--red); }

@container (width < 560px) {
  table.data, table.data thead, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
  table.data thead { display: none; }
  table.data tr { padding: 8px 4px; border-bottom: 1px solid var(--line); }
  table.data td, table.data tbody th { border: 0; padding: 2px 6px; white-space: normal; text-align: left !important; }
  table.data td[data-label]::before { content: attr(data-label) "  "; color: var(--muted); font-size: 12px; }
}

/* ---------- map ---------- */
.map { position: relative; overflow: hidden; background: var(--map-bg); min-height: 200px; isolation: isolate; }
.map__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map__canvas:active { cursor: grabbing; }
.map__canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.map__tools { position: absolute; top: 10px; right: 10px; display: grid; gap: 4px; z-index: 2; }
.map__tools .btn { width: 32px; height: 32px; padding: 0; min-height: 0; background: color-mix(in srgb, var(--raised) 88%, transparent); font-size: 16px; }
.map__tools .map__terrain { font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.map__tools .map__terrain[aria-pressed="true"] { border-color: var(--ink-2); color: var(--ink); }
.map__readout {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
  background: color-mix(in srgb, var(--panel) 82%, transparent); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 7px;
  pointer-events: none; white-space: nowrap;
}
.map__scale { position: absolute; right: 10px; bottom: 10px; z-index: 2; pointer-events: none; display: grid; justify-items: end; gap: 2px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.map__scale-bar { height: 6px; border: 1.5px solid var(--ink-2); border-top: 0; }
.map__compass { position: absolute; left: 12px; top: 10px; z-index: 2; pointer-events: none; width: 18px; text-align: center; font: 800 11px var(--font); color: var(--map-ink); text-shadow: 0 1px 2px var(--map-halo); }
.map__compass svg { display: block; margin: 0 auto 1px; filter: drop-shadow(0 1px 1px var(--map-halo)); }
.map__tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 280px; padding: 7px 9px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 12.5px; display: grid; gap: 2px;
}
.map__tip strong { font-size: 13.5px; }
.map__tip .mono { color: var(--ink-2); }
.map__tip .tip-sub { color: var(--muted); }
.map__tip .hbar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 3px; width: 120px; }
.map__tip .hbar > i { display: block; height: 100%; background: var(--accent); }
.map__tip .hbar--low > i { background: var(--red); }
.map__overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none; }
.map__overlay > * { pointer-events: auto; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 0; }

/* map + side panel layout */
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.split > .map { min-height: 0; }
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side__section { display: flex; flex-direction: column; min-height: 0; }
.side__section + .side__section { border-top: 1px solid var(--line); }
.side__head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; flex: none; }
.side__head h2 { margin-right: auto; font-size: 14px; }
.side__head .count { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.side__scroll { overflow-y: auto; min-height: 0; flex: 1; }
.page-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.page-bar .status { margin-left: auto; color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li + li { border-top: 1px solid var(--line); }
.prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 9px; align-items: center; width: 100%;
  padding: 7px 12px; background: transparent; border: 0; text-align: left; cursor: pointer;
}
.prow:hover { background: var(--raised); }
.prow .swatch { grid-row: span 2; width: 9px; height: 9px; border-radius: 50%; }
/* player faces (8x8 skin pixels, scaled up crisp) */
.pface { width: 16px; height: 16px; image-rendering: pixelated; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgb(0 0 0 / .4); }
.prow .pface { grid-row: span 2; }
.pface--sight { opacity: .7; }
.pface--big { width: 28px; height: 28px; border-radius: 3px; }
.prow__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow__meta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow__aside { font-size: 12px; color: var(--muted); white-space: nowrap; }
.prow.is-elsewhere { opacity: .62; }
.hp { display: inline-block; width: 34px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; vertical-align: middle; }
.hp > i { display: block; height: 100%; background: var(--accent); }
.hp--low > i { background: var(--red); }

/* ---------- replay ---------- */
.replay { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr) auto; }
.replay > .map { grid-column: 1; grid-row: 1; }
.replay > .side { grid-column: 2; grid-row: 1 / 3; }
.dock { grid-column: 1; grid-row: 2; border-top: 1px solid var(--line); background: var(--panel); padding: 10px 14px 10px; display: grid; gap: 8px; min-width: 0; }
.dock__row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.clock { display: grid; line-height: 1; margin-right: 6px; }
.clock__time { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.clock__date { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.play-btn { width: 44px; height: 44px; padding: 0; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.play-btn svg { width: 18px; height: 18px; }
.play-btn:disabled { background: var(--raised); border-color: var(--line-strong); color: var(--muted); }
.dock .seg button { font-family: var(--mono); font-size: 12.5px; }
.scrub { position: relative; display: grid; gap: 0; user-select: none; touch-action: none; }
.scrub__canvas { width: 100%; height: 76px; display: block; cursor: ew-resize; touch-action: none; }
.scrub__range { position: absolute; left: 0; right: 0; top: 18px; width: 100%; margin: 0; height: 22px; opacity: 0; pointer-events: none; }
.scrub__range:focus-visible + .scrub__focus { display: block; }
.scrub__focus { display: none; position: absolute; inset: 15px -3px 34px; border: 2px solid var(--focus); border-radius: 0; pointer-events: none; }
.shortcuts { color: var(--muted); font-size: 12px; display: flex; gap: 4px 14px; flex-wrap: wrap; }
.trackrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 0 7px; align-items: center; padding: 5px 10px 5px 12px; }
.trackrow:hover { background: var(--raised); }
.trackrow input { cursor: pointer; }
.trackrow label { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
.trackrow .swatch { width: 10px; height: 10px; border-radius: 50%; }
.trackrow .swatch--sighted { border-radius: 1px; transform: rotate(45deg) scale(.85); }
.trackrow__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trackrow__pos { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.trackrow.is-off .trackrow__name { color: var(--muted); font-weight: 400; }

.tbtn { border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: var(--r-sm); padding: 1px 5px; font-size: 11.5px; cursor: pointer; }
.tbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.tbtn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.group-label { padding: 8px 12px 3px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { border-top: 1px solid var(--line); }
.feed button {
  display: grid; grid-template-columns: 58px 10px minmax(0, 1fr); gap: 1px 8px; width: 100%; text-align: left; padding: 6px 12px;
  background: transparent; border: 0; cursor: pointer; align-items: baseline;
}
.feed button:hover { background: var(--raised); }
.feed time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.feed .ev-mark { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.feed .ev-text { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.feed li.is-future .ev-text, .feed li.is-future time { color: var(--muted); }

.feed li.is-future .ev-mark { opacity: .45; }
.feed li.is-current button { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
.feed li.is-current time { color: var(--ink); }
/* virtualised replay feed: fixed one-line rows, absolutely placed (replay.js FEED_ROW must match the height) */
.feed--virtual { position: relative; }
.feed--virtual li { position: absolute; left: 0; right: 0; height: 31px; box-sizing: border-box; overflow: hidden; }
.feed--virtual button { height: 100%; align-items: center; }
.feed--virtual .ev-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev--snitch { background: var(--amber); }
.ev--death { background: var(--red); }
.ev--combat { background: #f08a3c; }
.ev--session { background: var(--verdigris); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 2px 4px; font-size: 12.5px; background: transparent; color: var(--ink-2); cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="false"] { opacity: .45; }
.chip .ev-mark { width: 8px; height: 8px; }

/* ---------- heat chart (weekday x hour) ---------- */
.heat { display: grid; gap: 8px; min-width: 0; margin: 0; }
.heat__scroll { overflow-x: auto; min-width: 0; position: relative; }
table.heatgrid { border-collapse: separate; border-spacing: 2px; table-layout: fixed; width: 100%; min-width: 520px; }
table.heatgrid th { font-weight: 400; color: var(--muted); font-size: 11px; font-family: var(--mono); padding: 0; }
table.heatgrid thead th { height: 16px; text-align: left; }
table.heatgrid tbody th { text-align: right; padding-right: 6px; width: 38px; font-family: var(--font); font-size: 12px; }
table.heatgrid thead td { background: transparent; }
table.heatgrid td { height: 20px; border-radius: 2px; padding: 0; background: var(--sunken); }
table.heatgrid td:hover { outline: 1.5px solid var(--ink); outline-offset: 0; }
.heat__legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.heat__ramp { width: 120px; height: 8px; border-radius: 2px; }
.heat__tip { min-height: 1.4em; font-size: 12.5px; color: var(--ink-2); font-family: var(--mono); }

/* ---------- player profile ---------- */
.profile { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.profile > * { grid-column: span 12; min-width: 0; }
.p-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 16px; }
.p-head__face { grid-row: span 2; width: 56px; height: 56px; padding: 3px; background: #07090a; box-shadow: 0 0 0 2px var(--ring, var(--line-strong)); }
.p-head__face img { width: 50px; height: 50px; display: block; image-rendering: pixelated; }
.p-head__name { font-size: 28px; font-weight: 800; line-height: 1.1; }
.p-head__meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); align-items: center; }
.counts { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 0; overflow: hidden; flex-wrap: wrap; }
.counts > div { flex: 1 1 110px; background: var(--panel); padding: 8px 14px; display: grid; }
.counts .tile__value { font-size: 22px; }
.minimap { height: 340px; border-radius: 0; border: 1px solid var(--line); }
.gear { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.gear li { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.gear li:first-child { border-top: 0; }
.gear__slots { display: flex; flex-wrap: wrap; gap: 2px; }
.gear__slot { font-size: 12.5px; padding: 1px 7px; border-radius: 3px; background: var(--sunken); border: 1px solid var(--line); }
.gear__slot span { color: var(--muted); margin-right: 4px; font-size: 11px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.list-plain li:first-child { border-top: 0; }
.alts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- pages with map + table ---------- */
.mapgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(560px, 46%); }
.mapgrid > .map { min-height: 0; }
.mapgrid__table { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.mapgrid__table .table-wrap { flex: 1; min-height: 0; }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.heat-legend { position: absolute; left: 10px; top: 10px; z-index: 2; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.heat-legend canvas { width: 160px; height: 10px; display: block; border-radius: 2px; }
.heat-legend__scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---------- accounts ---------- */
.secret {
  display: grid; gap: 10px; padding: 14px; border-radius: 0; border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line));
  background: var(--amber-soft);
}
.secret__pw { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret__pw output { font-family: var(--mono); font-size: 17px; padding: 5px 10px; background: var(--sunken); border: 1px solid var(--line-strong); border-radius: var(--r); user-select: all; word-break: break-all; }
.secret__warn { color: var(--amber); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

/* ---------- dialog & toast ---------- */
.dialog {
  width: min(420px, calc(100vw - 32px)); padding: 22px; border-radius: 0; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgb(5 8 10 / .55); }
.dialog h2 { font-size: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 100; padding: 9px 14px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.toast.is-shown { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .mapgrid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 1fr) minmax(0, 1fr); }
  .mapgrid__table { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  :root { --rail: 168px; }
  .split, .replay { grid-template-columns: minmax(0, 1fr) 280px; }
  .clock__time { font-size: 28px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  .profile .span-7 { grid-column: span 7; }
  .profile .span-5 { grid-column: span 5; }
  .profile .span-6 { grid-column: span 6; }
}
@media (max-width: 760px) {
  .shell { display: block; height: auto; }
  .rail { position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail__top { border-bottom: 0; }
  .rail__menu { display: inline-flex; }
  .rail:not(.is-open) .nav, .rail:not(.is-open) .rail__user { display: none; }
  .nav { max-height: 60dvh; border-top: 1px solid var(--line); }
  .main { min-height: calc(100dvh - var(--topbar)); }
  .topbar { padding: 8px 16px; }
  .view { overflow: visible; padding: 14px 16px; }
  .view--fill { padding: 0; overflow: visible; }
  .split, .replay, .mapgrid { display: flex; flex-direction: column; }
  .split > .map, .replay > .map, .mapgrid > .map { height: 58dvh; flex: none; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .side__scroll { max-height: 50dvh; }
  .replay > .side { order: 3; }
  .dock { order: 2; }
  .clock__time { font-size: 26px; }
  .mapgrid__table { border-top: 1px solid var(--line); }
  .mapgrid__table .table-wrap { max-height: none; }
  .tiles { flex-wrap: wrap; }
  .tile { min-width: 0; flex: 1 1 45%; padding: 8px 12px; }
  .tile__value { font-size: 20px; }
  .p-head__name { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .toast { transition: none; }
}
@media (forced-colors: active) {
  .seg button[aria-pressed="true"], .tbtn[aria-pressed="true"] { outline: 2px solid CanvasText; }
}

.linkbtn { all: unset; cursor: pointer; color: inherit; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.linkbtn.mono { font-family: var(--mono); font-size: .92em; }

/* world switch */
.seg__count { font: 600 11px var(--mono); color: var(--accent); }
.world-note { padding: 6px 12px 10px; }
.world-note button { all: unset; cursor: pointer; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.world-note button:hover { color: var(--ink); }
.world-note button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.world-tag { color: var(--amber); }

/* ---------- live overlays (layer chips, threats, kit card) ---------- */
.layer-chips .chip { min-height: 26px; padding-right: 9px; }
.chip[aria-busy="true"] { cursor: progress; }
.chip[aria-busy="true"] .lmark { opacity: .35; }
.lmark { display: inline-block; width: 9px; height: 9px; flex: none; }
.lmark--members { border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 2.6px var(--accent); }
.lmark--radar { width: 10px; background: var(--ink); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.lmark--sightings { width: 7px; height: 7px; background: var(--muted); transform: rotate(45deg); }
.lmark--snitches { width: 7px; height: 7px; border-radius: 1px; background: var(--amber); }
.lmark--pearls { border-radius: 1px; background: #21b8c9; }
.lmark--deaths {
  background: linear-gradient(45deg, transparent 36%, var(--red) 36% 64%, transparent 64%),
    linear-gradient(-45deg, transparent 36%, var(--red) 36% 64%, transparent 64%);
}
.lmark--trails { width: 13px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent)); }
.lmark--threats { border-radius: 50%; border: 2px solid var(--red); }

.side__section--members { flex: 0 1 auto; max-height: 42%; }
.side__section--radar { flex: 0 1 auto; max-height: 30%; }
.side__section--sights { flex: 1 1 35%; }
.prow.is-selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.prow__tag { font-weight: 500; opacity: .8; }
.prow .swatch--radar { border-radius: 0; width: 11px; height: 10px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prow__aside .badge { height: 16px; font-size: 10.5px; padding: 0 4px; }
.map__tip .tip-kit { color: var(--ink-2); }
.map__tip .tip-alert { color: var(--red); font-weight: 600; }

.threats { flex: none; max-height: 34%; overflow-y: auto; background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); border-bottom: 1px solid var(--line); }
.threats__head { padding: 8px 12px 2px; }
.threats__head h2 { font-size: 13.5px; color: var(--red); }
.threats__list { list-style: none; margin: 0; padding: 0 0 5px; }
.threats__row { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 4px 12px; cursor: pointer; font-size: 13px; color: var(--ink); }
.threats__row:hover { background: var(--red-soft); }
.threats__row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.threats__dist { font-family: var(--mono); font-weight: 600; color: var(--red); }
.threats__meta { display: block; color: var(--muted); font-size: 11.5px; }

.kit { flex: 0 1 auto; max-height: 58%; }
.kit .side__head { padding-bottom: 2px; }
.kit__title { margin-right: auto; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit__title:focus { outline: none; }
.kit__close { width: 28px; padding: 0; font-size: 13px; }
.kit__meta { padding: 0 12px 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.kit__body { padding: 0 12px 10px; display: grid; gap: 6px; }
.kit__health { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.kit .hbar { display: block; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.kit .hbar > i { display: block; height: 100%; background: var(--accent); }
.kit .hbar--low > i { background: var(--red); }
.kit__counts { display: flex; flex-wrap: wrap; gap: 4px; }
.kitcount { border: 1px solid var(--line-strong); border-radius: 0; padding: 0 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.kitcount b { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.kitcount--zero { opacity: .5; }
.kitcount--warn { border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
.kitcount--warn b { color: var(--amber); }
.kit__h { margin-top: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kit__slots { list-style: none; margin: 0; padding: 0; }
.kit__slot { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 0 8px; padding: 3px 0; border-top: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.kit__slot:first-child { border-top: 0; }
.kit__slot-label { color: var(--muted); font-size: 11.5px; }
.kit__item { overflow-wrap: anywhere; }
.kit__item--empty { color: var(--muted); font-style: italic; }
.kit__dur { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.kit__dur--low { color: var(--amber); font-weight: 600; }
.kit__dur--crit { color: var(--red); font-weight: 600; }
.kit__ench { grid-column: 2 / 4; color: var(--accent); font-size: 11.5px; }
.kit__none { color: var(--muted); font-size: 13px; }
.kit__foot { color: var(--muted); font-size: 12px; }

/* ---- Live: map + one column ------------------------------------------------------------------------- */
.split--live { grid-template-columns: minmax(0, 1fr) 384px; }
.lv-side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.lv-where { display: flex; align-items: flex-end; gap: 12px; padding: 10px 16px 0; flex-wrap: wrap; }
.lv-tabs { display: flex; gap: 12px; }
.lv-tab { background: none; border: 0; padding: 0 0 6px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 5px; align-items: baseline; }
.lv-tab:hover { color: var(--ink); }
.lv-tab[aria-pressed="true"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px var(--ink); }
.lv-tab__n { font: 600 11px var(--mono); color: var(--copper); }
.lv-where__sep { width: 1px; height: 16px; background: var(--line); margin-bottom: 8px; }
.lv-summary { margin: 0; padding: 12px 16px 14px; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.45; color: var(--ink-2); flex: none; }
.lv-summary b { color: var(--ink); }
.lv-red { color: var(--red); font-weight: 600; }
.lv-dim { color: var(--muted); }
.lv-link { background: none; border: 0; padding: 0; font: inherit; color: var(--copper); font-weight: 600; cursor: pointer; text-decoration: none; }
.lv-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.lv-link--quiet { color: var(--muted); font-weight: 500; }
.lv-scroll { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; }
.lv-sec { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 6px; }
.lv-sec h2 { margin: 0; font-size: 15px; font-weight: 800; }
.lv-sec span { font: 12px var(--mono); color: var(--muted); }
.lv-nation { display: flex; align-items: center; gap: 8px; padding: 6px 16px 3px; font-size: 12.5px; color: var(--muted); }
.lv-nation::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lv-note { margin: 0; padding: 2px 16px 8px; font-size: 13.5px; color: var(--muted); }
.lv-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 1px 10px; align-items: center; width: 100%; padding: 6px 16px 7px; background: none; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; position: relative; }
.lv-row:hover, .lv-row.is-open { background: var(--raised); }
.lv-row.is-open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--copper); }
.lv-row__name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-row__sub { grid-column: 2; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-row__aside { grid-row: 1 / 3; grid-column: 3; text-align: right; font: 12px/1.35 var(--mono); color: var(--ink-2); white-space: nowrap; }
.lv-row--faded .lv-face, .lv-row--faded .lv-row__name { opacity: .68; }
.lv-face { grid-row: 1 / 3; width: 22px; height: 22px; padding: 2px; background: #07090a; box-shadow: 0 0 0 2px var(--ring, transparent); display: block; }
.lv-face img { width: 18px; height: 18px; display: block; image-rendering: pixelated; }
.lv-tag { font: 600 10.5px/15px var(--mono); padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.lv-nation .lv-tag { margin-left: 0; }
.hearts { display: inline-flex; gap: 1px; }
.hearts img { width: 9px; height: 8px; image-rendering: pixelated; display: block; }
.lv-inv { padding: 4px 16px 14px 48px; background: var(--raised); display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.lv-inv__row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.lv-inv__lab { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.slots { display: flex; gap: 2px; flex-wrap: wrap; }
.slot { width: 32px; height: 32px; background: var(--slot); box-shadow: inset 1px 1px 0 var(--slot-lo), inset -1px -1px 0 var(--slot-hi); position: relative; display: grid; place-items: center; }
.slot img { width: 24px; height: 24px; image-rendering: pixelated; display: block; }
.slot__letters { width: 24px; height: 24px; display: grid; place-items: center; font: 700 10px var(--mono); color: #e2e1da; background: #4a4f53; box-shadow: inset 0 0 0 1px #1b1b1b; }
.slot__n { position: absolute; right: 2px; bottom: 0; font: 700 11px var(--mono); color: #fff; text-shadow: 1px 1px 0 #3a3a3a; }
.slot__dur { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: #000; }
.slot__dur i { display: block; height: 100%; }
.lv-inv__facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: 13px; }
.lv-inv__facts dt { color: var(--muted); }
.lv-inv__facts dd { margin: 0; overflow-wrap: anywhere; }
.lv-inv__acts { display: flex; gap: 16px; font-size: 13.5px; flex-wrap: wrap; }
.lv-more { display: block; padding: 6px 16px 10px 48px; font-size: 13px; }
.lv-foot { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex: none; }
.lv-foot a { color: var(--copper); font-weight: 600; }
.lv-foot .status { display: inline-flex; align-items: center; gap: 7px; }
.map__tools .lv-layers__btn { width: auto; padding: 0 8px; font-size: 12px; font-weight: 700; }
.lv-layers { position: absolute; top: 10px; right: 52px; z-index: 3; background: var(--panel); border: 1px solid var(--line-strong); padding: 6px 4px; display: grid; min-width: 170px; }
.lv-layers label { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 13.5px; cursor: pointer; }
.lv-layers label:hover { background: var(--raised); }
.lv-follow { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgb(8 10 11 / .9); color: #f1f0ea; font-size: 13.5px; padding: 5px 6px 5px 12px; display: flex; gap: 10px; align-items: center; border: 1px solid var(--copper); }
.lv-follow button { background: var(--copper); color: #1b0f07; border: 0; font: inherit; font-weight: 700; padding: 2px 10px; cursor: pointer; }
@media (max-width: 760px) {
  .lv-side { border-left: 0; border-top: 1px solid var(--line); }
  .lv-scroll { overflow: visible; }
  .lv-inv { padding-left: 16px; }
}

/* player profile totals as a sentence */
.p-sum { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); max-width: 75ch; }
.p-sum b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
/* faces in lists */
.face-sm { display: inline-block; width: 18px; height: 18px; padding: 1px; background: #07090a; vertical-align: -4px; margin-right: 7px; box-shadow: 0 0 0 1.5px var(--ring, transparent); }
.face-sm img { width: 16px; height: 16px; display: block; image-rendering: pixelated; }
.trackrow .face-sm { margin-right: 0; }
/* a page's key on the map (snitches) - takes the compass's corner */
.map__legend { position: absolute; left: 12px; top: 10px; z-index: 2; pointer-events: none; max-width: calc(100% - 70px); padding: 4px 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }

/* ---------- public front page + sign-in (2026-10-24) ---------- */
.auth__layout { width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) min(380px, 100%); gap: 40px; align-items: start; }
.landing { display: grid; gap: 18px; align-content: start; padding-top: 6px; }
.landing__title { font-size: 28px; line-height: 1.15; text-wrap: balance; max-width: 22ch; }
.landing__lead { color: var(--ink-2); font-size: 16px; max-width: 52ch; }
.landing__part { display: grid; gap: 6px; max-width: 56ch; border-top: 1px solid var(--line); padding-top: 14px; }
.landing__part h2 { font-size: 15px; }
.landing__part p { color: var(--ink-2); }
@media (max-width: 760px) {
  .auth__layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .landing__title { font-size: 23px; }
}

/* ---------- guides, keys, devices ---------- */
.guide { max-width: 860px; }
.steps { display: grid; gap: 9px; padding-left: 1.4em; margin: 0; }
.steps li { padding-left: 2px; line-height: 1.5; }
.steps li::marker { color: var(--accent); font-weight: 600; }
.steps--plain { list-style: square; }
.secret-key { display: block; margin-top: 6px; font-family: var(--mono); font-size: 15px; letter-spacing: .04em; padding: 6px 10px;
  background: var(--sunken); border: 1px solid var(--line-strong); user-select: all; word-break: break-all; }
.copy-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-field__value { font-family: var(--mono); font-size: 13px; padding: 5px 10px; background: var(--sunken); border: 1px solid var(--line-strong);
  user-select: all; word-break: break-all; min-width: 0; flex: 1 1 260px; }
.fingerprint { display: block; word-break: break-all; padding: 6px 10px; background: var(--sunken); border: 1px solid var(--line); font-size: 12px; }
.details summary { cursor: pointer; color: var(--ink-2); }
.details[open] { display: grid; gap: 8px; }
.device-list { list-style: none; margin: 0; padding: 0; display: grid; }
.device { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.device > div { min-width: 0; }
.warn-text { color: var(--amber); }
.small { font-size: 12px; }
.form--inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.form--inline .field { min-width: 0; }
.form--inline .form__error, .form--inline > p { flex-basis: 100%; }
.field--end { align-self: end; }

/* ---------- analytics (owner) ---------- */
.an-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 0; padding: 1px 0 0 1px; }
.an-stat { padding: 10px 12px; display: grid; gap: 2px; align-content: start; border: 1px solid var(--line); margin: -1px 0 0 -1px; }
.an-stat dt { color: var(--muted); font-size: 12.5px; }
.an-stat dd { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.an-stat p { margin: 0; font-size: 12px; }
.an-part { gap: 8px; }
.an-part h3 { margin: 0; font-size: 14px; }
.an-part > p { margin: 0; }
.an-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.an-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.an-detail { border: 1px solid var(--line-strong); background: var(--sunken); padding: 14px; }
.an-detail__head { display: flex; align-items: center; gap: 10px; }
.an-detail__head h3 { margin: 0 auto 0 0; font-size: 15px; overflow-wrap: anywhere; }
.an-pre { margin: 0; padding: 10px; background: var(--bg); border: 1px solid var(--line); font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
table.data tbody tr.is-muted td { color: var(--muted); }
table.data tbody tr.is-warn { box-shadow: inset 3px 0 0 var(--red); }
.warn { color: var(--amber); font-weight: 600; }

.bars { margin: 0; display: grid; gap: 6px; min-width: 0; }
.bars__title { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.bars__frame { height: 140px; border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.bars__plot { display: flex; align-items: stretch; gap: 2px; height: 100%; }
.bars__plot--dense { gap: 1px; }
.bars__col { flex: 1 1 0; min-width: 1px; display: flex; align-items: flex-end; cursor: default; }
.bars__bar { display: block; width: 100%; height: 0; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.bars__plot--dense .bars__bar { border-radius: 1px 1px 0 0; }
.bars__col.is-on .bars__bar { opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--ink-2); }
.bars__axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.bars__tip { margin: 0; font-size: 12.5px; color: var(--ink-2); min-height: 1.45em; }

.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.funnel__step { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 4px 12px; align-items: center; }
.funnel__label { color: var(--ink); }
.funnel__track { height: 18px; background: var(--sunken); border: 1px solid var(--line); }
.funnel__bar { display: block; height: 100%; background: var(--accent); opacity: .85; }
.funnel__n { grid-column: 2; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 560px) { .funnel__step { grid-template-columns: 1fr; } .funnel__n { grid-column: 1; } }
@media (forced-colors: active) { .bars__bar, .funnel__bar { background: CanvasText; } }
