:root{
  --bg:#f6f7f9; --surface:#ffffff; --surface-2:#eef1f5; --text:#1b2330; --muted:#5a6678;
  --border:#dde2ea; --accent:#2457d6; --accent-ink:#ffffff; --accent-soft:#e6edfc;
  --ok:#1f7a4d; --warn:#9a6200; --warn-soft:#fff4df; --err:#b3261e; --err-soft:#fdeceb;
  --code-bg:#0f1624; --code-text:#e6edf7;
  --radius:10px; --shadow:0 1px 2px rgba(16,24,40,.06),0 4px 16px rgba(16,24,40,.05);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0e131b; --surface:#151c27; --surface-2:#1c2533; --text:#e4e9f1; --muted:#9aa6b8;
    --border:#2a3446; --accent:#7ea2ff; --accent-ink:#0e131b; --accent-soft:#1d2a47;
    --ok:#5fcf95; --warn:#f0b75a; --warn-soft:#2d2415; --err:#ff8a80; --err-soft:#321b1a;
    --code-bg:#0a0f17; --shadow:none;
  }
}
:root[data-theme="dark"]{
  --bg:#0e131b; --surface:#151c27; --surface-2:#1c2533; --text:#e4e9f1; --muted:#9aa6b8;
  --border:#2a3446; --accent:#7ea2ff; --accent-ink:#0e131b; --accent-soft:#1d2a47;
  --ok:#5fcf95; --warn:#f0b75a; --warn-soft:#2d2415; --err:#ff8a80; --err-soft:#321b1a;
  --code-bg:#0a0f17; --shadow:none;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.65 "Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif}
a{color:var(--accent)}
img{max-width:100%}
.wrap{max-width:1180px;margin:0 auto;padding:0 16px}
.skip{position:absolute;left:-999px;top:0;background:var(--accent);color:var(--accent-ink);padding:8px 12px;z-index:10}
.skip:focus{left:8px;top:8px}

/* header */
.site-header{background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-weight:700;font-size:1.05rem}
.brand small{font-weight:500;color:var(--muted)}
.logo{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:8px;background:var(--accent);color:var(--accent-ink);font-weight:800;font-size:.9rem;letter-spacing:-.5px}
.topnav{display:flex;gap:4px;flex-wrap:wrap}
.topnav a{text-decoration:none;color:var(--muted);padding:8px 12px;border-radius:8px;font-weight:500;font-size:.95rem}
.topnav a:hover{background:var(--surface-2);color:var(--text)}
.topnav a[aria-current]{background:var(--accent-soft);color:var(--accent)}

/* hero */
.hero{background:linear-gradient(180deg,var(--surface) 0%,var(--bg) 100%);border-bottom:1px solid var(--border);padding:56px 0 44px}
.hero h1{font-size:clamp(1.8rem,4vw,2.7rem);line-height:1.15;margin:0 0 14px;max-width:780px}
.hero p.lead{font-size:1.15rem;color:var(--muted);max-width:720px;margin:0 0 24px}
.btns{display:flex;gap:10px;flex-wrap:wrap}
.btn{display:inline-block;padding:11px 18px;border-radius:8px;text-decoration:none;font-weight:600;border:1px solid var(--accent)}
.btn.primary{background:var(--accent);color:var(--accent-ink)}
.btn.ghost{color:var(--accent);background:transparent}
.btn:hover{filter:brightness(1.08)}
.home-section{padding:44px 0}
.home-section h2{font-size:1.6rem;margin:0 0 8px}
.home-section > .wrap > p.sub{color:var(--muted);margin:0 0 24px;max-width:760px}

/* layout */
.layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:32px;padding-top:28px;padding-bottom:48px}
.sidebar details{position:sticky;top:84px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 16px}
.sidebar summary{font-weight:700;cursor:pointer;list-style:none}
.sidebar summary::-webkit-details-marker{display:none}
.sidebar h3{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:16px 0 6px}
.sidebar ul{list-style:none;margin:0;padding:0}
.sidebar li a{display:block;padding:5px 8px;border-radius:6px;text-decoration:none;color:var(--text);font-size:.92rem;line-height:1.35}
.sidebar li a:hover{background:var(--surface-2)}
.sidebar li a[aria-current]{background:var(--accent-soft);color:var(--accent);font-weight:600}
.content{min-width:0}
.content h1{font-size:clamp(1.6rem,3.2vw,2.2rem);line-height:1.2;margin:8px 0 12px}
.content h2{font-size:1.35rem;margin:36px 0 10px;padding-top:4px}
.content h3{font-size:1.1rem;margin:24px 0 8px}
.content p.lead{font-size:1.1rem;color:var(--muted);margin-top:0}
.crumbs{font-size:.88rem;color:var(--muted)}
.crumbs a{color:var(--muted)}
.crumbs span{margin:0 4px}

