:root {
  color-scheme: dark;
  /* Hedo Terminal. Old token names are kept so every rule below still resolves. */
  --bg: #07080a;
  --panel: #111316;
  --panel-deep: #0b0c0e;
  --line: #2a2d33;
  --line-soft: #22252b;
  --amber: #ffb000;
  --accent: var(--amber);
  --amber-dim: #7a5400;
  --ink: #e6e1d6;
  --ink-soft: #9a9384;
  --parchment: var(--panel-deep);
  --parchment-deep: #15171b;
  --cream: var(--panel);
  --wood: var(--line);
  --wood-dark: var(--line);
  --wood-light: #1b1d22;
  --gold: var(--amber);
  --gold-dark: var(--amber-dim);
  --grass: var(--amber);
  --shadow: 0 0 0 0 transparent;
  --display: "IBM Plex Sans Condensed", system-ui, sans-serif;
  --body: "IBM Plex Mono", ui-monospace, monospace;
  --happiness: #26d07c;
  --sadness: #5b8def;
  --fear: #b37cff;
  --greed: #d4e157;
  --risk_tolerance: #ff8a3d;
  --confidence: #3fc1c9;
  --energy: #ffb000;
  --curiosity: #ff6fae;
  --up: #26d07c;
  --down: #ff4d5e;
  --chart-bg: #000;
  --chart-grid: #2a2d33;
  --chart-ink: #9a9384;
  --chart-ring: #e6e1d6;
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

body.valley {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
}

a { color: inherit; }
button, input { font: inherit; border-radius: 0; }
button { cursor: pointer; }
h1, h2, h3, .mark, nav a, .kicker, .name, th, summary {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Status bar. The tape repeats once and scrolls; reduced motion stops it. */
.valley-sky {
  position: relative;
  height: 34px;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--amber);
}
.tape {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  color: var(--amber);
  font: 600 12px/1 var(--body);
  letter-spacing: 0.12em;
  white-space: nowrap;
  animation: tape 40s linear infinite;
}
.tape span { padding-right: 0.5em; }

.hill-row {
  --hen: max(0px, calc(14vw + 56px - (100vw - min(1080px, 100vw - 40px)) / 2));
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
  width: min(1080px, calc(100% - 40px));
  margin: 10px auto 0;
  padding-right: 0;
  min-height: 26px;
}
.hill-row .forecast {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 3px 8px;
  color: #000;
  background: var(--amber);
  border: 1px solid transparent;
  font-family: var(--body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forecast {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: var(--display);
  font-size: 12px;
}

.frame {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 40px));
  margin: 18px auto 40px;
  padding: 18px 18px 28px;
  background: var(--parchment);
  border: 1px solid var(--line);
}

.mast {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--amber);
  text-decoration: none;
  font-size: 14px;
}
.mark .sprite { width: 40px; height: 40px; }
.with-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.with-avatar .sprite { width: 40px; height: 40px; flex: none; }

