/* User guide — same paper, forest, and type as the rest of the library */
.ug-page {
    color: var(--uc-ink, #15261a);
    font-family: var(--uc-font-ui, "Manrope", "Noto Sans SC", "PingFang SC", "Segoe UI", sans-serif);
}

.ug-hero-actions .btn-light {
    color: var(--uc-forest, #205A28);
}

.ug-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.75rem 2rem;
    align-items: start;
}

.ug-toc {
    position: sticky;
    top: 5.25rem;
    max-height: calc(100vh - 6.5rem);
    overflow: auto;
    padding: 0.15rem 0 0.5rem;
}

.ug-toc-label {
    margin: 0 0 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(21, 38, 26, 0.45);
}

.ug-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid rgba(21, 38, 26, 0.12);
}

.ug-toc a {
    display: block;
    padding: 0.32rem 0 0.32rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: rgba(21, 38, 26, 0.72);
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.35;
}

.ug-toc a:hover,
.ug-toc a:focus-visible,
.ug-toc a.is-current {
    color: var(--uc-forest, #205A28);
    border-left-color: var(--uc-forest, #205A28);
}

.ug-article h2 {
    font-family: var(--uc-font-display, "Literata", "Noto Serif SC", Georgia, serif);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 2.25rem 0 0.75rem;
    padding-top: 0.35rem;
    scroll-margin-top: 5.25rem;
}

.ug-article h2:first-child {
    margin-top: 0;
}

.ug-article h3 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 1.25rem 0 0.45rem;
}

.ug-article p,
.ug-article li {
    line-height: 1.7;
    font-size: 0.98rem;
}

.ug-article p {
    margin: 0 0 0.75rem;
}

.ug-lead {
    font-size: 1.05rem !important;
    color: rgba(21, 38, 26, 0.82);
}

.ug-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.25rem 0 1.25rem;
}

.ug-step {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.85rem 0.9rem 0.95rem;
    min-height: 100%;
}

.ug-step-no {
    display: inline-block;
    font-family: var(--uc-font-display, "Literata", Georgia, serif);
    color: var(--uc-gold, #b08d3e);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.ug-step strong {
    display: block;
    margin-bottom: 0.25rem;
}

.ug-step p {
    margin: 0;
    font-size: 0.86rem !important;
    color: rgba(21, 38, 26, 0.72);
}

.ug-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.4rem 0 1rem;
}

.ug-card {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.85rem 1rem;
}

.ug-card h3 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.ug-card p {
    margin: 0;
    font-size: 0.88rem !important;
    color: rgba(21, 38, 26, 0.72);
}

.ug-card i {
    color: var(--uc-forest, #205A28);
    margin-right: 0.3rem;
}

.ug-ol,
.ug-ul {
    margin: 0 0 0.9rem;
    padding-left: 1.2rem;
}

.ug-note,
.ug-tip {
    border-left: 3px solid var(--uc-gold, #b08d3e);
    background: rgba(176, 141, 62, 0.08);
    padding: 0.75rem 0.9rem;
    margin: 0.4rem 0 1rem;
}

.ug-tip {
    border-left-color: var(--uc-forest, #205A28);
    background: rgba(32, 90, 40, 0.06);
}

.ug-note p,
.ug-tip p {
    margin: 0;
}

.ug-figure {
    margin: 0.85rem 0 1.15rem;
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
}

.ug-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #e8eee8;
}

.ug-figure figcaption {
    padding: 0.55rem 0.8rem 0.7rem;
    font-size: 0.82rem;
    color: rgba(21, 38, 26, 0.62);
    line-height: 1.5;
}

.ug-table-wrap {
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
    border: 1px solid rgba(21, 38, 26, 0.1);
    background: #fff;
}

.ug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ug-table th,
.ug-table td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(21, 38, 26, 0.08);
    vertical-align: top;
}

.ug-table th {
    background: #e8eee8;
    font-weight: 700;
    white-space: nowrap;
}

.ug-table tr:last-child td {
    border-bottom: none;
}

.ug-table code,
.ug-article code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.84em;
    color: var(--uc-forest-deep, #163f1c);
    background: rgba(32, 90, 40, 0.06);
    padding: 0.05rem 0.28rem;
}

.ug-table a {
    color: var(--uc-forest, #205A28);
    text-decoration: none;
    font-weight: 600;
}

.ug-table a:hover {
    text-decoration: underline;
}

.ug-faq details {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
}

.ug-faq summary {
    cursor: pointer;
    font-weight: 700;
}

.ug-faq details p {
    margin: 0.55rem 0 0.15rem;
}

@media (max-width: 900px) {
    .ug-wrap {
        grid-template-columns: 1fr;
        padding-top: 1rem;
    }

    .ug-toc {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .ug-toc ol {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        border-left: none;
        padding-bottom: 0.35rem;
    }

    .ug-toc a {
        border: 1px solid rgba(21, 38, 26, 0.12);
        border-left-width: 1px;
        margin-left: 0;
        white-space: nowrap;
        padding: 0.35rem 0.7rem;
        background: #fff;
    }

    .ug-toc a.is-current {
        border-color: var(--uc-forest, #205A28);
    }

    .ug-steps,
    .ug-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .ug-steps,
    .ug-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .ug-toc,
    .ug-hero-actions,
    .navbar,
    .ai-fab,
    footer.site-footer {
        display: none !important;
    }

    .ug-wrap {
        display: block;
        max-width: none;
        padding: 0;
    }

    .ug-figure {
        break-inside: avoid;
    }
}
