:root {
  color-scheme: dark;
  --bg: #0B0C0D;
  --board: #101113;
  --field: #131416;
  --surface: #16181B;
  --surface-2: #1F2226;
  --line: #26292E;
  --line-strong: #33373D;
  --text: #F1F2F3;
  --muted: #A1A3AB;
  --dim: #6B7078;
  --accent: #4FD08F;
  --accent-hi: #7FF0B6;
  --mint: #4FD08F;
  --alarm: #FF4D4D;
  --warn: #F2B544;
  --hot: #FF8A3D;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-pixel: "Jersey 20", "Helvetica Neue", Arial, sans-serif;
  --pad: 16px;
  --r: 10px;
  --r-s: 6px;
  --chrome: rgba(22,24,27,.88);
  --btn: rgba(255,255,255,.07);
  --btn-hover: rgba(255,255,255,.13);
  --shadow: 0 16px 40px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { background: var(--bg); height: 100%; }
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }

/* pixel face for names, headings and numbers; long text stays in the system font */
.pixel, .wordmark, h1, h2, .stats b, .about-stats b, .claim-price, .card-name, .rows .r-num b, .rows .rank,
button, a.chip, .file-btn {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0;
  font-synthesis: none; /* Jersey 20 has a single weight; fake bold smears the pixels */
}

