/* ==========================================================================
   intel.innerpulse.net
   A reading-first reference publication. Light by default, dark on request.
   ========================================================================== */

:root {
    /* --- light --- */
    --paper:      #faf9f7;
    --surface:    #ffffff;
    --surface-2:  #f2f0ec;
    --rule:       #e4e0d8;
    --rule-2:     #cec8bc;
    --ink:        #14161b;
    --text:       #2e323b;
    --text-dim:   #565c69;
    --text-mute:  #868c9a;
    --accent:     #0d6a72;
    --accent-2:   #0a4f56;
    --accent-bg:  #e4f0f0;
    --amber:      #9a6410;
    --amber-bg:   #f7efe0;
    --danger:     #a33636;
    --ok:         #2c6e49;
    --shadow:     0 1px 2px rgba(20, 22, 27, 0.04), 0 8px 24px -12px rgba(20, 22, 27, 0.10);
    --shadow-lg:  0 2px 4px rgba(20, 22, 27, 0.05), 0 18px 40px -18px rgba(20, 22, 27, 0.18);

    --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Iowan Old Style", Charter, "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --page:    1400px;
    --column:  980px;
    /* Prose runs the full column width so it lines up with tables, charts
       and every other block. Leading is opened up to carry the longer line. */
    --measure: 100%;
    --radius:  8px;
    --radius-s: 5px;

    /* Back-compat aliases used by the admin templates. */
    --bg: var(--paper);
    --bg-alt: var(--surface-2);
    --border: var(--rule);
    --border-2: var(--rule-2);
}

:root[data-theme="dark"] {
    --paper:      #0c0f15;
    --surface:    #171c26;
    --surface-2:  #212734;
    --rule:       #2f3847;
    --rule-2:     #4a5568;
    --ink:        #f7f9fb;
    --text:       #dde3ec;
    --text-dim:   #b4bdcc;
    --text-mute:  #8e99ab;
    --accent:     #5fd0d9;
    --accent-2:   #8fdfe6;
    --accent-bg:  #103a42;
    --amber:      #d9a441;
    --amber-bg:   #2c2312;
    --danger:     #e58c8c;
    --ok:         #6fc08f;
    --shadow:     0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg:  0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--accent-bg); color: var(--ink); }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 32px; }

/* ---------- reading progress ---------- */

#progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--accent); z-index: 60; transition: width 90ms linear;
}

/* ---------- masthead ---------- */

.masthead {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--rule);
}

.masthead .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 30px; height: 30px; border-radius: 7px; flex: none;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: #fff; display: grid; place-items: center;
    font-family: var(--mono); font-size: 15px; font-weight: 700;
    box-shadow: var(--shadow);
}

.brand-text b {
    display: block; font-size: 15px; letter-spacing: 0.2em;
    color: var(--ink); font-weight: 650; line-height: 1.2;
}

.brand-text span { display: block; font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.02em; }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }

.nav a {
    color: var(--text-dim); font-size: 14px; padding: 7px 12px; border-radius: var(--radius-s);
    text-decoration: none; transition: background 120ms ease, color 120ms ease;
}

.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--accent); background: var(--accent-bg); font-weight: 550; }

.searchbar { position: relative; display: flex; }

.searchbar input[type="search"] { padding-left: 32px; width: 170px; transition: width 160ms ease; }
.searchbar input[type="search"]:focus { width: 230px; }