.mast-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.donate {
  margin: 0;
  max-width: 100%;
  padding: 6px 8px 4px;
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: none;
  text-align: right;
}
.donate-label {
  display: block;
  margin-bottom: 2px;
  font-family: var(--display);
  font-size: 11px;
  color: var(--ink-soft);
}
.donate a.address {
  font-size: 14px;
  line-height: 1.2;
  color: var(--amber);
  user-select: all;
}
.donate a.perps {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
  text-underline-offset: 3px;
}
.wallet { max-width: 100%; }
.hill-row .wallet {
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
}
.wallet-row,
.hill-row .wallet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.wallet-connect,
.wallet-disconnect {
  padding: 6px 10px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
  cursor: pointer;
}
.wallet-connect:disabled { cursor: wait; }
.wallet-disconnect { color: var(--ink); background: var(--parchment-deep); }
.wallet-address,
.wallet-usdg {
  padding: 6px 8px;
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.wallet-address { text-underline-offset: 3px; }
.wallet-status,
.hill-row .wallet-status {
  flex-basis: 100%;
  width: fit-content;
  margin: 0 0 0 auto;
  padding: 2px 6px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  text-align: right;
}

nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
nav a {
  display: inline-block;
  padding: 6px 12px;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 11px;
  border: 1px solid var(--line);
  box-shadow: none;
}
nav a:hover { color: var(--ink); border-color: var(--ink-soft); }
nav a[aria-current="page"] { color: #000; background: var(--gold); border-color: var(--gold); }

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.credits, .other-projects ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.other-projects { text-align: right; }
.other-projects h2 { margin-bottom: 6px; }
.colophon a {
  color: var(--ink);
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.kicker {
  display: inline-block;
  margin: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
  font-size: 12px;
}

h1 { margin: 10px 0 14px; color: #fff; font-size: 22px; line-height: 1.35; }
h2 { margin: 0 0 8px; color: var(--amber); font-size: 14px; }
h3 { margin: 0; font-size: 13px; }
.lede, .whisper { margin: 0 0 14px; color: var(--ink-soft); }
.whisper { font-size: 14px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(min(100%, 260px), 0.8fr);
  grid-template-areas:
    "moods figures"
    "journal journal";
  gap: 16px;
  align-items: start;
}
.skill-board { grid-area: moods; min-width: 0; }
.mood-chart, .equity-chart { margin-top: 14px; min-width: 0; }
.equity-chart { width: min(100%, 590px); margin-bottom: 16px; }
.ledger-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: 16px;
}
.ledger-top .equity-chart { flex: 1 1 520px; max-width: 590px; margin-top: 0; margin-bottom: 0; }
.pnl-calendar { flex: 1 1 320px; max-width: 420px; min-width: 0; }
.pnl-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.pnl-nav h2 { margin: 0; font-size: 11px; text-align: center; }
.pnl-edge { min-height: 1em; font-family: var(--display); font-size: 10px; }
.pnl-nav .pnl-edge:last-child { text-align: right; }
.pnl-note {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 10px;
}
.pnl-weekdays, .pnl-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.pnl-weekdays {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 10px;
  text-align: center;
}
.pnl-day {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1px;
  min-height: 46px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--display);
  font-size: 10px;
  line-height: 1.1;
}
.pnl-day.is-out {
  border-color: transparent;
  background: transparent;
  color: #7d786f;
}
/* The day colours come inline from shared/pnl-days.js for a light page.
   On the terminal they are redrawn here from the same shade, so the heat scale is unchanged. */
.pnl-day[style] { color: var(--ink) !important; background: #1b1d22 !important; }
.pnl-day.is-up[style] { background: color-mix(in srgb, #17703a calc(var(--shade, 0) * 100%), #111316) !important; }
.pnl-day.is-down[style] { background: color-mix(in srgb, #a3283a calc(var(--shade, 0) * 100%), #111316) !important; }
.pnl-day.is-today { outline: 2px solid var(--gold-dark); outline-offset: 1px; }
.pnl-date { font-size: 10px; }
.pnl-money, .pnl-count { font-family: var(--body); font-size: 13px; line-height: 1; }
.pnl-count { align-self: flex-end; }
.mood-note, .equity-note {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 11px;
}
.mood-plot, .equity-plot { position: relative; min-width: 0; }
.mood-chart svg, .equity-chart svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--chart-bg);
  border: 1px solid var(--line);
  cursor: crosshair;
  touch-action: manipulation;
}
.mood-chart.is-focused .mood-line { opacity: 0.4; }
.mood-chart.is-focused .mood-line.is-chosen { opacity: 1; }
.mood-float, .equity-float {
  position: absolute;
  z-index: 4;
  display: none;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 6px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.mood-float.is-shown, .equity-float.is-shown { display: inline-flex; }
.mood-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 8px 0 0;
  padding: 0;
}
.mood-legend li {
  display: inline-flex;
  align-items: center;
}
button.mood-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  color: inherit;
  background: transparent;
  border: 2px solid transparent;
  box-shadow: none;
  font-family: var(--display);
  font-size: 11px;
  cursor: pointer;
}
button.mood-key:hover,
button.mood-key[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--parchment-deep);
}
.swatch {
  width: 14px;
  height: 8px;
  border: 0;
}
.swatch.happiness { background: var(--happiness); }
.swatch.sadness { background: var(--sadness); }
.swatch.fear { background: var(--fear); }
.swatch.greed { background: var(--greed); }
.swatch.risk_tolerance { background: var(--risk_tolerance); }
.swatch.confidence { background: var(--confidence); }
.swatch.energy { background: var(--energy); }
.swatch.curiosity { background: var(--curiosity); }
.figures { grid-area: figures; }
.latest { grid-area: journal; }

.skill-board, .panel, .figure, .dialogue, .entry, .slot, .item, .boost-card, .backroom, .notice, .create {
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.skill-board, .panel, .backroom, .create { padding: 14px; }
.panel { margin-top: 16px; }
.panel h2, .backroom h2 { margin-bottom: 12px; }
.clock .lede { margin-bottom: 12px; }
.chimes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chimes li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 8px;
  background: var(--parchment-deep);
  border: 1px solid var(--line);
}
.chimes li span:first-child { font-family: var(--display); font-size: 12px; }
.chimes li span:last-child { color: var(--ink-soft); overflow-wrap: anywhere; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; gap: 3px; }
.bar-label, .figure .detail, .chips, .status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.bar-label strong { font-family: var(--display); font-size: 12px; }
.bar-score { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.boost-link { margin: 10px 0 0; font-family: var(--display); font-size: 12px; }
.boost-chip {
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
  padding: 0 4px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.boost-chip.down { color: #000; background: var(--down); }
.track {
  display: flex;
  align-items: stretch;
  height: 10px;
  padding: 0;
  background: #1b1d22;
  border: 0;
}
.fill, .lift, .fade { height: 100%; flex: 0 0 auto; }
.fill {
  display: block;
  background: var(--bar, var(--gold));
}
.lift {
  background: repeating-linear-gradient(90deg, var(--gold) 0 3px, #ffe3a1 3px 5px);
  box-shadow: inset 0 0 0 1px var(--gold-dark);
}
.fade {
  background: repeating-linear-gradient(-45deg, transparent 0 3px, var(--gold) 3px 5px);
}
.lift[hidden], .fade[hidden] { display: none; }
.fill.happiness { --bar: var(--happiness); }
.fill.sadness { --bar: var(--sadness); }
.fill.fear { --bar: var(--fear); }
.fill.greed { --bar: var(--greed); }
.fill.risk_tolerance { --bar: var(--risk_tolerance); }
.fill.confidence { --bar: var(--confidence); }
.fill.energy { --bar: var(--energy); }
.fill.curiosity { --bar: var(--curiosity); }

.figures { display: grid; gap: 12px; min-width: 0; }
.figure, .dialogue { padding: 12px; min-width: 0; }
.figure .value, .dialogue .value { margin: 0; font-size: 28px; }
.figure .detail, .dialogue .detail { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.dialogue .value, .desire, .action, .lede, .slot p, .boost-card p, .notice {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
a.address, a.tx {
  overflow-wrap: anywhere;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dialogue {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.dialogue > div, .entry > div, .skill-board { min-width: 0; }
.dialogue .value { font-size: 15px; }
.name {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 6px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  font-size: 10px;
}

.coin {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 4px;
  vertical-align: 2px;
  color: #000;
  background: var(--amber);
  font: 600 11px/1.2 var(--body);
  font-style: normal;
}
.coin::before { content: "BD"; }
.chime-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -1px;
  background-color: #000;
  background-image:
    linear-gradient(var(--amber), var(--amber)),
    linear-gradient(var(--amber), var(--amber));
  background-size: 2px 7px, 6px 2px;
  background-position: center 2px, center 7px;
  background-repeat: no-repeat;
  border: 1px solid var(--amber);
}
[data-chime] .value { white-space: nowrap; }

.sprite {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  border: 1px solid var(--line);
}
img.sprite {
  display: block;
  border-color: var(--amber);
  /* Amber tint on the Hedo avatar. */
  filter: grayscale(1) sepia(1) saturate(4) hue-rotate(-12deg) brightness(0.9) contrast(1.1);
  object-fit: cover;
  object-position: center 22%;
}
.dialogue .portrait img.sprite {
  width: 72px;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #000;
}

/* Line icons (Lucide shapes) replace the pixel sprites in headings, empty states and the journal. */
svg.sprite.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--accent);
  background: none;
  border: 0;
  image-rendering: auto;
  flex: none;
}
svg.sprite.icon * { vector-effect: non-scaling-stroke; }
h2.with-avatar svg.sprite.icon { width: 16px; height: 16px; }
h1.with-avatar svg.sprite.icon { width: 18px; height: 18px; }
.empty-scene svg.sprite.icon { width: 18px; height: 18px; }
.entry .portrait svg.sprite.icon {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 11px;
  background: #000;
  border: 1px solid var(--line);
}

.empty-scene {
  display: flex;
  align-items: center;
  gap: 12px;
}
.empty-scene .sprite { width: 56px; height: 56px; flex: none; }
.empty {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel-deep);
  border: 1px dashed var(--line);
}

.chains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  align-items: start;
}
.chain {
  min-width: 0;
  padding: 10px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  container-type: inline-size;
}
.chain h3 { margin-bottom: 8px; }
.snapshot-age {
  margin: -6px 0 12px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
}
.chain .table-wrap { max-width: 100%; }
.balance-table th,
.balance-table td { white-space: nowrap; }
.balance-table th:nth-child(n + 2),
.balance-table td:nth-child(n + 2) { text-align: right; }

/* A narrow chain card keeps every amount and dollar value on the card. */
@container (max-width: 460px) {
  .balance-table thead { display: none; }
  .balance-table,
  .balance-table tbody { display: block; }
  .balance-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line-soft);
  }
  .balance-table td {
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
  }
  .balance-table td:nth-child(1) {
    font-family: var(--display);
    font-size: 13px;
  }
  .balance-table td:nth-child(2) { grid-column: 1 / -1; color: var(--ink-soft); }
  .balance-table td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
}

.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 7px 8px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--cream);
}
th { background: #000; color: var(--amber); font-size: 11px; }
td.up { color: var(--up); }
td.down { color: var(--down); }

.journal { display: grid; gap: 14px; }
.entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 14px 14px 14px 18px;
  background: var(--panel);
}
.entry header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.pnl {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 14px;
}
.pnl.up { color: var(--up); }
.pnl.down { color: var(--down); }
.entry .portrait .sprite { width: 64px; height: 64px; }
.desire { margin: 0 0 4px; font-size: 18px; }
.action { margin: 0 0 8px; }
.chip, .hash {
  padding: 2px 6px;
  background: var(--wood-light);
  border: 1px solid var(--line);
  text-decoration: none;
}
.chip.tx-ok { color: var(--up); background: rgba(38, 208, 124, 0.1); }
.chip.tx-bad { color: var(--down); background: rgba(255, 77, 94, 0.1); }
.hash { font-family: var(--body); font-size: 13px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips li { display: flex; align-items: center; gap: 6px; }
.chips strong {
  font-family: var(--display);
  font-size: 12px;
  padding: 3px 4px 1px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
}
.signal-board { display: grid; gap: 8px; }
.batch {
  min-width: 0;
  padding: 4px 8px 3px;
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.15;
}
.batch time,
.signal-where,
.signal-foot {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.15;
}
.signal-where,
.signal-foot { color: var(--ink-soft); }
.signal-notice {
  margin: 2px 0 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}
.signal-sheet {
  width: max-content;
  margin: 1px 0;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.15;
}
.signal-sheet th,
.signal-sheet td {
  padding: 0 14px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  vertical-align: baseline;
  text-align: left;
}
.signal-sheet thead th {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.signal-sheet tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.signal-sheet td.note,
.signal-sheet th:last-child { white-space: normal; }
.signal-sheet td.note span {
  display: inline-block;
  max-width: min(62ch, calc(100vw - 152px));
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: top;
}
.signal-sheet .picked {
  display: inline-block;
  padding: 0 5px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
  vertical-align: 1px;
}
.signal-sheet tr.is-quiet { color: #8a857a; }
.signal-sheet tr.is-chosen { color: #fff; background: rgba(255, 176, 0, 0.12); }
.backroom .create { margin-top: 12px; }

.entry-link { color: inherit; text-decoration: none; }
.entry-link time { text-decoration: underline; text-underline-offset: 3px; }
.share { margin: 10px 0 0; }
.share a {
  display: inline-block;
  padding: 6px 10px 4px;
  color: var(--ink);
  background: var(--wood-light);
  border: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
  text-decoration: none;
}
.pager { margin-top: 6px; }
.pager .gap {
  padding: 0 2px;
  background: none;
  border: 0;
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
}
.back { margin: 14px 0 0; }
.back a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.counter {
  padding: 14px;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.shelf, .catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 320px));
  justify-content: start;
  gap: 12px;
}
.slot, .item { padding: 12px; }
.shelf > .slot {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 5;
  align-items: start;
  row-gap: 0;
}
.slot .blurb { margin-bottom: 0; }
.slot .effects { margin-bottom: 0; }
.slot-art { position: relative; margin-bottom: 8px; }
.bought,
.prize-mark {
  position: absolute;
  top: 10px;
  z-index: 1;
  margin: 0;
  padding: 1px 6px 2px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.bought { left: 10px; }
.prize-mark { right: 10px; }
.slot.prize,
.item.prize {
  position: relative;
  z-index: 1;
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 0 3px var(--gold);
  animation: prize-glow 1.8s ease-in-out infinite alternate;
}
.slot.prize .stall-art,
.item.prize .stall-art {
  border-color: var(--gold);
  animation: prize-picture 1.8s ease-in-out infinite alternate;
}
.stall-art {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  border: 1px solid var(--line);
  /* Phase 1: the pixel pictures stay, muted until hover or focus. */
  filter: grayscale(0.85) contrast(1.15) brightness(0.85);
  transition: filter 0.2s ease;
}
.slot:hover .stall-art, .slot:focus-within .stall-art,
.item:hover .stall-art, .item:focus-within .stall-art,
.boost-card:hover .stall-art, .boost-card:focus-within .stall-art { filter: none; }
.price, .status { margin: 4px 0; }
.effects { min-height: 2.2em; color: var(--ink-soft); }
.item.disabled { background: #0b0c0e; opacity: 0.6; }
.item header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }

.tip-wrap { position: relative; display: inline-block; max-width: 100%; }
button.tip-button {
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  box-shadow: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: help;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.tip {
  display: none;
  position: absolute;
  z-index: 6;
  left: 0;
  top: calc(100% + 6px);
  width: min(280px, 72vw);
  padding: 8px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
}
.tip-wrap:hover .tip,
.tip-wrap:focus-within .tip { display: block; }
.tip-title { display: block; margin-bottom: 4px; font-family: var(--display); font-size: 12px; }
.tip-body, .tip-dial { display: block; margin: 0; font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.tip-dial { margin-top: 6px; }

.gift, button, .ghost {
  padding: 6px 10px;
  color: #000;
  background: var(--gold);
  border: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--display);
  font-size: 12px;
}
.boost-offer .gift, .boost-offer .book { display: block; width: 100%; margin-top: 8px; text-align: center; }
.boost-offer form { margin: 0; }
.boost-offer .whisper { margin: 6px 0 0; }
.boost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 16px;
  align-items: start;
}
.boost-board-wrap { position: sticky; top: 12px; }
.boost-board-wrap .panel { margin-top: 0; }
.boost-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 280px));
  gap: 12px;
}
.boost-card { padding: 12px; }
.boost-shelf > .boost-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 7;
  align-items: start;
  row-gap: 0;
}
.boost-card > * { margin: 0; }
.boost-card > .slot-art { margin-bottom: 8px; }
.boost-card .effects { min-height: 2.2em; color: var(--ink-soft); }
.boost-card.is-on {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow), 0 0 0 3px var(--gold);
}
.boost-card.is-on .try { color: var(--ink); background: var(--cream); }
.gift:disabled {
  color: var(--ink-soft);
  background: #1b1d22;
  box-shadow: none;
  cursor: not-allowed;
}
.ghost { color: var(--ink); background: var(--parchment-deep); margin-top: 8px; }

