/* CiteFight tokens. Components use tokens only; a skin overrides tokens. */
:root {
  --bg: #F5F6F9; --panel: #FFFFFF; --panel-2: #ECEEF3; --line: #DDE1E8; --floor: #E6E9F0;
  --fg: #1C2030; --muted: #646B7A; --accent: #4F5BD5; --on-accent: #FFFFFF; --accent-soft: #E8EAFC; --focus: #4F5BD5; --ai: #8A5BD5;
  --side-a: #2F6FD6; --side-a-soft: #E1EAFB; --side-b: #D9781C; --side-b-soft: #FBE8D3;
  --ok: #2E8B57; --warn: #B7791F; --danger: #C0392B;
  --font-ui: "Manrope", system-ui, sans-serif;
  --font-prose: "Literata", "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px; --toolbar-h: 40px; --topbar-h: 48px; --rail-w: 236px; --content-max: 1040px;
  /* reading size: fluid with the viewport (16px on small screens, 19px on wide), times the
     reader's A-/A+ choice (html[data-text]) */
  --prose-base: clamp(16px, 9px + 0.55vw, 19px); --text-scale: 1;
  --prose-size: var(--prose-base);
  --shadow-pop: 0 8px 24px rgba(20,25,50,.14);
  --pop-bg: #23273A; --pop-fg: #F3F4F9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171E; --panel: #1C1F28; --panel-2: #242834; --line: #2F3442; --floor: #0F1116;
    --fg: #E4E7EF; --muted: #9AA1B2; --accent: #8B95F0; --on-accent: #0F1116; --accent-soft: #262B4A; --focus: #8B95F0; --ai: #B79BF0;
    --side-a: #7FA6F2; --side-a-soft: #1F2C48; --side-b: #F0A45A; --side-b-soft: #47311C;
    --shadow-pop: 0 8px 24px rgba(0,0,0,.55); --prose-fg: #D6DAE4;
    --pop-bg: #343A4D; --pop-fg: #E9EBF2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171E; --panel: #1C1F28; --panel-2: #242834; --line: #2F3442; --floor: #0F1116;
  --fg: #E4E7EF; --muted: #9AA1B2; --accent: #8B95F0; --on-accent: #0F1116; --accent-soft: #262B4A; --focus: #8B95F0; --ai: #B79BF0;
  --side-a: #7FA6F2; --side-a-soft: #1F2C48; --side-b: #F0A45A; --side-b-soft: #47311C;
  --shadow-pop: 0 8px 24px rgba(0,0,0,.55); --prose-fg: #D6DAE4;
  --pop-bg: #343A4D; --pop-fg: #E9EBF2;
  color-scheme: dark;
}
/* Text size is per window: html carries the article's step, .drawer-body and each dockview
   panel carry their own (inheriting html's when unset); the scale zooms that window only. */
[data-text="-2"] { --text-scale: .85; } [data-text="-1"] { --text-scale: .93; } [data-text="0"] { --text-scale: 1; }
[data-text="1"] { --text-scale: 1.1; } [data-text="2"] { --text-scale: 1.22; } [data-text="3"] { --text-scale: 1.38; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the attribute must win over any display rule */
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-ui); }
html, body.shell-body { height: 100%; }
body.shell-body { display: flex; flex-direction: column; overflow: hidden; }
body.shell-body > .topbar, body.shell-body > .messages { flex: none; }
/* themed scrollbars (Chrome 121+, Firefox): a quiet thumb, no track */
* { scrollbar-color: color-mix(in srgb, var(--fg) 24%, transparent) transparent; }
*:hover { scrollbar-color: color-mix(in srgb, var(--fg) 36%, transparent) transparent; }
.rail, .drawer-body, .toc-col, textarea, pre, .suggest { scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--panel); padding: 6px 10px; border-radius: 6px; z-index: 300; }
.skip:focus { left: 8px; }

/* ---------- shell: topbar, rail, page ---------- */
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 17px; color: var(--fg); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--accent); }
.site-search { position: relative; flex: 1; min-width: 0; max-width: 560px; margin: 0 8px; }
.site-search input[type=search] { width: 100%; height: 34px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.site-search .search-go { position: absolute; right: 2px; top: 2px; height: 30px; padding: 0 8px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 120; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px 0; max-height: 60vh; overflow: auto; }
.suggest-hd { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.suggest-opt { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; cursor: pointer; }
.suggest-opt[aria-selected="true"], .suggest-opt:hover { background: var(--accent-soft); }
.suggest-hint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-links > a { color: var(--fg); text-decoration: none; white-space: nowrap; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 13.5px; }
.topbar-links > a[aria-current="page"] { background: var(--panel-2); color: var(--accent); }
.topbar-links .menu-items form button { width: 100%; }
.text-size { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.text-size button { font: inherit; font-size: 12px; padding: 0 7px; height: 26px; line-height: 26px; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; }
.text-size button:hover { background: var(--panel-2); color: var(--fg); }
.text-size button[data-text-reset] { font-weight: 700; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.text-size button[data-wide-toggle] { border-left: 1px solid var(--line); }
.text-size button[data-wide-toggle] svg { width: 14px; height: 14px; }
.text-size.sm { margin-left: auto; }
.text-size.sm button { height: 22px; line-height: 22px; min-width: 24px; padding: 0 5px; font-size: 11px; }
.drawer-hd .text-size.sm { margin-right: 4px; }
.text-size button.on, html:not([data-text]) .text-size:not(.sm) button[data-text-reset],
html[data-text^="-"] .text-size:not(.sm) button[data-text-step="-1"], html[data-text]:not([data-text^="-"]) .text-size:not(.sm) button[data-text-step="1"],
html[data-wide] .text-size button[data-wide-toggle] { background: var(--accent); color: var(--on-accent); }
html[data-wide] .page { max-width: none; }
html[data-wide] .messages { max-width: none; }
html[data-wide] .infobox { width: 380px; }
html[data-wide] .article-grid { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 700px) { .text-size { display: none; } }
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; min-height: 0; }
.main-scroll { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
/* side panel (editors, tools) as a third column; overlays the page on narrow screens */
:root { --drawer-w: 440px; --asst-w: 400px; }
html[data-drawer] .shell { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--drawer-w); }
html[data-drawer][data-rail="closed"] .shell { grid-template-columns: var(--rail-mini) minmax(0, 1fr) var(--drawer-w); }
html[data-drawer] .shell.no-rail { grid-template-columns: minmax(0, 1fr) var(--drawer-w); }
html[data-asst] .shell { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--asst-w); }
html[data-asst][data-rail="closed"] .shell { grid-template-columns: var(--rail-mini) minmax(0, 1fr) var(--asst-w); }
html[data-asst] .shell.no-rail { grid-template-columns: minmax(0, 1fr) var(--asst-w); }
html[data-drawer][data-asst] .shell { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--drawer-w) var(--asst-w); }
html[data-drawer][data-asst][data-rail="closed"] .shell { grid-template-columns: var(--rail-mini) minmax(0, 1fr) var(--drawer-w) var(--asst-w); }
html[data-drawer][data-asst] .shell.no-rail { grid-template-columns: minmax(0, 1fr) var(--drawer-w) var(--asst-w); }
.asst-drawer { background: var(--bg); }
.asst-drawer .drawer-hd { gap: 10px; }
/* each panel sizes its own text; the top bar's control reaches the article only */
.drawer-body:not([data-text]) { --text-scale: 1; }
.drawer-body.asst-body { padding-top: 0; padding-bottom: 0; display: flex; flex-direction: column; }
.asst-panel-hd { position: sticky; top: 0; z-index: 4; background: var(--panel-2); padding: 12px 16px 8px; margin: 0 -16px 8px; border-bottom: 1px solid var(--line); box-shadow: 0 6px 12px -8px rgba(0,0,0,.45); }
.asst-panel-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.asst-panel-more { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.asst-panel-more textarea { flex-basis: 100%; font-size: 12.5px; }
.asst-opt-wide { flex-basis: 100%; } .asst-opt-wide input { flex: 1 1 auto; min-width: 0; }
.asst-panel-actions { display: flex; gap: 8px; flex-basis: 100%; justify-content: flex-end; }
.asst-about-wrap { display: inline-flex; align-items: center; gap: 6px; }
.asst-topic { font-size: 12.5px; padding: 3px 8px; border-radius: 999px; width: 180px; }
.asst-about-go { font-size: 12px; color: var(--muted); }
.asst-list-note { margin: 10px 0 0; } .asst-list-links { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.asst-notes { display: grid; gap: 8px; margin-top: 14px; } .asst-notes li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.ib-note { color: var(--muted); }
.prop-row .t .num { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; margin-right: 2px; }
.asst-brief { width: 100%; min-height: 320px; font: 13px/1.5 var(--font-mono); }
.asst-body > .asst-panel { display: flex; flex-direction: column; flex: 1 0 auto; }
/* the jump arrow rides on the sticky composer, just above it */
.asst-jump { position: absolute; right: 8px; top: -46px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--fg); box-shadow: var(--shadow-pop); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.asst-jump:hover { color: var(--accent); border-color: var(--accent); }
[x-cloak] { display: none !important; }
.asst-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.asst-switch select { flex: 1 1 auto; min-width: 0; font-size: 12.5px; }
.tabs .asst-toggle { display: inline-flex; align-items: center; gap: 5px; }
html[data-asst] .tabs .asst-toggle { color: var(--accent); }
.drawer { position: relative; min-height: 0; display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: var(--panel); z-index: 20; }
.drawer-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.drawer-grip:hover, .drawer-grip:active { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.drawer-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-title { margin: 0; font: 700 14px var(--font-ui); }
.drawer-close { font-size: 20px; line-height: 1; padding: 2px 8px; }
.drawer-body { overflow: auto; padding: 14px 16px 40px; flex: 1; zoom: var(--text-scale); }
.drawer-body .block { border: 0; background: transparent; padding: 0; margin: 0; }
.drawer-body .block-hdr .n { color: var(--fg); font: 700 14px var(--font-ui); }
.tl-preview-tag { margin-left: 10px; color: var(--warn); font-family: var(--font-ui); }
.tl-section { scroll-margin-top: 12px; }
.article .block.is-editing-remote, .article .block.is-preview { outline: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); outline-offset: 4px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 5%, transparent); }
.article .block.is-preview .block-hdr .actions-article { display: none; }
.drawer-body .block-form textarea { min-height: 160px; }
/* side panel views: talk, history, links */
.panel-tabs { display: flex; align-items: center; gap: 2px; margin: -4px 0 12px; border-bottom: 1px solid var(--line); }
.panel-tab { font: 600 13px var(--font-ui); padding: 6px 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); cursor: pointer; }
.panel-tab:hover { color: var(--fg); }
.panel-tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.panel-tab .count { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 6px; }
.panel-full { margin-left: auto; padding: 0 4px; text-decoration: none; }
.panel-focus { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.panel-focus .mono, .panel-para .talk-para-hd .mono { color: var(--accent); text-decoration: none; padding-top: 2px; }
.panel-focus .talk-excerpt { flex: 1; font-size: 12.5px; }
.panel-para { padding: 10px 0; }
.panel-para:first-of-type { border-top: 0; }
.panel-compose-row { margin: 0 0 6px; }
.panel-composer:empty { display: none; }
.panel-composer { margin-bottom: 8px; }
.tabs-panel { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.panel-revs { display: grid; gap: 10px; }
.panel-rev { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.panel-rev-hd { font-size: 12.5px; margin-bottom: 6px; }
.panel-rev .diff-inline { white-space: pre-wrap; word-break: break-word; }
.panel-links h2 { font-size: 14px; margin: 12px 0 4px; }
.panel-links h3 { font-size: 13px; }
.panel-links .cols { columns: 1; }
@keyframes cf-flash { 0% { background: color-mix(in srgb, var(--accent) 28%, transparent); } 100% { background: transparent; } }
.article .block.is-flash { animation: cf-flash 1.5s ease-out; border-radius: 6px; }
.tl-section[data-preview] .timeline { outline: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); outline-offset: 6px; border-radius: 6px; }
@media (max-width: 1100px) {
  html[data-drawer] .shell, html[data-drawer][data-rail="closed"] .shell { grid-template-columns: minmax(0, 1fr); }
  .drawer { position: fixed; right: 0; top: var(--topbar-h); bottom: 0; height: auto; width: min(var(--drawer-w), 100vw); box-shadow: var(--shadow-pop); z-index: 95; }
  html[data-asst] .shell, html[data-asst][data-rail="closed"] .shell, html[data-drawer][data-asst] .shell { grid-template-columns: minmax(0, 1fr); }
  .asst-drawer { width: min(var(--asst-w), 100vw); z-index: 96; }
}
.shell.no-rail { grid-template-columns: minmax(0, 1fr); }
/* collapsed: a strip of icons that expands over the page while the pointer (or focus) is on it */
:root { --rail-mini: 52px; --rail-pad: 10px; }
/* the rail keeps one geometry in both states: icons sit at the same x whether collapsed,
   expanded on hover or pinned, so only the width and the labels animate */
html[data-rail="closed"] .shell { grid-template-columns: var(--rail-mini) minmax(0, 1fr); }
.rail { transition: width .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s; }
html[data-rail="closed"] .rail { width: var(--rail-mini); overflow: hidden; }
.rail-sec h2, .rail-sec > a span, .rail-browse, .rail-extra, .rail-pin { transition: opacity .18s ease .06s, transform .22s cubic-bezier(.2,.7,.2,1) .04s, visibility 0s; }
html[data-rail="closed"] .rail:not(.peek) .rail-sec h2, html[data-rail="closed"] .rail:not(.peek) .rail-sec > a span, html[data-rail="closed"] .rail:not(.peek) .rail-browse, html[data-rail="closed"] .rail:not(.peek) .rail-extra, html[data-rail="closed"] .rail:not(.peek) .rail-pin { opacity: 0; visibility: hidden; transform: translateX(-6px); transition: opacity .12s ease, transform .12s ease, visibility 0s .12s; }
.rail-sec h2 { white-space: nowrap; }
.rail-sec > a span { white-space: nowrap; }
/* stays in its 52px grid cell (so nothing else moves) and simply overflows over the page */
html[data-rail="closed"] .rail.peek { width: var(--rail-w); overflow: hidden auto; z-index: 90; box-shadow: var(--shadow-pop); }
.rail-hd { display: flex; align-items: center; gap: 6px; margin: -4px 0 4px; }
.topbar .rail-toggle { display: none; }
.rail .rail-toggle { display: inline-flex; flex: none; width: 32px; height: 32px; padding: 0; justify-content: center; margin-left: -1px; }
/* pin: outline when the menu only expands on hover, filled when it is pinned; click toggles */
.rail-pin { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: auto; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.rail-pin:hover, .rail-pin:focus-visible { background: var(--panel-2); color: var(--accent); outline: 0; }
.rail-pin svg { width: 16px; height: 16px; transition: transform .2s ease; }
.rail-pin[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.rail-pin[aria-pressed="true"] svg path:first-child { fill: currentColor; }
.rail-pin[aria-pressed="false"] svg { transform: rotate(35deg); }
.rail-sec > a svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.rail { position: relative; min-height: 0; overflow: hidden auto; padding: 12px var(--rail-pad) 24px; border-right: 1px solid var(--line); background: var(--panel); font-size: 13.5px; }
.rail-sec { margin-bottom: 14px; }
.rail-sec h2 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 8px 4px; }
.rail-sec > a { display: flex; align-items: center; gap: 10px; padding: 6px 7px; border-radius: 6px; color: var(--fg); text-decoration: none; }
.rail-sec > a:hover { background: var(--panel-2); }
.rail-sec > a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.rail-sec > a { position: relative; }
.rail-dot { flex: none; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--accent); }
html[data-rail="closed"] .rail:not(.peek) .rail-dot { position: absolute; left: 22px; top: 5px; margin: 0; }
.whats-new .prose h2 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.rail-browse .tree-wrap { padding: 0 4px; }
.page { max-width: var(--content-max); width: 100%; margin: 0 auto; padding: 22px 28px 60px; zoom: var(--text-scale); }
.page-wide { max-width: 1400px; }
.narrow { max-width: 348px; margin: 40px auto; }  /* 300px column + card padding: matches the Turnstile widget */
.card.narrow { padding: 24px; }
.messages { max-width: var(--content-max); margin: 12px auto 0; padding: 0 28px; }
@media (max-width: 1100px) {
  .topbar .rail-toggle { display: inline-flex; }
  .rail .rail-toggle, .rail-pin { display: none !important; }
  .rail { transition: none; }
  .shell, html[data-rail="closed"] .shell { grid-template-columns: minmax(0, 1fr); }
  html[data-rail="closed"] .rail { display: none; width: var(--rail-w); padding: 14px 10px 24px; overflow: auto; }
  .rail { display: none; position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: var(--rail-w); z-index: 90; box-shadow: var(--shadow-pop); }
  html[data-rail="open"] .rail { display: block; }
}
@media (max-width: 700px) {
  .page { padding: 16px 16px 48px; }
  .messages { padding: 0 16px; }
  .topbar-links > a:not(.btn) { display: none; }
  .brand span { display: none; }
}

/* ---------- plain pages ---------- */
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(20,25,50,.06); }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.form { display: grid; gap: 10px; }
.form-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.field { display: grid; gap: 4px; }
label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=datetime-local], input[type=url], input[type=number], input[type=date], input[type=search], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--bg); color: var(--fg); font: inherit; }
input:disabled { opacity: .6; }
.btn { font: inherit; font-size: 13px; padding: 7px 12px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--panel-2); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--fg); background: var(--panel-2); }
.form-errors, .field-errors, .errorlist { color: var(--danger); font-size: 12.5px; }
.form-errors ul { margin: 4px 0 0; padding-left: 18px; }
.errorlist { list-style: none; margin: 0; padding: 0; }
.msg { padding: 8px 12px; border-radius: calc(var(--radius) - 4px); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.msg-success { border-color: var(--ok); }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); }
.pill-open { color: var(--ok); } .pill-used { color: var(--muted); } .pill-expired, .pill-revoked { color: var(--danger); }
code.copy { font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; word-break: break-all; }
code.copy.copied { color: var(--ok); }
.cf-turnstile { margin: 4px 0; }
@media (max-width: 600px) { .table { display: block; overflow-x: auto; } }

