/* Reference-doc pages (Documentation, Manual) — readable light theme with
   a sticky sidebar TOC. Separate from report.css/admin.css's dark
   control-room styling since these are read, not operated. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7f7f5;
    color: #1c1e26;
    line-height: 1.6;
}

.docs-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1240px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.docs-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 20px;
    border-right: 1px solid #e3e2dc;
    background: #fbfbf9;
}

.docs-brand {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    color: #12141c;
    margin-bottom: 4px;
}

.docs-brand span {
    color: #2fa65a;
}

.docs-subbrand {
    font-size: 0.72rem;
    color: #8a8a80;
    margin-bottom: 22px;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.docs-nav-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.docs-nav-switch a {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
    border-radius: 6px;
    border: 1px solid #e3e2dc;
    font-size: 0.76rem;
    font-family: 'IBM Plex Mono', monospace;
    text-decoration: none;
    color: #55564f;
}

.docs-nav-switch a.active {
    background: #12141c;
    color: #fff;
    border-color: #12141c;
}

.docs-toc {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-toc li {
    margin-bottom: 2px;
}

.docs-toc a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.83rem;
    color: #55564f;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.docs-toc a:hover {
    background: #f0efe9;
    color: #12141c;
}

.docs-toc .toc-sub {
    padding-left: 22px;
    font-size: 0.78rem;
}

/* ---------- Content ---------- */

.docs-content {
    padding: 40px 56px 100px;
    max-width: 860px;
}

.docs-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #12141c;
}

.docs-lede {
    font-size: 1rem;
    color: #55564f;
    margin: 0 0 40px;
    max-width: 640px;
}

.docs-section {
    margin-bottom: 48px;
    scroll-margin-top: 24px;
}

.docs-section h2 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid #12141c;
    color: #12141c;
}

.docs-section h3 {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 26px 0 10px;
    color: #12141c;
}

.docs-section p {
    margin: 0 0 14px;
    color: #33342e;
}

.docs-section ul,
.docs-section ol {
    margin: 0 0 14px;
    padding-left: 22px;
    color: #33342e;
}

.docs-section li {
    margin-bottom: 6px;
}

.docs-section li > strong {
    color: #12141c;
}

.docs-section code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    background: #eeede6;
    padding: 1px 6px;
    border-radius: 4px;
    color: #1c1e26;
}

.docs-callout {
    background: #fbf6e6;
    border-left: 3px solid #e3a23d;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 0 0 16px;
    font-size: 0.88rem;
    color: #4a4326;
}

.docs-callout strong {
    color: #12141c;
}

/* Tech-stack chips */

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stack-card {
    border: 1px solid #e3e2dc;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
}

.stack-card .stack-name {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.88rem;
    color: #12141c;
    display: block;
    margin-bottom: 3px;
}

.stack-card .stack-role {
    font-size: 0.78rem;
    color: #7a7a70;
}

/* File-tree block */

.file-tree {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    background: #12141c;
    color: #dcdbe8;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
    line-height: 1.65;
    margin-bottom: 16px;
}

.file-tree .dir {
    color: #6fbfe0;
}

.file-tree .comment {
    color: #7a7d94;
}

/* Flow diagram (ascii-in-a-box) */

.flow-box {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #e3e2dc;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
    white-space: pre;
    color: #1c1e26;
    margin-bottom: 16px;
}

/* Simple data table for schema/routes */

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.docs-table th {
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a7a70;
    padding: 0 10px 8px;
    border-bottom: 2px solid #12141c;
}

.docs-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e3e2dc;
    vertical-align: top;
}

.docs-table code {
    white-space: nowrap;
}

/* Manual-specific: step cards */

.step-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.step-list li {
    counter-increment: step;
    position: relative;
    padding: 4px 0 4px 40px;
    margin-bottom: 12px;
    color: #33342e;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #12141c;
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-badge {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.role-badge.attendant {
    background: #e6f4ea;
    color: #1e7a41;
}

.role-badge.admin {
    background: #fdeeee;
    color: #b3261e;
}

@media (max-width: 860px) {
    .docs-shell {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e3e2dc;
    }

    .docs-content {
        padding: 28px 20px 80px;
    }
}