.searchbar::before {
    content: ""; position: absolute; left: 11px; top: 50%; width: 13px; height: 13px;
    transform: translateY(-50%); opacity: 0.5; pointer-events: none;
    background: currentColor; color: var(--text-mute);
    -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
            mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.theme-toggle {
    width: 34px; height: 34px; border-radius: var(--radius-s); flex: none;
    border: 1px solid var(--rule); background: var(--surface); color: var(--text-dim);
    display: grid; place-items: center; cursor: pointer; padding: 0;
    transition: border-color 120ms ease, color 120ms ease;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--rule-2); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- form controls ---------- */

input[type="text"], input[type="search"], input[type="number"], textarea, select {
    background: var(--surface);
    border: 1px solid var(--rule);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-s);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

input::placeholder, textarea::placeholder { color: var(--text-mute); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--rule-2); color: var(--text);
    padding: 9px 16px; border-radius: var(--radius-s); font-size: 14px; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.btn:hover { background: var(--surface-2); border-color: var(--text-mute); text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 550; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #08282c; }

.btn-ghost { background: transparent; border-color: var(--rule); }

/* ---------- generic page furniture ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 72px;
    padding: 40px 0 96px;
}

.page-head { padding: 48px 0 4px; }

.page-head h1 {
    margin: 0 0 8px; font-family: var(--serif); font-size: 38px; line-height: 1.15;
    letter-spacing: -0.015em; font-weight: 600; color: var(--ink);
}

.page-head p { margin: 0; color: var(--text-dim); font-size: 16px; }

.eyebrow {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 12px; font-weight: 500;
}

.section-label {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 26px;
}

.section-label h2 {
    margin: 0; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink); font-weight: 650;
}

.section-label span { font-size: 12.5px; color: var(--text-mute); text-align: right; }

/* ---------- lead story ---------- */

.lead { padding: 52px 0 40px; border-bottom: 1px solid var(--rule); }

.lead-inner { max-width: none; }

.lead-title { margin: 0 0 16px; font-family: var(--serif); font-size: 50px; line-height: 1.08; letter-spacing: -0.022em; font-weight: 600; }
.lead-title a { color: var(--ink); text-decoration: none; }
.lead-title a:hover { color: var(--accent); text-decoration: none; }

.lead-summary { margin: 0 0 22px; font-size: 18.5px; color: var(--text-dim); line-height: 1.55; font-family: var(--serif); }

.lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--text-mute); }

.lead-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: start; }

.lead-side { border-left: 1px solid var(--rule); padding-left: 32px; }

/* ---------- document list ---------- */

.year-group { margin-bottom: 44px; }

.year-label {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--text-mute);
    padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--rule);
}

.doc-item {
    display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 24px;
    padding: 22px 0; border-bottom: 1px solid var(--rule);
}

.doc-item:last-child { border-bottom: 0; }

.doc-date { font-family: var(--mono); font-size: 12px; color: var(--text-mute); padding-top: 5px; white-space: nowrap; }

.doc-title { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; line-height: 1.3; font-weight: 600; }
.doc-title a { color: var(--ink); text-decoration: none; }
.doc-title a:hover { color: var(--accent); }

.doc-summary { margin: 0 0 12px; color: var(--text-dim); font-size: 15.5px; line-height: 1.55; max-width: 68ch; }

/* ---------- tags ---------- */

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
    display: inline-flex; align-items: center; font-size: 12px; color: var(--text-dim);
    background: var(--surface-2); border: 1px solid transparent; border-radius: 999px;
    padding: 3px 11px; text-decoration: none; transition: all 120ms ease;
}

a.tag:hover { color: var(--accent); background: var(--accent-bg); text-decoration: none; }

.tag .count { color: var(--text-mute); margin-left: 6px; font-family: var(--mono); font-size: 11px; }

a.tag.topic-pill {
    color: var(--accent); background: transparent; border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    font-weight: 550;
}

a.tag.topic-pill:hover { background: var(--accent-bg); }

/* ---------- sidebar ---------- */

.sidebar { font-size: 14px; }
.side-block { margin-bottom: 36px; }

.side-block h3 {
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
    margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-weight: 650;
}

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.side-list a { color: var(--text-dim); text-decoration: none; }
.side-list a:hover { color: var(--accent); }
.side-list .count { color: var(--text-mute); font-family: var(--mono); font-size: 12px; }

/* ---------- topic cards ---------- */