/* ---------- topic pages: crumbs, tree, misc ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs .ns, h1 .ns { font-family: var(--font-mono); font-size: 12px; background: var(--panel-2); padding: 0 6px; border-radius: 4px; color: var(--muted); }
h1 .ns { font-size: 16px; vertical-align: middle; margin-right: 6px; }
.hatnote { font-size: 13px; color: var(--muted); font-style: italic; border-left: 3px solid var(--line); padding: 2px 10px; margin: 4px 0 8px; }
.byline { font-size: 12.5px; color: var(--muted); margin: -8px 0 12px; }
.lede { font-family: var(--font-prose); font-size: calc(var(--prose-size) * 1.1); line-height: 1.55; margin: 0 0 14px; color: var(--fg); text-align: justify; hyphens: auto; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 3px 0; }
.cols { columns: 2; column-gap: 32px; } .cols li { break-inside: avoid; }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 11.5px; }
.danger { color: var(--danger); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; border-left: 1px solid var(--line); }
.tree li { padding: 2px 0; }
.tree a { color: var(--fg); text-decoration: none; }
.tree a.cur { color: var(--accent); font-weight: 600; }
.tree summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: center; }
.tree summary::before { content: "▸"; color: var(--muted); font-size: 10px; transition: transform .15s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree .leaf { padding-left: 16px; display: block; }
.search { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--panel); color: var(--fg); font: inherit; margin-bottom: 8px; }
.backlinks .snippet { font-size: 12px; }
@media (max-width: 700px) { .cols { columns: 1; } }

/* ---------- blocks ---------- */
.blocks { display: grid; gap: 8px; }
.block { position: relative; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px 14px; }
.block:focus-visible, .block.is-selected { border-left-color: var(--accent); }
.block-heading .prose { font-size: 17px; font-weight: 600; }
.block-hdr { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); min-height: 22px; }
.block-hdr .actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.block:hover .block-hdr .actions, .block:focus-within .block-hdr .actions { opacity: 1; }
.block-hdr .btn { padding: 2px 7px; font-size: 12px; }
.prose { font-family: var(--font-prose); font-size: 15.5px; line-height: 1.6; }
.prose strong, .prose b { font-weight: 700; }
.prose a { color: var(--accent); }
.prose a.wikilink.auto { border-bottom-style: dotted; }
.prose a.wikilink.auto.quiet { color: inherit; border-bottom: 1px dotted color-mix(in srgb, var(--accent) 55%, transparent); }
.prose a.wikilink.auto.quiet:hover { color: var(--accent); }
.prose .nolink { border-bottom: 0; }
.prose p { margin: 4px 0; }
.prose :is(h2,h3,h4) { margin: 8px 0 4px; }
.prose code { font-family: var(--font-mono); font-size: 12.5px; background: var(--panel-2); padding: 1px 4px; border-radius: 3px; }
.prose pre { background: var(--panel-2); padding: 10px; border-radius: calc(var(--radius) - 4px); overflow-x: auto; }
.prose blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--line); padding: 4px 8px; }
.prose a.wikilink { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a.wikilink-missing { color: var(--danger); border-bottom-style: dashed; }
.prose a.wikilink-missing::after { content: "?"; font-size: 10px; vertical-align: super; }
.prose sup.cite a { color: var(--accent); text-decoration: none; font-size: 11px; }
.prose sup.cite-missing { color: var(--danger); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.block-form { display: grid; gap: 8px; }
.block-form textarea, .block-new textarea { width: 100%; min-height: 64px; resize: vertical; font: 14px/1.5 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--bg); color: var(--fg); }
.block-new { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.block-new select, .block-form select { width: auto; }
.preview:empty { display: none; }
.preview { border-top: 1px dashed var(--line); padding-top: 6px; }
.block-conflict { border-left-color: var(--danger); }
.diff-inline ins, .diff ins { background: color-mix(in srgb, var(--ok) 22%, transparent); text-decoration: none; }
.diff-inline del, .diff del { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.history-slot:empty { display: none; }
.history-slot { margin: 10px 0; }
.revs li { display: flex; gap: 8px; align-items: baseline; }
.diff-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); align-items: start; }
.diff-added .glyph { color: var(--ok); } .diff-removed .glyph { color: var(--danger); } .diff-edited .glyph { color: var(--warn); } .diff-moved .glyph { color: var(--accent); }
.diff-removed .diff-text { opacity: .7; text-decoration: line-through; }
.diff-unchanged .diff-text { opacity: .55; }
.wl-results { list-style: none; margin: 0; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); box-shadow: 0 6px 20px rgba(20,25,50,.12); }
.wl-results li { padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.wl-results li[aria-selected="true"], .wl-results li:hover { background: var(--panel-2); }

/* ---------- workspace ---------- */
.ws-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
html:has(> body.ws-body) { overflow: hidden; height: 100%; }
.ws-toolbar { display: flex; align-items: center; gap: 12px; height: var(--toolbar-h); padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13px; flex: none; }
.ws-toolbar .crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the wiki workspace: a rail of tools beside the dock; layouts in the toolbar */
.ws-main { flex: 1 1 auto; min-height: 0; display: flex; }
.ws-rail { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-right: 1px solid var(--line); background: var(--panel); }
.ws-rail button, .ws-rail a { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ws-rail button:hover, .ws-rail a:hover { background: var(--panel-2); color: var(--fg); }
.ws-rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-rail-sp { flex: 1; }
.ws-rail { overflow-y: auto; scrollbar-width: none; }
.ws-rail-sep { width: 28px; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
/* the site's links in the rail: icons, the name on hover (title), counts as a small badge */
.ws-rail-nav { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; }
.ws-rail-nav > a { position: relative; width: 44px; height: 40px; padding: 0; justify-content: center; border-radius: 10px; color: var(--muted); }
.ws-rail-nav > a:hover { background: var(--accent-soft); color: var(--fg); }
.ws-rail-nav > a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.ws-rail-nav > a > span:not(.nav-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-rail-nav > a svg { width: 19px; height: 19px; }
.ws-rail-nav .nav-count { position: absolute; top: 2px; right: 0; font-size: 10px; min-width: 16px; height: 16px; padding: 0 4px; }
.ws-rail-nav .rail-dot { position: absolute; top: 8px; right: 9px; }
.ws-layouts { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ws-layouts-k { font-weight: 800; letter-spacing: .08em; font-size: 10.5px; text-transform: uppercase; margin-right: 2px; }
.ws-layouts button { height: 24px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 12px var(--font-ui); cursor: pointer; }
.ws-layouts button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); font-weight: 700; }
.ws-toolbar .site-search { flex: 0 1 340px; }
.ws-body .drawer { position: fixed; right: 0; top: 48px; bottom: 0; height: auto; width: min(var(--drawer-w), 100vw); box-shadow: var(--shadow-pop); z-index: 95; }
.cf-panel .topic-page { padding: 0; }
.cf-panel > .article-grid, .cf-panel > article, .cf-panel .panel-inner { padding: 16px 20px; }
/* in a dock panel the article reflows to the panel's width, not the window's */
.cf-panel[data-kind="article"] { container-type: inline-size; }
/* the assistant pins its header and composer to the panel's edges: no padding for text to
   scroll through above or below them */
.cf-panel[data-kind="assistant"], .ws-body .cf-panel[data-kind="assistant"] { padding: 0; background: var(--bg); overflow: hidden; }
/* in a panel only the conversation scrolls: header and composer are fixed frames above and below
   it, so the scrollbar runs beside the messages alone (the full page keeps one page scroller) */
.cf-panel[data-kind="assistant"] > .asst-panel, #asst-body > .asst-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.cf-panel[data-kind="assistant"] .asst-panel-hd, #asst-body .asst-panel-hd { position: static; flex: 0 0 auto; }
.cf-panel[data-kind="assistant"] .asst-thread, #asst-body .asst-thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cf-panel[data-kind="assistant"] .asst-msgs, #asst-body .asst-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 6px; }
.cf-panel[data-kind="assistant"] .asst-compose, #asst-body .asst-compose { position: relative; flex: 0 0 auto; }
#asst-drawer .drawer-body.asst-body { overflow: hidden; }
/* long links and words wrap instead of widening the conversation */
.asst-answer, .asst-bubble, .asst-plan-text, .asst-trail .det { overflow-wrap: anywhere; }
.asst-answer pre { white-space: pre-wrap; }
.asst-msgs, .asst-msg { min-width: 0; }
#asst-drawer .drawer-body.asst-body { background: var(--bg); }
.cf-panel[data-kind="assistant"] > .asst-panel { padding: 0 14px; min-height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
.cf-panel[data-kind="assistant"] .asst-panel-hd { margin: 0 -14px 8px; padding: 10px 14px 8px; background: var(--panel-2); box-shadow: 0 6px 12px -8px rgba(0,0,0,.45); }
.cf-panel[data-kind="assistant"] .asst-compose { margin: 0 -14px; padding: 10px 14px 12px; background: var(--panel-2); box-shadow: 0 -6px 12px -8px rgba(0,0,0,.45); }
.cf-panel[data-kind="assistant"] .asst-compose textarea, .cf-panel[data-kind="assistant"] .asst-panel-hd select { background: var(--panel); }
/* the contents list lives in its own panel in the workspace; the article gives the prose its width */
.cf-panel[data-kind="article"] .toc-col { display: none; }
.cf-panel[data-kind="article"] .article-grid { grid-template-columns: minmax(0, 1fr); }
.cf-panel[data-kind="contents"] .toc h3 { margin-top: 0; }
.cf-panel[data-kind="contents"] .toc { position: static; max-height: none; }
/* Home in the workspace: Recent changes has its own panel, so the body does not repeat it */
.cf-panel[data-kind="home"] [aria-labelledby="h-changes"] { display: none; }
.cf-panel[data-kind="home"] .home { padding: 8px 12px; }
/* the side-panel fragment's own Talk/History/Links row: the dock's tabs do that job here */
.cf-panel .panel-view > .panel-tabs { display: none; }
.ws-toolbar .crumb a { color: var(--muted); text-decoration: none; } .ws-toolbar .crumb b { color: var(--fg); font-weight: 500; }
.tb-sp { flex: 1; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: 100%; z-index: 50; min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,25,50,.14); padding: 6px; display: grid; }
.menu-items button, .menu-items a { font: inherit; text-align: left; background: none; border: 0; color: var(--fg); padding: 6px 8px; border-radius: 4px; cursor: pointer; text-decoration: none; }
.menu-items button:hover, .menu-items a:hover { background: var(--panel-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; background: var(--panel-2); }
.live-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.live-status.on i { background: var(--ok); } .live-status.reconnecting i { background: var(--warn); }
.presence { display: inline-flex; gap: 4px; }
#dock { flex: 1; min-height: 0; }
.cf-dock-theme {
  --dv-group-view-background-color: var(--bg);
  --dv-tabs-and-actions-container-background-color: var(--panel-2);
  --dv-tabs-container-scrollbar-color: var(--line);
  --dv-activegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-activegroup-hiddenpanel-tab-background-color: var(--panel-2);
  --dv-inactivegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-inactivegroup-hiddenpanel-tab-background-color: var(--panel-2);
  --dv-tab-divider-color: var(--line);
  --dv-activegroup-visiblepanel-tab-color: var(--fg);
  --dv-activegroup-hiddenpanel-tab-color: var(--muted);
  --dv-inactivegroup-visiblepanel-tab-color: var(--fg);
  --dv-inactivegroup-hiddenpanel-tab-color: var(--muted);
  --dv-separator-border: var(--line);
  --dv-paneview-header-border-color: var(--line);
  --dv-icon-hover-background-color: var(--panel-2);
  --dv-floating-box-shadow: 0 8px 24px rgba(20,25,50,.2);
  --dv-active-sash-color: var(--accent);
  --dv-sash-color: transparent;
  --dv-drag-over-background-color: color-mix(in srgb, var(--accent) 18%, transparent);
  --dv-drag-over-border-color: var(--accent);
  --dv-tabs-and-actions-container-font-size: 12px;
  --dv-tabs-and-actions-container-height: 32px;
  --dv-tab-close-icon: none;
  --dv-paneview-active-outline-color: var(--focus);
  --dv-group-gap-size: 4px;
  --dv-overlay-z-index: 999;
  --dv-background-color: var(--bg);
  --dv-border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-ui);
}
.cf-dock-theme .dv-tab { font-family: var(--font-ui); }
/* workspaces as cards on a floor: each group a rounded panel with a gap around it, its tab bar
   darker than the panel, the visible tab lit by an accent underline (the design canvas look) */
.ws-body .cf-dock-theme {
  --dv-group-gap-size: 6px;
  --dv-background-color: var(--floor);
  --dv-group-view-background-color: var(--panel);
  --dv-tabs-and-actions-container-background-color: var(--bg);
  --dv-tabs-and-actions-container-height: 36px;
  --dv-tabs-and-actions-container-font-size: 12.5px;
  --dv-activegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-inactivegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-activegroup-hiddenpanel-tab-background-color: transparent;
  --dv-inactivegroup-hiddenpanel-tab-background-color: transparent;
  --dv-tab-divider-color: transparent;
  --dv-separator-border: transparent;
}
.ws-body #dock { background: var(--floor); padding: 6px; box-sizing: border-box; }
.ws-body .cf-dock-theme .dv-groupview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ws-body .cf-dock-theme .dv-tabs-and-actions-container { border-bottom: 1px solid var(--line); }
.ws-body .cf-dock-theme .dv-tab { font-weight: 600; padding: 0 14px; border-right: 1px solid var(--line); }
.ws-body .cf-dock-theme .dv-tab.dv-active-tab { box-shadow: inset 0 -2px 0 var(--accent); }
.ws-body .cf-dock-theme .dv-groupview:not(.dv-active-group) .dv-tab.dv-active-tab { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 45%, transparent); }
.ws-body .cf-dock-theme .dv-tab:hover { color: var(--fg); }
.ws-body .cf-panel { background: var(--panel); }
.ws-body .ws-toolbar { height: 48px; background: var(--panel); }
.ws-body .ws-toolbar .brand { font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: var(--fg); text-decoration: none; }
.ws-body .ws-toolbar .brand span { color: var(--accent); }
.ws-body .ws-rail { background: var(--floor); border-right: 0; padding-top: 10px; }
.ws-body .ws-rail button:hover, .ws-body .ws-rail a:hover { background: var(--accent-soft); color: var(--fg); }
.cf-panel { height: 100%; overflow: auto; padding: 10px 12px; background: var(--panel); zoom: var(--text-scale); }
.dv-right-actions-container .text-size.sm { margin: 0 6px 0 0; align-self: center; }
.cf-panel.is-loading { opacity: .6; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pos-panel .document { max-width: 72ch; }
/* sides */
.side-a { --sc: var(--side-a); --ss: var(--side-a-soft); } .side-b { --sc: var(--side-b); --ss: var(--side-b-soft); }
.side-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--sc); background: var(--ss); padding: 1px 7px; border-radius: 4px; line-height: 18px; }
.side-tag svg { width: 9px; height: 9px; fill: currentColor; }
.block.side-a, .block.side-b { border-left-color: var(--sc); }
.block.is-selected { background: var(--ss, var(--panel-2)); outline: 2px solid var(--sc, var(--accent)); outline-offset: -1px; }
.nbadge { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 11px; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.lock-slot:empty, .viewers:empty { display: none; }
.chip-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; border: 1px dashed var(--line); border-radius: 999px; padding: 0 7px; }
/* notes */
.notes-list { display: grid; gap: 8px; }
.note { border: 1px solid var(--line); border-left: 3px solid var(--sc, var(--line)); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; background: var(--panel); }
.note-reply { margin-left: 16px; border-left-style: solid; }
.note-resolved { opacity: .7; }
.note-ai-draft { border-style: dashed; --sc: var(--ai); }
.note-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-who strong { color: var(--fg); }
.note .anchor, .note-form .anchor, .block-quote { margin: 4px 0 6px; padding: 4px 8px; border-left: 2px solid var(--sc, var(--line)); background: var(--panel-2); color: var(--muted); font-size: 12.5px; }
.note .anchor.stale { text-decoration: line-through; }
.note-body { font-size: 13.5px; }
.note-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.note-actions .btn, .btn.small { padding: 2px 8px; font-size: 12px; }
.replies { margin-top: 6px; display: grid; gap: 6px; }
.note-form { display: grid; gap: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 8px; background: var(--panel); }
.note-form textarea, .note-editing textarea { width: 100%; font: 13px/1.5 var(--font-mono); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); resize: vertical; }
.anchor-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill-dispute { color: var(--danger); } .pill-question { color: var(--warn); } .pill-support { color: var(--ok); } .pill-comment { color: var(--muted); }
.pill-ai { color: var(--ai); }
.pill-open { color: var(--ok); } .pill-closed { color: var(--danger); } .pill-draft { color: var(--muted); }
.members-side { margin-bottom: 12px; } .members-side h3 { margin: 0 0 4px; font-size: 13px; }
.stack-side { margin-top: 20px; }
@media (max-width: 1023px) { .ws-body { height: auto; overflow: auto; } }

/* ---------- citations ---------- */
.block-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; font-size: 11.5px; }
.block-foot:empty { display: none; }
.cite-item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.cite-item .cite-k { color: var(--accent); text-decoration: none; font-weight: 600; }
.cite-item .cite-t { color: var(--fg); }
.cite-x { padding: 0 4px; font-size: 12px; line-height: 1; }
.cite-add { padding: 0 6px; font-size: 11.5px; }
.cite-form { display: grid; gap: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.cite-form input[type=url] { flex: 1; }
.cite-confirm { display: grid; gap: 8px; margin-top: 8px; padding: 12px; }
.cite-fmt { font-family: var(--font-prose); font-size: 13px; }
.cite-list { padding-left: 20px; margin: 0; font-size: 13px; display: grid; gap: 8px; }
.src-list li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.src-list a { color: var(--fg); text-decoration: none; font-weight: 500; }
.pill-pending { color: var(--warn); } .pill-ok { color: var(--ok); } .pill-failed { color: var(--danger); } .pill-manual { color: var(--muted); }
.warn { color: var(--warn); }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.prose sup.cite a { color: var(--accent); }

/* ---------- live ---------- */
.chip-user { font-size: 11.5px; }
.viewer { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 9.5px; font-weight: 700; margin-right: 2px; }
.stale-banner { padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 15%, transparent); margin-bottom: 6px; }
[aria-disabled="true"] { opacity: .5; }
.wl-menu { position: relative; z-index: 20; }
.wl-menu .wl-results { position: absolute; left: 0; right: 0; top: 2px; max-height: 220px; overflow: auto; margin: 0; }

