/* MarketWire — The Night Exchange (design v3) */

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --ink:         #000000;
  --page:        #000000;
  --panel:       rgba(255,255,255,.09);
  --panel-soft:  rgba(255,255,255,.05);
  --rule:        rgba(255,255,255,.13);
  --rule-strong: rgba(255,255,255,.22);

  --paper:    #FFFFFF;
  --dim:      #9A9A9A;

  --phosphor: #34D17A;
  --amber:    #F2A93B;
  --ember:    #E4572E;

  /* ④ type-scale discipline */
  --r-panel: 28px;
  --r-chip:  3px;

  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-data:    "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", system-ui, -apple-system, sans-serif;
  --font-accent:  "Inter", system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--page);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.4;
  min-height: 100dvh;
  overflow-x: hidden;
}
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }

/* ── Small-caps label ──────────────────────────────────────────────────── */
.section-label {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--dim);           /* ⑤ accent rationing: labels stay dim */
  text-transform: uppercase;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--dim);
}
/* ⑤ Chrome borders go neutral */
.badge-web, .badge-telnet, .badge-mcp { color: var(--paper); }

/* ─────────────────────────────────────────────────────────────────────── */
/* ① TICKER TAPE                                                           */
/* ─────────────────────────────────────────────────────────────────────── */
.ticker-wrap {
  background: var(--ink);
  height: 36px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
}
/* Hover pause (also caught by JS motion toggle) */
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 180s linear infinite;
  will-change: transform;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ⑦ JS motion toggle: body.motion-paused stops ticker and flashes */
body.motion-paused .ticker-track { animation-play-state: paused !important; }

.ticker-inner {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);           /* ⑤ default ticker text neutral */
  letter-spacing: .04em;
  padding-right: 4rem;
  flex-shrink: 0;
}
.ticker-sep   { color: var(--rule-strong); margin: 0 .6em; }
.ticker-price { color: var(--amber); }         /* ⑤ prices = amber */
.ticker-up    { color: var(--phosphor); }      /* ⑤ up signal = phosphor */
.ticker-down  { color: var(--ember); }         /* ⑤ down signal = ember */

/* ─────────────────────────────────────────────────────────────────────── */
/* ② MASTHEAD                                                              */
/* ─────────────────────────────────────────────────────────────────────── */
.masthead {
  text-align: center;
  padding: 0;
  background: var(--page);
}

/* ① more air above wordmark */
.masthead-rule-top {
  height: 1px;
  background: var(--rule-strong);
  margin-top: 1.5rem;          /* ① was .75rem */
  margin-inline: 1.5rem;
}

.masthead-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -.01em;
  text-wrap: balance;
  color: var(--paper);
  line-height: 1;
  padding: .65rem 1rem .5rem;  /* ① a touch more air */
}

/* Double rule: 3px + gap + 1px */
.masthead-rule-double {
  margin-inline: 1.5rem;
  border: none;
  box-shadow:
    0 0   0 3px var(--rule-strong),
    0 5px 0 1px var(--rule);
  height: 3px;
  background: var(--rule-strong);
  margin-bottom: 7px;
}

.dateline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: .4rem 1.5rem;       /* ① was .3rem */
  border-bottom: 1px solid var(--rule);
  gap: .5rem;
}
.dateline-clock-row {
  border-bottom: 2px solid var(--rule-strong);
  padding-block: .45rem;       /* ① slightly more */
}

.dateline-left   { text-align: left; }
.dateline-centre { text-align: center; }
.dateline-right  { text-align: right; }

.dateline-left,
.dateline-centre,
.dateline-right {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--dim);
  text-transform: uppercase;
}

/* ⑦ Clock row: dot + clock inline */
.clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4em;
}

/* ⑦ The only decorative dot on the page */
.clock-dot {
  font-size: 7px;
  color: var(--phosphor);
  line-height: 1;
  /* Pulse alongside the wire dot */
  animation: pulse-dot 2s ease-in-out infinite;
}
body.motion-paused .clock-dot { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .clock-dot { animation: none; } }

.clock {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: .06em;
}

.wire-status {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ember);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* ③ HERO ROW                                                              */
/* ─────────────────────────────────────────────────────────────────────── */

