/* ── Manual / Docs styles ── extends ../styles.css ── */

:root {
    --m-primary: #3f51b5;
    --m-primary-dark: #3949a3;
    --m-primary-tint: #e8eaf6;
    --m-text: #202124;
    --m-text-muted: #5f6368;
    --m-text-subtle: #80868b;
    --m-border: #e8eaed;
    --m-bg-soft: #f8f9fa;
    --m-success: #1e8e3e;
    --m-warning: #f29900;
    --m-danger: #d93025;
}

/* Page wrapper sits below the fixed navbar */
.manual-wrap {
    padding-top: 64px;
    background: var(--m-bg-soft);
    min-height: 100vh;
}

/* ── Manual hero (used on hub) ── */
.manual-hero {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: #fff;
    padding: 64px 0 56px;
    text-align: center;
}
.manual-hero .eyebrow {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255,255,255,0.16);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.manual-hero h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.manual-hero p {
    font-size: 17px;
    opacity: 0.9;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Search box (hub) ── */
.manual-search {
    max-width: 520px;
    margin: 28px auto 0;
    position: relative;
}
.manual-search input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border-radius: 100px;
    border: none;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--m-text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.manual-search input:focus { outline: 2px solid #fff; outline-offset: 2px; }
.manual-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--m-text-subtle);
}

/* ── Section grid (hub) ── */
.manual-sections {
    padding: 56px 0 80px;
}
.manual-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--m-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}
.manual-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--m-text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.manual-section-desc {
    font-size: 14px;
    color: var(--m-text-muted);
    margin-bottom: 28px;
}
.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}
.topic-card {
    background: #fff;
    border: 1px solid var(--m-border);
    border-radius: 16px;
    padding: 24px;
    display: block;
    transition: all 0.2s ease;
    color: inherit;
}
.topic-card:hover {
    border-color: var(--m-primary);
    box-shadow: 0 4px 24px rgba(63,81,181,0.10);
    transform: translateY(-2px);
}
.topic-card .topic-icon {
    width: 40px;
    height: 40px;
    background: var(--m-primary-tint);
    color: var(--m-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.topic-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--m-text);
    margin-bottom: 6px;
}
.topic-card p {
    font-size: 13.5px;
    color: var(--m-text-muted);
    line-height: 1.55;
    margin: 0;
}

/* ── Docs layout (topic pages) ── */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}
.docs-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 8px;
}
.docs-sidebar h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--m-text-subtle);
    margin: 16px 0 10px;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}
.docs-sidebar li { margin: 0; }
.docs-sidebar a {
    display: block;
    padding: 7px 12px;
    font-size: 13.5px;
    color: var(--m-text-muted);
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}
.docs-sidebar a:hover {
    background: var(--m-primary-tint);
    color: var(--m-primary);
}
.docs-sidebar a.active {
    color: var(--m-primary);
    background: var(--m-primary-tint);
    border-left-color: var(--m-primary);
    font-weight: 600;
}

/* ── Article content ── */
.docs-article {
    background: #fff;
    border: 1px solid var(--m-border);
    border-radius: 16px;
    padding: 40px 48px;
    min-width: 0;
}
.breadcrumb {
    font-size: 13px;
    color: var(--m-text-subtle);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--m-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--m-text-subtle); }

.docs-article h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--m-text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.docs-article .lede {
    font-size: 16px;
    color: var(--m-text-muted);
    line-height: 1.7;
    margin-bottom: 28px;
}
.docs-article h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--m-text);
    margin: 40px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--m-border);
    letter-spacing: -0.01em;
    scroll-margin-top: 88px;
}
.docs-article h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.docs-article h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--m-text);
    margin: 24px 0 10px;
    scroll-margin-top: 88px;
}
.docs-article p {
    font-size: 15px;
    color: var(--m-text);
    line-height: 1.75;
    margin-bottom: 14px;
}
.docs-article ul, .docs-article ol {
    margin: 0 0 16px 24px;
    padding: 0;
}
.docs-article li {
    font-size: 15px;
    color: var(--m-text);
    line-height: 1.7;
    margin-bottom: 6px;
}
.docs-article ol.steps {
    counter-reset: step;
    list-style: none;
    margin-left: 0;
}
.docs-article ol.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 18px 44px;
    margin-bottom: 0;
}
.docs-article ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--m-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(63,81,181,0.3);
}
.docs-article ol.steps > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 32px;
    bottom: 4px;
    width: 2px;
    background: var(--m-border);
}

