/* Shared styles of every dashboard page. Design: docs/info/2026-09-27-design-direction.md */
:root {
  --bg: #050605;
  --panel: #0a0d0a;
  --line: #1c3a1c;
  --line-strong: #2f6b2f;
  --accent: #39ff14;
  --accent-dim: #1f8a1f;
  --text: #c9f2c9;
  --muted: #6f9c6f;
  --warn: #ffb000;
  --bad: #ff3b3b;
  --row-active: #0f2a0f;
  --mono: "JetBrains Mono", "IBM Plex Mono", "Fira Code", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* The scrollbar's room is reserved up front, so rows arriving (and the page
   growing past the viewport) never shift the header or the layout sideways. */
html { scrollbar-gutter: stable; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font: 13px/1.5 var(--mono);
  min-height: 100vh;
  overflow-x: hidden;
}
/* Scanlines over everything, never intercepting clicks. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(57, 255, 20, .04) 0 1px, transparent 1px 3px);
  z-index: 10;
}
[x-cloak] { display: none !important; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover, a:focus-visible { text-decoration: underline; outline: none; }
button, select, [role="button"], .clickable, th[data-sort], tr.link { cursor: pointer; }
/* Wide enough for the 13-column coins table at 1920 px without a scrollbar;
   narrower screens scroll the table box, never the page. */
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 16px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Header: a fixed two-row grid (brand + nav, then status + badge) with
   reserved row heights. Nothing in it wraps or grows, so neither the status
   text Alpine fills in nor the web font arriving can move the page. */
header { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; }
.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 30px 24px;
  grid-template-areas: "logo nav" "status status";
  align-items: center; column-gap: 18px; row-gap: 4px;
  padding-top: 10px; padding-bottom: 10px;
}
.logo { grid-area: logo; color: var(--accent); font-weight: 600; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.logo:hover { text-decoration: none; }
.logo .sub { color: var(--muted); font-weight: 400; }
nav {
  grid-area: nav; display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 14px;
  min-width: 0; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav a { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; flex: none; line-height: 18px; }
nav a:hover, nav a:focus-visible { color: var(--accent); text-decoration: none; }
nav a.active { color: var(--accent); border-bottom: 1px solid var(--accent); }
.status {
  grid-area: status; display: flex; align-items: center; gap: 14px; flex-wrap: nowrap;
  height: 24px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 11px; letter-spacing: .08em;
}
/* The status message and snapshot label shrink (ellipsized) before the
   badge does: the badge's room is reserved at every width. */
.status > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .snap { flex-shrink: 50; }
.status .flag { flex: none; margin-left: auto; }
.flag { border: 1px solid var(--bad); color: var(--bad); padding: 2px 8px; font-size: 10px; line-height: 16px; letter-spacing: .14em; white-space: nowrap; }
.flag:hover, .flag.active { background: var(--bad); color: var(--bg); text-decoration: none; }

/* Hero */
.hero { padding: 56px 0 36px; }
.hero.small { padding: 36px 0 24px; }
.hero h1 {
  margin: 0; color: var(--accent); text-transform: uppercase; font-weight: 600;
  font-size: clamp(36px, 8vw, 72px); line-height: 1.02; letter-spacing: .01em;
  text-shadow: 0 0 4px rgba(57, 255, 20, .35);
}
.hero.small h1 { font-size: clamp(28px, 6vw, 48px); }
.hero p { margin: 18px 0 0; color: var(--muted); max-width: 60ch; }

/* Overview hero: text left, live candles right (hidden under 900 px). */
/* The chart column gives way first (down to 260 px), and the heading scales
   with the viewport, so the text never runs under the chart. */
.hero.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, min(560px, 40%)); gap: 32px; align-items: center; }
.hero.split h1 { font-size: clamp(36px, 5vw, 72px); }
.hero-chart { position: relative; margin: 0; height: 220px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: opacity .4s; }
.hero-chart svg { display: block; width: 100%; height: 100%; }
.hero-chart.dim { opacity: .35; }
.candle-base { stroke: var(--line); stroke-width: 1; }
.candle-track { transition: transform 1s linear; }
.hero-chart.dim .candle-track { transition: none; }
.c-up line, .c-up rect { stroke: var(--accent); fill: var(--accent); }
.c-down line, .c-down rect { stroke: var(--bad); fill: var(--bad); }
.c-up line, .c-down line { stroke-width: 1; }
.c-up rect, .c-down rect { stroke-width: 0; }
.candle-label {
  position: absolute; top: 8px; right: 10px; padding: 1px 6px; background: var(--panel);
  color: var(--muted); font-size: 11px; letter-spacing: .06em; white-space: nowrap;
}
.back { display: inline-block; margin-bottom: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 40px; }
.tile { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; min-width: 0; }
.tile:hover { border-color: var(--line-strong); }
.tile .big { font-size: clamp(22px, 4vw, 34px); font-weight: 600; color: var(--accent); line-height: 1.2; margin: 6px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { color: var(--muted); font-size: 11px; }

/* Sections and tables */
section { margin-bottom: 40px; }
h2 { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .12em; margin: 0 0 10px; }
h2 .hint { color: var(--muted); font-weight: 400; letter-spacing: .04em; margin-left: 8px; }
h2 .known { color: var(--muted); font-weight: 400; letter-spacing: .04em; margin-left: 4px; }
h2 .known:hover, h2 .known:focus-visible { color: var(--accent); }
h2 .more { float: right; font-weight: 400; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.table-box { background: var(--panel); border: 1px solid var(--line); overflow: auto; max-height: 70vh; }
table { width: 100%; border-collapse: collapse; }
th, td { height: 34px; padding: 0 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
  position: sticky; top: 0; background: var(--panel); z-index: 1;
  font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); text-align: left;
  user-select: none;
}
th.num { text-align: right; }
th[data-sort]:hover { color: var(--accent); }
th.sorted { color: var(--accent); }
tbody tr:hover { background: var(--row-active); }
tbody tr:hover td { color: var(--accent); }
tbody tr:last-child td { border-bottom: 0; }
tr.link td a { color: inherit; }
td.rank { color: var(--muted); width: 1%; }
.dot { font-size: 11px; }
.empty td { color: var(--muted); text-align: center; height: 64px; white-space: normal; }
.empty:hover { background: none; }
.empty:hover td { color: var(--muted); }

/* Help markers ("?") and their one shared tooltip */
.help {
  display: inline-block; margin-left: 5px; width: 13px; height: 13px; line-height: 11px;
  border: 1px solid var(--line-strong); color: var(--accent-dim);
  font-size: 9px; text-align: center; letter-spacing: 0; cursor: help; vertical-align: 1px;
}
.help:hover, .help:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
#tip {
  position: fixed; z-index: 20; max-width: min(340px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text);
  padding: 8px 10px; font-size: 11px; line-height: 1.5; text-transform: none; letter-spacing: 0;
  white-space: normal; pointer-events: none; box-shadow: 0 0 4px rgba(57, 255, 20, .25);
}

/* Filters and pager (coins page) */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; margin-bottom: 14px; }
/* "clear all" closes the row, always there (disabled without a filter), so
   choosing a filter never moves anything. */
.filters-clear { grid-column: -2; align-self: end; }
.btn.clear-all { height: 32px; color: var(--muted); }
.btn.clear-all:hover:not(:disabled), .btn.clear-all:focus-visible { color: var(--bad); border-color: var(--bad); outline: none; }
.btn.clear-all:disabled { opacity: .45; cursor: default; }
.filters label { display: block; margin-bottom: 4px; }
.filters select { width: 100%; }
.plain-select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); font: inherit;
  height: 32px; padding: 0 8px; border-radius: 0;
}
.plain-select:focus { border-color: var(--line-strong); outline: none; }
.legend { font-size: 11px; margin: 8px 0 0; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; color: var(--muted); }
.pager button, .btn {
  background: var(--panel); color: var(--accent); border: 1px solid var(--line); font: inherit;
  padding: 4px 12px; text-transform: uppercase; letter-spacing: .12em; font-size: 11px;
}
.pager button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
.pager button:disabled { color: var(--muted); cursor: default; }