/* ---------- graph ---------- */
.graph-panel { display: flex; flex-direction: column; height: 100%; min-height: 360px; }
.graph-svg { flex: 1; width: 100%; min-height: 300px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.graph-page .graph-panel { height: 70vh; }
.gl { stroke: var(--muted); opacity: .7; }
.gl-child { stroke: var(--line); opacity: 1; }
.gn circle, .gn path { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.gn-debate path { fill: var(--side-b); }
.gn-focus circle { fill: var(--fg); }
.gn text { font: 11.5px var(--font-ui); fill: var(--fg); pointer-events: none; }
.gn:focus-visible circle, .gn:focus-visible path { outline: none; stroke: var(--focus); stroke-width: 3; }
.legend .lg { margin: 0 6px 0 2px; } .lg-topic { color: var(--accent); } .lg-debate { color: var(--side-b); }
.chip-ai { color: var(--ai); border-color: color-mix(in srgb, var(--ai) 40%, var(--line)); }
.chip-error { color: var(--danger); }
.ai-menu summary { padding: 2px 7px; font-size: 12px; }
.ai-menu .menu-items { left: 0; right: auto; }
.block-jobs:empty { display: none; }

/* ---------- manage ---------- */
.manage-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
.manage-nav { display: grid; gap: 2px; align-content: start; }
.manage-nav h2 { font: 700 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px 10px; }
.manage-nav h2:first-child { margin-top: 2px; }
.manage-nav a { color: var(--fg); text-decoration: none; padding: 5px 10px; border-radius: 6px; }
.manage-nav a:hover { background: var(--panel-2); }
.manage-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; } .stat span { color: var(--muted); font-size: 12px; }
.stat-warn b { color: var(--warn); }
.manage-topic-forms { display: grid; gap: 6px; padding: 6px 0 8px 16px; }
.manage-topic-forms input[type=text] { width: auto; min-width: 180px; }
button.pill { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 11.5px; }
@media (max-width: 800px) { .manage-layout { grid-template-columns: 1fr; } .manage-nav { display: flex; flex-wrap: wrap; gap: 4px; } .manage-nav h2 { flex-basis: 100%; margin: 8px 0 0 4px; } }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ---------- auto lists + topic-page notes ---------- */
.autolist-items { margin: 4px 0 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.autolist-items li { break-inside: avoid; padding: 2px 0; }
.autolist-head { margin: 0 0 4px; }
.doc-notes { margin-top: 18px; }
@media (max-width: 700px) { .autolist-items { columns: 1; } }

/* ---------- article mode (topic pages) ---------- */
/* Heading hierarchy: H2 large with a rule, H3 medium, H4 small caps. Space above a heading is
   padding on its block so the § mark in the gutter lines up with the heading text. */
.block-h { font-family: var(--font-ui); font-size: calc(var(--prose-size) * 1.75); font-weight: 800; margin: 0; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.block-h.h2 { font-size: calc(var(--prose-size) * 1.75); font-weight: 800; margin: 0; display: block; }  /* .h2 is also a utility class */
.block-h.h3 { font-size: calc(var(--prose-size) * 1.5); font-weight: 800; letter-spacing: -.015em; }
.block-h.h4 { font-size: calc(var(--prose-size) * 1.25); font-weight: 700; letter-spacing: -.01em; }
.article .blocks { gap: 0; }
/* sections indent by level: --depth is set per block from its § label (0 for H2 sections) */
.article .block { position: relative; background: transparent; border: 0; border-left: 0; border-radius: 0; padding: 4px 0 4px calc(60px + var(--depth, 0) * 28px); margin: 0; }
.article .block + .block { margin-top: 10px; }
.article .block-heading { padding-top: 38px; padding-bottom: 2px; }
.article .block-heading:first-child { padding-top: 8px; }
.article .block-heading .block-h.h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.article .block-heading:has(.h3) { padding-top: 26px; }
.article .block-heading:has(.h4) { padding-top: 20px; }
.article .block-heading + .block-text { margin-top: 6px; }
.article .block-heading:has(.h2) + .block-text { margin-top: 10px; }
.article .block-heading .block-hdr { top: 44px; }
.article .block-heading:has(.h3) .block-hdr { top: 32px; }
.article .block-heading:has(.h4) .block-hdr { top: 24px; }
.article .block-heading:first-child .block-hdr { top: 12px; }
.article .block .prose { font-size: var(--prose-size); line-height: 1.7; text-align: justify; hyphens: auto; text-wrap: pretty; font-optical-sizing: auto; color: var(--prose-fg, var(--fg)); }
.article .block .prose :is(li, blockquote, pre, table) { text-align: left; }
.article .block:first-of-type .prose { font-size: calc(var(--prose-size) * 1.06); }
.article .block-hdr { position: absolute; left: calc(var(--depth, 0) * 28px); top: 6px; width: 52px; min-height: 0; gap: 0; }
.article .block-hdr .n { color: var(--muted); opacity: .45; font-size: 10.5px; letter-spacing: -.02em; white-space: nowrap; }
.article .block-hdr .meta, .article .block-hdr .side-tag { display: none; }
.article .block-hdr .actions { position: absolute; right: 0; left: auto; top: -26px; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; box-shadow: 0 4px 14px rgba(20,25,50,.12); z-index: 5; white-space: nowrap; }
.article .block:hover .block-hdr .n, .article .block:focus-within .block-hdr .n, .article .block.is-selected .block-hdr .n { opacity: 1; color: var(--accent); }
.article .block:hover, .article .block:focus-within { background: color-mix(in srgb, var(--panel-2) 55%, transparent); border-radius: 6px; }
.article .block.is-selected { background: var(--panel-2); outline: 0; box-shadow: none; }
.article .block.is-selected::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }
.article .block-hdr .nbadge, .article .block-hdr .lock-slot, .article .block-hdr .viewers { position: absolute; left: 48px; top: 28px; }
.article .block-hdr .nbadge { left: auto; right: 0; top: -2px; }
.article .block-foot { padding-left: 0; font-size: 12px; margin-top: 2px; }
.article .cite-add { opacity: 0; }
.article .block:hover .cite-add, .article .block:focus-within .cite-add { opacity: 1; }
.article .block-new { margin-left: 48px; margin-top: 16px; }
.article .block-editing { padding-left: 48px; }
.article .autolist { margin: 4px 0 8px; }
.article .empty { margin-left: 48px; }

/* ---------- dialog + nav ---------- */
.cf-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg); padding: 18px 20px; max-width: 420px; box-shadow: 0 16px 48px rgba(20,25,50,.25); }
.cf-dialog::backdrop { background: rgba(10,12,20,.45); }
.cf-dialog-form { display: grid; gap: 14px; }
.cf-dialog-msg { margin: 0; font-size: 14px; }
.cf-dialog-title { margin: 0; font: 700 15px var(--font-ui); }
.cf-dialog .btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.cf-dialog-actions { flex-wrap: wrap; }
.cf-dialog-actions { justify-content: flex-end; }

/* ---------- references ---------- */
.references { margin-top: 24px; }
/* the list reads as interface text at its normal size, not as article prose; the page's
   A-/A+ zoom still applies to it like everything else */
.ref-list { padding-left: 24px; margin: 6px 0 0; display: grid; gap: 6px; font: 14px/1.5 var(--font-ui); }
.ref-list li { padding-left: 4px; }
.ref-list .cite-fmt { font-family: var(--font-ui); font-size: 14px; }
.ref-list blockquote.anchor { font-family: var(--font-prose); }
.ref-list li:target { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); border-radius: 4px; }
.ref-back { text-decoration: none; color: var(--accent); margin-right: 4px; }
.ref-backs { margin-right: 6px; }
.ref-backs .ref-back { margin-right: 0; padding: 0 3px; font-size: 11.5px; font-style: italic; }
.ref-backs .ref-back:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 3px; }
.ref-unplaced li { padding: 2px 0; }
.ref-quotes { list-style: none; margin: 4px 0 0; padding: 0 0 0 10px; display: grid; gap: 4px; border-left: 2px solid var(--line); }
.ref-quotes li { padding-left: 2px; } .ref-quotes li:target { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); border-radius: 4px; }
.ref-quotes blockquote.anchor { display: inline; margin: 0; }
.ref-letter { display: inline-block; min-width: 14px; color: var(--accent); font-weight: 600; font-size: 12px; }
.prose sup.cite.is-flash { animation: cf-flash 1.2s ease-out; }
@keyframes cf-flash { from { background: color-mix(in srgb, var(--accent) 35%, transparent); } to { background: transparent; } }

/* ---------- article page: head, tabs, grid, toc, editor ---------- */
.article-head { margin-bottom: 4px; }
.article-head h1 { font-family: var(--font-prose); font-size: calc(var(--prose-size) * 2.1); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; margin: 2px 0 6px; }
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; font-size: 13.5px; }
.tabs > a { padding: 7px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; white-space: nowrap; }
.tabs > a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--panel-2); border-radius: 999px; padding: 0 6px; }
.tabs-sp { flex: 1; }
.tabs .btn, .tabs .menu { margin-bottom: 4px; }
.tabs .menu-items { min-width: 180px; }
.article-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 32px; align-items: start; }
.toc-col { position: sticky; top: 16px; max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; }
.toc { font-size: 13px; }
.toc h3 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 10px; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc li a:hover { color: var(--fg); }
.toc li a[aria-current="location"] { color: var(--fg); font-weight: 700; border-left-color: var(--accent); }
.toc li.lvl-3 a { padding-left: 22px; font-size: 12.5px; } .toc li.lvl-4 a { padding-left: 34px; font-size: 12px; }
.toc .toc-n { color: var(--muted); font-size: 11px; margin-right: 2px; }
.ed-group { display: inline-flex; } .ed-group button + button { margin-left: -1px; }
/* in-place section editor */
.article .section-editor { padding-top: 12px; padding-bottom: 12px; }
/* the editor's bar: row one says what the line is and where to save, row two is the word
   processor set; Insert (or / on an empty line) opens one searchable list of everything else */