/* ② Phosphor glow behind the hero row */
.hero-row-wrap {
  position: relative;
  margin-top: 2.75rem;
  margin-bottom: 2.75rem;
}
.hero-row-wrap::before {
  content: '';
  position: absolute;
  inset: -40px -60px;
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--phosphor) 3%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(24px);
}

.hero-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;                  /* ① panels spaced, not edge-to-edge */
  padding-inline: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ② Depth: soft shadow + 14px radius; no outer border */
.hero-panel {
  background: var(--panel);
  border-radius: var(--r-panel);
  border: none;
  padding: 1.75rem 1.5rem 1.25rem;          /* ① more air inside */
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.hero-panel:hover { background: rgba(255,255,255,.12); }

/* ③ Inverted riser panel: solid phosphor bg, ink text */
.hero-panel--riser { background: var(--panel); }

/* Labels — ⑤ neutral on dark panels, ink on riser */
.hero-label {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--dim);
  text-transform: uppercase;
}

.hero-pair {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -.01em;
  text-wrap: balance;
  font-size: 1.15rem;
  color: var(--paper);
  line-height: 1.2;
  margin-top: .2rem;
}

/* ④ Hero numerals grow: ~56px */
.hero-price {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 3.5rem;
  font-weight: 500;
  color: var(--amber);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: .3rem;
}

.hero-delta {
  font-family: var(--font-data);
  font-size: .78rem;
  font-weight: 500;
  margin-top: .2rem;
  min-height: 1.1em;
}
/* ⑤ phosphor only for genuine up signal; ember for down */
.hero-delta.up   { color: var(--phosphor); }
.hero-delta.down { color: var(--ember); }
.hero-delta.flat { color: var(--dim); }

.hero-sparkline {
  width: 100%;
  height: 36px;
  margin-top: .75rem;
  overflow: visible;
}
/* ⑤ sparklines: phosphor on dark panels */
.spark-area   { fill: color-mix(in srgb, var(--phosphor) 12%, transparent); }
.spark-stroke { fill: none; stroke: var(--phosphor); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
/* On inverted riser: ink sparkline */
/* Graph colour follows direction: green up, red down (set in app.js) */
.hero-panel.is-down .spark-area   { fill: color-mix(in srgb, var(--ember) 12%, transparent); }
.hero-panel.is-down .spark-stroke { stroke: var(--ember); }

/* ─────────────────────────────────────────────────────────────────────── */
/* ④ BOARD + ⑤ WIRE: exchange floor                                       */
/* ─────────────────────────────────────────────────────────────────────── */
.exchange-floor {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 0;
}

/* ── Board ────────────────────────────────────────────────────────────── */
.board-section {
  border-right: 1px solid var(--rule);
  padding: 1.5rem;              /* ① was 1rem */
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;                    /* ① was .75rem */
}

.board-loading {
  color: var(--dim);
  font-family: var(--font-data);
  font-size: .8rem;
  grid-column: 1 / -1;
  padding: .5rem;
}

/* ② Market panels: 14px radius, soft shadow, NO outer border between rows */
.market-panel {
  background: var(--panel);
  border: none;
  border-radius: var(--r-panel);
  overflow: hidden;
  transition: background .2s;
}
.market-panel:hover { background: rgba(255,255,255,.12); }

/* ⑤ Panel header: neutral (no phosphor tint) */
.market-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem 1rem;
  background: color-mix(in srgb, var(--rule) 40%, transparent);
  border-bottom: 1px solid var(--rule);
}
.market-panel-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-wrap: balance;
  color: var(--paper);          /* ⑤ was phosphor */
  text-transform: uppercase;
}
.market-panel-count {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--dim);
}

/* Commodity rows — hairlines only INSIDE panels */
.comm-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 .5rem;
  padding: .65rem 1rem;         /* ① was .5rem */
  border-bottom: 1px solid var(--rule);
  min-height: 44px;
  cursor: pointer;
  transition: background .12s;
}
.comm-row:last-child { border-bottom: none; }
.comm-row:hover      { background: color-mix(in srgb, var(--paper) 3%, transparent); }
.comm-row:focus      { outline: none; }
.comm-row:focus-visible { outline: 2px solid var(--phosphor); outline-offset: -2px; }

