/* The plugin shell locks html/body to the window. The guide is a document. */
html:has(body.guide-doc) {
    height: auto;
    max-height: none;
    overflow: auto;
}

body.guide-doc {
    display: block;
    min-height: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 8%, transparent), transparent 32%),
        var(--bg-0);
    color: var(--text);
    font-family: "DM Sans", system-ui, sans-serif;
}

body.guide-doc > #titlebar.titlebar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.guide-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 28px 64px;
    box-sizing: border-box;
}

.guide-kicker {
    margin: 0 0 8px;
    color: var(--gold);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.guide-hero {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.guide-hero h1 {
    margin: 0;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.guide-hero p,
.guide-lead {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--text-2);
    font-size: 16px;
    line-height: 1.5;
}

.guide-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.guide-jump a {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-1);
}

.guide-jump a:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

.guide-section {
    margin-top: 40px;
    scroll-margin-top: 64px;
}

.guide-section h2 {
    margin: 0 0 14px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.guide-section h3 {
    margin: 28px 0 8px;
    font-size: 16px;
    color: var(--gold);
    font-weight: 600;
}

.guide-section p {
    max-width: 720px;
    margin: 0 0 10px;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.5;
}

.guide-shot {
    margin: 14px 0 16px;
}

.guide-shot img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-0);
}

.guide-shot.is-rail img {
    width: auto;
    max-width: min(100%, 420px);
}

.guide-shot figcaption {
    margin-top: 8px;
    max-width: 720px;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.45;
}

.guide-controls {
    list-style: none;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 16px 16px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-1);
}

.guide-controls li {
    display: grid;
    grid-template-columns: minmax(168px, 280px) 1fr;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.4;
}

.guide-controls li:first-child {
    border-top: 0;
}

.guide-controls span {
    color: var(--text);
    font-weight: 600;
}

.guide-controls small {
    color: var(--text-2);
    font-size: 13px;
}

@media (max-width: 800px) {
    .guide-wrap { padding: 24px 16px 48px; }
    .guide-controls li { grid-template-columns: 1fr; gap: 2px; }
}

/* Embedded beside the live plugin in the interactive guide. */
html.guide-embed body > #titlebar, html.guide-embed .guide-hero .guide-jump { display: none; }
html.guide-embed .guide-wrap { padding: 14px 18px 40vh; }
html.guide-embed .guide-hero h1 { font-size: 26px; }
html.guide-embed .guide-section { scroll-margin-top: 12px; }
html.guide-embed .guide-section h2, html.guide-embed .guide-section h3 { cursor: pointer; }
html.guide-embed .guide-section h2:hover, html.guide-embed .guide-section h3:hover { color: var(--gold); }
.guide-controls li.is-target, .guide-section h3.is-target, .guide-section.is-target > h2 {
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    border-radius: 6px; transition: background .3s ease;
}
/* LightwaveLlama site brand in the page header. */
.lwl-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.lwl-logo { height: 30px; width: auto; }
.lwl-name { font: 700 17px/1 "DM Sans", system-ui, sans-serif; letter-spacing: .01em; }
.lwl-variant { margin-left: 14px; color: var(--text-3); }
/* Wiki layout: contents tree on the left, one page at a time on the right. */
.wiki { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 36px; align-items: start; max-width: 1280px; margin: 0 auto; }
.wiki-page[hidden] { display: none !important; }
.wiki-toc {
    position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow-y: auto;
    padding: 14px 10px 14px 0; border-right: 1px solid var(--border);
}
.wiki-toc-title { margin: 0 0 10px 10px; color: var(--text-3); font: 600 12px/1.4 "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.wiki-tree, .wiki-tree-kids { list-style: none; margin: 0; padding: 0; }
.wiki-tree a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 15px; line-height: 1.35; }
.wiki-tree a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.wiki-tree-chapter > a { color: var(--text); font-weight: 600; }
.wiki-tree-kids { display: none; margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.wiki-tree-kids a { font-size: 14px; }
.wiki-tree-chapter.is-open > .wiki-tree-kids, .wiki-tree-chapter:has(li.is-current) > .wiki-tree-kids { display: block; }
.wiki-tree li.is-current > a { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.wiki-main { min-width: 0; max-width: 860px; }
.wiki-crumbs { margin: 4px 0 18px; color: var(--text-3); font-size: 14px; }
.wiki-crumbs a { color: var(--text-2); text-decoration: none; }
.wiki-crumbs a:hover { color: var(--gold); }
.wiki-crumbs b { margin: 0 6px; font-weight: 400; }
.wiki-body .guide-section { margin: 0; padding: 0; border: 0; background: none; }
.wiki-body .guide-section > h2, .wiki-body .guide-section > h3:first-of-type { margin: 0 0 14px; font-size: 32px; line-height: 1.15; color: var(--text); }
.wiki-body .guide-section > p { font-size: 17px; line-height: 1.65; color: var(--text-2); max-width: 760px; }
.wiki-chapter-label { margin: 0 0 6px !important; color: var(--gold) !important; font: 600 12px/1.4 "DM Sans", sans-serif !important; letter-spacing: .08em; text-transform: uppercase; }
.wiki-body .guide-section > h3.wiki-in-chapter { margin: 28px 0 10px; font-size: 18px; }
.wiki-subpages, .wiki-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wiki-subpages a, .wiki-chapters a { color: var(--gold); text-decoration: none; font-weight: 600; font-size: 16px; }
.wiki-subpages a:hover, .wiki-chapters a:hover { text-decoration: underline; }
.wiki-chapters li { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.wiki-chapters small { display: block; margin-top: 4px; color: var(--text-3); font-size: 14px; line-height: 1.45; }
.wiki-cover h1 { margin: 0 0 12px; font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.wiki-cover > h2 { margin: 30px 0 12px !important; font-size: 22px !important; }
.wiki-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--border); }
.wiki-pager a { display: block; max-width: 48%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.wiki-pager a:hover { border-color: var(--gold); color: var(--gold); }
.wiki-pager small { display: block; color: var(--text-3); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.wiki-next { margin-left: auto; text-align: right; }
@media (max-width: 860px) {
    .wiki { grid-template-columns: 1fr; gap: 16px; }
    .wiki-toc { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
}
html.guide-embed .wiki { grid-template-columns: 1fr; }
html.guide-embed .wiki-toc { display: none; }
/* Wiki live search. */
.wiki-search {
    box-sizing: border-box; width: calc(100% - 10px); margin: 0 0 14px 4px; padding: 9px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-1); color: var(--text); font: 15px/1.3 "DM Sans", sans-serif;
}
.wiki-search:focus { outline: none; border-color: var(--gold); }
.wiki-results { list-style: none; margin: 0 0 16px; padding: 0; }
.wiki-results button {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--text-2); font: 13px/1.45 "DM Sans", sans-serif;
}
.wiki-results button:hover, .wiki-results button.is-active { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.wiki-results strong { display: block; color: var(--text); font-size: 15px; }
.wiki-results em { display: block; color: var(--gold); font-style: normal; font-size: 12px; }
.wiki-results mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 2px; }
.wiki-noresult { padding: 8px 10px; color: var(--text-3); }
.wiki-tree[hidden], .wiki-results[hidden] { display: none; }
@media (max-width: 860px) { .wiki-toc .wiki-search { width: 100%; margin-left: 0; } }