/* HOODCAP — production skin (Robinhood Chain).
   A black surface over the DOM contract in docs/DOM-CONTRACT.md: rounded panels lifted off a
   true-black ground by three surface steps and hairline borders. One signature green for YES /
   up / live, red for NO / down / loss, amber for the honesty markers and nothing else — the
   binding rules live in docs/PALETTE.md. Numbers stay mono, tabular and high-contrast.
   Loaded after tokens.css; every token below deliberately overrides it.

   Layout notes that are easy to break:
   - `#markets-body` is a <tbody> the script fills with <tr>. It is `display: contents` so the
     rows become flex items of `.table`; that is the only way to paint the spotlight row ABOVE
     the column-header strip without touching dashboard.js.
   - `.odds` holds bar-then-percent in DOM order, so it is reversed with `column-reverse`.
   - `.odds__pct` text is overwritten by the script, so the "chance" label is a ::after. */

/* ============================================================ tokens */
:root {
  --bg: #000000;
  --bg-1: #0b0d0c;
  --bg-2: #131614;
  --bg-3: #1b1f1d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);

  --fg: #ffffff;
  --fg-1: #d6dbd8;
  --fg-2: #969e9a;
  --fg-3: #667069;

  --green: #00c805;
  --green-2: #35e83a;
  --green-dim: rgba(0, 200, 5, .14);
  --green-line: rgba(0, 200, 5, .35);
  --red: #ff5000;
  --red-2: #ff7a3d;
  --red-dim: rgba(255, 80, 0, .14);
  --amber: #ffb62a;
  --amber-dim: rgba(255, 182, 42, .13);

  /* the retired category hues are replaced by white at three opacities: a panel, a chip or a
     rank medal may only differ from another one by how bright its neutral is */
  --neutral-1: rgba(255, 255, 255, .55);
  --neutral-2: rgba(255, 255, 255, .28);
  --neutral-3: rgba(255, 255, 255, .12);

  --yes: var(--green);
  --no: var(--red);

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: var(--font-sans);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 15px;
  --fs-xl: 22px;

  --pad: 14px;
  --gap: 14px;
  --page-x: 20px;
  --rail-l: 214px;
  --rail-r: 266px;

  /* market table geometry — the media queries only retune these */
  --c-meme: 116px;
  --c-spark: 36px;
  --c-cap: 98px;
  --c-odds: 70px;
  --c-yes: 44px;
  --c-no: 44px;
  --c-vol: 46px;
  --c-ends: 50px;
  --c-gap: 6px;

  color-scheme: dark;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 500 var(--fs-md)/1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
b, strong { font-weight: 700; }
h1, h2, h3 { margin: 0; }
::selection { background: rgba(0, 200, 5, .32); }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, .03); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); background-clip: padding-box; }

/* ---- text utilities ---- */
.mono { font-family: var(--font-mono); }
.up, .yes { color: var(--green); }
.down, .no { color: var(--red); }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); }
.amber { color: var(--amber); }
.accent { color: var(--fg); }
.sep { color: var(--fg-3); opacity: .8; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
  padding: 0 var(--page-x);
  background: rgba(0, 0, 0, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand__badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--green);
}
/* the mark is knocked out to black so the badge reads as the brand colour, not as a sticker */
.brand__logo { width: 25px; height: 25px; filter: brightness(0); }
.brand__text { display: flex; flex-direction: column; gap: 3px; line-height: 1.05; }
.brand__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fg);
}
/* the subtitle used to be 10px grey mono; it is a sentence, so it gets sentence type */
.brand__sub {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .005em;
  text-transform: none;
  color: var(--fg-1);
  white-space: nowrap;
}

/* ---- live block readout (grafted from v1) ---- */
.blockread {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 14px 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-1);
}
.blockread__top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.blockread__id { color: var(--fg-3); }
.blockread__main { display: flex; align-items: baseline; gap: 9px; }
.blockread__hash { font-family: var(--font-mono); font-size: 14px; color: var(--fg-3); }
.blockread__n {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
  color: var(--fg);
}
.blockread__lat {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-1);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.blockread__label {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.chip__stale {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--amber-dim);
  border: 1px solid rgba(255, 182, 42, .4);
  color: var(--amber);
  letter-spacing: .06em;
}

.dot {
  flex: none;
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
  animation: dot-pulse 1.8s ease-in-out infinite;
}
.dot--off { background: var(--fg-3); box-shadow: none; animation: none; }
.dot--warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.dot--bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
@keyframes dot-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.28); opacity: .75; } }

.topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--green-dim);
  border: 1px solid var(--green-line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--green);
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: transform .1s ease, background .14s ease;
}
.wallet-btn .dot { background: var(--fg-3); box-shadow: none; animation: none; }
.wallet-btn:hover { background: var(--bg-3); }
.wallet-btn:active { transform: translateY(1px); }
.chain-badge { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.chain-badge--ok { color: #001b00; background: var(--green); }
.chain-badge--bad { color: #1a0500; background: var(--red); }

/* ============================================================ strips */
/* The hazard strip must stay honest without out-shouting the page: muted amber wash,
   solid pill for the word DEMO, body text at full legibility. */
.strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.strip--demo {
  color: #ffd79a;
  background: var(--amber-dim);
  border-bottom: 1px solid rgba(255, 182, 42, .26);
}
.strip__pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--amber);
  color: #241800;
  font-weight: 700;
  letter-spacing: .2em;
}
.strip__txt { color: #ffd79a; }

/* ---- price ticker: pills with a sans label and a mono figure ---- */
.ticker {
  height: 38px;
  overflow: hidden;
  background: rgba(255, 255, 255, .028);
  border-bottom: 1px solid var(--line);
}
.ticker__track {
  display: flex;
  align-items: center;
  height: 38px;
  width: max-content;
  animation: marquee var(--ticker-dur, 60s) linear infinite;
  will-change: transform;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  height: 26px;
  margin: 0 4px;
  padding: 0 13px;
  border-radius: 999px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-2);
  transition: background .15s, color .15s;
}
.ticker__item:hover { background: rgba(255, 255, 255, .08); color: var(--fg); }
.ticker__item b {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fg);
}
.ticker__item .up { color: var(--green); }
.ticker__item .down { color: var(--red); }
.ticker__item .yes { font-weight: 700; color: var(--green); }
.ticker__item.muted { color: var(--fg-3); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================ page shell */
.page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
  max-width: 2400px;
  margin: 0 auto;
  padding: 14px var(--page-x) 30px;
}
.grid {
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  gap: var(--gap);
  align-items: start;
}
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ---- the pitch: the product promise, promoted out of 10px micro-copy ---- */
.pitch {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 36px;
  padding: 2px 2px 0;
}
.pitch__title {
  font-family: var(--font-sans);
  font-size: clamp(24px, 2.55vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--fg);
}
/* the one green phrase in the headline: it names the live moment, not a decoration */
.pitch__title em {
  font-style: normal;
  color: var(--green);
}
.pitch__sub {
  display: none;
  flex: 0 1 520px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--fg-2);
}

/* ---- stat band (no decorative mini charts: the accent underline carries the colour) ---- */
.statband {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
/* One card is green because it counts what is live; the rest separate by neutral weight
   alone, so a green number keeps meaning something. */
.stat {
  --hue: var(--neutral-2);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-1);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.stat::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--hue);
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--fg);
}
.stat__value.up { color: var(--green); }
.stat__value.down { color: var(--red); }
.stat--live { --hue: var(--green); }
.stat--oi { --hue: var(--neutral-3); }
.stat--vol { --hue: var(--neutral-2); }
.stat--res { --hue: var(--neutral-3); }
.stat--pnl { --hue: var(--neutral-2); }

/* the honesty tags: solid fill, dark ink — they must read at 9px on a dark panel */
.tag {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
}
.tag--demo { color: #241800; background: var(--amber); }
/* paper is an honesty marker too, so it joins demo in amber instead of reading as a YES */
.tag--paper { color: var(--amber); background: var(--amber-dim); box-shadow: inset 0 0 0 1px rgba(255, 182, 42, .4); }

/* ============================================================ panel */
.panel {
  --panel-accent: var(--neutral-3);
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--panel-accent);
}
/* the only accented panel on the page: the live markets table it is built around */
.panel--green { --panel-accent: var(--green-line); }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
}
.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}
.panel__title::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--panel-accent);
}
.panel__title .sep { font-weight: 400; }
.panel__title .accent { color: var(--fg); }
.panel__note {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 10px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col--left .panel__note { display: none; }
/* the book panel's note carries the paper disclaimer, which may never be half-shown:
   it wraps onto a second line rather than being cut off by the shared ellipsis rule */
#book-note {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.col--right .panel__head { flex-wrap: wrap; align-content: center; padding-top: 8px; padding-bottom: 8px; row-gap: 1px; }
.col--right .panel__note { flex: 1 0 100%; padding-left: 17px; text-align: left; }
.panel__body { min-width: 0; padding: 8px; }
.panel__empty {
  padding: 24px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  text-align: center;
  line-height: 1.7;
}

/* ---- yes / no legend beside the markets header (grafted from v2) ---- */
.legendset { display: flex; align-items: center; gap: 14px; flex: none; }
.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.legend__sw { width: 10px; height: 10px; border-radius: 3px; }
.legend__sw--yes { background: var(--green); }
.legend__sw--no { background: var(--red); }
.legend--hint {
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-3);
}