.comm-row-top {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  grid-column: 1;
}
.comm-row-right {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: .2rem;
}

.comm-name {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 500;
  color: var(--paper);
}
.comm-unit {
  font-family: var(--font-data);
  font-size: .68rem;
  color: var(--dim);
}

/* Range bar */
.range-bar-wrap {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .25rem;
}
.range-bar-track {
  flex: 1;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.range-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--amber);     /* ⑤ range bar = amber (price accent) */
  border-radius: 2px;
  transition: width .4s ease;
  min-width: 4px;
}
.range-bar-min,
.range-bar-max {
  font-family: var(--font-data);
  font-size: .62rem;
  color: var(--dim);
  white-space: nowrap;
}

/* ④ Board price slightly smaller than v2 hero */
.comm-price {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;           /* ④ was 1.1rem */
  font-weight: 500;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  text-align: right;
}

/* Delta chip */
.delta-chip {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.delta-chip.up   { color: var(--phosphor); }
.delta-chip.down { color: var(--ember); }
.delta-chip.flat { color: var(--dim); }

.comm-provenance {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .15rem;
  flex-wrap: nowrap;
}
.comm-reporter {
  font-family: var(--font-data);
  font-size: .62rem;
  color: var(--dim);
  /* Allow up to 12 chars without ellipsis */
  max-width: 12ch;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* ⑤ WIRE RAIL                                                             */
/* ─────────────────────────────────────────────────────────────────────── */
.wire-rail {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.wire-rail-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.25rem;      /* ① a touch more */
  border-bottom: 1px solid var(--rule);
  background: var(--page);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ⑤ Wire dot = phosphor live signal */
.wire-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--phosphor);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
@media (prefers-reduced-motion: reduce) { .wire-live-dot { animation: none; } }
body.motion-paused .wire-live-dot { animation-play-state: paused !important; }

.wire-feed {
  overflow-y: auto;
  flex: 1;
}
.wire-empty {
  font-family: var(--font-data);
  font-size: .75rem;
  color: var(--dim);
  padding: .75rem 1.25rem;
}

.dispatch {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0 .6rem;
  padding: .6rem 1.25rem .6rem .9rem;  /* ① more air per dispatch */
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}
.dispatch:last-child { border-bottom: none; }

@keyframes dispatch-flash {
  0%   { background: color-mix(in srgb, var(--phosphor) 16%, transparent); }
  100% { background: transparent; }
}
.dispatch.flash { animation: dispatch-flash 600ms ease-out forwards; }
@media (prefers-reduced-motion: reduce) { .dispatch.flash { animation: none; } }
body.motion-paused .dispatch.flash { animation-play-state: paused !important; }

.dispatch-time {
  font-family: var(--font-data);
  font-size: .68rem;
  color: var(--dim);
  line-height: 1.4;
  padding-top: .05rem;
  text-align: right;
}
.dispatch-body { min-width: 0; }
.dispatch-headline {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 500;
  color: var(--paper);
  line-height: 1.3;
  margin-bottom: .15rem;
}
.dispatch-detail {
  font-family: var(--font-data);
  font-size: .68rem;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25em;
}
.dispatch-price { color: var(--amber); font-weight: 500; }  /* ⑤ prices = amber */

/* ─────────────────────────────────────────────────────────────────────── */
/* ⑥ DISPATCH SLIP                                                         */
/* ─────────────────────────────────────────────────────────────────────── */
.dispatch-slip-wrap {
  padding: 3.75rem 1.5rem 3.25rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--page);
}

.dispatch-slip {
  max-width: 860px;
  margin: 0 auto;
  background: var(--panel);
  border-radius: var(--r-panel);
  border: none;
  position: relative;
}
.dispatch-slip::before { content: none; }

.slip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 1.5rem .7rem;
  border-bottom: 1px solid var(--rule);
  margin-top: 2px;
}
.slip-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.01em;
  text-wrap: balance;
  color: var(--paper);
  text-transform: uppercase;
}
.slip-sub {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .06em;
}

.slip-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem 1.5rem;             /* ① was .75rem */
  padding: 1.25rem 1.5rem 1.5rem;
  align-items: start;
}

