:root{
  --bg:#0f1526; --panel:#172039; --code:#0a0f1d; --line:#2a3556;
  --text:#e9edf7; --muted:#a8b2cc; --amber:#ffc83d; --ok:#4cd6a0; --warn:#ff9d5c;
  --bar:3.5rem; --side:17rem;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--bar) + .8rem)}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.65 var(--font)}
body.locked{overflow:hidden}
a{color:var(--amber)}
:focus-visible{outline:2px solid var(--amber);outline-offset:2px}

/* top bar (phone) */
.topbar{position:sticky;top:0;z-index:20;height:var(--bar);display:flex;align-items:center;justify-content:space-between;
  padding:0 1rem;background:rgba(15,21,38,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(6px)}
.brand{display:flex;align-items:center;gap:.6rem;color:var(--amber);font-weight:800;font-size:1.05rem;text-decoration:none;letter-spacing:-.01em}
.brand img{border-radius:7px}
.menu-btn{display:flex;align-items:center;gap:.45rem;background:var(--panel);color:var(--text);border:1px solid var(--line);
  border-radius:10px;padding:.45rem .85rem;font:inherit;font-weight:600;cursor:pointer}

/* menu: slide-in on phone, fixed sidebar on wide screens */
.scrim{position:fixed;inset:0;z-index:30;background:rgba(5,8,16,.65)}
.drawer{position:fixed;z-index:40;top:0;right:0;bottom:0;width:min(21rem,86vw);overflow-y:auto;background:var(--bg);
  border-left:1px solid var(--line);transform:translateX(102%);transition:transform .22s ease;visibility:hidden;padding:0 0 2rem}
.drawer.open{transform:none;visibility:visible}
.drawer-head{display:flex;align-items:center;justify-content:space-between;height:var(--bar);padding:0 1rem;border-bottom:1px solid var(--line)}
.close-btn{background:none;border:1px solid var(--line);color:var(--text);width:2.4rem;height:2.4rem;border-radius:10px;font-size:1.6rem;line-height:1;cursor:pointer}
.drawer ul{list-style:none;margin:0;padding:.7rem .7rem 0}
.drawer a{display:flex;align-items:center;gap:.8rem;padding:.75rem .8rem;border-radius:10px;color:var(--text);text-decoration:none;font-weight:500}
.drawer a b{flex:none;width:1.7rem;height:1.7rem;display:grid;place-items:center;border-radius:50%;background:var(--panel);color:var(--amber);font-size:.85rem}
.drawer a em{margin-left:auto;font-style:normal;font-size:.8rem;color:var(--muted)}
.drawer a.on{background:var(--panel);box-shadow:inset 3px 0 0 var(--amber);font-weight:700}
.drawer a.on b{background:var(--amber);color:#1a1400}

main,footer{max-width:46rem;margin:0 auto;padding:0 1.1rem}
.hero{padding:1.8rem 0 .2rem}
.hero h1{margin:0;font-size:2rem;line-height:1.15;letter-spacing:-.03em;font-weight:800}
.hero p{margin:.5rem 0 0;color:var(--muted)}

main section{padding:2rem 0 .6rem;border-bottom:1px solid var(--line)}
main section:last-child{border-bottom:0}
h2{margin:0 0 .7rem;font-size:1.5rem;line-height:1.25;letter-spacing:-.01em}
h3{margin:1.6rem 0 .4rem;font-size:1.05rem;color:var(--amber)}
p,ul{margin:.6rem 0}
li{margin:.3rem 0}
code{font-family:var(--mono);font-size:.88em;background:var(--code);border:1px solid var(--line);border-radius:5px;padding:.05em .4em}

.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.6rem;margin:1.1rem 0}
.facts div{background:var(--panel);border-left:3px solid var(--amber);padding:.6rem .8rem;border-radius:0 8px 8px 0}
.facts dt{font-size:.8rem;color:var(--muted)}
.facts dd{margin:0;font-weight:600}

.note{border-radius:8px;padding:.8rem 1rem;background:var(--panel);border:1px solid var(--line)}
.note.warn{border-color:var(--warn)}
.note b{color:var(--warn)}

.tbl{overflow-x:auto;margin:.8rem 0;border:1px solid var(--line);border-radius:8px}
table{border-collapse:collapse;width:100%;min-width:20rem;font-size:.93rem}
th,td{text-align:left;padding:.55rem .8rem;border-bottom:1px solid var(--line);vertical-align:top}
th{background:var(--panel);color:var(--muted);font-weight:600}
tr:last-child td{border-bottom:0}

.code{position:relative;margin:.8rem 0}
.code pre{margin:0}
pre{margin:.8rem 0;background:var(--code);border:1px solid var(--line);border-radius:8px;padding:.9rem 5rem .9rem 1rem;overflow-x:auto}
pre code{background:none;border:0;padding:0;font-size:.85rem;line-height:1.6;white-space:pre}
.copy{position:absolute;top:.5rem;right:.5rem;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:.25rem .65rem;font:inherit;font-size:.8rem;cursor:pointer}
.copy.done{background:var(--ok);border-color:var(--ok);color:#06251a}

.progress{margin:1rem 0 .4rem;font-weight:600}
.bar{height:8px;background:var(--panel);border-radius:99px;overflow:hidden;border:1px solid var(--line)}
.bar i{display:block;height:100%;width:0;background:var(--ok);transition:width .25s}
.checks{list-style:none;padding:0;margin:1rem 0}
.checks li{margin:.4rem 0}
.checks label{display:flex;gap:.75rem;align-items:flex-start;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:.7rem .9rem;cursor:pointer}
.checks input{width:1.15rem;height:1.15rem;margin-top:.2rem;accent-color:var(--ok);flex:none}
.checks label:has(input:checked){color:var(--muted);text-decoration:line-through;border-color:var(--ok)}
.ghost{background:none;color:var(--muted);border:1px solid var(--line);border-radius:8px;padding:.5rem 1rem;font:inherit;cursor:pointer;margin-bottom:1rem}

footer{padding-top:2rem;padding-bottom:4.5rem;color:var(--muted);font-size:.85rem}
.totop{position:fixed;right:1rem;bottom:1rem;z-index:15;width:2.8rem;height:2.8rem;border-radius:50%;border:0;background:var(--amber);color:#1a1400;font-size:1.3rem;font-weight:800;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.45)}

@media (min-width:1000px){
  .topbar,.scrim,.close-btn,.totop.never{display:none}
  .drawer{width:var(--side);right:auto;left:0;transform:none;visibility:visible;border-left:0;border-right:1px solid var(--line);transition:none}
  main,footer{margin-left:calc(var(--side) + 2.5rem);margin-right:auto;max-width:48rem}
  html{scroll-padding-top:1.2rem}
  .hero{padding-top:2.6rem}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}.bar i,.drawer{transition:none}}
