/* Epimeleia Graphite — flat neutral terminal: floating sidebar, hairline borders, serif headlines, violet accent */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff) format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff) format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff) format('woff'); }
@font-face { font-family: 'Lora'; font-weight: 400; font-display: swap; src: url(/fonts/lora-latin-400-normal.woff) format('woff'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-display: swap; src: url(/fonts/geist-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 500; font-display: swap; src: url(/fonts/geist-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 600; font-display: swap; src: url(/fonts/geist-mono-latin-600-normal.woff2) format('woff2'); }

:root {
  --bg: #0a0a0a; --bg2: #111111; --side: #171717; --panel: #0a0a0a; --panel-s: #0f0f0f; --panel2: #171717; --muted: #262626; --hover: rgba(38, 38, 38, 0.6); --pop: #171717;
  --line: #262626; --line2: #2e2e2e; --line3: #404040;
  --text: #fafafa; --dim: #a1a1a1; --faint: #737373;
  --accent: #753df6; --accent2: #a98bff; --accent-bg: rgba(117, 61, 246, 0.16); --accent-glow: rgba(117, 61, 246, 0.4);
  --cyan: var(--accent2); --orchid: var(--accent); --rose: var(--accent2);
  --ember: var(--accent);
  --up: #00bc7d; --up-bg: rgba(0, 188, 125, 0.12); --down: #ff2056; --down-bg: rgba(255, 32, 86, 0.12);
  --warn: #f5b544; --blue: #60a5fa;
  --glow: none;
  --ui: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: 'Lora', ui-serif, Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 8px; --r2: 14px; --side-w: 248px; --gap: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; color: var(--text); }
body {
  font: 400 14px/1.5 var(--ui); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: calc(var(--side-w) + var(--gap)) minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr) 30px; grid-template-areas: 'rail top' 'rail view' 'rail status';
  min-height: 100vh; overflow-x: hidden;
}
#fx, .orbits { display: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(117, 61, 246, 0.5); border-radius: 8px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: -0.01em; }
.up { color: var(--up); } .down { color: var(--down); } .dim { color: var(--dim); } .faint { color: var(--faint); } .acc { color: var(--accent2); } .warn { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(117, 61, 246, 0.5); }

/* ---------- sidebar (floating) ---------- */
.rail { grid-area: rail; position: sticky; top: var(--gap); align-self: start; height: calc(100vh - var(--gap) * 2); margin: var(--gap) 0 var(--gap) var(--gap); display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--side); border-radius: var(--r2); z-index: 45; overflow-y: auto; scrollbar-width: none; }
.rail .brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; margin-bottom: 8px; }
.rail .brand img { width: 26px; height: 26px; }
.rail .brand span { font: 500 19px/1 var(--ui); letter-spacing: -0.02em; color: var(--text); }
.rail a.nv { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: var(--r); color: var(--text); font-size: 14px; font-weight: 400; white-space: nowrap; }
.rail a.nv svg { width: 16px; height: 16px; stroke-width: 1.8; color: var(--dim); flex: none; }
.rail a.nv:hover { background: var(--muted); }
.rail a.nv.on { background: var(--muted); font-weight: 500; }
.rail a.nv.on svg { color: var(--text); }
.rail a.nv .lb { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.rail a.nv .ct { font: 500 12px/1 var(--ui); color: var(--text); }
.rail a.nv .ct.tagx { padding: 3px 6px; border-radius: 6px; background: var(--accent-bg); color: var(--accent2); font-size: 11px; }
.rail .tip { display: none; }
.rail .sp { flex: 1; min-height: 16px; }
.rail .sec a.nv { height: 34px; }
.rail .who { display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 4px; }
.rail .who .btn { width: 100%; }
.rail .foot { padding: 6px 8px 4px; font-size: 12px; color: var(--dim); line-height: 1.7; }
.rail .foot a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line3); }
.rail .foot a:hover { color: var(--text); }
.rail .foot i { font-style: normal; color: var(--line3); margin: 0 6px; }