.slip-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.slip-field--narrow { max-width: 220px; }

.slip-label {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--dim);
  text-transform: uppercase;
}

.slip-input {
  width: 100%;
  background: var(--panel-soft);
  border: none;
  border-radius: 14px;
  padding: .8rem 1rem;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 400;
  outline: none;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
.slip-input:focus       { background: rgba(255,255,255,.09); }
.slip-input::placeholder { color: var(--dim); font-size: .9rem; }

select.slip-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239AA48E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .2rem center;
  padding-right: 1.4rem;
  cursor: pointer;
}
select.slip-input option { background: #171717; color: var(--paper); }

.slip-refusal {
  grid-column: 1 / -1;
  font-family: var(--font-data);
  font-size: .78rem;
  color: var(--ember);
  background: color-mix(in srgb, var(--ember) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--ember) 30%, transparent);
  border-radius: var(--r-chip);
  padding: .45rem .75rem;
}
.slip-success {
  grid-column: 1 / -1;
  font-family: var(--font-data);
  font-size: .78rem;
  color: var(--phosphor);
  background: color-mix(in srgb, var(--phosphor) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--phosphor) 25%, transparent);
  border-radius: var(--r-chip);
  padding: .45rem .75rem;
}

.slip-submit {
  grid-column: 1 / -1;
  background: #FFFFFF;
  color: #000000;
  border: none;
  border-radius: 999px;
  font-family: var(--font-data);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .12em;
  padding: .7rem 1.75rem;
  min-height: 44px;
  cursor: pointer;
  text-transform: uppercase;
  align-self: end;
  justify-self: start;
  transition: background .15s, transform .1s;
}
.slip-submit:hover        { background: rgba(255,255,255,.85); }
.slip-submit:active       { transform: translateY(1px); }
.slip-submit:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ─────────────────────────────────────────────────────────────────────── */
/* ⑥ CLOSING STAMP                                                         */
/* Giant cropped MARKETWIRE wordmark; bleeds off bottom of its band.       */
/* ─────────────────────────────────────────────────────────────────────── */
.closing-stamp {
  overflow: hidden;
  height: 4.5rem;              /* only top ~25% of the letters show */
  line-height: 1;
  padding-top: .5rem;
  padding-inline: 1.25rem;
  background: var(--page);
  border-top: 1px solid var(--rule);
  pointer-events: none;
  user-select: none;

  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18vw;
  letter-spacing: -.01em;
  color: var(--rule);           /* ⑥ dark-green tonal, matches design spec */
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* ⑦ THREE DOORS FOOTER                                                    */
/* ─────────────────────────────────────────────────────────────────────── */
.three-doors {
  background: var(--ink);
  border-top: 2px solid var(--rule-strong);
}

.doors-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.door {
  padding: 1.75rem 1.75rem 2rem;   /* ① more air */
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.door:last-child { border-right: none; }

.door-num {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--rule-strong);
  line-height: 1;
}
.door-badge { margin-bottom: .1rem; }
.door-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--paper);
  text-wrap: balance;
}
.door-desc {
  font-size: .78rem;
  color: var(--dim);
}
.door-cmd {
  font-family: var(--font-data);
  font-size: .72rem;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--r-chip);
  padding: .4rem .65rem;
  color: var(--paper);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  margin-top: .25rem;
}

.copy-btn {
  background: var(--panel);
  border: none;
  border-radius: 999px;
  color: var(--paper);
  font-family: var(--font-data);
  font-size: .65rem;
  letter-spacing: .08em;
  padding: .3rem .65rem;
  cursor: pointer;
  min-height: 44px;
  align-self: flex-start;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover  { background: rgba(255,255,255,.14); }
.copy-btn.copied { color: var(--phosphor); border-color: var(--phosphor); }

/* ⑦ Motion toggle */
.footer-controls {
  padding: 1rem 1.75rem 1.5rem;
  border-top: 1px solid var(--rule);
}
.motion-toggle {
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-chip);
  color: var(--dim);
  font-family: var(--font-data);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  padding: .4rem .9rem;
  cursor: pointer;
  min-height: 44px;
  transition: color .15s, border-color .15s;
  text-transform: uppercase;
}
.motion-toggle:hover { color: var(--paper); border-color: var(--dim); }
.motion-toggle[aria-pressed="true"] { color: var(--phosphor); border-color: var(--phosphor); }

