/* ================================================================
   Telescope Arena — an observatory for €500 strategies
   ================================================================ */

:root {
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, ui-serif, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-sm: 8px; --r: 14px; --r-lg: 22px;
  --pad: clamp(16px, 3.2vw, 36px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 0px;
}

/* ---------- dark (default) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #07090d;
  --surface: #0e1117;
  --surface-2: #131722;
  --surface-3: #1a1f2c;
  --line: rgba(255,255,255,.075);
  --line-2: rgba(255,255,255,.13);
  --ink: #eceae4;
  --ink-2: #a3a6ae;
  --ink-3: #6d717b;
  --grid: #222734;
  --axis: #3a4050;
  --gold: #e8c27a;
  --gold-2: #f6e3b8;
  --gold-ink: #1a1408;
  --up: #53c556;
  --down: #eb6263;
  --warn: #fbb315;
  --f-trend: #338ced;
  --f-premium_selling: #e76624;
  --f-breakout: #00a888;
  --f-long_premium: #9887ef;
  --f-benchmark: #c9c6bd;
  --aurora-a: rgba(51,140,237,.16);
  --aurora-b: rgba(152,135,239,.13);
  --aurora-c: rgba(232,194,122,.08);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -24px rgba(0,0,0,.7);
  --glass: rgba(10,12,18,.72);
}

/* ---------- light ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f5f2ea;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --surface-3: #efebe1;
  --line: rgba(30,24,10,.09);
  --line-2: rgba(30,24,10,.16);
  --ink: #1b1a17;
  --ink-2: #5d5a52;
  --ink-3: #8f8b81;
  --grid: #ebe6da;
  --axis: #c9c3b4;
  --gold: #9a6b14;
  --gold-2: #b07e22;
  --gold-ink: #fffaf0;
  --up: #006c10;
  --down: #c22f30;
  --warn: #a86a00;
  --f-trend: #257de0;
  --f-premium_selling: #f47230;
  --f-breakout: #00b894;
  --f-long_premium: #6a4ce2;
  --f-benchmark: #57534a;
  --aurora-a: rgba(37,125,224,.10);
  --aurora-b: rgba(106,76,226,.07);
  --aurora-c: rgba(176,126,34,.10);
  --shadow: 0 1px 2px rgba(30,24,10,.04), 0 18px 40px -26px rgba(30,24,10,.25);
  --glass: rgba(250,247,240,.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--page); color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.up { color: var(--up); } .down { color: var(--down); }
[hidden] { display: none !important; }

/* ---------- the sky ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora {
  position: absolute; inset: -20% -10% auto -10%; height: 85vh;
  background:
    radial-gradient(40% 55% at 18% 18%, var(--aurora-a), transparent 70%),
    radial-gradient(35% 45% at 78% 6%, var(--aurora-b), transparent 70%),
    radial-gradient(30% 40% at 55% 32%, var(--aurora-c), transparent 70%);
  filter: blur(10px);
  animation: drift 38s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(2.5%, 1.5%, 0) scale(1.04); } }
.grain {
  position: absolute; inset: 0; opacity: .55; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] .sky::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 72% 12%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.2px 1.2px at 42% 8%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 88% 34%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 26% 46%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 62% 28%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1.3px 1.3px at 5% 6%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 95% 9%, rgba(255,255,255,.4), transparent 60%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 60%);
}
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } * { transition: none !important; } }

/* ---------- shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in {
  max-width: var(--maxw); margin: 0 auto; padding: 12px var(--pad);
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand svg { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line-2); }
.brand b { font: 600 19px/1 var(--serif); letter-spacing: .01em; display: block; }
.brand small { display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 3px; }
.nav { display: flex; gap: 2px; margin-left: 14px; }
.nav a {
  position: relative; padding: 8px 13px; border-radius: 999px; color: var(--ink-2);
  font-size: 14px; font-weight: 500; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--ink); background: var(--surface-3); }
.nav .badge, .tabbar .badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink);
  font-size: 11px; font-weight: 700;
}
.spacer { flex: 1; }
.status {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; position: relative; }
.dot.open { background: var(--up); }
.dot.open::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--up); opacity: 0; animation: ping 2.4s var(--ease) infinite;
}
.dot.flash { animation: flash .9s var(--ease); }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 40%, transparent); } }
.status .sep { width: 1px; height: 12px; background: var(--line-2); }
.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2);
  transition: color .2s, border-color .2s, transform .2s;
}
.iconbtn:hover { color: var(--ink); border-color: var(--line-2); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 17px; height: 17px; }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) var(--pad) calc(60px + var(--nav-h)); }
.view { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.loading-veil { opacity: .55; transition: opacity .3s; }

/* bottom tab bar (mobile) */
.tabbar { display: none; }

/* ---------- typography ---------- */
.kicker { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.04; }
h1 em, h2 em { font-style: italic; color: var(--gold-2); }
:root[data-theme="light"] h1 em, :root[data-theme="light"] h2 em { color: var(--gold); }
h2 { font-size: clamp(21px, 2.3vw, 27px); line-height: 1.15; }
h3 { font-size: 17px; }
.lede { color: var(--ink-2); max-width: 62ch; font-size: 15.5px; margin: 12px 0 0; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: clamp(16px, 2.2vw, 24px); min-width: 0;
}
.card-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-h .sub { color: var(--ink-3); font-size: 13px; }
.card-h .right { margin-left: auto; }
.section { margin-top: clamp(20px, 3vw, 30px); }
.grid { display: grid; gap: clamp(12px, 1.6vw, 18px); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }

/* hero */
.hero { padding: clamp(6px, 1.5vw, 14px) 0 clamp(14px, 2vw, 22px); }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--ink-2);
}
.pill b { color: var(--ink); font-weight: 600; }
.bignum { font: 400 clamp(40px, 5.6vw, 68px)/1 var(--serif); letter-spacing: -.02em; }
.bignum small { font-size: .42em; color: var(--ink-3); letter-spacing: 0; }
.stat-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.delta { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px;
  background: var(--line); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); margin-top: 18px; }