/* ============================================================ list rows (rails) */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 9px;
  border-radius: 12px;
  font-size: 12.5px;
  overflow: hidden;
  transition: background .15s ease, transform .15s ease;
}
.row + .row { margin-top: 3px; }
.row:hover { background: rgba(255, 255, 255, .06); transform: translateX(3px); }
.row--hl {
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.row--hl:hover { background: rgba(255, 255, 255, .11); }
.row__rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.row__sym {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__sym:hover { color: var(--fg); }
.row__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__right {
  flex: none;
  max-width: 44%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
}
.row__right .row__sub { text-align: right; font-weight: 400; }

/* New launches: the ticker is the point of the row, so the age pill gives up width first
   and the symbol gets tight tracking rather than an ellipsis ($BITSHARK, $PICKLEPONS). */
#launches .row { gap: 8px; padding: 5px 7px; min-height: 42px; }
#launches .row__main { flex: 1 1 auto; }
#launches .row__sym { font-size: 12.5px; letter-spacing: -.04em; }
#launches .row__right { max-width: 38%; flex: 0 1 auto; }
/* the age pill is not a price move: it keeps the .up hook but never the up colour */
#launches .row__right > .up {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--fg-2);
  font-size: 10px;
  letter-spacing: -.02em;
}

/* forecaster board: rank reads by brightness, because a medal may not introduce a hue */
.panel__body--board .row { gap: 7px; min-height: 40px; padding: 4px 6px; }
.panel__body--board .row__rank { width: 22px; height: 22px; border-radius: 7px; }
.panel__body--board .avatar { --size: 22px !important; }
.panel__body--board .row__sym { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: -.06em; }
.panel__body--board .row__right { max-width: 38%; font-size: 10.5px; letter-spacing: -.04em; }
.panel__body--board .row:nth-child(1) .row__rank,
.panel__body--board .row:nth-child(2) .row__rank,
.panel__body--board .row:nth-child(3) .row__rank {
  border-radius: 50%;
  color: #000000;
  font-size: 11.5px;
  font-weight: 700;
}
.panel__body--board .row:nth-child(1) .row__rank { background: #ffffff; }
.panel__body--board .row:nth-child(2) .row__rank { background: var(--neutral-1); }
.panel__body--board .row:nth-child(3) .row__rank { background: var(--neutral-2); }
.panel__body--board .row:nth-child(1) { background: rgba(255, 255, 255, .05); }
.panel__body--board .row--hl .row__rank { background: var(--fg); color: #000000; }
.panel__body--board .row--hl::after {
  content: 'you';
  flex: none;
  align-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: var(--fg);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ============================================================ badges */
/* The demo/real badges are the honesty markers: solid fill, dark ink, never a pale outline. */
.badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 9px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: middle;
  flex: none;
}
/* demo is amber and solid; real is deliberately quieter, so the honesty marker wins the eye */
.badge--demo {
  color: #241800;
  background: var(--amber);
}
.badge--real {
  color: var(--fg);
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.badge--new {
  color: #001b00;
  background: var(--green);
  animation: badge-pop 1.4s ease-in-out infinite;
}
.badge--yes { color: #001b00; background: var(--green); }
.badge--no { color: #1a0500; background: var(--red); }
.badge--muted { color: var(--fg-1); background: rgba(255, 255, 255, .1); }
@keyframes badge-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }

/* ============================================================ avatar */
.avatar {
  --size: 32px;
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size);
  height: var(--size);
  border-radius: 32%;
  border: 1.5px solid var(--line-2);
  background: var(--bg-3);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: calc(var(--size) * .36);
  font-weight: 700;
  letter-spacing: -.02em;
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

#launches .avatar { --size: 28px !important; }
#leaderboard .avatar { --size: 22px !important; }
#markets-body .avatar { --size: 32px !important; }
#resolved .avatar { --size: 24px !important; }
.provider .avatar { --size: 26px !important; }

/* ============================================================ markets table */
/* `.table` is a flex column so the spotlight row can be pulled above the header strip with
   `order`; `#markets-body` is display:contents so its <tr> are the flex items. */
.table-wrap { padding: 6px 10px 10px; overflow-x: auto; }
.table {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.table colgroup, .table col { display: none; }
.table thead { display: block; order: 2; }
#markets-body { display: contents; }
#markets-body > tr { order: 3; }
#markets-body > tr:first-child:not(.sk-row) { order: 1; }

.table thead tr,
#markets-body > tr {
  display: grid;
  grid-template-columns:
    var(--c-meme) var(--c-spark) minmax(0, 1fr)
    var(--c-cap) var(--c-odds) var(--c-yes) var(--c-no) var(--c-vol) var(--c-ends);
  grid-template-areas: "meme spark q cap odds yes no vol ends";
  column-gap: var(--c-gap);
  align-items: center;
}

/* the column-header strip sits directly above the first ordinary row and shares its grid */
.table thead tr {
  padding: 0 11px;
  margin: 2px 0 5px;
  border-bottom: 1px solid var(--line);
}
.table th {
  display: block;
  padding: 0 0 6px;
  text-align: left;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.table th:nth-child(1) { grid-area: meme; }
.table th:nth-child(2) { grid-area: spark; }
.table th:nth-child(3) { grid-area: q; color: var(--fg-2); }
.table th:nth-child(4) { grid-area: cap; }
.table th:nth-child(5) { grid-area: odds; }
.table th:nth-child(6) { grid-area: yes; }
.table th:nth-child(7) { grid-area: no; }
.table th:nth-child(8) { grid-area: vol; }
.table th:nth-child(9) { grid-area: ends; }
.table th.th-r, .td-r { text-align: right; }
.table th.th-c, .td-c { text-align: center; }

#markets-body > tr {
  position: relative;
  min-height: 56px;
  padding: 7px 11px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .022);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
/* the affordance the copy promises: a hover rail, and a solid white rail when focused */
#markets-body > tr::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background .16s ease;
}
#markets-body > tr:hover {
  background: rgba(255, 255, 255, .085);
  border-color: var(--line-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
#markets-body > tr:hover::before { background: var(--line-2); }
#markets-body > tr.is-focus {
  border-color: var(--line-2);
  background: var(--bg-2);
}
#markets-body > tr.is-focus::before { background: var(--fg); }
#markets-body > tr.is-focus .meme__sym { color: var(--fg); }

#markets-body > tr > td { display: block; padding: 0; min-width: 0; }
#markets-body > tr > td:nth-child(1) { grid-area: meme; }
#markets-body > tr > td:nth-child(2) { grid-area: spark; }
#markets-body > tr > td:nth-child(3) { grid-area: q; }
#markets-body > tr > td:nth-child(4) { grid-area: cap; }
#markets-body > tr > td:nth-child(5) { grid-area: odds; }
#markets-body > tr > td:nth-child(6) { grid-area: yes; }
#markets-body > tr > td:nth-child(7) { grid-area: no; }
#markets-body > tr > td:nth-child(8) { grid-area: vol; text-align: right; }
#markets-body > tr > td:nth-child(9) { grid-area: ends; text-align: right; }

.meme { display: flex; align-items: center; gap: 9px; min-width: 0; }
.meme__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.12; }
/* long tickers ($MONEROCKET) get a wide cell and tight tracking instead of an ellipsis */
.meme__sym {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meme__sym:hover { color: var(--fg); }
.meme__rank {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meme__rank.up { color: var(--green); }
.meme__rank.down { color: var(--red); }

.spark { display: block; line-height: 0; }
.spark svg { display: block; width: 100%; height: 24px; overflow: visible; }
.spark svg polyline { stroke-width: 2; }
.spark svg.spark-up polyline { stroke: var(--green); }
.spark svg.spark-up circle { fill: var(--green); }
.spark svg.spark-down polyline { stroke: var(--red); }
.spark svg.spark-down circle { fill: var(--red); }

/* the question keeps its own column, so every row is exactly one line tall */
.q {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-1);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#markets-body > tr:hover .q { color: var(--fg); }
.q--muted { color: var(--fg-3); font-style: italic; }

.captarget { line-height: 1.2; }
.captarget__vals {
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.captarget__vals .cap { font-weight: 700; color: var(--fg); }
.captarget__vals .sep { padding: 0 3px; }
.captarget__vals .tgt { color: var(--fg-2); }
/* cap progress is neutral on purpose: green is reserved for YES, red for NO */
.bar {
  height: 4px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--neutral-1);
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
}
/* the hold template measures distance to a floor rather than to a target: dimmer, not redder */
.bar__fill--no { background: var(--neutral-2); }

/* ---- odds: the probability is the row's headline, the split bar is its footnote ---- */
.odds {
  display: flex;
  flex-direction: column-reverse;  /* runtime DOM order is bar, then percent */
  align-items: stretch;
  justify-content: center;
  gap: 5px;
}
.odds__pct {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.odds__pct::after {
  content: 'chance';
  display: block;
  margin-top: 3px;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.odds__bar {
  width: 100%;
  height: 4px;
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 80, 0, .7);
}
.odds__yes {
  height: 100%;
  background: var(--green);
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
}

#markets-body > tr > td:nth-child(8) > span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-1);
}

.ends {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--fg-1);
}
.ends--soon {
  color: var(--fg);
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px var(--line-2);
  animation: soon 1s steps(2, end) infinite;
}
.ends--closed { color: var(--fg-3); background: rgba(255, 255, 255, .04); }
@keyframes soon { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---- HOTTEST MARKET spotlight: the first data row, restyled by CSS alone ---- */
#markets-body > tr:first-child:not(.sk-row) {
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr) minmax(0, .84fr) minmax(0, .84fr);
  grid-template-areas:
    "meme meme  spark flag"
    "q    q     q     q"
    "cap  odds  vol   ends"
    "yes  no    .     .";
  column-gap: 15px;
  row-gap: 7px;
  align-items: center;
  min-height: 0;
  padding: 12px 17px 14px;
  margin-bottom: 11px;
  border: 1.5px solid var(--green-line);
  border-radius: 20px;
  /* the single soft green glow the palette allows, and only behind this card */
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(0, 200, 5, .10), transparent 68%),
    var(--bg-1);
  box-shadow: 0 0 48px rgba(0, 200, 5, .07);
}
#markets-body > tr:first-child:not(.sk-row)::before {
  content: 'hottest right now';
  position: static;
  grid-area: flag;
  justify-self: end;
  align-self: center;
  width: auto;
  top: auto;
  bottom: auto;
  padding: 5px 13px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
#markets-body > tr:first-child:not(.sk-row):hover::before { background: rgba(255, 255, 255, .18); }
#markets-body > tr:first-child:not(.sk-row).is-focus {
  border-color: var(--green);
  box-shadow: 0 0 48px rgba(0, 200, 5, .12);
}
#markets-body > tr:first-child:not(.sk-row) .avatar { --size: 48px !important; border-radius: 26%; }
#markets-body > tr:first-child:not(.sk-row) .meme { gap: 14px; }
#markets-body > tr:first-child:not(.sk-row) .meme__sym { font-size: 25px; letter-spacing: -.03em; }
#markets-body > tr:first-child:not(.sk-row) .meme__rank { font-size: 12px; }
#markets-body > tr:first-child:not(.sk-row) .badge--new { height: 20px; font-size: 9.5px; }
/* the sparkline runs inline with the token title instead of floating full-height */
#markets-body > tr:first-child:not(.sk-row) .spark svg { height: 40px; }
#markets-body > tr:first-child:not(.sk-row) .q {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
  white-space: nowrap;
}
#markets-body > tr:first-child:not(.sk-row) .captarget__vals { font-size: 15px; }
#markets-body > tr:first-child:not(.sk-row) .bar { height: 6px; margin-top: 7px; }
#markets-body > tr:first-child:not(.sk-row) .odds { gap: 6px; }
#markets-body > tr:first-child:not(.sk-row) .odds__bar { height: 6px; }
#markets-body > tr:first-child:not(.sk-row) .odds__pct { font-size: 30px; }
#markets-body > tr:first-child:not(.sk-row) .odds__pct::after { font-size: 8.5px; }
#markets-body > tr:first-child:not(.sk-row) .ends { font-size: 13px; padding: 7px 13px; }