/* ─────────────────────────────────────────────────────────────────────── */
/* HISTORY DRAWER                                                           */
/* ─────────────────────────────────────────────────────────────────────── */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}
.history-overlay[hidden] { display: none; }

.history-drawer {
  background: var(--panel);
  border-left: 1px solid var(--rule);
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
}
.history-title {
  font-family: var(--font-data);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--paper);
  text-transform: uppercase;
}
.history-close {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 1rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-chip);
}
.history-close:hover { color: var(--paper); background: var(--rule); }
.history-body { overflow-y: auto; flex: 1; }
.history-row {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  gap: .4rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-data);
  font-size: .75rem;
  align-items: center;
}
.history-row:last-child { border-bottom: none; }
.history-time     { color: var(--dim); font-size: .68rem; }
.history-price    { color: var(--amber); font-weight: 500; font-variant-numeric: tabular-nums; }
.history-unit     { color: var(--dim); }
.history-reporter { color: var(--dim); font-size: .68rem; text-align: right; }
.history-empty {
  font-family: var(--font-data);
  font-size: .78rem;
  color: var(--dim);
  padding: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* FUEL WATCH STRIP                                                         */
/* ─────────────────────────────────────────────────────────────────────── */
.fuel-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: stretch;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
  border: none;
  border-radius: var(--r-panel);
  overflow: hidden;
  margin: 0 1.5rem 2.75rem;
  border-radius: var(--r-panel);
  overflow: hidden;
}

.fuel-cell {
  padding: .9rem 1.1rem .8rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.fuel-label {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--dim);
  text-transform: uppercase;
}
.fuel-unit {
  font-weight: 400;
  letter-spacing: .04em;
  color: color-mix(in srgb, var(--dim) 60%, transparent);
}

