.wiki-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 4rem;
    padding-top: 3rem;
    padding-bottom: 4rem;
}
.wiki-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
    font-size: 0.85rem;
}
.wiki-sidebar > p {
    font: 0.75rem var(--mono);
    color: var(--muted);
    margin-bottom: 1.25rem;
}
.wiki-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.wiki-sidebar a {
    padding: 0.45rem 0;
    text-decoration: none;
    display: flex;
    gap: 1rem;
}
.wiki-sidebar a:hover {
    text-decoration: underline;
}
.wiki-sidebar a span {
    font: 0.7rem/1.9 var(--mono);
    color: var(--muted);
    min-width: 1.2rem;
}
.index-meta {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    margin-top: 1.5rem;
    font: 0.7rem/1.6 var(--mono);
    color: var(--muted);
}
.wiki-content {
    max-width: 56rem;
    min-width: 0;
}
.wiki-intro {
    padding-bottom: 2.5rem;
}
.wiki-intro h1 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin: 1rem 0;
}
.wiki-summary {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 42rem;
}
.wiki-release-note {
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-raised);
    font-size: 0.875rem;
    margin-top: 1.5rem;
}
.doc-section {
    border-top: 1px solid var(--line);
    padding: 2.5rem 0;
    scroll-margin-top: 1rem;
}
.doc-section > header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.doc-section > header > span {
    font: 0.75rem var(--mono);
    color: var(--muted);
}
.doc-section h2 {
    font-size: 2rem;
}
.doc-section h3 {
    font-size: 1.35rem;
    margin: 2rem 0 1rem;
}
.doc-section > p {
    margin: 1rem 0;
}
.doc-section .text-link {
    display: inline;
    font: inherit;
    text-decoration: underline;
}
.doc-section code {
    overflow-wrap: anywhere;
}
.doc-terminal {
    margin: 1.5rem 0;
}
.doc-terminal pre code {
    font-size: 0.75rem;
}
.terminal-bar.secondary {
    border-top: 1px solid var(--line);
    background: var(--surface-raised);
}
.definition-list {
    border-top: 1px solid var(--line);
    margin: 1.5rem 0;
}
.definition-list > div {
    display: grid;
    grid-template-columns: minmax(10rem, 0.85fr) minmax(0, 1.6fr);
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.definition-list code {
    font-size: 0.75rem;
    line-height: 1.8;
}
.definition-list span {
    font-size: 0.9rem;
    color: var(--muted);
}
.doc-boundary {
    background: var(--surface-raised);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}
.step-list {
    padding: 0;
    list-style: none;
}
.step-list li {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.step-list li > span {
    display: grid;
    place-items: center;
    flex: 0 0 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--line);
    font: 0.75rem var(--mono);
}
.step-list li p {
    font-size: 0.95rem;
}
.step-list strong,
.security-list strong {
    font-weight: 500;
}
.key-list {
    padding: 0;
    list-style: none;
}
.key-list li {
    padding: 0.5rem 0;
}
.key-list kbd {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    padding: 0.15rem 0.4rem;
}
.security-list {
    display: grid;
    gap: 1rem;
}
.security-list p {
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
}
.security-list strong {
    display: block;
    margin-bottom: 0.3rem;
}
.muted {
    color: var(--muted);
}
.article-page .site-header {
    border-bottom: 0;
}
.article-heading {
    border-top: 1px solid var(--line);
    padding: 3rem 0 3.5rem;
}
.article-heading .article-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font: 0.75rem/1.7 var(--mono);
    color: var(--muted);
}
.article-heading h1 {
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    line-height: 1.04;
    max-width: 60rem;
    margin: 2rem 0;
    letter-spacing: -0.055em;
}
.article-deck {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 47rem;
}
.decision-strip {
    background: var(--surface-raised);
    border-block: 1px solid var(--line);
    padding: 1.25rem 0;
}
.decision-strip .wrap {
    display: flex;
    align-items: baseline;
    gap: 2rem;
}
.decision-strip strong {
    font: 0.75rem/1.6 var(--mono);
    flex-shrink: 0;
}
.decision-strip p {
    font-size: 0.95rem;
}
.article-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 4rem;
    padding-top: 3rem;
    padding-bottom: 4rem;
}
.article-body {
    max-width: 48rem;
    min-width: 0;
    font-size: 1.075rem;
    line-height: 1.85;
}
.article-body section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}
.article-body h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 1.5rem;
}
.article-body h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
    letter-spacing: -0.025em;
}
.article-body p {
    margin: 1rem 0;
}
.article-body ul {
    padding-left: 1.25rem;
}
.article-body li {
    padding-left: 0.4rem;
    margin: 0.5rem 0;
}
.article-body strong {
    font-weight: 600;
}
.article-body a {
    overflow-wrap: anywhere;
}
.article-body .lead {
    font-size: 1.25rem;
}
.article-body .article-callout {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    background: var(--surface-raised);
    font-size: 0.95rem;
}
.architecture-page .article-heading {
    padding-bottom: 2rem;
}
.architecture-page .article-body {
    max-width: none;
    font-size: 1rem;
    line-height: 1.7;
    padding-bottom: 3rem;
}
.architecture-page .article-body h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.architecture-page .article-body section > p {
    max-width: 52rem;
}
.decision-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: left;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.decision-table caption {
    text-align: left;
    font: 0.75rem/1.6 var(--mono);
    color: var(--muted);
    padding-bottom: 0.75rem;
}
.decision-table th,
.decision-table td {
    vertical-align: top;
    border-block: 1px solid var(--line);
    padding: 1.25rem;
    font-weight: 400;
}
.decision-table thead {
    background: var(--surface-raised);
    font: 0.75rem/1.6 var(--mono);
}
.decision-table th:first-child {
    width: 34%;
}
.decision-table th:nth-child(2) {
    width: 28%;
}
.decision-table tbody th a {
    font-weight: 600;
}
.decision-table tbody p {
    margin: 0.5rem 0 0;
}
.delegation-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    background: var(--surface-raised);
}
.article-body .delegation-flow li {
    margin: 0;
    padding: 1.25rem;
}
.delegation-flow li + li {
    border-left: 1px solid var(--line);
}
.delegation-flow span,
.delegation-flow strong {
    display: block;
}
.delegation-flow span {
    font: 0.75rem/1.6 var(--mono);
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.delegation-flow p {
    font-size: 0.9rem;
    margin-bottom: 0;
}
.research-appendix {
    border-block: 1px solid var(--line);
    margin: 0 0 2rem;
    padding: 1.25rem 0;
}
.research-appendix > summary {
    cursor: pointer;
    font-weight: 600;
}
.research-appendix > summary span {
    font: 0.75rem/1.6 var(--mono);
    color: var(--muted);
    margin-left: 1rem;
}
@media (max-width: 700px) {
    .decision-table caption {
        display: block;
    }
    .decision-table,
    .decision-table tbody,
    .decision-table tr,
    .decision-table th,
    .decision-table td {
        display: block;
        width: auto;
    }
    .decision-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .decision-table tr {
        border-top: 1px solid var(--line);
        padding: 1rem 0;
    }
    .decision-table tbody th:first-child,
    .decision-table td {
        width: auto;
        border: 0;
        padding: 0.5rem 0;
    }
    .decision-table td::before {
        display: block;
        font: 0.7rem/1.6 var(--mono);
        color: var(--muted);
        margin-bottom: 0.4rem;
    }
    .decision-table td:nth-child(2)::before {
        content: "Our decision";
    }
    .decision-table td:nth-child(3)::before {
        content: "In the current system";
    }
    .delegation-flow {
        grid-template-columns: 1fr;
    }
    .delegation-flow li + li {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}
.cost-model {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border: 1px solid var(--line);
    background: var(--surface);
}
.cost-model figcaption {
    font: 0.75rem/1.6 var(--mono);
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.cost-fraction {
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 1rem;
}
.cost-fraction span:first-child {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--text);
}
.cost-fraction span:last-child {
    padding-top: 0.75rem;
}
.cost-model > p {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0;
}
.evidence-card {
    border-top: 1px solid var(--line);
    padding: 1.5rem 0 0.5rem;
}
.evidence-card .source-meta {
    font: 0.7rem/1.7 var(--mono);
    color: var(--muted);
    margin: 0;
}
.evidence-card h3 {
    margin: 0.75rem 0;
}
.evidence-card p {
    font-size: 1rem;
}
.evidence-card .source-link {
    font-size: 0.85rem;
}
.evidence-card .source-link a {
    font-weight: 500;
}
.article-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: left;
    margin: 1.5rem 0;
}
.article-table th,
.article-table td {
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    padding: 1rem 0.75rem;
}
.article-table th {
    font: 0.7rem/1.7 var(--mono);
    background: var(--surface-raised);
}
.article-table td:first-child {
    font-weight: 500;
}
.article-table caption {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: left;
    padding-bottom: 1rem;
}
.feedback-figure {
    margin: 2rem 0;
    background: var(--dark);
    color: var(--text);
    padding: 1.5rem 2rem;
}
.feedback-figure figcaption {
    font: 0.75rem/1.5 var(--mono);
    color: var(--dark-muted);
    margin-bottom: 1.5rem;
}
.feedback-figure ol {
    padding: 0;
    list-style: none;
    counter-reset: loop;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}
.feedback-figure li {
    counter-increment: loop;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    margin: 0;
    font-size: 0.95rem;
}
.feedback-figure li::before {
    content: "0" counter(loop);
    font: 0.7rem var(--mono);
    color: var(--dark-muted);
    display: block;
    margin-bottom: 0.35rem;
}
.feedback-figure li.human-gate {
    color: var(--accent);
}
.feedback-figure p {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--dark-muted);
}
.proposal-label {
    display: inline-block;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    font: 0.7rem/1.6 var(--mono);
    padding: 0.4rem 0.6rem;
    margin-bottom: 1rem;
}
.article-endnote {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.article-next {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface-raised);
    border-block: 1px solid var(--line);
    padding: 1.5rem;
    text-decoration: none;
    font-size: 1rem;
}
.article-next:hover {
    text-decoration: underline;
}
@media (max-width: 1100px) {
    .wiki-layout,
    .article-layout {
        gap: 2.5rem;
        grid-template-columns: 12rem minmax(0, 1fr);
    }
}
@media (max-width: 800px) {
    .wiki-layout,
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding-top: 2rem;
    }
    .wiki-sidebar {
        position: static;
        border-bottom: 1px solid var(--line);
        padding-bottom: 1.5rem;
    }
    .wiki-sidebar nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem 1rem;
    }
    .wiki-sidebar nav a {
        font-size: 0.8rem;
    }
    .index-meta {
        display: none;
    }
    .wiki-intro h1 {
        font-size: 3.5rem;
    }
    .article-heading {
        padding: 2rem 0 2.5rem;
    }
    .article-heading h1 {
        font-size: 3rem;
    }
    .article-body {
        max-width: none;
    }
    .decision-strip .wrap {
        flex-direction: column;
        gap: 0.5rem;
    }
    .article-body section {
        scroll-margin-top: 1.5rem;
    }
}
@media (max-width: 600px) {
    .wiki-sidebar nav {
        grid-template-columns: 1fr 1fr;
    }
    .wiki-sidebar nav a {
        gap: 0.6rem;
    }
    .wiki-intro h1 {
        font-size: 3rem;
    }
    .wiki-summary,
    .article-deck {
        font-size: 1.1rem;
    }
    .doc-section {
        padding: 2rem 0;
    }
    .doc-section h2,
    .article-body h2 {
        font-size: 1.75rem;
    }
    .doc-section > header {
        gap: 0.7rem;
    }
    .definition-list > div {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .doc-terminal pre {
        padding: 1rem;
    }
    .doc-terminal pre code {
        font-size: 0.7rem;
    }
    .wiki-intro {
        padding-bottom: 2rem;
    }
    .article-heading h1 {
        font-size: clamp(2.25rem, 9vw, 3rem);
        margin: 1.5rem 0;
    }
    .article-heading .article-meta {
        flex-direction: column;
        gap: 0.4rem;
    }
    .article-body {
        font-size: 1rem;
    }
    .article-body .lead {
        font-size: 1.15rem;
    }
    .cost-model,
    .feedback-figure {
        padding: 1.25rem;
    }
    .cost-fraction {
        font-size: 0.9rem;
    }
    .article-body .article-callout {
        padding: 1rem;
    }
    .feedback-figure ol {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .article-table {
        min-width: 30rem;
    }
    .article-next {
        padding: 1.2rem;
    }
}
@media print {
    .wiki-sidebar,
    .decision-strip,
    .article-next {
        display: none;
    }
    .wiki-layout,
    .article-layout {
        display: block;
        padding: 0;
    }
    .wiki-content,
    .article-body {
        max-width: none;
    }
    .article-heading {
        padding: 1rem 0;
    }
    .article-heading h1 {
        font-size: 3rem;
    }
    .article-body {
        font-size: 11pt;
    }
    .article-body a::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        overflow-wrap: anywhere;
    }
    .article-body a[href^="#"]::after {
        content: "";
    }
    .feedback-figure {
        background: #fff;
        color: #000;
        border: 1px solid #aaa;
    }
    .feedback-figure li.human-gate,
    .feedback-figure p,
    .feedback-figure figcaption,
    .feedback-figure li::before {
        color: #333;
    }
    .article-table {
        min-width: 0;
    }
    .table-scroll {
        overflow: visible;
    }
}

/* Keep prose readable beside the document index. */
.doc-section > p,
.wiki-summary,
.article-deck {
    max-width: 65ch;
}
.wiki-sidebar a:hover,
.article-body a,
.doc-section a {
    color: var(--accent);
}
.wiki-release-note,
.doc-boundary,
.article-body .article-callout {
    border-left-width: 2px;
    background: var(--surface);
}
