/* GC reader V3: fluid workspace, readable type and tonal content panels. */
:root {
    --reader-size: clamp(19px, calc(15px + .25vw), 24px);
    --small-size: clamp(12px, calc(10px + .12vw), 15px);
    --nav-size: clamp(17px, calc(14px + .22vw), 22px);
    --page-gutter: clamp(24px, 2.2vw, 72px);
    --panel-padding: clamp(24px, 1.5vw, 46px);
    --panel-edge: rgba(140, 135, 131, .34);
    --panel-tint: rgba(140, 135, 131, .07);
    --crimson-tint: rgba(201, 15, 24, .055);
}
body { font-size: 18px; line-height: 1.7; }
.workspace { grid-template-columns: clamp(260px, 12vw, 340px) minmax(0, 1fr); }
main { width: 100%; max-width: none; margin: 0; padding-inline: var(--page-gutter); }
.topbar, .footer { padding-inline: var(--page-gutter); }
.topbar { min-height: 96px; height: auto; padding-block: 22px; }
.sidebar { padding: 34px 28px 24px; overflow-y: auto; overscroll-behavior: contain; }
.brand { font-size: clamp(40px, 2vw, 54px); }
.side-label { font-size: 12px; line-height: 1.7; letter-spacing: .8px; margin: 20px 0 30px; }
.overview-link, .area-link { font-size: var(--nav-size); padding: 12px; }
.number, .nav-section { font-size: var(--small-size); }
.nav-section { margin: 28px 0 14px; }
.subnav { margin-bottom: 16px; }
.subnav>a { font-size: clamp(15px, 1vw, 19px); line-height: 1.6; }
.subnav>a>span { font-size: 11px; line-height: 1.7; }
.subnav>a.selected:before { margin-top: 10px; }
.reading-link { font-size: 16px; }
.sidebar-foot { font-size: 11px; line-height: 1.9; padding-top: 30px; }
.sidebar-foot .muted { font-size: 14px; }
.breadcrumb { font-size: var(--small-size); min-width: 0; flex-wrap: wrap; gap: 10px; }
.search-form { max-width: 580px; width: 38%; flex-shrink: 0; }
.search-form input { font-size: 17px; padding: 12px 0; }
.search-form button { font-size: 13px; padding: 12px 0; }
.search-mark { font-size: 28px; }
.eyebrow, .wiki-meta, .article-meta, .scope-strip,
.entry-type, .card-time, .card-number, .card-bottom>span:first-child,
.note-label, .section-heading>span { font-size: var(--small-size); line-height: 1.7; }
.eyebrow { letter-spacing: 1px; }
.crimson-line { width: 36px; height: 3px; }
.wiki-heading, .article-heading { padding: 42px 0 30px; }
.wiki-heading h1, .article-heading h1, .search-heading h1 { font-size: clamp(68px, 4.8vw, 124px); margin: 22px 0 14px; }
.wiki-lead, .article-subtitle { font-size: clamp(23px, 1.35vw, 32px); max-width: 80ch; }
.wiki-grid, .article-layout { grid-template-columns: minmax(0, 1fr) clamp(240px, 13vw, 360px); gap: clamp(28px, 2vw, 60px); padding-top: 32px; }
.wiki-toc, .article-aside { background: var(--surface); border: 1px solid var(--panel-edge); border-top: 3px solid var(--steel); border-radius: 8px; padding: 24px; top: 24px; }
.aside-label { font-size: var(--small-size); line-height: 1.7; letter-spacing: .5px; }
.wiki-toc>a, .wiki-toc>a:first-of-type { font-size: clamp(16px, 1vw, 20px); line-height: 1.6; padding: 11px 0; }
.wiki-toc p, .article-aside, .article-aside li, .article-aside>a { font-size: clamp(15px, .9vw, 18px); line-height: 1.75; }
.article-aside { display: block; }
.article-aside .aside-note { font-size: inherit; }
.prose, .article-deck { font-size: var(--reader-size); line-height: 1.75; }
.prose p, .prose li { max-width: 84ch; }
.article-deck { max-width: 78ch; margin-bottom: 28px; }
.wiki-body>p:first-child>em { font-size: inherit; }
.reader-introduction { background: var(--panel-tint); border: 1px solid var(--panel-edge); border-left: 4px solid var(--steel); border-radius: 8px; padding: 22px var(--panel-padding); }
.reader-introduction p { font-size: clamp(16px, 1vw, 20px); line-height: 1.75; max-width: 110ch; margin: 0; }
.reader-sections, .reader-flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.reader-introduction { grid-column: 1 / -1; }
.reader-section { min-width: 0; padding: var(--panel-padding); border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--surface); overflow: hidden; }
.reader-section>h2 {
    margin: calc(-1 * var(--panel-padding)) calc(-1 * var(--panel-padding)) 26px;
    padding: 22px var(--panel-padding); border-top: 0; border-bottom: 1px solid var(--panel-edge);
    border-left: 4px solid var(--accent); background: var(--crimson-tint);
    font: 500 clamp(34px, 1.7vw, 48px)/1.12 var(--heading); text-transform: uppercase;
}
.reader-section>p:last-child { margin-bottom: 0; }
.reader-section--arbeitsgrenze { background: var(--crimson-tint); }
.reader-section--arbeitsgrenze, .reader-section--quellenvergleich, .reader-section--table { grid-column: 1 / -1; }
.prose table { width: 100%; font-size: clamp(17px, calc(13px + .25vw), 22px); line-height: 1.7; margin: 0 0 26px; }
.prose th { font-size: var(--small-size); padding: 18px 20px; background: var(--panel-tint); }
.prose td { padding: 22px 20px; border-bottom-color: var(--panel-edge); }
.prose tbody tr:nth-child(even) { background: rgba(140, 135, 131, .035); }
.wiki-body table a { font-size: inherit; }
.reader-flow+.source-section, .article-body>.source-section { margin-top: 28px; padding: var(--panel-padding); border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--surface); }
.source-section h2 { font: 500 36px/1.2 var(--heading); }
.source-section>p { font-size: 18px; line-height: 1.75; max-width: 84ch; }
.source-section a { text-decoration: underline; text-underline-offset: 4px; }
.concept-strip { margin: 28px 0; border-radius: 8px; overflow: hidden; }
.concept-strip a { padding: 28px; border-top: 3px solid var(--steel); }
.concept-strip a:first-child { border-top-color: var(--accent); background: var(--crimson-tint); }
.concept-strip a:nth-child(2) { background: rgba(140, 135, 131, .12); }
.concept-strip span { font-size: var(--small-size); }
.concept-strip strong { font-size: clamp(48px, 2.5vw, 72px); margin: 16px 0 10px; }
.concept-strip small { font-size: clamp(16px, 1vw, 21px); line-height: 1.6; }
.technique-visual { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0 0 30px; padding: 24px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--panel-tint); }
.media-context { grid-row: 1; align-self: center; }
.media-context .article-deck { margin: 0 0 22px; max-width: 45ch; }
.instruction-figure { margin: 0; border-color: var(--panel-edge); }
.instruction-figure figcaption { padding: 18px 20px; font-size: 14px; line-height: 1.7; }
.instruction-figure figcaption a { font-size: 13px; }
.figure-note { font-size: 17px; line-height: 1.75; margin: 0 0 20px; padding-left: 17px; }
.text-link { font-size: 17px; line-height: 1.6; gap: 26px; }
.bibliography { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border: 0; margin-top: 30px; padding-top: 0; }
.bibliography>.section-heading { grid-column: 1 / -1; border: 1px solid var(--panel-edge); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--surface); padding: 22px 28px; margin: 0; }
.bibliography .section-heading h2 { font-size: clamp(34px, 1.7vw, 46px); }
.bibliography-item { padding: 26px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--panel-tint); gap: 18px; }
.bibliography-number { font-size: 13px; }
.bibliography-item h3 { font-size: clamp(18px, 1.1vw, 23px); line-height: 1.5; margin-bottom: 13px; }
.bibliography-item p { font-size: clamp(16px, 1vw, 20px); line-height: 1.75; }
.bibliography-item a { display: inline-block; margin-top: 14px; font-size: 14px; line-height: 1.7; }
.reader-next, .chapter-nav { padding: 26px; margin-top: 30px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--surface); }
.reader-next span, .chapter-nav span { font-size: 12px; line-height: 1.8; }
.reader-next strong, .chapter-nav strong { font-size: clamp(30px, 1.7vw, 43px); line-height: 1.1; }
.overview-main>.prose, .overview-main>.wiki-section, .overview-main>.scope-note { background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 8px; padding: var(--panel-padding); }
.overview-main>.prose>h2:first-child { font: 500 clamp(35px, 1.8vw, 48px)/1.2 var(--heading); padding-bottom: 18px; border-bottom: 1px solid var(--panel-edge); margin-bottom: 25px; }
.overview-main>.wiki-section { margin-top: 26px; }
.wiki-section .section-heading h2 { font-size: clamp(34px, 1.8vw, 48px); }
.wiki-entry-row { padding: 28px; border-color: var(--panel-edge); background: var(--panel-tint); }
.wiki-entry-row h3 { font-size: clamp(42px, 2.2vw, 62px); }
.wiki-entry-row p { font-size: clamp(17px, 1vw, 22px); line-height: 1.75; }
.entry-index { font-size: 72px; }
.card-arrow { width: 42px; height: 42px; font-size: 27px; }
.visual-preview { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
.visual-preview h3 { font-size: clamp(38px, 2.2vw, 60px); line-height: 1.06; }
.visual-preview p { font-size: clamp(17px, 1vw, 22px); line-height: 1.75; max-width: 52ch; }
.visual-preview .text-link { font-size: 17px; }
.source-split { gap: 34px; }
.source-split h3 { font-size: clamp(20px, 1.3vw, 29px); line-height: 1.5; }
.source-split p, .scope-note p { font-size: clamp(17px, 1.1vw, 23px); line-height: 1.75; }
.scope-note { border-left: 4px solid var(--accent) !important; }
.section-heading h2 { font-size: clamp(32px, 1.8vw, 48px); }
.intro-copy { max-width: 68ch; }
.intro-copy .lead { font-size: clamp(28px, 1.7vw, 42px); }
.intro-copy p { font-size: clamp(18px, 1.1vw, 25px); }
.intro h1 { font-size: clamp(115px, 8vw, 230px); }
.scope-strip { gap: 25px 40px; padding-block: 20px; }
.area-grid { gap: 24px; }
.area-card { padding: 30px; min-height: 330px; border-color: var(--panel-edge); border-top: 3px solid var(--steel); border-radius: 8px; }
.area-card:nth-child(odd) { background: var(--panel-tint); }
.area-card:hover { border-top-color: var(--accent); }
.area-card h3 { font-size: clamp(42px, 2.4vw, 66px); }
.card-subtitle { font-size: 19px; line-height: 1.6; }
.card-summary { max-width: 60ch; font-size: clamp(17px, 1.1vw, 24px); line-height: 1.7; }
.area-card:last-child { min-height: 300px; }
.reading-note { padding: 30px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--surface); margin-bottom: 40px; }
.reading-note h2 { font-size: 40px; }
.reading-note .prose, .reading-note summary { font-size: 18px; line-height: 1.8; }
.reading-note .prose { max-width: 100ch; }
.search-heading p, .empty-state p { font-size: var(--reader-size); }
.search-result { padding: 28px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--surface); margin-bottom: 18px; }
.search-result h2 { font-size: clamp(40px, 2.3vw, 60px); }
.search-result p { font-size: 19px; line-height: 1.6; }
.search-result>.number { width: 105px; font-size: 13px; }
.footer { font-size: 12px; line-height: 1.8; padding-block: 25px; }
.dialog-header h2 { font-size: 34px; }
.dialog-header button { font-size: 15px; padding: 13px 18px; }
dialog>p { font-size: 13px; }