.fuel-price {
  font-family: var(--font-data);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.fuel-price.awaiting {
  color: var(--dim);
  font-size: .88rem;
  font-weight: 400;
}

.fuel-range {
  font-family: var(--font-data);
  font-size: .68rem;
  color: var(--dim);
  min-height: .9em;
}

.fuel-source {
  padding: .9rem 1rem .8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 0;
  border-left: 1px solid var(--rule);
}
.fuel-updated {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .04em;
  color: color-mix(in srgb, var(--dim) 55%, transparent);
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* SCROLLBAR                                                                */
/* ─────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ─────────────────────────────────────────────────────────────────────── */
/* MOBILE — a separate composition, not a stack (design.md, 2026-12-03)     */
/* ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  /* Masthead: compress, centre, one-row clock/badges */
  .masthead { padding-top: .9rem; }
  .masthead-wordmark { font-size: 11.5vw; letter-spacing: -.01em; }
  .dateline {
    grid-template-columns: 1fr;
    text-align: center;
    gap: .25rem;
    padding: .45rem .75rem;
  }
  .dateline-left,
  .dateline-right { text-align: center; }
  .dateline-clock-row { justify-content: center; flex-wrap: wrap; gap: .5rem; }
  .ticker-wrap { font-size: .78rem; }

  /* Hero: swipeable snap carousel — movers are swiped, not scrolled past.
     Panels at 86% width so the next card peeks in as an affordance. */
  .hero-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-inline: .75rem;
    padding-bottom: .35rem;
    gap: .7rem;
    scrollbar-width: none;
  }
  .hero-row::-webkit-scrollbar { display: none; }
  .hero-panel {
    flex: 0 0 86%;
    scroll-snap-align: start;
    padding: 1.05rem 1.1rem .85rem;
    gap: .3rem;
    border-radius: 12px;
  }
  .hero-label { font-size: .66rem; }
  .hero-pair { font-size: 1.02rem; }
  .hero-price { font-size: 2.3rem; }
  .hero-delta { font-size: .86rem; }
  .hero-sparkline { height: 30px; margin-top: .45rem; }

  /* Fuel strip: 2×2 grid, source full-width beneath */
  .fuel-strip {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    margin-inline: .75rem;
    border-radius: 12px;
  }
  .fuel-cell { padding: .75rem .9rem .7rem; }
  .fuel-cell:nth-child(2n) { border-right: none; }
  .fuel-cell:nth-child(3),
  .fuel-cell:nth-child(4)  { border-top: 1px solid var(--rule); }
  .fuel-price { font-size: 1.22rem; }
  .fuel-price.awaiting { font-size: .8rem; }
  .fuel-source {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--rule);
    text-align: center;
    padding: .5rem;
  }

  /* Exchange floor: board first, wire beneath */
  .exchange-floor { grid-template-columns: 1fr; }
  .board-section  { border-right: none; border-bottom: 1px solid var(--rule); padding: .9rem .75rem 1.1rem; }
  .board-grid     { grid-template-columns: 1fr; gap: .7rem; }
  .market-panel   { border-radius: 12px; padding: .85rem .9rem .7rem; }
  .comm-row       { padding: .55rem 0; }
  .comm-price     { font-size: 1.05rem; }
  .range-bar-max,
  .range-bar-min  { font-size: .6rem; }
  .wire-rail      { max-height: none; border-bottom: 1px solid var(--rule); padding: .9rem .75rem 1.1rem; }
  .dispatch       { padding: .6rem 0; }

  /* Dispatch slip: thumb-first */
  .dispatch-slip-wrap { padding-inline: .75rem; }
  .slip-form { gap: .9rem; }
  .slip-field--narrow { max-width: 100%; }
  .slip-input { font-size: 16px; }
  .slip-submit { width: 100%; min-height: 52px; font-size: .95rem; }

  /* Closing stamp + doors */
  .closing-stamp { font-size: 24vw; height: 3.2rem; }
  .doors-row  { grid-template-columns: 1fr; }
  .door       { border-right: none; border-bottom: 1px solid var(--rule); padding: 1.3rem 1rem 1.4rem; }
  .door:last-child { border-bottom: none; }
  .door-num   { font-size: 2rem; }
  .door-cmd   { overflow-x: auto; white-space: nowrap; display: block; }
  .footer-controls { justify-content: center; }
  .footer-controls button { min-height: 44px; padding: .6rem 1.1rem; }

  /* ── App shell: floating glass tab bar + one view at a time ──────────────
     Features are one tap away at all times; scrolling is for content
     within a view, never for navigation. The bar is a detached glass pill
     on its own compositor layer (translateZ + will-change) so scroll
     repaints of the page beneath never make it flicker or lag. */
  html, body { overflow-x: clip; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex;
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 60;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,.09);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 12px 28px -10px rgba(0,0,0,.28), inset 0 0 0 1.5px rgba(255,255,255,.22);
    transform: translateZ(0);
    will-change: transform;
    overflow: hidden;
  }
  .tabbar-btn {
    flex: 1;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--dim);
    font-family: var(--font-ui);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-btn.is-active { color: var(--phosphor); }

  /* View switching by body[data-tab] (set in app.js; default 'board') */
  body[data-tab="board"] .wire-rail,
  body[data-tab="board"] .dispatch-slip-wrap,
  body[data-tab="board"] .closing-stamp,
  body[data-tab="board"] .three-doors { display: none; }

  body[data-tab="wire"] .hero-row-wrap,
  body[data-tab="wire"] .fuel-strip,
  body[data-tab="wire"] .board-section,
  body[data-tab="wire"] .dispatch-slip-wrap,
  body[data-tab="wire"] .closing-stamp,
  body[data-tab="wire"] .three-doors { display: none; }
  body[data-tab="wire"] .wire-rail { max-height: none; }

  body[data-tab="post"] .hero-row-wrap,
  body[data-tab="post"] .fuel-strip,
  body[data-tab="post"] .exchange-floor,
  body[data-tab="post"] .closing-stamp,
  body[data-tab="post"] .three-doors { display: none; }

  body[data-tab="doors"] .hero-row-wrap,
  body[data-tab="doors"] .fuel-strip,
  body[data-tab="doors"] .exchange-floor,
  body[data-tab="doors"] .dispatch-slip-wrap { display: none; }
}

