:root {
    color-scheme: light;
    --ink: #172131;
    --ink-soft: #334155;
    --muted: #5b6779;
    --canvas: #f3f5f8;
    --surface: #fff;
    --surface-sunken: #f8fafc;
    --border: #e2e7ee;
    --border-strong: #cbd3dd;
    --sidebar: #111c2a;
    --sidebar-raised: #1b2a3b;
    --sidebar-text: #c9d3df;
    --sidebar-muted: #8fa0b4;
    --accent: #15766a;
    --accent-strong: #0e5a51;
    --accent-soft: #e2f2ef;
    --focus: #15766a;
    --info: #1d4ed8;
    --info-soft: #e8effd;
    --warning-soft: #fff4e0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.65; }
::selection { color: #0a463f; background: #c3e7e0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--accent-strong); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: #083d37; }
img { max-width: 100%; }
code, kbd { font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: .88em; }
kbd { padding: .08rem .36rem; color: var(--muted); background: var(--surface-sunken); border: 1px solid var(--border-strong); border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.skip-link { position: fixed; z-index: 20; top: .75rem; left: .75rem; padding: .6rem .9rem; color: #fff; background: var(--accent-strong); border-radius: var(--radius-sm); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.guide-topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 1.5rem;
    padding: .65rem clamp(1rem, 3vw, 2rem);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.brand { display: flex; min-width: 225px; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.brand span { display: grid; line-height: 1.2; }
.brand strong { font-size: .98rem; letter-spacing: -.025em; }
.brand small { margin-top: .18rem; color: var(--muted); font-size: .75rem; }
.guide-search { display: flex; width: min(440px, 42vw); min-height: 40px; align-items: center; gap: .6rem; margin-inline: auto; padding: 0 .7rem; background: var(--surface-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.guide-search svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.guide-search input { width: 100%; min-width: 0; padding: .45rem 0; color: var(--ink); background: transparent; border: 0; outline: 0; font: inherit; }
.guide-search input::placeholder { color: var(--muted); opacity: 1; }
.guide-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(21 118 106 / 14%); }
.app-link { flex: 0 0 auto; font-size: .875rem; font-weight: 650; }

.guide-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; gap: clamp(1.5rem, 3vw, 3rem); max-width: 1600px; margin: 0 auto; padding: 1.4rem clamp(1rem, 3vw, 2rem) 4rem; }
.guide-sidebar { position: sticky; top: 80px; max-height: calc(100dvh - 96px); overflow: auto; padding: .4rem .8rem 1rem .2rem; scrollbar-color: #536174 transparent; scrollbar-width: thin; }
.desktop-toc { display: grid; gap: .15rem; }
.desktop-toc a, .mobile-toc nav a { display: block; padding: .38rem .62rem; color: var(--ink-soft); border-radius: 5px; font-size: .84rem; line-height: 1.4; text-decoration: none; }
.desktop-toc a:hover, .mobile-toc nav a:hover { color: var(--accent-strong); background: var(--accent-soft); }
.desktop-toc a[aria-current="location"], .mobile-toc nav a[aria-current="location"] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 700; }
.toc-group { margin: 1.1rem 0 .35rem; padding: 0 .65rem; color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .095em; text-transform: uppercase; }
.toc-group:first-child { margin-top: .1rem; }
.mobile-toc { display: none; }
.search-empty { padding: .6rem; color: var(--muted); font-size: .875rem; }

.guide-main { min-width: 0; }
.guide-intro { max-width: 940px; padding: clamp(1.35rem, 4vw, 3rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
h1, h2, h3 { color: var(--ink); line-height: 1.22; text-wrap: balance; }
h1 { max-width: 16ch; margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 760; letter-spacing: -.045em; }
.intro-copy { max-width: 65ch; margin: 1.1rem 0 0; color: var(--ink-soft); font-size: 1.12rem; }
.intro-copy strong { color: var(--accent-strong); }
.intro-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.button-primary, .button-secondary { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: .58rem .95rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: .9rem; font-weight: 680; text-decoration: none; }
.button-primary { color: #fff; background: var(--accent-strong); border-color: var(--accent-strong); }
.button-primary:hover { color: #fff; background: #08473f; }
.button-secondary { color: var(--ink); background: var(--surface); }
.button-secondary:hover { color: var(--accent-strong); background: var(--surface-sunken); }
.guide-note { max-width: 75ch; margin: 1.7rem 0 0; padding: .85rem 1rem; color: #46320a; background: var(--warning-soft); border: 1px solid #f1d6a3; border-radius: var(--radius-md); font-size: .91rem; }

.guide-content { max-width: 940px; }
.guide-section { margin-top: 1.25rem; padding: clamp(1.25rem, 3vw, 2.2rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); scroll-margin-top: 82px; }
.guide-section[hidden] { display: none; }
.guide-section h2 { margin: 0 0 1rem; font-size: clamp(1.55rem, 2vw, 2rem); letter-spacing: -.025em; }
.guide-section h3 { margin: 1.6rem 0 .55rem; font-size: 1.12rem; letter-spacing: -.015em; }
.guide-section p { max-width: 74ch; margin: .75rem 0; color: var(--ink-soft); }
.guide-section ul, .guide-section ol { max-width: 74ch; padding-left: 1.4rem; color: var(--ink-soft); }
.guide-section li { padding-left: .2rem; margin: .38rem 0; }
.guide-section li::marker { color: var(--accent-strong); font-weight: 700; }
.guide-section strong { color: var(--ink); }
.guide-section code { overflow-wrap: anywhere; padding: .08rem .26rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 4px; }
.guide-section figure { margin: 1.45rem 0 .5rem; padding: .65rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-md); }
.guide-section figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 5px; }
.guide-section figcaption { padding: .5rem .3rem .1rem; color: var(--muted); font-size: .82rem; }
.troubleshooting { max-width: 74ch; margin: 0; }
.troubleshooting div { padding: .8rem 0; border-top: 1px solid var(--border); }
.troubleshooting dt { color: var(--ink); font-weight: 720; }
.troubleshooting dd { margin: .25rem 0 0; color: var(--ink-soft); }

.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius-md); scrollbar-color: var(--border-strong) transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.coverage-table { min-width: 900px; font-size: .82rem; }
th, td { padding: .72rem .8rem; vertical-align: top; border-bottom: 1px solid var(--border); }
th { position: sticky; top: 0; color: var(--ink); background: var(--surface-sunken); font-weight: 730; }
td { color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: anywhere; }
.guide-footer { display: flex; max-width: 940px; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; padding: .8rem .2rem; color: var(--muted); font-size: .85rem; }
.guide-footer p { margin: 0; }
.chapter-navigation { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.chapter-navigation a { max-width: 48%; font-size: .875rem; font-weight: 650; text-decoration: none; }
.chapter-navigation a:last-child { margin-left: auto; text-align: right; }
.chapter-navigation span { display: block; color: var(--muted); font-size: .72rem; font-weight: 550; }

@media (max-width: 1020px) {
    .guide-shell { grid-template-columns: 215px minmax(0, 1fr); gap: 1.3rem; padding-inline: 1rem; }
    .brand { min-width: 180px; }
    .guide-search { width: min(380px, 40vw); }
}
@media (max-width: 760px) {
    html { scroll-padding-top: 68px; }
    .guide-topbar { min-height: 58px; gap: .7rem; padding: .55rem .75rem; }
    .brand { min-width: 0; gap: .45rem; }
    .brand img { width: 30px; height: 30px; }
    .brand strong { font-size: .83rem; }
    .brand small { font-size: .69rem; }
    .guide-search { width: auto; min-width: 0; flex: 1 1 auto; gap: .35rem; padding-inline: .5rem; }
    .guide-search input { font-size: .82rem; }
    .guide-search kbd { display: none; }
    .app-link { max-width: 76px; font-size: .75rem; line-height: 1.2; text-align: right; }
    .guide-shell { display: block; padding: .7rem .75rem 2rem; }
    .guide-sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
    .desktop-toc { display: none; }
    .mobile-toc { display: block; margin-bottom: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
    .mobile-toc > summary { padding: .68rem .85rem; color: var(--accent-strong); font-weight: 700; cursor: pointer; }
    .mobile-toc nav { display: grid; max-height: 58vh; overflow-y: auto; padding: 0 .6rem .8rem; }
    .mobile-toc nav .toc-group { margin-top: .8rem; }
    .guide-intro { padding: 1.25rem; border-radius: var(--radius-md); }
    h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
    .intro-copy { font-size: 1rem; }
    .intro-actions { gap: .5rem; }
    .button-primary, .button-secondary { min-height: 40px; padding: .5rem .7rem; font-size: .82rem; }
    .guide-note { font-size: .85rem; }
    .guide-section { margin-top: .75rem; padding: 1.1rem; border-radius: var(--radius-md); scroll-margin-top: 68px; }
    .guide-section h2 { font-size: 1.5rem; }
    .guide-section h3 { font-size: 1.05rem; }
    .guide-section p, .guide-section ul, .guide-section ol { font-size: .93rem; }
    .guide-section figure { margin-inline: -.15rem; padding: .4rem; }
    .guide-section figcaption { font-size: .75rem; }
    .chapter-navigation a { font-size: .8rem; }
    .guide-footer { padding-inline: .2rem; }
}
@media (max-width: 420px) {
    .guide-topbar { gap: .4rem; }
    .brand { flex: 0 0 auto; }
    .brand strong { font-size: .72rem; white-space: nowrap; }
    .brand small { display: none; }
    .guide-search { min-width: 70px; }
    .app-link { max-width: 58px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
    :root { color-scheme: light; }
    body { background: #fff; font-size: 10.5pt; }
    .guide-topbar, .guide-sidebar, .intro-actions, .chapter-navigation, .guide-footer a { display: none !important; }
    .guide-shell { display: block; max-width: none; padding: 0; }
    .guide-main, .guide-content, .guide-intro { max-width: none; }
    .guide-intro, .guide-section { margin: 0 0 1rem; padding: 0; border: 0; break-inside: avoid; }
    .guide-section figure img { max-height: 5in; object-fit: contain; }
    a { color: inherit; }
}
