/* Paper Trench: literal paper. Graph-paper ground, red margin rule, ink-blue type, highlighter marks for gains /
   losses / flags, sticky-note tips, a handwritten accent face next to a bold grotesk and a mono for numbers.
   Phone-first (375 px), 16 px gutters, big tap targets, no horizontal scroll. Owner: SITE (BLUEPRINT §12).
   CSP note: no inline style attributes anywhere; dynamic widths use CSS custom properties set through CSSOM. */

:root {
  color-scheme: light;
  --paper: #fbfaf4;
  --paper-2: #fffef9;
  --paper-3: #f4f2e6;
  --grid: #cfe2f3;
  --grid-soft: #e3eef8;
  --margin: #e5484d;
  --ink: #1d3a8a;
  --text: #22305e;
  --muted: #5b678f;
  --line: #c6d1ea;
  --hl-yellow: #ffe45c;
  --hl-green: #9cf2a8;
  --hl-pink: #ff9fcf;
  --hl-blue: #a9d6ff;
  --sticky: #fff3a6;
  --up: #157a3a;
  --down: #b4235a;
  --font-head: 'Space Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Space Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(29, 58, 138, 0.06), 0 10px 22px -16px rgba(29, 58, 138, 0.45);
  --shadow-press: 2px 2px 0 var(--ink);
  --top-h: 60px;
  --tab-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--margin); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 7vw, 46px); font-weight: 700; }
h2 { font-size: clamp(20px, 4.8vw, 26px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 0.8em; }
:focus-visible { outline: 3px solid var(--hl-blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 16px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); padding: 0 16px;
  background: rgba(251, 250, 244, 0.94);
  border-bottom: 2px solid var(--grid);
  backdrop-filter: saturate(1.2) blur(6px);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; flex: 0 1 auto; overflow: hidden; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-name { font: 700 19px/1 var(--font-head); letter-spacing: -0.02em; white-space: nowrap; }
.logo-name { background: linear-gradient(transparent 62%, var(--hl-yellow) 62% 92%, transparent 92%); padding: 0 2px; }
.logo-name em { font-style: normal; background: linear-gradient(transparent 55%, var(--hl-yellow) 55% 92%, transparent 92%); padding: 0 2px; }
.nav { display: none; gap: 2px; margin-left: 8px; }
.nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--text); }
.nav a:hover { background: var(--grid-soft); }
.nav a.on { color: var(--ink); background: linear-gradient(transparent 52%, var(--hl-yellow) 52% 90%, transparent 90%); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 0 auto; }
.mock-short { display: none; }
@media (max-width: 559px) {
  .top { gap: 8px; padding: 0 12px 0 16px; }
  .logo-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .auth-me .trader-name, .auth-me .auth-cash { display: none; }
  .auth-me { padding: 4px; border-radius: 999px; }
  .auth-btn { padding: 6px 10px; }
  .clock { padding: 6px 8px; font-size: 12px; }
  .mock-long { display: none; }
  .mock-short { display: inline; }
}
@media (max-width: 359px) {
  .logo-name { display: none; }
}
.clock {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 36px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper-2);
  font: 600 13px/1 var(--font-mono); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.clock .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.clock.closing { border-color: var(--margin); background: #fff0f5; }
.clock.closing .dot { background: var(--margin); animation: blink 1s steps(2) infinite; }
.clock.settling .dot, .clock.idle .dot { background: var(--muted); }
.clock.sample { border-style: dashed; }
@keyframes blink { 50% { opacity: 0.2; } }
.auth-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.auth-btn .ico { width: 18px; height: 18px; }
.auth-me { background: var(--paper-2); color: var(--ink); border-color: var(--line); padding: 4px 10px 4px 4px; max-width: 160px; }
.auth-me .trader-name { overflow: hidden; text-overflow: ellipsis; }
.auth-cash { font: 600 12px/1 var(--font-mono); color: var(--muted); }

/* ---------- mock banner ---------- */
.mockbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px;
  padding: 6px 16px; text-align: center;
  background: repeating-linear-gradient(-45deg, var(--hl-yellow) 0 14px, #ffd84a 14px 28px);
  color: var(--ink); font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--ink);
}
.mockbar a { font-weight: 700; }
body.is-mock .top { top: 33px; }