/* CSS-generated labels — the spotlight has room for them, the compact rows do not */
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(4)::before { content: 'cap vs target'; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(5)::before { content: 'odds'; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(6)::before { content: 'buy yes'; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(7)::before { content: 'buy no'; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(8)::before { content: 'volume 24h'; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(9)::before { content: 'ends in'; }
#markets-body > tr:first-child:not(.sk-row) > td::before {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: left;
}
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(6),
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(7),
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(8),
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(9) { text-align: left; }
#markets-body > tr:first-child:not(.sk-row) > td:nth-child(8) > span { font-size: 15px; font-weight: 700; color: var(--fg); }
/* equal-width buy pills, each sitting under its own label */
#markets-body > tr:first-child:not(.sk-row) .btn--yes,
#markets-body > tr:first-child:not(.sk-row) .btn--no {
  width: 100%;
  max-width: 180px;
  height: 42px;
  font-size: 17px;
  border-radius: 13px;
}

/* ============================================================ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  min-width: 44px;
  padding: 0 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--fg-1);
  background: rgba(255, 255, 255, .07);
  transition: transform .09s ease, background .14s ease, color .14s ease;
}
.btn:hover { background: rgba(255, 255, 255, .13); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn--yes {
  color: #001b00;
  background: var(--green);
}
.btn--yes:hover { color: #001b00; background: var(--green-2); }
.btn--yes:active { transform: translateY(1px); }
.btn--no {
  color: #1a0500;
  background: var(--red);
}
.btn--no:hover { color: #1a0500; background: var(--red-2); }
.btn--no:active { transform: translateY(1px); }
.btn--solid-yes { color: #001b00; background: var(--green); }
.btn--solid-no { color: #1a0500; background: var(--red); }
.btn--wide { width: 100%; }
.btn--sm { height: 28px; min-width: 0; width: auto; padding: 0 12px; font-size: 11px; }

/* In an ordinary row the cent pills are secondary: the probability leads, they follow. */
#markets-body > tr:not(:first-child) .btn--yes,
#markets-body > tr.sk-row .btn--yes,
#markets-body > tr:not(:first-child) .btn--no,
#markets-body > tr.sk-row .btn--no {
  height: 28px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
}
#markets-body > tr:not(:first-child) .btn--yes {
  color: var(--green);
  background: var(--green-dim);
  box-shadow: inset 0 0 0 1px var(--green-line);
}
#markets-body > tr:not(:first-child) .btn--yes:hover {
  color: #001b00;
  background: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
#markets-body > tr:not(:first-child) .btn--no {
  color: var(--red-2);
  background: var(--red-dim);
  box-shadow: inset 0 0 0 1px rgba(255, 80, 0, .35);
}
#markets-body > tr:not(:first-child) .btn--no:hover {
  color: #1a0500;
  background: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