@media (min-width: 1800px) {
    .reader-sections, .reader-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .technique-visual { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 34px; }
    .technique-visual .instruction-figure { grid-column: 1; grid-row: 1; }
    .media-context { grid-column: 2; grid-row: 1; }
    .area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .area-card:last-child { grid-column: span 2; }
}
@media (min-width: 2100px) {
    .overview-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; align-content: start; }
    .overview-main>.wiki-section, .overview-main>.scope-note { margin-top: 0; }
    .overview-main>.visual-preview, .overview-main>#quellen, .overview-main>.scope-note { grid-column: 1 / -1; }
    .reader-section--quellenvergleich table, .reader-section--quellenvergleich tbody { display: block; }
    .reader-section--quellenvergleich thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .reader-section--quellenvergleich tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .reader-section--quellenvergleich tr { display: block; min-width: 0; border: 1px solid var(--panel-edge); border-radius: 6px; background: var(--panel-tint); }
    .reader-section--quellenvergleich td, .reader-section--quellenvergleich td:first-child { display: block; width: auto; border: 0; padding: 25px 28px; }
    .reader-section--quellenvergleich td:first-child { border-bottom: 1px solid var(--panel-edge); background: var(--crimson-tint); }
}
@media (max-width: 1300px) {
    .wiki-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
    .wiki-toc { position: static; grid-row: 1; display: flex; flex-wrap: wrap; gap: 7px 22px; padding: 20px 24px; }
    .wiki-toc>.aside-label { width: 100%; }
    .wiki-toc>a, .wiki-toc>a:first-of-type { padding: 0; font-size: 16px; }
    .wiki-toc>.toc-divider, .wiki-toc>p, .wiki-toc>.aside-label:not(:first-child) { display: none; }
    .article-aside { position: static; grid-row: 1; }
    .article-aside ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 0; }
    .article-aside li { border: 0; padding: 0; }
    .article-aside .aside-note { display: none; }
}
@media (max-width: 1100px) {
    .breadcrumb { display: none; }
    .search-form { width: 100%; max-width: none; }
    .intro-grid, .visual-preview { grid-template-columns: 1fr; }
    .intro-copy { max-width: none; }
    .source-split { grid-template-columns: 1fr; }
    .area-grid { grid-template-columns: 1fr; }
    .area-card:last-child { grid-column: auto; }
    .instruction-figure figcaption { display: block; }
    .instruction-figure figcaption a { display: inline-block; margin-top: 10px; }
}
@media (max-width: 760px) {
    :root { --reader-size: 18px; --small-size: 12px; --nav-size: 18px; --page-gutter: 18px; --panel-padding: 20px; }
    .workspace { display: block; }
    .sidebar { position: static; height: auto; overflow: visible; padding: 22px 18px 16px; }
    .brand { font-size: 38px; }
    .navigation-shell>summary { font-size: 13px; padding: 10px 0; }
    .sidebar .navigation-shell .area-link { font-size: 18px; padding: 11px 10px; }
    .sidebar .navigation-shell .subnav>a { font-size: 16px; }
    .sidebar .navigation-shell .subnav>a>span { font-size: 11px; }
    .topbar { min-height: 75px; padding-block: 14px; }
    .search-form input { font-size: 16px; }
    .search-form button { font-size: 12px; }
    .wiki-heading, .article-heading { padding: 28px 0 24px; }
    .wiki-heading h1, .article-heading h1, .search-heading h1 { font-size: 56px; }
    .wiki-lead, .article-subtitle { font-size: 21px; }
    .eyebrow { font-size: 11px; letter-spacing: .4px; }
    .wiki-meta, .article-meta { gap: 10px 18px; }
    .wiki-grid, .article-layout { padding-top: 24px; gap: 24px; }
    .wiki-toc { padding: 20px; gap: 10px 18px; }
    .wiki-toc>a, .wiki-toc>a:first-of-type { font-size: 15px; }
    .reader-section>h2 { font-size: 32px; padding-block: 18px; margin-bottom: 22px; }
    .reader-introduction { padding: 20px; }
    .reader-introduction p { font-size: 16px; }
    .prose table { font-size: 16px; line-height: 1.7; }
    .prose th, .prose td { padding: 13px 9px; }
    .prose th { font-size: 11px; }
    .wiki-body table a { font-size: 15px; }
    .reader-section--quellenvergleich { padding-inline: 15px; }
    .reader-section--quellenvergleich>h2 { margin-inline: -15px; padding-inline: 18px; }
    .technique-visual { padding: 16px; gap: 20px; }
    .figure-note { font-size: 16px; }
    .instruction-figure figcaption { padding: 14px; font-size: 13px; }
    .instruction-figure figcaption a { font-size: 13px; }
    .concept-strip a { padding: 22px 12px; }
    .concept-strip strong { font-size: 43px; }
    .concept-strip small { font-size: 14px; }
    .bibliography>.section-heading { padding: 22px; }
    .bibliography .section-heading h2 { font-size: 32px; }
    .bibliography-item { padding: 23px; }
    .bibliography-item h3 { font-size: 20px; }
    .bibliography-item p { font-size: 17px; }
    .reader-next, .chapter-nav { padding: 22px; gap: 20px; }
    .reader-next span, .chapter-nav span { font-size: 11px; }
    .reader-next strong, .chapter-nav strong { font-size: 28px; }
    .wiki-entry-row { padding: 22px 16px; gap: 12px; }
    .wiki-entry-row h3 { font-size: 42px; }
    .wiki-entry-row p { font-size: 17px; }
    .entry-index { font-size: 54px; padding: 0; }
    .card-arrow { width: 32px; height: 36px; }
    .visual-preview h3 { font-size: 38px; }
    .visual-preview p, .source-split p, .scope-note p { font-size: 18px; }
    .reading-note { padding: 24px; }
    .reading-note h2 { font-size: 34px; }
    .intro h1 { font-size: 120px; }
    .intro-copy .lead { font-size: 29px; }
    .intro-copy p { font-size: 18px; }
    .area-card { padding: 25px; }
    .area-card h3 { font-size: 46px; }
    .card-summary { font-size: 18px; }
    .search-result { padding: 22px 18px; gap: 16px; }
    .search-result>.number { width: 55px; font-size: 11px; }
    .search-result h2 { font-size: 35px; }
    .search-result p { font-size: 17px; }
    .footer { font-size: 11px; }
    .dialog-header h2 { font-size: 27px; }
    .dialog-header button { font-size: 13px; }
}

