:root {
    --ink: #0b1f29;
    --navy: #102f3d;
    --teal: #0a4f6c;
    --blue: #4d92af;
    --blue-light: #e9f2f6;
    --slate: #40545e;
    --muted: #667982;
    --line: #d9e3e8;
    --surface: #f7f9fa;
    --white: #ffffff;
    --orange: #f58f24;
    --sidebar-width: 300px;
    --header-height: 76px;
    --font:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--white);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.guide-header {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid rgba(217, 227, 232, 0.88);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
}

.guide-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: var(--ink);
    text-decoration: none;
}

.guide-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.guide-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.guide-brand strong {
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.guide-brand small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.guide-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background: var(--blue-light);
    cursor: pointer;
}

.guide-menu-button span:not(.sr-only) {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    background: var(--teal);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.guide-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    padding-top: var(--header-height);
}

.guide-sidebar {
    position: relative;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, #f3f8fa 0%, var(--surface) 100%);
}

.guide-sidebar-inner {
    position: sticky;
    top: var(--header-height);
    display: flex;
    min-height: calc(100vh - var(--header-height));
    flex-direction: column;
    padding: 36px 24px 24px;
}

.guide-sidebar-label {
    margin: 0 0 16px 12px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-sidebar nav {
    display: grid;
    gap: 4px;
}

.guide-nav-link {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--slate);
    font-size: 0.88rem;
    font-weight: 590;
    line-height: 1.25;
    text-decoration: none;
}

.guide-nav-link span {
    color: var(--blue);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.06em;
}

.guide-nav-link:hover {
    background: rgba(77, 146, 175, 0.1);
    color: var(--teal);
}

.guide-nav-link[aria-current="page"] {
    background: var(--teal);
    color: var(--white);
}

.guide-nav-link[aria-current="page"] span {
    color: rgba(255, 255, 255, 0.7);
}

.guide-version {
    margin: auto 12px 0;
    padding-top: 30px;
    color: var(--muted);
    font-size: 0.72rem;
}

.guide-main {
    min-width: 0;
}

.guide-main article {
    width: min(100% - 64px, 940px);
    margin: 0 auto;
}

.guide-hero {
    padding: 82px 0 58px;
    border-bottom: 1px solid var(--line);
}

.guide-eyebrow {
    display: flex;
    gap: 11px;
    align-items: center;
    margin: 0 0 18px;
    color: var(--teal);
    font-size: 0.76rem;
    font-weight: 760;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-eyebrow::before {
    width: 28px;
    height: 1px;
    background: var(--orange);
    content: "";
}

.guide-hero h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.7rem, 7vw, 5.2rem);
    font-weight: 650;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.guide-hero > p:last-child {
    max-width: 720px;
    margin: 28px 0 0;
    color: var(--slate);
    font-size: 1.16rem;
    line-height: 1.7;
}

.guide-content {
    padding: 54px 0 40px;
}

.guide-content h2,
.guide-content h3,
.guide-content h4 {
    color: var(--ink);
    line-height: 1.15;
    scroll-margin-top: calc(var(--header-height) + 28px);
}

.guide-content h2 {
    margin: 64px 0 20px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 650;
    letter-spacing: -0.035em;
}

.guide-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.guide-content h3 {
    margin: 44px 0 16px;
    font-size: 1.45rem;
    font-weight: 670;
    letter-spacing: -0.02em;
}

.guide-content h4 {
    margin: 32px 0 12px;
    color: var(--teal);
    font-size: 1rem;
    font-weight: 740;
    letter-spacing: 0.02em;
}

.guide-content p {
    max-width: 800px;
    margin: 0 0 18px;
    color: var(--slate);
}

.guide-content strong {
    color: var(--ink);
}

.guide-content ul,
.guide-content ol {
    max-width: 800px;
    margin: 0 0 24px;
    padding-left: 24px;
    color: var(--slate);
}

.guide-content li {
    margin: 8px 0;
    padding-left: 5px;
}

.guide-content li::marker {
    color: var(--blue);
    font-weight: 750;
}

.guide-content pre {
    max-width: 800px;
    overflow-x: auto;
    margin: 28px 0;
    padding: 24px;
    border-left: 4px solid var(--blue);
    border-radius: 0 14px 14px 0;
    background: var(--navy);
    color: #edf8fc;
    font-size: 0.9rem;
    line-height: 1.7;
}

.guide-content code {
    border-radius: 5px;
    background: var(--blue-light);
    color: var(--teal);
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 0.9em;
}

.guide-content pre code {
    background: transparent;
    color: inherit;
}

.guide-content hr {
    margin: 52px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.guide-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 40px 0 80px;
    border-top: 1px solid var(--line);
}

.pager-link {
    display: flex;
    min-height: 104px;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    text-decoration: none;
    transition:
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.pager-link:hover {
    border-color: var(--blue);
    box-shadow: 0 18px 42px rgba(11, 31, 41, 0.08);
    transform: translateY(-2px);
}

.pager-link span {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.pager-link strong {
    color: var(--teal);
}

.pager-next {
    text-align: right;
}

.guide-footer {
    display: flex;
    justify-content: space-between;
    padding: 24px 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

.guide-footer p {
    margin: 0;
}

.guide-footer a {
    color: var(--teal);
    font-weight: 650;
    text-decoration: none;
}

@media (max-width: 900px) {
    .guide-header {
        padding: 0 18px;
    }

    .guide-menu-button {
        display: block;
    }

    .guide-layout {
        display: block;
    }

    .guide-sidebar {
        position: fixed;
        z-index: 90;
        top: var(--header-height);
        right: 0;
        bottom: 0;
        left: 0;
        overflow-y: auto;
        border-right: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-12px);
        transition:
            opacity 180ms ease,
            transform 180ms ease;
    }

    .guide-sidebar.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .guide-sidebar-inner {
        position: static;
        min-height: 100%;
        padding: 28px 20px;
    }

    .guide-nav-link {
        padding: 13px 14px;
        font-size: 0.95rem;
    }

    .guide-main article {
        width: min(100% - 36px, 760px);
    }

    .guide-hero {
        padding: 58px 0 42px;
    }

    .guide-hero > p:last-child {
        font-size: 1.02rem;
    }

    body.has-open-guide-menu {
        overflow: hidden;
    }
}

@media (max-width: 600px) {
    .guide-main article {
        width: min(100% - 28px, 760px);
    }

    .guide-content {
        padding-top: 38px;
    }

    .guide-content h2 {
        margin-top: 48px;
        padding-top: 28px;
    }

    .guide-pager {
        grid-template-columns: 1fr;
    }

    .pager-next {
        text-align: left;
    }

    .guide-footer {
        display: grid;
        gap: 8px;
        padding: 22px 18px;
    }
}