#markets-body > tr:not(:first-child) .btn:active { transform: translateY(1px); }

/* ============================================================ skeleton */
#markets-body > tr.sk-row {
  border-color: transparent;
  background: rgba(255, 255, 255, .02);
}
.sk {
  display: inline-block;
  height: 12px;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.sk--round { width: 32px !important; height: 32px; border-radius: 32%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================ focus panel */
.focus__target {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fg);
}
.focus__target-l {
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.focus__canvas { display: block; width: 100%; height: 200px; border-radius: 13px; background: rgba(0, 0, 0, .22); }
.focus__readout {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  padding: 11px 2px 2px;
}
.focus__big {
  flex: none;
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--green);
}
.focus__big small {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--fg-3);
  letter-spacing: .18em;
  text-transform: uppercase;
}
/* the compact stat cluster (cap / needs / sigma / ends) sits beside the big cents figure */
.focus__meta {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-1);
  text-align: left;
  line-height: 1.85;
  white-space: pre-line;
}
.focus__stamp {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 8px;
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-3);
}
.focus__stamp > span { white-space: nowrap; }

/* ============================================================ order book
   Three stacked blocks inside one panel body: the ladder, the ticket, the resting
   orders. The ladder columns (price / shares / cumulative $) are shared by the row
   header, the levels and the spread row, so the three must be retuned together. */
