:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface-2: #efede6; --text: #1c1b18; --muted: #6b675d;
  --border: #e2dfd5; --gold: #a87b12; --gold-soft: #f3e7c6; --pos: #1d7a46; --neg: #b3261e;
  --neutral: #6b675d; --warn: #9a6400; --chart-2: #3d6fb6; --chart-3: #8a8577;
  --radius: 16px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0c; --surface: #191916; --surface-2: #23221e; --text: #f1efe8; --muted: #a29d90;
    --border: #2e2d28; --gold: #e2b34a; --gold-soft: #3a2f14; --pos: #4cc27e; --neg: #ff6b5f;
    --neutral: #a29d90; --warn: #f0b44c; --chart-2: #7aa7ec; --chart-3: #77736a;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + var(--safe-b)); -webkit-font-smoothing: antialiased;
}
header {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #f5d27a, #a87b12);
  display: grid; place-items: center; font-weight: 800; color: #3a2a00; font-size: 13px; }
header h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
header .upd { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
section.tab { display: none; } section.tab.active { display: block; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin: 0 0 10px; font-weight: 600; }
.card h3 { font-size: 16px; margin: 0 0 4px; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-size: 38px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chg { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.fresh { color: var(--pos); } .badge.delayed, .badge.cached { color: var(--warn); }
.badge.stale, .badge.missing { color: var(--neg); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.stance { border-left: 4px solid var(--gold); }
.stance .label { font-size: 21px; font-weight: 750; line-height: 1.25; margin-bottom: 8px; letter-spacing: -.01em; }
.stance.notrade { border-left-color: var(--neutral); }
.stance.long { border-left-color: var(--pos); } .stance.short { border-left-color: var(--neg); }
ul.reasons { margin: 0; padding-left: 18px; } ul.reasons li { margin: 4px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.points { display: grid; gap: 10px; }
.point { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--neutral); }
.dot.positive { background: var(--pos); } .dot.negative { background: var(--neg); }
.point b { display: block; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kv .k { font-size: 12px; color: var(--muted); } .kv .v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: 190px; display: block; touch-action: pan-y; }
.chart.tall { height: 230px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px;
  padding: 6px; border-radius: 8px; font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.factor { padding: 12px 0; border-top: 1px solid var(--border); } .factor:first-of-type { border-top: 0; padding-top: 0; }
.factor .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; margin: 8px 0 4px; }
.bar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .5; }
.hyp { padding: 12px 0; border-top: 1px solid var(--border); } .hyp:first-of-type { border-top: 0; padding-top: 0; }
.verdict { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.verdict.validated { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.verdict.weak { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.verdict.rejected { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.stats div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.stats .k { font-size: 10.5px; color: var(--muted); } .stats .v { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
details { margin-top: 8px; } summary { cursor: pointer; color: var(--gold); font-size: 13px; font-weight: 600; }
.event { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); align-items: center; }
.event:first-of-type { border-top: 0; }
.event .t { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; }
.imp { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.imp.High { background: var(--neg); } .imp.Medium { background: var(--warn); } .imp.Low { background: var(--neutral); }
.day-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 2px; }
.day-h:first-child { margin-top: 0; }
.hrow { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.hrow:first-of-type { border-top: 0; }
.banner { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--text); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.banner.err { background: color-mix(in srgb, var(--neg) 12%, var(--surface)); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 6px 4px calc(6px + var(--safe-b)); }
nav button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-size: 10.5px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-weight: 600; }
nav button svg { width: 24px; height: 24px; }
nav button.active { color: var(--gold); }
table.season { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.season td, table.season th { padding: 5px 4px; text-align: right; border-top: 1px solid var(--border); }
table.season th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.season td:first-child, table.season th:first-child { text-align: left; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; }
.skeleton { color: var(--muted); padding: 40px 0; text-align: center; }
p { margin: 6px 0; }
a { color: var(--gold); }
