/* === /guide/ — user guide layout. Tokens come from styles.css; only guide-specific rules live here. === */
.guide-page nav .nav-links a.nav-current { color: var(--white); }

.guide-layout {
    max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px;
    display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start;
}
.guide-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 8px; }
.toc-toggle { display: none; }

/* Table of contents */
.guide-toc { font-size: 0.9rem; }
.toc-search { position: relative; margin-bottom: 14px; }
.toc-search input {
    width: 100%; padding: 10px 12px; border-radius: var(--sui-radius-sm);
    border: 1px solid var(--sui-border); background: var(--sui-surface-2); color: var(--text); font: inherit; font-size: 0.9rem;
}
.toc-search input:focus { outline: none; border-color: var(--sui-accent); box-shadow: 0 0 0 3px var(--sui-accent-soft); }
.search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
    background: var(--sui-surface); border: 1px solid var(--sui-border); border-radius: var(--sui-radius-sm);
    box-shadow: var(--sui-shadow); max-height: 60vh; overflow-y: auto; padding: 6px;
}
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.is-active { background: var(--sui-accent-soft); color: var(--white); }
.search-results .sr-title { display: block; font-weight: 600; font-size: 0.88rem; }
.search-results .sr-meta { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }
.search-results .sr-empty { padding: 10px; color: var(--text-muted); font-size: 0.85rem; }
.toc-home, .toc-all { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-muted); font-weight: 600; }
.toc-home:hover, .toc-all:hover, .toc-chapter a:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.toc-home.is-current { color: var(--white); background: var(--sui-accent-soft); }
.toc-all { margin-top: 10px; font-size: 0.8rem; font-weight: 500; }
.toc-chapter { margin-top: 6px; }
.toc-chapter summary {
    cursor: pointer; list-style: none; padding: 7px 10px; border-radius: 8px; color: var(--white);
    font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 8px;
}
.toc-chapter summary::-webkit-details-marker { display: none; }
.toc-chapter summary::before { content: "▸"; font-size: 0.7rem; color: var(--sui-text-dim); transition: transform var(--sui-ease); }
.toc-chapter[open] summary::before { transform: rotate(90deg); }
.toc-chapter ul { list-style: none; margin: 0 0 4px; padding: 0 0 0 10px; }
.toc-chapter li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-muted); border-left: 2px solid transparent; }
.toc-chapter li a.is-current { color: var(--white); border-left-color: var(--purple); background: rgba(255,255,255,0.04); }

/* Topic */
.guide-main { min-width: 0; }
.breadcrumb { font-size: 0.8rem; color: var(--sui-text-dim); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.topic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.topic-type {
    display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; border: 1px solid transparent;
}
.type-concept { background: rgba(59,130,246,0.15); color: var(--blue); border-color: rgba(59,130,246,0.3); }
.type-task { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }
.type-reference { background: rgba(245,166,35,0.15); color: var(--brand-gold); border-color: rgba(245,166,35,0.3); }
.type-map { background: rgba(126,40,132,0.15); color: var(--purple); border-color: rgba(126,40,132,0.3); }
.open-in-app { font-size: 0.85rem; font-weight: 600; color: var(--purple); }
.topic h1 { font-size: 2.2rem; font-weight: 800; color: var(--white); margin: 0 0 10px; }
.topic .shortdesc { font-size: 1.15rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 22px; max-width: 70ch; }
.topic .body p, .topic .prereq p { color: var(--text); margin: 0 0 14px; max-width: 72ch; line-height: 1.7; }
.topic .body strong { color: var(--white); }
.topic a { color: var(--purple); }
.topic a:hover { color: var(--brand-gold); }
.section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple); margin: 34px 0 12px; }
.note {
    border: 1px solid rgba(245,166,35,0.35); background: rgba(245,166,35,0.08); border-radius: var(--sui-radius-sm);
    padding: 12px 14px; font-size: 0.92rem; color: var(--text); margin: 0 0 20px; max-width: 72ch;
}
.note-label { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-gold); margin-right: 8px; }
.on-this-page { background: var(--sui-surface); border: 1px solid var(--sui-border); border-radius: var(--sui-radius-sm); padding: 12px 16px; margin: 0 0 8px; max-width: 72ch; }
.otp-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sui-text-dim); margin-bottom: 6px; }
.on-this-page ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.on-this-page a { font-size: 0.88rem; color: var(--text-muted); }
.on-this-page a:hover { color: var(--white); }