.shelves { padding: 52px 0 8px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.topic-card {
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 24px; display: flex; flex-direction: column;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.topic-card:hover { border-color: var(--rule-2); box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.topic-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.monogram {
    width: 34px; height: 34px; border-radius: var(--radius-s); flex: none;
    display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 15px;
    background: var(--accent-bg); color: var(--accent);
}

.topic-card h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.topic-card h3 a { color: var(--ink); text-decoration: none; }
.topic-card h3 a:hover { color: var(--accent); }

.topic-desc { margin: -4px 0 16px; font-size: 13.5px; color: var(--text-mute); line-height: 1.5; }

.topic-links { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }

.topic-links li {
    display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
    padding: 8px 0; border-top: 1px solid var(--rule);
}

.topic-links li:first-child { border-top: 0; padding-top: 0; }
.topic-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; line-height: 1.4; }
.topic-links a:hover { color: var(--accent); }
.topic-links .when { font-family: var(--mono); font-size: 11px; color: var(--text-mute); flex: none; }

.topic-more { font-size: 13px; color: var(--accent); margin-top: auto; font-weight: 550; text-decoration: none; }

/* ==========================================================================
   Article
   ========================================================================== */

.article-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, var(--column));
    gap: 72px;
    padding: 0 0 96px;
    justify-content: center;
}

.article { min-width: 0; }

.article-head { padding: 52px 0 30px; margin-bottom: 36px; border-bottom: 1px solid var(--rule); }

.article-head h1 {
    margin: 0 0 18px; font-family: var(--serif); font-size: 44px; line-height: 1.12;
    letter-spacing: -0.022em; color: var(--ink); font-weight: 600;
}

.article-standfirst {
    margin: 0 0 24px; font-family: var(--serif); font-size: 20px; line-height: 1.55;
    color: var(--text-dim);
}

.article-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    font-size: 13px; color: var(--text-mute);
}

.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rule-2); }

/* --- body --- */

.article-body {
    font-family: var(--serif);
    font-size: 18.5px;
    line-height: 1.78;
    color: var(--text);
}

/* Text keeps a readable measure; tables and code use the full column. */
.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote,
.article-body > h2,
.article-body > h3,
.article-body > h4,
.article-body > hr { max-width: var(--measure); }

.article-body > p:first-of-type { font-size: 20px; line-height: 1.65; }

.article-body h2 {
    margin: 52px 0 16px; font-size: 27px; line-height: 1.25; letter-spacing: -0.015em;
    color: var(--ink); font-weight: 600; padding-top: 18px; border-top: 1px solid var(--rule);
}

.article-body h3 { margin: 34px 0 10px; font-size: 20px; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
.article-body h4 { margin: 26px 0 8px; font-size: 17px; color: var(--ink); font-weight: 650; }

.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--text-mute); }

.article-body strong { color: var(--ink); font-weight: 650; }

.article-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.article-body blockquote {
    margin: 0 0 24px; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
    color: var(--text-dim); font-style: italic;
}

.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
    font-family: var(--mono); font-size: 0.82em; background: var(--surface-2);
    border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; color: var(--ink);
}

.article-body pre {
    background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 18px 20px; overflow-x: auto; margin: 0 0 24px;
}

.article-body pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.6; }

.article-body hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* --- tables --- */

.table-wrap {
    margin: 0 0 28px; border: 1px solid var(--rule); border-radius: var(--radius);
    overflow-x: auto; background: var(--surface); box-shadow: var(--shadow);
}

.article-body table {
    width: 100%; border-collapse: collapse;
    font-family: var(--sans); font-size: 14.5px; line-height: 1.5; min-width: 480px;
}

.article-body thead th {
    position: sticky; top: 0; z-index: 1;
    text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); font-weight: 650; white-space: nowrap;
    padding: 13px 16px; background: var(--surface-2);
    border-bottom: 2px solid var(--rule-2);
}

.article-body tbody td { padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--text); }
.article-body tbody tr:last-child td { border-bottom: 0; }
.article-body tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.article-body tbody tr:hover { background: var(--accent-bg); }
.article-body td strong { color: var(--ink); font-weight: 650; }

/* Before/after arrows carry most of the meaning in balance tables. */
.article-body td .arrow { color: var(--accent); font-weight: 700; padding: 0 2px; }

/* ---------- key figures ---------- */

.figures {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px; margin: 0 0 28px; background: var(--rule);
    border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}