.section-editor { position: relative; }
.sec-head { container-type: inline-size; position: sticky; top: 0; z-index: 6; margin-bottom: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); font-family: var(--font-ui); }
.sec-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px 6px 14px; }
.sec-row2 { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 5px 8px 6px 10px; border-top: 1px solid var(--line); }
.sec-head .grow { flex: 1; }
.sec-head .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.sec-head .hint { font-size: 11px; color: var(--muted); padding-right: 4px; }
.sec-title { font-weight: 800; font-size: 13px; white-space: nowrap; }
.sec-title .mono { font-size: 11.5px; }
.sec-head .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; }
.sec-head .seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: 700 12.5px var(--font-ui); cursor: pointer; white-space: nowrap; }
.sec-head .seg button:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.sec-head .seg button.on { background: var(--accent); color: var(--bg); }
.sec-head .ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); cursor: pointer; font: 700 13px var(--font-ui); }
.sec-head .ico .serif { font-family: var(--font-prose); }
.sec-head .ico:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }
.sec-head .ico.on, .sec-head .ico[aria-expanded="true"] { background: var(--accent); color: var(--bg); }
.sec-head .ico svg { display: block; }
.sec-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sec-head kbd { font: 500 11px var(--font-mono); opacity: .7; }
.sec-insert { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 9px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font: 800 12.5px var(--font-ui); cursor: pointer; }
.sec-insert:hover, .sec-insert[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.sec-insert svg { display: block; }
.sec-row1 .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.sec-menu, .sec-chars { position: absolute; z-index: 20; width: 400px; max-width: calc(100% - 16px); background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.45); overflow: hidden; }
.sec-menu-q { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.sec-menu-q input { flex: 1; border: 0; background: transparent; color: var(--fg); font: 600 13.5px var(--font-ui); outline: 0; }
.sec-menu-q kbd { border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.sec-menu-list { max-height: 360px; overflow: auto; padding: 6px; }
.sec-menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); text-align: left; cursor: pointer; font-family: var(--font-ui); }
.sec-menu-list button.on { background: color-mix(in srgb, var(--fg) 9%, transparent); outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.sec-menu-list .ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.sec-menu-list .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sec-menu-list .t b { font-size: 13px; }
.sec-menu-list .t small { font-size: 11.5px; color: var(--muted); }
.sec-menu-foot { display: flex; gap: 14px; padding: 8px 14px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.sec-chars { left: 8px; top: 100%; width: 440px; padding: 10px 12px 0; }
.sec-chars-t { font: 700 11px var(--font-ui); color: var(--muted); padding: 6px 2px 4px; }
.sec-chars-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; margin-bottom: 6px; }
.sec-chars-row button { height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: 500 17px var(--font-prose); cursor: pointer; }
.sec-chars-row button:hover { border-color: var(--accent); color: var(--accent); }
.sec-chars .sec-menu-foot { margin: 4px -12px 0; }
/* the bubble above selected words, and the tools above the table the caret is in */
.sec-bubble { position: absolute; z-index: 15; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--pop-bg); color: var(--pop-fg); border-radius: 10px; box-shadow: var(--shadow-pop); font-family: var(--font-ui); white-space: nowrap; }
.sec-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--pop-bg); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.sec-bubble.below::after { bottom: auto; top: -5px; }
/* in a narrow column (beside the infobox) the segments and Insert show their short form */
.sec-head .seg .short { display: none; font-weight: 800; }
@container (max-width: 820px) {
  .sec-head .seg .long, .sec-insert kbd, .sec-title .muted { display: none; }
  .sec-head .seg .short { display: inline; }
  .sec-head .seg button { padding: 0 9px; min-width: 34px; }
}
.sec-bubble button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--pop-fg); font: 700 12.5px var(--font-ui); cursor: pointer; }
.sec-bubble button b { font-size: 15px; } .sec-bubble button .serif { font-family: var(--font-prose); font-size: 15px; }
.sec-bubble button:hover { background: color-mix(in srgb, var(--pop-fg) 16%, transparent); }
.sec-bubble button.primary { background: var(--pop-fg); color: var(--pop-bg); }
.sec-bubble .sep { width: 1px; height: 18px; background: color-mix(in srgb, var(--pop-fg) 25%, transparent); margin: 0 3px; }
.sec-tabletools { position: absolute; z-index: 15; display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-pop); font-family: var(--font-ui); white-space: nowrap; }
.sec-tabletools .lbl { font: 800 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 0 6px; }
.sec-tabletools button { height: 28px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: 700 12px var(--font-ui); cursor: pointer; }
.sec-tabletools button:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }
.sec-tabletools button.danger { color: var(--danger); }
.sec-tabletools .sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.sec-surface table { width: 100%; margin: 10px 0; }
.sec-surface td, .sec-surface th { min-width: 3em; vertical-align: top; }
.sec-surface th { font-family: var(--font-ui); font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
.sec-surface td:focus-within, .sec-surface th:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.sec-surface { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 10px; border-radius: 4px; min-height: 80px; caret-color: var(--accent); }
.sec-surface:focus { outline-style: solid; }
.sec-surface > * + * { margin-top: 10px; }
.sec-surface .block-h { margin-top: 18px; }
.sec-surface .block-h.h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sec-surface .sec-block > p:first-child { margin-top: 0; } .sec-surface .sec-block > p:last-child { margin-bottom: 0; }
.sec-surface .sec-atom { position: relative; opacity: .85; outline: 1px dashed var(--line); outline-offset: 4px; border-radius: 4px; cursor: default; }
.sec-surface .sec-atom:hover, .sec-surface .sec-atom:focus { outline-color: var(--accent); opacity: 1; }
.sec-surface .sec-atom.is-selected { outline: 2px solid var(--accent); opacity: 1; }
.sec-surface .sec-atom a { cursor: default; }
.sec-atom-x { position: absolute; top: -10px; right: -10px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.sec-surface .sec-atom:hover .sec-atom-x, .sec-surface .sec-atom.is-selected .sec-atom-x, .sec-surface .sec-atom:focus .sec-atom-x { opacity: 1; }
.sec-atom-x:hover { color: var(--danger); border-color: var(--danger); }
.sec-surface sup.cite { user-select: all; }
/* timeline sections in the editor: a badge on the heading, rows with a date chip, the settings card */
.sec-surface [data-tl]::after { content: "timeline"; display: inline-block; vertical-align: middle; margin-left: 10px; font: 700 11px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px; }
.sec-entry { display: grid; grid-template-columns: 110px minmax(0, 1fr) 26px; gap: 8px 10px; align-items: start; padding: 6px 4px; border-radius: 8px; cursor: default; }
.sec-entry:not(.tl-entry) .tl-date { position: static; width: auto; text-align: left; }
.sec-entry:not(.tl-entry) .tl-dot { display: none; }
.sec-entry:hover, .sec-entry:focus-within { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sec-entry .text { padding: 4px 6px; border-radius: 6px; outline: none; min-height: 32px; }
.sec-entry .text:focus { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.sec-entry .text > p { margin: 0; }
.sec-entry > .x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; padding: 6px 4px; border-radius: 6px; }
.sec-entry:hover > .x, .sec-entry:focus-within > .x { opacity: 1; }
.sec-entry > .x:hover { color: var(--danger); background: var(--panel-2); }
.sec-entry .daterow { grid-column: 2; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; border-bottom: 0; background: var(--panel-2); font-family: var(--font-ui); font-size: 12.5px; }
.sec-entry .daterow .dr { display: inline-flex; align-items: center; gap: 6px; }
.sec-entry .daterow .dr-l { font-weight: 700; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sec-entry .daterow .tl-star { color: var(--accent); }
.sec-entry .daterow.is-bad { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--panel-2)); }
.sec-entry .daterow .dr-err { font-size: 12px; }
.sec-timeline .sec-add-after { position: absolute; right: 0; bottom: 2px; font: 600 11px var(--font-ui); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); cursor: pointer; opacity: 0; }
.sec-timeline .sec-entry:hover .sec-add-after, .sec-timeline .sec-entry:focus-within .sec-add-after, .sec-timeline .sec-add-after:focus-visible { opacity: 1; }
.sec-timeline .sec-add-after:hover { color: var(--accent); border-color: var(--accent); }
.sec-entry .daterow label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sec-entry .daterow input[type=checkbox] { accent-color: var(--accent); }
.sec-tlconfig { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; cursor: default; opacity: 1; }
.sec-tlconfig .tracks { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.sec-tlconfig .track { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-ui); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.sec-tlconfig .track i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.sec-tlconfig .track i.c-blue { background: var(--accent); } .sec-tlconfig .track i.c-orange { background: #d98f3a; } .sec-tlconfig .track i.c-green { background: var(--ok); } .sec-tlconfig .track i.c-violet { background: #a06ad4; } .sec-tlconfig .track i.c-teal { background: #3aa6a0; }
/* a timeline section edits as the timeline itself: entries where they stand, dates as
   buttons in the margin, gaps, moments and track lanes redrawn by the server on change */
.sec-tl-group { cursor: default; }
.sec-tlconfig-empty { justify-content: space-between; }
.sec-timeline { margin: 14px 0 4px 48px; }
.sec-timeline .sec-entry { display: block; padding: 0 0 22px; border-radius: 0; }
.sec-timeline .sec-entry.range { padding-bottom: 30px; }
.sec-timeline .sec-entry:hover, .sec-timeline .sec-entry:focus-within { background: transparent; }
.sec-timeline .sec-entry .text { min-height: 38px; padding: 6px 30px 6px 10px; border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 0 0 8px 8px; background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.sec-timeline .sec-entry > .x { top: 40px; }
.sec-timeline .sec-entry .text:focus { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.sec-timeline .sec-entry > .x { position: absolute; right: 2px; }
.sec-timeline .tl-loose { position: relative; padding-bottom: 14px; }
.sec-timeline .tl-moment { opacity: .75; }
.sec-timeline .tl-moment:hover { opacity: 1; }
.sec-timeline > .sec-add-entry { margin: 4px 0 6px calc(var(--tracks) * 64px + var(--date-w) + var(--gap)); }
.sec-source { width: 100%; font: 13px/1.5 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.sec-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.article-col { min-width: 0; }
.article-editor { display: grid; gap: 8px; }
.article-editor textarea { width: 100%; min-height: 360px; font: 14px/1.6 var(--font-mono); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--fg); resize: vertical; }
.ed-toolbar { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-toolbar button { font: inherit; font-size: 12.5px; min-width: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--fg); cursor: pointer; }
.ed-toolbar button:hover { background: var(--panel); }
.cite-slot:empty { display: none; }
.talk-para { border-top: 1px solid var(--line); padding: 12px 0; }
.talk-para-hd { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.talk-para-hd .mono { color: var(--accent); text-decoration: none; padding-top: 2px; }
.talk-excerpt { flex: 1; font-size: 13px; }
.talk-para:target, .note:target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.talk .chips { margin-bottom: 10px; }
@media (max-width: 860px) { .article-head h1 { font-size: 28px; } }

/* ---------- infobox ---------- */
.infobox { float: right; width: 320px; max-width: 100%; margin: 0 0 18px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 13.5px; box-shadow: 0 1px 2px rgba(20,25,50,.05); overflow: hidden; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox caption { font-weight: 800; font-size: 17px; padding: 12px 14px 8px; text-align: left; caption-side: top; }
.infobox .ib-img { padding: 4px 14px 8px; text-align: center; }
.infobox .ib-img img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.infobox th { width: 38%; text-align: left; vertical-align: top; padding: 8px 14px; background: var(--panel-2); font-weight: 700; border-top: 1px solid var(--line); color: var(--fg); font-size: 13px; }
.infobox td { padding: 8px 14px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.infobox .ib-sec th { width: auto; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; letter-spacing: .01em; padding: 6px 14px; }
.infobox .ib-empty { color: var(--muted); margin-right: 4px; }
.infobox .ib-add { padding: 2px 9px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); }
.infobox .ib-edit, .infobox .ib-cite { padding: 0 6px; font-size: 11px; opacity: 0; float: right; }
.infobox tr:hover .ib-edit, .infobox tr:focus-within .ib-edit,
.infobox tr:hover .ib-cite, .infobox tr:focus-within .ib-cite { opacity: 1; }
@media (hover: none) { .infobox .ib-edit, .infobox .ib-cite { opacity: 1; } }
.infobox .ib-editing .ib-cite { float: none; opacity: 1; }
.ib-cite-hint { margin: 0; }
.infobox .ib-req { color: var(--warn); }
.infobox .ib-hidden th { text-decoration: line-through; color: var(--muted); }
.infobox .ib-foot td { font-size: 12px; color: var(--muted); background: var(--panel-2); }
.infobox .ib-form { display: grid; gap: 6px; }
.infobox .ib-form textarea, .infobox .ib-form input, .infobox .ib-form select { font-size: 13px; padding: 5px 8px; }
.infobox .ib-form label { font-weight: 600; color: var(--fg); }
.infobox-preview { float: none; width: auto; margin: 0 0 12px; }
.infobox a.wikilink-missing { color: var(--danger); }
.article .blocks { display: block; }
.article .block { display: flow-root; }
/* when the real column is too narrow for prose beside the infobox (small window or big text) */
#article-main { container-type: inline-size; }
.article-col { container-type: inline-size; }
@container (max-width: 720px) { .article-grid { grid-template-columns: minmax(0, 1fr); } .toc-col { position: static; max-height: none; margin-bottom: 14px; } .toc ol { display: flex; flex-wrap: wrap; gap: 2px 10px; border-left: 0; } }
@container (max-width: 560px) { .infobox { float: none; width: 100%; margin: 0 0 18px; } }

/* ---------- see also, relations, debates box, catbar ---------- */
.see-also, .relations, .debates-box { margin-top: 26px; }
.see-also-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; }
.see-also h3, .debates-box h3 { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.debates-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; }
.debates-box .block-h { border-bottom: 0; font-size: 16px; margin: 0 0 6px; }
.debates-box .btn { margin-top: 8px; }
.catbar { margin-top: 28px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.catbar-lbl { font-weight: 700; color: var(--muted); }
.catbar a { color: var(--accent); text-decoration: none; }
.catbar a.cat-rule { text-decoration: underline dotted; text-underline-offset: 3px; }
.catbar .cat-item { display: inline-flex; align-items: center; gap: 2px; }
.catbar .cat-x { border: 0; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; padding: 0 3px; cursor: pointer; border-radius: 4px; }
.catbar .cat-x:hover { color: var(--danger); background: var(--panel); }
.catbar-add input { width: 160px; padding: 3px 8px; font-size: 12.5px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; }
.catbar-add { position: relative; }
.category-page .cat-desc { margin-bottom: 8px; }
.rule-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; margin: 14px 0 22px; font-size: 13.5px; }
.rule-panel h2 { margin: 0; font-size: 15px; }
.rule-text { margin: 8px 0 4px; font-size: 14px; }
.rule-form { display: grid; gap: 8px; }
.rule-form textarea { font: 13px/1.5 var(--font-mono); }
.h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.h2 small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.chip .n { color: var(--muted); }
.letters { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--font-mono); font-size: 12px; margin: 10px 0 6px; }
.letters a { padding: 2px 6px; border-radius: 4px; color: var(--fg); text-decoration: none; }
.letters a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.cat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; }
.cat-card .th { aspect-ratio: 3 / 2; display: grid; place-items: center; background: var(--panel-2); overflow: hidden; }
.cat-card .th img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .th .ini { font-family: var(--font-prose); font-size: 40px; color: var(--muted); }
.cat-card .bd { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.cat-card .bd a { font-weight: 700; color: var(--fg); text-decoration: none; }
.cat-card .bd small { color: var(--muted); font-size: 12px; }
.cat-card .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cat-card .cat-x { padding: 0 5px; font-size: 12px; }
.cat-add { margin-top: 14px; position: relative; } .cat-add input { max-width: 320px; }
.autolist-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-family: var(--font-ui); }
.autolist-table th, .autolist-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.autolist-table thead th { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.autolist-table .col-number { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- search, changes, links, source ---------- */
.search-page form { margin-bottom: 16px; } .search-page input[type=search] { flex: 1; min-width: 200px; }
.search-page select { width: auto; }
.search-results { padding-left: 20px; display: grid; gap: 10px; }
.search-results .snippet { font-family: var(--font-prose); font-size: 14px; color: var(--muted); }
.search-results mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; }
.search-exact { font-size: 15px; }
.changes-day { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px; }
.change { display: grid; grid-template-columns: 44px 20px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); align-items: baseline; font-size: 13.5px; }
.change .glyph { text-align: center; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .chip { text-decoration: none; color: var(--fg); }
.chips .chip[aria-current="page"], .chips .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.links-groups section { margin-bottom: 20px; }
.links-groups h2 { font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.source-wrap { position: relative; }
.source-wrap .copy-source { position: absolute; right: 8px; top: 8px; }
pre.source { font: 13px/1.55 var(--font-mono); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; }
.page-narrow { max-width: 60ch; }

/* ---------- talk by selection ---------- */
.seltool { position: fixed; z-index: 200; display: flex; align-items: center; gap: 2px; padding: 5px 6px; background: var(--pop-bg); color: var(--pop-fg); border: 1px solid var(--pop-bg); border-radius: 10px; box-shadow: var(--shadow-pop); font-family: var(--font-ui); }
.seltool::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--pop-bg); transform: translateX(-50%) rotate(45deg); }
.seltool.is-menu { flex-direction: column; align-items: stretch; gap: 1px; }
.seltool.is-menu::after { display: none; }
.seltool button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--pop-fg); cursor: pointer; white-space: nowrap; text-align: left; line-height: 1; }
.seltool button:hover, .seltool button:focus-visible { background: color-mix(in srgb, var(--pop-fg) 16%, transparent); outline: 0; }
.seltool .glyph { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--pop-fg) 14%, transparent); color: var(--pop-fg); }
.seltool .g-dispute { color: #FF7B6B; } .seltool .g-question { color: #F5C451; } .seltool .g-support { color: #6EDC9A; }
.seltool-sep { width: 1px; height: 18px; background: color-mix(in srgb, var(--pop-fg) 30%, transparent); margin: 0 3px; }
.seltool-where { font-size: 11px; color: color-mix(in srgb, var(--pop-fg) 70%, transparent); padding: 0 8px 0 4px; }
.seltool-close { padding: 0 !important; width: 30px; height: 30px; justify-content: center; border-radius: 50% !important; background: color-mix(in srgb, var(--pop-fg) 16%, transparent) !important; color: var(--pop-fg) !important; }
.seltool-close:hover, .seltool-close:focus-visible { background: var(--danger) !important; color: #fff !important; }
mark.anchor { background: transparent; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.anchor-dispute { text-decoration-style: wavy; text-decoration-color: var(--danger); }
.anchor-question { text-decoration-style: dotted; text-decoration-color: var(--warn); }
.anchor-support { text-decoration-style: solid; text-decoration-color: var(--ok); }
.anchor-comment { text-decoration-style: dashed; text-decoration-color: var(--muted); }
mark.anchor.is-resolved { text-decoration-thickness: 1px; opacity: .75; }
mark.anchor.is-hover, mark.anchor:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: 0; }
mark.anchor.is-active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.anchor-tag { font: 600 10px/1.4 var(--font-mono); vertical-align: super; margin-left: 2px; padding: 0 4px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--fg); background: var(--panel); }
.anchor-tag-dispute { border-color: var(--danger); } .anchor-tag-question { border-color: var(--warn); } .anchor-tag-support { border-color: var(--ok); }
.anchor-tag.is-resolved { border-style: dashed; color: var(--muted); }
.anchor-flag { display: inline-flex; font: 600 10px/1.4 var(--font-mono); padding: 0 5px; border-radius: 999px; border: 1px dashed var(--danger); color: var(--danger); cursor: pointer; }
.talk-inline { margin: 6px 0 10px 48px; }
.talk-inline:empty { display: none; }
.talk-inline .note { font-size: 13px; }

/* ---------- quote embeds ---------- */
.quote-embed { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 6px 6px 0; }
.quote-embed > p:first-child { margin-top: 0; }
.quote-src { margin: 4px 0 0 !important; font-size: 12px; color: var(--muted); }
.quote-src a { color: var(--accent); }
.topic-panel .references { margin-top: 16px; }

/* ---------- timeline sections ---------- */
.timeline { position: relative; margin: 10px 0 24px 48px; --date-w: 96px; --gap: 44px; --tracks: 0; }
.tl-spine { position: relative; padding-left: calc(var(--tracks) * 64px + var(--date-w) + var(--gap)); }
.tl-spine::before { content: ""; position: absolute; left: calc(var(--tracks) * 64px + var(--date-w) + 20px); top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.tracks-head { display: flex; padding-left: 0; margin-bottom: 4px; font: 800 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tracks-head span { width: 64px; text-align: center; white-space: normal; line-height: 1.15; font-size: 10px; padding: 0 2px; box-sizing: border-box; }
.tl-entry, .tl-moment { position: relative; padding-bottom: 22px; }
.tl-entry.range { padding-bottom: 30px; }
.tl-date { position: absolute; left: calc(-1 * (var(--date-w) + var(--gap))); top: 2px; width: var(--date-w); text-align: right; font-family: var(--font-ui); font-weight: 800; font-size: 15px; color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.2; }
.tl-date small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.tl-date-end { top: auto; bottom: 14px; }
.tl-dot { position: absolute; left: calc(-1 * var(--gap) + 14px); top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.tl-entry.range .tl-dot { border-radius: 6px; height: auto; width: 8px; left: calc(-1 * var(--gap) + 16px); bottom: 24px; background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); border: 0; }
.tl-entry.range .tl-dot::before, .tl-entry.range .tl-dot::after { content: ""; position: absolute; left: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tl-entry.range .tl-dot::before { top: -4px; } .tl-entry.range .tl-dot::after { bottom: -4px; }
.tl-entry.uncertain { --uc: color-mix(in srgb, var(--accent) 80%, black); }
.tl-entry.uncertain .tl-dot { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); box-shadow: none; border: 2px dashed var(--uc); box-sizing: border-box; width: 14px; height: 14px; left: calc(-1 * var(--gap) + 13px); }
.tl-entry.uncertain.range .tl-dot { width: 10px; height: auto; left: calc(-1 * var(--gap) + 15px); background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.tl-entry.uncertain.range .tl-dot::before, .tl-entry.uncertain.range .tl-dot::after { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); border: 2px dashed var(--uc); box-sizing: border-box; width: 14px; height: 14px; left: -4px; }
.tl-entry.key .tl-dot, .tl-moment.key .tl-dot { width: 20px; height: 20px; left: calc(-1 * var(--gap) + 10px); top: 0; border-radius: 0; background: transparent; box-shadow: none; border: 0; }
.tl-entry.key .tl-dot::before, .tl-moment.key .tl-dot::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; line-height: 1; color: var(--accent); }
.tl-entry.key .tl-date { font-size: 17px; }
/* a key range keeps its bar; the star marks the start date at the top of it */
.tl-entry.range.key .tl-dot { width: 8px; height: auto; top: 9px; bottom: 24px; left: calc(-1 * var(--gap) + 16px); border-radius: 6px; background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.tl-entry.range.key .tl-dot::before { content: "★"; position: absolute; left: 50%; top: -10px; width: 18px; height: 18px; transform: translateX(-50%); border: 0; border-radius: 50%; box-sizing: border-box; background: var(--accent); display: grid; place-items: center; font-size: 12px; line-height: 1; color: #000; padding-bottom: 1px; }
/* uncertain: the dashed circle stays, with the star inside it */
.tl-entry.uncertain.range.key .tl-dot { width: 10px; left: calc(-1 * var(--gap) + 15px); background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.tl-entry.uncertain.range.key .tl-dot::before { width: 20px; height: 20px; top: -11px; background: var(--bg); border: 2px dashed var(--uc); color: var(--accent); font-size: 12px; }
.tl-entry.key .block-body > p:first-child::first-line { font-weight: 600; }
.tl-moment { font-family: var(--font-prose); font-size: var(--prose-size); line-height: 1.6; padding-bottom: 22px; color: var(--prose-fg, var(--fg)); }
.tl-moment .tl-date { top: 2px; }
.tl-moment .tl-dot { width: 12px; height: 12px; top: 9px; left: calc(-1 * var(--gap) + 14px); background: var(--fg); box-shadow: 0 0 0 2px var(--fg); border: 2px solid var(--bg); }
.tl-moment.key .tl-dot { top: 4px; }
.tl-moment-text { font-weight: 600; } .tl-moment-text a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
/* a long stretch with no entry: the spine breaks (chart-style cut) and a dashed rule with a
   label runs across the whole row; track lanes keep going, eras do not pause */
.tl-gap { height: 44px; position: relative; margin: 2px 0 6px; }
.tl-gap::before { content: ""; position: absolute; left: calc(-1 * var(--gap) + 12px); top: 4px; width: 18px; height: 36px; background: var(--bg); }
.tl-gap .tl-cut { position: absolute; left: calc(-1 * var(--gap) + 12px); top: 6px; width: 18px; height: 32px; background: linear-gradient(var(--muted), var(--muted)) 8px 0 / 2px 8px no-repeat, linear-gradient(var(--muted), var(--muted)) 8px 24px / 2px 8px no-repeat; }
.tl-gap .tl-cut::before, .tl-gap .tl-cut::after { content: ""; position: absolute; left: 1px; width: 16px; height: 2px; background: var(--muted); transform: rotate(-30deg); }
.tl-gap .tl-cut::before { top: 11px; } .tl-gap .tl-cut::after { top: 19px; }
.tl-gap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
/* with track columns the rule also runs left, behind the lanes, to the outer column's edge */
.has-tracks .tl-gap::after { left: calc(-1 * (var(--tracks) * 64px + var(--date-w) + var(--gap))); z-index: 0; }
.has-tracks .track-col { z-index: 1; }
.has-tracks .tl-gap::before, .has-tracks .tl-gap .tl-cut, .has-tracks .tl-gap span { z-index: 2; }
.tl-gap span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font: 600 11.5px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tl-end { position: relative; height: 18px; }
.tl-end span { position: absolute; left: calc(-1 * (var(--date-w) + var(--gap))); width: var(--date-w); text-align: right; font: 600 11px var(--font-ui); color: var(--muted); top: 0; }
.tl-end::before { content: ""; position: absolute; left: calc(-1 * var(--gap) + 16px); top: 2px; width: 10px; height: 2px; background: var(--muted); }
.tl-entry .block, .tl-moment .block { padding-left: 0; }
.tl-unsorted { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--font-ui); }
.tl-entry .block .block-hdr { left: -8px; }
.tl-entry .block-hdr .n { display: none; }
.track-col { position: absolute; top: 0; bottom: 0; width: 64px; }
.track-col::before { content: ""; position: absolute; left: 31px; top: 8px; bottom: 8px; width: 2px; background: var(--line); opacity: .5; border-radius: 2px; }
.lane { position: absolute; left: 18px; width: 28px; border-radius: 14px; background: color-mix(in srgb, var(--lc) 18%, var(--panel)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--lc) 60%, transparent); }
.lane.alt { background: color-mix(in srgb, var(--lc) 34%, var(--panel)); }
.lane.open::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 14px; background: linear-gradient(color-mix(in srgb, var(--lc) 18%, var(--panel)), transparent); }
.lane b { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; white-space: nowrap; font: 800 13px var(--font-ui); letter-spacing: .03em; color: var(--fg); display: block; max-width: var(--room); overflow: hidden; text-overflow: ellipsis; }
.lane b small { font-weight: 600; color: var(--muted); margin-left: 8px; font-size: 12px; }
.lane b a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.tl-c-blue { --lc: var(--accent); } .tl-c-orange { --lc: #d9781c; } .tl-c-green { --lc: #2e8b57; } .tl-c-violet { --lc: #8a5bd5; } .tl-c-teal { --lc: #1f8a8a; }
.tracks-head .tl-c-orange { color: #d9781c; } .tracks-head .tl-c-green { color: #2e8b57; } .tracks-head .tl-c-blue { color: var(--accent); } .tracks-head .tl-c-violet { color: #8a5bd5; } .tracks-head .tl-c-teal { color: #1f8a8a; }
@media (max-width: 640px) { .timeline { --date-w: 56px; --gap: 34px; } .tl-date { font-size: 13px; } .tl-spine { padding-left: calc(var(--date-w) + var(--gap)); } .tl-spine::before { left: calc(var(--date-w) + 18px); } .track-col, .tracks-head { display: none; } }

/* inline paragraph editing on article pages */
/* hover popover for in-place editing: sits above the paragraph's right edge, in the
   selection toolbar's colours, so it never covers the text or a timeline's date margin */
.article .block-hdr { left: calc(var(--depth, 0) * 28px); right: 0; width: auto; pointer-events: none; }
.article .block-hdr > * { pointer-events: auto; }
.article .block-hdr .nbadge { left: 14px; right: auto; }
.article .block-hdr .actions-article { left: 60px; right: auto; top: -24px; padding: 2px 3px; background: var(--pop-bg); color: var(--pop-fg); border: 1px solid var(--pop-bg); border-radius: 8px; padding: 3px 4px; box-shadow: var(--shadow-pop); }
.article .block-hdr .actions-article .btn { color: var(--pop-fg); font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 5px; line-height: 1.4; }
.article .block-hdr .actions-article .btn:hover, .article .block-hdr .actions-article .btn:focus-visible { background: color-mix(in srgb, var(--pop-fg) 16%, transparent); color: var(--pop-fg); }
.tl-entry .block .block-hdr { left: 0; }
/* timeline editing: date row, settings editor */
.tl-tools { display: inline-flex; align-items: center; vertical-align: middle; margin: 0 0 0 14px; font-weight: 400; letter-spacing: 0; }
.block-h .tl-tools { position: relative; top: -2px; }
.tl-settings-btn { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-ui); letter-spacing: .01em; padding: 4px 10px 4px 8px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); cursor: pointer; }
.tl-settings-btn:hover, .tl-settings-btn:focus-visible { background: var(--accent-soft); border-color: var(--accent); outline: 0; }
.tl-anchor { position: relative; min-height: 26px; margin-bottom: 4px; }
.tl-anchor .tl-date { color: var(--muted); font-weight: 700; }
.tl-anchor .tl-dot { background: var(--bg); border: 2px solid var(--muted); box-shadow: none; box-sizing: border-box; width: 12px; height: 12px; }
.tl-n { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); opacity: .55; text-decoration: none; }
.tl-entry:hover .tl-n, .tl-entry:focus-within .tl-n, .tl-n:focus-visible { opacity: 1; color: var(--accent); }
.tl-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--panel-2); font-family: var(--font-ui); font-size: 13px; }
.tl-fields input[type="text"], .tl-config input[type="text"], .tl-config select { font: 13px var(--font-mono); padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--fg); }
.tl-f { display: inline-flex; align-items: center; gap: 6px; }
.tl-f-range { display: inline-flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.tl-chk { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.tl-star { color: var(--accent); }
.tl-f-help { flex-basis: 100%; }
.tl-config { display: grid; gap: 10px; font-family: var(--font-ui); font-size: 13px; }
.tl-config p { margin: 0; }
.tl-cfg-sec { display: grid; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); background: var(--panel-2); }
.tl-cfg-sec h4 { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-cfg-sec > .btn { justify-self: start; }
.tl-track { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.tl-track-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-track-hd input[type="text"] { font-family: var(--font-ui); font-weight: 700; }
.tl-track-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.tl-track > .btn { justify-self: start; }
.tl-range { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 34px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.tl-range + .tl-range { margin-top: 6px; }
.tl-range-n { flex-basis: 100%; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-range-x { position: absolute; right: 4px; top: 4px; }
.tl-range-dates { display: inline-flex; align-items: center; gap: 6px; }
.tl-range-l { font: 700 11px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 34px; }
.tl-range.is-bad { border-color: var(--danger); }
.tl-err, .dr-err { color: var(--danger); font-weight: 600; }
.tl-config input[type="text"], .tl-config select { width: auto; }
.tl-config input[size="10"] { width: 13ch; }
.tl-track-hd input[type="text"] { width: 22ch; }
.tl-range .tl-label { flex: 1 1 100%; width: auto; font-family: var(--font-ui); }
/* track colour shown as a bubble: tinted pill, coloured dot, text in the track colour */
.tl-swatch { display: inline-flex; align-items: center; gap: 7px; padding: 2px 6px 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--lc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); color: var(--lc); }
.tl-swatch .tl-dot-sw { width: 10px; height: 10px; border-radius: 50%; background: var(--lc); flex: none; }
.tl-swatch input[type="text"], .tl-swatch select { border: 0; background: transparent; color: var(--lc); padding: 2px 4px; }
.tl-swatch select { font-family: var(--font-ui); font-weight: 700; cursor: pointer; }
.tl-swatch select option { color: var(--fg); background: var(--bg); }
.tl-swatch input[type="text"]:focus, .tl-swatch select:focus { outline: 2px solid var(--lc); outline-offset: 1px; border-radius: 4px; }
.block-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.block-form-foot .actions { margin-left: auto; display: inline-flex; gap: 6px; }
.tl-raw summary { cursor: pointer; }
.tl-raw textarea { margin-top: 6px; }
[x-cloak] { display: none !important; }
.article .block-editing, .article .block-adding { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 10px 12px; margin: 6px 0 10px 48px; }
.article .block-editing .block-hdr, .article .block-adding .block-hdr { position: static; width: auto; gap: 10px; min-height: 28px; }
.article .block-editing .block-hdr .actions, .article .block-adding .block-hdr .actions { position: static; opacity: 1; box-shadow: none; border: 0; background: transparent; }
.article .block-editing .block-hdr .n { display: inline; opacity: 1; }
.tl-entry .block-editing, .tl-entry .block-adding { margin-left: 0; }
.blockmenu { min-width: 220px; }

/* ---- main page: the wiki and the debates side by side ---- */
.home { display: grid; gap: 22px; }
.home-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.home-hd h1 { margin: 0 0 4px; font-size: 30px; }
.home-intro { margin: 0; max-width: 60ch; font-family: var(--font-prose); font-size: 17px; color: var(--muted); }
.home-stats { display: flex; gap: 22px; margin: 0; }
.home-stats div { display: grid; text-align: right; }
.home-stats dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.home-stats dd { margin: 0; font: 700 22px var(--font-ui); font-variant-numeric: tabular-nums; }
.home-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.home-card { position: relative; padding: 18px 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: grid; gap: 10px; align-content: start; }
.home-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
.home-debate::before { background: linear-gradient(var(--side-a), var(--side-b)); }
.home-kicker { margin: 0; font: 800 11px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.home-kicker .glyph { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.home-debate .home-kicker .glyph { background: var(--side-b-soft); color: var(--side-b); }
.home-title { margin: 0; font: 700 24px/1.2 var(--font-prose); letter-spacing: -.01em; }
.home-title a { color: var(--fg); text-decoration: none; }
.home-title a:hover { color: var(--accent); }
.home-summary { margin: 0; font-size: 14px; }
.home-lead { font-size: 15.5px; max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.home-lead p { margin: 0 0 .7em; }
.home-question { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-strong, var(--line)); font-family: var(--font-prose); font-size: 16px; font-style: italic; }
.home-sides { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; }
.home-meta { margin: 0; }
.home-cta { margin: 4px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.home-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.home-sec h2 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.home-sec h2 a.small { font-weight: 500; }
.home-changes .changes-day { font-size: 12px; margin: 8px 0 2px; color: var(--muted); }
.home-debates { display: grid; gap: 8px; margin: 0; }
.home-debate-row { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.home-debate-title { font-weight: 600; text-decoration: none; color: var(--fg); }
.home-debate-title:hover { color: var(--accent); }
.home-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.home-cats .chip { text-decoration: none; }
.home-cats .count { font-size: 11px; color: var(--muted); margin-left: 4px; }
.home-manage { text-align: right; margin: 0; }
@container page (max-width: 820px) { .home-hero, .home-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .home-hero, .home-cols { grid-template-columns: 1fr; } }

/* ---- media: figures, galleries, players ---- */
.media-embed { margin: 14px 0 18px; padding: 0; }
.media-embed img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); display: block; }
.media-embed figcaption { margin-top: 6px; font: 13px/1.45 var(--font-ui); color: var(--muted); }
.media-image a { display: inline-block; max-width: 100%; }
.media-pdf { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-family: var(--font-ui); }
.media-audio audio { width: 100%; max-width: 560px; display: block; }
.media-video video, .media-video iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; background: #000; border: 0; border-radius: 8px; display: block; }
.media-pending { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-family: var(--font-ui); }
.media-missing { color: var(--danger); font-family: var(--font-ui); font-size: 13px; border-bottom: 1px dotted var(--danger); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-item figcaption { font-size: 12px; }
.media-licence-needed { display: none; font: 600 11px var(--font-ui); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); border-radius: 999px; padding: 0 6px; margin-left: 6px; vertical-align: middle; }
body[data-fix-licence] .media-licence-needed { display: inline-block; }
.ib-file img { max-width: 100%; max-height: 120px; width: auto; height: auto; border-radius: 4px; border: 1px solid var(--line); }
.infobox .ib-caption { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.autolist-table .col-image img { max-height: 48px; width: auto; }

/* ---- file picker, cards, uploader ---- */
/* the finder under an image field */
.ib-find { display: grid; gap: 8px; margin-top: 6px; font-family: var(--font-ui); }
.ib-find:empty { display: none; }
.ib-find-current { display: flex; gap: 10px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ib-find-current img { width: 72px; height: 54px; object-fit: contain; border-radius: 4px; background: var(--panel-2); }
.ib-find-hd { letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; }
.ib-find-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ib-find-grid form { display: contents; }
.ib-find-item { display: grid; gap: 4px; justify-items: center; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); font: inherit; font-size: 11px; cursor: pointer; text-align: center; }
.ib-find-item:hover, .ib-find-item:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.ib-find-item img { width: 84px; height: 60px; object-fit: contain; border-radius: 4px; background: var(--panel-2); }
.ib-find-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-find-item small { font-size: 10px; }
.ib-find-commons { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 7px 12px; font-weight: 600; font-size: 12.5px; }
.ib-find-commons svg { flex: none; }
.ib-find .commons-preview { margin-top: 4px; }
.ib-find .commons-card { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ib-find .commons-card img { width: 96px; max-width: 96px; height: auto; flex: none; }
.ib-find .commons-card > div { min-width: 0; overflow-wrap: anywhere; }
.ib-find .commons-preview .field input, .ib-find .commons-preview .field select { width: 100%; box-sizing: border-box; }
.file-picker { display: grid; gap: 10px; font-family: var(--font-ui); }
.file-picker.compact { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel-2); margin: 6px 0; }
.picker-search { display: flex; gap: 6px; }
.picker-search input[type="search"] { flex: 1; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 12.5px; }
.file-card.is-pending { opacity: .7; }
.file-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--panel-2); border-radius: 6px; overflow: hidden; text-decoration: none; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-kind { font-size: 28px; color: var(--muted); }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 4px; }
.tag { display: inline-block; font: 600 11px var(--font-ui); border-radius: 999px; padding: 0 6px; }
.tag-warn { color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); }
.upload-form { display: grid; gap: 10px; }
.upload-drop { display: grid; place-items: center; text-align: center; padding: 22px 12px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--muted); }
.upload-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop input[type="file"] { display: none; }
.upload-progress { display: flex; align-items: center; gap: 10px; }
.upload-progress progress { flex: 1; accent-color: var(--accent); }
.upload-result:empty { display: none; }
.ib-lead-edit { float: right; }
.ib-lead-empty td { text-align: left; }

/* ---- file page, files list, manage ---- */
.file-page h1 .ns { font-weight: 500; }
.file-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; margin-top: 10px; }
.file-view img.file-full { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.file-view .file-pdf { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.file-view audio { width: 100%; }
.file-caption { margin: 8px 0 0; }
.file-table th { text-align: left; white-space: nowrap; width: 110px; vertical-align: top; }
.file-table td { word-break: break-word; }
.file-used, .file-history { margin-top: 24px; }
.file-used h2, .file-history h2 { font-size: 16px; }
.file-grid-page .file-card { font-size: 13px; }
.commons-card { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); margin-bottom: 10px; }
.commons-card img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; }
.commons-form, .file-edit form { display: grid; gap: 8px; font-family: var(--font-ui); }
.file-in-use { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); border-radius: 8px; margin-bottom: 10px; }
.manage-nav .count { font-size: 11px; background: var(--warn); color: #000; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 14px; }
.stats div { display: grid; }
.stats dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; }
@media (max-width: 900px) { .file-layout { grid-template-columns: 1fr; } }

/* ---- video player: main column, marker bar, moving transcript beside it ---- */
/* Widths are derived from the viewport height so a 16:9 player never exceeds 60vh and never
   letterboxes: main column = 0.6 x figure - gap, video height = main x 9/16 <= 60vh. */
.media-embed.media-video.has-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 40%); gap: 14px; max-width: min(1600px, calc(178vh + 23px)); }
.media-video.has-side figcaption { grid-column: 1 / -1; }
.media-embed.media-video.has-side.side-below { grid-template-columns: minmax(0, 1fr); max-width: min(820px, 106.7vh); }
.media-video.side-below .player-side { min-height: 0; height: 220px; }
.player-main { min-width: 0; }
.player-side { position: relative; min-height: 220px; }
.media-video:not(.has-side) .player-side { display: none; }
.player-side .transcript { position: absolute; inset: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.tr-side-hd { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-family: var(--font-ui); }
.tr-side-hd > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-side .tr-lines { flex: 1; max-height: none; padding: 6px; }
.player-side .tr-line { font-size: 13px; padding: 4px 8px; }
.player-side .tr-text { font-size: 15px; }
.player-side .tr-line.is-now { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 760px) {
  .media-video.has-side { grid-template-columns: 1fr; }
  .player-side { min-height: 200px; height: 200px; }
}
.player-bar { margin-top: 10px; font-family: var(--font-ui); }
.player-track { position: relative; height: 22px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.player-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px 0 0 5px; background: color-mix(in srgb, var(--accent) 16%, transparent); pointer-events: none; }
.player-head { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--fg); pointer-events: none; z-index: 4; }
.player-head::before { content: ""; position: absolute; top: -1px; left: -4px; width: 10px; height: 6px; background: var(--fg); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.player-mark { position: absolute; top: 50%; height: 12px; width: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; cursor: pointer; background: var(--accent); z-index: 2; transform: translateY(-50%); transition: transform .12s, box-shadow .12s; }
.player-mark.range { transform: none; top: 4px; bottom: 4px; height: auto; margin-left: 0; border: 0; border-radius: 4px; box-shadow: none; opacity: .45; z-index: 1; }
.player-mark.range::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 4px 0 0 4px; background: color-mix(in srgb, currentColor 40%, var(--fg)); opacity: .9; }
.player-mark.kind-dispute { background: var(--danger); } .player-mark.kind-question { background: var(--warn); } .player-mark.kind-support { background: var(--ok); } .player-mark.kind-comment { background: var(--muted); }
.player-mark:hover, .player-mark:focus-visible { transform: translateY(-50%) scale(1.4); box-shadow: 0 0 0 2px var(--fg); z-index: 3; outline: 0; }
.player-mark.range:hover, .player-mark.range:focus-visible { transform: none; opacity: .8; box-shadow: 0 0 0 2px var(--fg); }
.player-mark.is-now { box-shadow: 0 0 0 2px var(--fg); z-index: 3; }
.player-mark.range.is-now { opacity: .75; }
.player-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; flex-wrap: wrap; }
.player-time { color: var(--fg); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.player-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.player-btns button { font: inherit; font-size: 12.5px; padding: 3px 10px; border: 0; background: transparent; color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.player-btns button + button { border-left: 1px solid var(--line); }
.player-btns button:hover { background: var(--panel-2); color: var(--accent); }
.player-btns button span { color: var(--muted); font-family: var(--font-mono); }
.player-count { margin-left: auto; }
.note.is-now { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
/* who can see a note: private and side notes are marked in text and by a dashed edge */
.pill-private { color: var(--muted); border: 1px dashed var(--muted); }
.pill-side { color: var(--accent); border: 1px solid var(--accent); }
.note-vis summary { list-style: none; } .note-vis summary::-webkit-details-marker { display: none; }
.note-vis .menu-items { min-width: 200px; }
.player-mark.vis-private { border-style: dashed; border-color: var(--fg); background: transparent; box-shadow: inset 0 0 0 6px currentColor, 0 0 0 1px var(--line); }
.player-mark.vis-private.kind-dispute { color: var(--danger); } .player-mark.vis-private.kind-question { color: var(--warn); } .player-mark.vis-private.kind-support { color: var(--ok); } .player-mark.vis-private.kind-comment { color: var(--muted); }
.player-mark.range.vis-private { background: repeating-linear-gradient(45deg, currentColor 0 4px, transparent 4px 8px); opacity: .6; }
.player-mark.vis-side { outline: 2px dotted var(--accent); outline-offset: 1px; }
mark.anchor.vis-private { text-decoration-style: dotted; }
.anchor-tag.vis-private { border-style: dashed; } .anchor-tag.vis-side { border-color: var(--accent); }
.chip-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; align-self: center; }
.my-notes-group { margin: 18px 0; } .my-notes-group h2 { margin: 0 0 8px; } .my-notes-group h2 a { text-decoration: none; }
.time-chip { font: inherit; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent); cursor: pointer; }
.time-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.time-row input { width: 7ch; font-family: var(--font-mono); }
.file-existing { margin: 4px 0 0; padding: 4px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--fg); }
.files-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-family: var(--font-ui); }
.files-filter .search { flex: 1 1 200px; }
.files-table td, .files-table th { vertical-align: top; }
.files-thumb { width: 56px; }
.files-thumb img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.files-thumb .file-kind { font-size: 20px; }
/* figures never grow with a wide column: a player or photo wider than ~820px is a wall */
.media-embed.media-image, .media-embed.media-video, .media-embed.media-audio, .media-embed.media-pdf { max-width: 820px; }
.media-embed.media-image img { max-height: 75vh; width: auto; max-width: 100%; }
.file-view { max-width: 900px; }
.media-video video, .media-video iframe { max-height: 60vh; }
.media-embed.media-video:not(.has-side) { max-width: min(820px, 106.7vh); }