/* ---------- sheet (main paper) ---------- */
.sheet { position: relative; max-width: 1140px; margin: 0 auto; padding: 18px 16px calc(var(--tab-h) + 40px) 26px; min-height: 60vh; outline: none; }
.sheet::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 9px; width: 5px; pointer-events: none;
  background: linear-gradient(90deg, var(--margin) 0 1.5px, transparent 1.5px 3.5px, var(--margin) 3.5px 5px);
  opacity: 0.7;
}
.view-in { animation: fadein 0.18s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
.foot { max-width: 1140px; margin: 0 auto; padding: 18px 16px calc(var(--tab-h) + 28px) 26px; font-size: 13px; color: var(--muted); border-top: 1.5px dashed var(--line); }
.foot p { margin: 0 0 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot-links a { color: var(--muted); }

/* ---------- phone tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(251, 250, 244, 0.97); border-top: 2px solid var(--grid);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; min-width: 0; }
.tabbar svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { background: var(--hl-yellow); border-radius: 8px; box-shadow: 0 0 0 4px var(--hl-yellow); }

/* ---------- generic blocks ---------- */
.card { position: relative; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.taped::before {
  content: ''; position: absolute; top: -11px; left: 50%; width: 92px; height: 22px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(169, 214, 255, 0.55); border: 1px solid rgba(29, 58, 138, 0.08); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.section { margin: 26px 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-title h2 { margin: 0; }
.stack > * + * { margin-top: 10px; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.divider { border: 0; border-top: 1.5px dashed var(--line); margin: 14px 0; }

.hl { color: var(--ink); padding: 0.02em 0.28em; border-radius: 0.25em 0.4em 0.3em 0.45em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl-yellow { background: linear-gradient(100deg, rgba(255, 228, 92, 0.25) 0 3%, var(--hl-yellow) 6% 94%, rgba(255, 228, 92, 0.3) 97%); }
.hl-green, .hl-gain { background: linear-gradient(100deg, rgba(156, 242, 168, 0.3) 0 3%, var(--hl-green) 6% 94%, rgba(156, 242, 168, 0.35) 97%); }
.hl-pink, .hl-loss { background: linear-gradient(100deg, rgba(255, 159, 207, 0.3) 0 3%, var(--hl-pink) 6% 94%, rgba(255, 159, 207, 0.35) 97%); }
.hl-blue { background: linear-gradient(100deg, rgba(169, 214, 255, 0.3) 0 3%, var(--hl-blue) 6% 94%, rgba(169, 214, 255, 0.35) 97%); }
.hl-flat { background: var(--grid-soft); }
.scribble { font-family: var(--font-hand); font-size: 21px; line-height: 1.1; color: var(--margin); font-weight: 600; }
.scribble.ink { color: var(--ink); }
.sticky {
  position: relative; display: block; background: var(--sticky); color: #3b3510;
  padding: 12px 14px 14px; border-radius: 2px 2px 10px 2px; font-family: var(--font-hand); font-size: 20px; line-height: 1.2;
  box-shadow: 0 12px 16px -12px rgba(60, 50, 0, 0.55), inset 0 -18px 18px -18px rgba(120, 100, 0, 0.25);
  margin: 12px 0;
}
.sticky b { display: block; font-family: var(--font-head); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; color: #6b5d00; }
.tilt-l { transform: rotate(-1.3deg); }
.tilt-r { transform: rotate(1.1deg); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper-2); font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.chip-curve { border-color: #8fb8e6; background: #eef6ff; }
.chip-amm { border-color: #9ad6a6; background: #effcf1; }
.chip-arena { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip-warn { border-color: var(--margin); color: var(--margin); background: #fff4f6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--paper-2); color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-press); transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-buy { background: var(--hl-green); }
.btn-sell { background: var(--hl-pink); }
.btn-danger { background: var(--margin); border-color: #a3242b; color: #fff; box-shadow: 2px 2px 0 #a3242b; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--grid-soft); }
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn.copy { width: 32px; height: 32px; }
.ico { width: 20px; height: 20px; flex: none; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--paper-3); border: 1.5px solid var(--line); max-width: 100%; }
.seg-btn { min-height: 38px; padding: 6px 12px; border-radius: 9px; border: 0; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 0 var(--line), inset 0 -3px 0 var(--hl-yellow); }

.input, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper-2);
  font-size: 16px; color: var(--text);
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--hl-blue); }
.label { display: block; font-weight: 700; color: var(--ink); margin: 0 0 6px; font-size: 14px; }
.field { margin: 0 0 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1.5px solid var(--grid); min-width: 0; }
.stat-k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-v { font-size: 17px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.stat-h { font-size: 12px; color: var(--muted); }

.loading { display: flex; align-items: center; gap: 10px; padding: 26px 4px; color: var(--muted); font-family: var(--font-hand); font-size: 22px; }
.pencil { width: 28px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #f2c94c 0 70%, #e9a2a2 70% 85%, #444 85%); animation: write 0.9s ease-in-out infinite alternate; }
@keyframes write { from { transform: translateX(-4px) rotate(-8deg); } to { transform: translateX(8px) rotate(4deg); } }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); background: rgba(255, 254, 249, 0.7); }
.empty p { margin: 0 0 10px; }
.errbox { padding: 14px 16px; border-radius: var(--radius); border: 2px solid var(--margin); background: #fff4f6; color: #7a1c37; }
.errbox p { margin: 0 0 8px; }

/* avatars + coin images */
.ava { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; font: 700 12px/1 var(--font-head); color: var(--ink); border: 1.5px solid var(--ink); }
.ava-sm { width: 26px; height: 26px; font-size: 10px; }
.ava-md { width: 36px; height: 36px; }
.ava-lg { width: 64px; height: 64px; font-size: 22px; border-width: 2px; }
.tone-yellow { background: var(--hl-yellow); }
.tone-green { background: var(--hl-green); }
.tone-pink { background: var(--hl-pink); }
.tone-blue { background: var(--hl-blue); }
.coin-img { flex: none; border-radius: 10px; object-fit: cover; background: var(--paper-3); border: 1.5px solid var(--line); }
.coin-sm { width: 28px; height: 28px; }
.coin-md { width: 40px; height: 40px; }
.coin-lg { width: 56px; height: 56px; border-radius: 14px; }
.coin-fb { display: inline-flex; align-items: center; justify-content: center; font: 700 11px/1 var(--font-mono); color: var(--ink); background: var(--grid-soft); }
.trader { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; min-width: 0; }
.trader-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* check level badges + flags */
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink); border: 1.5px solid transparent; white-space: nowrap; }
.lvl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.lvl-red { background: var(--hl-pink); border-color: #e46aa6; }
.lvl-red .lvl-dot { background: var(--margin); }
.lvl-yellow { background: var(--hl-yellow); border-color: #e5c53a; }
.lvl-yellow .lvl-dot { background: #a07800; }
.lvl-green { background: var(--hl-green); border-color: #6fd383; }
.lvl-green .lvl-dot { background: var(--up); }
.lvl-unknown { background: var(--paper-2); border: 1.5px dashed var(--muted); color: var(--muted); }
.lvl-unknown .lvl-dot { background: var(--muted); }
.lvl-big { font-size: 17px; padding: 6px 14px 6px 12px; }
.lvl-big .lvl-dot { width: 11px; height: 11px; }
.flags { list-style: none; margin: 0; padding: 0; }
.flag { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.flag:last-child { border-bottom: 0; }
.flag-mark { width: 12px; height: 12px; margin-top: 5px; border-radius: 3px; flex: none; transform: rotate(8deg); }
.flag-red .flag-mark { background: var(--margin); }
.flag-yellow .flag-mark { background: #f0c419; }
.flag-green .flag-mark { background: #36b45a; }
.flag-info .flag-mark { background: var(--hl-blue); border: 1.5px solid var(--ink); }
.flag-title { color: var(--ink); }
.flag-says { color: var(--text); }
.codes { display: flex; flex-wrap: wrap; gap: 4px; }
.code { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--paper-3); color: var(--muted); white-space: nowrap; }
.code-red { background: #ffe1ef; color: #9c1f50; }

.bar { position: relative; display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--grid-soft); border: 1px solid var(--grid); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: repeating-linear-gradient(-45deg, var(--ink) 0 4px, #3654b4 4px 8px); border-radius: 999px; }
.bar.near .bar-fill { background: repeating-linear-gradient(-45deg, #2e9c50 0 4px, #45b766 4px 8px); }

/* ---------- landing hero ---------- */
.hero { position: relative; padding: 22px 18px 18px; margin: 4px 0 20px; }
.hero h1 { max-width: 15ch; }
.hero h1 mark { color: var(--ink); }
.hero-sub { font-size: 18px; max-width: 46ch; }
.hero-note { position: absolute; right: 14px; top: 10px; transform: rotate(4deg); max-width: 150px; text-align: right; }
.steps { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.steps li { position: relative; padding: 10px 12px 10px 46px; background: var(--paper); border: 1.5px solid var(--grid); border-radius: 10px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 10px; top: 9px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 700 14px/1 var(--font-head); color: var(--ink); background: var(--hl-yellow); }
.steps b { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-close { position: absolute; top: 6px; right: 6px; }
.season-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1.5px dashed var(--ink); background: rgba(255, 254, 249, 0.85); font-size: 14px; }
.season-strip .num { font-weight: 700; color: var(--ink); }

/* ---------- board ---------- */
.paste { display: flex; gap: 8px; }
.paste .input { flex: 1 1 auto; min-width: 0; }
.paste-msg { margin-top: 8px; }
.cands { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.cands button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper-2); cursor: pointer; min-height: 48px; }
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: 'img name chk' 'img meta meta';
  gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: var(--paper-2); border: 1.5px solid var(--line); box-shadow: var(--shadow); min-height: 64px;
}
.row:hover { border-color: var(--ink); }
.row-img { grid-area: img; }
.row-name { grid-area: name; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.row-name b { color: var(--ink); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name .sym { font: 600 13px/1 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-chk { grid-area: chk; display: flex; align-items: center; gap: 6px; justify-self: end; }
.row-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.row-meta .num { color: var(--text); }
.row-meta .up { color: var(--up); font-weight: 700; }
.row-meta .down { color: var(--down); font-weight: 700; }
.row-bar { flex: 0 0 56px; width: 56px; display: inline-block; }
.row-stage .chip { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.row-codes { grid-column: 2 / -1; }
.board-head { display: none; }
.row-stage { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ico-sm { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; }
.coin-links a { display: inline-flex; align-items: center; gap: 3px; }
.asof { font-size: 13px; color: var(--muted); }

/* ---------- coin / trade screen ---------- */
.coin-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'strip' 'chart' 'check' 'ticket' 'pos'; }
.coin-head { grid-area: head; display: flex; gap: 12px; align-items: flex-start; }
.coin-title { min-width: 0; flex: 1 1 auto; }
.coin-title h1 { font-size: clamp(24px, 6vw, 36px); margin: 0; overflow-wrap: anywhere; }
.coin-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.coin-sub .mint { font: 600 13px/1 var(--font-mono); color: var(--muted); }
.coin-px { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin-top: 8px; }
.coin-px .big { font: 700 22px/1.1 var(--font-mono); color: var(--ink); }
.coin-links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.coin-strip { grid-area: strip; margin: 0; }
.chart-card { grid-area: chart; margin: 0; padding: 12px; }
.chart-box { position: relative; width: 100%; min-height: 220px; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-tick { font: 500 11px var(--font-mono); fill: var(--muted); }
.ch-wick { stroke-width: 1.5; }
.ch-up.ch-wick { stroke: #157a3a; }
.ch-down.ch-wick { stroke: #b4235a; }
.ch-body.ch-up { fill: var(--hl-green); stroke: #157a3a; stroke-width: 1.2; }
.ch-body.ch-down { fill: var(--hl-pink); stroke: #b4235a; stroke-width: 1.2; }
.ch-last { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.ch-last-tag { fill: var(--ink); }
.ch-last-txt { font: 600 11px var(--font-mono); fill: var(--paper); }
.ch-line { stroke: var(--margin); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ch-line-label { font: 600 15px var(--font-hand); fill: var(--margin); }
.chart-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.chart-note { position: absolute; right: 70px; top: 4px; pointer-events: none; }
.check-card { grid-area: check; margin: 0; }
.check-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.check-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.check-nums .stat-v mark { padding: 0 0.2em; }
.check-unav { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding-left: 18px; }
.ticket { grid-area: ticket; margin: 0; }
.ticket .seg { width: 100%; }
.ticket .seg-btn { flex: 1 1 0; font-size: 16px; min-height: 44px; }
.ticket .seg-btn.on[data-v='buy'] { box-shadow: inset 0 -4px 0 var(--hl-green), 0 1px 0 var(--line); }
.ticket .seg-btn.on[data-v='sell'] { box-shadow: inset 0 -4px 0 var(--hl-pink), 0 1px 0 var(--line); }
.sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0 8px; }
.sizes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.size { min-height: 46px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper-2); font: 700 15px/1 var(--font-mono); color: var(--ink); cursor: pointer; padding: 0 2px; }
.size.on { border-color: var(--ink); background: var(--hl-yellow); }
.size:disabled { opacity: 0.45; cursor: not-allowed; }
.custom { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.custom .input { min-height: 44px; font-family: var(--font-mono); }
.ticket-cash { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.ticket-cash .num { color: var(--ink); font-weight: 700; }
.ticket-fine { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.ticket-msg { margin-top: 10px; }
.pos { grid-area: pos; margin: 0; }
.pos-pnl { font-size: 22px; }

/* ---------- tables (standings, leaders) ---------- */
.tbl-wrap { width: 100%; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--ink); }
.tbl td { padding: 9px 8px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.me td { background: rgba(255, 228, 92, 0.35); }
.tbl .rank { font: 700 15px/1 var(--font-mono); color: var(--ink); width: 2.6em; }
.tbl .trader { max-width: 46vw; }
.rank-1 .rank, .rank-2 .rank, .rank-3 .rank { font-size: 17px; }
.medal { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); font: 700 12px/1 var(--font-mono); }
.medal-1 { background: var(--hl-yellow); }
.medal-2 { background: #e4e9f5; }
.medal-3 { background: #f6c9a4; }
.hide-sm { display: none; }

.clock-big { font: 700 clamp(40px, 13vw, 76px)/1 var(--font-mono); color: var(--ink); letter-spacing: -0.04em; }
.clock-big.closing { color: var(--margin); }
.season-head { display: grid; gap: 14px; }
.pool { font: 700 26px/1.1 var(--font-mono); color: var(--ink); }
.split { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.split span { font: 600 11px/1 var(--font-mono); padding: 4px 5px; border-radius: 5px; background: var(--paper-3); color: var(--ink); }
.past { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.past a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper-2); text-decoration: none; color: var(--text); min-height: 56px; }
.past a:hover { border-color: var(--ink); }
.past b { color: var(--ink); }
.payout-status { font-weight: 700; }
.sig { font: 600 13px/1.4 var(--font-mono); overflow-wrap: anywhere; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0; font-size: clamp(24px, 6vw, 34px); overflow-wrap: anywhere; }
.podiums { display: flex; gap: 10px; flex-wrap: wrap; }
.podium { display: flex; align-items: center; gap: 6px; font: 700 16px/1 var(--font-mono); color: var(--ink); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--sticky); border: 1.5px solid #e5d36a; font-weight: 700; color: #5c5000; font-size: 13px; transform: rotate(-1deg); }
.badge:nth-child(2n) { transform: rotate(1deg); }

/* ---------- feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.feed-what { flex: 1 1 200px; min-width: 0; }
.feed-time { font: 500 12px/1 var(--font-mono); color: var(--muted); margin-left: auto; }
.feed-amt { color: var(--ink); font-weight: 600; }
.coin-link { font-weight: 700; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; color: var(--ink); min-height: 44px; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--paper-3); border: 2px solid var(--line); position: relative; cursor: pointer; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper-2); border: 1.5px solid var(--ink); transition: transform 0.15s; }
.switch input:checked { background: var(--hl-green); border-color: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- school ---------- */
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lesson-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 12px; align-items: center; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper-2); box-shadow: var(--shadow); text-decoration: none; color: var(--text); min-height: 72px; }
.lesson-card:hover { border-color: var(--ink); }
.lesson-n { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 700 18px/1 var(--font-hand); color: var(--ink); background: var(--paper); }
.lesson-card b { color: var(--ink); font-size: 17px; }
.done-mark { font-family: var(--font-hand); font-size: 22px; color: var(--up); font-weight: 700; }
.lesson-body { max-width: 68ch; font-size: 17px; }
.lesson-body ul { padding-left: 22px; }
.lesson-body li { margin: 4px 0; }
.live-ex { position: relative; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper-2); margin: 16px 0; }
.live-ex .scribble { position: absolute; top: -16px; left: 12px; background: var(--paper); padding: 0 6px; }
.quiz fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; background: var(--paper-2); }
.quiz legend { font-weight: 700; color: var(--ink); padding: 0 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 8px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.choice:hover { background: var(--grid-soft); }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.choice.right { background: rgba(156, 242, 168, 0.55); }
.choice.wrong { background: rgba(255, 159, 207, 0.5); }
.why { font-size: 14px; color: var(--text); margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--hl-yellow); }

/* ---------- rules ---------- */
.prose { max-width: 70ch; font-size: 16.5px; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.weights { display: grid; gap: 6px; margin: 12px 0; }
.weight { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.weight .bar { height: 12px; }
.faq details { border-bottom: 1.5px dashed var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 32px; display: flex; align-items: center; }
.faq details p { margin: 8px 0 4px; }

/* ---------- modal + toasts ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(34, 48, 94, 0.38); padding: 0; animation: fadein 0.15s ease-out; }
.modal {
  width: 100%; max-height: 88vh; overflow: auto; padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-soft) 1px, transparent 1px), linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px);
  background-size: 24px 24px; border-radius: 18px 18px 0 0; border: 2px solid var(--ink); border-bottom: 0;
  box-shadow: 0 -10px 30px -12px rgba(29, 58, 138, 0.5);
}
.modal-red { border-color: var(--margin); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.modal-title { margin: 0; font-size: 21px; }
.modal-actions { display: flex; flex-wrap: wrap-reverse; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn { flex: 1 1 140px; }
.wallets { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.wallets button, .wallets a { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper-2); cursor: pointer; font-weight: 700; color: var(--ink); text-decoration: none; text-align: left; }
.wallets button:hover, .wallets a:hover { border-color: var(--ink); }
.wallets img, .wallet-fb { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.wallet-fb { display: inline-flex; align-items: center; justify-content: center; background: var(--hl-blue); font: 700 13px/1 var(--font-head); }
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 520px; width: 100%; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45); transition: opacity 0.3s, transform 0.3s; pointer-events: auto; }
.toast-error { background: #8c1d3f; }
.toast-gain { background: #0f5c2b; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- admin ---------- */
.admin-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mode { font-weight: 700; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--ink); }
.mode-dry { background: var(--hl-yellow); }
.mode-live { background: var(--hl-pink); border-color: var(--margin); }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono-box { font: 500 12px/1.45 var(--font-mono); background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-form { display: grid; gap: 8px; grid-template-columns: 1fr; }

/* ---------- desktop ---------- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hide-sm { display: table-cell; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-wrap { align-items: center; padding: 16px; }
  .modal { max-width: 520px; border-radius: 18px; border-bottom: 2px solid var(--ink); }
  .modal-red { border-color: var(--margin); }
  .admin-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}
@media (min-width: 900px) {
  :root { --tab-h: 0px; }
  .tabbar { display: none; }
  .nav { display: flex; }
  .top { padding: 0 24px; }
  .sheet { padding: 26px 32px 56px 64px; }
  .sheet::before { left: 34px; }
  .foot { padding: 20px 32px 32px 64px; }
  .toasts { bottom: 24px; left: auto; right: 24px; align-items: flex-end; }
  .hero { padding: 30px 30px 26px; }
  .hero-note { right: 30px; top: 22px; max-width: 220px; }
  .coin-grid { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'head head' 'strip strip' 'chart ticket' 'check pos' 'check .'; align-items: start; }
  .ticket { position: sticky; top: calc(var(--top-h) + 16px); }
  .row {
    grid-template-columns: 40px minmax(160px, 2.2fr) repeat(4, minmax(70px, 1fr)) minmax(150px, 1.4fr);
    grid-template-areas: none; gap: 10px; min-height: 60px;
  }
  .row > * { grid-area: auto; }
  .row-meta { display: contents; }
  .row-meta > span { font-size: 14px; }
  .row-codes { grid-column: auto; }
  .board-head {
    display: grid; grid-template-columns: 40px minmax(160px, 2.2fr) repeat(4, minmax(70px, 1fr)) minmax(150px, 1.4fr); gap: 10px; padding: 0 12px 4px;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700;
  }
  .row-chk { justify-self: start; flex-wrap: wrap; }
  .hide-wide { display: none; }
  .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .season-head { grid-template-columns: 1.2fr 1fr; align-items: end; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* ---------- Pulse: live columns (BLUEPRINT §17.4) ---------- */
.up { color: var(--up); }
.down { color: var(--down); }
.ico-xs { width: 13px; height: 13px; flex: none; }
.k { font-size: 11px; color: var(--muted); font-weight: 600; margin-right: 3px; letter-spacing: 0; }
.pulse-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; }
.pulse-title { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pulse-title h1 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: clamp(28px, 6vw, 38px); }
.pulse-ico { width: 30px; height: 30px; color: var(--margin); }
.pulse-tools { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; flex: 1 1 300px; justify-content: flex-end; }
.paste-compact { flex: 1 1 240px; max-width: 460px; margin: 0; }
.paste-compact .input { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.paste-compact .paste-msg:empty { display: none; }
.pulse-fine { margin-top: 14px; max-width: 90ch; }
.st-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 700 12px/1.4 var(--font-mono); border: 1.5px solid var(--line); background: var(--paper-2); color: var(--ink); white-space: nowrap; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.st-live { border-color: #6fd383; background: #effcf1; }
.st-live .st-dot { background: #22a35a; animation: livepulse 1.6s ease-out infinite; }
.st-poll { border-color: #e5c53a; background: #fffbe0; }
.st-poll .st-dot { background: #c99a00; }
.st-off { border-color: var(--margin); background: #fff4f6; color: #8c1d3f; }
.st-off .st-dot { background: var(--margin); }
.st-sample { border: 1.5px dashed var(--ink); background: repeating-linear-gradient(-45deg, var(--hl-yellow) 0 8px, #ffd84a 8px 16px); }
.st-sample .st-dot { background: var(--ink); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(34, 163, 90, 0.55); } 100% { box-shadow: 0 0 0 8px rgba(34, 163, 90, 0); } }

.pulse-seg { margin: 0 0 10px; }
.pulse-seg .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.pulse-seg .seg-btn { padding: 6px 4px; font-size: 14px; }
.pcol { position: relative; min-width: 0; background: rgba(255, 254, 249, 0.78); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 8px 8px; }
.pcol.paused { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--hl-yellow); }
.pcol-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 2px; }
.pcol-head h2 { margin: 0; font-size: 19px; }
.pcol-count { font-size: 12px; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: var(--paper-3); }
.pcol-paused { font: 700 17px/1 var(--font-hand); color: var(--margin); white-space: nowrap; }
.pcol-pause { margin-left: auto; width: 34px; height: 34px; border: 1.5px solid var(--line); background: var(--paper-2); }
.pcol-pause[aria-pressed="true"] { background: var(--hl-yellow); border-color: var(--ink); }
.pcol-pause .ico { width: 16px; height: 16px; }
.pcol-blurb { font-size: 12.5px; color: var(--muted); margin: 0 4px 8px; }
.pcol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (max-width: 899px) {
  .pulse[data-col="new"] .pcol:not([data-col="new"]),
  .pulse[data-col="stretch"] .pcol:not([data-col="stretch"]),
  .pulse[data-col="migrated"] .pcol:not([data-col="migrated"]) { display: none; }
}

/* one coin card */
.pc { position: relative; background: var(--paper-2); border: 1.5px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 8px 9px 8px 8px; box-shadow: var(--shadow); }
.pc:hover { border-color: var(--ink); }
.pc.lv-red { border-left-color: var(--margin); }
.pc.lv-yellow { border-left-color: #f0c419; }
.pc.lv-green { border-left-color: #36b45a; }
.pc.lv-unknown { border-left-style: dashed; border-left-color: var(--muted); }
.pc.busy { opacity: 0.72; }
.pc.popped { z-index: 6; }
.pc-top { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pc-ava { position: relative; display: block; width: 52px; height: 52px; }
.pc-ring { position: absolute; inset: 0; width: 52px; height: 52px; }
.ring-bg { fill: none; stroke: var(--grid); stroke-width: 3.5; }
.ring-fg { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.ring-near .ring-fg { stroke: #22a35a; }
.ring-done .ring-fg { stroke: #36b45a; }
.coin-pc { position: absolute; left: 6px; top: 6px; width: 40px; height: 40px; border-radius: 50%; }
.pc-id { min-width: 0; }
.pc-link { display: flex; align-items: baseline; gap: 6px; min-width: 0; text-decoration: none; color: var(--ink); }
.pc-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; z-index: 1; }
.pc-link:focus-visible { outline: none; }
.pc-link:focus-visible::after { outline: 3px solid var(--hl-blue); outline-offset: 1px; }
.pc-sym { font: 700 15.5px/1.2 var(--font-head); white-space: nowrap; }
.pc-name { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pc-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.pc-age { color: var(--ink); font-weight: 700; }
.pc-soc { display: inline-flex; gap: 1px; position: relative; z-index: 2; }
.soc { display: inline-flex; min-width: 20px; height: 18px; padding: 0 4px; align-items: center; justify-content: center; border-radius: 5px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 700 10px/1 var(--font-mono); text-decoration: none; }
.soc:hover { background: var(--grid-soft); color: var(--ink); }
.pc-paid { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--hl-blue); color: var(--ink); }
.pc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.qflag { display: inline-flex; align-items: center; gap: 4px; font: 700 11px/1 var(--font-head); padding: 3px 7px 3px 6px; border-radius: 999px; white-space: nowrap; border: 1.5px solid transparent; color: var(--ink); }
.qflag .lvl-dot { width: 7px; height: 7px; }
.qf-red { background: var(--hl-pink); border-color: #e46aa6; }
.qf-red .lvl-dot { background: var(--margin); }
.qf-yellow { background: var(--hl-yellow); border-color: #e5c53a; }
.qf-yellow .lvl-dot { background: #a07800; }
.qf-green { background: var(--hl-green); border-color: #6fd383; }
.qf-green .lvl-dot { background: var(--up); }
.qf-unknown { background: var(--paper-2); border: 1.5px dashed var(--muted); color: var(--muted); }
.qf-unknown .lvl-dot { background: var(--muted); }
.pc-mc { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pc-mc b { font-size: 14.5px; color: var(--ink); }
.pc .num { border-radius: 4px; padding: 0 2px; }
.pc-stats { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; font-size: 12.5px; }
.pc-stat { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: var(--muted); }
.pc-stat b { color: var(--ink); }
.bs { position: relative; display: inline-block; width: 36px; height: 7px; border-radius: 999px; background: var(--hl-pink); overflow: hidden; border: 1px solid rgba(29, 58, 138, 0.25); margin-right: 3px; }
.bs-b { position: absolute; inset: 0 auto 0 0; width: var(--b, 50%); background: #36b45a; }
.bs-none { background: var(--grid-soft); }
.bs-none .bs-b { display: none; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.pc-chips { display: flex; gap: 3px; flex-wrap: wrap; }
.hchip { display: inline-flex; gap: 3px; align-items: baseline; font-size: 11px; padding: 1px 5px; border-radius: 5px; background: var(--paper-3); color: var(--ink); white-space: nowrap; border: 1px solid transparent; }
.hchip .num { padding: 0 1px; }
.hchip-k { font-weight: 700; color: var(--muted); font-size: 10px; }
.hc-red { background: var(--hl-pink); }
.hc-red .hchip-k { color: #8c1d3f; }
.hc-yellow { background: var(--hl-yellow); }
.hc-yellow .hchip-k { color: #6b5d00; }
.hc-green { background: rgba(156, 242, 168, 0.55); }
.hc-unknown { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.pc-quick { display: inline-flex; align-items: center; gap: 4px; position: relative; z-index: 2; margin-left: auto; }
.qb { min-width: 38px; min-height: 30px; padding: 0 7px; border-radius: 8px; border: 1.5px solid var(--ink); background: var(--paper-2); font: 700 12.5px/1 var(--font-mono); color: var(--ink); cursor: pointer; box-shadow: 1.5px 1.5px 0 var(--ink); }
.qb:hover { background: var(--hl-green); }
.qb:active { transform: translate(1.5px, 1.5px); box-shadow: none; }
.qb:disabled { opacity: 0.5; cursor: progress; }
.qb-ico { color: #c99a00; }
.pc-nt { font-size: 11px; color: var(--muted); }
.pc-pop { position: absolute; z-index: 3; top: 4px; left: 4px; right: 4px; padding: 10px 12px; background: #fff4f6; border: 2px solid var(--margin); border-radius: 10px; box-shadow: 0 14px 24px -12px rgba(140, 29, 63, 0.55); font-size: 13px; }
.pc-pop-t { display: block; color: #8c1d3f; font-family: var(--font-head); margin-bottom: 4px; font-size: 14px; }
.pc-pop ul { margin: 0 0 6px; padding-left: 18px; }
.pc-pop p { margin: 0 0 8px; color: #7a1c37; }
.pc-pop-a { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pc-pop-a .btn { min-height: 36px; }
@media (max-width: 899px) {
  .qb { min-height: 38px; min-width: 46px; font-size: 14px; }
  .pc-sym { font-size: 16.5px; }
}

/* landing hero with live cards */
.hero-grid { display: grid; gap: 12px 24px; grid-template-areas: "main" "side" "more"; }
.hero-main { grid-area: main; min-width: 0; }
.hero-more { grid-area: more; min-width: 0; }
.hero-main .hero-sub { margin-bottom: 0; }
@media (max-width: 559px) {
  .hero-sub { font-size: 16px; }
  .hero-more .steps { gap: 6px; margin-top: 4px; }
  .hero-more .steps li { font-size: 14px; padding: 8px 10px 8px 42px; }
}
.hero-grid .hero-note { position: static; display: inline-block; max-width: none; text-align: left; transform: rotate(-1.5deg); margin-bottom: 6px; }
.hero-side { grid-area: side; min-width: 0; }
.hero-live-h { margin: 0 0 6px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hero-live { display: grid; gap: 8px; }
.hero-live .loading { padding: 10px 4px; }
.mini { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); border-left: 4px solid var(--line); background: var(--paper); text-decoration: none; color: var(--text); min-height: 52px; }
.mini:hover { border-color: var(--ink); }
.mini.lv-red { border-left-color: var(--margin); }
.mini.lv-yellow { border-left-color: #f0c419; }
.mini.lv-green { border-left-color: #36b45a; }
.mini .coin-sm { border-radius: 50%; }
.mini-t { display: flex; flex-direction: column; min-width: 0; }
.mini-t b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-c { font-size: 11.5px; color: var(--muted); }
.mini-n { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; }
.mini-n .num { color: var(--ink); font-weight: 700; }

/* ---------- token page: terminal ---------- */
.term { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "strip" "chart" "ticket" "pos" "tabs" "check"; }
.term > .card { margin: 0; }
.term-head { grid-area: head; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.term-id { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 300px; }
.term-id .coin-lg { border-radius: 50%; }
.term-id h1 { font-size: clamp(24px, 6vw, 34px); margin: 0; overflow-wrap: anywhere; }
.term-name { font: 600 15px/1.2 var(--font-body); color: var(--muted); }
.term-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.tn { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--paper); border: 1.5px solid var(--grid); min-width: 82px; text-decoration: none; color: inherit; }
a.tn:hover { border-color: var(--ink); }
.tn-k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tn-v { font-size: 17px; font-weight: 700; color: var(--ink); }
.tn-h { font-size: 11px; color: var(--muted); }
.tn-curve .bar { margin-top: 3px; width: 90px; }
.tn-chk .lvl { margin-top: 2px; font-size: 12px; padding: 2px 8px 2px 6px; }
.term-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; width: 100%; }
.term .coin-strip { grid-area: strip; margin: 0; }
.term .chart-card { grid-area: chart; }
.term .ticket { grid-area: ticket; position: static; }
.term .pos { grid-area: pos; }
.term-tabs { grid-area: tabs; }
.term .check-card { grid-area: check; scroll-margin-top: calc(var(--top-h) + 16px); }
.term-tabs .card-head .seg { flex: 0 1 auto; }

.tape { list-style: none; margin: 0; padding: 0; }
.tape-head, .tp { display: grid; grid-template-columns: 54px 46px minmax(56px, 1fr) minmax(70px, 1fr) minmax(0, 1.7fr); gap: 6px; align-items: center; }
.tape-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 0 4px 4px; border-bottom: 2px solid var(--ink); }
.tp { padding: 6px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; border-radius: 6px; }
.tp-t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tp-side { font-size: 12px; font-weight: 700; text-align: center; padding: 1px 4px; }
.tp-buy .tp-usd { color: var(--up); font-weight: 700; }
.tp-sell .tp-usd { color: var(--down); font-weight: 700; }
.tp-w { display: flex; gap: 5px; align-items: center; min-width: 0; overflow: hidden; }
.tp-w a, .tp-w .num { font-size: 12px; white-space: nowrap; }
.wl { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; white-space: nowrap; color: var(--ink); }
.wl-dev { background: var(--hl-pink); }
.wl-bundler { background: #ffd0e6; border: 1px solid #e46aa6; }
.wl-sniper { background: var(--hl-yellow); }
.wl-kol { background: var(--hl-blue); }
.small-h { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 14px 0 6px; }
.tabs-body > .small-h:first-child { margin-top: 2px; }
.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; gap: 8px; align-items: center; font-size: 13px; }
.hbar-k { font-weight: 700; color: var(--ink); }
.hbar .bar { height: 10px; }
.bar.hb-pink .bar-fill { background: repeating-linear-gradient(-45deg, var(--margin) 0 4px, #f0727a 4px 8px); }
.bar.hb-yellow .bar-fill { background: repeating-linear-gradient(-45deg, #e0b400 0 4px, #f2cd3a 4px 8px); }
.bar.hb-green .bar-fill { background: repeating-linear-gradient(-45deg, #2e9c50 0 4px, #45b766 4px 8px); }
.hbar-v { text-align: right; }
.holders { list-style: none; margin: 0; padding: 0; }
.holders li { display: flex; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.holders li > :last-child { margin-left: auto; }
.hl-labels { display: inline-flex; gap: 4px; }
@media (max-width: 559px) {
  .tape-head, .tp { grid-template-columns: 46px 42px minmax(0, 1fr) minmax(0, 1.25fr); }
  .tp-sol, .tape-head span:nth-child(4) { display: none; }
  .tn { min-width: 0; flex: 1 1 30%; }
}
@media (min-width: 1000px) {
  .term { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "head head" "strip strip" "chart ticket" "tabs pos" "tabs check"; align-items: start; }
  .term-tabs .tabs-body { max-height: 620px; overflow-y: auto; overscroll-behavior: contain; }
}

/* wide sheets for the terminal views */
@media (min-width: 900px) {
  .pulse-seg { display: none; }
  .pulse { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .pcol-body { max-height: calc(100vh - var(--top-h) - 170px); min-height: 440px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 3px 2px 1px; scrollbar-width: thin; }
  .hero-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); grid-template-areas: "main side" "more side"; align-items: start; }
  body[data-view="pulse"] .sheet, body[data-view="coin"] .sheet { max-width: 1480px; padding-left: 56px; padding-right: 24px; }
  body[data-view="pulse"] .sheet::before, body[data-view="coin"] .sheet::before { left: 30px; }
  body[data-view="pulse"] .foot, body[data-view="coin"] .foot { max-width: 1480px; padding-left: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .top, .tabbar, .mockbar, .toasts { display: none; }
}