/* ---------- board ---------- */
.board {
  position: fixed; inset: 0; overflow: hidden;
  /* faint green glow bleeding in from both sides, near-black in the middle */
  background:
    radial-gradient(ellipse 30% 75% at 0% 55%, rgba(29,122,79,.05), transparent 75%),
    radial-gradient(ellipse 30% 75% at 100% 55%, rgba(79,208,143,.025), transparent 75%),
    linear-gradient(90deg, #0C120F 0%, #0B0E0D 20%, #0B0C0D 40%, #0B0C0D 60%, #0B0E0D 80%, #0C120F 100%);
}
#grid {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#grid.dragging { cursor: grabbing; }
#grid.claiming { cursor: crosshair; }
#grid.over-sold { cursor: pointer; }
/* the grid is the whole page, so a focus ring would wrap everything; keyboard focus shows as the drawn cursor block instead */
#grid:focus-visible { outline: none; }

/* ---------- floating chrome: one language for every corner ---------- */
.chrome {
  position: absolute; z-index: 5; margin: 0;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.bottom-left { bottom: calc(var(--ticker-h, 0px) + var(--pad)); left: calc(var(--rail-w, 0px) + var(--pad)); padding: 9px 14px; font-size: 14px; color: var(--muted); max-width: calc(100% - 2 * var(--pad)); }
.bottom-left.alarm { color: var(--alarm); }
.bottom-left:empty { display: none; }

/* along the bottom edge: the latest vulnerabilities from osv.dev, scrolling past */
.ticker {
  bottom: 0; left: 0; right: 0;
  border-width: 1px 0 0; border-radius: 0; box-shadow: none;
  font-family: var(--font); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 9px 0 9px calc(var(--pad) + 16px);   /* label lines up with the wordmark */
  font-size: 14px; color: var(--muted); overflow: hidden;
}
.ticker[hidden] { display: none; }
.ticker:hover { background: rgba(31,34,38,.92); }
.ticker:focus-visible { outline-offset: -2px; }
.ticker-label { font-family: var(--font-pixel); font-size: 17px; line-height: 1; color: var(--alarm); flex: none; }
.ticker-window {
  display: block; flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
}
.ticker-track { display: flex; width: max-content; white-space: nowrap; animation: ticker var(--ticker-s, 60s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-track span { padding-right: 32px; }
/* severity, loud: flames, then the level in its own color */
.ticker-track i { font-style: normal; margin-right: 6px; }
.ticker-track em {
  font-style: normal; font-family: var(--font-pixel); font-size: 15px; line-height: 1; text-transform: uppercase;
  padding: 2px 6px 1px; margin-right: 8px; border-radius: 4px; vertical-align: 1px;
  color: var(--muted); background: var(--btn);
}
.ticker-track .sev-critical em { color: #fff; background: var(--alarm); }
.ticker-track .sev-serious em { color: var(--bg); background: var(--hot); }
.ticker-track .sev-moderate em { color: var(--bg); background: var(--warn); }
.ticker-track .sev-critical { color: var(--text); }
.ticker-track small { font-size: 13px; color: var(--dim); }
.ticker-track b { color: var(--text); font-weight: 500; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* down the left: the warnings in order, ending at today. Only where the grid leaves room for it */
.rail {
  position: absolute; z-index: 4; left: 0; top: var(--top-h, 72px); bottom: var(--ticker-h, 0px);
  width: 340px; display: flex; flex-direction: column;
  padding: 4px 0 0 calc(var(--pad) + 16px);   /* lines up with the wordmark */
}
.rail[hidden] { display: none; }
/* one backdrop from the top of the page down: dark behind the text, easing out into the grid
   well past the rail's edge, with a red warmth along the left, where the warnings live */
.rail::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: calc(-1 * var(--top-h, 72px)); bottom: 0; left: 0; width: calc(100% + 180px);
  background:
    linear-gradient(90deg, rgba(255,77,77,.11), rgba(255,77,77,.04) 40%, rgba(255,77,77,.01) 62%, rgba(255,77,77,0) 80%),
    linear-gradient(90deg, rgba(11,12,13,.92) 0%, rgba(11,12,13,.9) 58%, rgba(11,12,13,.78) 66%, rgba(11,12,13,.58) 74%,
      rgba(11,12,13,.36) 82%, rgba(11,12,13,.17) 90%, rgba(11,12,13,.05) 96%, rgba(11,12,13,0) 100%);
}
@media (max-width: 1099px) { .rail, .rail-show { display: none; } }
.rail-head { display: flex; align-items: center; justify-content: space-between; padding-right: 20px; margin: 0 0 10px; }
.rail h2 { font-size: 15px; line-height: 1; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.rail .rail-toggle { font-size: 15px; padding: 2px 10px; color: var(--muted); }
.rail-toggle:hover { color: var(--text); }
/* folding: the rail slides out to the left and fades, then a small button fades in where it was */
.rail-off .rail { transform: translateX(calc(-100% - 180px)); opacity: 0; visibility: hidden; pointer-events: none; }
.rail-ready .rail { transition: transform .42s cubic-bezier(.2,.7,.2,1), opacity .3s ease, visibility 0s; }
.rail-ready.rail-off .rail { transition: transform .42s cubic-bezier(.4,0,.6,1), opacity .3s ease .1s, visibility 0s .42s; }
.rail-ready .bottom-left { transition: left .42s cubic-bezier(.2,.7,.2,1); }
/* folded away, the timeline leaves one small button where it was */
.chip.rail-show { position: absolute; z-index: 4; top: var(--top-h, 72px); left: calc(var(--pad) + 16px); font-size: 15px; padding: 4px 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rail-show:hover { color: var(--text); }
.chip.rail-show { opacity: 0; visibility: hidden; transform: translateX(-8px); }
.rail-off .chip.rail-show { opacity: 1; visibility: visible; transform: none; }
.rail-ready .chip.rail-show { transition: opacity .18s ease, transform .18s ease, visibility 0s .18s; }
.rail-ready.rail-off .chip.rail-show { transition: opacity .25s ease .3s, transform .25s ease .3s, visibility 0s; }
.chip.rail-show[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .rail-ready .rail, .rail-ready.rail-off .rail, .rail-ready .chip.rail-show, .rail-ready.rail-off .chip.rail-show, .rail-ready .bottom-left { transition: none; } }
.timeline {
  list-style: none; margin: 0; padding: 0 20px 0 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px);
          mask-image: linear-gradient(to bottom, transparent, #000 28px);
}
.timeline::-webkit-scrollbar { display: none; }
.timeline li:first-child { padding-top: 28px; }
/* a line runs through every dot, on down into today */
.timeline li, .rail-now { position: relative; padding-left: 22px; }
.timeline li::before, .rail-now::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.rail-now::before { bottom: auto; height: 14px; }
.timeline a { display: block; text-decoration: none; padding: 0 0 20px; }
.tl-date { display: block; position: relative; font-family: var(--font-pixel); font-size: 16px; line-height: 1; color: var(--dim); margin-bottom: 6px; }
.tl-date i { position: absolute; left: -22px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--alarm); }
.tl-who { display: block; font-size: 13px; color: var(--muted); }
.tl-said { display: block; font-size: 14px; line-height: 1.45; color: var(--text); margin-top: 2px; }
.timeline a:hover .tl-said, .timeline a:focus-visible .tl-said { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.timeline a:hover .tl-date i { background: var(--alarm); }
.tl-week .tl-date i { background: var(--alarm); }
.tl-week .tl-who { color: var(--alarm); }
/* a post on X, as a card */
.tweet {
  display: block; text-decoration: none; color: var(--text); font-family: var(--font);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px;
}
.tweet:hover { background: var(--surface-2); }
.tw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tw-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.tw-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tw-name { display: flex; align-items: center; gap: 3px; font-size: 15px; }
.tw-name b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-badge { width: 17px; height: 17px; flex: none; }
.tw-handle { font-size: 14px; color: var(--muted); }
.tw-x { width: 18px; height: 18px; margin-left: auto; align-self: flex-start; color: var(--text); flex: none; }
.tw-text { display: block; font-size: 15px; line-height: 1.4; white-space: pre-wrap; }
.tw-time { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
.tl-tweet { padding-bottom: 20px; }
.tl-tweet .tl-who { margin-bottom: 8px; }
.tl-tweet .tweet { padding: 10px 12px; }
.tl-tweet .tw-text { font-size: 14px; }
.said-tweet { border-top-color: transparent !important; margin-bottom: 8px; padding-left: 3px; }
.tw-role { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
/* in the Breaking list, a card is a card, not one of the rows around it */
.rows.vulns.said a.tweet { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; }
.rows.vulns.said a.tweet:hover { background: var(--surface-2); }

.rail-now { padding-top: 14px; padding-bottom: 18px; }
.rail-now .tl-date { color: var(--accent); }
.rail-now .tl-date i { background: var(--accent); border-color: var(--accent); top: 3px; }
.rail-now-text { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.rail-now-text b { color: var(--text); font-weight: 500; }
.rail .claim-btn { margin-left: 0; font-size: 18px; }

/* one bar: name, status, counters, views, zoom, claim */
.bar {
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: calc(var(--pad) + 4px) calc(var(--pad) + 4px) 36px calc(var(--pad) + 16px); min-height: 50px;
  /* no panel: just a fade from dark so the controls stay legible over the grid */
  background: linear-gradient(to bottom, rgba(11,12,13,.85), rgba(11,12,13,.45) 55%, rgba(11,12,13,0));
  border: 0; border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.wordmark { font-size: 24px; line-height: 1; text-decoration: none; white-space: nowrap; }
.stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.stats b { font-size: 19px; color: var(--text); }
/* the little "i" after the price opens the bonding-curve explainer */
.stat-price { display: inline-flex; align-items: baseline; gap: 4px; }
.info {
  align-self: center; width: 16px; height: 16px; padding: 0; margin-left: 2px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid currentColor; border-radius: 50%;
}
.info:hover { color: var(--text); }
.c-rest { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; opacity: .8; }
.c-sold { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.c-fill { fill: var(--accent); opacity: .22; }
.c-now { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.claim-btn {
  margin-left: 8px; font-size: 20px; line-height: 1.2; padding: 6px 16px; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: var(--bg); border: 1px solid var(--accent); border-radius: var(--r-s);
}
.claim-btn:hover { background: var(--accent-hi); }
.claim-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); }
.claim-btn[aria-pressed="true"]::after { content: "\00a0· stop"; font-weight: 400; opacity: .7; }

/* the bar sheds its parts by width; the pixel price is the last stat to go */
@media (max-width: 1280px) { .tools .zoom { display: none; } }
@media (max-width: 940px) { .stats span:nth-child(1) { display: none; } }
@media (min-width: 721px) and (max-width: 780px) {
  /* too tight for a price next to the controls; it comes back once the controls drop to the bottom */
  .stats { display: none; }
}
@media (max-width: 720px) {
  /* name and counters stay up top; controls become a bottom row within thumb reach */
  .bar { padding: 12px 14px 28px; min-height: 46px; gap: 10px; }
  .wordmark { font-size: 21px; }
  .stats { margin-left: auto; padding-left: 0; border: 0; gap: 10px; }
  .tools {
    position: fixed; z-index: 5; bottom: var(--ticker-h, 0px); left: 0; right: 0;
    margin: 0; padding: 28px 14px 10px; justify-content: space-between;
    /* no panel, same as the top bar: a fade up from dark, sitting on the ticker */
    background: linear-gradient(to top, rgba(11,12,13,.85), rgba(11,12,13,.45) 45%, rgba(11,12,13,0));
  }
  .tools .chip { font-size: 18px; padding: 5px 10px; white-space: nowrap; }
  .tools .zoom { display: none; }
  .claim-btn { margin-left: auto; font-size: 18px; padding: 6px 12px; white-space: nowrap; }
  .bottom-left { display: none; }
  /* the very bottom edge, under the controls */
  .ticker { padding-left: 14px; padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .stats { display: none; }
}


.chip {
  background: var(--btn); border: 0; border-radius: var(--r-s); text-decoration: none;
  font-size: 19px; padding: 5px 12px; cursor: pointer; line-height: 1.3; white-space: nowrap;
}
.chip:hover { background: var(--btn-hover); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chip.icon { width: 34px; padding: 5px 0; text-align: center; font-size: 22px; }
.chip.share svg { width: 18px; height: 18px; }
.chip.share.copied { width: auto; padding: 0 12px; font-size: 19px; background: var(--accent); color: var(--bg); }
.chip.share.copied svg { display: none; }
.zoom { display: flex; align-items: center; gap: 2px; margin-left: 4px; padding-left: 6px; border-left: 1px solid var(--line); }
/* every control in the bar shares one height, whatever its glyph size */
.tools .chip, .claim-btn {
  height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding-top: 0; padding-bottom: 0; line-height: 1;
}

/* ---------- tooltip + card ---------- */
.tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: var(--text); color: var(--bg);
  font-size: 14px; line-height: 1.35; padding: 7px 10px; border-radius: var(--r-s);
  max-width: 260px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.tip b { font-weight: 600; }
.tip span { display: block; opacity: .7; }

.card {
  position: absolute; z-index: 9;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 14px 36px 12px 16px;
  width: min(300px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
.card-name { font-size: 22px; line-height: 1.15; }
.card-msg { color: var(--muted); margin-top: 2px; }
.card-link { display: inline-block; margin-top: 10px; font-size: 15px; color: var(--accent); text-underline-offset: 3px; }
.card-link[hidden] { display: none; }
.card-meta { font-size: 13px; color: var(--muted); margin-top: 10px; }
/* the pick: an empty block you tapped, before any form */
/* three tiers, hairlines between: what (head) → how much (buy) → the fine print (foot) */
.pick { padding: 14px 16px 12px; }
.pick-head { padding-right: 24px; }
.pick-size { font-size: 14px; line-height: 1.35; color: var(--muted); margin-top: 3px; }
.pick-size b { font-weight: 600; color: var(--text); }
.pick-buy { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pick-label { display: block; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.pick-price { font-family: var(--font-pixel); font-size: 32px; line-height: 1; margin-top: 5px; }
.pick-rate { grid-column: 1 / -1; font-size: 12px; line-height: 1.35; color: var(--muted); margin-top: 6px; }
.pick .btn { font-size: 18px; padding: 8px 16px; white-space: nowrap; }
.pick-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4; color: var(--dim); }
.pick-foot .linkish { color: var(--muted); }
.pick-foot .linkish:hover { color: var(--text); }
.pick-note { margin-top: 6px; }
.pick-note:empty { display: none; }
.pick-note.alarm {
  font-size: 13px; color: var(--alarm); margin-top: 8px; padding: 7px 10px; border-radius: var(--r-s);
  background: rgba(255,77,77,.08); border: 1px solid rgba(255,77,77,.3);
}
#grid.resizing, #grid.over-handle { cursor: nwse-resize; }
@media (max-width: 720px) {
  /* on phones the pick sits above the bottom controls instead of beside the block */
  .pick { left: var(--pad) !important; right: var(--pad); top: auto !important; width: auto;
          bottom: calc(var(--ticker-h, 0px) + var(--tools-h, 50px) - 16px); }
}
.x {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border: 0; border-radius: var(--r-s); background: var(--btn);
  font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted);
}
.x:hover { background: var(--btn-hover); color: var(--text); }

/* ---------- rankings ---------- */
h2 { font-size: 26px; line-height: 1.1; }

.lead { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.lead .linkish { color: var(--accent); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--line); }
.rows a {
  display: grid; grid-template-columns: 28px 20px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: var(--r-s); text-decoration: none;
}
.rows a:hover, .rows a:focus-visible { background: var(--surface-2); }
.rows a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rows .swatch-cell { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.rows .rank { font-size: 16px; color: var(--muted); }
.rows .swatch { width: 20px; height: 20px; border-radius: 3px; display: block; }
.rows .r-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r-sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r-num { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.rows .r-num b { font-size: 18px; line-height: 1.1; color: var(--text); display: block; }
.empty { color: var(--muted); font-size: 15px; }

/* the rankings page scrolls like a normal document */
body.page { height: auto; overflow: auto; }
.page-wrap { max-width: 720px; margin: 0 auto; padding: 20px var(--pad) 72px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 48px; }
.page h1 { font-size: clamp(44px, 9vw, 64px); line-height: 1; }
.page .intro { color: var(--muted); margin: 12px 0 28px; max-width: 52ch; }
.page .lead { font-size: 15px; margin-bottom: 16px; }
.page .lead a { color: var(--accent); text-underline-offset: 3px; }
.page section + section { margin-top: 56px; }
.page section h2 { margin-bottom: 12px; }
.page-foot { margin-top: 56px; font-size: 14px; color: var(--dim); }
.page-foot a, .about-actions .fine a, .claim-note a { color: inherit; text-underline-offset: 3px; }

.linkish { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- dialogs ---------- */
dialog {
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--text);
  padding: 0; max-height: calc(100% - 32px); overflow: auto;
  font: inherit; box-shadow: 0 24px 64px rgba(0,0,0,.6);
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(5,6,7,.65); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: rise .2s ease-out; }
dialog[open]::backdrop { animation: fade .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
/* exit mirrors the entrance: same keyframes and duration, run backwards */
dialog.closing { animation: sink .2s ease-in forwards; }
dialog.closing::backdrop { animation: unfade .2s ease-in forwards; }
@keyframes sink { to { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes unfade { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  dialog[open], dialog[open]::backdrop, dialog.closing, dialog.closing::backdrop { animation: none; }
  /* no scrolling: the list sits still and can be scrolled by hand */
  .ticker-track { animation: none; }
  .ticker-window { overflow-x: auto; scrollbar-width: none; }
}

/* ---------- about ---------- */
.about { width: min(600px, calc(100% - 32px)); }
.about-body { padding: 32px 36px 28px; }
.about h1:focus { outline: none; }
@media (max-width: 520px) { .about-body { padding: 24px 20px 20px; } }
h1 {
  font-size: clamp(44px, 6.5vw, 68px);
  line-height: 0.95;
  margin: 0 0 18px;
}
.deck { font-size: 18px; line-height: 1.45; margin: 0 0 16px; }
.about-stats { display: flex; gap: 6px 22px; flex-wrap: wrap; margin: 0 0 22px; font-size: 14px; color: var(--muted); }
.about-stats b { font-size: 24px; color: var(--text); }
.about-stats .linkish { font-size: 14px; color: var(--accent); align-self: center; }
.about-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px 20px; margin-top: 10px; flex-wrap: wrap; }
.about-actions .fine { font-size: 13px; color: var(--muted); flex: 1 1 260px; }
@media (max-width: 520px) {
  /* the way out stays in reach while the rules scroll */
  .about-actions {
    position: sticky; bottom: 0; margin: 4px -20px -20px; padding: 12px 20px 16px;
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .about-actions .btn { flex: 1 1 100%; }
}

/* ---------- breaking: the ticker's full list ---------- */
.breaking { width: min(640px, calc(100% - 32px)); }
.breaking .about-body { position: relative; }
.breaking .x { top: 14px; right: 14px; }
.breaking h2 { font-size: 40px; line-height: 1; color: var(--alarm); margin-bottom: 10px; }
.breaking h2:focus { outline: none; }
.breaking .intro { color: var(--muted); font-size: 15px; margin: 0 0 18px; max-width: 52ch; }
.rows.vulns { margin-bottom: 14px; }
.rows.vulns a { grid-template-columns: 58px minmax(0, 1fr) auto; align-items: start; border-left: 3px solid transparent; }
.rows.vulns .flames { font-size: 16px; line-height: 1.5; white-space: nowrap; letter-spacing: -2px; }
.rows.vulns .r-num b { padding: 2px 7px 1px; border-radius: 4px; color: var(--muted); background: var(--btn); text-transform: uppercase; display: inline-block; margin-bottom: 4px; }
.rows.vulns .r-num { display: flex; flex-direction: column; align-items: flex-end; }
/* the worse it is, the louder the row */
.rows.vulns .sev-critical { background: rgba(255,77,77,.12); border-left-color: var(--alarm); }
.rows.vulns .sev-critical:hover { background: rgba(255,77,77,.2); }
.rows.vulns .sev-critical .r-num b { color: #fff; background: var(--alarm); }
.rows.vulns .sev-serious { background: rgba(255,138,61,.07); border-left-color: var(--hot); }
.rows.vulns .sev-serious:hover { background: rgba(255,138,61,.14); }
.rows.vulns .sev-serious .r-num b { color: var(--bg); background: var(--hot); }
.rows.vulns .sev-moderate { border-left-color: var(--warn); }
.rows.vulns .sev-moderate .r-num b { color: var(--bg); background: var(--warn); }
.rows.vulns li { border-top-color: transparent; margin-bottom: 4px; }
.rows.vulns .r-name, .rows.vulns .r-sub { white-space: normal; }
.rows.vulns .r-sub { font-size: 14px; margin-top: 1px; }
.rows.vulns .r-num b { font-size: 16px; }
.breaking .list-head { font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.breaking .list-head:first-child { margin-top: 0; }
.rows.vulns.said a { border-left-color: var(--alarm); background: rgba(255,77,77,.06); }
.rows.vulns.said a:hover { background: rgba(255,77,77,.12); }
.rows.vulns.said .r-name { font-size: 14px; color: var(--muted); }
.rows.vulns.said .r-sub { font-size: 15px; color: var(--text); margin-top: 3px; }
.rows.vulns.said .r-num b { font-size: 14px; padding: 0; background: none; text-transform: none; }
.ticker-track .news em { color: #fff; background: var(--alarm); }
.ticker-track .news { color: var(--text); }
.breaking .fine a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- price: the bonding curve, large ---------- */
.price { width: min(680px, calc(100% - 32px)); }
.price .about-body { position: relative; }
.price .x { top: 14px; right: 14px; }
.price h2 { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.price h2:focus { outline: none; }
.price .intro { color: var(--muted); font-size: 15px; margin: 0 0 18px; max-width: 56ch; }
.price .fine b { color: var(--text); font-weight: 600; }
.curve-fig { position: relative; margin: 0 0 6px; }
.curve-fig svg { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; overflow: visible; }
.curve-fig .c-rest { stroke-width: 2; }
.curve-fig .c-sold { stroke-width: 2.5; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-label { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.c-axis { fill: var(--dim); }
.c-now-label { font-family: var(--font-pixel); font-size: 16px; fill: var(--text); }
.c-hair { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.c-hover { fill: var(--text); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.curve-tip { position: absolute; z-index: 2; }
/* the curve in numbers, for anyone who can't hover or see it */
.curve-marks {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  margin: 14px 0 20px; padding-top: 14px; border-top: 1px solid var(--line);
}
.curve-marks div { min-width: 0; }
.curve-marks b { display: block; font-family: var(--font-pixel); font-weight: 400; font-size: 22px; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curve-marks span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.curve-marks div:nth-child(2) b { color: var(--accent); }
@media (max-width: 520px) {
  .curve-marks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price h2 { font-size: 34px; }
  /* the svg scales down with the dialog, so its type scales up to stay readable */
  .c-label { font-size: 17px; }
  .c-now-label { font-size: 22px; }
}

/* ---------- claim ---------- */
.claim { width: min(660px, calc(100% - 32px)); }
.claim form { padding: 22px 24px 24px; }
@media (max-width: 520px) { .claim form { padding: 18px 16px 16px; } }
.claim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.claim-price { font-size: 26px; }
.claim-where { margin: 4px 0 18px; font-size: 14px; color: var(--muted); }
.claim-body { display: grid; grid-template-columns: 168px 1fr; gap: 24px; }
@media (max-width: 520px) { .claim-body { grid-template-columns: 1fr; gap: 16px; } }
.preview-wrap { display: flex; flex-direction: column; }
.preview { display: block; width: 168px; height: 168px; border-radius: var(--r-s); background: var(--field); border: 1px solid var(--line); }
@media (max-width: 520px) { .preview-wrap { flex-direction: row; gap: 16px; align-items: flex-start; flex-wrap: wrap; } .preview { width: 120px; height: 120px; } }
.size-note { font-size: 13px; color: var(--alarm); margin: 6px 0 0; min-height: 1.4em; flex-basis: 100%; }
/* picture editor under the preview: drag/scroll/pinch on the preview, plus zoom and four buttons */
.preview.editing { cursor: grab; touch-action: none; }
.preview.editing.dragging { cursor: grabbing; }
.preview.editing:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pic-tools { margin-top: 10px; width: 168px; }
.pic-tools[hidden] { display: none; }
.pic-tools input[type="range"] { display: block; width: 100%; margin: 0 0 8px; accent-color: var(--accent); }
.pic-btns { display: flex; justify-content: space-between; }
.pic-btns .chip.icon { width: 36px; height: 32px; padding: 0; display: grid; place-items: center; }
.pic-btns svg { width: 16px; height: 16px; }
.pic-help { margin: 6px 0 0; font-size: 12px; color: var(--dim); }
@media (max-width: 520px) { .pic-tools { margin-top: 0; flex: 1 1 140px; width: auto; } }
.fields label, .row label, .row .lbl { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
/* the picture button is a label too: keep it a centred flex row, not a block label */
.row label.file-btn { display: flex; align-items: center; font-size: 19px; color: var(--text); margin-bottom: 12px; }
.row label.file-btn span { line-height: 1; padding-top: 2px; }
input:disabled { opacity: .45; cursor: not-allowed; }
input:disabled:hover { border-color: var(--line); }
.field-note { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }
.field-note[hidden] { display: none; }
input[type="text"], input[type="url"], input[type="number"] {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; height: 40px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: var(--r-s);
}
input:hover { border-color: var(--line-strong); }
input::placeholder { color: var(--dim); }
.row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.row .color { flex: none; }
.row .file { flex: 1 1 160px; }
.row .lbl { margin-bottom: 0; }
input[type="color"] {
  display: block; margin-top: 4px; width: 56px; height: 40px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--field); cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 3px; }
.file-btn {
  display: flex; align-items: center; gap: 8px; margin-top: 4px; height: 40px; padding: 0 12px;
  font-size: 19px; color: var(--text);
  background: var(--btn); border: 1px dashed var(--line-strong); border-radius: var(--r-s); cursor: pointer;
  max-width: 100%;
}
.file-btn:hover { border-color: var(--muted); }
.file-btn:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-btn.has-file { border-style: solid; }
.file-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.claim-note { font-size: 13px; color: var(--muted); margin: 10px 0 20px; max-width: 48em; }
.claim-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .claim-actions {
    position: sticky; bottom: 0; margin: 0 -16px -16px; padding: 12px 16px 16px;
    background: var(--surface); border-top: 1px solid var(--line); flex-wrap: nowrap;
  }
  .claim-actions .btn { flex: 1; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .claim-note { margin-bottom: 16px; }
  .size-note { margin-top: 0; min-height: 0; }
  .size-note:empty { display: none; }
}
.btn { font-size: 20px; line-height: 1.2; padding: 7px 18px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; background: var(--btn); }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hi); }
.btn.primary:disabled, .claim-btn:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn.ghost:hover { background: var(--btn-hover); }

/* live (API answered) vs demo (no API, claims stay in the browser) copy; app.js sets body.demo */
body.demo .if-live, body:not(.demo) .if-demo { display: none; }
/* the bot check: empty (and out of the way) unless it needs the visitor to tick a box */
.turnstile { margin: -8px 0 16px; }
.turnstile:empty { display: none; }
