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

img { max-width: 100%; display: block; }

/* The universal reset above zeroes `margin: 0` on every element, which kills
   the UA-default `margin: auto` browsers use to centre modal <dialog>s. The
   `img { display: block }` rule similarly overrides the UA `[hidden] {
   display: none }` for any <img hidden>. Re-establish both as a single
   project-wide invariant so individual rules don't need to repeat them. */
[hidden] { display: none !important; }

/* Dark-theme tokens (#85). Warm dark — PM-picked from three A/B candidates. */
:root {
  --bg:               #1e1c1a;
  --fg:               #e8e2d6;
  --fg-muted:         #9a9a9a;
  --fg-dim:           #6e6e6e;
  --border:           #3a3a3a;
  --input-bg:         #2a2a2a;
  --input-border:     #555555;
  --button-border:    #777777;
  --button-disabled:  #555555;
  --button-hover:     #cccccc;
  --bar-bg:           #333333;
  --bar-fill:         #b8b8b8;
  --error:            #f06868;
  --mission-border:   #555555;
  --activity-text:    #aaaaaa;
  --inventor-glyph:   #d4b070;
}

body {
  font-family: monospace;
  font-size: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Version footer (fixed bottom-right, all pages) ── */
footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 2px 6px;
  font-size: 11px;
  color: #aaa;
  z-index: 100;
  pointer-events: none;
}

/* ── Game route (#470 slice A) ── */
body.game { max-width: 900px; }

/* ── Landing page ── */
body.landing {
  max-width: none;
  padding: 0;
  background: #0e0e0e;
  color: #ccc;
}

body.landing img {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  object-position: center;
}

body.landing h1 {
  text-align: center;
  font-size: 18px;
  padding: 28px 24px 10px;
  letter-spacing: 0.05em;
}

body.landing p.tagline {
  text-align: center;
  padding: 0 24px 24px;
  color: #888;
}

body.landing nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 24px 40px;
  margin: 0;
}

body.landing .landing-btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  flex: 1;
  max-width: 120px;
}

body.landing .landing-btn-stack .btn {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

body.landing footer { color: rgba(255,255,255,0.2); }

.btn {
  display: inline-block;
  font-family: monospace;
  font-size: 14px;
  padding: 6px 24px;
  border: 1px solid #666;
  color: #ccc;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.btn:hover { border-color: #bbb; color: #fff; }

h1 { font-size: 16px; font-weight: bold; }
h2 { font-size: 14px; font-weight: bold; margin-bottom: 6px; }

section { margin-top: 20px; }

/* #153 — compact text-only topbar replaces the avatar+name+H1 header.
   1 px bottom border anchors it as a shelf; height ~32 px. Right side
   pairs the profile-link character name with the Logout button via
   middle-dot separator. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.topbar-right { display: flex; align-items: baseline; gap: 6px; }
.topbar-sep { color: var(--fg-dim); }

/* ── Action dashboard shell (#470 slice A) ──
   Two-column placeholder skeleton for the GATHER / CRAFT clusters that
   slice B will fill in. At <700px the grid collapses to one column. The
   cluster placeholder is a bordered 64px box per column with the verb
   centered; slice B replaces it with the real cluster widgets. */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
}
.dashboard .col h2 {
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}
.cluster-placeholder {
  border: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.10em;
  color: var(--fg-muted);
}
@media (max-width: 700px) {
  .dashboard { grid-template-columns: 1fr; }
}

/* ── 6-tile destination strip (#470 slice A) ──
   Slot order locked PM 2026-06-04: Stash · Market · Raids · Hall · Dwelling
   · Attic. Linkable tiles are full-strength; shaded tiles (Hall / Dwelling)
   wear `.tile.shaded` — non-interactive, body+icons at 0.5 opacity, heading
   + "Coming soon" line stay at full strength. At <700px the strip collapses
   to a 2-col / 3-row grid. */
.tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  padding: 8px;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg);
}
.tile:hover { border-color: var(--button-border); }
.tile h3 {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.tile .body {
  font-size: 12px;
  color: var(--fg-muted);
}
.tile .icons {
  font-variant-emoji: text;
  margin-top: 4px;
  color: var(--fg-muted);
}
.tile.shaded { cursor: default; pointer-events: none; }
.tile.shaded:hover { border-color: var(--border); }
.tile.shaded .body,
.tile.shaded .icons { opacity: 0.5; }
.tile.shaded .soon {
  display: block;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 3px;
  opacity: 1;
}
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

/* Slice B (#471) hides the legacy gather / craft / invent components — their
   functionality moves into the dashboard cluster. The DOM nodes stay alive
   so render helpers in invent-craft.ts / game.ts don't crash. Feed keeps
   its `.action-component` chrome (slice B doesn't touch the feed slot). */
#gather-component,
#craft-component,
#invent-component { display: none; }

/* ── Action cluster (#471 slice B) ──
   Asymmetric grammar: [focus | GATHER | repeat] ↔ [study | CRAFT | repeat].
   Mod-zones flank the centre GO. Study toggles `body.study-on`, which
   swaps the recipe row for the dust-type row and morphs CRAFT→STUDY. */
.col .identity {
  color: var(--fg-muted);
  font-size: 12px;
  font-style: italic;
  margin: -2px 0 2px;
  line-height: 1.4;
  min-height: 2.8em;
  display: flex;
  align-items: flex-end;
}
.action-cluster {
  display: flex;
  width: 100%;
  border: 1px solid var(--fg);
  min-height: 64px;
}
.action-cluster .mod-zone {
  flex: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.015);
  border: none;
  cursor: pointer;
  font-family: monospace;
}
.action-cluster .mod-zone .glyph {
  font-size: 22px;
  line-height: 1;
  font-variant-emoji: text;
}
.action-cluster .mod-zone .label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.action-cluster .mod-zone.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
}
.action-cluster .mod-zone--left  { border-right: 1px solid var(--border); }
.action-cluster .mod-zone--right { border-left:  1px solid var(--border); }
.action-cluster .mod-zone:disabled,
.action-cluster .mod-zone[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.action-cluster .go {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.24em;
  padding: 14px 8px;
  background: none;
  border: none;
  color: var(--fg);
  font-family: monospace;
  cursor: pointer;
}
.action-cluster .go:hover { background: rgba(255, 255, 255, 0.04); }
.go-study { display: none; }
body.study-on .craft-cluster .go-craft { display: none; }
body.study-on .craft-cluster .go-study { display: inline; }
body.study-on .craft-recipes,
body.study-on .craft-summary { display: none; }
body:not(.study-on) .craft-dust-row { display: none; }

/* ASCII lever — gather mode picker */
.lever {
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  letter-spacing: -2px;
  cursor: pointer;
  user-select: none;
  color: var(--fg-muted);
}
.lever .node {
  cursor: pointer;
  padding: 0 1px;
}
.lever .node.active { color: var(--fg); }
.lever .rail { color: var(--border); }
.lever-label {
  margin-left: 14px;
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0;
}

/* Focus chip row (#279) */
.focus-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}
.focus-chip {
  font-size: 12px;
  font-family: monospace;
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
}
.focus-chip.active,
.focus-chip[aria-pressed="true"] {
  border-color: var(--fg);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

/* Recipe row + dust row */
.recipe-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}
.recipe-icon {
  width: 44px;
  height: 56px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 22px;
  background: var(--bg);
  font-variant-emoji: text;
  cursor: pointer;
}
.recipe-icon.active {
  border-color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}
