:root {
  --bg: #0f1216; --panel: #171b21; --line: #262c35; --text: #e6e9ee; --muted: #8b95a3;
  --up: #22b07d; --down: #e5534b; --warn: #d9a33a; --accent: #4c8dff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 650; font-size: 16px; }
.muted { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.status { display: flex; gap: 10px; align-items: center; }
nav { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 11px 12px; cursor: pointer; font: inherit; }
nav button.active { color: var(--text); border-bottom-color: var(--accent); }
main { padding: 18px 20px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
footer { padding: 16px 20px 24px; text-align: center; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; font: inherit; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button:disabled { opacity: .5; cursor: default; }
.pill { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line); }
.pill.up { background: rgba(34,176,125,.15); color: var(--up); }
.pill.down { background: rgba(229,83,75,.15); color: var(--down); }
.pill.warn { background: rgba(217,163,58,.15); color: var(--warn); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px 14px; }
.kv div span { display: block; color: var(--muted); font-size: 11.5px; }
.kv div b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.advice { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: rgba(76,141,255,.07); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
th:first-child, td:first-child, td.l, th.l { text-align: left; }
tr.dim td { opacity: .5; }
.scroll { overflow-x: auto; }
.up { color: var(--up); } .down { color: var(--down); }
.why { color: var(--muted); font-size: 12px; white-space: normal; text-align: left; max-width: 340px; }
.empty { color: var(--muted); padding: 14px 0; }
.verdict { font-weight: 600; padding: 8px 10px; border-radius: 6px; margin: 10px 0; }
.verdict.good { background: rgba(34,176,125,.12); color: var(--up); }
.verdict.bad { background: rgba(229,83,75,.12); color: var(--down); }
.verdict.meh { background: rgba(217,163,58,.12); color: var(--warn); }
svg.curve { width: 100%; height: 120px; display: block; }
form.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
form.settings label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; }
ol.rules li { margin-bottom: 6px; }
.err { color: var(--down); }

a.sym { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: pointer; }
a.sym:hover { color: var(--accent); border-color: var(--accent); }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 10; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; width: min(1000px, 100%); max-height: 95vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
svg.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; }
.banner.now { background: rgba(217,163,58,.12); border-color: var(--warn); }
.banner.soon { background: rgba(76,141,255,.08); border-color: var(--accent); }
select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; margin-right: 8px; }
.report ul { margin: 6px 0 14px; padding-left: 20px; } .report li { margin-bottom: 5px; }
.report h4 { margin: 12px 0 2px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.guide { border-width: 2px; }
.guide.down { border-color: var(--down); } .guide.up { border-color: var(--up); } .guide.warn { border-color: var(--warn); } .guide.now { border-color: var(--warn); background: rgba(217,163,58,.08); }
.guide .big { font-size: 17px; font-weight: 600; margin: 4px 0 12px; line-height: 1.4; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.steps div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.steps b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; } .steps span { font-weight: 600; }
.learn-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .learn-grid { grid-template-columns: 1fr; } }
.lesson-list ol { list-style: none; padding: 0; margin: 8px 0; }
.lesson-list li { padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.lesson-list li:hover { background: var(--line); } .lesson-list li.cur { background: rgba(76,141,255,.15); }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--up); }
.lesson-body { font-size: 15px; line-height: 1.6; } .lesson-body table { margin: 8px 0; } .lesson-body td, .lesson-body th { white-space: normal; }
.quiz { margin-top: 16px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.quiz button { margin: 8px 8px 0 0; text-align: left; }
.lesson-nav { display: flex; justify-content: space-between; margin-top: 16px; }

textarea { width: 100%; min-height: 140px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 12.5px/1.4 ui-monospace, Consolas, monospace; }
.luck { margin-top: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.luck ul { margin: 6px 0; padding-left: 18px; } .luck li { margin-bottom: 3px; }
.yearbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; } .yearbar span { padding: 3px 8px; border-radius: 6px; font-size: 12px; background: var(--line); }
.yearbar span.up { background: rgba(34,176,125,.15); } .yearbar span.down { background: rgba(229,83,75,.15); }
.habit { padding: 8px 10px; border-left: 3px solid var(--line); margin: 8px 0; background: var(--bg); border-radius: 4px; }
.habit.bad { border-color: var(--down); } .habit.meh { border-color: var(--warn); } .habit.good { border-color: var(--up); }
details.lab > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