/* Keep source cards filling their row even with a spanning heading. */
@media (max-width: 1100px) { .bibliography { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .bibliography { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 2100px) { .wiki-body .reader-section--quellenvergleich td:first-child { width: 100%; } }

/* V4: chapter headers and indented entries form one visible navigation unit. */
.sidebar .nav-chapter { margin: 0 0 12px; border: 1px solid rgba(140,135,131,.24); border-radius: 6px; background: rgba(140,135,131,.035); overflow: hidden; }
.sidebar .nav-chapter>.area-link { margin: 0; padding: 13px 12px; gap: 11px; border: 0; border-left: 3px solid transparent; background: rgba(140,135,131,.10); font-weight: 650; line-height: 1.4; }
.sidebar .nav-chapter>.area-link>.number { display: grid; place-items: center; flex: 0 0 30px; min-height: 30px; border: 1px solid rgba(140,135,131,.35); border-radius: 4px; background: var(--bg); color: var(--dim); font-size: 12px; font-weight: 400; }
.sidebar .nav-chapter>.area-link>span:nth-child(2) { flex: 1; min-width: 0; }
.chapter-marker { color: var(--steel); font-size: 19px; font-weight: 400; }
.sidebar .nav-chapter.chapter-active { border-color: rgba(201,15,24,.6); }
.sidebar .nav-chapter.chapter-active>.area-link { background: rgba(201,15,24,.12); border-left-color: var(--accent); }
.sidebar .nav-chapter.chapter-active .chapter-marker { color: var(--text); }
.sidebar .nav-chapter .subnav { display: block; margin: 10px 10px 12px 29px; padding: 0 0 0 13px; border-left: 1px solid rgba(140,135,131,.4); }
.sidebar .nav-chapter .subnav>a { display: flex; flex-direction: column; position: relative; padding: 11px 12px; border: 1px solid transparent; border-radius: 4px; font-size: clamp(15px, 1vw, 19px); white-space: normal; line-height: 1.5; }
.sidebar .nav-chapter .subnav>a>span { display: block; margin: 4px 0 0; font-size: 10px; letter-spacing: .8px; color: var(--steel); }
.sidebar .nav-chapter .subnav>a.selected { background: rgba(201,15,24,.12); border-color: rgba(201,15,24,.32); color: var(--text); }
.sidebar .nav-chapter .subnav>a.selected:before { content: ''; position: absolute; left: -15px; top: 14px; width: 3px; height: 22px; margin: 0; background: var(--accent); }
.sidebar .nav-chapter>.area-link:hover, .sidebar .nav-chapter .subnav>a:hover { background: rgba(140,135,131,.18); }
.sidebar .nav-chapter a[aria-current="page"] { color: var(--text); }
@media (max-width: 760px) {
    .sidebar .navigation-shell .nav-chapter { width: 100%; margin-bottom: 9px; }
    .sidebar .navigation-shell .nav-chapter>.area-link { font-size: 18px; padding: 12px; white-space: normal; }
    .sidebar .navigation-shell .nav-chapter .subnav { margin: 9px 10px 11px 29px; padding-left: 13px; }
    .sidebar .navigation-shell .nav-chapter .subnav>a { display: flex; font-size: 16px; padding: 10px 12px; }
    .sidebar .navigation-shell .nav-chapter .subnav>a>span { display: block; margin: 4px 0 0; font-size: 10px; }
    .sidebar .navigation-shell .nav-chapter .subnav>a.selected:before { display: block; }
}

@media (min-width: 761px) { .workspace { grid-template-columns: clamp(300px, 12vw, 340px) minmax(0, 1fr); } }
.navigation-shell>summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; font-size: 14px; }
.navigation-shell>summary::-webkit-details-marker { display: none; }

/* V5: compact desktop type and a full-width vertical mobile navigation. */
@media (min-width: 761px) {
    .sidebar .overview-link { font-size: 17px; }
    .sidebar .nav-chapter>.area-link { font-size: 18px; padding-block: 11px; font-weight: 600; }
    .sidebar .nav-chapter .subnav>a { font-size: 16px; padding-block: 10px; }
    .sidebar .nav-chapter { margin-bottom: 10px; }
}
@media (max-width: 760px) {
    .sidebar .navigation-shell nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; min-width: 0; overflow: visible; margin-top: 14px; padding-bottom: 0; }
    .sidebar .navigation-shell:not([open])>nav { display: none; }
    .sidebar .navigation-shell .nav-chapter { flex: none; width: 100%; min-width: 0; }
    .sidebar .navigation-shell .nav-chapter>.area-link { min-height: 48px; font-size: 17px; padding: 10px 12px; }
    .sidebar .navigation-shell .nav-chapter .subnav>a { min-height: 48px; font-size: 16px; }
    .sidebar .navigation-shell .overview-link { display: flex; margin: 0 0 10px; padding: 10px 12px; min-height: 44px; font-size: 17px; }
    .sidebar .navigation-shell .reading-link { display: flex; margin-top: 8px; padding: 12px; font-size: 16px; }
    .navigation-shell[open]>summary span { transform: rotate(180deg); }
}

