:root {
  --bg: #0f1012; --surface: #1a1a19; --surface2: #232322; --line: #32322f;
  --text: #f0efec; --text2: #c3c2b7; --muted: #8f8e86;
  --accent: #f7931a; --blue: #3987e5; --good: #2fb37f; --bad: #e66767;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
h2 { font-size: 18px; margin: 0 0 4px; }
.sub { color: var(--text2); margin: 0 0 14px; max-width: 95ch; font-size: 14px; }
b { font-weight: 600; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #111; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; color: var(--text2); }
.chip b { color: var(--text); font-size: 16px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px 0; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.tabs button { flex: none; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--text2); padding: 9px 13px 10px; font: inherit; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .hero-tab { color: var(--accent); font-weight: 600; margin-left: auto; }

main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; }
.tab { display: none; }
.tab.on { display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 16px; }
.note { color: var(--text2); font-size: 14px; }

.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; color: var(--text2); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--text2); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--surface2); color: var(--text); font-weight: 600; }
input, select { background: var(--surface2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; }
input[type=range] { padding: 0; vertical-align: middle; width: 220px; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text2); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; margin-left: auto; }

.chart { width: 100%; height: 380px; }
.chart.tall { height: 560px; }
.scroll { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.plain td { border-bottom: 1px solid #262624; }
.plain tr.base td { color: var(--text2); background: var(--surface2); }
.plain tr.active td:first-child { font-weight: 600; }
.heat td { border: 2px solid var(--surface); border-radius: 6px; }
.heat td.c { cursor: default; min-width: 74px; }
.heat td.click { cursor: pointer; }
.heat td.click:hover { outline: 2px solid var(--text); }
.heat small, .plain small { color: var(--muted); font-size: 11.5px; }
.pos { color: var(--good); } .neg { color: var(--bad); } .mut { color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface2); border-radius: 10px; padding: 10px 14px; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; }
.kpi b { font-size: 21px; font-variant-numeric: tabular-nums; }
.kpi span { display: block; color: var(--text2); font-size: 12.5px; }

.verdict { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: center; border-color: #5a4320; }
.gauge { height: 300px; }
.verdict h1 { font-size: 30px; margin: 0 0 8px; line-height: 1.2; }
.verdict p { color: var(--text2); margin: 0 0 10px; max-width: 80ch; }
.verdict .big { font-size: 17px; color: var(--text); }
.sig { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #262624; font-size: 14px; }
.sig:last-child { border: 0; }
.sig small { color: var(--muted); display: block; }

footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 28px; }

@media (max-width: 800px) {
  .grid2, .verdict { grid-template-columns: 1fr; }
  .chart.tall { height: 460px; }
  .tabs .hero-tab { margin-left: 0; }
  .legend { margin-left: 0; }
}
