:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #1d1f21;
  --muted: #6b6f75;
  --line: #dcdcd8;
  --accent: #0b6bcb;
  --good: #1a7f37;
  --bad: #b42318;
  --warn: #9a6700;
  --auto: #6f42c1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --panel: #1e2125;
    --ink: #e6e6e3;
    --muted: #9aa0a6;
    --line: #33373d;
    --accent: #5aa9ff;
    --good: #4cc26b;
    --bad: #ff6b5e;
    --warn: #e0b341;
    --auto: #b394f5;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: calc(14px * var(--scale, 1))/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header {
  position: sticky; top: 0; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
header .clock { font-size: calc(18px * var(--scale, 1)); font-weight: 600; font-variant-numeric: tabular-nums; }
/* A top-bar chip with a dropdown under it (consumables). */
.dropwrap { position: relative; display: inline-block; }
.dropwrap > .dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; min-width: 420px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.chip.on { border-color: var(--accent, var(--good)); }
/* Main area (tabs) and a side column on every tab. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; padding: 0 16px 16px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }
main { min-width: 0; }
main > .away { margin-bottom: 12px; }
.tab { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tab[hidden] { display: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
h2 { font-size: calc(15px * var(--scale, 1)); margin: 0 0 8px; }
h3 { font-size: calc(14px * var(--scale, 1)); margin: 0 0 4px; }
small, .muted { color: var(--muted); }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 3px 0; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.badge { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: calc(12px * var(--scale, 1)); border: 1px solid currentColor; }
button, select, input {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
button.small { padding: 0 6px; font-size: calc(12px * var(--scale, 1)); }
table { border-collapse: collapse; width: 100%; }
td, th { text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { font-weight: 600; color: var(--muted); }
td.num, th.num { text-align: right; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.log { max-height: 320px; overflow-y: auto; font-family: ui-monospace, Consolas, monospace; font-size: calc(12px * var(--scale, 1)); }
.log div { white-space: pre-wrap; }
.log .t { color: var(--muted); margin-right: 8px; }
.log .auto { color: var(--auto); }
.log .unlock { color: var(--good); font-weight: 600; }
.msg { color: var(--bad); }
textarea { width: 100%; height: 200px; font-family: ui-monospace, Consolas, monospace; font-size: calc(11px * var(--scale, 1)); background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.away { border-color: var(--accent); }
.away-grid { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 6px 0; }
button.danger { color: var(--bad); border-color: var(--bad); }
[hidden] { display: none !important; }
.hpbar { position: relative; display: inline-block; width: 140px; height: 10px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--bg); }
.hpbar span { position: absolute; left: 0; top: 0; bottom: 0; }
.hpbar span.good { background: var(--good); }
.hpbar span.warn { background: var(--warn); }
.hpbar span.bad { background: var(--bad); }
.hpbar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: 0.6; }
.tempbar { position: relative; display: inline-block; width: 60px; height: 8px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.tempbar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }

/* New craft: one affix per line with the materials that enable it. */
.affix-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.affix-list label.muted { opacity: 0.55; }
.nowrap { white-space: nowrap; }

/* Top bar parts behave as the header's own flex items. */
header > [data-key] { display: contents; }

/* New craft: numbered steps, a result box, a help note. */
h3.step { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; }
h3.step .step-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: calc(12px * var(--scale, 1)); }
.step-why { margin: 0 0 4px; font-size: calc(12px * var(--scale, 1)); }
.result { margin-top: 10px; padding: 6px 8px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; }
details summary { cursor: pointer; color: var(--accent); }
ul.help { margin: 4px 0; padding-left: 18px; font-size: calc(13px * var(--scale, 1)); }
ul.help li { margin: 2px 0; }

