/* Manual static site — self-contained CSS, no Tailwind dependency.
   Earth-tone palette mirrors the app's "olive" theme so the manual feels
   like the same product. */

:root {
    --bg: #F6F2EA;
    --surface: #FFFFFF;
    --surface-alt: #F0EBDF;
    --primary: #5C6B3D;
    --primary-soft: #E4E8D5;
    --accent: #B5562F;
    --ink: #2A2620;
    --ink-soft: #6B6357;
    --ink-muted: #A39A8B;
    --line: #E5DFD2;
    --danger: #B5453A;
    --warn: #C99641;
    --mono: ui-monospace, "JetBrains Mono", Menlo, monospace;
    --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
}

.manual-header {
    background: var(--primary);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
}
.manual-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.manual-header .subtitle {
    margin: 0.25rem 0 0;
    opacity: 0.85;
    font-size: 0.95rem;
}
.manual-header .generated-at {
    margin: 0.5rem 0 0;
    opacity: 0.7;
    font-family: var(--mono);
    font-size: 0.75rem;
}

.manual-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    gap: 2rem;
}

.manual-toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
}
.manual-toc h2 {
    margin: 0 0 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    font-weight: 700;
}
.manual-toc h3 {
    margin: 1rem 0 0.25rem;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.manual-toc h3:first-of-type { margin-top: 0; }
.manual-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}
.manual-toc li {
    margin: 0.25rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid transparent;
}
.manual-toc li:hover { border-left-color: var(--primary-soft); }
.manual-toc a {
    color: var(--ink-soft);
    text-decoration: none;
    display: block;
    padding: 0.15rem 0;
}
.manual-toc a:hover { color: var(--primary); }

.manual-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2rem 2.5rem;
}

.chapter { margin-bottom: 4rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.chapter:last-child { border-bottom: 0; }
.chapter-group {
    margin: 0 0 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
}

.chapter h1 {
    margin: 0 0 1.25rem;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.chapter h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.chapter h3 {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
}
.chapter h4 { margin: 1.25rem 0 0.25rem; font-size: 0.95rem; font-weight: 600; }

.chapter p { margin: 0 0 1rem; }
.chapter ul, .chapter ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.chapter li { margin: 0.25rem 0; }

.chapter a { color: var(--primary); }
.chapter a:hover { color: var(--accent); }

.chapter code {
    background: var(--surface-alt);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--ink);
}
.chapter pre {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
}
.chapter pre code { background: none; padding: 0; }

.chapter blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    color: var(--ink-soft);
}

.chapter table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.chapter th, .chapter td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
}
.chapter th {
    background: var(--surface-alt);
    font-weight: 600;
    color: var(--ink);
}

.chapter img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.missing-screenshot {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(201, 150, 65, 0.1);
    border: 1px dashed var(--warn);
    border-radius: 6px;
    color: var(--warn);
    font-size: 0.85rem;
}
.missing-screenshot code {
    background: rgba(201, 150, 65, 0.15);
    color: var(--warn);
}

.permalink {
    opacity: 0;
    margin-left: 0.4rem;
    text-decoration: none;
    color: var(--ink-muted);
    font-weight: 400;
}
.group:hover .permalink { opacity: 1; }

.manual-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .manual-layout { grid-template-columns: 1fr; }
    .manual-toc { position: static; max-height: none; }
    .manual-content { padding: 1.5rem; }
    .chapter h1 { font-size: 1.5rem; }
    .chapter h2 { font-size: 1.1rem; }
}