/* components */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);display:flex;flex-direction:column}
.card h3{margin:0 0 6px;font-size:1.1rem}
.card p{margin:0 0 12px;color:var(--muted);font-size:.95rem}
.card .meta{font-size:.85rem;color:var(--muted);margin-bottom:12px}
.card .actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap}
.card a.more{font-weight:600;text-decoration:none;margin-top:auto}
.tag{display:inline-block;font-size:.75rem;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);margin:0 4px 4px 0}
.tag.free{background:var(--accent-soft);color:var(--accent)}
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);margin:12px 0 20px}
table{border-collapse:collapse;width:100%;font-size:.93rem}
th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--border);vertical-align:top}
th{background:var(--surface-2);font-weight:600;white-space:nowrap}
tr:last-child td{border-bottom:0}
.yes{color:var(--ok);font-weight:600}
.partial{color:var(--warn);font-weight:600}
.no{color:var(--err);font-weight:600}
.note,.warn,.tip{border-radius:var(--radius);padding:14px 16px;margin:16px 0;border:1px solid var(--border);background:var(--surface)}
.note{border-left:4px solid var(--accent)}
.tip{border-left:4px solid var(--ok)}
.warn{border-left:4px solid var(--warn);background:var(--warn-soft)}
.note strong:first-child,.tip strong:first-child,.warn strong:first-child{display:block;margin-bottom:2px}
ol.steps{counter-reset:s;list-style:none;padding:0;margin:12px 0}
ol.steps > li{counter-increment:s;position:relative;padding:0 0 16px 46px}
ol.steps > li::before{content:counter(s);position:absolute;left:0;top:0;width:30px;height:30px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-weight:700;font-size:.9rem}
ol.steps > li strong{display:block}
code{font-family:Consolas,"Cascadia Code",monospace;font-size:.9em;background:var(--surface-2);padding:1px 5px;border-radius:4px}
pre{background:var(--code-bg);color:var(--code-text);padding:14px 16px;border-radius:var(--radius);overflow-x:auto;font-size:.88rem;line-height:1.5}
pre code{background:none;padding:0;color:inherit}
kbd{font-family:inherit;font-size:.85em;border:1px solid var(--border);border-bottom-width:2px;border-radius:4px;padding:0 5px;background:var(--surface)}
.faq details{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 16px;margin:8px 0}
.faq summary{font-weight:600;cursor:pointer}
.err-block{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px;margin:14px 0}
.err-block h3{margin:0 0 6px}
.err-block .msg{display:inline-block;font-family:Consolas,monospace;font-size:.88rem;background:var(--err-soft);color:var(--err);padding:2px 8px;border-radius:4px;margin-bottom:8px}
.toc{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 18px;margin:16px 0}
.toc strong{display:block;margin-bottom:4px}
.toc ul{margin:0;padding-left:18px}
.next{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:40px;padding-top:20px;border-top:1px solid var(--border)}
.next a{text-decoration:none;font-weight:600}

/* footer */
.site-footer{background:var(--surface);border-top:1px solid var(--border);padding:36px 0 20px;font-size:.92rem}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:24px}
.site-footer p{color:var(--muted);margin:6px 0 0}
.site-footer ul{list-style:none;padding:0;margin:6px 0 0}
.site-footer li{margin:3px 0}
.site-footer a{color:var(--muted);text-decoration:none}
.site-footer a:hover{color:var(--accent)}
.legal{color:var(--muted);font-size:.82rem;margin-top:24px;padding-top:16px;border-top:1px solid var(--border)}

@media (max-width:900px){
  .layout{grid-template-columns:1fr;gap:16px}
  .sidebar details{position:static}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  .header-inner{padding:8px 0}
  .topnav{width:100%;overflow-x:auto;flex-wrap:nowrap}
  .topnav a{white-space:nowrap;padding:6px 10px}
  .footer-grid{grid-template-columns:1fr}
  .hero{padding:36px 0 28px}
}