/* ---- transcripts ---- */
.transcript { font-family: var(--font-ui); text-align: left; hyphens: none; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.tr-search { flex: 1 1 160px; } .tr-search input { width: 100%; }
.tr-lines { max-height: 60vh; overflow: auto; padding-right: 4px; }
.tr-line { display: flex; gap: 8px; align-items: baseline; margin: 0; padding: 3px 6px; border-radius: 6px; font-size: 14px; line-height: 1.45; }
.tr-line.is-now { background: var(--accent-soft); }
.tr-line.is-hit .tr-text { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.tr-time { flex: none; font-size: 11.5px; color: var(--accent); background: transparent; border: 0; padding: 0; cursor: pointer; min-width: 44px; text-align: right; }
.tr-text { font-family: var(--font-prose); font-size: 15px; }
.tr-fix { border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; font-size: 12px; }
.tr-line:hover .tr-fix { opacity: 1; }
.tr-edit { display: flex; gap: 6px; flex: 1; } .tr-edit input { flex: 1; }
.tr-empty { display: grid; gap: 8px; color: var(--muted); }
.file-transcript { margin-top: 12px; } .file-transcript summary { cursor: pointer; font-weight: 600; font-family: var(--font-ui); }
.tr-progress { display: grid; gap: 4px; margin-bottom: 8px; }
.tr-progress progress { width: 100%; accent-color: var(--accent); }
.tr-choice { margin-bottom: 8px; }

/* the date widget: year, BC/AD, month, day; one way to enter a date everywhere */
.cf-date { display: inline-flex; flex: none; align-items: center; gap: 3px; }
.cf-date input, .cf-date select, .tl-config .cf-date input[type="text"], .tl-config .cf-date select, .tl-fields .cf-date input[type="text"] { font: 500 12.5px var(--font-mono); padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); height: 26px; box-sizing: border-box; width: auto; flex: none; }
.cf-date input[type="text"].cf-date-y, .tl-config .cf-date input[type="text"].cf-date-y, .tl-fields .cf-date input[type="text"].cf-date-y { width: 6.5ch; text-align: right; }
.cf-date select, .tl-config .cf-date select { font-family: var(--font-ui); padding-right: 2px; }
.cf-date .cf-date-m { min-width: 7.6em; }
.cf-date .cf-date-d { min-width: 4.6em; }
.cf-date select:disabled { opacity: .45; }
.cf-date input:focus, .cf-date select:focus { border-color: var(--accent); outline: 0; }
.is-off .cf-date { opacity: .4; pointer-events: none; }
/* graph: categories are squares in the muted ink, topics circles in the accent */
.graph-svg .gn-category rect { fill: var(--panel-2); stroke: var(--muted); stroke-width: 1.5px; }
.graph-svg .gn-category:hover rect, .graph-svg .gn-category.gn-focus rect { stroke: var(--fg); }
.graph-svg .gn-category text { fill: var(--muted); }
/* when a paragraph (or a section) last changed: there, but barely */
.article .block-stamp { display: block; text-align: right; margin: 2px 0 0; font: 500 10.5px var(--font-mono); line-height: 1.2; color: color-mix(in srgb, var(--muted) 55%, transparent); user-select: none; text-decoration: none; }
.article a.block-stamp:hover { color: var(--accent); text-decoration: underline; }
.article .block:hover .block-stamp { color: var(--muted); }
.article .block-heading .block-stamp { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin: 0; }
.article .block-heading { position: relative; }
.tl-entry .block-stamp { margin-right: 4px; }
/* diagrams: the figure shows its source until mermaid draws it; errors read as text */
figure.diagram { margin: 12px 0; }
figure.diagram .diagram-src { font: 12.5px/1.5 var(--font-mono); white-space: pre-wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); margin: 0; }
figure.diagram.is-drawn .diagram-src { display: none; }
figure.diagram .diagram-svg { display: flex; justify-content: center; padding: 8px 0; }
figure.diagram .diagram-svg svg { max-width: 100%; height: auto; }
figure.diagram .diagram-err { color: var(--danger); margin: 6px 0 0; }
.sec-atom-editor { display: grid; gap: 6px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--panel); font-family: var(--font-ui); cursor: auto; }
.sec-atom-editor .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-atom-editor .row .grow { flex: 1; }
.sec-atom-editor select { width: auto; font: 12.5px var(--font-ui); padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--fg); }
.sec-atom-editor .row { padding-right: 22px; } /* clear of the atom's remove cross */
.sec-atom-editor textarea { width: 100%; box-sizing: border-box; font: 13px/1.5 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); resize: vertical; }
.sec-surface .sec-atom:has(.sec-atom-editor) { outline-color: var(--accent); opacity: 1; }
/* drawings: draw.io over the page, and an edit button on every drawing figure */
.drawing-overlay { position: fixed; inset: 0; z-index: 1000; background: var(--bg); }
.drawing-overlay iframe { width: 100%; height: 100%; border: 0; display: block; }
body.drawing-open { overflow: hidden; }
figure[data-drawing] { position: relative; }
figure[data-drawing] .drawing-edit { position: absolute; top: 8px; right: 8px; font: 700 12px var(--font-ui); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--fg); cursor: pointer; opacity: 0; transition: opacity .12s; }
figure[data-drawing]:hover .drawing-edit, figure[data-drawing] .drawing-edit:focus-visible { opacity: 1; }
/* a drawing is an adaptive SVG: color-scheme on the image picks its light or dark side */
figure.media-drawing img { background: transparent; border-radius: 6px; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) figure.media-drawing img { color-scheme: dark; } }
:root[data-theme="dark"] figure.media-drawing img { color-scheme: dark; }
.sec-surface .sec-atom figure[data-drawing] { cursor: pointer; }
.sec-atom-editor .file-note { color: var(--muted); }
.diagram-form textarea { width: 100%; box-sizing: border-box; font: 13px/1.5 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); margin: 8px 0; }
figure.file-diagram { margin: 12px 0; }
/* the Mermaid form editor: tabs, groups of lines, text as the other tab */
.mf-tabs { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.mf-tab { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--fg); font: 700 12.5px var(--font-ui); cursor: pointer; }
.mf-tab.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.mf-note { margin-left: 8px; }
.mf-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-family: var(--font-ui); font-size: 12.5px; }
.mf-l { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.mf-group { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.mf-h { font: 800 10.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.mf-line { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.mf-line.mf-top { align-items: flex-start; }
.mf-line input[type="text"], .mf-line select, .mf-line textarea, .mf-row input[type="text"] { font: 500 12.5px var(--font-ui); padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--fg); min-width: 0; }
/* the theme gives inputs and selects width 100%: in a flex line each needs its own share */
.mf-line input[type="text"] { width: auto; flex: 1 1 120px; }
.mf-line select { width: auto; flex: 0 1 auto; max-width: 40%; }
.mf-line textarea { width: auto; flex: 1 1 160px; font-family: var(--font-ui); resize: vertical; }
.mf-line .mf-num { flex: 0 0 7ch; width: 7ch; text-align: right; font-family: var(--font-mono); }
.mf-line .mf-period { flex: 0 0 11ch; width: 11ch; }
.mf-row input[type="text"] { width: auto; flex: 1 1 160px; }
.sec-atom-editor .row label { white-space: nowrap; }
.mf-id { flex: 0 0 2.4em; font-size: 11px; color: var(--muted); text-align: center; }
.mf-chk { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.mf-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.mf-x:hover { color: var(--danger); background: var(--panel-2); }
.mf-add { margin-top: 2px; }
.mf-text { width: 100%; box-sizing: border-box; font: 13px/1.5 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); resize: vertical; }
.sec-atom-editor .mf { margin-top: 2px; }
/* sources: a flagged source colours its markers and its references; the source page */
.prose sup.cite.cite-flag a, .prose sup.cite.cite-flag a:visited, sup.cite.cite-flag a { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); border-radius: 4px; padding: 0 3px; }
.prose sup.cite.cite-flag a::after, sup.cite.cite-flag a::after { content: " !"; font-weight: 800; }
.prose sup.cite.cite-retracted a, .prose sup.cite.cite-gone a, sup.cite.cite-retracted a, sup.cite.cite-gone a { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.ref-flag { display: inline-flex; align-items: center; padding: 1px 7px; margin-right: 6px; border-radius: 999px; font: 800 10.5px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); vertical-align: middle; }
.ref-flag.st-retracted, .ref-flag.chk-gone { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.ref-list li.ref-flagged { padding: 6px 10px; margin-left: -10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--warn) 6%, transparent); }
.ref-list li.ref-flagged.st-retracted { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.ref-reason { display: block; color: var(--warn); margin-top: 2px; }
.ref-reason.st-retracted { color: var(--danger); }
.source-page { max-width: var(--content-max); margin: 0 auto; padding: 24px 0 60px; font-family: var(--font-ui); }
.source-head { margin-bottom: 18px; }
.source-title { font: 800 28px/1.2 var(--font-ui); letter-spacing: -.02em; margin: 6px 0; }
.source-status { margin: 0 0 18px; }
.status-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-form input[type="text"] { width: auto; flex: 1 1 260px; font: 500 12.5px var(--font-ui); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--fg); }
.source-status .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.source-status .seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: 700 12px var(--font-ui); cursor: pointer; }
.source-status .seg button.on { background: var(--accent); color: var(--bg); }
.source-status .seg button.on.st-disputed, .source-status .seg button.on.st-misleading { background: var(--warn); }
.source-status .seg button.on.st-retracted { background: var(--danger); color: #fff; }
.pill.st-ok { color: var(--ok); } .pill.st-disputed, .pill.st-misleading, .st-note.st-disputed, .st-note.st-misleading { color: var(--warn); } .pill.st-retracted, .st-note.st-retracted { color: var(--danger); }
.source-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.source-cards .card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-size: 13px; }
.source-page .k { font: 800 10.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.source-passages h2.k, .source-used h2.k { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.passage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); margin-bottom: 10px; }
.passage blockquote { margin: 0 0 4px; padding-left: 10px; border-left: 3px solid var(--accent); font-family: var(--font-prose); font-size: 14px; line-height: 1.5; }
.passage .use { margin-bottom: 4px; } .passage .excerpt { color: var(--muted); }
.chk-ok { color: var(--ok); } .chk-changed, .chk-moved { color: var(--warn); } .chk-gone, .chk-error { color: var(--danger); }
@media (max-width: 700px) { .source-cards, .passage { grid-template-columns: 1fr; } }