/* V6: contextual search and persistent, keyboard-operable match navigation. */
.sidebar .brand { font-size: clamp(39px, 1.65vw, 49px); line-height: 1; white-space: nowrap; letter-spacing: .5px; }
.search-passages { list-style: none; padding: 0; margin: 18px 0; }
.search-passages li { margin: 10px 0; }
.search-passages a { display: block; padding: 15px 18px; border: 1px solid var(--panel-edge); border-left: 3px solid var(--steel); border-radius: 5px; background: var(--panel-tint); font-size: 18px; line-height: 1.7; }
.search-passages a:hover { border-color: var(--accent); }
.search-passage-count { color: var(--dim); font-size: 14px !important; }
.search-result-passages>div { flex: 1; min-width: 0; }
mark { background: rgba(201,15,24,.25); color: var(--text); padding: 0 .1em; border-bottom: 2px solid var(--accent); }
.reader-match.current-match { outline: 2px solid var(--text); outline-offset: 3px; background: var(--accent); }
.search-location-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px var(--page-gutter); border-bottom: 1px solid var(--steel); background: var(--surface); font-size: 16px; box-shadow: 0 6px 18px #050505; }
.search-location-bar[hidden] { display: none; }
.search-location-bar>div { display: flex; gap: 8px; }
.search-location-bar button { min-width: 44px; min-height: 44px; border: 1px solid var(--steel); border-radius: 4px; padding: 8px 12px; background: var(--bg); color: var(--text); font-size: 15px; cursor: pointer; }
[data-search-block] { scroll-margin-top: 100px; }
@media(max-width:760px) {
    .sidebar .brand { font-size: 38px; }
    .search-location-bar { flex-wrap: wrap; gap: 6px; padding: 9px 18px; font-size: 14px; }
    .search-location-bar>span { width: 100%; overflow-wrap: anywhere; }
    .search-location-bar button { font-size: 13px; }
    .search-passages a { padding: 14px; font-size: 17px; }
    .search-result-passages { display: block; }
    .search-result-passages>.number { display: block; width: auto; margin-bottom: 10px; }
}