/* Aspect tags: one color per aspect, readable in both themes. */
.aspect { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: calc(12px * var(--scale, 1)); border: 1px solid var(--aspect, var(--line)); color: var(--aspect, var(--ink)); }
.aspect-sharp { --aspect: #c2410c; }
.aspect-reinforced { --aspect: #4d7c0f; }
.aspect-conductive { --aspect: #0369a1; }
.aspect-bio { --aspect: #15803d; }
.aspect-volatile { --aspect: #be123c; }
.aspect-neural { --aspect: #7e22ce; }
.aspect-salvage { --aspect: #a16207; }
.aspect-thermal { --aspect: #b45309; }
.aspect-phase { --aspect: #0e7490; }
@media (prefers-color-scheme: dark) {
  .aspect-sharp { --aspect: #fb923c; }
  .aspect-reinforced { --aspect: #a3e635; }
  .aspect-conductive { --aspect: #38bdf8; }
  .aspect-bio { --aspect: #4ade80; }
  .aspect-volatile { --aspect: #fb7185; }
  .aspect-neural { --aspect: #c084fc; }
  .aspect-salvage { --aspect: #facc15; }
  .aspect-thermal { --aspect: #fdba74; }
  .aspect-phase { --aspect: #67e8f9; }
}

/* Materials: legend, zone groups, one line per material. */
.legend { margin-bottom: 6px; }
details.zone { border-top: 1px solid var(--line); padding: 3px 0; }
details.zone summary { color: var(--ink); font-weight: 600; }
.mat { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 1px 0 1px 14px; cursor: default; }
.mat .num { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
.mat .mat-name { min-width: 8em; }
.mat.empty { opacity: 0.45; }

/* Live run view on an adventurer card. */
.live { margin: 4px 0; padding: 4px 6px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 3px; }
ul.live-events li { padding: 0; border: 0; font-size: calc(12px * var(--scale, 1)); }
/* The run's event log: a fixed height that scrolls (newest first), so the Support row above it never moves. */
ul.live-events { height: calc(4 * 1.45em); overflow-y: auto; margin: 4px 0 0; font-size: calc(12px * var(--scale, 1)); }
.rate { font-variant-numeric: tabular-nums; color: var(--accent); }

/* Craft panel hint (blueprint discovered or matched). */
.hint { margin: 4px 0; padding: 3px 6px; border: 1px dashed var(--line); border-radius: 4px; font-size: calc(13px * var(--scale, 1)); }

/* Legacy tree: four branches side by side when there's room. */
.tree { display: grid; gap: 8px 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 6px; }
.tree-title { margin-top: 12px; }
li.node { padding: 4px 0; }
.node-text { font-size: calc(12px * var(--scale, 1)); }
.node-owned b { color: var(--good); }
.node-locked { opacity: 0.6; }

/* Tabs with attention badges. */
/* The tab bar sticks under the header (its height is measured into --header-h, since the header wraps). */
.tabs { display: flex; gap: 4px; padding: 8px 16px; position: sticky; top: var(--header-h, 48px); z-index: 1; background: var(--bg); }
.tab-btn { padding: 4px 14px; font-weight: 600; }
/* One notification badge everywhere (counts, "new", "N!", dots): a fixed amber with near-black text and a thin
   near-black ring, the same in every theme and palette, so it reads on light, dark, accent (selected tabs and menu
   items) and high-contrast yellow alike (text 12:1; the ring outlines it where the amber is close to the background). */
:root { --badge-bg: #ffc83d; --badge-ink: #1a1400; }
.count, .new-dot, .quiet-new, .badge.new {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; border: 0; font-weight: 600; line-height: 1.4;
  background: var(--badge-bg); color: var(--badge-ink); box-shadow: 0 0 0 1px var(--badge-ink);
  font-size: calc(11px * var(--scale, 1)); text-align: center; vertical-align: middle;
}
.quiet-new.dot, [data-newsum]::after {
  content: ""; display: inline-block; width: 8px; height: 8px; min-width: 0; padding: 0; border-radius: 50%;
  background: var(--badge-bg); box-shadow: 0 0 0 1.5px var(--badge-ink); margin-left: 5px; vertical-align: middle;
}

/* Top bar chips: abilities (highlighted when ready) and the retirement badge. */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 12px; font-size: calc(13px * var(--scale, 1)); text-transform: none; background: var(--bg); }
.chip.ready { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
select.small { padding: 0 4px; font-size: calc(12px * var(--scale, 1)); }

/* Settings menu: a drawer under the top bar. */
.settings { position: fixed; top: 56px; right: 16px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 72px); overflow-y: auto; z-index: 3; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.settings h3 { margin-top: 12px; }

/* Side column: crew lines and the activity feed. */
.side { position: sticky; top: calc(var(--header-h, 48px) + 52px); display: grid; gap: 12px; }
.crewline { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; margin: 0 0 6px; padding: 4px 6px; background: var(--panel); }
.crewline .crew-status { font-size: calc(12px * var(--scale, 1)); text-align: right; }
.crewline .hpbar.mini { grid-column: 1 / -1; width: 100%; height: 6px; }
.feed { font-size: calc(12px * var(--scale, 1)); max-height: 340px; overflow-y: auto; }
.feed div { padding: 2px 0; border-bottom: 1px solid var(--line); }
.feed .t { color: var(--muted); }
.feed .unlock { color: var(--good); }
.card.flash { outline: 2px solid var(--accent); transition: outline-color 1s; }

/* Legacy tree: the four branches as columns. */
.tree { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tree { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tree { grid-template-columns: minmax(0, 1fr); } }
.branch { border-left: 2px solid var(--line); padding-left: 8px; }

/* Blueprint book: the three slots as columns. */
.book { display: grid; gap: 8px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
@media (max-width: 800px) { .book { grid-template-columns: minmax(0, 1fr); } }

/* Gradual unlocks: a one-time highlight on what was just revealed. */
@keyframes reveal-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px var(--accent); } }
.fresh { animation: reveal-pulse 1.6s ease-in-out 3; border-color: var(--accent) !important; }

/* Next up: the guided quest and the nearest goals. */
.quest { padding: 4px 6px; margin-bottom: 6px; border-left: 3px solid var(--good); background: var(--bg); border-radius: 3px; font-size: calc(13px * var(--scale, 1)); }
.goal { font-size: calc(12px * var(--scale, 1)); margin: 4px 0; }
.goalbar { position: relative; display: inline-block; flex: 1; height: 6px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--bg); }
.goalbar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }

/* The craft in progress: its hammer row spans the queue table. */
tr.hammer-row td { border-bottom: 1px solid var(--line); padding-top: 0; }

/* The craft in progress: a progress bar beside the temper bar, each with a small label. */
.progbar span { background: var(--good); }
.barlabel { font-size: calc(11px * var(--scale, 1)); color: var(--muted); margin-left: 6px; }

/* Side column: send out / hold under each crew line. */
.crewrow { margin: 0 0 6px; }
.crewrow .crewline { margin-bottom: 2px; }
.crew-controls { display: flex; gap: 4px; justify-content: flex-end; }

/* Tab badges: new things ("N") and things needing an answer ("N!") share the badge style; the "!" tells them apart. */

/* Itinerary on the adventurer card; the current step under each side-column crew line. */
.itin { margin: 6px 0; }
.itinerary { margin: 4px 0; padding-left: 20px; }
.itinerary li.current { font-weight: 600; }
input.num { width: 56px; }
.crew-step { margin: 0 0 2px 6px; }

/* Hammer strike feedback: the bar flashes and the strike's gain floats up from it. */
@keyframes strike-flash { 0% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; background: transparent; } }
.tempbar.hit { animation: strike-flash 0.35s ease-out; }
@keyframes strike-pop { 0% { opacity: 1; transform: translate(-50%, -2px); } 100% { opacity: 0; transform: translate(-50%, -28px); } }
.strike-pop { position: fixed; z-index: 5; pointer-events: none; font-size: calc(12px * var(--scale, 1)); font-weight: 600; color: var(--accent); white-space: nowrap; animation: strike-pop 0.8s ease-out forwards; }
.strikes { font-variant-numeric: tabular-nums; }

/* Instant hover tooltips (data-tip; lines split on newlines). */
.tip { position: relative; }
/* One floating tooltip (src/ui/tooltip.ts) placed inside the window: below the element, or above it and shifted
   left when it would leave the screen; a max width, wrapping. */
.tooltip { position: fixed; z-index: 30; max-width: min(320px, calc(100vw - 16px)); padding: 6px 8px; border-radius: 4px;
  background: var(--ink); color: var(--panel); font-size: calc(12px * var(--scale, 1)); font-weight: normal; line-height: 1.35;
  white-space: pre-line; overflow-wrap: anywhere; text-align: left; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.tooltip[hidden] { display: none; }

/* Notices (a new ability): a banner above the tabs until dismissed. */
.notices:empty { display: none; }
.notices { display: grid; gap: 6px; margin-bottom: 12px; }
/* The save screen (a save from a newer build, or one that couldn't be loaded or backed up): covers the game. */
.savegate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.7); }
.savegate .panel { max-width: 560px; }
/* The failure screen (src/ui/failure.ts): above everything, the game stopped behind it. */
.failure-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.75); overflow: auto; }
.failure-wrap[hidden] { display: none; }
.failure { max-width: 560px; border-left: 4px solid var(--bad); }
.failure textarea { width: 100%; min-height: 120px; box-sizing: border-box; }
.noscript { margin: 16px; padding: 12px; border: 1px solid var(--warn); border-radius: 6px; }
.version { margin-top: 12px; font-size: calc(12px * var(--scale)); }
.notice { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--good); border-left-width: 4px; border-radius: 6px; background: var(--panel); font-weight: 600; }

/* The side column is wider (it holds the opportunities board) and scrolls on its own, since it sticks. */
.layout { grid-template-columns: minmax(0, 1fr) 360px; }
.side { max-height: calc(100vh - var(--header-h, 48px) - 60px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } .side { position: static; max-height: none; } }

/* Opportunities board (side column): compact entries that expand on click. */
.opps details.opp { border-bottom: 1px solid var(--line); padding: 3px 0; }
.opps details.opp > summary { color: var(--ink); font-size: calc(13px * var(--scale, 1)); list-style: none; display: flex; gap: 6px; align-items: baseline; }
.opps details.opp > summary::-webkit-details-marker { display: none; }
.opps details.opp > summary::before { content: "▸"; color: var(--muted); }
.opps details.opp[open] > summary::before { content: "▾"; }
.opps .opp-short { flex: 1; min-width: 0; }
.opps details.opp.accepted .badge { color: var(--good); }
.opps .opp-body { margin: 4px 0 2px 14px; font-size: calc(13px * var(--scale, 1)); }

/* "While you were away": an overlay under the top bar with its own scroll; the title row (with Dismiss)
   stays visible at the top of it, so the sticky header and tab bar can never cover the button. */
.panel.away {
  position: fixed; z-index: 4; top: calc(var(--header-h, 48px) + 8px); left: 50%; transform: translateX(-50%);
  width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - var(--header-h, 48px) - 24px); overflow-y: auto;
  margin: 0; padding-top: 0; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.away-head { position: sticky; top: 0; z-index: 1; background: var(--panel); margin: 0 0 6px; padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
/* The header's tooltips (ability chips) hang over the sticky tab bar, so the header stacks above it. */
header { z-index: 2; }

/* Order queue on the adventurer card: like the craft queue; the first order is next, the last repeats. */
.orders { margin: 6px 0; }
table.orderq { margin: 4px 0; }
table.orderq td:first-child { width: 1.6em; color: var(--muted); }
table.orderq tr.current td:nth-child(2) { font-weight: 600; }
table.orderq tr.repeat td:first-child { color: var(--accent); font-weight: 600; }

/* Commissions: the board (one entry per commission) and reputation bars per client. */
li.commission { padding: 6px 0; }
.badge.client-ripperdoc { color: #15803d; }
.badge.client-fixer { color: #c2410c; }
.badge.client-corporate { color: #0369a1; }
.badge.client-collective { color: #7e22ce; }
@media (prefers-color-scheme: dark) {
  .badge.client-ripperdoc { color: #4ade80; }
  .badge.client-fixer { color: #fb923c; }
  .badge.client-corporate { color: #38bdf8; }
  .badge.client-collective { color: #c084fc; }
}
.reps { display: grid; gap: 6px; }
.rep .row { flex-wrap: nowrap; }
.rep .goalbar { min-width: 80px; }

/* Achievement toasts: bottom corner, above everything; they expire on their own. */
/* A glitch: a small button at a random spot; a slow, gentle shimmer (no flashing), none with reduced motion. */
.glitch { position: fixed; z-index: 7; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 12px; background: var(--panel); color: var(--accent); font: inherit; font-size: calc(13px * var(--scale, 1)); cursor: pointer; box-shadow: 0 0 10px rgba(56, 189, 248, 0.35); animation: glitch-shimmer 3s ease-in-out infinite; }
.glitch:hover { background: var(--accent); color: #fff; }
@keyframes glitch-shimmer { 0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(56, 189, 248, 0.25); } 50% { opacity: 0.85; box-shadow: 0 0 14px rgba(56, 189, 248, 0.5); } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 6; display: grid; gap: 6px; pointer-events: none; }
.toasts:empty { display: none; }
.toast { display: grid; gap: 2px; min-width: 220px; max-width: 320px; padding: 8px 12px; border: 1px solid var(--good); border-left-width: 4px; border-radius: 6px; background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); animation: toast-in 0.25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Achievements (Codex): categories as columns; earned ones stand out. Cred next to the workbench upgrades. */
.ach-grid { display: grid; gap: 8px 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 6px; }
details.ach-cat summary { color: var(--ink); font-weight: 600; }
li.ach { font-size: calc(13px * var(--scale, 1)); }
li.ach.earned b { color: var(--good); }
li.ach .goalbar { width: 80px; flex: none; vertical-align: middle; }
.cred { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Legacy tree: six branch columns (fewer on narrow screens). Daemon toggles. */
.tree { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1500px) { .tree { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .tree { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tree { grid-template-columns: minmax(0, 1fr); } }
button.daemon { border-style: dashed; }
button.daemon.on { border-style: solid; }

/* Craft panel: the pattern list on the left, the selected pattern on the right. */
#craft { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 4px 14px; align-items: start; }
#craft > [data-key="head"], #craft > [data-key="help"] { grid-column: 1 / -1; }
@media (max-width: 700px) { #craft { grid-template-columns: minmax(0, 1fr); } }
/* By the panel's own width too: at tablet widths the Workshop sets it beside the bench, too narrow for two columns. */
#craftPanel { container-type: inline-size; }
@container (max-width: 440px) { #craft { grid-template-columns: minmax(0, 1fr); } }
.craft-head { gap: 6px; }
.tab-btn { padding: 2px 10px; }
.tab-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); opacity: 1; }
.pattern-list { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); padding-right: 8px; }
.pattern-slot { margin: 8px 0 2px; font-size: calc(11px * var(--scale, 1)); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; }
.pattern { display: block; width: 100%; text-align: left; padding: 3px 6px; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; color: inherit; font: inherit; }
.pattern:hover { border-color: var(--line); }
/* The craft panel's upgrade mark on a blueprint row (blueprintHint): right-aligned, small. */
.pattern .bp-gain { float: right; margin-left: 6px; font-variant-numeric: tabular-nums; }
.pattern .bp-gain.muted { opacity: 0.6; }
.pattern.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pattern.missing { opacity: 0.5; cursor: default; font-size: calc(12px * var(--scale, 1)); }
.stars { color: #c99a2e; letter-spacing: -1px; font-size: calc(11px * var(--scale, 1)); }
.wish { color: #d0457a; }

/* Inventory: level gates by zone (the next one nobody has reached is highlighted). */
.gates { margin-bottom: 8px; }
.gate-row { display: flex; gap: 2px; margin-top: 3px; width: 100%; }
.gate { flex: 1 1 0; min-width: 0; display: inline-flex; flex-direction: column; align-items: center; padding: 3px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; font-size: calc(12px * var(--scale, 1)); opacity: 0.6; position: relative; }
.gate.sel { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.gate .held-dot { position: absolute; top: -2px; right: 2px; color: var(--accent); }
.zone-detail { margin: 8px 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 700px) { .gate-row { flex-wrap: wrap; } .gate { flex: 0 0 calc(10% - 2px); } }
.gate small { font-size: calc(10px * var(--scale, 1)); }
.gate.reached { opacity: 1; color: var(--good); }
.gate.next { opacity: 1; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); font-weight: 600; }

/* Expedition support: a pulse sweeps the bar (main.ts moves it); clicks in the marked zone count more. */
.support-row { gap: 6px; }
.pulse-bar { position: relative; display: inline-block; width: 110px; height: 10px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.pulse-zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 35%, transparent); }
.pulse { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--accent); }


/* The Guide (Codex tab) and the "?" on each panel that opens its entry. */
button.help { font-size: calc(11px * var(--scale, 1)); line-height: 1; padding: 1px 5px; margin-left: 6px; border-radius: 50%; vertical-align: middle; opacity: 0.7; }
button.help:hover { opacity: 1; }
#guideSearch { width: 100%; max-width: 360px; margin: 4px 0 8px; }
.guide .guide-entry { padding: 3px 0; border-bottom: 1px solid var(--line); }
.guide .guide-entry > button.linkish { background: none; border: none; padding: 2px 0; font-weight: 600; cursor: pointer; color: inherit; text-align: left; }
.guide .badge.new { margin-left: 4px; }
.guide .guide-text { margin: 2px 0 6px 16px; max-width: 95ch; }
.guide .guide-text p { margin: 3px 0; }

/* Multiplier breakdowns: the Codex's Multipliers page, and hover tooltips on numbers. */
.num-tip { border-bottom: 1px dotted var(--muted); cursor: help; }
.tooltip.wide { max-width: min(380px, calc(100vw - 16px)); }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.bd { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: calc(13px * var(--scale, 1)); }
.bd-val { float: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bd-part { font-variant-numeric: tabular-nums; }
#multPanel details { margin: 4px 0; }

/* Adventurer cards: a header with an XP bar, a status block (activity, live run, health, actions), then tabs. */
.card-head h3 { margin: 0 0 2px; }
.xpbar { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; vertical-align: middle; }
.xpbar > span { display: block; height: 100%; background: var(--accent); }
.card > [data-key="status"], .card > [data-key="live"], .card > [data-key="swap"], .card > [data-key="renew"], .card > [data-key="health"] {
  background: color-mix(in srgb, var(--line) 35%, transparent); padding: 0 8px; margin: 0 -2px;
}
.card > [data-key="status"] { padding-top: 6px; margin-top: 6px; border-radius: 6px 6px 0 0; }
.card > [data-key="health"] { padding-bottom: 6px; border-radius: 0 0 6px 6px; }
.card-tabs { display: flex; gap: 2px; margin: 8px 0 0; border-bottom: 1px solid var(--line); }
.card-tab { border: 1px solid transparent; border-bottom: none; background: none; padding: 3px 10px; border-radius: 5px 5px 0 0; cursor: pointer; color: inherit; }
.card-tab.on { border-color: var(--line); background: var(--panel); font-weight: 600; }
.card-body { padding-top: 6px; }

/* Craft panel selects size to their content, up to a max width; long names are cut (full text on hover). */
#craft select { field-sizing: content; width: auto; max-width: 240px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }

/* Codex: the Stats page. */
.stats-table td:first-child { color: var(--muted); }
.stats-table td, .stats-table th { padding: 3px 10px 3px 0; text-align: left; }

/* Retirement: what it costs and gives; the pinned line in Next up while it's recommended or on hold. */
.retire-cost { margin: 6px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: calc(13px * var(--scale, 1)); }
.retire-cost > div { margin: 2px 0; }
.retire-pin { display: block; width: 100%; text-align: left; margin-bottom: 6px; padding: 5px 8px; font-weight: 600; }
.retire-pin.good { border-color: var(--good); color: var(--good); }

/* Trait chips: colored by rarity (common grey, uncommon blue, rare gold). */
.trait { display: inline-block; font-size: 0.78em; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line, #444); color: var(--muted, #aaa); font-weight: normal; vertical-align: middle; }
.trait.r-uncommon { color: #3b8be0; border-color: #3b8be0; }
.trait.r-rare { color: #c9961a; border-color: #c9961a; }
.traits-detail { margin-bottom: 6px; }
/* Perks (the card's Perks tab): one row per tier, the two options side by side. */
table.perks { width: 100%; border-collapse: collapse; margin: 4px 0; }
table.perks td { vertical-align: top; padding: 3px 4px; border-top: 1px solid var(--line); font-size: calc(12px * var(--scale, 1)); }
table.perks td.perk { width: 45%; }
table.perks td.perk.taken { background: color-mix(in srgb, var(--good) 14%, transparent); }
table.perks td.perk.planned { outline: 1px dashed var(--accent); outline-offset: -2px; }
table.perks td.perk.locked, table.perks tr.locked td.perk-lvl { opacity: 0.5; }
table.perks td.perk-lvl { width: 10%; }
/* Room for a perk icon (none drawn yet). */
.perk-icon { float: left; width: 24px; height: 24px; margin: 1px 6px 2px 0; border: 1px dashed var(--line); border-radius: 4px; }
.perk-acts { margin-top: 2px; }

/* Challenges (Legacy tab) and the active challenge's top-bar chip. */
table.challenges { width: 100%; border-collapse: collapse; }
table.challenges td { vertical-align: top; padding: 4px 6px; border-top: 1px solid var(--line); }
table.challenges tr.on td { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.challenge-chip { border-color: var(--warn); }

/* Flavor text (data/content.json): quiet, italic, never in the way. */
.flavor { color: var(--muted); font-style: italic; font-size: 0.9em; }
.zone-flavor { color: var(--muted); font-style: italic; font-size: 0.9em; margin: 2px 0 6px; }
.quote { color: var(--muted); font-style: italic; margin-left: 1.2em; }

/* Accessibility (src/ui/display.ts sets the classes on <html>). */
.aspect-sym { font-size: 0.95em; }
/* Reduced motion: no animations or transitions anywhere; feedback stays as static color. */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.reduce-motion .tempbar.hit, .reduce-motion .progbar.hit { outline: 2px solid var(--accent); }
.reduce-motion .fresh { outline: 2px solid var(--accent); }
.reduce-motion .pulse { display: none; }
.reduce-motion .pulse-bar.now .pulse-zone { background: var(--good); }
.reduce-motion .pulse-bar.now { border-color: var(--good); }
/* Colorblind-safe aspect colors (Okabe-Ito and Tol hues, darkened for the light theme). */
.colorblind .aspect-sharp { --aspect: #c45400; }
.colorblind .aspect-reinforced { --aspect: #555555; }
.colorblind .aspect-conductive { --aspect: #0072b2; }
.colorblind .aspect-bio { --aspect: #007a5e; }
.colorblind .aspect-volatile { --aspect: #aa3377; }
.colorblind .aspect-neural { --aspect: #6a3d9a; }
.colorblind .aspect-salvage { --aspect: #8a6d00; }
.colorblind .aspect-thermal { --aspect: #a33b00; }
.colorblind .aspect-phase { --aspect: #2b6f8f; }
@media (prefers-color-scheme: dark) {
  .colorblind .aspect-sharp { --aspect: #e69f00; }
  .colorblind .aspect-reinforced { --aspect: #bbbbbb; }
  .colorblind .aspect-conductive { --aspect: #56b4e9; }
  .colorblind .aspect-bio { --aspect: #2fc29a; }
  .colorblind .aspect-volatile { --aspect: #e07fb5; }
  .colorblind .aspect-neural { --aspect: #b79be0; }
  .colorblind .aspect-salvage { --aspect: #f0e442; }
  .colorblind .aspect-thermal { --aspect: #ff8a4a; }
  .colorblind .aspect-phase { --aspect: #8fd3f0; }
}
/* High contrast: black and white with bright accents, whatever the system theme. */
:root.high-contrast {
  --bg: #000000; --panel: #000000; --ink: #ffffff; --muted: #d6d6d6; --line: #ffffff;
  --accent: #ffd400; --good: #4dff88; --bad: #ff6b6b; --warn: #ffb000; --auto: #e0b3ff;
}
.high-contrast .panel, .high-contrast button, .high-contrast select, .high-contrast input { border-width: 2px; }
.high-contrast button { color: var(--ink); background: var(--bg); border-color: var(--ink); }
.high-contrast button.on, .high-contrast button:hover { background: var(--accent); color: #000000; }
.high-contrast .aspect { --aspect: #ffffff; font-weight: 600; }
.high-contrast a { color: var(--accent); }

/* Codex: a left-side menu, one section shown at a time. */
.codex { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: start; }
.codex-nav { position: sticky; top: calc(var(--header-h, 48px) + 44px); display: flex; flex-direction: column; gap: 4px; }
.codex-link { text-align: left; padding: 6px 10px; }
.codex-link.on { font-weight: 600; }
.codex-link.locked { opacity: 0.6; }
.codex-body { min-width: 0; }
@media (max-width: 760px) {
  .codex { grid-template-columns: 1fr; }
  .codex-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
/* A panel's "?": its Guide entry over the current screen. */
.help-popup { position: fixed; z-index: 8; top: calc(var(--header-h, 48px) + 12px); right: 380px; width: min(440px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); }
.help-popup .row:first-child { justify-content: space-between; }
@media (max-width: 1100px) { .help-popup { right: 16px; } }

/* Retirement milestones */
.identity { font-size: calc(12px * var(--scale, 1)); white-space: nowrap; }
.identity .gold, .gold { color: var(--warn); }
.ladder td { padding: 2px 6px; vertical-align: top; }
.ladder tr.muted b { font-weight: 500; }
.tag { border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
section.gilded { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }

/* Locked things are shown greyed with what opens them (docs/writing-rules.md: nothing is hidden). */
.locked-line { color: var(--muted); margin: 4px 0; font-size: calc(12px * var(--scale, 1)); }
.locked-line .goalbar { margin-left: 6px; vertical-align: middle; }
.locked-inline { color: var(--muted); font-size: calc(12px * var(--scale, 1)); }
.locked-body { opacity: 0.45; pointer-events: none; user-select: none; }
.chip.locked, .tab-btn.locked { opacity: 0.55; }
.tab-btn.locked.on { opacity: 0.85; }
.guide-entry.locked > button { color: var(--muted); }
.pattern.locked { opacity: 0.5; }
/* Capacity only a license gives (licenseLine): greyed like a locked perk, with a "License" tag. */
.licensed-only { opacity: 0.5; white-space: nowrap; }
.license-tag { border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: calc(10px * var(--scale, 1)); letter-spacing: 0.04em; }
.lock-preview p { max-width: 640px; }

/* Stash: groups of rows, each with one primary button and a "⋯" menu for the rest. */
.stash-group h3 { margin: 10px 0 4px; }
.stash-row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.stash-acts { display: flex; gap: 4px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
details.more { position: relative; }
details.more > summary { list-style: none; cursor: pointer; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] .more-body { position: absolute; right: 0; z-index: 8; display: flex; flex-wrap: wrap; gap: 4px; width: max-content; max-width: 360px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }

/* New things (src/ui/unseen.ts): marked where they show until hovered or clicked. */
[data-new] { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.new-dot[data-newsum]::after, .count[data-newsum]::after { content: none; }
button.count[data-count], .high-contrast button.count[data-count] { cursor: pointer; border: 0; background: var(--badge-bg); color: var(--badge-ink); padding: 0 5px; }
details.add-order > summary { cursor: pointer; color: var(--accent); margin: 4px 0; }
.flash-new { outline: 2px solid var(--accent); outline-offset: 2px; }
.reduce-motion .flash-new { outline-style: dashed; }

/* Phones and touch (src/ui/touch.ts handles taps). Touch targets are at least 44px on any touch screen; a double tap
   never zooms, so fast hammer and support taps each count. */
.mobile-only { display: none !important; }
button, summary, select, .chip { touch-action: manipulation; }
@media (pointer: coarse) {
  button, select, summary, .chip, .codex-link, .card-tab, .tab-btn { min-height: 44px; }
  button.small, button.help, button.count[data-count] { min-height: 44px; min-width: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
}
/* Narrow screens (down to 360px): the tabs become a bottom bar, the top bar keeps the essentials (clock, abilities,
   notifications, speed) with the rest behind "More", the side column opens as a panel ("☰ Crew"), cards stack. */
@media (max-width: 760px) {
  .mobile-only { display: inline-flex !important; }
  header { gap: 6px 8px; padding: 6px 8px; }
  html:not(.top-more) header > [data-key="identity"], html:not(.top-more) header > [data-key="consumables"],
  html:not(.top-more) header > [data-key="retire"], html:not(.top-more) header > [data-key="cores"],
  html:not(.top-more) header > [data-key="challenge"], html:not(.top-more) header > [data-key="glitches"] { display: none; }
  html:not(.top-more) header [data-action="skip"], html:not(.top-more) header [data-action="toggleSettings"] { display: none; }
  .tab { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: calc(64px + env(safe-area-inset-bottom)); left: 8px; right: 8px; }
  .tabs {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 3; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    overflow-x: auto; border-top: 1px solid var(--line); background: var(--panel);
  }
  .tabs { gap: 2px; scrollbar-width: none; padding-left: 2px; padding-right: 2px; }
  .tabs .tab-btn { flex: 1 1 auto; min-height: 44px; padding: 2px 3px; font-size: calc(11px * var(--scale)); letter-spacing: -0.2px; position: relative; }
  /* Badges ride on the tab's corner so seven tabs fit across a 360px screen. */
  .tabs .tab-btn .count, .tabs .tab-btn .quiet-new { position: absolute; top: 1px; right: 1px; min-width: 16px; padding: 0 3px; font-size: calc(10px * var(--scale)); }
  body { padding-bottom: 64px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 8px 8px; }
  .side { display: none; }
  html.side-open .side {
    display: grid; position: fixed; z-index: 6; top: var(--header-h, 48px); bottom: 56px; left: 0; right: 0;
    max-height: none; overflow-y: auto; padding: 8px; background: var(--bg); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4);
  }
  .side-close { justify-self: end; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 8px; }
  .dropwrap > .dropdown { position: fixed; left: 8px; right: 8px; top: calc(var(--header-h, 48px) + 4px); min-width: 0; max-height: 70vh; overflow-y: auto; }
  .help-popup { right: 8px; left: 8px; width: auto; }
  .tooltip { max-width: calc(100vw - 16px); }
  .settings { left: 4px; right: 4px; width: auto; max-width: none; top: var(--header-h, 48px); bottom: 60px; max-height: none; }
  .away { width: calc(100vw - 16px); }
  table { display: block; overflow-x: auto; }
  .tree { grid-template-columns: minmax(0, 1fr); }
  #craft { grid-template-columns: minmax(0, 1fr); }
}
/* Device transfer (Settings): the code box and the QR frames (always dark on white, for the camera). */
textarea.transfer-code { width: 100%; font: calc(11px * var(--scale)) / 1.3 ui-monospace, monospace; word-break: break-all; }
.qr-box { background: #ffffff; padding: 8px; width: min(320px, 100%); border-radius: 6px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.scan-box video { width: min(320px, 100%); border-radius: 6px; background: #000; }

/* The story: The Source's own lines (signals, glitch toasts, its requests) set apart in a mono face, and the Signals list. */
.source-line { display: block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--accent); }
.source-line::before { content: "> "; opacity: 0.6; }
ul.signals > li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.signals > li.locked { padding: 4px 0; }
.signal .ending { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }

/* The Cycle tree (Legacy → Cycle): rows of nodes. */
.cycle-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 8px; }

/* The news ticker: one line under the tabs (above the bottom tabs on phones), styled as a broadcast crawl: a CITYNET
   label on the left, an accent line along the top, a condensed face. A headline scrolls across the track; with
   reduced motion it fades in, holds and fades out in place (opacity only, kept under .reduce-motion). The label
   uses ink on page colors, so it reads in every theme and in high contrast. */
.ticker { display: flex; align-items: stretch; overflow: hidden; white-space: nowrap; min-height: calc(30px * var(--scale));
  margin: 0 16px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 0 0 4px 4px; background: var(--panel);
  color: var(--ink); font-family: Bahnschrift, "Bahnschrift SemiCondensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  font-stretch: semi-condensed; font-size: calc(15px * var(--scale)); line-height: calc(30px * var(--scale)); letter-spacing: 0.01em; }
html:not(.ticker-on) .ticker { display: none; }
.ticker-label { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: calc(12px * var(--scale)); letter-spacing: 0.14em; }
.ticker-label::before { content: ""; width: calc(7px * var(--scale)); height: calc(7px * var(--scale)); border-radius: 50%; background: var(--bad); }
.ticker-track { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.ticker-text { position: absolute; left: 0; top: 0; padding: 0 10px; will-change: transform; animation: ticker-scroll var(--dur, 20s) linear forwards; }
@keyframes ticker-scroll { from { transform: translateX(var(--from, 100vw)); } to { transform: translateX(-100%); } }
.ticker-text.ticker-fade { position: static; display: block; white-space: normal; line-height: 1.2; padding-block: calc(6px * var(--scale)); will-change: opacity; animation: ticker-fade var(--hold, 12s) ease forwards; }
@keyframes ticker-fade { 0% { opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; } }
.reduce-motion .ticker .ticker-text.ticker-fade { animation: ticker-fade var(--hold, 12s) ease forwards !important; }
@media (max-width: 760px) {
  .ticker { position: fixed; left: 0; right: 0; margin: 0; z-index: 3; border-radius: 0; border-width: 3px 0 0;
    bottom: calc(53px + env(safe-area-inset-bottom)); font-size: calc(14px * var(--scale)); }
  .ticker-label { padding: 0 8px; letter-spacing: 0.1em; }
  html.ticker-on body { padding-bottom: calc(68px + 33px * var(--scale)); }
}

/* Hall of fame and Bestiary (Codex). */
table.fame { border-collapse: collapse; width: 100%; margin: 4px 0 10px; font-size: calc(13px * var(--scale)); }
table.fame th, table.fame td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.fame-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.fame-card { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--panel); }
.fame-card .farewell, .bestiary .flavor { font-style: italic; color: var(--muted); margin-top: 4px; }
.bestiary { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.bestiary .beast { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.bestiary .beast.locked { opacity: 0.7; }
@media (max-width: 760px) { table.fame { font-size: calc(12px * var(--scale)); } table.fame.items th:nth-child(5), table.fame.items td:nth-child(5) { display: none; } }
table.fame.items [data-tip] { text-decoration: underline dotted; cursor: help; }

/* Bonds (card Details, hall of fame). */
.bonds li { margin: 2px 0; }
.bar.small { display: inline-block; width: 80px; height: 6px; vertical-align: middle; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar.small > span { display: block; height: 100%; background: var(--accent); }