/* Tasks (DITA task → steps) */
.task { background: var(--sui-surface); border: 1px solid var(--sui-border); border-radius: var(--sui-radius); padding: 22px 24px; margin: 0 0 16px; max-width: 76ch; }
.task h3 { font-size: 1.15rem; font-weight: 700; color: var(--white); margin: 0 0 12px; }
.task h3 .anchor { color: inherit; }
.task h3 .anchor:hover { color: var(--purple); }
.task .prereq { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 12px; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step { counter-increment: step; position: relative; padding: 0 0 12px 40px; color: var(--text); line-height: 1.6; }
.step::before {
    content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--sui-accent-soft); color: var(--white); font-weight: 700; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
}
.step:last-child { padding-bottom: 0; }
.result { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--sui-border); color: var(--text-muted); font-size: 0.92rem; }
.result strong { color: var(--green); }

/* Reference (DITA properties) */
dl.properties { margin: 0; max-width: 76ch; }
.prop { padding: 12px 0; border-bottom: 1px solid var(--sui-border); }
.prop dt { font-weight: 700; color: var(--white); margin-bottom: 4px; }
.prop dt .anchor { color: inherit; }
.prop dt .anchor:hover { color: var(--purple); }
.prop dd { margin: 0; color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }
table.properties { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 0.92rem; }
table.properties th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sui-text-dim); padding: 8px 10px; border-bottom: 2px solid var(--sui-border); }
table.properties td { padding: 10px; border-bottom: 1px solid var(--sui-border); vertical-align: top; color: var(--text-muted); }
table.properties td:first-child { color: var(--white); font-weight: 600; }
.status { display: inline-block; padding: 2px 10px; border-radius: 50px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.status-on { background: rgba(16,185,129,0.15); color: var(--green); }
.status-partial, .status-limited { background: rgba(245,166,35,0.15); color: var(--brand-gold); }
.status-held-back, .status-off, .status-not-yet { background: rgba(239,68,68,0.15); color: var(--red); }

/* Related, pager, foot */
.related-links ul { list-style: none; margin: 0; padding: 0; max-width: 76ch; }
.related-links li { padding: 8px 0; border-bottom: 1px solid var(--sui-border); }
.related-links a { font-weight: 600; }
.rel-desc { display: block; color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 16px; max-width: 76ch; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--sui-border); border-radius: var(--sui-radius-sm); background: var(--sui-surface); color: var(--white); font-weight: 600; }
.pager a:hover { border-color: var(--sui-accent); color: var(--white); }
.pager a span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sui-text-dim); margin-bottom: 4px; }
.pager-next { text-align: right; }
.topic-foot { font-size: 0.85rem; color: var(--sui-text-dim); margin-top: 24px; }
.topic-foot a { color: var(--purple); }

/* Map page */
.map-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.map-list a { display: block; padding: 14px 16px; border: 1px solid var(--sui-border); border-radius: var(--sui-radius-sm); background: var(--sui-surface); color: var(--text-muted); height: 100%; }
.map-list a:hover { border-color: var(--sui-accent); color: var(--text-muted); }
.map-title { display: block; color: var(--white); font-weight: 700; margin-bottom: 4px; }
.map-desc { display: block; font-size: 0.85rem; line-height: 1.5; }
.chip-beta { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 50px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(239,68,68,0.15); color: var(--red); vertical-align: 2px; }

/* Whole-guide page */
.all-toc { color: var(--text-muted); font-size: 0.92rem; columns: 2; column-gap: 32px; }
.all-toc ol { margin: 4px 0 10px; }
.all-chapter { font-size: 1.6rem; font-weight: 800; color: var(--white); margin: 56px 0 18px; padding-top: 24px; border-top: 1px solid var(--sui-border); }
.all-topic { margin-bottom: 44px; }
.all-topic .all-title { font-size: 1.6rem; font-weight: 800; color: var(--white); margin: 0 0 8px; }

@media (max-width: 900px) {
    .guide-layout { grid-template-columns: 1fr; gap: 16px; padding: 16px 16px 48px; }
    .guide-side { position: static; max-height: none; display: none; }
    .guide-side.is-open { display: block; }
    .toc-toggle {
        display: inline-block; padding: 8px 14px; border-radius: var(--sui-radius-sm); border: 1px solid var(--sui-border);
        background: var(--sui-surface-2); color: var(--white); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; justify-self: start;
    }
    .topic h1 { font-size: 1.7rem; }
    .pager { grid-template-columns: 1fr; }
    .all-toc { columns: 1; }
    table.properties { display: block; overflow-x: auto; }
}

@media print {
    nav, footer, .guide-side, .toc-toggle, .pager, .topic-foot, .open-in-app, .rainbow-bar, .on-this-page { display: none !important; }
    body { background: #fff; color: #111; }
    .guide-layout { display: block; padding: 0; }
    .topic h1, .all-title, .all-chapter, .task h3, .prop dt, .map-title, table.properties td:first-child { color: #000; }
    .topic .body p, .step, .prop dd, .shortdesc, table.properties td { color: #222; }
    .task, .note, .on-this-page { background: none; border-color: #ccc; break-inside: avoid; }
    .all-topic { break-before: auto; }
    a { color: #000; text-decoration: none; }
}