.sidebar .brand>.brand-dot { display: inline; }

/* V7: native collapsible chapters, one optional topic level, stronger GC crimson. */
:root { --accent-readable: #f0747b; }
.sidebar .nav-chapter { border-color: rgba(201,15,24,.32); }
.sidebar .nav-chapter>summary { list-style: none; cursor: pointer; }
.sidebar .nav-chapter>summary::-webkit-details-marker, .nav-topic>summary::-webkit-details-marker { display: none; }
.sidebar .nav-chapter.chapter-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(201,15,24,.35); }
.sidebar .nav-chapter.chapter-active>.area-link { background: rgba(201,15,24,.30); border-left-color: var(--accent); }
.sidebar .nav-chapter:hover, .sidebar .nav-chapter:focus-within { border-color: var(--accent); }
.sidebar .nav-chapter>.area-link:hover, .sidebar .nav-chapter>.area-link:focus-visible { background: rgba(201,15,24,.23); box-shadow: inset 0 0 0 1px var(--accent); }
.sidebar .nav-chapter.chapter-active>.area-link:hover { background: rgba(201,15,24,.38); }
.branch-icon { flex: 0 0 18px; color: var(--accent-readable); text-align: center; font: 400 23px/1 var(--body); }
.branch-icon:before { content: '+'; }
[open]>summary>.branch-icon:before { content: '−'; }
.sidebar .nav-chapter:not([open])>.subnav, .sidebar .nav-topic:not([open])>.subnav { display: none; }
.sidebar .nav-chapter .subnav { margin-left: 15px; padding-left: 10px; }
.sidebar .nav-chapter .subnav>a { overflow-wrap: anywhere; }
.sidebar .nav-chapter .subnav>a.selected { background: rgba(201,15,24,.25); border-color: var(--accent); }
.sidebar .nav-chapter .subnav>a:hover, .sidebar .nav-chapter .subnav>a:focus-visible { background: rgba(201,15,24,.18); border-color: var(--accent); }
.sidebar .nav-chapter .subnav>a.selected:before { left: -12px; }
.sidebar .chapter-overview { color: var(--dim); }
.nav-topic { margin: 6px 0; min-width: 0; }
.nav-topic>summary { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 44px; padding: 9px 11px; list-style: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; font: 600 16px/1.5 var(--body); overflow-wrap: anywhere; }
.nav-topic>summary>span:first-child { min-width: 0; }
.nav-topic>summary:hover, .nav-topic>summary:focus-visible { border-color: var(--accent); background: rgba(201,15,24,.18); }
.nav-topic.topic-active>summary { color: var(--accent-readable); background: rgba(201,15,24,.12); }
.sidebar .navigation-shell .nav-chapter .nested-subnav { margin: 5px 0 8px 6px; padding-left: 8px; }
.sidebar .navigation-shell .nav-chapter .nested-subnav>a { font-size: 16px; }
.wiki-heading, .article-heading { border-bottom-color: rgba(201,15,24,.65); }
.reader-section>h2 { background: rgba(201,15,24,.10); color: var(--accent-readable); }
.overview-main>.prose>h2:first-child, .wiki-section>.section-heading h2, .wiki-section>h2, .section-heading h2, .reading-note h2, .source-section h2 { color: var(--accent-readable); }
.eyebrow { color: #c9a1a3; }
.area-card { border-top-color: rgba(201,15,24,.65); }
.area-card:hover, .wiki-entry-row:hover { border-color: var(--accent); background: rgba(201,15,24,.08); }
.search-form:focus-within { border-bottom-color: var(--accent-readable); }
@media(max-width:760px) {
    .sidebar .navigation-shell .nav-chapter .subnav { margin-left: 15px; padding-left: 10px; }
    .sidebar .navigation-shell .nav-chapter .nested-subnav { margin-left: 6px; padding-left: 8px; }
    .nav-topic>summary { min-height: 48px; }
}

/* V8: compact family wordmark and identifiable navigation controls. */
.sidebar .brand { width: 100%; max-width: 240px; line-height: 0; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--panel-edge); }
.codex-wordmark { display: block; width: 100%; height: auto; overflow: visible; }
.codex-wordmark text { font-family: var(--heading); font-weight: 500; fill: var(--text); }
.wordmark-brand { font-size: 57px; }
.wordmark-product { font-size: 92px; }
.wordmark-rule { fill: none; stroke: var(--accent); stroke-width: 4; }
.nav-icon { width: 23px; height: 23px; flex: 0 0 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .overview-link { justify-content: flex-start; gap: 12px; margin: 0 0 22px; padding: 12px 14px; min-height: 48px; font-size: 17px; border: 1px solid var(--panel-edge); border-left: 3px solid transparent; border-radius: 6px; background: var(--panel-tint); }
.sidebar .overview-link.selected { border-color: var(--accent); background: rgba(201,15,24,.25); }
.sidebar .overview-link:hover { border-color: var(--accent); background: rgba(201,15,24,.16); }
.sidebar .overview-link>.nav-icon { color: var(--accent-readable); }
.sidebar .nav-section { margin: 0 0 12px; font-size: 11px; letter-spacing: 1.3px; }
.intro h1 { font-size: clamp(68px, 5vw, 144px); }
@media(min-width:761px) {
    .navigation-shell>summary { display: none; }
}
@media(max-width:760px) {
    .sidebar .brand { width: 190px; padding-bottom: 16px; margin-bottom: 10px; border: 0; }
    .navigation-shell { margin-top: 0; }
    .sidebar .navigation-shell>summary { display: flex; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--panel-edge); border-radius: 6px; background: var(--panel-tint); font: 500 15px/1.5 var(--body); letter-spacing: 0; }
    .sidebar .navigation-shell>summary:hover { border-color: var(--accent); }
    .navigation-shell .menu-label { flex: 1; }
    .navigation-shell[open]>summary .menu-label { transform: none; }
    .navigation-shell>summary>.menu-chevron { width: 18px; text-align: center; }
    .sidebar .navigation-shell .overview-link { margin-bottom: 18px; font-size: 17px; }
    .sidebar .navigation-shell .nav-section { display: flex; }
    .intro h1 { font-size: 68px; }
}

