:root{
  --bg:#101418; --bg-surface:#171d24; --bg-raised:#1e2630;
  --text-primary:#f2ede4; --text-secondary:#c9c2b2; --text-muted:#a79e8c;
  --ember:#ff8a3d; --ember-strong:#ffb27a; --cold:#7fb3d9;
  --line:#39424e; --line-soft:#2a323d; --focus:#ffb27a;
  --on-ember:#221100; --danger:#ff9d8a;
}
html[data-theme="light"]{
  --bg:#f7f3ea; --bg-surface:#fffdf6; --bg-raised:#ffffff;
  --text-primary:#1d1a14; --text-secondary:#43403a; --text-muted:#5d584d;
  --ember:#b34700; --ember-strong:#933b00; --cold:#17557e;
  --line:#8a8272; --line-soft:#cfc7b4; --focus:#933b00;
  --on-ember:#ffffff; --danger:#9c1c00;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
svg[hidden]{display:none}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important;animation:none!important}}
body{margin:0;background:var(--bg);color:var(--text-primary);font:17px/1.55 -apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;-webkit-font-smoothing:antialiased}
.skip{position:absolute;left:-9999px}.skip:focus{left:1rem;top:1rem;background:var(--bg-raised);padding:.5rem 1rem;z-index:50}
a{color:var(--ember-strong)} a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1rem;padding:.55rem 1rem;background:var(--bg-surface);border-bottom:1px solid var(--line-soft)}
.top a.home{color:var(--text-primary);text-decoration:none;font-weight:700}
.top nav{display:flex;gap:1rem;margin-left:auto;flex-wrap:wrap}
.top nav a{color:var(--text-secondary);text-decoration:none;font-size:.95rem}
.top nav a:hover{color:var(--text-primary)}
@media(max-width:640px){.top nav a[href^="#"]{display:none}}
.iconbtn{background:none;border:1px solid var(--line);border-radius:999px;color:var(--text-primary);min-width:44px;min-height:44px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
main{max-width:72rem;margin:0 auto;padding:1.2rem 1rem 4rem}
.hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:2rem;align-items:start}
@media(max-width:860px){.hero{grid-template-columns:minmax(0,1fr)}}
h1{font-family:Georgia,"Times New Roman",serif;font-size:2.3rem;line-height:1.15;margin:.4rem 0 .8rem;font-weight:700}
@media(max-width:480px){h1{font-size:1.8rem}}
.deck{font-size:1.13rem;color:var(--text-secondary);max-width:38rem}
.answer{background:var(--bg-surface);border:1px solid var(--line);border-radius:6px;padding:1rem 1.2rem;margin:1.2rem 0}
.answer strong{color:var(--ember-strong)}
.riser{background:var(--bg-surface);border:1px solid var(--line);border-radius:6px;padding:1rem;text-align:center}
.riser .knum{font-family:Georgia,serif;font-size:3.4rem;line-height:1;color:var(--ember-strong)}
.riser .kcap{color:var(--text-secondary);font-size:.95rem;margin-top:.4rem}
.riser svg{max-width:220px;width:100%;height:auto}
section{margin-top:3rem}
h2{font-family:Georgia,serif;font-size:1.55rem;margin:0 0 .7rem}
h2 a{color:inherit;text-decoration:none}
.lead{color:var(--text-secondary);max-width:44rem}
.calc{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:1.5rem;align-items:start}
@media(max-width:860px){.calc{grid-template-columns:minmax(0,1fr)}}
.panel{background:var(--bg-surface);border:1px solid var(--line);border-radius:6px;padding:1.1rem 1.2rem}
.field{margin-bottom:1rem}
label{display:block;font-weight:600;margin-bottom:.35rem}
.hint{color:var(--text-muted);font-size:.9rem;margin-top:.3rem}
select,input[type=number]{width:100%;padding:.65rem .7rem;border:1px solid var(--line);border-radius:4px;background:var(--bg-raised);color:var(--text-primary);font-size:1rem;min-height:44px}
input[type=range]{width:100%;min-height:44px;accent-color:var(--ember)}
.rangeval{font-weight:700;color:var(--ember-strong)}
.checkline{display:flex;gap:.6rem;align-items:flex-start}
.checkline input{width:22px;height:22px;margin-top:.15rem;accent-color:var(--ember)}
.err{color:var(--danger);font-weight:600;margin:.5rem 0}
.result .big{font-family:Georgia,serif;font-size:2.6rem;line-height:1.05;color:var(--ember-strong)}
.result .money{font-family:Georgia,serif;font-size:2rem;color:var(--text-primary)}
.formula{font-family:ui-monospace,Menlo,monospace;font-size:.95rem;background:var(--bg);border:1px solid var(--line-soft);border-radius:4px;padding:.7rem .8rem;overflow-wrap:anywhere}
table{border-collapse:collapse;width:100%;margin:1rem 0}
th,td{border:1px solid var(--line);padding:.5rem .6rem;text-align:right}
th:first-child,td:first-child{text-align:left}
thead th{background:var(--bg-raised)}
tr.hl td{background:var(--bg-raised);font-weight:700}
td.hit{color:var(--ember-strong);font-weight:800}
.scrollx{overflow-x:auto}
.btn{display:inline-block;background:var(--ember);color:var(--on-ember);border:0;border-radius:4px;padding:.7rem 1.1rem;font-size:1rem;font-weight:700;cursor:pointer;min-height:44px}
.btn.ghost{background:none;border:1px solid var(--line);color:var(--text-primary)}
.share{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin-top:1rem}
.share .lbl{color:var(--text-muted);font-size:.92rem}
.share a,.share button{width:44px;height:44px;border-radius:999px;border:1px solid var(--line-soft);display:inline-flex;align-items:center;justify-content:center;color:var(--text-primary);background:none;cursor:pointer;text-decoration:none;font-size:.8rem;font-weight:700}
.steps{counter-reset:st;list-style:none;padding:0}
.steps li{counter-increment:st;padding:.7rem 0 .7rem 3rem;position:relative;border-bottom:1px solid var(--line-soft)}
.steps li::before{content:counter(st);position:absolute;left:0;top:.55rem;width:2rem;height:2rem;border-radius:999px;border:2px solid var(--ember);color:var(--ember-strong);display:flex;align-items:center;justify-content:center;font-weight:800}
footer{border-top:1px solid var(--line-soft);margin-top:4rem;padding:1.5rem 1rem;color:var(--text-muted);text-align:center;font-size:.95rem}
footer a{color:var(--text-secondary)}
.mono{font-family:ui-monospace,Menlo,monospace}