.figure { background: var(--surface); padding: 18px 20px; }

.figure-value {
    font-family: var(--sans); font-size: 28px; font-weight: 650; color: var(--ink);
    letter-spacing: -0.02em; line-height: 1.1;
}

.figure-label {
    font-family: var(--sans); font-size: 12px; color: var(--text-mute);
    margin-top: 6px; letter-spacing: 0.02em;
}

.figure-delta {
    display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 11.5px;
    padding: 1px 7px; border-radius: 999px;
}

.figure-delta.up   { color: var(--ok);      background: color-mix(in srgb, var(--ok) 12%, transparent); }
.figure-delta.down { color: var(--danger);  background: color-mix(in srgb, var(--danger) 12%, transparent); }
.figure-delta.flat { color: var(--text-mute); background: var(--surface-2); }

/* ---------- charts ---------- */

.chart {
    margin: 0 0 28px; padding: 20px 20px 12px; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}

.chart-title {
    font-family: var(--sans); font-size: 13px; font-weight: 650; color: var(--ink);
    letter-spacing: 0.01em; margin-bottom: 14px;
}

.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }

.chart-key {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--sans); font-size: 12px; color: var(--text-dim);
}

.chart-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

.chart-svg .grid       { stroke: var(--rule); stroke-width: 1; }
.chart-svg .axis-line  { stroke: var(--rule-2); stroke-width: 1; }
.chart-svg .axis       { fill: var(--text-mute); font-family: var(--sans); font-size: 11px; }
.chart-svg .row-label  { fill: var(--text-dim); font-size: 12px; }
.chart-svg .value      { fill: var(--text-dim); font-family: var(--sans); font-size: 11px; font-weight: 600; }
.chart-svg .bar        { transition: opacity 120ms ease; }
.chart-svg .bar:hover  { opacity: 0.78; }

.chart-note {
    font-family: var(--sans); font-size: 12px; color: var(--text-mute);
    margin: 12px 0 4px; line-height: 1.5;
}

/* Series palette, tuned to stay distinguishable in both themes. */
:root {
    --c1: #0d6a72;
    --c2: #b4671a;
    --c3: #4a5fa8;
    --c4: #7a6a2e;
    --c5: #8a4a6e;
    --c6: #3f7a52;
}

:root[data-theme="dark"] {
    --c1: #4ec2cb;
    --c2: #e0a057;
    --c3: #8fa2e8;
    --c4: #c9b661;
    --c5: #d492b5;
    --c6: #7fc396;
}

.chart-svg .slice { transition: opacity 120ms ease; }
.chart-svg .slice:hover { opacity: 0.8; }
.chart-svg .swatch { font-size: 15px; }
.chart-svg .donut-total {
    fill: var(--ink); font-family: var(--sans); font-size: 22px; font-weight: 650;
}

.figure-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.figure-note {
    font-family: var(--sans); font-size: 11.5px; color: var(--text-mute); line-height: 1.4;
}
.figure-foot .figure-delta { margin-top: 0; }

.sparkline { width: 80px; height: 24px; flex: none; overflow: visible; }

/* ---------- head-to-head ---------- */

.versus {
    margin: 0 0 28px; border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--surface); overflow: hidden; font-family: var(--sans);
}

.versus-head, .versus-row {
    display: grid; grid-template-columns: minmax(120px, 1.1fr) 1fr 42px 1fr;
    align-items: center; gap: 12px; padding: 12px 20px;
}

.versus-head {
    background: var(--surface-2); border-bottom: 2px solid var(--rule-2);
    font-size: 13px; font-weight: 650; color: var(--ink);
}

.versus-head .versus-side { font-size: 15px; }

.versus-row { border-bottom: 1px solid var(--rule); font-size: 15px; }
.versus-row:last-child { border-bottom: 0; }

.versus-label { font-size: 13px; color: var(--text-mute); }
.versus-value { color: var(--text); font-variant-numeric: tabular-nums; }
.versus-head .versus-side, .versus-row .versus-value { text-align: center; }

.versus-vs {
    text-align: center; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-mute);
}