/* V9: the permanent G-COMBAT CODEX wordmark receives its edition descriptor. */
.wordmark-lockup { display: block; }
.sidebar .brand .wordmark-edition { display: block; margin-top: 12px; font: 500 22px/1.3 var(--body); letter-spacing: 2.5px; color: var(--accent-readable); }
.sidebar .brand .wordmark-rule { display: block; width: 44px; height: 3px; margin-top: 12px; background: var(--accent); }
.intro h1 .edition-title { display: block; margin-top: 18px; font: 500 26px/1.3 var(--body); letter-spacing: 4px; color: var(--accent-readable); }
@media(max-width:760px) {
    .sidebar .brand .wordmark-edition { font-size: 20px; margin-top: 10px; }
    .sidebar .brand .wordmark-rule { margin-top: 10px; }
    .intro h1 .edition-title { font-size: 22px; letter-spacing: 3px; }
}

/* Long German article titles must fit narrow reader viewports. */
.wiki-heading h1 { overflow-wrap: anywhere; }

/* Manuscript witnesses remain readable alongside one another and stack on mobile. */
.reader-section--quellenvergleich { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.reader-section--quellenvergleich > h2,.reader-section--quellenvergleich > p { grid-column:1 / -1; }
.reader-section--quellenvergleich > blockquote { margin:0; min-width:0; padding:20px; border:1px solid var(--border,#414141); border-left:2px solid var(--accent-readable,#9ebed2); background:rgba(255,255,255,.025); font-style:normal; overflow-wrap:anywhere; }
.reader-section--quellenvergleich > blockquote h3 { margin:0 0 16px; font:600 20px/1.4 var(--body); }
.reader-section--quellenvergleich > blockquote p { font-size:18px; line-height:1.7; }
@media(max-width:1200px) { .reader-section--quellenvergleich { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) { .reader-section--quellenvergleich { grid-template-columns:minmax(0,1fr); } }