/* ---------- top bar ---------- */
.top { grid-area: top; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 max(16px, env(safe-area-inset-right)) 0 16px; background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; color: var(--dim); }
.crumb .wm { display: none; }
.crumb .sl { color: var(--line3); }
.crumb .cur { color: var(--text); }
.crumb .mlogo { display: none; }
.top .sp { flex: 1; }
.readout { display: inline-flex; align-items: baseline; gap: 6px; font: 400 12px var(--mono); color: var(--dim); white-space: nowrap; }
.readout small { font: 500 11px var(--ui); color: var(--faint); }
.nav { display: none; }
.tag { font: 500 11px/1 var(--ui); padding: 3px 6px; border-radius: 6px; background: var(--accent-bg); color: var(--accent2); }
.tag.soon { background: var(--muted); color: var(--dim); }
.search { position: relative; display: flex; align-items: center; gap: 8px; width: min(320px, 28vw); height: 34px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--dim); transition: border-color 0.15s, box-shadow 0.15s; }
.search .ico { width: 15px; height: 15px; }
.search:focus-within { border-color: var(--line3); box-shadow: 0 0 0 3px rgba(117, 61, 246, 0.25); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 13px; }
.search input::placeholder { color: var(--dim); }
.search kbd { font: 500 11px var(--ui); padding: 2px 6px; border-radius: 6px; background: var(--muted); color: var(--dim); }
.search .results { position: absolute; top: 42px; left: 0; right: 0; min-width: 340px; max-height: 440px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--pop); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6); }
.search .results .card { border-radius: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.btn:hover { background: var(--muted); }
.btn .ico { width: 15px; height: 15px; }
.btn.pri { border-color: transparent; background: var(--text); color: #171717; }
.btn.pri:hover { background: #e5e5e5; }
.btn.brand { border-color: transparent; background: var(--accent); color: #fff; }
.btn.brand:hover { background: #8550ff; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--muted); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.chip.on { color: var(--text); background: var(--muted); border-color: var(--line3); }
button.chip:hover { color: var(--text); background: var(--muted); }
.top .eth { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); font: 400 12.5px var(--mono); color: var(--text); }
.top .eth::before { content: 'Ξ'; color: var(--dim); }
.top .m-only { display: none; }

/* menu */
.menu { position: fixed; z-index: 80; min-width: 240px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--pop); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6); animation: pop 0.15s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu a { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; }
.menu a b { font-weight: 500; }
.menu a:hover { background: var(--muted); }
.menu a small { color: var(--dim); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px; }

/* ---------- status bar ---------- */
.status { grid-area: status; display: flex; align-items: center; gap: 18px; height: 30px; padding: 0 16px; color: var(--faint); font-size: 12px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.status .live { display: inline-flex; align-items: center; gap: 6px; color: var(--up); font-weight: 500; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.35; } }
.status a:hover { color: var(--text); }
.status .sp { flex: 1; }
.dock { display: none; }

/* ---------- layout ---------- */
.view { grid-area: view; min-width: 0; outline: none; }
.view:focus, .view:focus-visible { box-shadow: none; }
.page { max-width: 1728px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); animation: rise 0.35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.page h1, .doc h1 { margin: 6px 0 8px; font: 400 34px/1.15 var(--display); letter-spacing: -0.01em; color: var(--text); }
.page .lead { margin: 0 0 20px; color: var(--dim); max-width: 68ch; font-size: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); overflow: hidden; }
.ph { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); font-weight: 500; }
.ph b { font-weight: 500; font-size: 14px; white-space: nowrap; }
.ph .code { font: 400 11px var(--mono); font-style: normal; color: var(--faint); }
.ph .count { color: var(--dim); font: 500 12px var(--ui); padding: 2px 7px; border-radius: 6px; background: var(--muted); }
.ph .sp { flex: 1; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--muted); }
.tabs button { white-space: nowrap; height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--dim); font-weight: 500; font-size: 13px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); background: var(--bg); border-color: var(--line2); }
.utabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.utabs button { position: relative; height: 44px; border: 0; background: none; color: var(--dim); font-weight: 500; white-space: nowrap; }
.utabs button:hover { color: var(--text); }
.utabs button.on { color: var(--text); }
.utabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
.empty { padding: 34px 16px; text-align: center; color: var(--dim); }
.skel { background: linear-gradient(90deg, #1a1a1a, #242424, #1a1a1a); background-size: 200% 100%; animation: sh 1.4s linear infinite; border-radius: 6px; }
@keyframes sh { to { background-position: -200% 0; } }
.av { flex: none; width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--muted); border: 1px solid var(--line2); display: grid; place-items: center; font: 600 12px var(--ui); color: var(--dim); overflow: hidden; }
.av.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 9.5px; }
.av.lg { width: 56px; height: 56px; border-radius: 12px; font-size: 18px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font: 500 12px/1.5 var(--ui); background: var(--muted); }
.score { font: 500 11.5px/1 var(--ui); padding: 4px 7px; border-radius: 6px; }
.score.strong { color: var(--up); background: var(--up-bg); }
.score.fair { color: var(--warn); background: rgba(245, 181, 68, 0.12); }
.score.weak { color: var(--down); background: var(--down-bg); }
.bar { height: 4px; border-radius: 4px; background: var(--muted); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar.done i { background: var(--up); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; padding: 12px 12px; background: var(--panel-s); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.row { cursor: pointer; }
table.t tr.row:hover td { background: var(--hover); }
table.t .r, table.t th.r { text-align: right; }
.tw { overflow-x: auto; }
.tok { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tok b { font-weight: 500; } .tok span { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { from { background: rgba(117, 61, 246, 0.16); } }
.tick-up { animation: tu 0.9s ease-out; } .tick-down { animation: td 0.9s ease-out; }
@keyframes tu { from { color: var(--up); } }
@keyframes td { from { color: var(--down); } }
.ico { width: 16px; height: 16px; flex: none; }
.socials { display: inline-flex; gap: 2px; }
.socials a { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--dim); }
.socials a:hover { color: var(--text); background: var(--muted); }
.socials svg { width: 12px; height: 12px; }

/* ---------- board banner ---------- */
.hero { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 16px 16px 0; padding: 28px 28px 28px 28px; border-radius: var(--r2); overflow: hidden; color: #18181b;
  background: linear-gradient(100deg, #9fb7ad 0%, #b9cbc3 38%, #d6e2dc 70%, #e4ece8 100%); }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(24, 24, 27, 0.28) 1px, transparent 1.4px); background-size: 16px 16px; -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000 80%); mask-image: linear-gradient(90deg, transparent 40%, #000 80%); }
.hero .txt { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.hero .badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.55); font: 500 13px var(--ui); color: #18181b; }
.hero .badge i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.hero h2 { margin: 4px 0 0; font: 400 clamp(24px, 2.4vw, 32px)/1.15 var(--display); letter-spacing: -0.01em; color: #09090b; }
.hero p { margin: 0; font-size: 15px; line-height: 1.55; color: #27272a; max-width: 62ch; }
.hero .cta { display: flex; gap: 8px; flex: none; }
.hero .btn.brand { height: 38px; padding: 0 16px; }
.hero .btn.ghost { color: #18181b; background: rgba(255, 255, 255, 0.5); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.75); }

/* ---------- board ---------- */
.tape { position: relative; display: flex; overflow: hidden; height: 40px; border-bottom: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tape-wrap { position: relative; }
.tape .run { display: flex; align-items: center; gap: 28px; padding-right: 28px; white-space: nowrap; animation: tape 70s linear infinite; }
.tape:hover .run { animation-play-state: paused; }
.tape a { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.tape a b { font-weight: 500; }
.tape a .mono { font-size: 12px; }
.tape .rank { color: var(--faint); font: 400 11px var(--mono); }
@keyframes tape { to { transform: translateX(-100%); } }
.kstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 8px 16px 0; }
.kstrip > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); }
.kstrip small { display: block; color: var(--dim); font-size: 13px; margin-bottom: 4px; }
.kstrip b { font: 500 22px/1.2 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--text); }
.kstrip b em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--dim); margin-left: 6px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 16px 16px; height: calc(100vh - 56px - 30px - 40px - 170px - 100px); min-height: 560px; }
.col { display: flex; flex-direction: column; min-height: 0; }
.col .ph .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: twinkle 1.6s ease-in-out infinite; }
.col .list { flex: 1; overflow-y: auto; }
.card { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.15s; }
.card:hover, .card:focus-visible { background: var(--hover); outline: 0; box-shadow: none; border-radius: 0; }
.search .results .card { border-bottom: 0; }
.ring { position: relative; grid-row: span 3; width: 52px; height: 52px; }
.ring svg { position: absolute; inset: 0; overflow: visible; width: 52px; height: 52px; }
.ring .av { position: absolute; inset: 7px; width: 38px; height: 38px; border-radius: 50%; }
.ring circle { fill: none; }
.ring .tk { display: none; }
.ring .bg { stroke: var(--muted); stroke-width: 2.5; }
.ring .fg { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.ring .xh { display: none; }
.ring.done .fg { stroke: var(--up); }
.card .l1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.card .l1 b { font-weight: 500; font-size: 14px; }
.card .l1 .nm { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.card .rt { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card .rt .mc { font-size: 14px; font-weight: 500; color: var(--text); }
.card .rt small { color: var(--dim); font: 400 11px var(--ui); margin-right: 4px; }
.spark { width: 80px; height: 22px; overflow: visible; }
.spark path { fill: none; stroke-width: 1.4; }
.card .l2 { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 0; flex-wrap: wrap; }
.card .l2 .age { color: var(--text); }
.card .l3 { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 11.5px; flex-wrap: wrap; margin-top: 4px; }
.card .stat { display: inline-flex; align-items: center; gap: 3px; }
.card .stat svg { width: 12px; height: 12px; }
.card .chipx { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--muted); color: var(--dim); font-variant-numeric: tabular-nums; }
.card .chipx.bad { background: var(--down-bg); color: var(--down); }
.card .sp { flex: 1; }
.quick { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--text); color: #171717; font: 500 11.5px var(--ui); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.15s; }
.card:hover .quick, .card:focus-within .quick { opacity: 1; }

/* ---------- token page ---------- */
.tp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 8px; padding: 16px; }
.tp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.tp-head h1 { margin: 0; font: 400 28px/1.1 var(--display); display: flex; align-items: center; gap: 12px; }
.tp-head .sub { display: flex; align-items: center; gap: 10px; color: var(--dim); flex-wrap: wrap; font-size: 13px; margin-top: 6px; }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--dim); font: 400 12px var(--mono); }
.copy:hover { color: var(--text); background: var(--muted); }
.copy svg { width: 12px; height: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.kpis div { padding: 12px 16px; background: var(--panel); }
.kpis small { display: block; color: var(--dim); font-size: 12.5px; margin-bottom: 2px; }
.kpis b { font: 500 15px var(--ui); font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; height: 440px; }
.chart-tools { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chart-tools .sp { flex: 1; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--muted); }
.seg button { height: 24px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--dim); font: 500 12px var(--ui); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg); color: var(--text); border-color: var(--line2); }
.trade-box { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bs, .ls { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 10px; background: var(--muted); }
.bs button, .ls button { height: 34px; border: 0; border-radius: 7px; background: none; color: var(--dim); font-weight: 500; }
.bs button:hover, .ls button:hover { color: var(--text); }
.bs button.on.buy, .ls button.on.long { background: var(--up); color: #022c22; }
.bs button.on.sell, .ls button.on.short { background: var(--down); color: #fff; }
.field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); transition: border-color 0.15s, box-shadow 0.15s; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 16px var(--ui); font-variant-numeric: tabular-nums; }
.field:focus-within { border-color: var(--line3); box-shadow: 0 0 0 3px rgba(117, 61, 246, 0.25); }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.presets button { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--dim); font: 500 12.5px var(--ui); font-variant-numeric: tabular-nums; }
.presets button:hover { color: var(--text); background: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 8px; margin: 0; font-size: 13px; }
.rows div { display: flex; justify-content: space-between; gap: 10px; }
.rows dt { color: var(--dim); } .rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.big-btn { height: 44px; font-size: 14.5px; }
.note { font-size: 12.5px; color: var(--dim); margin: 0; }
.flag { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; }
.flag i { width: 7px; height: 7px; border-radius: 2px; margin-top: 7px; flex: none; background: var(--up); }
.flag.bad i { background: var(--down); } .flag.mid i { background: var(--warn); }
.side-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* ---------- live ---------- */
.feed { max-height: calc(100vh - 260px); overflow-y: auto; }
.trow { display: grid; grid-template-columns: 64px 54px minmax(0, 1.4fr) 1fr 1fr 1fr 120px; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; }
.trow:hover { background: var(--hover); }
.trow .r { text-align: right; }
.side { font: 500 12px var(--ui); }
.side.buy { color: var(--up); } .side.sell { color: var(--down); }
.whale { background: linear-gradient(90deg, rgba(117, 61, 246, 0.12), transparent 60%); }

/* ---------- perps ---------- */
.px { display: grid; grid-template-columns: minmax(0, 1fr) 300px 340px; grid-template-rows: auto minmax(440px, 1fr) auto; gap: 1px; background: var(--line); min-height: calc(100vh - 86px); border-top: 1px solid var(--line); }
.px > * { background: var(--bg); min-width: 0; }
.px-bar { grid-column: 1 / 3; display: flex; align-items: center; gap: 26px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; }
.px-bar .mk { display: flex; align-items: center; gap: 9px; font: 500 17px var(--ui); border: 1px solid var(--line); background: var(--bg2); padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.px-bar .mk:hover { background: var(--muted); }
.px-bar .st small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; }
.px-bar .st b { font: 500 14px var(--ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-chart { display: flex; flex-direction: column; }
.px-chart .chart-wrap { flex: 1; height: auto; min-height: 400px; }
.px-book { display: flex; flex-direction: column; min-height: 0; }
.book { flex: 1; display: flex; flex-direction: column; font: 400 12px var(--mono); min-height: 0; }
.book .hd, .book .ln { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px 12px; }
.book .hd { color: var(--dim); font-family: var(--ui); font-size: 12px; padding: 8px 12px; }
.book .ln { position: relative; height: 21px; align-items: center; }
.book .ln span { position: relative; }
.book .ln span:nth-of-type(n+2), .book .hd span:nth-of-type(n+2) { text-align: right; }
.book .ln i { position: absolute; top: 2px; bottom: 2px; right: 0; opacity: 0.14; border-radius: 3px 0 0 3px; }
.book .asks .ln span:nth-of-type(1) { color: var(--down); } .book .asks i { background: var(--down); }
.book .bids .ln span:nth-of-type(1) { color: var(--up); } .book .bids i { background: var(--up); }
.book .mid { display: flex; justify-content: space-between; padding: 7px 12px; border-block: 1px solid var(--line); color: var(--dim); font-size: 12px; background: var(--bg2); }
.book .asks { display: flex; flex-direction: column-reverse; }
.px-trade { grid-row: 1 / 4; grid-column: 3; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; }
.px-acct { grid-column: 1 / 3; min-height: 220px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.acct-grid div small { display: block; color: var(--dim); font-size: 12px; }
.acct-grid div b { font: 500 13.5px var(--ui); font-variant-numeric: tabular-nums; }
.lev { display: flex; align-items: center; gap: 10px; }
.lev input[type=range] { flex: 1; accent-color: var(--accent); }
.mk-list { position: absolute; z-index: 50; top: 60px; left: 12px; width: min(580px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--pop); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65); animation: pop 0.15s var(--ease); overflow: hidden; }
.mk-list .field { margin: 10px; height: 40px; }
.mk-list .tw { flex: 1; overflow: auto; }

/* ---------- ask ---------- */
.ask { max-width: 820px; margin: 0 auto; padding: 28px 18px 40px; display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 86px); }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 14px; line-height: 1.65; white-space: pre-wrap; animation: rise 0.3s var(--ease); }
.msg.me { align-self: flex-end; background: var(--muted); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--bg2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai .who { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--accent2); font-weight: 500; font-size: 12.5px; }
.composer { position: sticky; bottom: 12px; display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line2); border-radius: 14px; background: var(--side); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55); }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; border: 0; outline: 0; background: none; padding: 11px; }
.composer textarea::placeholder { color: var(--dim); }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- docs / generic ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 36px 18px 64px; animation: rise 0.35s var(--ease); }
.doc h1 { font-size: 44px; margin-bottom: 14px; }
.doc h2 { margin: 34px 0 8px; font: 500 18px var(--ui); }
.doc p, .doc li { color: var(--dim); line-height: 1.75; font-size: 14.5px; }
.doc code { font-family: var(--mono); background: var(--muted); padding: 1px 6px; border-radius: 5px; color: var(--text); font-size: 12.5px; }
.road { display: grid; gap: 8px; margin-top: 18px; }
.road .panel { padding: 16px 18px; }
.road h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.settings .panel { padding: 18px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings label:last-child { border-bottom: 0; }
.settings input[type=text], .settings input[type=number] { width: 130px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); font-family: var(--mono); }
.page .field input, .ph .field input { font-size: 13.5px; }