.versus .chart-note { padding: 0 20px 14px; margin: 0; }

/* ---------- disclosure ---------- */

details.disclosure {
    margin: 0 0 26px; border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--surface); overflow: hidden;
}

details.disclosure > summary {
    cursor: pointer; padding: 13px 20px; font-family: var(--sans); font-size: 14px;
    font-weight: 600; color: var(--ink); list-style: none;
    display: flex; align-items: center; gap: 10px;
}

details.disclosure > summary::-webkit-details-marker { display: none; }

details.disclosure > summary::before {
    content: "›"; font-size: 17px; color: var(--text-mute); line-height: 1;
    transition: transform 140ms ease; transform-origin: center;
}

details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure > summary:hover { background: var(--surface-2); }

.disclosure-body { padding: 4px 20px 8px; border-top: 1px solid var(--rule); }
.disclosure-body > *:first-child { margin-top: 16px; }

/* ---------- callouts ---------- */

.callout {
    margin: 0 0 26px; padding: 16px 20px; border-radius: var(--radius);
    border: 1px solid var(--rule); border-left: 3px solid var(--text-mute);
    background: var(--surface); max-width: var(--measure);
}

.callout .callout-label {
    font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-mute); margin: 0 0 8px;
}

.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout p, .callout li { font-size: 0.95em; }

.callout-key     { border-left-color: var(--accent); background: var(--accent-bg); }
.callout-key .callout-label { color: var(--accent); }

.callout-warning { border-left-color: var(--amber); background: var(--amber-bg); }
.callout-warning .callout-label { color: var(--amber); }

.callout-tip     { border-left-color: var(--ok); }
.callout-tip .callout-label { color: var(--ok); }

/* ---------- timeline ---------- */

ol.timeline {
    list-style: none; margin: 0 0 30px; padding: 0 0 0 4px;
    max-width: var(--measure); position: relative;
}

ol.timeline::before {
    content: ""; position: absolute; left: 96px; top: 8px; bottom: 8px;
    width: 1px; background: var(--rule);
}

ol.timeline li {
    display: grid; grid-template-columns: 84px 1fr; gap: 28px;
    position: relative; padding: 0 0 20px 0; margin: 0;
}

ol.timeline li::before {
    content: ""; position: absolute; left: 92px; top: 8px; width: 9px; height: 9px;
    border-radius: 50%; background: var(--rule-2); border: 2px solid var(--paper);
}

ol.timeline li.is-highlight::before { background: var(--accent); }

.tl-date {
    font-family: var(--mono); font-size: 11.5px; color: var(--text-mute);
    text-align: right; padding-top: 3px; line-height: 1.5;
}

.tl-body { display: block; }
.tl-title { display: block; font-weight: 650; color: var(--ink); font-size: 0.95em; }
.tl-text  { display: block; color: var(--text-dim); font-size: 0.92em; margin-top: 3px; }

/* ---------- citations ---------- */

a.cite {
    display: inline-block; font-family: var(--sans); font-size: 0.62em; font-weight: 700;
    vertical-align: super; line-height: 1; color: var(--accent);
    background: var(--accent-bg); border-radius: 3px; padding: 2px 4px; margin: 0 1px;
    text-decoration: none;
}

a.cite:hover { background: var(--accent); color: var(--paper); text-decoration: none; }

/* ---------- code block language label ---------- */

.article-body pre[data-lang] { position: relative; padding-top: 34px; }

.article-body pre[data-lang]::before {
    content: attr(data-lang); position: absolute; top: 0; left: 0; right: 0;
    padding: 6px 16px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text-mute);
    background: color-mix(in srgb, var(--rule) 40%, transparent);
    border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0;
}

/* ---------- table extras ---------- */

.article-body td .delta { font-family: var(--sans); font-weight: 650; font-size: 0.95em; }
.article-body td .delta.up   { color: var(--ok); }
.article-body td .delta.down { color: var(--danger); }

.article-body tr.is-total td {
    background: var(--surface-2); font-weight: 650; color: var(--ink);
    border-top: 2px solid var(--rule-2);
}

/* ---------- contents rail ---------- */