/* ---- the reference builder (side panel) ---- */
.cite-builder { display: flex; flex-direction: column; gap: 12px; }
.cite-builder .cite-url { display: flex; gap: 6px; }
.cite-builder .cite-url input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; }
.cite-builder .cite-url .btn { flex: 0 0 auto; width: auto; }
.cite-reader { display: flex; flex-direction: column; gap: 10px; }
.cite-src { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.cite-src .cite-src-site { font-weight: 700; color: var(--fg); }
.cite-src .grow, .cite-card-head .grow, .cite-card-links .grow { flex: 1; }
.cite-meta summary { cursor: pointer; color: var(--muted); }
.cite-known { display: flex; flex-direction: column; gap: 6px; }
.cite-passage { display: block; width: 100%; text-align: left; font: inherit; font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); cursor: pointer; }
.cite-passage q { quotes: "\201C" "\201D"; font-family: var(--font-prose); }
.cite-passage:hover, .cite-passage.is-picked { border-color: var(--accent); }
.cite-page { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.cite-page-title { padding: 10px 14px 0; font-weight: 700; font-size: 14px; line-height: 1.3; }
.cite-page-text { padding: 8px 14px 12px; max-height: min(42vh, 420px); overflow: auto; font-size: 14px; line-height: 1.55; }
.cite-page-text p { margin: 0 0 10px; }
.cite-page-text p::selection, .cite-page-text p *::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.cite-fields { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px 10px; align-items: start; font-size: 12.5px; }
.cite-fields .k { padding-top: 7px; }
.cite-fields textarea, .cite-fields input[type="text"] { width: 100%; font-size: 13px; }
.cite-fields textarea { font-family: var(--font-prose); line-height: 1.45; }
.cite-supports { min-height: 34px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; font-family: var(--font-prose); font-size: 13px; line-height: 1.5; color: var(--muted); }
.cite-supports:not(:has(.cite-supports-text:not(:empty)))::before { content: attr(data-empty); font-family: var(--font-ui); font-size: 12.5px; }
.cite-supports:not(:has(.cite-supports-text:not(:empty))) .cite-supports-where { display: none; }
#cite-supports.cite-supports-field { border-style: solid; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--fg); }
#cite-supports.cite-supports-field .cite-supports-where { display: inline; }
#cite-supports.cite-supports-field select { font-size: 13px; padding: 3px 6px; max-width: 100%; }
#cite-error:empty { display: none; }
.cite-supports:has(.cite-supports-text:not(:empty)) { border-style: solid; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--fg); }
.cite-actions { display: flex; align-items: center; gap: 8px; }
.cite-actions .cite-note { flex: 1; }
.cite-actions .btn { width: auto; }
.cite-bubble { position: fixed; z-index: 200; display: flex; align-items: center; padding: 5px 6px; background: var(--pop-bg); color: var(--pop-fg); border: 1px solid var(--pop-bg); border-radius: 10px; box-shadow: var(--shadow-pop); font-family: var(--font-ui); }
.cite-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--pop-bg); transform: translateX(-50%) rotate(45deg); }
.cite-bubble button { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--pop-fg); cursor: pointer; white-space: nowrap; line-height: 1; width: auto; }
.cite-bubble button:hover { background: color-mix(in srgb, var(--pop-fg) 12%, transparent); }

/* the claim's words on the page */
mark.cite-anchor { background: transparent; color: inherit; border-bottom: 1.5px dotted color-mix(in srgb, var(--accent) 75%, transparent); padding-bottom: 1px; }
mark.cite-anchor.st-disputed, mark.cite-anchor.st-misleading, mark.cite-anchor.chk-moved, mark.cite-anchor.chk-changed { border-bottom-color: color-mix(in srgb, var(--warn) 90%, transparent); }
mark.cite-anchor.st-retracted, mark.cite-anchor.chk-gone { border-bottom-color: color-mix(in srgb, var(--danger) 90%, transparent); }
mark.cite-anchor.is-hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-bottom-style: solid; }
.prose sup.cite .is-hover, .prose sup.cite a.is-hover { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; border-radius: 4px; }
.source-page .excerpt.claim { font-family: var(--font-prose); color: var(--fg); }
.source-page .excerpt.claim.is-stale { text-decoration: line-through; color: var(--muted); }

/* the hover card on a marker */
.cite-card { position: fixed; z-index: 210; width: min(420px, calc(100vw - 16px)); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 12px 14px; font-size: 12.5px; line-height: 1.45; }
.cite-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cite-card-title { font-weight: 700; font-size: 13.5px; line-height: 1.3; margin-bottom: 2px; }
.cite-card-quote { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0 6px 6px 0; font-family: var(--font-prose); font-size: 13.5px; line-height: 1.5; }
.cite-card-links { display: flex; gap: 12px; margin-top: 10px; font-weight: 700; }
.cite-card-links a { text-decoration: none; }
.pill.chk-moved, .pill.chk-changed { color: var(--warn); } .pill.chk-gone { color: var(--danger); }