.panel__body--book { display: flex; flex-direction: column; }
.book { padding: 2px 0; }
.book__cols,
.book__row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 56px;
  align-items: center;
  padding: 0 8px;
}
.book__cols {
  height: 18px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.book__cols span + span { text-align: right; }
.book__row {
  position: relative;
  height: 24px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s ease;
}
.book__row:hover { background: rgba(255, 255, 255, .08); }
.book__row:focus-visible { outline: 1px solid var(--fg-2); outline-offset: -1px; }
.book__depth { position: absolute; top: 2px; bottom: 2px; right: 0; border-radius: 8px; opacity: .26; pointer-events: none; }
.book__row--ask .book__depth { background: linear-gradient(90deg, rgba(255, 80, 0, .12), var(--red)); }
.book__row--bid .book__depth { background: linear-gradient(90deg, rgba(0, 200, 5, .12), var(--green)); }
.book__c { position: relative; font-weight: 700; }
.book__row--ask .book__c { color: var(--red); }
.book__row--bid .book__c { color: var(--green); }
.book__size {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--fg-1);
}
.book__usd { position: relative; text-align: right; color: var(--fg-3); font-size: 10px; }
/* the visitor's own resting size at that level — the dot is the "this is yours" marker */
.book__mine {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--fg);
}
.book__spread {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 26px;
  margin: 5px 6px;
  border-radius: 999px;
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-2);
}
/* one of your limits is on the wrong side of the touch and the next tick will take it */
/* amber is reserved for the honesty markers, so a crossed touch shouts in white instead */
.book__spread--crossed {
  background: var(--bg-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg);
}
.book__last { font-weight: 700; color: var(--fg); }
.book__last.up { color: var(--green); }
.book__last.down { color: var(--red); }
/* two lines high whatever it says, so hovering a level never shifts the ticket below it */
.book__hint {
  min-height: 26px;
  margin: 6px 2px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  color: var(--fg-3);
}

