:root {
    --bg: #f4f1ec;
    --bg-elevated: #ffffff;
    --bg-muted: #ebe6df;
    --text: #1a1f2e;
    --text-muted: #5c6478;
    --brand: #2e5a31;
    --brand-light: #e8f0e9;
    --accent: #e79124;
    --accent-light: #fdf0dc;
    --info-light: #e0f2fe;
    --info-border: #0284c7;
    --border: rgba(26, 31, 46, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 30px rgba(26, 31, 46, 0.08);
    --font: "Plus Jakarta Sans", system-ui, sans-serif;
    --layout-max: 1280px;
    --sidebar-ratio: 33%;
    --sidebar-max-width: 340px;
}

* {
    box-sizing: border-box;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "clig" 0, "calt" 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
}

.legal-page .site-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legal-page .site-footer a {
    color: var(--brand);
    font-weight: 600;
}

.legal-page .site-footer-sep {
    margin: 0 0.45rem;
    color: var(--text-muted);
}

.legal-page code {
    font-size: 0.9em;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: var(--bg-muted);
}

.legal-page ul {
    margin: 0.75rem 0 0;
    padding-left: 1.35rem;
}

.legal-page li {
    margin-bottom: 0.45rem;
}

.manual-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
}

.manual-sidebar {
    flex: 0 0 min(var(--sidebar-ratio), var(--sidebar-max-width));
    width: min(var(--sidebar-ratio), var(--sidebar-max-width));
    max-width: var(--sidebar-ratio);
    position: sticky;
    top: 1.25rem;
    align-self: flex-start;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.manual-main {
    flex: 1 1 0;
    min-width: 0;
}

.hero {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.hero h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hero .lead {
    margin: 0;
    color: var(--text);
    font-size: 1.125rem;
    line-height: 1.65;
}

.hero-meta {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toc {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}

.toc h2,
.toc-heading {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.manual-sidebar-tools {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.manual-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.manual-back-btn:hover {
    background: var(--brand-light);
    border-color: rgba(46, 90, 49, 0.2);
    text-decoration: none;
}

.toc-collapse-btn {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.toc-collapse-btn:hover {
    background: var(--bg-elevated);
}

.toc-collapse-btn-icon {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.manual-sidebar:not(.is-toc-collapsed) .toc-collapse-btn-icon {
    transform: rotate(180deg);
}

.toc-grid {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toc a {
    display: block;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.toc a:hover {
    background: var(--bg-muted);
    text-decoration: none;
}

.toc a.is-active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 700;
}

.section-block {
    margin-bottom: 3.5rem;
    scroll-margin-top: 1.5rem;
}

.section-head {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--brand-light);
}

.section-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-head .section-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.prose p {
    margin: 0 0 1.1rem;
}

.prose h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.prose h3:first-child {
    margin-top: 0;
}

.prose h4 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.prose ul,
.prose ol {
    margin: 0 0 1.1rem;
    padding-left: 1.35rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose li > ul,
.prose li > ol {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

.prose strong {
    font-weight: 700;
}

.note,
.tip {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    margin: 1.35rem 0;
    font-size: 0.98rem;
    line-height: 1.65;
}

.note {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
}

.note-title,
.tip-title {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.tip {
    background: var(--info-light);
    border-left: 4px solid var(--info-border);
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 1.25rem 0 1.5rem;
}

.manual-table th,
.manual-table td {
    border: 1px solid var(--border);
    padding: 0.65rem 0.85rem;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.manual-table th {
    background: var(--brand-light);
    font-weight: 700;
}

.manual-table caption {
    caption-side: bottom;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
}

.faq-item {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.faq-item p {
    margin: 0;
    color: var(--text-muted);
}

.site-footer {
    margin-top: 4rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 899px) {
    .manual-layout {
        flex-direction: column;
        gap: 1.25rem;
        padding-top: 0;
    }

    .manual-sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        width: 100%;
        max-width: none;
        flex: none;
        max-height: none;
        overflow: visible;
        padding-top: 0.5rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.25rem;
    }

    .manual-sidebar-tools {
        position: sticky;
        top: 0;
        z-index: 2;
        margin-bottom: 0;
        padding: 0.5rem 0 0.65rem;
        background: var(--bg);
    }

    .toc-collapse-btn {
        display: inline-flex;
    }

    .manual-sidebar.is-toc-collapsed .toc {
        display: none;
    }

    .manual-sidebar:not(.is-toc-collapsed) .toc {
        margin-top: 0.65rem;
        max-height: min(50vh, 420px);
        overflow-y: auto;
    }

    .manual-sidebar:not(.is-toc-collapsed) .toc-heading {
        display: none;
    }

    .section-block {
        scroll-margin-top: 5.5rem;
    }
}

@media (min-width: 900px) {
    .manual-sidebar-tools {
        margin-bottom: 0.85rem;
    }

    .manual-sidebar .toc-heading {
        display: block;
    }

    .manual-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .manual-sidebar::-webkit-scrollbar-thumb {
        background: rgba(26, 31, 46, 0.15);
        border-radius: 999px;
    }
}