/* select2, dark */
.select2-container { font: 13px var(--mono); }
.select2-container .select2-selection--single {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0; height: 32px; cursor: pointer;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text); line-height: 30px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 30px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--accent-dim) transparent transparent transparent; }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--muted); cursor: pointer; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--line-strong); }
.select2-dropdown { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 0; color: var(--text); }
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); font: inherit; outline: none;
}
.select2-results__option { cursor: pointer; padding: 5px 8px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--row-active); color: var(--accent); }
.select2-container--default .select2-results__option--selected { background: #0c1d0c; }
.select2-container--default .select2-results__option--disabled { color: var(--muted); cursor: default; }
.select2-results__message { color: var(--muted); }
/* select2 multiple: neon chips inside the box. */
.select2-container .select2-selection--multiple {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0; min-height: 32px; cursor: text;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple { border: 1px solid var(--line-strong); }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--row-active); border: 1px solid var(--accent-dim); border-radius: 0; color: var(--accent);
  box-shadow: 0 0 3px rgba(57, 255, 20, .25); margin-top: 4px; padding-left: 20px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display { color: var(--accent); }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--accent-dim); border-right: 1px solid var(--accent-dim); border-radius: 0; background: transparent;
}
/* The chip's ×: focusable (the page sets tabindex 0), Enter / Delete /
   Backspace on it removes that one value. */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus { color: var(--bg); background: var(--accent); outline: none; }
.select2-container--default .select2-selection--multiple .select2-selection__choice:focus-within { border-color: var(--accent); }
.select2-container--default .select2-selection--multiple .select2-selection__clear { color: var(--muted); margin-top: 6px; margin-right: 6px; }
.select2-container .select2-search--inline .select2-search__field { color: var(--text); font: 13px var(--mono); margin-top: 6px; }
.select2-container .select2-search--inline .select2-search__field::placeholder { color: var(--muted); }
/* Before select2 replaces it, a multi <select> keeps the one-row height
   select2 will have, so the filter row does not jump when the CDN script runs. */
select.plain-select[multiple] { height: 32px; }

/* Plain text pages */
.prose { max-width: 72ch; margin-bottom: 48px; }
.prose h2 { margin-top: 28px; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 16px 0 28px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.prompt .user { color: var(--accent-dim); }
.cursor { display: inline-block; width: .6em; background: var(--accent); color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Whales: amber for events younger than 10 s, expandable context rows. */
a.tile { display: block; color: inherit; }
a.tile:hover, a.tile:focus-visible { text-decoration: none; border-color: var(--accent-dim); }
tr.whale-new td, tr.whale-new td a { color: var(--warn); }
tr.whale-new td.rank { box-shadow: inset 2px 0 0 var(--warn); }
tr.open td { background: var(--row-active); }
tbody.event tr.ctx td { border-bottom: 1px solid var(--line); padding-top: 6px; padding-bottom: 10px; height: auto; }
tbody.event tr.ctx:hover { background: none; }
tbody.event tr.ctx:hover td { color: var(--text); }
table.inner { width: auto; min-width: 60%; border: 1px solid var(--line); }
table.inner th { position: static; background: var(--bg); }
table.inner th, table.inner td { height: 26px; }
table.inner tbody tr:last-child td { border-bottom: 0; }

/* Engine unreachable: retained data stays visible but is marked frozen. */
.banner { border: 1px solid var(--bad); color: var(--bad); background: var(--panel); padding: 8px 12px; margin: 0 0 20px; }
.banner.stalled { border-color: var(--warn); color: var(--warn); }
.frozen .tile, .frozen .table-box { border-color: var(--warn); }
.frozen .tile .big, .frozen tbody td, .frozen tbody tr:hover td { color: var(--warn); }
.frozen tbody td { opacity: .75; }

@media (max-width: 900px) {
  /* Three fixed rows: brand, nav (scrolls sideways), status + badge. */
  .bar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 24px 24px 24px;
    grid-template-areas: "logo" "nav" "status";
  }
  nav { justify-content: flex-start; }
  .hero.split { display: block; }
  .hero-chart { display: none; }
}
@media (max-width: 760px) {
  .tiles, .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-clear { grid-column: auto; }
  .hero { padding: 36px 0 24px; }
}
@media (max-width: 420px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .status .snap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  /* Candles still update, they just do not slide. */
  .candle-track { transition: none; }
}