.backroom { margin-top: 16px; }
.backroom summary { cursor: pointer; font-size: 12px; }
.backroom p { margin-top: 10px; }
.create { display: grid; gap: 8px; margin-top: 16px; }
label { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 8px; }
input {
  width: 100%;
  padding: 4px 8px;
  color: var(--ink);
  background: #000;
  border: 1px solid var(--line);
}
fieldset { margin: 0; border: 1px solid var(--line); }
.effect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.notice { margin: 0 0 14px; padding: 8px 12px; color: #000; background: var(--gold); }

/* Market regime colours the badge and the status bar rule. */
.season-rain .forecast { color: #000; background: var(--down); }
.season-rain .valley-sky { border-bottom-color: var(--down); }
.season-dusk .forecast { color: var(--amber); background: #000; border: 1px solid var(--amber); }
.season-gold .forecast { color: #000; background: var(--up); }
.season-gold .valley-sky { border-bottom-color: var(--up); }
.season-festival .forecast { color: #000; background: var(--curiosity); }
.season-festival .valley-sky { border-bottom-color: var(--curiosity); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .hill-row { padding-right: 0; }
  .hill-row .forecast { margin: 0; }
}

@media (max-width: 800px) {
  body.valley { font-size: 15px; }
  .hill-row { width: calc(100% - 32px); }
  .hill-row .wallet { position: static; max-width: 100%; }
  .frame {
    width: calc(100% - 32px);
    margin-top: 14px;
    padding: 12px;
  }
  .frame, main, .mast, .mast-side, .donate, .hero, .panel, .journal, .entry > div, .figure, .slot, .item, .boost-card, .boost-layout, .signal, .batch, .equity-chart, .ledger-top, .pnl-calendar {
    min-width: 0;
    max-width: 100%;
  }
  .mast, .dialogue, .entry, .empty-scene { display: block; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "moods"
      "journal"
      "figures";
  }
  .mark { margin-bottom: 10px; }
  .mast-side { align-items: flex-start; }
  .donate { text-align: left; }
  .wallet-row { justify-content: flex-start; }
  .wallet-status { text-align: left; }
  .donate a.address { font-size: 12px; }
  nav { justify-content: flex-start; max-width: 100%; }
  .colophon, .other-projects { display: block; text-align: left; }
  .other-projects { margin-top: 12px; }
  nav a { font-size: 11px; padding: 5px 9px; }
  h1 { font-size: 18px; }
  .desire { font-size: 15px; }
  .figure .value { font-size: 24px; }
  .shelf, .catalog, .boost-shelf, .boost-layout, .effect-grid, .chains, .chimes li { grid-template-columns: minmax(0, 1fr); }
  .boost-board-wrap { position: static; order: -1; }
  .chimes li span, .hash, .chip { max-width: 100%; overflow-wrap: anywhere; }
  .bar-label, .item header, .chips li { flex-wrap: wrap; }
  .chips li { max-width: 100%; }
  .tip {
    position: static;
    width: auto;
    max-width: 100%;
    margin-top: 6px;
  }
  .entry .portrait, .slot-art { margin-bottom: 8px; }
}

@media (max-width: 960px) {
  .bar-label, .chips li { flex-wrap: wrap; }
  .chips li, .tip-wrap { max-width: 100%; }
  .tip {
    position: static;
    width: auto;
    max-width: 100%;
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .tape span + span { display: none; }
}

@keyframes prize-glow {
  from {
    border-color: var(--amber-dim);
    box-shadow: var(--shadow), 0 0 0 1px var(--amber-dim);
  }
  to {
    border-color: var(--amber);
    box-shadow: var(--shadow), 0 0 0 1px var(--amber), 0 0 12px rgba(255, 176, 0, 0.45);
  }
}
@keyframes prize-picture {
  from { border-color: var(--amber-dim); }
  to { border-color: var(--amber); }
}

@keyframes tape {
  to { transform: translateX(-50%); }
}