.tile { background: var(--surface); padding: 13px 15px; min-width: 0; }
.tile .v { font: 500 20px/1.2 var(--serif); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles.six { grid-template-columns: repeat(6, minmax(0,1fr)); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); transition: all .2s;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* legend chips */
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; user-select: none; transition: opacity .2s, border-color .2s;
}
.chip:hover { border-color: var(--line-2); }
.chip.off { opacity: .4; }
.chip .k { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.chip .k.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; }
.fam { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.fam i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .25s, stroke-width .25s; }
.chart.dim .series:not(.hot) { opacity: .16; }
.chart .series.hot { stroke-width: 2.8; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .epoch line { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.chart .epoch text { fill: var(--gold); font: 600 10.5px var(--sans); }
.chart .endlabel { font: 600 11px var(--sans); fill: var(--ink-2); }
.chart .area { opacity: .14; }
.empty {
  display: grid; place-items: center; text-align: center; padding: 38px 16px; color: var(--ink-3);
  border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 14px;
}
.empty b { display: block; font: 500 18px var(--serif); color: var(--ink-2); margin-bottom: 4px; }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 170px; max-width: 290px;
  background: color-mix(in srgb, var(--surface-3) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.55); font-size: 12.5px;
}
.tooltip .tt-h { color: var(--ink-3); font-size: 11.5px; margin-bottom: 6px; }
.tooltip .tt-r { display: flex; align-items: center; gap: 8px; padding: 1.5px 0; }
.tooltip .tt-r .k { width: 10px; height: 2.5px; border-radius: 2px; flex: none; }
.tooltip .tt-r .n { color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tooltip .tt-r .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip .tt-r.hot .n { color: var(--ink); }
.tooltip .tt-more { color: var(--ink-3); font-size: 11.5px; margin-top: 4px; }

/* ---------- leaderboard ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * clamp(16px, 2.2vw, 24px)); padding: 0 clamp(16px, 2.2vw, 24px); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 10px 10px; white-space: nowrap; cursor: pointer; user-select: none;
}
th.r, td.r { text-align: right; }
th .arr { opacity: .8; margin-left: 3px; }
td { padding: 11px 10px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--surface-2); }
.rank { font: 500 15px var(--serif); color: var(--ink-3); width: 28px; }
.rank.gold { color: var(--gold); }
.botname { font-weight: 600; font-size: 14px; color: var(--ink); }
.botname small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.spark { width: 110px; height: 30px; display: block; }
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--ink-2); letter-spacing: .02em;
}
.tag.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold-2); }
:root[data-theme="light"] .tag.gold { color: var(--gold); }
.tag.bad { background: color-mix(in srgb, var(--down) 18%, transparent); color: var(--down); }
.tag.good { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.lb-cards { display: none; }

/* ---------- side panels ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(60px, 1fr) 62px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-row .track { height: 8px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.bar-row .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.bar-row .track .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.bar-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.luck-viz { position: relative; height: 54px; margin: 8px 0 6px; }
.luck-viz .rail { position: absolute; left: 0; right: 0; top: 24px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.luck-viz .zone { position: absolute; top: 24px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink-3) 55%, transparent); }
.luck-viz .mark { position: absolute; top: 14px; width: 2px; height: 26px; background: var(--gold); border-radius: 1px; }
.luck-viz .mark span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--gold); white-space: nowrap; font-weight: 600; }
.luck-viz .lbl { position: absolute; top: 36px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ---------- bot page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.bot-head { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.bot-head .title { min-width: 0; flex: 1 1 380px; }
.bot-head h1 { font-size: clamp(28px, 4vw, 46px); word-break: break-word; }
.bot-head .doc { color: var(--ink-2); margin-top: 10px; max-width: 70ch; }
.bot-value { text-align: right; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-3); font-weight: 600;
  font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.on { color: var(--ink); border-color: var(--gold); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }

.positions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pos {
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
.pos .sym { font: 500 17px var(--serif); }
.pos .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.pos .side { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pos .side.short { color: var(--f-premium_selling); }
.pos .side.long { color: var(--f-trend); }

.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.param { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface-2); }
.param .top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.param .pn { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.param .pv { font: 500 19px var(--serif); }
.range { position: relative; height: 22px; margin-top: 10px; }
.range .rail { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.range .knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 4px color-mix(in srgb, var(--gold) 40%, transparent); }
.range .ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.param.fixed { opacity: .78; }
.param .lock { font-size: 11px; color: var(--ink-3); margin-top: 8px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--gold); }
.tl-item .when { font-size: 12px; color: var(--ink-3); }
.tl-item .what { margin-top: 2px; }
.diff { font-family: var(--mono); font-size: 12.5px; }
.diff .o { color: var(--ink-3); text-decoration: line-through; }
.diff .n { color: var(--gold-2); font-weight: 600; }
:root[data-theme="light"] .diff .n { color: var(--gold); }

/* feed */
.feed { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 74px 22px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.ev:first-child { border-top: 0; }
.ev .t { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev .ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; background: var(--surface-3); color: var(--ink-2); }
.ev .ic.trade { background: color-mix(in srgb, var(--f-trend) 18%, transparent); color: var(--f-trend); }
.ev .ic.error { background: color-mix(in srgb, var(--down) 18%, transparent); color: var(--down); }
.ev .ic.epoch { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.ev .ic.settle { background: color-mix(in srgb, var(--f-breakout) 18%, transparent); color: var(--f-breakout); }
.ev .ic.reject { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ev .b { min-width: 0; }
.ev .b .who { font-weight: 600; font-size: 13.5px; }
.ev .b .who a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ev .b .msg { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.ev .b .kv { font-family: var(--mono); font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; margin-top: 2px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* proposals */
.prop { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(16px, 2.2vw, 24px); box-shadow: var(--shadow); }
.prop + .prop { margin-top: 14px; }
.prop.awaiting { border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 7%, var(--surface)), var(--surface) 60%); }
.prop-h { display: flex; gap: 16px; align-items: flex-start; }
.prop-h .t { flex: 1; min-width: 0; }
.prop-h h3 { font-size: 20px; }
.prop .summary { color: var(--ink-2); margin: 8px 0 0; }
.ring { width: 58px; height: 58px; flex: none; position: relative; }
.ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px var(--sans); }
.ring span small { display: block; font-size: 9px; color: var(--ink-3); font-weight: 500; line-height: 1; text-align: center; }
.evidence { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.evidence details summary { cursor: pointer; color: var(--ink-3); font-size: 13px; list-style: none; }
.evidence details summary::-webkit-details-marker { display: none; }
.evidence details[open] summary { margin-bottom: 10px; }
.sighting { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-top: 8px; font-size: 13.5px; }
.sighting .n { color: var(--ink-3); font-size: 12px; margin-bottom: 3px; }
.decide { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
textarea, input[type=password] {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 76px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: transform .15s, background .2s, border-color .2s; min-height: 42px;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--down); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* journal markdown */
.md { color: var(--ink); font-size: 15px; line-height: 1.65; }
.md h2 { font-size: 17px; font-family: var(--sans); font-weight: 700; letter-spacing: .02em; margin: 18px 0 6px; color: var(--ink); }
.md h2:first-child { margin-top: 0; }
.md h3 { font-size: 15px; font-family: var(--sans); font-weight: 700; margin: 14px 0 4px; }
.md p { margin: 6px 0; color: var(--ink-2); }
.md ul { margin: 6px 0; padding-left: 20px; color: var(--ink-2); }
.md li { margin: 3px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.md strong { color: var(--ink); }
.night { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: clamp(14px, 3vw, 34px); padding: 26px 0; border-top: 1px solid var(--line); }
.night:first-of-type { border-top: 0; padding-top: 6px; }
.night .date { position: sticky; top: 90px; align-self: start; }
.night .date b { font: 500 26px/1.05 var(--serif); display: block; }
.night .date span { color: var(--ink-3); font-size: 13px; }
pre.log { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); border-radius: 10px; padding: 12px; overflow-x: auto; white-space: pre-wrap; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(420px, 100%); padding: 34px 30px; text-align: center; }
.login .brand { justify-content: center; margin-bottom: 26px; }
.login h1 { font-size: 34px; }
.login p { color: var(--ink-2); margin: 10px 0 24px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .err { color: var(--down); font-size: 13.5px; min-height: 20px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--nav-h) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 70; background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); animation: rise .35s var(--ease);
}

.footer { color: var(--ink-3); font-size: 12.5px; text-align: center; padding: 28px var(--pad) calc(28px + var(--nav-h)); }
.footer a { text-decoration: underline; text-underline-offset: 3px; }

/* ================================================================
   responsive
   ================================================================ */
@media (max-width: 1100px) {
  .tiles.six { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  .nav { display: none; }
  .status .long { display: none; }
  .g-hero, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g3 > :last-child { grid-column: auto; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 10.5px; font-weight: 600; color: var(--ink-3); position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--gold); }
  .tabbar .badge { position: absolute; top: 7px; left: 54%; margin: 0; }
  .night { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .night .date { position: static; }
  .bot-value { text-align: left; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .top-in { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand small { display: none; }
  .brand b { font-size: 17px; }
  .status { padding: 5px 10px; }
  .status .sep, .status .tick { display: none; }
  .tiles.six { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lb-table { display: none; }
  .lb-cards { display: flex; flex-direction: column; }
  .lb-card { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 4px 10px; align-items: center;
    padding: 13px 2px; border-top: 1px solid var(--line); }
  .lb-card:first-child { border-top: 0; }
  .lb-card .rank { grid-row: span 2; }
  .lb-card .botname { overflow: hidden; text-overflow: ellipsis; }
  .lb-card .val { text-align: right; font-weight: 600; }
  .lb-card .sub { display: flex; gap: 10px; font-size: 12px; color: var(--ink-3); align-items: center; min-width: 0; }
  .lb-card .spark { width: 72px; height: 22px; }
  .lb-card .ret { text-align: right; font-size: 13px; font-weight: 600; }
  .ev { grid-template-columns: 22px minmax(0, 1fr); }
  .ev .t { grid-column: 2; grid-row: 1; font-size: 11.5px; }
  .ev .ic { grid-row: 1 / span 2; }
  .ev .b { grid-column: 2; }
  .prop-h { flex-direction: row-reverse; }
  .btns .btn { flex: 1; }
  .card-h .right { margin-left: 0; width: 100%; }
}

/* hero headline: three deliberate lines */
.hero-h span { display: block; }
.hero-h { font-size: clamp(30px, 4.1vw, 54px); }