.docs-article strong { color: var(--m-text); font-weight: 600; }
.docs-article code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    padding: 2px 6px;
    background: var(--m-bg-soft);
    border: 1px solid var(--m-border);
    border-radius: 4px;
    color: var(--m-text);
}

/* In-text path / menu trail (e.g., Settings → Currency) */
.path {
    display: inline-block;
    padding: 2px 8px;
    background: var(--m-primary-tint);
    color: var(--m-primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Callouts */
.callout {
    border-radius: 10px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 14px;
    line-height: 1.65;
    border-left: 4px solid var(--m-primary);
    background: var(--m-primary-tint);
    color: var(--m-text);
}
.callout strong { color: inherit; }
.callout.tip { border-color: var(--m-success); background: #e6f4ea; }
.callout.warn { border-color: var(--m-warning); background: #fef7e0; }
.callout.danger { border-color: var(--m-danger); background: #fce8e6; }
.callout-title {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Page TOC at top of article (mobile-friendly) */
.toc-card {
    background: var(--m-bg-soft);
    border: 1px solid var(--m-border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.toc-card h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--m-text-subtle);
    margin-bottom: 10px;
}
.toc-card ol {
    list-style: decimal;
    margin: 0 0 0 20px;
    padding: 0;
    columns: 2;
    column-gap: 32px;
}
.toc-card li {
    font-size: 13.5px;
    margin-bottom: 4px;
    line-height: 1.5;
    break-inside: avoid;
}
.toc-card a { color: var(--m-text); }
.toc-card a:hover { color: var(--m-primary); text-decoration: underline; }

/* Tables */
.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 20px;
    font-size: 14px;
}
.docs-article th, .docs-article td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--m-border);
    vertical-align: top;
}
.docs-article th {
    background: var(--m-bg-soft);
    font-weight: 600;
    font-size: 13px;
    color: var(--m-text);
}

/* Screenshots / figures */
.docs-article figure.screenshot {
    margin: 22px 0 26px;
}
.docs-article figure.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--m-border);
    border-radius: 12px;
    background: var(--m-bg-soft);
    box-shadow: 0 4px 20px rgba(32, 33, 36, 0.06);
}
.docs-article figure.screenshot figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--m-text-muted);
    line-height: 1.55;
    text-align: center;
    font-style: italic;
}

/* Page footer nav */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--m-border);
}
.page-nav a {
    flex: 1 1 0;
    padding: 16px 20px;
    border: 1px solid var(--m-border);
    border-radius: 12px;
    transition: all 0.15s;
}
.page-nav a:hover {
    border-color: var(--m-primary);
    background: var(--m-primary-tint);
}
.page-nav .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--m-text-subtle);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.page-nav .title {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-text);
}
.page-nav .next { text-align: right; }

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--m-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--m-text);
    text-align: left;
    cursor: pointer;
    margin-bottom: 16px;
}
.sidebar-toggle::after {
    content: '▾';
    float: right;
    color: var(--m-text-subtle);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .docs-layout { grid-template-columns: 1fr; gap: 0; padding: 24px 20px 60px; }
    .docs-sidebar {
        position: static;
        max-height: none;
        display: none;
        background: #fff;
        border: 1px solid var(--m-border);
        border-radius: 10px;
        padding: 16px;
        margin-bottom: 16px;
    }
    .docs-sidebar.open { display: block; }
    .sidebar-toggle { display: block; }
}

@media (max-width: 640px) {
    .manual-hero { padding: 48px 0 40px; }
    .manual-hero h1 { font-size: 30px; }
    .manual-hero p { font-size: 15px; }
    .manual-sections { padding: 40px 0 60px; }
    .topic-grid { grid-template-columns: 1fr; }
    .docs-article { padding: 28px 22px; }
    .docs-article h1 { font-size: 26px; }
    .docs-article h2 { font-size: 19px; }
    .toc-card ol { columns: 1; }
    .page-nav { flex-direction: column; }
    .page-nav .next { text-align: left; }
}