.toast { position: fixed; right: 16px; bottom: 44px; z-index: 90; transform: translateY(16px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 10px; background: var(--text); color: #171717; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 13px; font-weight: 500; transition: 0.25s var(--ease); }
.toast.on { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .px { grid-template-columns: minmax(0, 1fr) 300px; }
  .px-trade { grid-row: auto; grid-column: 1 / 3; }
  .tp { grid-template-columns: minmax(0, 1fr) 320px; }
  .kstrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kstrip > div:nth-child(n+4) { display: none; }
  .readout.clk { display: none; }
}
/* icon-only sidebar on laptops / tablets */
@media (max-width: 1100px) {
  :root { --side-w: 60px; }
  .rail { padding: 8px 6px; align-items: center; overflow: visible; }
  .rail .brand { padding: 0; justify-content: center; }
  .rail .brand span, .rail a.nv .lb, .rail a.nv .ct, .rail .foot, .rail .who { display: none; }
  .rail a.nv { width: 40px; justify-content: center; padding: 0; }
  .rail a.nv .tip { display: block; position: absolute; left: 50px; top: 50%; transform: translateY(-50%); padding: 5px 9px; border-radius: 8px; background: var(--text); color: #171717; font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 5; }
  .rail a.nv:hover .tip { opacity: 1; }
  .top .m-only { display: inline-flex; }
  .hero { flex-direction: column; align-items: flex-start; }
  .board { grid-template-columns: minmax(0, 1fr); height: auto; }
  .col .list { max-height: 72vh; }
}
@media (max-width: 980px) {
  .board { grid-template-columns: minmax(0, 1fr); height: auto; }
  .col .list { max-height: 72vh; }
  .tp { grid-template-columns: minmax(0, 1fr); }
  .search { width: 34px; padding: 0; justify-content: center; }
  .search input, .search kbd { display: none; }
  .search.open { position: fixed; left: 10px; right: 10px; top: 10px; width: auto; padding: 0 12px; border-color: var(--line3); background: var(--pop); z-index: 70; }
  .search.open input { display: block; }
  .top .eth, .readout { display: none; }
}
@media (max-width: 760px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 54px minmax(0, 1fr) auto; grid-template-areas: 'top' 'view' 'status'; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .top { height: 54px; padding-left: 14px; }
  .crumb .sl { display: none; }
  .crumb .mlogo { display: grid; }
  .crumb .mlogo img { display: block; }
  .dock { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-around; height: 60px; padding: 0 4px; border: 1px solid var(--line); border-radius: var(--r2); background: rgba(23, 23, 23, 0.92); backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
  .dock a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); font-size: 10.5px; font-weight: 500; border-radius: 10px; margin: 6px 2px; }
  .dock a svg { width: 19px; height: 19px; }
  .dock a.on { color: var(--text); background: var(--muted); }
  .status { display: none; }
  .hero { margin: 10px 10px 0; padding: 20px; }
  .hero p { font-size: 14px; }
  .kstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 10px 0; }
  .kstrip > div:nth-child(n+3) { display: none; }
  .kstrip b { font-size: 18px; }
  .board { padding: 8px 10px 10px; }
  .px { grid-template-columns: minmax(0, 1fr); }
  .px-bar, .px-trade, .px-acct { grid-column: 1; }
  .px-book { min-height: 420px; }
  .trow { grid-template-columns: 50px 42px minmax(0, 1fr) 1fr 90px; }
  .trow .hm { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .chart-wrap { height: 320px; }
  .acct-grid { grid-template-columns: 1fr 1fr; }
  .card .spark { display: none; }
  .quick { opacity: 1; }
  .page h1 { font-size: 28px; }
  .toast { left: 10px; right: 10px; bottom: 84px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