/* ============================================================ ticket */
.ticket {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg-2);
}
.ticket--flash { animation: ticket-flash .9s ease; }
@keyframes ticket-flash {
  0% { border-color: var(--fg); box-shadow: 0 0 0 0 rgba(255, 255, 255, .35); }
  60% { border-color: var(--fg); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.ticket__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket__title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket__q {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .3);
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg__b {
  height: 26px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}
.seg__b:hover { color: var(--fg-1); background: rgba(255, 255, 255, .07); }
.seg__b.is-on { color: var(--fg); background: rgba(255, 255, 255, .12); }
.seg--side .seg__b.is-on { color: var(--fg); background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg--outcome .seg__b[data-v="YES"].is-on { color: #001b00; background: var(--green); }
.seg--outcome .seg__b[data-v="NO"].is-on { color: #1a0500; background: var(--red); }
/* order type is not an outcome, so the selected chip stays neutral */
.seg--type .seg__b.is-on { color: var(--fg); background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px var(--line-2); }
/* label above value: two side-by-side fields in a 250px rail have no room for a label
   beside the number, and a clipped amount is a lie about what the ticket will do */
.ticket__fields { display: flex; gap: 6px; }
.ticket__fields .field {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  height: auto;
  padding: 5px 10px 6px;
  border-radius: 11px;
}
.ticket__fields .field__pre { font-size: 8.5px; letter-spacing: .14em; }
.ticket__fields .field input { width: 100%; text-align: left; font-size: 16px; }
.ticket__preview {
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .24);
}
.ticket__preview .kv { padding: 3px 0; font-size: 10.5px; }
.ticket__why {
  min-height: 13px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  color: var(--fg-1);
}
.ticket__why.is-ok { color: var(--fg-3); }
.ticket__actions { display: flex; gap: 7px; }
.ticket__actions .btn { flex: 1; height: 38px; font-size: 13px; }
.ticket__actions .btn:first-child { flex: 0 0 58px; font-size: 11px; }
.ticket__hint {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--amber);
  text-align: center;
}

/* ============================================================ resting orders */
.orders__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 11px 2px 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.orders__note {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.order + .order { margin-top: 5px; }
.order__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.order__sym { font-weight: 700; color: var(--fg); }
.order__sub { grid-column: 1; color: var(--fg-3); line-height: 1.35; }
.order__x { grid-column: 2; grid-row: 1 / span 2; }
.order__tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  flex: none;
}
.order__tag--buy { color: var(--green); background: var(--green-dim); box-shadow: inset 0 0 0 1px var(--green-line); }
.order__tag--sell { color: var(--red); background: var(--red-dim); box-shadow: inset 0 0 0 1px rgba(255, 80, 0, .35); }
.order__tag--yes { color: #001b00; background: var(--green); }
.order__tag--no { color: #1a0500; background: var(--red); }

/* ============================================================ swaps */
.trade {
  display: grid;
  grid-template-columns: 54px 44px minmax(0, 1fr) auto 16px;
  gap: 8px;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  transition: background .14s ease, transform .14s ease;
}
.trade:hover { background: rgba(255, 255, 255, .07); transform: translateX(3px); }
.trade__time { color: var(--fg-3); }
.trade__side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .08em;
}
.trade__side.up { color: var(--green); background: var(--green-dim); box-shadow: inset 0 0 0 1px var(--green-line); }
.trade__side.down { color: var(--red); background: var(--red-dim); box-shadow: inset 0 0 0 1px rgba(255, 80, 0, .35); }
.trade__size { color: var(--fg-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade__price { color: var(--fg-2); white-space: nowrap; }
.trade__link { color: var(--fg-3); text-align: right; }
.trade:hover .trade__link { color: var(--fg); }

/* ============================================================ resolved */
.resolved {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 9px;
  padding: 11px;
}
.resolved .panel__empty { grid-column: 1 / -1; }
.rcard {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.rcard:hover { transform: translateY(-2px); border-color: var(--line-2); background: rgba(255, 255, 255, .075); }
.rcard b { font-size: 12.5px; color: var(--fg); }
.rcard__q {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcard__time { color: var(--fg-3); white-space: nowrap; }

/* ============================================================ how it works (left rail) */
.howto { display: flex; flex-direction: column; gap: 3px; }
.howto__card {
  --c: var(--fg-2);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px;
  border-radius: 12px;
  overflow: hidden;
  transition: background .16s ease, transform .16s ease;
}
.howto__card:hover { background: rgba(255, 255, 255, .05); transform: translateX(3px); }
.howto__n {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--c);
}
.howto__t { margin: 0 0 3px; font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.howto__p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--fg-2); font-weight: 400; }

/* ---- paper-mode call-out ---- */
.cta {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  overflow: hidden;
}
.cta__t { margin: 0 0 7px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.cta__p { margin: 0 0 12px; font-size: 11.5px; line-height: 1.55; font-weight: 400; color: var(--fg-1); }
.cta__badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ============================================================ footer */
.footer { margin-top: 2px; }
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: 14px;
}
.footer__col {
  --c: var(--neutral-3);
  position: relative;
  padding: 15px 17px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}
.footer__col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 17px;
  right: 17px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--c);
}
/* only the honesty card is coloured, and only in the amber the palette reserves for it */
.footer__col--amber { --c: var(--amber); }
.footer__h {
  margin-bottom: 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.footer__col--amber .footer__h { color: var(--amber); }
.footer__col p { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--fg-1); }
.footer__col .real { color: var(--fg); font-weight: 700; }
.footer__col .demo { color: var(--amber); font-weight: 700; }
.footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.footer__bar a { color: var(--fg-1); }
.footer__bar a:hover { color: var(--fg); }

/* ============================================================ form fields */
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
}
.field:focus-within { border-color: var(--fg-2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.field input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}
.field__pre { color: var(--fg-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
}
.kv b { color: var(--fg); }

/* ============================================================ modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px;
}
.modal {
  width: 400px;
  max-width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--bg-1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  overflow: hidden;
}
.modal .panel__head { min-height: 54px; }
.modal__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.provider {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .05);
  width: 100%;
  text-align: left;
  transition: border-color .14s, background .14s, transform .14s;
}
.provider:hover { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-2px); }
.provider img { width: 26px; height: 26px; border-radius: 8px; }
.provider__name { flex: 1; font-weight: 700; font-size: 14px; }
.modal__hint {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: center;
  line-height: 1.8;
}

/* ============================================================ toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 13px 18px;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--line-2);
  border-radius: 13px;
  background: var(--bg-2);
  font-size: 12.5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  animation: toast-in .22s cubic-bezier(.22, 1, .36, 1);
  transition: opacity .2s, transform .2s;
}
.toast--warn { border-left-color: var(--fg-2); }
.toast--out { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ============================================================ wide screens */
@media (min-width: 1660px) {
  :root {
    --gap: 16px;
    --page-x: 26px;
    --rail-l: 264px;
    --rail-r: 348px;
    --c-meme: 158px;
    --c-spark: 64px;
    --c-cap: 116px;
    --c-odds: 104px;
    --c-yes: 60px;
    --c-no: 60px;
    --c-vol: 68px;
    --c-ends: 70px;
    --c-gap: 12px;
  }
  .pitch__sub { display: block; }
  .statband { gap: 14px; }
  .stat { padding: 13px 20px 16px; }
  .stat__value { font-size: 32px; }
  .focus__canvas { height: 240px; }
  .focus__big { font-size: 44px; }
  #markets-body > tr { padding: 8px 14px; min-height: 60px; }
  .q { font-size: 14px; }
  .odds__pct { font-size: 23px; }
  #markets-body > tr:not(:first-child) .btn--yes,
  #markets-body > tr:not(:first-child) .btn--no { height: 32px; font-size: 13px; }
  .ends { font-size: 11.5px; padding: 6px 10px; }
  .meme__sym { font-size: 15px; }
  #markets-body .avatar { --size: 36px !important; }
  #markets-body > tr:first-child:not(.sk-row) .q { font-size: 25px; }
  #markets-body > tr:first-child:not(.sk-row) .meme__sym { font-size: 30px; }
  #markets-body > tr:first-child:not(.sk-row) .avatar { --size: 58px !important; }
  #markets-body > tr:first-child:not(.sk-row) .odds__pct { font-size: 36px; }
  #markets-body > tr:first-child:not(.sk-row) .btn--yes,
  #markets-body > tr:first-child:not(.sk-row) .btn--no { max-width: 190px; height: 46px; font-size: 19px; }
  .resolved { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
}

/* ---- ultrawide: split the right rail into two columns and spend the freed height on the
        chart. The rail stretches to the markets panel so 2560 stops ending in a void. ---- */
@media (min-width: 1920px) {
  :root { --gap: 20px; --page-x: 32px; --rail-l: 288px; }
  /* Both rails stretch to the markets panel, so the page stops ending in a bottom-right
     hole: the surplus goes into the chart, the swaps feed and the call-out card. */
  .grid {
    grid-template-columns: var(--rail-l) minmax(0, 1fr) minmax(560px, .54fr);
    align-items: stretch;
  }
  .col--left .cta { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  /* the book panel is now ladder + ticket + resting orders, so it sizes to its content
     and the focus panel absorbs whatever height is left over */
  .col--right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1fr) auto;
    gap: var(--gap);
  }
  #panel-focus { grid-column: 1 / -1; grid-row: 1; }
  #panel-book { grid-column: 1; grid-row: 2; }
  #panel-trades { grid-column: 2; grid-row: 2; }
  #panel-focus,
  #panel-book,
  #panel-trades { display: flex; flex-direction: column; }
  #panel-focus .panel__body,
  #panel-trades .panel__body { flex: 1; min-height: 0; }
  #panel-trades .panel__body { overflow-y: auto; }
  /* roomier ladder and feed so the two rail panels finish level with the markets table */
  .book__cols,
  .book__row { grid-template-columns: 52px minmax(0, 1fr) 68px; padding: 0 11px; }
  .book__row { height: 30px; font-size: 12.5px; }
  .book__spread { height: 32px; font-size: 10.5px; }
  .book__usd { font-size: 11px; }
  .book__hint { font-size: 11px; }
  .ticket { padding: 13px; gap: 9px; }
  .ticket__q { font-size: 12.5px; }
  .ticket__preview .kv { font-size: 11.5px; padding: 4px 0; }
  .seg__b { height: 30px; font-size: 10.5px; }
  .order { font-size: 11px; }
  .trade { height: 36px; font-size: 11.5px; }

  #panel-focus .panel__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    grid-template-areas:
      "tgt    tgt"
      "canvas readout"
      "canvas stamp";
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 9px;
  }
  .focus__target { grid-area: tgt; margin: 0; }
  .focus__canvas { grid-area: canvas; height: 100%; min-height: 340px; }
  .focus__readout {
    grid-area: readout;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
    padding: 0;
  }
  .focus__big { font-size: 52px; }
  .focus__meta { flex: none; font-size: 11px; line-height: 2; }
  .focus__stamp { grid-area: stamp; margin: 0; }
}

@media (min-width: 2200px) {
  :root {
    --c-meme: 176px;
    --c-spark: 76px;
    --c-cap: 130px;
    --c-odds: 116px;
    --c-yes: 68px;
    --c-no: 68px;
    --c-vol: 80px;
    --c-ends: 80px;
    --c-gap: 14px;
  }
  .q { font-size: 15px; }
  .odds__pct { font-size: 25px; }
  #markets-body > tr { min-height: 64px; padding: 9px 16px; }
  .stat__value { font-size: 38px; }
  .resolved { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
}

/* ============================================================ narrow screens */
@media (max-width: 1340px) {
  :root { --rail-l: 200px; --rail-r: 272px; --page-x: 14px; --gap: 12px; }
  .legend--hint { display: none; }
  .panel__head--markets .panel__note { display: none; }
}
@media (max-width: 1180px) {
  .grid { grid-template-columns: var(--rail-l) minmax(0, 1fr); }
  .col--right { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
  .statband { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat--opt { display: none; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topbar__right { margin-left: auto; }
  .page { padding: 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .col--right { grid-column: auto; grid-template-columns: 1fr; }
  .statband { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticker { display: none; }
  .legendset { display: none; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker__track,
  .dot,
  .badge--new,
  .ends--soon,
  .sk { animation: none !important; }
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .row:hover, .trade:hover, .stat:hover, .howto__card:hover, .rcard:hover { transform: none; }
  /* contrast markers must survive: hover and focus stay legible without movement */
  #markets-body > tr:hover { background: rgba(255, 255, 255, .1); }
}