/* our capture of a source, read in full */
.source-capture .capture-text { max-width: 72ch; max-height: 70vh; overflow: auto; padding: 4px 8px 4px 3.4em; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.source-capture .capture-text p { position: relative; margin: 0 0 1em; }
.source-capture .capture-text .para-n { position: absolute; left: -3.2em; width: 2.6em; text-align: right; font-size: 11px; color: var(--muted); user-select: none; top: .45em; }
.source-capture .capture-text p.is-cited { border-left: 3px solid var(--accent); padding-left: 10px; margin-left: -13px; }
.source-capture .capture-text p:first-child { margin-top: .8em; }
.source-capture mark.cited-passage { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; padding: 1px 0; }

/* our copy of a source: the frozen page in a sandboxed frame under our bar */
.page-frozen { max-width: none; padding-left: 0; padding-right: 0; }
.frozen-viewer { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 8px); }
.frozen-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.frozen-bar .grow { flex: 1; }
.frozen-badge { font: 800 10.5px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.frozen-title { font-weight: 700; }
.frozen-note { margin: 4px 16px; }
.frozen-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* a quote embed pinned to a version; the badge when the paragraph moved on */
.quote-rev { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.quote-changed { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font: 800 10.5px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); text-decoration: none; cursor: pointer; }
.quote-embed.is-changed { border-left-color: var(--warn); }
.quote-compare { margin: 6px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; font-family: var(--font-ui); }
.quote-compare .qc-head, .quote-compare .qc-body { display: grid; grid-template-columns: 1fr 1fr; }
.quote-compare .qc-head { border-bottom: 1px solid var(--line); }
.quote-compare .qc-head .k { padding: 7px 12px; }
.quote-compare .qc-head .k + .k, .quote-compare .qc-now { border-left: 1px solid var(--line); }
.quote-compare .qc-then, .quote-compare .qc-now { padding: 10px 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.quote-compare .qc-now del { background: color-mix(in srgb, var(--danger) 18%, transparent); text-decoration: line-through; text-decoration-color: var(--danger); }
.quote-compare .qc-now ins { background: color-mix(in srgb, var(--ok) 20%, transparent); text-decoration: none; box-shadow: inset 0 -2px 0 var(--ok); }
.quote-compare .qc-actions { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.quote-compare .qc-actions .grow { flex: 1; }
.quote-compare .qc-actions .btn { width: auto; }
.btn.is-hint { color: var(--warn); }

/* ---- proposals and votes ---- */
.prop-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 10.5px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; border: 0; cursor: pointer; }
.prop-badge:hover { filter: brightness(1.1); }
.block.has-proposal { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
.block.is-proposed .block-body del, .prop-diff del { background: color-mix(in srgb, var(--danger) 18%, transparent); text-decoration: line-through; text-decoration-color: var(--danger); }
.block.is-proposed .block-body ins, .prop-diff ins { background: color-mix(in srgb, var(--ok) 20%, transparent); text-decoration: none; box-shadow: inset 0 -2px 0 var(--ok); }
.block.is-proposed { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 10px 10px 0; }
.block.is-proposed-insert { background: color-mix(in srgb, var(--ok) 7%, transparent); box-shadow: inset 3px 0 0 var(--ok); }
.block.is-proposed-delete .block-body { text-decoration: line-through; text-decoration-color: var(--danger); opacity: .7; }
.prop-legend { display: flex; align-items: center; gap: 10px; font: 600 12px var(--font-ui); color: var(--muted); margin-top: 8px; }
.prop-legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.prop-legend .sw.del { background: color-mix(in srgb, var(--danger) 50%, transparent); } .prop-legend .sw.ins { background: color-mix(in srgb, var(--ok) 50%, transparent); }
.proposal { display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.5; }
.proposal .prop-title { font-weight: 800; font-size: 14px; }
.proposal .prop-why { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.prop-votes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prop-votes button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); font: inherit; cursor: pointer; text-align: left; width: auto; }
.prop-votes button.on.up { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.prop-votes button.on.down { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.prop-votes b { display: inline-flex; align-items: center; gap: 6px; }
.prop-votes .who { font-size: 11.5px; color: var(--muted); }
.prop-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prop-actions .btn { width: auto; }
.prop-changes { display: flex; flex-direction: column; gap: 8px; }
.prop-change { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-family: var(--font-prose); font-size: 13.5px; line-height: 1.5; }
.prop-change .k { font-family: var(--font-ui); }
.prop-change.is-stale { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.prop-change .drift { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.prop-comments { display: flex; flex-direction: column; gap: 8px; }
.prop-comment { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.prop-comment .prose p:last-child { margin-bottom: 0; }
.prop-state { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); font: 700 11px var(--font-ui); }
.prop-state.accepted { border-color: transparent; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.prop-state.declined, .prop-state.withdrawn, .prop-state.stale { border-color: transparent; background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.prop-state.rebase { border-color: color-mix(in srgb, var(--warn) 60%, transparent); color: var(--warn); }
.prop-list { display: grid; gap: 8px; }
.prop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; color: var(--fg); }
.prop-row:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.prop-row .t { font-weight: 800; }
.prop-row .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.prop-row .r { display: flex; align-items: center; gap: 10px; font: 700 12px var(--font-ui); }
.prop-row .up { color: var(--ok); } .prop-row .down { color: var(--danger); }
.prop-row.done { opacity: .65; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 11px var(--font-ui); }
.sec-save { display: inline-flex; border-radius: 8px; overflow: hidden; }
.sec-save .btn { width: auto; }
.sec-save .caret { padding: 0 8px; border-left: 1px solid color-mix(in srgb, #000 20%, transparent); border-radius: 0 8px 8px 0; }
.sec-save-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 260px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-pop); font-size: 12.5px; }
.sec-save-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; }
.sec-save-menu button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sec-save-menu small { display: block; color: var(--muted); }
.propose-form { display: flex; flex-direction: column; gap: 10px; }
.propose-form .prop-change { max-height: 160px; overflow: auto; }

/* a section editor beside the floated infobox gets only the leftover width; unless the
   column is wide, it clears the infobox and takes the whole width while editing */
@container (max-width: 1100px) { .article-col .section-editor { clear: both; } }

/* ---- templates: the page, the editor, the fill-in panel, the widgets ---- */
.tpl-page .tpl-head { margin-bottom: 14px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.tpl-page .k { margin: 16px 0 6px; }
.tpl-fields td, .tpl-fields th { vertical-align: top; }
.tpl-outline { padding-left: 22px; display: grid; gap: 4px; }
.tpl-form .field { display: grid; gap: 4px; margin: 6px 0; }
.tpl-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl-rows { display: grid; gap: 6px; }
.tpl-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tpl-row-move { display: flex; flex-direction: column; gap: 2px; }
.tpl-row-move .ico { width: 26px; height: 22px; border: 0; background: var(--panel-2); border-radius: 5px; color: var(--fg); cursor: pointer; font-size: 12px; }
.tpl-row-move .ico:disabled { opacity: .35; cursor: default; }
.tpl-row-opts { flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.tpl-row-opts input[type="text"], .tpl-row-opts input[type="number"], .tpl-row-opts select { width: auto; font-size: 12.5px; }
.tpl-row-opts label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.tpl-row-opts .btn { width: auto; }
.tpl-inherited { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 6px; }
.tpl-add { margin-top: 8px; }
.tpl-add input { flex: 1; }
.tpl-add .btn { width: auto; }
.tpl-add .suggest, .fill-extra .suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-pop); display: grid; }
.tpl-add .suggest button, .fill-extra .suggest button { text-align: left; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; width: 100%; }
.tpl-add .suggest button:hover, .fill-extra .suggest button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tpl-new { margin-top: 8px; padding: 12px 14px; }
.tpl-new .form-row { grid-template-columns: 1.2fr 1fr .8fr .5fr; }
.tpl-preview-col { position: sticky; top: 16px; }
.tpl-live .infobox { float: none; width: auto; margin: 0 0 10px; }
.tpl-live-outline { margin-top: 10px; display: grid; gap: 6px; }
.ghost-section { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.ghost-section .ghost-h { font-weight: 800; color: var(--muted); }
.tpl-pages { columns: 2; gap: 24px; }
.widgets { float: right; clear: right; width: var(--infobox-w, 300px); margin: 0 0 16px 24px; display: grid; gap: 10px; font-family: var(--font-ui); }
html[data-wide] .widgets { width: 380px; }
.widget { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; }
.widget-empty { border-style: dashed; background: transparent; }
.widget-title { font-weight: 800; margin-bottom: 4px; }
.widget-map { display: flex; justify-content: space-between; gap: 8px; text-decoration: none; }
.widget-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.widget-gallery img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; display: block; }
.widget-facts th { text-align: left; padding: 2px 8px 2px 0; font-weight: 700; color: var(--muted); }
.widget-tl li { margin: 2px 0; }
.fill-panel { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.fill-head { display: flex; align-items: center; gap: 10px; }
.fill-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fill-bar span { display: block; height: 100%; background: var(--accent); }
.fill-group { margin-top: 6px; }
.fill-table { width: 100%; border-collapse: collapse; }
.fill-table th { text-align: left; width: 38%; padding: 6px 8px 6px 0; font-weight: 700; vertical-align: top; }
.fill-table td { padding: 4px 0; }
.fill-table .btn { width: auto; }
.fill-row { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 8px; align-items: center; }
.fill-extra { display: flex; flex-direction: column; gap: 6px; }
.fill-extra .btn { width: auto; }
.ghost-sections { display: grid; gap: 8px; margin: 18px 0 8px; }
.ghost-sections .ghost-section { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-ui); }
.ghost-sections .ghost-h { font-size: 20px; }
.ghost-sections .ghost-start { margin-left: auto; }
.ghost-sections .ghost-start .btn { width: auto; }
.tpl-row-move .grip { cursor: grab; color: var(--muted); font-size: 14px; line-height: 22px; text-align: center; user-select: none; }
.tpl-row-move .grip:active { cursor: grabbing; }
.tpl-row.is-dragover { outline: 2px solid var(--accent); outline-offset: 1px; }
.ghost-section.lvl-3 { margin-left: 22px; } .ghost-section.lvl-3 .ghost-h { font-size: 17px; }
.ghost-section.lvl-4 { margin-left: 44px; } .ghost-section.lvl-4 .ghost-h { font-size: 15px; }
.tpl-outline li.lvl-3 { margin-left: 18px; } .tpl-outline li.lvl-4 { margin-left: 36px; }
.tpl-rows .tpl-row-opts.lvl-3 { margin-left: 18px; } .tpl-rows .tpl-row-opts.lvl-4 { margin-left: 36px; }

/* a reference cited on an infobox value: the row's key next to the back-link */
.ref-list .ref-where { font-size: 11px; color: var(--muted); background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent)); border-radius: 4px; padding: 0 5px; margin-right: 4px; }
.infobox sup.cite a { color: var(--accent); text-decoration: none; font-size: 10.5px; }
.infobox sup.cite-missing { color: var(--danger); font-size: 10.5px; }
.infobox sup.cite.cite-flag a { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); border-radius: 4px; padding: 0 3px; }
.infobox sup.cite.cite-changed a { color: var(--muted); background: none; border-bottom: 1px dotted var(--warn); }

/* watching */
.tabs .watch-btn { display: inline-flex; align-items: center; gap: 5px; }
.tabs .watch-btn.is-on { color: var(--accent); }
.watch-rows { display: grid; gap: 8px; max-width: 760px; }
.watch-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.watch-row.has-new { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.watch-title { font-weight: 600; }
.watch-page h2 { margin-top: 28px; }
.rail a .nav-count { margin-left: auto; }
/* a secret typed in plain view, on purpose: no password manager grabs it */
input.secret { -webkit-text-security: disc; }
input.secret:focus { -webkit-text-security: none; }
.mail-log td { vertical-align: top; }
.mail-log tr.st-failed td { background: color-mix(in srgb, var(--danger) 7%, transparent); }

/* the mail activity chart: server-drawn SVG, status colours with a legend */
.chart { margin: 16px 0 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.chart figcaption { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chart .legend { display: inline-flex; gap: 10px; align-items: center; }
.chart .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chart .sw-ok { background: var(--ok); } .chart .sw-danger { background: var(--danger); }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--font-mono); }
.chart .bar-ok { fill: var(--ok); } .chart .bar-danger { fill: var(--danger); }
.chart .hit { fill: transparent; }
.chart .bar-group:hover .hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.mail-failures { display: grid; gap: 8px; } .mail-failures li { border-left: 3px solid var(--danger); padding: 2px 10px; }
.infobox .ib-prop { font-size: 10px; padding: 0 5px; margin-left: 4px; text-decoration: none; }

/* the assistant: a working chat. One memorable thing: the trail of what it did, as a ledger
   above each answer; everything else stays quiet. */
/* the assistant always takes the whole width; the title bar sticks to the top, the composer to the foot */
.page.asst-page { padding-top: 0; padding-bottom: 0; max-width: none; }
.asst-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.asst-list { position: sticky; top: 0; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 22px 16px 0 0; }
.asst-list .asst-new { width: 100%; }
.asst-list ul { display: grid; gap: 2px; margin-top: 12px; }
.asst-chat { display: grid; gap: 1px; padding: 7px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.asst-chat .t { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.asst-chat .m { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.asst-chat .asst-about { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-chat:hover { background: var(--panel-2); }
.asst-chat.is-on { background: var(--accent-soft); }
.asst-chat.is-on .t { color: var(--accent); }
.asst-main { min-width: 0; min-height: calc(100vh - var(--topbar-h) - 22px); display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 28px; }
.asst-welcome { max-width: 56ch; padding-top: 22px; }
.asst-welcome p { color: var(--muted); }
.asst-head { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 22px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.asst-head-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.asst-title { flex: 1 1 240px; min-width: 160px; border: 0; background: transparent; font: 600 19px/1.3 var(--font-prose); color: var(--fg); padding: 4px 0; }
.asst-title:focus { outline: none; box-shadow: 0 1px 0 var(--accent); }
.asst-title::placeholder { color: var(--fg); opacity: .8; }
.asst-about-link { font-size: 12.5px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; white-space: nowrap; }
.asst-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.asst-opt select { font-size: 12.5px; padding: 3px 24px 3px 8px; border-radius: 6px; }
.asst-delete { color: var(--muted); }
.asst-delete:hover { color: var(--danger); }
.asst-thread { display: flex; flex-direction: column; flex: 1 1 auto; }
.asst-msgs { display: grid; gap: 22px; align-content: start; flex: 1 1 auto; padding-bottom: 18px; }
.asst-msg.user { justify-self: end; max-width: min(80%, 560px); }
.asst-bubble { background: var(--accent-soft); color: var(--fg); padding: 9px 14px; border-radius: 14px 14px 4px 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.asst-msg.assistant { justify-self: start; max-width: 100%; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--ai) 55%, var(--line)); }
.asst-msg.is-failed { border-left-color: var(--danger); }
.asst-trail { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.asst-trail li { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: baseline; color: var(--muted); }
.asst-trail .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); align-self: center; }
.asst-trail .run .dot { background: var(--ai); animation: asst-pulse 1.2s ease-in-out infinite; }
.asst-trail .lbl { color: var(--fg); font-weight: 600; }
.asst-trail .det { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-answer { font-family: var(--font-prose); font-size: 15.5px; line-height: 1.6; }
.asst-answer > :first-child { margin-top: 0; } .asst-answer > :last-child { margin-bottom: 0; }
.asst-working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.asst-working .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ai); animation: asst-pulse 1.2s ease-in-out infinite; }
@keyframes asst-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .asst-trail .run .dot, .asst-working .dot { animation: none; } }
.asst-props { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.asst-prop { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.asst-prop:hover { filter: brightness(1.08); }
.asst-error { color: var(--danger); font-size: 13.5px; }
.asst-plan { border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); }
.asst-plan-hd { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.asst-plan-text { font-size: 14px; } .asst-plan-text > :first-child { margin-top: 0; } .asst-plan-text > :last-child { margin-bottom: 0; }
.asst-plan-bar { display: flex; gap: 8px; margin-top: 10px; }
.asst-note { color: var(--muted); font-size: 13px; }
.asst-meta { margin-top: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.asst-empty { max-width: 60ch; color: var(--muted); padding-top: 8px; }
.asst-tries { display: grid; gap: 6px; margin-top: 10px; }
.asst-tries button { text-align: left; font: inherit; font-size: 13.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.asst-tries button:hover { border-color: var(--accent); background: var(--accent-soft); }
.asst-compose { position: sticky; bottom: 0; z-index: 3; flex: 0 0 auto; margin-top: auto; padding: 10px 0 14px; background: var(--bg); border-top: 1px solid var(--line); }
.asst-compose textarea { width: 100%; resize: vertical; min-height: 56px; font-size: 14.5px; }
.asst-compose-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.asst-compose-opts { display: inline-flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; min-width: 0; }
.asst-compose-opts select { font-size: 12px; padding: 2px 22px 2px 6px; }
.asst-hint { font-size: 12px; color: var(--muted); }
.asst-thread.in-panel .asst-answer { font-size: 14.5px; }
.asst-thread.in-panel .asst-compose { background: var(--panel-2); padding: 10px 16px 12px; margin: 0 -16px; box-shadow: 0 -6px 12px -8px rgba(0,0,0,.45); }
.asst-thread.in-panel .asst-compose textarea { background: var(--panel); }
.asst-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; margin-top: 6px; }
@media (max-width: 800px) {
  .asst-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page.asst-page { padding-top: 16px; }
  .asst-list { position: static; max-height: none; overflow: visible; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .asst-head { padding-top: 6px; }
  .asst-main { min-height: 0; border-left: 0; padding-left: 0; }
  .asst-list ul { display: flex; gap: 6px; overflow-x: auto; }
  .asst-chat { flex: 0 0 auto; max-width: 220px; }
  .asst-msg.user { max-width: 92%; }
}
.asst-check { gap: 4px; cursor: pointer; }
.asst-more { flex-basis: 100%; }
.asst-more summary { display: inline-block; list-style: none; cursor: pointer; }
.asst-more summary::-webkit-details-marker { display: none; }
.asst-more textarea { width: 100%; margin-top: 6px; font-size: 13px; }

/* workspace: the Proposals and Sources panels */
.prop-queue-hd { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.prop-queue-hd .seg span.on { cursor: default; }
.cf-panel[data-kind="proposals"] .prop-row { padding: 9px 10px; }
.cf-panel[data-kind="proposals"] .prop-row .r { flex-wrap: wrap; justify-content: flex-end; }
.cf-panel[data-kind="sources"] .references { margin-top: 0; }
#proposals-main .seg, .prop-queue-hd .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
#proposals-main .seg > *, .prop-queue-hd .seg > * { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 6px; color: var(--fg); font: 700 12.5px var(--font-ui); text-decoration: none; white-space: nowrap; }
#proposals-main .seg a:hover, .prop-queue-hd .seg a:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
#proposals-main .seg .on, .prop-queue-hd .seg .on { background: var(--accent); color: var(--bg); }
.cf-panel[data-kind="sources"] .references h2 { font-size: 1.25rem; margin-top: 0; }
/* a long URL in a reference never widens the list past its column (narrow panels, phones) */
.ref-list, .ref-quotes { grid-template-columns: minmax(0, 1fr); }
.ref-list li { overflow-wrap: anywhere; }

/* the toolbar's Saved layouts menu */
.ws-saved-menu .menu-items { min-width: 260px; }
.ws-saved { display: grid; gap: 2px; }
.ws-saved-row { display: flex; align-items: stretch; gap: 2px; }
.ws-saved-row [data-cf-layout] { flex: 1; display: flex; align-items: center; gap: 8px; text-align: left; }
.ws-saved-row [data-cf-layout] .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-saved-row [data-cf-layout].on { box-shadow: inset 3px 0 0 var(--accent); font-weight: 700; }
.ws-saved-del { flex: 0 0 auto; width: 30px; justify-content: center; color: var(--muted); }
.ws-saved-del:hover { color: var(--danger); }
.ws-saved kbd { font: 600 11px var(--font-mono, monospace); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.ws-saved hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.ws-saved-empty, .ws-saved-keys { margin: 4px 10px; max-width: 30ch; }
.layout-save { display: grid; gap: 12px; }

/* the workspace on a phone (phase 5 step 1): one stack of panels as tabs, the rail as a bottom
   bar that scrolls sideways, a toolbar with only search, panels and the theme */
.ws-toolbar .menu > summary, .ws-toolbar > a.btn, .ws-layouts button { white-space: nowrap; }
@media (max-width: 1100px) {
  .ws-toolbar .crumb, .ws-toolbar .ws-layouts-k, .ws-toolbar > a.btn[href*="profile"] { display: none; }
  .ws-toolbar .site-search { flex: 1 1 160px; min-width: 0; }
}
/* the debate workspace scrolls as a page below 1024px; the wiki workspace (it boots from
   #cf-boot) keeps its fixed full height there, or the dock collapses */
@media (max-width: 1023px) { .ws-body:has(#cf-boot) { height: 100vh; height: 100dvh; overflow: hidden; } }
@media (max-width: 800px) {
  .ws-toolbar { gap: 8px; padding: 0 8px; }
  .ws-toolbar .menu > summary { white-space: nowrap; }
  .ws-toolbar .crumb, .ws-toolbar .ws-layouts, .ws-toolbar .ws-saved-menu, .ws-toolbar > a.btn[href*="profile"] { display: none; }
  .ws-toolbar .site-search { flex: 1 1 auto; min-width: 0; }
  .ws-toolbar .site-search input { width: 100%; min-width: 0; }
  .ws-toolbar .brand span { display: none; }
  .ws-main { flex-direction: column-reverse; }
  .ws-rail { flex: 0 0 auto; flex-direction: row; align-items: center; height: 54px; padding: 4px 6px; gap: 2px;
    overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--line);
    padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .ws-rail > button, .ws-rail-nav > a { flex: 0 0 44px; }
  .ws-rail-nav { flex-direction: row; }
  .ws-rail-sep { width: 0; height: 28px; border-top: 0; border-left: 1px solid var(--line); margin: 0 6px; }
  .ws-body #dock { padding: 0; }
  .ws-body .cf-dock-theme .dv-groupview { border: 0; border-radius: 0; }
  .ws-body .cf-dock-theme .dv-tab { padding: 0 12px; }
  .ws-body .drawer { width: 100vw; }
}

/* toasts (ui.js CF.toast) and reviewing proposals in order */
.cf-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(520px, calc(100vw - 32px)); }
.cf-toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow-pop); font-size: 13.5px; }
.cf-toast > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-toast .btn { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); background: transparent; }
@media (max-width: 800px) { .ws-body .cf-toasts { bottom: 66px; } }
.prop-actions kbd { font: 600 10.5px var(--font-mono, monospace); padding: 0 4px; margin-left: 4px; border: 1px solid currentColor; border-radius: 3px; opacity: .7; }
.prop-review-start { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.prop-done .prop-title { font-size: 1.05rem; }
.prop-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.prop-filters .chip { color: var(--fg); text-decoration: none; }
.prop-filters .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.prop-filters .chip[aria-current="page"] .muted { color: inherit; opacity: .8; }
.prop-filters-k { margin-left: 4px; }
.prop-section { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; background: var(--panel); }
.prop-section > summary { cursor: pointer; padding: 8px 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.prop-section > summary .prop-section-t { font-weight: 700; }
.prop-section[open] > summary { border-bottom: 1px solid var(--line); }
.prop-section > .prop-changes { padding: 6px 10px 10px; }
.prop-after .mark-word { display: inline-block; font: 700 10.5px var(--font-ui); text-transform: lowercase; padding: 0 6px; border-radius: 4px; margin-right: 6px; vertical-align: 2px; background: var(--accent-soft); color: var(--accent); }
.prop-after .after-new, .prop-after .after-changed { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; margin-left: -12px; }
.prop-after .after-new { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.prop-after-body .block { margin: 0 0 12px; }
.ib-after th { text-align: left; padding: 4px 10px 4px 0; color: var(--muted); font-weight: 600; }
.cf-panel[data-kind="review"] .prop-actions.reviewing { position: sticky; bottom: -10px; z-index: 2; background: var(--panel); padding: 10px 0; margin-bottom: -10px; border-top: 1px solid var(--line); }
/* the proposal on screen in the Review panel: a bar and a word, never colour alone */
.prop-row.is-current { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); background: var(--accent-soft); }
/* "Reviewing" as a tag on the row's top-right border, so the title never rewraps as you move */
.prop-row { position: relative; }
.prop-row.is-current::after { content: "Reviewing"; position: absolute; top: -9px; right: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 11px/16px var(--font-ui); pointer-events: none; }
.prop-queue .prop-list { gap: 13px; padding-top: 6px; }
/* a word replaced by another: keep a gap between what goes and what comes */
.prop-diff del + ins, .prop-diff ins + del { margin-left: .3em; }
/* an edited paragraph as two lines: now (what goes, struck) and proposed (what comes, marked) */
.prop-split { display: grid; gap: 6px; margin-top: 4px; }
.prop-split .prop-diff { display: block; padding: 6px 8px 6px 10px; border-radius: 6px; line-height: 1.6; }
.prop-split .was { background: color-mix(in srgb, var(--danger) 5%, transparent); border-left: 3px solid color-mix(in srgb, var(--danger) 55%, transparent); color: var(--muted); }
.prop-split .will { background: color-mix(in srgb, var(--ok) 6%, transparent); border-left: 3px solid var(--ok); }
.prop-split .lbl { display: block; font: 700 11.5px var(--font-ui); color: var(--muted); margin-bottom: 2px; }
.prop-split .was del { color: var(--fg); }
.prop-split .will ins { font-weight: 600; }
/* a paragraph in the article with a proposal laid over it: the badge on a line of its own
   above the text (not in the narrow number gutter), the proposed wording, then a quieter "now" */
.article .block.is-proposed { padding-top: 30px; }
.article .block.is-proposed .block-hdr .prop-badge { position: absolute; left: 52px; top: 0; white-space: nowrap; }
.block.is-proposed .prop-will ins { font-weight: 600; }
.block.is-proposed .prop-was { margin-top: 6px; font-size: .86em; color: var(--muted); padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.block.is-proposed .prop-was del { color: var(--fg); }
.block.is-proposed .prop-was .lbl { font: 700 11.5px var(--font-ui); margin-right: 4px; }
/* the workspace page never scrolls, not even by script (scrollIntoView reaches overflow:hidden
   ancestors, and slid the whole dock up leaving a gap below); panels scroll inside themselves */
html:has(> body.ws-body), body.ws-body { overflow: clip; }
/* a panel or dock container that took focus from a click shows no ring when a key is pressed:
   the active panel is already marked by its tab; buttons and links inside keep theirs */
.ws-body .dv-groupview:focus-visible, .ws-body .dv-content-container:focus-visible,
.ws-body .dv-view:focus-visible, .ws-body .cf-panel:focus-visible, .ws-body [tabindex="-1"]:focus-visible { outline: none; }
/* the queue row's right side: the votes on one line, the status beneath them */
.prop-queue .prop-row .r { display: grid; grid-template-columns: auto auto; justify-items: end; align-content: center; gap: 4px 10px; }
.prop-queue .prop-row .r .prop-state { grid-column: 1 / -1; }

/* a site page in the workspace's page panel: the panel already carries the text zoom */
.cf-panel .page-fragment { zoom: 1; margin: 0 auto; padding: 16px 20px 40px; }

/* assistant jobs (phase 5 step 3) */
.jobs-page .job-new { display: grid; gap: 10px; margin: 14px 0 26px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.jobs-page .job-new textarea { width: 100%; font: 14px/1.5 var(--font-ui); }
.jobs-page .job-opts { flex-wrap: wrap; align-items: end; }
.jobs-page .job-opts label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.jobs-page .job-opts .grow { flex: 1 1 200px; }
.job-list { display: grid; gap: 8px; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); text-decoration: none; }
.job-row .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-bar { display: block; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.job-bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.job-bar.big { height: 8px; flex: 1; }
.job-head { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.job-state { font: 700 12px var(--font-ui); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.job-state.st-running { border-color: var(--accent); color: var(--accent); }
.job-state.st-paused { border-color: var(--warn); color: var(--warn); }
.job-state.st-done { border-color: var(--ok); color: var(--ok); }
.job-state.st-draft { border-style: dashed; color: var(--muted); }
.job-state.st-cancelled { color: var(--muted); }
.job-ctl { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.job-head { flex-wrap: wrap; }
.job-head .job-bar.big { min-width: 160px; }
details.job-instr { margin: 6px 0 12px; font-size: 13.5px; color: var(--muted); }
details.job-instr summary { cursor: pointer; font-weight: 700; }
details.job-instr p { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); }
.job-page { container-type: inline-size; }
.jobs-page .grow { flex: 1; }
.job-top { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.job-top h1 { margin: 0; font-size: 24px; }
.job-crumb { flex-basis: 100%; margin: 0; font-size: 12.5px; }
.job-intro { max-width: 70ch; }
.lbl { display: block; margin: 0 0 6px; padding: 0; font: 700 12px var(--font-ui); color: var(--muted); }
.help { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.linkish { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* the draft (the Jobs 1 board): pages on the left, what to do and how on the right */
.job-draft-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 8px; align-items: start; }
@container (max-width: 820px) { .job-draft-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .job-draft-grid { grid-template-columns: minmax(0, 1fr); } }
.job-grp { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.job-grp > .hd { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font: 700 13px var(--font-ui); }
.job-grp > .hd .hint { font-weight: 600; font-size: 12px; color: var(--muted); }
.job-drows { list-style: none; margin: 0; padding: 0; }
.job-drow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 150px 32px; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.job-drow .grip { width: 22px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); font: 700 13px var(--font-mono); letter-spacing: -2px; cursor: grab; }
.job-drow .grip:hover, .job-drow .grip:focus-visible { background: var(--panel-2); color: var(--fg); }
.job-drow .t { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-drow .t a { color: inherit; text-decoration: none; }
.job-drow .t a:hover { text-decoration: underline; }
.job-drow select { width: 100%; font-size: 12.5px; }
.job-drow .x { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 17px; cursor: pointer; }
.job-drow .x:hover, .job-drow .x:focus-visible { background: var(--panel-2); color: var(--danger); }
.job-drow.dragging { opacity: .45; }
.job-drow.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.job-drow.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
@container (max-width: 560px) {
  .job-drow { grid-template-columns: 22px minmax(0, 1fr) 32px; row-gap: 4px; }
  .job-drow .chips { grid-column: 2; grid-row: 2; }
  .job-drow select { grid-column: 2; grid-row: 3; max-width: 240px; }
  .job-drow .x { grid-column: 3; grid-row: 1; }
}
.job-empty { padding: 14px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.jchip { display: inline-block; font: 700 11.5px var(--font-ui); padding: 2px 9px; border-radius: 999px; white-space: nowrap; color: var(--muted); background: var(--panel-2); }
.jchip.new { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--panel)); }
.jchip.has { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.jchip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, var(--panel)); }
.job-add { display: grid; gap: 8px; padding: 12px 14px; }
.job-add textarea, .job-how textarea { width: 100%; box-sizing: border-box; font: 13.5px/1.5 var(--font-ui); }
.job-how { display: grid; gap: 18px; padding: 14px; }
.job-seg-f { border: 0; margin: 0; padding: 0; min-width: 0; }
.job-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.job-seg label { position: relative; }
.job-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.job-seg span { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 12px; border-radius: 6px; font: 700 12.5px var(--font-ui); color: var(--fg); }
.job-seg input:checked + span { background: var(--accent); color: var(--on-accent, #fff); }
.job-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.job-opts { display: flex; gap: 14px; flex-wrap: wrap; }
.job-opts label { display: grid; gap: 4px; font: 700 12px var(--font-ui); color: var(--muted); }
.job-opts .grow { flex: 1 1 180px; }
.job-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.job-foot .sum { font-size: 12.5px; }
.job-foot .grow { flex: 1; }
/* running: one card per page */
.job-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.job-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.job-card .ch { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.job-card .ch .t { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card .ch .t a { color: inherit; }
.job-card .cb { display: grid; gap: 8px; padding: 10px 12px; font-size: 13px; flex: 1; align-content: start; }
.job-card .meta { margin: 0; font-size: 12px; color: var(--muted); }
.job-card.st-running { border-color: var(--accent); }
.job-card.st-waiting { border-color: var(--warn); }
.job-card.st-done { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.job-card.st-failed { border-color: var(--danger); }
.job-card.st-skipped { opacity: .65; }
.job-sum-card { border-style: dashed; }
.jst { font: 800 11.5px var(--font-ui); padding: 2px 9px; border-radius: 999px; white-space: nowrap; color: var(--muted); background: var(--panel); }
.jst.st-running { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.jst.st-waiting { color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, var(--panel)); }
.jst.st-done { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--panel)); }
.jst.st-failed { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--panel)); }
.job-run .job-head { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.job-plan { font: 13.5px/1.55 var(--font-prose, serif); padding: 8px 10px; border-left: 3px solid var(--warn); border-radius: 6px; background: var(--panel-2); max-height: 14em; overflow: auto; }
.job-trail { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.job-trail li { display: flex; gap: 8px; align-items: baseline; }
.job-trail .dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--ok); }
.job-trail li.now { color: var(--fg); }
.job-trail li.now .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.job-err { margin: 0; color: var(--danger); }
.job-props { display: flex; gap: 6px; flex-wrap: wrap; }
.job-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: start; margin-top: auto; }
.job-reply[open] { flex-basis: 100%; order: 9; }
.job-reply summary { list-style: none; display: inline-flex; align-items: center; }
.job-reply summary::-webkit-details-marker { display: none; }
.job-reply[open] summary { margin-bottom: 6px; }
.job-reply form { display: grid; gap: 6px; justify-items: start; }
.job-reply textarea { width: 100%; font: 13.5px/1.5 var(--font-ui); }
.prop-batch { padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); }
.panel-failed { display: grid; justify-items: start; gap: 8px; padding: 16px; color: var(--muted); }

/* the assistant's full page in a workspace tab: the chat list and the conversation each scroll
   on their own; the settings bar and the box to write in stay put and span the whole column,
   as in the side Assistant panel */
.cf-panel[data-kind="page"]:has(> .page-fragment.asst-page) { padding: 0; overflow: hidden; }
.cf-panel > .page-fragment.asst-page { height: 100%; max-width: none; margin: 0; padding: 0; box-sizing: border-box; }
.cf-panel .asst-page .asst-layout { height: 100%; }
.cf-panel .asst-page .asst-list { position: static; height: 100%; max-height: none; box-sizing: border-box; padding: 14px 14px 12px; overflow-y: auto; }
.cf-panel .asst-page .asst-main { height: 100%; min-height: 0; padding-left: 0; display: flex; flex-direction: column; }
.cf-panel .asst-page .asst-head { position: static; flex: 0 0 auto; margin: 0; padding: 10px 18px; background: var(--panel-2); box-shadow: 0 6px 12px -8px rgba(0,0,0,.45); z-index: 2; }
.cf-panel .asst-page .asst-thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cf-panel .asst-page .asst-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 18px; }
.cf-panel .asst-page .asst-compose { position: static; flex: 0 0 auto; margin: 0; padding: 10px 18px 12px; background: var(--panel-2); box-shadow: 0 -6px 12px -8px rgba(0,0,0,.45); }
.cf-panel .asst-page .asst-compose textarea { background: var(--panel); }
.cf-panel .asst-page .asst-welcome { overflow-y: auto; padding: 18px 22px; }
/* a narrow tab gives the conversation the room: a slimmer list, then none (New chat and Jobs
   stay reachable from the side panel and the rail) */
.cf-panel > .page-fragment.asst-page { container-type: inline-size; }
@container (max-width: 820px) { .asst-page .asst-layout { grid-template-columns: 200px minmax(0, 1fr); } }
@container (max-width: 560px) { .asst-page .asst-layout { grid-template-columns: minmax(0, 1fr); } .asst-page .asst-list { display: none; } }
.seltool button.danger { color: #FF8A7A; }
.asst-hint kbd { font: 600 10.5px var(--font-mono, monospace); padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; }
.asst-start { display: grid; gap: 8px; margin-top: 18px; max-width: 760px; }
.asst-start textarea { width: 100%; min-height: 84px; resize: vertical; font-size: 14.5px; }
.asst-start-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-opts input { height: 34px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 600 13.5px var(--font-ui); min-width: 0; }
.job-run .job-head .job-bar.big { flex: 1 1 160px; }