/* Small phones (≤480px): tighten the type scale one more step */
@media (max-width: 480px) {
  .hero-price { font-size: 2.05rem; }
  .hero-panel { flex-basis: 88%; }
  .fuel-price { font-size: 1.12rem; }
  .comm-price { font-size: .98rem; }
  .masthead-wordmark { font-size: 12vw; letter-spacing: -.01em; }
  .ticker-wrap { font-size: .72rem; }
  .tabbar { left: 10px; right: 10px; }
}

/* Tab bar exists only in the mobile app shell */
@media (min-width: 861px) {
  .tabbar { display: none; }
}

/* ── Bencho gallery pass (2026-12-03, user-directed) ─────────────────────── */
@media (min-width: 1280px) {
  .board-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Filter chips (market filter for the board) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 1.25rem 1.5rem 0;
}
.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--panel);
  color: #B4B4B4;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.96); }
.chip.is-active { background: #FFFFFF; color: #000000; }

/* ═══════════════════════════════════════════════════════════════════════════
   BENCHO COMPOSITION (2026-12-03, user-directed): nav + centred hero +
   filter row + masonry gallery of OUR cards. Manager-built frontend layer
   over the Kiro-built system (disclosed in README).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 16px;
  background: rgba(0,0,0,.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 1.1rem; transition: opacity .35s; }
body.scrolled .nav-left, body.scrolled .nav-right { opacity: .45; pointer-events: auto; }
body.scrolled .nav-left:hover, body.scrolled .nav-right:hover,
body.scrolled .nav-left:focus-within, body.scrolled .nav-right:focus-within { opacity: 1; }
.app-icon {
  position: relative;
  width: 30px; height: 30px;
  background: #FFFFFF;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
  flex-shrink: 0;
}
.app-icon-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--phosphor);
}
.brand-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #FFFFFF;
  margin-left: -.35rem;
}
.nav-tab {
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-tab.is-active { color: #FFFFFF; }
.nav-tab:hover { color: #FFFFFF; }
.search-pill {
  display: flex; align-items: center; gap: .5rem;
  height: 36px; min-width: 170px;
  padding: 0 .8rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  cursor: text;
}
.search-pill input {
  background: none; border: none; outline: none;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  width: 110px;
}
.search-pill input::placeholder { color: var(--dim); }
.search-pill kbd {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: .05rem .32rem;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 0 0 rgba(52,209,122,.5);
  animation: livePulse 2.4s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(52,209,122,.45); }
  70% { box-shadow: 0 0 0 7px rgba(52,209,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,209,122,0); }
}
.live-count { font-size: 14px; font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }
.btn-white {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 20px;
  border-radius: 999px;
  background: #FFFFFF; color: #000000;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: background .15s, transform .12s;
}
.btn-white:hover { background: rgba(255,255,255,.86); }
.btn-white:active { transform: scale(.97); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding: 64px 16px 8px;
  display: flex; flex-direction: column; align-items: center;
}
.hero-badge {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .38rem .85rem;
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 1.4rem;
}
.hero-badge span { transition: opacity .45s; }
.hero-badge span.fade { opacity: 0; }
.hero-h1 {
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -.012em;
  line-height: 1.08;
  color: #FFFFFF;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 1.1rem;
  max-width: 460px;
  font-size: 16px;
  line-height: 1.55;
  color: #8E8D88;
  text-wrap: balance;
}
.hero-sub strong { color: #FFFFFF; font-weight: 500; }
.btn-hero { margin-top: 1.6rem; }
.hero-meta {
  margin-top: 1.5rem;
  font-size: 13px;
  color: var(--dim);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.fake-cursor {
  position: absolute;
  left: 12%; top: 30%;
  display: flex; align-items: flex-start; gap: 2px;
  pointer-events: none;
  z-index: 2;
}
.cursor-bubble {
  background: #4F5BFF;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  padding: .42rem .8rem;
  margin-top: 14px;
  white-space: nowrap;
  min-height: 1.1em;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.28);
}

/* ── Filter row ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 0 16px;
  margin-top: 40px;
}
.filter-row .filter-bar { padding: 0; flex: 1; }
.sort-select {
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #B4B4B4;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}
.sort-select option { background: #171717; color: var(--paper); }

/* ── Masonry gallery ─────────────────────────────────────────────────────── */
.gallery {
  columns: 2;
  column-gap: 12px;
  padding: 16px;
}
@media (min-width: 1280px) {
  .gallery { columns: 3; }
}
@media (min-width: 861px) {
  .hero-row, .board-section, .board-grid { display: contents; }
}
.gallery .hero-panel,
.gallery .fuel-strip,
.gallery .market-panel,
.gallery .wire-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
  vertical-align: top;
}
.gallery .fuel-strip {
  grid-template-columns: 1fr 1fr;
  border-radius: var(--r-panel);
}
.gallery .fuel-source {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.wire-card {
  background: var(--panel);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.wire-card-header {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.25rem .4rem;
}
.wire-card .wire-feed { max-height: 540px; overflow-y: auto; }
.wire-status { font-size: 12px; color: var(--ember); letter-spacing: .06em; }
#wireCard, #post, #doors { scroll-margin-top: 72px; }

/* ── Mobile: same design, floating bottom navigation ─────────────────────── */
@media (max-width: 860px) {
  .topnav { padding: 0 12px; }
  .nav-tab, .topnav .btn-white, .search-pill kbd, .brand-name { display: none; }
  .search-pill { min-width: 0; flex: 1; }
  .search-pill input { width: 100%; }
  .hero { padding: 38px 14px 4px; }
  .hero-h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .fake-cursor { display: none; }
  .filter-row { margin-top: 26px; padding: 0 12px; }
  .filter-row .filter-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-row .filter-bar::-webkit-scrollbar { display: none; }
  .sort-select { display: none; }
  .gallery { columns: 1; padding: 12px; }
  .gallery .hero-panel, .gallery .fuel-strip,
  .gallery .market-panel, .gallery .wire-card { display: block; width: auto; }

  /* Tab views on the new structure */
  body[data-tab="board"] .wire-card,
  body[data-tab="board"] .dispatch-slip-wrap,
  body[data-tab="board"] .three-doors { display: none; }

  body[data-tab="wire"] .hero,
  body[data-tab="wire"] .filter-row,
  body[data-tab="wire"] .hero-row,
  body[data-tab="wire"] .fuel-strip,
  body[data-tab="wire"] .board-section,
  body[data-tab="wire"] .dispatch-slip-wrap,
  body[data-tab="wire"] .three-doors { display: none; }
  body[data-tab="wire"] .wire-card .wire-feed { max-height: none; }

  body[data-tab="post"] .hero,
  body[data-tab="post"] .filter-row,
  body[data-tab="post"] .gallery,
  body[data-tab="post"] .three-doors { display: none; }

  body[data-tab="doors"] .hero,
  body[data-tab="doors"] .filter-row,
  body[data-tab="doors"] .gallery,
  body[data-tab="doors"] .dispatch-slip-wrap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .live-dot { animation: none; }
  .fake-cursor { display: none; }
}

/* Search suggestions */
.search-wrap { position: relative; }
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max(100%, 250px);
  background: rgba(18,18,18,.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.1);
  padding: 6px;
  z-index: 70;
  text-align: left;
}
.suggest-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  width: 100%;
  padding: .5rem .65rem;
  border: none; border-radius: 10px;
  background: none;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.suggest-item .suggest-type { font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.suggest-item.is-active, .suggest-item:hover { background: rgba(255,255,255,.09); }

/* Defect fixes: empty-search state + row figure captions */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--dim);
  font-size: 15px;
  padding: 2.5rem 1rem;
  margin: 0;
}
.rb-cap, .comm-price-cap {
  display: block;
  font-style: normal;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.5;
}
.comm-price-cap { text-align: right; }

/* Search row highlight + offline snapshot note */
.comm-row.row-hit {
  background: rgba(242,169,59,.10);
  box-shadow: inset 0 0 0 1px rgba(242,169,59,.5);
  border-radius: 12px;
}
.snapshot-note {
  margin: 0 0 1rem;
  padding: .65rem .9rem;
  border-radius: 12px;
  background: rgba(242,169,59,.12);
  color: var(--amber, #f2a93b);
  font-size: 13px;
  line-height: 1.45;
}