.toc { position: sticky; top: 92px; align-self: start; padding-top: 52px; font-size: 13.5px; }

.toc-label {
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute);
    margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font-weight: 650;
}

.toc ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow-y: auto; }

.toc li a {
    display: block; padding: 5px 0 5px 14px; color: var(--text-mute); text-decoration: none;
    border-left: 2px solid var(--rule); line-height: 1.4;
    transition: color 120ms ease, border-color 120ms ease;
}

.toc li a:hover { color: var(--accent); border-left-color: var(--rule-2); text-decoration: none; }

.toc li a.is-current { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

.toc li.level-3 a { padding-left: 26px; font-size: 12.5px; }

/* ---------- sources ---------- */

.sources { margin-top: 56px; }

.sources h2 {
    margin: 0 0 18px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink); font-weight: 650; padding-bottom: 10px; border-bottom: 2px solid var(--ink);
    font-family: var(--sans);
}

.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.source-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s);
    text-decoration: none; font-family: var(--sans);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.source-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }

.source-num {
    width: 24px; height: 24px; border-radius: 5px; flex: none; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-mute);
    font-family: var(--mono); font-size: 11px; font-weight: 700;
}

.source-card:hover .source-num { background: var(--accent-bg); color: var(--accent); }

.source-title { display: block; color: var(--text); font-size: 14px; line-height: 1.4; margin-bottom: 3px; }
.source-site { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); }

/* ---------- article footer ---------- */

.article-foot { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }

.related-label {
    margin: 0 0 12px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink); font-weight: 650;
}

ul.related { list-style: none; margin: 0 0 32px; padding: 0; }

ul.related li {
    display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
    padding: 11px 0; border-bottom: 1px solid var(--rule);
}

ul.related a { color: var(--text-dim); text-decoration: none; }
ul.related a:hover { color: var(--accent); }
ul.related .when { font-family: var(--mono); font-size: 11px; color: var(--text-mute); flex: none; }

.provenance {
    display: block; margin-top: 16px; font-size: 12.5px; color: var(--text-mute);
    background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 14px;
}

/* ---------- misc ---------- */

.empty {
    border: 1px dashed var(--rule-2); border-radius: var(--radius); padding: 52px 32px;
    text-align: center; color: var(--text-mute); background: var(--surface);
}

.empty strong { display: block; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }

.notice {
    border: 1px solid var(--rule); border-left: 3px solid var(--text-mute); background: var(--surface);
    border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 24px; font-size: 14px;
}

.notice.error { border-left-color: var(--danger); background: var(--surface); color: var(--danger); }
.notice.ok    { border-left-color: var(--ok); }

.footer {
    border-top: 1px solid var(--rule); padding: 32px 0 56px; color: var(--text-mute);
    font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

.footer a { color: var(--text-mute); }
.footer a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; justify-content: stretch; }
    .toc { display: none; }
    .lead-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .lead-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 24px; }
}

@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 32px; }
}

@media (max-width: 720px) {
    .wrap { padding: 0 20px; }
    .masthead .wrap { min-height: 60px; gap: 12px; }
    .nav { width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 8px; }
    .searchbar input[type="search"], .searchbar input[type="search"]:focus { width: 140px; }

    .page-head h1 { font-size: 30px; }
    .lead { padding: 32px 0 28px; }
    .lead-title { font-size: 32px; }
    .lead-summary { font-size: 17px; }
    .lead-inner { max-width: none; }

    .article-head { padding: 32px 0 24px; }
    .article-head h1 { font-size: 31px; max-width: none; }
    .article-standfirst { font-size: 17.5px; }
    .article-body { font-size: 17.5px; }
    .article-body > p:first-of-type { font-size: 18.5px; }
    .article-body h2 { font-size: 23px; margin-top: 40px; }

    .doc-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .doc-date { padding-top: 0; }
    .doc-title { font-size: 19px; }

    .topic-grid, .source-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
    .masthead, .toc, .footer, #progress, .article-foot { display: none; }
    body { background: #fff; color: #000; }
    .article-layout { display: block; }
}