.recipe-icon.locked {
  opacity: 0.35;
}
.recipe-icon.undiscovered {
  opacity: 0.35;
}
.recipe-icon .recipe-noun {
  font-size: 9px;
  line-height: 1;
  color: var(--fg-muted);
  text-align: center;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-icon .recipe-art {
  /* 32-px source pre-baked via scripts/gen_item_icons.mjs (#450); the 36-px
     display upscales ×1.125 with NN to keep the chunky pixel read inside
     the 44-px tile. */
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  display: block;
}
.dust-tile {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
  position: relative;
  font-size: 22px;
}
.dust-tile.active {
  border-color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}
.dust-tile .band {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  color: var(--fg-muted);
  letter-spacing: 0;
}
.recipe-summary,
.dust-summary {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 2px;
  min-height: 1.4em;
}
.col .desc {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
}
.col .desc a {
  color: var(--fg-muted);
  text-decoration: underline;
}

/* ── Progress strip (#464 slice C). Sits between #action-strip (windshield,
   #362) and the dashboard. Renders only when a main-slot action is running;
   the JS layer toggles `hidden` instead of relying on body.is-active so
   slot-less mutex states (e.g. feed alone) don't paint an empty bar.
   ≥12-16px margin above mandated by A4 (windshield is ~84px of continuous
   motion; flush would read as one block). */
.progress-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--fg);
  background: rgba(255, 255, 255, 0.025);
  margin: 14px 0 4px;
  font-size: 13px;
}
.strip-queue {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.strip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
.strip-chip--active {
  border-color: var(--fg);
  color: var(--fg);
}
.chip-bar {
  display: inline-block;
  width: 84px;
  height: 6px;
  background: var(--bar-bg);
  vertical-align: middle;
}
.chip-fill {
  display: block;
  height: 6px;
  background: var(--bar-fill);
  transition: width 1s linear;
  width: 0;
}
.chip-time {
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.strip-arrow { color: var(--fg-dim); font-size: 14px; }
.strip-total {
  color: var(--fg-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.strip-skip {
  padding: 6px 14px;
  border: 1px solid var(--fg);
  background: rgba(255, 255, 255, 0.025);
  color: var(--fg);
  font-family: monospace;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.12em;
  cursor: pointer;
  white-space: nowrap;
}
.strip-skip:hover { background: rgba(255, 255, 255, 0.07); }
.strip-skip .cost {
  color: var(--inventor-glyph);
  font-weight: normal;
  letter-spacing: 0.04em;
  margin-left: 4px;
}
.progress-strip .error {
  color: var(--error);
  font-size: 12px;
  margin-left: 4px;
}
@media (max-width: 700px) {
  .progress-strip { flex-wrap: wrap; gap: 8px; padding: 8px; }
  .chip-bar { width: 56px; }
}

/* Mutex / active state */
body.is-active .action-cluster { border-color: var(--border); }
body.is-active .action-cluster .go {
  color: var(--fg-dim);
  font-weight: normal;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
}
body.is-active .action-cluster .go:hover { color: var(--fg); }
body.is-active .action-cluster .go-text { display: none; }
.cluster-busy-text { display: none; }
body.is-active .action-cluster .cluster-busy-text { display: inline; }
body.is-active .lever,
body.is-active .recipe-row,
body.is-active .craft-dust-row {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 700px) {
  .action-cluster .mod-zone {
    flex: 0 0 64px;
    padding: 4px 2px;
  }
  .action-cluster .mod-zone .glyph { font-size: 18px; }
  .action-cluster .go {
    letter-spacing: 0.10em;
    font-size: 14px;
    padding: 12px 6px;
  }
}

/* Attic teaser list (#156). Flat plain-text rows in the same calm-table
   typography as the rest of the game. Marker stripped so the rows read as
   labels, not bullets. */
.attic-list { list-style: none; padding: 0; margin: 0; }
.attic-list li { padding: 2px 0; color: var(--fg-muted); }

.craft-empty { color: var(--fg-muted); margin-top: 12px; }


/* Profile-link wraps the character name; truncates long names with an
   ellipsis (full name carries via aria-label). The link points at the
   future profile page (#201). */
#char-profile-link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  max-width: 14ch;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
#char-profile-link em { font-style: italic; font-weight: normal; }
#char-profile-link:hover { color: var(--button-hover); }

/* ── Profile page (#201) ──
   Single-column destination page. Avatar at the top, italic monospace name
   beneath, descriptor + lifetime + teaser blocks separated by whitespace
   (no horizontal rules — section breaks are the dim heading line plus
   24 px gaps). Topbar swaps the /game `Cinder` link for `← Back · Logout`. */
#back-link { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
#back-link:hover { color: var(--button-hover); }
.topbar-glyph { color: var(--fg); margin-right: 4px; }

.profile { max-width: 480px; margin: 32px auto 0; text-align: center; }
.profile .profile-avatar { margin: 0 auto 16px; }
.profile-name { font-size: 1.5em; font-style: italic; font-weight: normal; line-height: 1.2; margin: 0; }
.profile-line { margin: 4px 0 0; color: var(--fg); }
.profile-line-italic { font-style: italic; color: var(--fg-muted); }

.profile-section {
  font-size: 0.85em;
  font-weight: normal;
  opacity: 0.5;
  text-align: center;
  margin: 24px 0 8px;
}
.profile-section span::before { content: '— '; }
.profile-section span::after  { content: ' —'; }

.profile-lifetime {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.5em;
  row-gap: 4px;
  max-width: 280px;
  margin: 0 auto;
  text-align: left;
}
.profile-lifetime dt { color: var(--fg); }
.profile-lifetime dd { font-variant-numeric: tabular-nums; text-align: right; margin: 0; }

.profile-teasers { margin-top: 32px; }
.profile-teaser { color: var(--fg-muted); font-style: italic; margin: 4px 0; }

/* Wardrobe picker (#540) */
.wardrobe-picker { margin-top: 12px; }
.wardrobe-heading { font-size: 0.78em; opacity: 0.5; margin: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.wardrobe-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.wardrobe-label { flex: 1; }
.wardrobe-btn { font-size: 0.8em; padding: 2px 8px; min-width: 5.5em; }
.wardrobe-none { color: var(--fg-muted); font-style: italic; margin: 4px 0; font-size: 0.9em; }

/* #153 — status header. Two text-only lines below the topbar. Line 1 is
   energy ↔ bars (flex-justified); line 2 is the tier readout. */
.status-header { margin-top: 0; margin-bottom: 8px; }
.status-line { display: flex; align-items: baseline; gap: 8px; }
.status-line-1 { justify-content: space-between; }
/* #221 — line 2 mirrors line 1's left/right rhythm: name + rank flush-left,
   dim XP numbers + bar flush-right (or button-only when capped). The tier
   text takes `margin-right: auto` instead of `justify-content` so the
   right-side group (numbers, bar, button, error) stays naturally packed
   without flex-grow distributing slack between them. */
.status-line-2 { gap: 6px; flex-wrap: wrap; }
.status-line-2 .tier-text { margin-right: auto; }
.stat-block { display: inline-flex; align-items: baseline; gap: 6px; }
.stat-glyph {
  font-variant-emoji: text;
  line-height: 1;
}
.stat-value { font-variant-numeric: tabular-nums; }
.stat-tail { color: var(--fg-muted); }

/* Tier line — `Dust · Steady · 42/50 ████░░░` (idle), or button-only
   when capped, or `Dust · Steady · MAX` at the top. The bar reuses the
   existing tokens from #127 (--bar-bg / --bar-fill, 8 px tall). */
.tier-text { font-variant-numeric: tabular-nums; }
/* #221 — XP `N/cap` dimmed to --fg-muted. Line 1 energy numbers stay bright
   (live resource the player spends); line 2 XP numbers are progress-only
   data, so the colour hierarchy mirrors the register difference. */
.tier-numbers { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.tier-bar {
  display: inline-block;
  width: 120px;
  height: 8px;
  background: var(--bar-bg);
  vertical-align: middle;
}
.tier-bar .tier-progress__bar-fill {
  display: block;
  height: 8px;
  background: var(--bar-fill);
}

table { border-spacing: 0; }
td { padding: 1px 12px 1px 0; vertical-align: middle; }

button {
  font-family: monospace;
  font-size: 14px;
  cursor: pointer;
  padding: 1px 10px;
  background: none;
  border: 1px solid var(--button-border);
  color: var(--fg);
}
button:hover { border-color: var(--button-hover); }
button:disabled { opacity: 0.45; cursor: default; border-color: var(--button-disabled); }
button:disabled:hover { border-color: var(--button-disabled); }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  font-family: monospace;
  font-size: 14px;
  padding: 1px 4px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--fg);
}

form label { display: block; margin-bottom: 6px; }
form button[type="submit"] { margin-top: 8px; }

nav { margin: 10px 0; }
nav button { border: none; margin-right: 12px; padding: 0; }

#sell-form { display: flex; gap: 10px; align-items: baseline; margin-top: 4px; flex-wrap: wrap; }
#sell-form label { margin: 0; }
#sell-preview { color: var(--fg-muted); }

/* #154 — advance-tier button + confirmation dialog. Button shows inline
   on the tier row when progression.capReached and not at MAX_TIER, in
   place of the numbers + bar. Dialog uses the native <dialog> element
   with retro-pixel chrome matching the rest of the UI. */

#tier-advance-dialog {
  font-family: monospace;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px 18px;
  max-width: 360px;
  line-height: 1.5;
  margin: auto;                        /* restore UA centring zeroed by the * reset */
}
#tier-advance-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
#tier-advance-dialog h2 { margin-bottom: 10px; }
#tier-advance-dialog p { margin-bottom: 6px; }
.tier-advance-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* #191 — daily-login streak modal. Shares the retro-pixel chrome with
   #tier-advance-dialog so the visual language is one piece. The recap
   list sits inside its own bordered section so the player's eye knows
   "yesterday's beats" is a distinct block from the streak headline. */
#streak-modal {
  font-family: monospace;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px 18px;
  max-width: 360px;
  line-height: 1.5;
  margin: auto;
}
#streak-modal::backdrop { background: rgba(0, 0, 0, 0.5); }
#streak-modal h2 { margin-bottom: 6px; }
#streak-modal p { margin-bottom: 6px; }
.streak-modal-recap { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.streak-modal-recap h3 { font-size: 13px; color: var(--fg-dim); margin-bottom: 4px; }
.streak-modal-recap ul { list-style: none; padding-left: 0; margin: 0; }
.streak-modal-recap li { margin-bottom: 4px; }
.streak-modal-recap-empty { color: var(--fg-dim); font-style: italic; }
.streak-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

.error { color: var(--error); font-size: 13px; }
.success { color: var(--fg-dim); font-size: 13px; }
/* Calm pre-flight status — "what unlocks this", not "what broke" (#398). */
.action-status { color: var(--fg-dim); font-size: 13px; display: block; margin: 4px 0; }

/* --- Unified action component (#282) --- */
.action-component { max-width: 480px; }
.action-header { display: flex; justify-content: space-between; align-items: baseline; }
.action-header h2 { margin: 0; }
.skill-badge { font-size: 13px; }
.action-modes { display: flex; gap: 4px; margin: 4px 0; flex-wrap: wrap; }
.mode-btn { min-width: 72px; padding: 4px 8px; }
.mode-btn[aria-pressed="true"] { font-weight: bold; outline: 2px solid var(--fg); outline-offset: -2px; }
.mode-btn:disabled { opacity: 0.5; }
.action-summary { color: var(--fg-dim); font-size: 13px; min-height: 1.3em; padding: 2px 0; }
.action-toggles { display: flex; gap: 12px; padding: 4px 0; min-height: 1.6em; align-items: center; }
.action-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.action-toggle--disabled { opacity: 0.5; cursor: default; }
.action-toggle input[type="checkbox"] { margin: 0; }
.action-component--active .action-modes { opacity: 0.4; pointer-events: none; }
.action-component--active .action-toggles .action-toggle--disabled { opacity: 0.3; pointer-events: none; }
.action-btn-row { padding: 4px 0; }
.action-start-btn { min-width: 80px; }
.action-start-btn:disabled { opacity: 0.5; }
#invent-dust-picker { padding: 4px 0; }
#invent-dust-select { min-width: 160px; }

/* In-row active state (#174). When an action is running, its row replaces
   col 2 with an 8 px progress bar (reuses --bar-bg / --bar-fill tokens
   shared with the tier-XP bar #127/#153) trailed by the 1 Hz tick (#171)
   and a `{time} remaining` label. Sibling rows in both sections show a bare
   `[ Busy ]` button in col 3; col 1 + col 2 stay readable so the player can
   plan their next action. */
.action-progress {
  display: inline-block;
  width: 120px;
  height: 8px;
  background: var(--bar-bg);
  vertical-align: middle;
  margin-right: 6px;
}
.action-progress__fill {
  display: block;
  height: 8px;
  background: var(--bar-fill);
}
.action-row--active .gather-summary,
.action-row--active .craft-summary { color: var(--fg); }
.action-busy-btn { min-width: 64px; }

@media (max-width: 520px) {
  .action-row--active .gather-summary,
  .action-row--active .craft-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
  }
  .action-row--active .action-progress {
    order: 1;
    flex-basis: 100%;
    width: auto;
    margin-right: 0;
  }
}

/* In-progress block tick (#171): 1 Hz rotating ASCII glyph sharing the
   countdown's setInterval. Subordinate to the timer — muted weight, no
   animation property (the rotation is the 4-glyph sequence itself). */
.tick { color: var(--fg-muted); }

#energy-eta { white-space: nowrap; }

.activity-row { color: var(--activity-text); padding: 1px 0; }
.activity-row .activity-time { color: var(--fg-dim); margin-left: 6px; font-size: 0.85em; }

#inventory-table { width: 100%; max-width: 480px; }
#inventory-table .inv-name em { font-style: italic; font-weight: normal; }
#inventory-table .inv-name .muted { color: var(--fg-dim); margin-left: 6px; }
#inventory-table .inv-qty { text-align: right; padding-right: 0; }
#inventory-empty { color: var(--fg-dim); }

/* Dust icon (#494): per-(tier, hint) heap shape as CSS mask, tinted by the
   per-name dust-color class via `background-color: currentColor`. The mask
   PNG is a pre-baked 32×32 NN raster from scripts/gen_item_icons.mjs; sized
   here in em so it tracks the surrounding text. Combine .dust-icon with a
   .dust-icon-heap-* class (shape) and a .dust-color-* class (tint). */
.dust-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  image-rendering: pixelated;
}
.dust-icon-heap-1         { -webkit-mask-image: url('items/dust_1.png');         mask-image: url('items/dust_1.png'); }
.dust-icon-heap-2-crock   { -webkit-mask-image: url('items/dust_2_crock.png');   mask-image: url('items/dust_2_crock.png'); }
.dust-icon-heap-2-broth   { -webkit-mask-image: url('items/dust_2_broth.png');   mask-image: url('items/dust_2_broth.png'); }
.dust-icon-heap-3-salt    { -webkit-mask-image: url('items/dust_3_salt.png');    mask-image: url('items/dust_3_salt.png'); }
.dust-icon-heap-3-thread  { -webkit-mask-image: url('items/dust_3_thread.png');  mask-image: url('items/dust_3_thread.png'); }
.dust-icon-heap-3-scrap   { -webkit-mask-image: url('items/dust_3_scrap.png');   mask-image: url('items/dust_3_scrap.png'); }
.dust-icon-heap-3-clinker { -webkit-mask-image: url('items/dust_3_clinker.png'); mask-image: url('items/dust_3_clinker.png'); }
.dust-icon-heap-4         { -webkit-mask-image: url('items/dust_4.png');         mask-image: url('items/dust_4.png'); }
.dust-icon-heap-5         { -webkit-mask-image: url('items/dust_5.png');         mask-image: url('items/dust_5.png'); }

/* Wearable inventory swatch (#494): per-(type, color) thumbnail from the
   character-render layer. Drops the legacy dust-icon swatch which read as
   "pile of dust" next to a wearable name. */
.wearable-swatch {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -3px;
  image-rendering: pixelated;
}

/* Dust-icon colour groups (#76). Hex values mirror the palette comments in
   `src/config.ts` (DUST_COLOR_PALETTE). Applied via class= so CSP
   `style-src 'self'` blocks no inline styles. */
.dust-color-bone        { color: #e8dcc8; }
.dust-color-pale-slate  { color: #a8b0b8; }
.dust-color-near-black  { color: #5a4838; }
.dust-color-ochre       { color: #b87333; }
.dust-color-muted-green { color: #6b7a3a; }
.dust-color-blue-grey   { color: #5a6a78; }
.dust-color-muted-rose  { color: #a87878; }
.dust-color-warm-brown  { color: #7a5a3a; }
.dust-color-slate       { color: #6b6b6b; }
.dust-color-fallback    { color: #888888; }

/* QA-only character reset button (#98) — small "×" next to the name. */
.char-reset {
  font-size: 11px;
  padding: 0 4px;
  margin-left: 4px;
  line-height: 1;
  vertical-align: middle;
  opacity: 0.5;
  cursor: pointer;
}
.char-reset:hover { opacity: 1; }

#game-logo { width: 24px; height: 24px; image-rendering: pixelated; }

#name-prompt { max-width: 320px; margin: 60px auto 0; }
#name-prompt h2 { margin-bottom: 10px; }
#name-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; }
#name-form #appearance-fieldset { flex-basis: 100%; }

/* Mission panel (#68; promoted out of Gather to global chrome in #223). Sits
   between the status header and the tab bar. Tighter top/bottom margin than
   the 20 px global `section` rule so the chrome above the tabs reads as one
   compact block instead of three loosely-spaced rows. */
#mission-section { grid-column: 1 / -1; margin: 0; }
.mission-card { border: 1px solid var(--mission-border); padding: 8px 10px; border-radius: 4px; }
.mission-card .mission-name { font-size: 1.05em; margin-bottom: 2px; }
.mission-card .mission-desc { margin-bottom: 6px; }
.mission-card .mission-progress { margin-bottom: 2px; }
.mission-card .mission-reward { margin-bottom: 6px; }
.mission-card .mission-claim { font-size: 0.95em; }
.mission-card .mission-claim:disabled { opacity: 0.4; cursor: not-allowed; }
.inventor-glyph { color: var(--inventor-glyph); }

/* Appearance picker (#82) — three sensory axes presented under the name
   prompt. Defaults pre-selected; players who don't care just hit Confirm.
   Buttons in a row share a single column width so the grid stays clean
   regardless of label length (Weathered vs. Broad). */
.appearance-fieldset { border: none; margin: 14px 0 0; padding: 0; max-width: 320px; }
.appearance-legend { padding: 0; }
.appearance-sep {
  color: var(--fg-dim);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 8px 0 4px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.appearance-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 2px;
}
.appearance-row .appearance-opt { width: 100%; padding: 2px 4px; }
.appearance-opt.selected { border-color: var(--fg); color: var(--fg); }

/* Clothing cycle control (#551) — ← label → below appearance axes.
   Grid (not flex) so the 1fr middle column is always capped at the parent
   width — prevents long names from expanding the fieldset and pushing
   sibling buttons wider. Label is white-space: nowrap + ellipsis. */
.clothing-cycle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.clothing-cycle-arrow { padding: 2px 8px; }
.clothing-cycle-label {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatar (#492, #581) — one <canvas> per surface. The SVG body + PNG clothing
   layer are composited into the canvas by the renderer in src/client/avatar.ts.
   F step removed in #581; smooth interpolation throughout. Halo (#113) unchanged.
   `.profile-avatar` is 192×288; `.name-preview-avatar` is 96×144. */
.profile-avatar { display: block; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.7)); }
.name-preview-avatar { display: block; margin: 0 auto 8px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.7)); }

/* Invent section (#122). Stepper rows reuse the gather/inventory table look
   so the calm-table aesthetic carries through. No new colours; reuses
   --fg-dim for `have N` secondary labels. The ± buttons are sized as
   single-character squares so a 375 px viewport fits comfortably. */
/* Insight balance (#153) — relocated from the retired status row. Hidden
   when zero so fresh players don't see a zero-stat line. */
.invent-insight { color: var(--fg-muted); margin: 0 0 0.4em; font-size: 13px; }
#invent #invent-rows { width: 100%; }
#invent .invent-stepper { white-space: nowrap; text-align: right; }
#invent .invent-step { min-width: 2em; padding: 0 0.4em; }
#invent .invent-qty { display: inline-block; min-width: 2em; text-align: center; }
#invent #invent-try { margin-top: 0.5em; }
#invent #invent-in-progress { margin-top: 0.5em; }
/* Open-inventions strip (#213): heading + table sit visually apart from
   the stepper rows that follow. Bottom border carries the section break;
   the heading reads as a label, not as a stepper-table column. */
#invent #invent-open-strip { margin-bottom: 0.75em; padding-bottom: 0.5em; border-bottom: 1px solid var(--bar-bg); }
#invent .invent-open-heading { margin: 0 0 0.25em 0; font-size: 0.9em; }
#invent #invent-open-strip-rows { width: 100%; }
#invent #invent-open-strip-rows td { padding: 0.1em 0; }
#invent #recipe-list { width: 100%; margin-top: 0.75em; border-top: 1px solid var(--bar-bg); padding-top: 0.5em; }
#invent .recipe-name { font-style: italic; }

/* Consumable cooldown queue (#124). Pip strip sits above the inventory
   table inside the Inventory section. 10 squares × 8px + 2px gap fits
   ~98px wide — comfortably inside the 375px viewport. Filled pip uses
   the same color-mix token as .tier-progress-strip; empty pip matches
   #energy-bar's --bar-bg. No animation: pips clear discretely as
   expiresAt passes (calm-table principle). The stomach text below is
   muted; the "next opens" suffix is a middle-dot separator (U+00B7). */
.cooldown-pips { display: flex; gap: 2px; margin-top: 4px; }
.cooldown-pip { width: 8px; height: 8px; background: var(--bar-bg); }
.cooldown-pip.cooldown-pip--active { background: color-mix(in srgb, var(--fg) 70%, transparent); }
.cooldown-text { margin: 2px 0 0.5em; font-size: 13px; }
.inv-group-row td { font-style: italic; color: var(--fg-dim); border: none; padding-top: 0.5em; }
.eat-btn { margin-left: 0.4em; }
#eat-error { display: block; min-height: 1em; }

/* --- Item images + detail panel (#266) ----------------------------------
   Thumbnails ride inline on consumable + tool rows at ×2 (32×32 CSS px from
   a 16×16 source PNG). Clicking the row expands an inline detail row below
   it with a ×4 image and flavor / origin text — same in-place pattern as the
   cooldown pip strip and tab contents, never a modal. CSS-only collapse
   animation: max-height transitions in ≤150 ms. Color tokens reused from
   the existing inventory surface (--fg-dim, --border, --input-bg). */
.item-thumb {
  display: inline-block;             /* override the global `img { display: block }` */
  image-rendering: pixelated;
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 6px;
}
.item-row--expandable { cursor: pointer; }
.item-row--expandable:hover .inv-name em { color: var(--fg); }
.item-row--expanded .inv-name em { color: var(--fg); }

.item-detail-row td {
  padding: 0;
  border: none;
}
.item-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 4px 12px;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 150ms ease-out;
}
.item-detail-img {
  image-rendering: pixelated;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}
.item-detail-text { flex: 1 1 auto; min-width: 0; }
.item-detail-flavor {
  margin: 0;
  font-style: italic;
  color: var(--fg);
  line-height: 1.35;
}
.item-detail-origin {
  margin: 4px 0 0;
  font-size: 0.85em;
}

/* --- Feed belt (#198) --- */
.feed-belt {
  font-family: monospace;
  font-size: 13px;
  line-height: 1.3;
  color: var(--fg-muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  margin: 8px 0 4px;
  overflow: hidden;
  white-space: pre;
  width: 100%;
  box-sizing: border-box;
}
#feed-countdown { margin: 2px 0; }
#feed-summary { margin: 2px 0; font-size: 13px; }

/* --- Teaser bar (#233) --------------------------------------------------- */
.teaser-bar {
  text-align: center;
  font-size: 12px;
  color: var(--fg-muted);
  padding: 4px 8px;
  min-height: 1.4em;
  overflow: hidden;
}
.teaser-bar .teaser-character { color: var(--fg); text-decoration: none; }
.teaser-bar a.teaser-character:hover { text-decoration: underline; }
.teaser-fade { animation: teaser-in 0.6s ease-out; }
@keyframes teaser-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Diary bar (#241) ---------------------------------------------------- */
#diary-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  padding: 6px 16px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  z-index: 50;
  box-sizing: border-box;
}
#game-content { padding-bottom: 36px; }
.diary-bar-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg);
  text-decoration: none;
  font-family: monospace;
}
.diary-bar-link:hover .diary-event,
.diary-bar-link:focus-visible .diary-event { text-decoration: underline; }
.diary-event {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.diary-time { flex-shrink: 0; }

/* --- Events page (#241) -------------------------------------------------- */
.events-page { max-width: 480px; margin: 32px auto 0; padding: 0 12px; }
.events-page h1 { font-size: 1.2em; font-weight: normal; margin: 0 0 16px; }
.events-day-label { font-size: 0.9em; font-weight: normal; color: var(--fg-muted); margin: 16px 0 4px; }
.events-day-label:first-child { margin-top: 0; }
.events-row { font-family: monospace; font-size: 13px; padding: 2px 0; }
.events-time { margin-right: 8px; }
#events-show-older {
  display: block;
  margin: 16px auto;
  font-size: 13px;
}

/* --- Dwellings (#300) --- */
.dwelling-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.dwelling-name { font-weight: 600; }
.dwelling-expiry { font-size: 12px; }
.dwelling-raid-btn { min-width: 52px; }

/* --- Recipe placeholders (#353 slice 8) ----------------------------------
   Undiscovered recipes render as blurry placeholders. The icon swap arrives
   with #266; for V1 a CSS blur on the name + dim hint line carries the
   "you don't know it yet" cue. Class is applied to `<em>` so the cell
   layout stays identical to discovered rows. */
.recipe-name-blurred {
  filter: blur(2px);
  color: var(--fg-muted);
  font-style: italic;
}
.craft-row-undiscovered .craft-summary { opacity: 0.85; }
.recipe-hint {
  display: inline-block;
  margin-top: 2px;
  font-style: italic;
}

/* Action strip (#362) — animated SVG scene above the tab bar. Hidden when
   no main-slot action is running; the strip mirrors gather progress (walker
   traversing the surface, picking buried dust glyphs). */
.action-strip {
  margin: 10px 0;
  border: 1px solid var(--border);
  background: #221f1c;
  height: 140px;
  position: relative;
  overflow: hidden;
}
.action-strip__svg { display: block; width: 100%; height: 100%; }
.action-strip__wall-fill   { fill: #4a3f33; }
.action-strip__wall-stroke { stroke: #2a2520; stroke-width: 1; fill: none; }
.action-strip__tier-tag    { fill: #1e1c1a; stroke: #c9b48a; stroke-width: 1; }
.action-strip__tier-text {
  fill: #c9b48a; font-family: monospace; font-size: 7px;
  letter-spacing: 0.1em; text-anchor: middle; dominant-baseline: middle;
}
.action-strip__ground      { fill: #3a2f25; }
.action-strip__ground-line { stroke: #5a4a3a; stroke-width: 1; fill: none; }
.action-strip__dust-glyph {
  font-family: monospace; font-size: 11px; fill: #c9b48a;
  text-anchor: middle; dominant-baseline: middle;
}
.action-strip__divot { fill: #1a1410; }
.action-strip__star  { fill: #f0e8c8; }
.action-strip__walker {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', monospace;
  font-size: 22px;
  text-anchor: middle;
  dominant-baseline: alphabetic;
  /* Mute the colourful default emoji so the walker reads as a calm silhouette
     rather than a brand-mismatched mascot (#362 L15). CSS filters on emoji
     are inconsistent across platforms — a V2 layered SVG walker is filed as
     #393. */
  filter: grayscale(1) opacity(0.75);
}

/* ── Action strip — mode-switched scenes (#454) ─────────────────────────── */

/* Per-mode background gradients via body class (L1 body-class swap). */
body.craft-running .action-strip { background: #211a10; }
body.study-running .action-strip { background: #141820; }
body.raid-running  .action-strip { background: #111620; }
body.is-idle       .action-strip { background: #1c201a; }

/* Raid scene: cooler star tint (#454 L5 cool palette). */
body.raid-running .action-strip__star { fill: #b0c4d4; }

/* Mode label — ⌗ idle / ⌗ gather / etc. (#454 L6) */
.action-strip__mode-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #c9b48a;
  opacity: 0.6;
  pointer-events: none;
}

/* Cave silhouette (home cave for idle, foreign cave for raid). */
.action-strip__cave-fill { fill: #1a1510; }
.action-strip__cave-rock { stroke: #4a3f33; stroke-width: 1.5; fill: none; }

/* Ember at home cave mouth — static, no flicker (L2). */
.action-strip__ember { fill: #ff7020; opacity: 0.38; }

/* Raid: occupancy pulse-light deep inside foreign cave (L5). */
@keyframes action-strip-pulse {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.32; }
}
.action-strip__pulse-light {
  fill: #80a8c8;
  animation: action-strip-pulse 3s ease-in-out infinite;
}

/* Workshop elements (craft + study). */
.action-strip__bench { fill: #4a3f33; }

/* Craft: hearth glow — orange radial, flickering 3 s (#454 L3). */
@keyframes action-strip-hearth {
  0%, 100% { opacity: 0.55; r: 26; }
  33%       { opacity: 0.78; r: 29; }
  66%       { opacity: 0.40; r: 23; }
}
.action-strip__hearth {
  fill: #c05010;
  animation: action-strip-hearth 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Study: lamp dot — static warm white (L4 cue swap). */
.action-strip__lamp { fill: #f0e8c8; opacity: 0.55; }

/* Study: dust-pinch circle at walker's raised palm. */
.action-strip__dust-pinch { opacity: 0.85; }

/* Rising glyph at craft cycle close — ✦ rises and fades (4 s, L3). */
@keyframes action-strip-glyph-rise {
  from { opacity: 0.90; transform: translateY(0); }
  to   { opacity: 0;    transform: translateY(-32px); }
}
.action-strip__glyph-rise {
  animation: action-strip-glyph-rise 4s ease-out forwards;
  fill: #c9b48a;
  font-family: monospace;
  font-size: 13px;
  text-anchor: middle;
  dominant-baseline: middle;
  transform-box: fill-box;
  transform-origin: center;
}

/* Rising glyph at study cycle close — ◌ rises with alpha + blur (6 s, L4). */
@keyframes action-strip-study-rise {
  0%   { opacity: 0.80; transform: translateY(0);     filter: blur(0px);   }
  60%  { opacity: 0.40; transform: translateY(-20px); filter: blur(1.5px); }
  100% { opacity: 0;    transform: translateY(-32px); filter: blur(4px);   }
}
.action-strip__glyph-study-rise {
  animation: action-strip-study-rise 6s ease-out forwards;
  fill: #8a9ab4;
  font-family: monospace;
  font-size: 13px;
  text-anchor: middle;
  dominant-baseline: middle;
  transform-box: fill-box;
  transform-origin: center;
}

/* prefers-reduced-motion: reduce — the JS module skips the RAF loop so
   walker/stars freeze at their initial frame, but the static scene (wall,
   surface, dust glyphs) still renders. Hides only the twinkling-star
   animation via opacity-stabilising at the median. Walker stays at the
   gate, which reads as "you sent someone to gather" without movement.
   For the new scenes, the static read remains coherent in each:
   cave+walker (idle), workbench+hearth+walker (craft), workbench+lamp+
   walker+pinch (study), cave+walker (raid). (#454 L7) */
@media (prefers-reduced-motion: reduce) {
  .action-strip__hearth,
  .action-strip__pulse-light,
  .action-strip__glyph-rise,
  .action-strip__glyph-study-rise {
    animation: none;
  }
}

/* Knowledge sub-page (#363). Math-minded surface off the Attic tab; the
   prototype is at https://qa-art.dust-mine.com/knowledge-363/ (variant A,
   paired-wrap ladder). Locks: L1 (math/hobbyist persona), L15 (paired wrap),
   L16 (roman after band word), L17 (condensed numbers), L18 (number-first
   row), L19 (5-column grid: glyph | name | xp | band | promo). */
.knowledge-page { max-width: 560px; margin: 24px auto 60px; padding: 0 16px; }
.knowledge-page h1 {
  font-size: 1.2em; font-weight: normal;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.knowledge-ladder {
  border: 1px solid var(--border);
  padding: 8px 12px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.7;
}
.kladder-pair { white-space: nowrap; margin-right: 10px; }
.kladder-word { color: var(--fg); }
.kladder-roman { color: var(--fg-dim); }
.kladder-at { color: var(--fg-muted); margin-left: 2px; }
.knowledge-tiers { font-family: monospace; }
.ktier { margin-bottom: 10px; }
.ktier-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.ktier-title { color: var(--fg); }
.ktier-chev { color: var(--fg-muted); width: 1em; display: inline-block; }
.ktier-chev::before { content: '▼'; }
.ktier-collapsed .ktier-chev::before { content: '▶'; }
.ktier-name { margin-left: 2px; }
.ktier-here {
  color: var(--accent);
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ktier-count { color: var(--fg-dim); font-size: 11.5px; }
.ktier-body { padding: 4px 0 10px; }
.ktier-collapsed .ktier-body { display: none; }
.ktier-empty {
  color: var(--fg-dim);
  font-style: italic;
  padding: 2px 0 2px 1.4em;
  font-size: 12.5px;
}
.krow {
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr) 4.5em 9em 11em;
  column-gap: 8px;
  padding: 2px 0;
  align-items: baseline;
  font-size: 13.5px;
}
.krow-glyph {
  font-size: 1.1em;
  line-height: 1;
  font-variant-emoji: text;
  text-align: center;
}
.krow-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.krow-xp { text-align: right; color: var(--fg); }
.krow-band { text-align: left; color: var(--fg); }
.krow-roman { color: var(--fg-dim); }
.krow-promo { text-align: right; color: var(--fg-muted); }
.krow-cap .krow-promo { color: var(--accent); }
.krow-rumor .krow-name { color: var(--fg-dim); font-style: italic; }
.krow-rumor .krow-tail {
  grid-column: 3 / 6;
  text-align: right;
  color: var(--fg-dim);
}
