/* PaperOS Learn — the Knowledge Center in Paper Pilot's design language.
   Type carries rank, shape carries kind, and space carries relationship. */

:root {
  --bg: #0a0a0c;
  --bg-raised: #101014;
  --surface: #141418;
  --surface-2: #1a1a1f;
  --surface-3: #22222a;
  --border: #26262d;
  --border-strong: #34343c;
  --border-subtle: #1d1d22;
  --seam: #7a4f72;
  --seam-wash: rgba(122, 79, 114, .12);
  --text: #ededef;
  --text-strong: #ffffff;
  --text-muted: #b0b0b8;
  --text-subtle: #808088;
  --gold: #d4a72c;
  --gold-hover: #e6b836;
  --gold-soft: #f5d57a;
  --gold-deep: #b88b1e;
  --gold-04: rgba(212, 167, 44, 0.04);
  --gold-08: rgba(212, 167, 44, 0.08);
  --gold-15: rgba(212, 167, 44, 0.15);
  --gold-25: rgba(212, 167, 44, 0.25);
  --gold-40: rgba(212, 167, 44, 0.4);
  --structure-line: var(--gold);
  --structure-line-soft: var(--gold-25);
  --structure-wash: var(--gold-04);
  --lamp-edge: rgba(212, 167, 44, .48);
  --lamp-edge-color: var(--gold-deep);
  --lamp-mid-color: #ffe488;
  --lamp-core-color: #fff8d7;
  --lamp-tight: rgba(255, 234, 157, .48);
  --lamp-tight-soft: rgba(212, 167, 44, .14);
  --lamp-cast: rgba(255, 226, 126, .20);
  --lamp-cast-soft: rgba(212, 167, 44, .07);
  --lamp-shadow: rgba(212, 167, 44, .52);
  --lamp-shadow-soft: rgba(212, 167, 44, .24);
  --success: #4fb36e;
  --warn: #edb058;
  --error: #ea6660;
  --info: #6db9e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
  --sans: 'Geist', system-ui, sans-serif;
  --serif: Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sp-tight: 4px;
  --sp-fact: 14px;
  --sp-group: 28px;
}

/* Transcript Extractor's Cool Mist theme. An explicit dark choice only
   replaces these tokens; new visitors start here via data-theme="light". */
html[data-theme='light'] {
  --bg: #edf2fa;
  --bg-raised: #f5f8fc;
  --surface: #faf7ec;
  --surface-2: #f4f0de;
  --surface-3: #ede7cd;
  --border: #e2dbc2;
  --border-strong: #cfc5a4;
  --border-subtle: #ede7d2;
  --seam: #bf746f;
  --seam-wash: rgba(191, 116, 111, .20);
  --text: #1a1f2e;
  --text-strong: #0a0f1c;
  --text-muted: #3d4a5e;
  --text-subtle: #6b7489;
  --gold-soft: #8a6410;
  --gold-04: rgba(212, 167, 44, .08);
  --gold-08: rgba(212, 167, 44, .14);
  --gold-15: rgba(212, 167, 44, .22);
  --gold-25: rgba(212, 167, 44, .38);
  --gold-40: rgba(212, 167, 44, .55);
  --structure-line: #bf746f;
  --structure-line-soft: rgba(191, 116, 111, .48);
  --structure-wash: rgba(191, 116, 111, .10);
  --lamp-edge: rgba(174, 91, 86, .58);
  --lamp-edge-color: #ae5b56;
  --lamp-mid-color: #e9a59e;
  --lamp-core-color: #fff8f4;
  --lamp-tight: rgba(233, 165, 158, .62);
  --lamp-tight-soft: rgba(191, 116, 111, .22);
  --lamp-cast: rgba(207, 126, 119, .22);
  --lamp-cast-soft: rgba(160, 105, 101, .08);
  --lamp-shadow: rgba(191, 116, 111, .48);
  --lamp-shadow-soft: rgba(171, 111, 106, .22);
  --success: #157f4c;
  --warn: #9a6a12;
  --error: #bb3a2e;
  --info: #1a6ba8;
  --shadow-sm: 0 1px 2px rgba(140, 105, 20, .08);
  --shadow-md: 0 4px 20px rgba(140, 105, 20, .10), 0 1px 2px rgba(26, 31, 46, .04);
  --shadow-lg: 0 12px 40px rgba(140, 105, 20, .14), 0 2px 6px rgba(26, 31, 46, .06);
}

* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
html[data-theme='light'] { color-scheme: light; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--sans);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 360px at 50% -8%, rgba(212, 167, 44, 0.075), transparent 70%),
    radial-gradient(650px 380px at 100% 100%, rgba(122, 79, 114, 0.055), transparent 72%);
}
html[data-theme='light'] body::before {
  background:
    radial-gradient(circle at 85% -10%, rgba(191, 116, 111, .10), transparent 55%),
    radial-gradient(circle at 10% 110%, rgba(123, 151, 184, .07), transparent 45%);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [contenteditable]:focus-visible, a:focus-visible, .csv-dialog-body:focus-visible {
  outline: 2px solid var(--gold-40);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
::selection { background: var(--gold-40); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.machine {
  font: 500 10.5px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow { color: var(--gold-soft); margin-bottom: 13px; }

/* Learn keeps Paper Pilot's gold thread, but its light is architectural rather
   than interactive: a small recessed source fixed beneath the top edge, with
   a tight halo and a soft downward cast. It never follows the pointer. */
#thread {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 2px;
  flex: none;
  background: linear-gradient(90deg, transparent, var(--structure-line-soft) 18%, var(--structure-line) 50%, var(--structure-line-soft) 82%, transparent);
}
#thread-glow {
  position: absolute;
  z-index: 1;
  top: -1px;
  left: 50%;
  width: 70px;
  height: 5px;
  transform: translateX(-50%);
  border: 1px solid var(--lamp-edge);
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(90deg, var(--lamp-edge-color), var(--lamp-mid-color) 24%, var(--lamp-core-color) 50%, var(--lamp-mid-color) 76%, var(--lamp-edge-color));
  box-shadow: 0 2px 6px var(--lamp-shadow), 0 5px 16px var(--lamp-shadow-soft);
  pointer-events: none;
}
#thread-glow::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -5px;
  left: 50%;
  width: 180px;
  height: 28px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 15%, var(--lamp-tight), var(--lamp-tight-soft) 38%, transparent 72%);
  filter: blur(3px);
}
#thread-glow::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 3px;
  left: 50%;
  width: 300px;
  height: 78px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, var(--lamp-cast), var(--lamp-cast-soft) 38%, transparent 72%);
  filter: blur(5px);
}
html[data-theme='light'] #thread-glow::before { opacity: .72; }
html[data-theme='light'] #thread-glow::after { opacity: .62; }
#topbar {
  position: relative;
  z-index: 80;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-group);
  padding: 17px 28px 15px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 10, 12, .84);
  backdrop-filter: blur(16px);
}
html[data-theme='light'] #topbar { background: rgba(237, 242, 250, .82); }
.brand {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand img { width: 22px; height: 22px; flex: none; transform: translateY(4px); opacity: .94; }
.brand-name { font: 400 26px/1 var(--serif); color: var(--text-strong); letter-spacing: .01em; white-space: nowrap; }
.brand-name em { color: var(--gold-soft); font-style: normal; }
.brand-context {
  padding-left: 5px;
  color: var(--text-subtle);
  font: 500 10.5px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .13em;
  white-space: nowrap;
}
.topnav { display: flex; align-items: center; gap: var(--sp-fact); }
.topnav a {
  position: relative;
  color: var(--text-subtle);
  font-size: 12.5px;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.topnav a:hover { color: var(--text); }
.topnav a[aria-current='page'] { color: var(--text-strong); }
.topnav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: var(--gold);
}
.topnav .manage-link {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.topnav .manage-link:hover { color: var(--gold-soft); border-color: var(--gold-25); background: var(--gold-04); }
.topbar-right { min-width: 0; display: flex; align-items: center; gap: var(--sp-group); }
.theme-toggle {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-subtle);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.theme-toggle:hover { color: var(--gold-soft); border-color: var(--gold-25); background: var(--gold-04); }
.theme-toggle:active { transform: rotate(18deg) scale(.94); }
.theme-toggle .theme-sun { display: block; }
.theme-toggle .theme-moon { display: none; }
html[data-theme='light'] .theme-toggle .theme-sun { display: none; }
html[data-theme='light'] .theme-toggle .theme-moon { display: block; }
.session { position: relative; min-width: 0; flex: none; display: flex; align-items: center; gap: 10px; }
.session #who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-subtle); font: 10.5px var(--mono); }
.session-menu-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--text-subtle);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 16px;
  line-height: 1;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.session-menu-button:hover, .session-menu-button[aria-expanded='true'] { color: var(--text); border-color: var(--border-strong); }
.session-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 190px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-lg);
}
.session-menu[hidden] { display: none; }
.session-name {
  padding: 7px 9px 8px;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font: 11px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-menu a, .session-menu button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font: 12.5px var(--sans);
  text-align: left;
}
.session-menu a:hover, .session-menu button:hover, .session-menu a[aria-current='page'] { color: var(--text); background: var(--gold-08); }
.session-menu #signout { margin-top: 4px; color: var(--text-subtle); border-top: 1px solid var(--border-subtle); border-radius: 0 0 5px 5px; }

.site-footer {
  width: 100%;
  max-width: 1440px;
  margin: auto auto 0;
  padding: 22px 28px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-fact);
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  font: 400 13px var(--serif);
}
.site-footer .machine { font-family: var(--mono); font-size: 9px; }
.public-footer { display: grid; grid-template-columns: 1fr auto; }
.site-disclaimer {
  grid-column: 1 / -1;
  max-width: 110ch;
  color: var(--text-muted);
  font: 400 13px/1.65 var(--sans);
}

/* The last door: the same meme treatment Paper Pilot uses for exceptions,
   set inside Learn's light/dark shell for retired and mistyped page URLs. */
.not-found-main {
  width: 100%;
  max-width: 760px;
  min-height: min(710px, calc(100vh - 170px));
  margin: 0 auto;
  padding: 56px 28px 72px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.not-found-main .fatal-meme {
  width: min(100%, 420px);
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 12px;
}
.not-found-main .fatal-meme img {
  display: block;
  width: 100%;
  border-radius: 12px;
}
.not-found-main .fatal-meme figcaption {
  margin-top: 16px;
  color: var(--text-strong);
  font: 700 21px/1.3 var(--sans);
  letter-spacing: .01em;
}
.not-found-main .eyebrow { margin-bottom: 16px; }
.not-found-main h1 {
  max-width: 12ch;
  color: var(--text-strong);
  font: 400 clamp(42px, 7vw, 64px)/.98 var(--serif);
  letter-spacing: -.02em;
}
.not-found-copy {
  max-width: 50ch;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}
.not-found-main .button { margin-top: 26px; min-width: 210px; }

/* Admin pages are capability-first: their controls do not enter the visual or
   accessibility tree until a protected request confirms the current login. */
.admin-app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.admin-app[hidden] { display: none; }
.admin-gate {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.admin-gate .loading-state { min-height: auto; max-width: 560px; text-align: center; }
.admin-gate-failed { min-height: 100vh; }
.access-denied-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.not-found-main .access-denied-actions .button { margin-top: 0; }

/* Public library: a stable rail and a content room. */
.public-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: var(--sp-group);
  flex: 1;
  align-items: start;
}
.rail-panel {
  position: sticky;
  top: 30px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  animation: rise .32s var(--ease) both;
}
.rail-heading {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--gold-04), transparent);
  color: var(--text-subtle);
}
.rail-home { color: var(--text-subtle); transition: color .15s var(--ease); }
.rail-home:hover { color: var(--gold-soft); }
.rail-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
}
.rail-toggle span { color: var(--gold-soft); transition: transform .18s var(--ease); }
.rail-panel[data-open='true'] .rail-toggle span { transform: rotate(180deg); }
.rail { padding: 8px; }
.rail ul { list-style: none; }
.rail li { margin: 1px 0; }
.rail a {
  display: block;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color .14s var(--ease), background .14s var(--ease);
}
.rail a:hover { color: var(--text); background: var(--surface); }
.rail a.current { color: var(--gold-soft); background: var(--gold-08); font-weight: 600; }
.rail details > summary { list-style: none; display: flex; align-items: center; cursor: pointer; }
.rail details > summary::-webkit-details-marker { display: none; }
.rail details > summary a { flex: 1; min-width: 0; }
.rail details > summary::after {
  content: '›';
  flex: none;
  padding: 0 10px;
  color: var(--text-subtle);
  font-size: 18px;
  transition: transform .15s var(--ease), color .15s var(--ease);
}
.rail details[open] { background: var(--surface); border-radius: 6px; }
.rail details[open] > summary::after { transform: rotate(90deg); color: var(--gold-soft); }
.rail details ul { padding: 0 0 7px 17px; border-left: 1px solid var(--seam); margin-left: 14px; }
.rail details ul a { padding: 5px 9px; color: var(--text-subtle); font-size: 12.5px; }
.rail-loading { padding: 10px; color: var(--text-subtle); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }

.public-main { min-width: 0; animation: rise .38s var(--ease) both; }

/* Home */
.hero {
  position: relative;
  min-height: 330px;
  padding: clamp(46px, 7vw, 88px) clamp(28px, 7vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.hero::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  right: -90px;
  top: -140px;
  border: 1px solid var(--structure-line-soft);
  border-radius: 50%;
  box-shadow: 0 0 100px var(--structure-wash), inset 0 0 90px var(--structure-wash);
}
.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: var(--text-strong);
  font: 400 clamp(44px, 6.5vw, 78px)/.98 var(--serif);
  letter-spacing: -.025em;
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}
.knowledge-search { position: relative; z-index: 2; width: min(720px, 100%); margin-top: 28px; }
.search-control {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 17px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.search-control:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-15), var(--shadow-sm); background: var(--surface); }
.search-control > svg { color: var(--text-subtle); }
.search-control input { width: 100%; min-width: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 14px; }
.search-control button {
  min-height: 38px;
  padding: 7px 15px;
  color: #0a0a0c;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 7px;
  font-weight: 600;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.search-control button:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.search-results { max-height: min(520px, 58vh); margin-top: 8px; overflow-x: hidden; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-md); }
.search-results > header { padding: 10px 14px 8px; color: var(--text-subtle); border-bottom: 1px solid var(--border-subtle); }
.search-result {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background .14s var(--ease);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--gold-04); }
.search-result.keyboard-active { background: var(--gold-08); outline: 1px solid var(--gold-25); outline-offset: -1px; }
.search-result-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.search-result-copy strong { overflow: hidden; color: var(--text); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy > span { font-weight: 700; overflow: hidden; color: var(--text-subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-location { max-width: 165px; color: var(--text-subtle); text-align: right; }
.search-result-arrow { color: var(--text-subtle); transition: color .15s var(--ease), transform .15s var(--ease); }
.search-result:hover .search-result-arrow { color: var(--gold-soft); transform: translateX(3px); }
.hero-rule { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--border-subtle); }
.hero-rule span { display: block; width: 34%; height: 100%; background: linear-gradient(90deg, var(--structure-line), var(--structure-line-soft), transparent); }
.directory { margin-top: 36px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-group);
  margin-bottom: 16px;
}
.section-heading .machine { color: var(--text-subtle); margin-bottom: var(--sp-tight); }
.section-heading h2 { color: var(--text-strong); font: 600 18px/1.3 var(--sans); }
.section-note { color: var(--text-subtle); font: 11px var(--mono); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.category-card {
  min-height: 146px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: transform .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.category-card:hover { transform: translateY(-2px); border-color: var(--gold-25); background: var(--surface); }
.category-card .card-index { color: var(--gold); font: 500 10px var(--mono); letter-spacing: .08em; }
.category-card h3 { margin-top: 20px; color: var(--text-strong); font: 600 15px/1.3 var(--sans); }
.category-card p { margin-top: 6px; color: var(--text-subtle); font-size: 12.5px; }
.category-card .card-arrow { margin-top: auto; align-self: flex-end; color: var(--text-subtle); transition: color .15s var(--ease), transform .15s var(--ease); }
.category-card:hover .card-arrow { color: var(--gold-soft); transform: translateX(3px); }

/* Category listing */
.page-intro {
  padding: 40px 42px 34px;
  background: linear-gradient(180deg, var(--structure-wash), transparent 75%), var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
}
.page-intro h1 { color: var(--text-strong); font: 400 clamp(38px, 5vw, 58px)/1.05 var(--serif); letter-spacing: -.015em; }
.page-summary { margin-top: 15px; display: flex; align-items: center; gap: var(--sp-fact); color: var(--text-subtle); font-size: 13px; }
.summary-rule { width: 28px; height: 1px; background: var(--seam); }
.article-groups {
  padding: 12px 42px 38px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.article-groups h2.subcategory {
  margin: 28px 0 8px;
  padding-top: 19px;
  border-top: 1px solid var(--seam);
  color: var(--gold-soft);
  font: 500 10.5px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.article-list { list-style: none; }
.article-list li { position: relative; padding: 15px 34px 15px 0; border-bottom: 1px solid var(--border-subtle); }
.article-list li:last-child { border-bottom: 0; }
.article-list li::after { content: '→'; position: absolute; right: 4px; top: 17px; color: var(--text-subtle); transition: color .15s var(--ease), transform .15s var(--ease); }
.article-list li:hover::after { color: var(--gold-soft); transform: translateX(3px); }
.article-list a { color: var(--text); font: 600 14px/1.4 var(--sans); transition: color .15s var(--ease); }
.article-list a:hover { color: var(--gold-soft); }
.article-list .sub { font-weight: 700; max-width: 760px; margin-top: 5px; color: var(--text-subtle); font-size: 12.5px; line-height: 1.55; }
.article-list-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 2px;
  color: var(--gold-soft);
  background: transparent;
  border: 0;
  font: 600 12.5px/1.3 var(--sans);
  transition: color .15s var(--ease);
}
.article-list-toggle:hover { color: var(--gold); }
.article-list-toggle .toggle-arrow { color: var(--text-subtle); font-size: 8px; }

/* Article */
.breadcrumb { display: flex; align-items: center; gap: 9px; margin: 5px 0 14px; color: var(--text-subtle); }
.article-main .breadcrumb { flex-wrap: wrap; overflow: visible; white-space: normal; }
.article-main .breadcrumb a { overflow: visible; overflow-wrap: anywhere; }
.breadcrumb a:hover { color: var(--gold-soft); }
.breadcrumb span { color: var(--border-strong); }
.article-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.article-header { padding: clamp(34px, 6vw, 66px) clamp(28px, 7vw, 72px) 34px; border-bottom: 1px solid var(--seam); background: linear-gradient(180deg, var(--structure-wash), transparent); }
.article-header h1 { max-width: 850px; color: var(--text-strong); font: 400 clamp(38px, 5.5vw, 62px)/1.06 var(--serif); letter-spacing: -.018em; }
.article-subtitle { font-weight: 700; max-width: 720px; margin-top: 18px; color: var(--text-muted); font-size: 16px; line-height: 1.6; }
.article-updated { margin-top: 18px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.article-body { max-width: 820px; padding: 42px clamp(28px, 7vw, 72px) 64px; color: var(--text-muted); font-size: 15.5px; line-height: 1.75; overflow-wrap: anywhere; }
.article-body :where(p, li, span, div, strong, em, td, th) { color: inherit !important; background-color: transparent !important; font-family: inherit !important; }
.article-body :where(h1, h2, h3, h4) { color: var(--text-strong) !important; background: transparent !important; font-family: var(--sans) !important; line-height: 1.3; }
.article-body h1 { margin: 34px 0 12px; font-size: 26px !important; }
.article-body h2 { margin: 32px 0 11px; font-size: 21px !important; }
.article-body h3 { margin: 26px 0 9px; font-size: 17px !important; }
.article-body .section-divider-heading::before {
  content: '';
  display: block;
  width: min(100%, 680px);
  height: 1px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, var(--seam) 0%, var(--seam) 22%, transparent 100%);
}
.article-body p, .article-body ul, .article-body ol, .article-body table, .article-body blockquote { margin: 14px 0; }
.article-body > :first-child { margin-top: 0 !important; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li + li { margin-top: 5px; }
.article-body ol, .editor-document .body ol { list-style-type: decimal; }
.article-body ol ol, .editor-document .body ol ol { list-style-type: lower-alpha; }
.article-body ol ol ol, .editor-document .body ol ol ol { list-style-type: lower-roman; }
.article-body ol ol ol ol, .editor-document .body ol ol ol ol { list-style-type: upper-alpha; }
.article-body ol ol ol ol ol, .editor-document .body ol ol ol ol ol { list-style-type: upper-roman; }
.article-body a { color: var(--gold-soft) !important; text-decoration: underline; text-decoration-color: var(--gold-25); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--gold-soft); }
.article-body .article-callout { width: min(100%, 680px); margin: 24px 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; }
.article-body .article-callout :where(p, ul, ol) { margin-top: 0; margin-bottom: 0; }
/* Callouts change the container, not the article's list structure. Leave
   markers and nested numbering intact, with room inside the clipped card. */
.article-body .article-callout :where(ul, ol) { padding-left: 24px; }
.article-body .article-callout li { margin: 0; }
.article-body .article-callout-action strong, .article-body .article-callout-related li strong { display: block; width: 100%; }
.article-body .article-callout-action {
  padding: 0;
  border-left: 3px solid var(--gold);
  background-image: linear-gradient(100deg, var(--gold-08), var(--gold-04));
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.article-body .article-callout-action:hover { border-color: var(--gold-40); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.article-body .article-callout-action > p:not(:has(a)) { padding: 14px 20px 0; color: var(--text-subtle) !important; font-size: 12px; }
.article-body .article-callout-action a {
  min-height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  color: var(--text-strong) !important;
  text-decoration: none;
}
.article-body .article-callout-action a::after { content: '→'; flex: none; color: var(--gold); font-size: 19px; font-weight: 400; transition: transform .15s var(--ease); }
.article-body .article-callout-action a:hover::after { transform: translateX(3px); }
.article-body .article-callout-related {
  padding: 18px 20px;
  border-left: 2px solid var(--seam);
  background-image: linear-gradient(100deg, var(--seam-wash), var(--gold-04));
}
.article-body .article-callout-related > p:first-child:not(:only-child) { margin-bottom: 8px; color: var(--text-strong) !important; font-weight: 650; }
.article-body .article-callout-related a { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 6px 0; color: var(--text) !important; text-decoration: none; }
.article-body .article-callout-related a::after { content: '→'; flex: none; color: var(--seam); transition: color .15s var(--ease), transform .15s var(--ease); }
.article-body .article-callout-related a:hover { color: var(--gold-soft) !important; }
.article-body .article-callout-related a:hover::after { color: var(--gold); transform: translateX(3px); }
.article-body :is(ul, ol).article-callout { padding-left: 44px; }
.article-body .article-callout-action > :where(ul, ol) { padding: 0 20px 0 44px; }
.article-body .article-callout-action li a { min-height: 0; padding: 12px 0; }
.article-body .article-callout-caution { padding: 16px 18px; border-left: 3px solid var(--warn); background-image: linear-gradient(100deg, rgba(237, 176, 88, .10), transparent); }
.article-body strong, .article-body b { color: var(--text) !important; font-weight: 650; }
.article-body blockquote { padding: 14px 18px; border-left: 2px solid var(--gold); background: var(--gold-04); color: var(--text); }
.article-body img { display: block; max-width: 100%; height: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: 8px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.article-body th, .article-body td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; }
.article-body th { color: var(--text) !important; background: var(--surface) !important; }
.article-body pre { max-width: 100%; overflow-x: auto; padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; color: var(--text); }
.article-body code { font-family: var(--mono) !important; color: var(--gold-soft) !important; }
.related-articles { max-width: 820px; margin: 0 clamp(28px, 7vw, 72px) 40px; padding-top: 25px; border-top: 1px solid var(--seam); }
.related-articles[hidden] { display: none; }
.related-articles header { margin-bottom: 10px; }
.related-articles header .machine { margin-bottom: 5px; color: var(--text-subtle); }
.related-articles h2 { color: var(--text-strong); font: 600 18px/1.3 var(--sans); }
.related-articles ul { list-style: none; }
.related-articles li + li { border-top: 1px solid var(--border-subtle); }
.related-articles a { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 11px 2px; }
.related-articles a > span:first-child { min-width: 0; display: grid; gap: 3px; }
.related-articles strong { color: var(--text); font: 600 13.5px/1.4 var(--sans); transition: color .15s var(--ease); }
.related-articles small { color: var(--text-subtle); font: 500 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .045em; }
.related-articles .related-arrow { flex: none; color: var(--seam); font-size: 17px; transition: color .15s var(--ease), transform .15s var(--ease); }
.related-articles a:hover strong { color: var(--gold-soft); }
.related-articles a:hover .related-arrow { color: var(--gold); transform: translateX(3px); }
.article-feedback { max-width: 820px; margin: 0 clamp(28px, 7vw, 72px) 46px; padding-top: 25px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; border-top: 1px solid var(--seam); }
.article-feedback[hidden] { display: none; }
.article-feedback .machine { margin-bottom: 5px; color: var(--text-subtle); }
.article-feedback h2 { color: var(--text-strong); font: 600 17px/1.3 var(--sans); }
.feedback-actions { display: flex; align-items: center; gap: 8px; }
.feedback-actions button { min-width: 76px; min-height: 38px; padding: 8px 13px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; font: 600 12.5px var(--sans); transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
.feedback-actions button span { margin-right: 4px; color: var(--text-subtle); }
.feedback-actions button:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.feedback-actions button.selected { color: var(--gold-soft); background: var(--gold-08); border-color: var(--gold-40); }
.feedback-actions button.selected span { color: var(--gold); }
.feedback-actions button:disabled { opacity: .5; cursor: wait; transform: none; }
.feedback-status { grid-column: 1 / -1; color: var(--text-subtle); font-size: 11.5px; }
.feedback-comment { grid-column: 1 / -1; width: min(100%, 620px); margin-top: 7px; padding: 17px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 8px; }
.feedback-comment[hidden] { display: none; }
.feedback-comment label { display: block; margin-bottom: 9px; color: var(--text); font-size: 12.5px; }
.feedback-comment label span { margin-left: 5px; color: var(--text-subtle); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.feedback-comment textarea { width: 100%; min-height: 82px; resize: vertical; padding: 10px 11px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font: 400 13px/1.5 var(--sans); }
.feedback-comment textarea:focus { outline: 2px solid var(--gold-15); border-color: var(--gold-40); }
.feedback-comment textarea::placeholder { color: var(--text-subtle); }
.feedback-comment-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.feedback-comment-footer > span { color: var(--text-subtle); }
.feedback-comment-footer button { min-height: 34px; padding: 7px 12px; color: #0a0a0c; background: var(--gold); border: 1px solid var(--gold); border-radius: 6px; font: 600 12px var(--sans); }
.feedback-comment-footer button:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.feedback-comment-footer button:disabled { opacity: .4; cursor: default; }
.article-end { margin: 18px 0 26px; padding: 24px 28px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-fact); background: var(--gold-04); border: 1px solid var(--gold-15); border-radius: 8px; color: var(--text-muted); }
.article-end .end-mark { color: var(--gold); font-size: 18px; }
.article-end a { color: var(--gold-soft); font-weight: 600; }
.notice { padding: 26px 0; color: var(--text-subtle); }


/* Editorial workspace */
.manage-shell, .editor-shell { width: 100%; max-width: 1420px; margin: 0 auto; padding: 28px; flex: 1; }
.manage-shell { max-width: 1680px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-group); margin: 10px 0 24px; }
.workspace-heading .eyebrow { margin-bottom: 8px; }
.workspace-heading h1 { color: var(--text-strong); font: 400 42px/1.05 var(--serif); }
.workspace-heading p:not(.eyebrow) { margin-top: 9px; color: var(--text-muted); font-size: 13.5px; }
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font: 600 13px var(--sans);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease);
}
.button.primary { color: #0a0a0c; background: var(--gold); border: 1px solid var(--gold); }
.button.primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.button.secondary { color: var(--gold-soft); background: var(--gold-04); border: 1px solid var(--gold-25); }
.button.secondary:hover { background: var(--gold-08); border-color: var(--gold-40); }
.button.quiet { color: var(--text-subtle); background: transparent; border: 1px solid transparent; }
.button.quiet:hover { color: var(--text); background: var(--surface-2); }
.button.danger { color: var(--error); background: transparent; border: 1px solid rgba(234, 102, 96, .38); }
.button.danger:hover { background: rgba(234, 102, 96, .07); border-color: rgba(234, 102, 96, .62); }
.button:disabled { opacity: .4; cursor: default; }

.manage-console { overflow: hidden; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px; animation: rise .34s var(--ease) both; }
.views { display: flex; align-items: stretch; border-bottom: 1px solid var(--seam); background: var(--surface); }
.views button {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-subtle);
  font: 600 13px var(--sans);
}
.views button:hover { color: var(--text); background: var(--surface-2); }
.views button.on { color: var(--text-strong); background: var(--bg-raised); box-shadow: inset 0 -3px var(--gold); }
.view-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; font-size: 13px; line-height: 1; }
.views button.on .view-icon { color: var(--gold-soft); background: var(--gold-08); border-color: var(--gold-25); }
.views button[data-view='published'].on .view-icon { color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.views button b { color: var(--text-subtle); font: 500 10.5px var(--mono); }
.views button.on b { color: var(--gold-soft); }
.attention-strip { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(220px, .8fr)); align-items: stretch; gap: 10px; padding: 12px 14px; background: linear-gradient(100deg, var(--gold-08), transparent 72%); border-bottom: 1px solid var(--border-subtle); }
.attention-strip.single { grid-template-columns: minmax(220px, 1fr) minmax(300px, .8fr); }
.attention-heading { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.attention-heading > span:last-child { min-width: 0; display: grid; gap: 2px; }
.attention-mark { width: 30px; height: 30px; display: inline-flex; flex: none; align-items: center; justify-content: center; color: var(--gold-soft); background: var(--gold-08); border: 1px solid var(--gold-25); border-radius: 50%; font-size: 10px; }
.attention-heading strong { color: var(--text-strong); font-size: 13.5px; }
.attention-heading small { overflow: hidden; color: var(--text-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.attention-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 11px; color: var(--text); text-align: left; background: color-mix(in srgb, var(--bg-raised) 82%, transparent); border: 1px solid var(--border); border-radius: 8px; transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.attention-card:hover { background: var(--surface); border-color: var(--gold-40); transform: translateY(-1px); }
.attention-card-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--gold-soft); background: var(--gold-08); border-radius: 7px; font-size: 15px; }
.attention-card-icon.update { color: var(--info); background: color-mix(in srgb, var(--info) 9%, transparent); }
.attention-card > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.attention-card strong { overflow: hidden; color: var(--text-strong); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.attention-card small { overflow: hidden; color: var(--text-subtle); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.attention-card > b { min-width: 25px; padding: 3px 7px; color: var(--gold-soft); background: var(--gold-08); border-radius: 999px; font: 600 10.5px var(--mono); text-align: center; }
.attention-arrow { color: var(--text-subtle); transition: color .15s var(--ease), transform .15s var(--ease); }
.attention-card:hover .attention-arrow { color: var(--gold-soft); transform: translateX(2px); }
.attention-card:disabled { opacity: .52; cursor: default; transform: none; }
.filters { position: relative; min-height: 58px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); }
.checkpoint-filter { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; }
.checkpoint-filter label { color: var(--text-strong); font-weight: 600; }
.checkpoint-filter span { color: var(--text-subtle); }
.filter-group { display: flex; align-items: center; gap: 6px; padding: 4px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); border: 1px solid var(--border-subtle); border-radius: 9px; }
.filters select, .filters input[type='search'], .editor-rail select, .editor-rail input, .organization-block select, .organization-block input, .article-setup select, .article-setup input, .checkpoint-columns select, .checkpoint-selection select, .action-dialog select {
  min-height: 36px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12.5px;
}
.filters select:hover, .filters input[type='search']:hover, .editor-rail select:hover, .editor-rail input:hover, .organization-block select:hover, .organization-block input:hover, .article-setup select:hover, .article-setup input:hover, .checkpoint-columns select:hover, .checkpoint-selection select:hover, .action-dialog select:hover { border-color: var(--border-strong); }
.select-wrap select { min-width: 180px; }
.filter-menu { position: relative; flex: none; }
.filter-menu summary {
  width: max-content;
  min-height: 36px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}
.filter-menu summary::-webkit-details-marker { display: none; }
.filter-menu summary:hover { border-color: var(--border-strong); background: var(--surface); }
.filter-icon { width: 15px; height: 15px; color: var(--text-subtle); }
.filter-summary-text { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.filter-menu summary::after { content: '⌄'; color: var(--text-subtle); }
.filter-menu:has(input:checked) summary, .filter-menu[open] summary { color: var(--text-strong); background: var(--gold-04); border-color: var(--gold-40); }
.filter-menu:has(input:checked) .filter-icon, .filter-menu[open] .filter-icon { color: var(--gold-soft); }
.filter-menu[open] summary::after { content: '⌃'; }
.filter-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: 260px;
  padding: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.filter-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 8px; color: var(--text-subtle); }
.filter-popover-heading button { padding: 3px 5px; color: var(--gold-soft); background: transparent; border: 0; font-size: 11px; }
.check-options { max-height: 280px; overflow-y: auto; }
.check-options label { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: 5px; color: var(--text-muted); font-size: 12.5px; cursor: pointer; }
.check-options label:hover { color: var(--text); background: var(--gold-04); }
.check-options label span { min-width: 0; overflow-wrap: anywhere; }
.check-options input { flex: none; }
.check-options input, .select-cell input { accent-color: var(--gold); }
.filter-empty { padding: 7px 6px; color: var(--text-subtle); font-size: 12.5px; }
.filters .ai-switch { min-height: 36px; padding: 7px 10px; font: 600 12px var(--sans); text-transform: none; letter-spacing: 0; }
.filters .button { min-height: 36px; padding: 7px 10px; font-size: 12.5px; }
.search-wrap { position: relative; flex: 0 1 360px; min-width: 220px; margin-left: auto; }
.search-wrap::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: -11px; border-left: 1px solid var(--border); }
.filters .search-wrap input[type='search'] { width: 100%; padding-left: 34px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--text-subtle); font-size: 16px; }
input::placeholder { color: var(--text-subtle); }
.filters .count { color: var(--text-subtle); white-space: nowrap; }
.bulk-bar { min-height: 54px; display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-bottom: 1px solid var(--gold-25); background: var(--gold-04); }
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { min-width: 82px; color: var(--gold-soft); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.bulk-bar select { min-width: 210px; min-height: 36px; padding: 7px 10px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.action-dialog { position: fixed; inset: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; color: var(--text); background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.action-dialog::backdrop { background: rgba(6, 6, 9, .62); backdrop-filter: blur(3px); }

/* Gold orbital motif used by Entity Setup and Transcript Extractor. */
.import-dialog { width: min(520px, calc(100vw - 32px)); }
.import-dialog-content { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); padding: 32px; text-align: center; }
.import-dialog-content > :not(#import-dialog-report) { flex-shrink: 0; }
.import-dialog #import-dialog-file { color: var(--gold-soft); }
.import-dialog[data-result='error'] h2 { color: var(--error); }
.import-dialog[data-result='success'] h2 { color: var(--success); }
.import-dialog .dialog-actions { justify-content: center; }
#import-last-result { margin-bottom: 18px; }
.import-dialog[data-result] { width: min(760px, calc(100vw - 32px)); }
#import-dialog-report { min-height: 0; overflow-y: auto; margin-top: 20px; text-align: left; overflow-wrap: anywhere; }
.import-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.import-count { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg); }
.import-count[data-outcome='added'], .import-count[data-outcome='updated'] { color: var(--success); }
.import-count[data-outcome='invalid'], .import-count[data-outcome='failed'] { color: var(--error); }
#import-dialog-report h3, #import-successes summary { font: 600 14px/1.5 var(--sans); color: var(--text-strong); }
#import-successes summary { cursor: pointer; padding: 12px 0; }
#import-successes { margin-top: 12px; border-top: 1px solid var(--border); }
.import-rows { list-style: none; padding: 0; margin: 12px 0; }
.import-row { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.import-row + .import-row { margin-top: 10px; }
.import-row header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.import-row strong { font-size: 14px; color: var(--text-strong); }
.import-row .import-outcome { font-size: 12px; font-weight: 650; color: var(--success); }
.import-row[data-outcome='invalid'] .import-outcome, .import-row[data-outcome='failed'] .import-outcome { color: var(--error); }
.import-row[data-outcome='unchanged'] .import-outcome { color: var(--text-muted); }
.import-row p { margin: 8px 0 0; font-size: 13px; line-height: 1.6; }
.import-row .import-adjustment { color: var(--gold-soft); }
@media (max-width: 600px) {
  .import-dialog-content { padding: 20px; }
  .import-dialog .dialog-actions { flex-wrap: wrap; }
}
.import-orbital { position: relative; display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 24px; }
.import-ring { position: absolute; border-radius: 50%; }
.import-ring.outer { inset: 0; border: 2px solid var(--gold-15); border-top-color: var(--gold); animation: import-orbit 1.4s cubic-bezier(.4, 0, .2, 1) infinite; }
.import-ring.inner { inset: 10px; border: 1.5px solid var(--gold-08); border-bottom-color: var(--gold-soft); animation: import-orbit 2.2s cubic-bezier(.4, 0, .2, 1) infinite reverse; }
@keyframes import-orbit { to { transform: rotate(360deg); } }
.checkpoint-dialog { position: fixed; inset: 0; margin: auto; padding: 24px; width: min(1240px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; color: var(--text); background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.checkpoint-dialog::backdrop { background: rgba(6, 6, 9, .62); }
.checkpoint-header { position: sticky; top: -24px; z-index: 1; background: var(--bg-raised); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; margin-bottom: 16px; }
.checkpoint-header h2 { font: 400 32px/1.2 var(--serif); color: var(--text-strong); }
.checkpoint-dialog p { overflow-wrap: anywhere; }
#checkpoint-message { color: var(--text-muted); margin-bottom: 18px; }
.checkpoint-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.checkpoint-columns[hidden] { display: none; }
.checkpoint-columns > section { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 12px; }
.checkpoint-columns label { display: grid; gap: 6px; font-weight: 600; }
.checkpoint-columns select, .action-dialog select { width: 100%; min-width: 0; }
#checkpoint-controls option:disabled { color: var(--text-subtle); }
.checkpoint-version-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.checkpoint-version-actions[hidden] { display: none; }
#checkpoint-message.error { color: var(--error); }
#checkpoint-article-actions { margin-bottom: 18px; }
.save-conflict-versions { margin-top: 20px; }
.save-conflict-versions h3 { margin-bottom: 8px; }
#save-conflict-message.error { color: var(--error); }
.save-conflict-actions { position: sticky; bottom: -24px; background: var(--bg-raised); padding: 16px 0; margin-top: 20px; }
.checkpoint-changes { border-block: 1px solid var(--border); padding: 18px 0; margin: 20px 0; }
.checkpoint-changes h3 { font-size: 15px; margin-bottom: 6px; }
.checkpoint-legend { display: flex; gap: 20px; margin: 12px 0; font-size: 13px; font-weight: 600; }
.checkpoint-removed { color: var(--error); }
.checkpoint-added { color: var(--success); }
#checkpoint-formatting-note { padding: 12px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.checkpoint-field-diff { margin-top: 18px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.checkpoint-field-diff h4 { padding: 10px 14px; font-size: 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.checkpoint-diff-head, .checkpoint-diff-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkpoint-diff-head { background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.checkpoint-diff-head span { padding: 7px 14px; }
.checkpoint-diff-cell { display: flex; min-width: 0; padding: 5px 12px; color: var(--text); line-height: 1.6; }
.checkpoint-diff-cell.after { border-left: 1px solid var(--border); }
.checkpoint-diff-marker { flex: 0 0 22px; font-family: var(--mono); font-weight: 600; user-select: none; }
.checkpoint-diff-text { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.checkpoint-diff-row.changed .before:not(.diff-gap) { background: color-mix(in srgb, var(--error) 12%, var(--bg-raised)); }
.checkpoint-diff-row.changed .after:not(.diff-gap) { background: color-mix(in srgb, var(--success) 12%, var(--bg-raised)); }
.checkpoint-diff-row.changed .before .checkpoint-diff-marker { color: var(--error); }
.checkpoint-diff-row.changed .after .checkpoint-diff-marker { color: var(--success); }
.checkpoint-field-diff del { background: color-mix(in srgb, var(--error) 25%, transparent); text-decoration: line-through; }
.checkpoint-field-diff ins { background: color-mix(in srgb, var(--success) 25%, transparent); text-decoration: none; }
#checkpoint-previews > summary { cursor: pointer; font-weight: 600; padding-block: 12px; }
#checkpoint-previews .checkpoint-columns { margin-top: 8px; }
.checkpoint-attribution { white-space: pre-line; color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }
.checkpoint-preview { padding: 24px; }
.checkpoint-preview-title { font: 400 30px/1.15 var(--serif); margin-bottom: 12px; overflow-wrap: anywhere; }
.checkpoint-preview .article-body { margin-top: 20px; padding: 0; }
@media (max-width: 700px) {
  .checkpoint-dialog { padding: 16px; }
  .save-conflict-actions { bottom: -16px; }
  .checkpoint-header { top: -16px; }
  .checkpoint-columns { grid-template-columns: 1fr; }
  .checkpoint-diff-row { grid-template-columns: 1fr; }
  .checkpoint-diff-head, .checkpoint-diff-row.unchanged .before, .checkpoint-diff-cell.diff-gap { display: none; }
  .checkpoint-diff-cell.after { border-left: 0; }
  .checkpoint-preview { padding: 18px; }
}
.action-dialog form { padding: 25px; }
.csv-guide-dialog { width: min(760px, calc(100vw - 32px)); }
.csv-guide-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.csv-guide-dialog form > :not(.csv-dialog-body) { flex-shrink: 0; }
.csv-dialog-body { min-height: 0; max-height: 55vh; overflow-y: auto; margin-top: 18px; padding: 2px 12px 2px 2px; scrollbar-gutter: stable; }
.csv-guide-dialog .dialog-mark { display: none; }
.csv-rules { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.csv-rules h3 { margin: 22px 0 10px; color: var(--text-strong); font: 600 15px/1.4 var(--sans); }
.csv-rules h3:first-child { margin-top: 0; }
.csv-rules ul { padding-left: 20px; }
.csv-rules li + li { margin-top: 10px; }
[data-csv-rules] .csv-rules { padding-top: 18px; border-top: 1px solid var(--border); }
#import-rules .csv-rules { padding-top: 0; border: 0; }
.action-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-mark { display: block; margin-bottom: 13px; color: var(--gold); font-size: 13px; }
.action-dialog h2 { color: var(--text-strong); font: 400 30px/1.05 var(--serif); }
.action-dialog.warning, .action-toast.warning { border-color: var(--error); background: color-mix(in srgb, var(--error) 8%, var(--bg-raised)); }
.action-dialog.warning h2, .action-toast.warning #toast-title { color: var(--error); }
.action-dialog.warning h2 span { font-family: var(--sans); }

.action-dialog p { margin-top: 11px; overflow-wrap: anywhere; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.action-dialog .button.danger { color: #fff; background: var(--error); border-color: var(--error); }
.action-dialog .button.danger:hover { filter: brightness(1.07); }
.action-toast {
  position: fixed;
  z-index: 90;
  top: 92px;
  left: 50%;
  width: min(500px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 17px 18px;
  transform: translateX(-50%);
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .42), 0 3px 12px rgba(0, 0, 0, .22);
  animation: toast-arrive .22s var(--ease) both;
}
.action-toast[hidden] { display: none; }
.toast-mark { width: 10px; height: 10px; margin-top: 5px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 5px var(--gold-08); }
.action-toast.warning .toast-mark { background: var(--error); box-shadow: 0 0 0 4px color-mix(in srgb, var(--error) 15%, transparent); }
.action-toast.success .toast-mark { background: var(--success); box-shadow: 0 0 0 4px rgba(80, 176, 130, .10); }
.action-toast.error {
  border-color: rgba(234, 102, 96, .72);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .46), 0 0 0 1px rgba(234, 102, 96, .12);
}
.action-toast.error .toast-mark { background: var(--error); box-shadow: 0 0 0 5px rgba(234, 102, 96, .13); }
.action-toast #toast-title { display: block; color: var(--text-strong); font-size: 14px; }
.action-toast strong, .action-dialog strong { color: var(--text-strong); font-weight: 650; }
.action-toast code, .action-dialog code { font: .95em var(--mono); }
.action-toast p { max-height: 160px; margin-top: 4px; overflow: auto; overflow-wrap: anywhere; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.action-toast > button { padding: 0 2px; color: var(--text-subtle); background: transparent; border: 0; font-size: 18px; line-height: 1; }
.action-toast > button:hover { color: var(--text); }

@keyframes toast-arrive {
  from { opacity: 0; transform: translate(-50%, -14px) scale(.985); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.table-frame { overflow-x: auto; }
.articles { width: 100%; min-width: 1160px; table-layout: fixed; border-collapse: collapse; }
.articles .col-select { width: 3.5%; }
.articles .col-article { width: 30%; }
.articles .col-status { width: 9.5%; }
.articles .col-ai-ready { width: 8%; }
.articles .col-category { width: 10.5%; }
.articles .col-timeline { width: 7%; }
.articles .col-updated { width: 10%; }
.articles .col-created { width: 10%; }
.articles .col-author { width: 11.5%; }
.articles th { padding: 12px 15px; border-bottom: 1px solid var(--border); color: var(--text-subtle); text-align: left; font: 600 11px var(--sans); letter-spacing: .01em; }
.articles td { padding: 15px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); vertical-align: top; font-size: 12.5px; }
.articles tr:last-child td { border-bottom: 0; }
.articles tr.row td { transition: background .14s var(--ease); }
.articles tr.row:hover td { background: var(--gold-08); }
.articles tr.row.selected td { background: var(--gold-15); }
.articles tr.proposal-row td { background: var(--gold-04); }
.articles tr.proposal-row td:first-child { box-shadow: inset 3px 0 var(--gold); }
.articles tr.proposal-row:hover td { background: var(--gold-08); }
.articles tr.proposal-row.selected td { background: var(--gold-15); }
.articles .select-cell { padding-right: 4px; text-align: center; }
.articles .select-cell input { width: 15px; height: 15px; cursor: pointer; }
.articles th label { cursor: pointer; }
.articles .name { min-width: 0; }
.article-name-link { display: block; max-width: 100%; overflow-wrap: anywhere; color: var(--text-strong); font-size: 14px; font-weight: 650; line-height: 1.35; }
.article-name-link:hover { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.name .url { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-subtle); font: 10px var(--mono); }
.sort-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.sort-button:hover, th[aria-sort]:not([aria-sort='none']) .sort-button { color: var(--gold-soft); }
.sort-button span { font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; white-space: nowrap; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.status-pill i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--text-subtle); }
.status-pill.published { color: var(--success); background: color-mix(in srgb, var(--success) 7%, transparent); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.status-pill.published i { background: var(--success); }
.status-pill.archived i { background: var(--seam); }
.ai-ready-cell { white-space: nowrap; }
.ai-switch { display: inline-flex; align-items: center; gap: 7px; padding: 3px 7px 3px 4px; color: var(--text-subtle); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.ai-switch > span { position: relative; width: 26px; height: 14px; flex: none; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 999px; transition: background .15s var(--ease), border-color .15s var(--ease); }
.ai-switch > span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--text-subtle); border-radius: 50%; transition: transform .15s var(--ease), background .15s var(--ease); }
.ai-switch.on { color: var(--success); border-color: color-mix(in srgb, var(--success) 38%, transparent); background: color-mix(in srgb, var(--success) 8%, transparent); }
.ai-switch.on > span { background: color-mix(in srgb, var(--success) 22%, transparent); border-color: color-mix(in srgb, var(--success) 55%, transparent); }
.ai-switch.on > span::after { background: var(--success); transform: translateX(12px); }
.ai-switch:hover { color: var(--text); border-color: var(--border-strong); }
.ai-switch.on:hover { color: var(--success); border-color: var(--success); }
:is(.proposal-switch, .assignment-switch).on { color: var(--gold-soft); background: var(--gold-04); border-color: var(--gold-40); }
:is(.proposal-switch, .assignment-switch).on > span { background: var(--gold-15); border-color: var(--gold-40); }
:is(.proposal-switch, .assignment-switch).on > span::after { background: var(--gold); }
:is(.proposal-switch, .assignment-switch).on:hover { color: var(--gold-soft); border-color: var(--gold); }
.filters > .proposal-switch { min-height: 44px; padding-inline: 12px; color: var(--gold-soft); background: var(--gold-04); border-color: var(--gold-25); box-shadow: inset 0 0 0 1px var(--gold-04); }
.filters > .proposal-switch:hover { color: var(--gold-soft); background: var(--gold-08); border-color: var(--gold-40); }
.ai-switch:disabled { opacity: .45; cursor: wait; }
.ai-switch.working { min-width: 92px; justify-content: flex-start; }
.ai-switch.working > span::after { animation: pulse .65s var(--ease) infinite; }
.cat { overflow-wrap: anywhere; color: var(--text) !important; }
.cat .sub { display: block; margin-top: 4px; color: var(--text-subtle); font-size: 11px; }
.article-proposal-badge, .proposal-link { width: max-content; max-width: 100%; display: block; margin-top: 7px; padding: 3px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 650; line-height: 1.35; }
.article-proposal-badge { color: var(--gold-soft); background: var(--gold-08); border: 1px solid var(--gold-25); }
.article-source { display: block; margin-top: 7px; color: var(--text-subtle); font-size: 11px; line-height: 1.4; }
.proposal-link { color: var(--info); background: color-mix(in srgb, var(--info) 7%, transparent); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.proposal-link:hover { color: var(--text-strong); border-color: color-mix(in srgb, var(--info) 48%, transparent); }
.timeline-link { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 5px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.timeline-link:hover { color: var(--gold-soft); background: var(--gold-04); border-color: var(--gold-40); }
.muted { overflow-wrap: anywhere; color: var(--text-subtle) !important; }
.empty { padding: 42px !important; color: var(--text-subtle) !important; text-align: center; }
.loading-state { min-height: 150px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; }
.pagination { min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.page-range { color: var(--text-subtle); }
.page-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.page-controls .button { min-width: 92px; }
.page-number { min-width: 86px; color: var(--text-muted); text-align: center; }
.page-size { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--text-subtle); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.page-size select { min-height: 34px; padding: 6px 28px 6px 9px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.loading-mark { color: var(--text); font: 400 20px var(--serif); }
.loading-mark em { color: var(--gold-soft); }
.loading-state .machine { color: var(--text-subtle); animation: pulse 1.2s var(--ease) infinite; }

/* Editor: the document is the work; controls live in an honest side rail. */
.editor-page { --editor-accent: var(--gold); --editor-accent-ink: var(--gold-soft); }
html[data-theme='light'] .editor-page { --editor-accent: var(--seam); --editor-accent-ink: #994f4a; }
.editor-shell { max-width: 1800px; display: grid; grid-template-columns: minmax(600px, 1fr) 700px; grid-template-areas: 'controls sidebar' 'editor sidebar'; gap: 18px 24px; align-items: start; }
.editor-controls { grid-area: controls; min-width: 0; display: grid; grid-template-columns: subgrid; }
.editor-controlbar { grid-column: 1; display: grid; gap: 12px; }
.editor-controls > .proposal-current { grid-column: 1 / -1; }
.editor-conflict-banner { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-muted); font-size: 13px; }
.editor-conflict-banner[hidden] { display: none; }
.editor-controlbar .editor-heading { margin: 0; align-items: start; }
.editor-controlbar .editor-viewbar { min-width: 0; margin-bottom: 0; }
@media (min-width: 641px) {
  .editor-controlbar { grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: var(--sp-fact); }
  .editor-controlbar > * { grid-column: 1 / -1; }
  .editor-controlbar :is(.editor-heading, .editor-viewbar) { display: grid; grid-template-columns: subgrid; }
  .editor-heading .back-link { justify-self: start; }
  .editor-heading .checkpoint-selection { grid-column: 2; }
  .editor-viewbar .editor-feedback { grid-column: 3; }
}

.article-setup { width: min(620px, calc(100% - 36px)); margin: 36px auto 80px; }
.article-setup form { margin-top: 20px; padding: clamp(24px, 5vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.article-setup h1 { margin-bottom: 12px; color: var(--text-strong); font: 400 clamp(34px, 5vw, 44px)/1.1 var(--serif); }
.article-setup p { margin-bottom: 26px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.article-setup :is(select, input) { width: 100%; }
.setup-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.editor-pane { min-width: 0; grid-area: editor; }
.editor-workspace { min-width: 0; }
.editor-pane > .toolbar { flex-shrink: 0; margin-bottom: 18px; }
@media (min-width: 1101px) {
  .editor-page:has(#editor-shell:not([hidden])) .admin-app { height: 100dvh; min-height: 0; flex: none; overflow: hidden; }
  .editor-page #topbar { flex-shrink: 0; }
  .editor-shell { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .editor-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  .editor-workspace { flex: 1; }
  .editor-shell :is(.editor-workspace, .editor-rail) {
    min-height: 0; height: 100%; overflow: auto; overscroll-behavior: contain;
    scrollbar-gutter: stable; align-self: stretch;
  }
  .editor-shell .editor-sidebar { position: static; height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .editor-shell .editor-rail > * { flex-shrink: 0; }
}

.editor-heading { min-height: 34px; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-fact); margin-bottom: 10px; color: var(--text-subtle); }
.back-link { font-size: 12.5px; font-weight: 600; }
.button.back-link { border-color: var(--border); background: var(--surface); color: var(--text-muted); }
.back-link:hover { color: var(--gold-soft); }
.editor-viewbar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-fact); margin-bottom: 10px; }
.editor-view-toggle { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.editor-view-toggle button { min-width: 78px; min-height: 30px; padding: 5px 13px; color: var(--text-subtle); background: transparent; border: 0; border-radius: 5px; font-size: 12.5px; font-weight: 600; }
.editor-view-toggle button:hover { color: var(--text); }
.editor-view-toggle button[aria-selected='true'] { color: var(--text-strong); background: var(--gold-08); box-shadow: inset 0 -2px var(--gold); }
.editor-feedback { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
.editor-feedback #save-article { flex-shrink: 0; }
.editor-feedback #note { display: inline-flex; align-items: baseline; gap: 7px; max-width: 420px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.editor-feedback #note::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.editor-feedback #note.warning { color: var(--error); border-color: var(--error); background: color-mix(in srgb, var(--error) 10%, var(--surface)); }
.editor-feedback #note.warning::before { content: '⚠'; flex-basis: auto; width: auto; height: auto; border-radius: 0; background: transparent; }
.editor-feedback #note.saved { color: var(--success); }
.editor-feedback #note.error { color: var(--error); }
.editor-document { min-height: calc(100vh - 190px); padding: clamp(30px, 5vw, 62px); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; animation: rise .34s var(--ease) both; }
.editor-document input { width: 100%; display: block; border: 0; outline: 0; background: transparent; }
.editor-document .editor-text-field { display: block; width: 100%; min-width: 0; min-height: 1lh; padding: 2px; border: 0; outline: 0; background: transparent; font: inherit; resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-document .title { color: var(--text-strong); font: 400 clamp(36px, 5vw, 58px)/1.06 var(--serif); letter-spacing: -.018em; }
.editor-document .title::placeholder { color: #55555e; }
.editor-document .subtitle { font-weight: 700; color: var(--text-muted); font-size: 16px; line-height: 1.5; }
.editor-document .subtitle::placeholder { color: var(--text-subtle); }
.editor-field { position: relative; isolation: isolate; min-width: 0; margin: -15px; padding: 14px; border: 1px solid var(--seam); border-radius: 9px; transition: background-color .16s var(--ease); }
.editor-field + .editor-field { margin-top: 26px; }
.editor-field.editor-body-field { margin-top: 34px; }
.editor-document > .article-updated { margin-top: 30px; }
.editor-document > .article-updated:not([hidden]) + .editor-body-field { margin-top: 18px; }
.editor-field:focus-within { background-color: color-mix(in srgb, var(--editor-accent) 3%, transparent); }
.editor-field-heading { min-height: 18px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-subtle); }
.editor-field-heading label { cursor: text; }
.editor-field-heading > .machine { font-weight: 600; font-size: 11px; }
.field-optional { margin-left: 7px; font: 400 10px var(--sans); text-transform: none; letter-spacing: 0; }
.editor-field-hint { flex: none; color: var(--editor-accent-ink); font: 500 10px/1.4 var(--sans); opacity: 0; transition: opacity .16s var(--ease); }
.field-edit-button { min-height: 24px; padding: 3px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.field-edit-button:hover { background: color-mix(in srgb, var(--editor-accent) 8%, transparent); border-color: color-mix(in srgb, var(--editor-accent) 40%, transparent); }
.field-active { display: none; }
.field-active::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--editor-accent); vertical-align: 1px; }
.editor-field:focus-within .editor-field-heading > .machine { color: var(--editor-accent-ink); }
.editor-field:focus-within .editor-field-hint { opacity: 1; }
.editor-field:has(textarea:focus, [contenteditable]:focus) .field-idle { display: none; }
.editor-field:has(textarea:focus, [contenteditable]:focus) .field-active { display: inline; }
.editor-field :is(input, textarea, [contenteditable]) { caret-color: var(--editor-accent-ink); }
.editor-field ::selection { background: color-mix(in srgb, var(--editor-accent) 28%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .editor-field:hover:not(:focus-within) { background-color: color-mix(in srgb, var(--editor-accent) 2%, transparent); }
  .editor-field:hover .editor-field-hint { opacity: 1; }
  .editor-rail .rail-block:not(.danger-block):hover { border-color: color-mix(in srgb, var(--editor-accent) 45%, var(--border)); }
}
@media (hover: none) {
  .editor-field-hint { opacity: 1; }
}
.starter-picker { margin: 18px 0 8px; padding: 18px; border: 1px dashed var(--gold-40); border-radius: 9px; background: var(--gold-04); }
.starter-intro { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-fact); }
.starter-intro .machine { color: var(--gold-soft); }
.starter-intro p:last-child { color: var(--text-subtle); font-size: 11.5px; }
.starter-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.starter-options button { min-height: 66px; padding: 10px; text-align: left; color: var(--text); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 7px; transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
.starter-options button:hover { background: var(--gold-08); border-color: var(--gold-40); transform: translateY(-1px); }
.starter-options strong, .starter-options span { display: block; }
.starter-options strong { font-size: 12px; }
.starter-options span { margin-top: 4px; color: var(--text-subtle); font-size: 10.5px; line-height: 1.35; }
.editor-document .body { min-height: clamp(640px, 70svh, 900px); padding: 20px 0; color: var(--text); outline: 0; font-size: 15.5px; line-height: 1.75; overflow-wrap: anywhere; }
.editor-document .body:empty::before { content: attr(data-placeholder); color: #55555e; pointer-events: none; }
.editor-document .body [data-draft-placeholder]:empty::before { content: attr(data-draft-placeholder); color: var(--text-subtle); font-style: italic; font-weight: 400; pointer-events: none; }
.editor-page :is(input, textarea):focus::placeholder,
.editor-document .body:focus::before,
.editor-document .body [data-draft-active]::before { opacity: 0; }
.editor-document .body [data-draft-placeholder]:empty { min-height: 1.25em; }
.editor-document .body > * { scroll-margin-top: 18px; }
.editor-document .body :where(p, ul, ol, blockquote) { margin: 12px 0; }
.editor-document .body :where(ul, ol) { padding-left: 24px; }
.editor-document .body a[href] { color: var(--gold-soft) !important; text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: text; }
.editor-document .body a[href]:hover { text-decoration-thickness: 2px; }
.draft-preview { min-height: calc(100vh - 190px); animation: rise .24s var(--ease) both; }
.draft-preview .article-card { min-height: inherit; }
.draft-preview .preview-empty { color: var(--text-subtle); font-style: italic; }
.editor-sidebar { grid-area: sidebar; min-width: 0; position: sticky; top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.editor-rail { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.rail-block { padding: 16px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; animation: rise .34s var(--ease) both; }
.editor-sidebar .editor-rail .rail-block:not(.danger-block) { background: color-mix(in srgb, var(--surface) 65%, transparent); box-shadow: none; }
.editor-rail .rail-block { min-width: 0; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.editor-rail .rail-block:not(.danger-block):focus-within { border-color: var(--editor-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--editor-accent) 10%, transparent); }
.rail-block h2 { margin-bottom: 14px; color: var(--text-strong); font: 650 14px/1.4 var(--sans); }
.rail-block-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.rail-block-heading h2 { margin-bottom: 0; }
.rail-badge { flex: none; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); font: 500 10px/1.5 var(--mono); }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-fact); padding: 10px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.status-fact { padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font: 600 11px var(--sans); text-transform: capitalize; }
.status-fact.draft { color: var(--text-subtle); }
.status-fact.published { color: var(--success); }
.status-fact.archived { color: var(--seam); }
.rail-copy { margin-top: 12px; color: var(--text-subtle); font-size: 11.5px; line-height: 1.55; }
.checkpoint-reminder { padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.review-block .field-label { margin-top: 14px; }
.review-block select, .review-block textarea { width: 100%; }
.review-block textarea { resize: vertical; min-height: 80px; }
.review-block form button { margin-top: 10px; }
.review-history { margin-top: 14px; max-height: 360px; overflow-y: auto; }
.review-entry { border-top: 1px solid var(--border); padding: 12px 0; font-size: 12px; overflow-wrap: anywhere; }
.review-entry time { color: var(--text-subtle); font-size: 11px; }
.review-note { margin-top: 8px; white-space: pre-wrap; }
.publish-actions, .checkpoint-actions { margin-top: 14px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.public-link { margin-top: 12px; display: inline-flex; gap: 7px; color: var(--gold-soft); font-size: 12px; }
.public-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.field-label { display: block; margin: 13px 0 6px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.organization-block select, .organization-block input { width: 100%; }
.organization-block input { margin-top: 7px; }
.outline-block h2 { margin-bottom: 9px; }
#draft-outline { display: flex; flex-direction: column; gap: 2px; }
.outline-empty { padding: 5px 0 2px; color: var(--text-subtle); font-size: 11.5px; line-height: 1.5; }
.outline-link { width: 100%; padding: 6px 7px; overflow: hidden; color: var(--text-muted); background: transparent; border: 0; border-radius: 5px; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.outline-link:hover { color: var(--gold-soft); background: var(--gold-04); }
.outline-link[data-depth='1'] { padding-left: 18px; }
.outline-link[data-depth='2'] { padding-left: 29px; }
.outline-link[data-depth='3'] { padding-left: 40px; }
.health-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-fact); }
.health-heading h2 { margin-bottom: 0; }
#health-score { color: var(--gold-soft); }
.draft-stats { margin: 9px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-subtle); font-size: 11.5px; }
.health-list { display: flex; flex-direction: column; gap: 7px; padding: 0; list-style: none; }
.health-list li { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: baseline; gap: 8px; color: var(--text-muted); font-size: 11.5px; line-height: 1.4; }
.health-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle); }
.health-list li.good::before { background: var(--success); }
.health-list li.attention::before { background: var(--warn); }
.health-list li.neutral::before { background: var(--text-subtle); }
.internal-comments-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-fact); }
.internal-comments-heading h2 { margin-bottom: 0; }
.internal-comments-heading > span { color: var(--gold-soft); }
.internal-comments-list { max-height: 320px; display: flex; flex-direction: column; gap: 9px; margin: 13px 0; overflow-y: auto; }
.internal-comments-empty { padding: 9px 0; color: var(--text-subtle); font-size: 11.5px; }
.internal-comment { padding: 10px 11px; background: var(--gold-04); border: 1px solid var(--gold-15); border-radius: 5px 10px 10px; }
.internal-comment-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 8px; margin-bottom: 6px; }
.internal-comment-meta strong { min-width: 0; overflow: hidden; color: var(--text); font: 600 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.internal-comment-meta span { grid-column: 1; color: var(--text-subtle); font: 500 9px var(--mono); }
.internal-comment-actions { grid-column: 2; grid-row: 1 / 3; align-self: center; display: flex; gap: 4px; }
.internal-comment-meta button { padding: 3px 4px; color: var(--gold-soft); background: transparent; border: 0; font: 600 10px var(--sans); }
.internal-comment-meta button:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.internal-comment-body { color: var(--text-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.internal-comment-compose { padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.internal-comment-compose textarea, .internal-comment textarea, #checkpoint-notes, #new-checkpoint-notes, .review-block textarea { width: 100%; resize: vertical; padding: 8px 9px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; font: 400 12px/1.5 var(--sans); }
.internal-comment-compose textarea:focus, .internal-comment textarea:focus, #checkpoint-notes:focus, #new-checkpoint-notes:focus, .review-block textarea:focus { outline: 2px solid var(--gold-15); border-color: var(--gold-40); }
.internal-comment-compose > div, .internal-comment-edit-actions { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 7px; }
.internal-comment-compose .machine { color: var(--text-subtle); font-size: 8.5px; }
.internal-comment-compose .button, .internal-comment-edit-actions .button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.internal-comment-edit-actions { justify-content: flex-end; }
.danger-block { border-color: rgba(234, 102, 96, .22); }
.danger-block h2 { color: var(--error); }
.danger-block .button { width: 100%; margin-top: 13px; }

.loading-lines { padding: 38px 0; display: flex; flex-direction: column; gap: 11px; }
.loading-lines span, .loading-card span { display: block; height: 9px; border-radius: 4px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.loading-lines span:nth-child(1) { width: 62%; }
.loading-lines span:nth-child(2) { width: 84%; }
.loading-lines span:nth-child(3) { width: 45%; }
.loading-card { min-height: 146px; padding: 18px; grid-column: 1 / -1; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; }
.loading-card span { margin-bottom: 13px; }
.loading-card span:nth-child(1) { width: 16%; }
.loading-card span:nth-child(2) { width: 34%; margin-top: 25px; }
.loading-card span:nth-child(3) { width: 52%; }

/* In Cool Mist, content surfaces use the same warm cream lift as Transcript
   Extractor while navigation remains part of the cool page shell. */
html[data-theme='light'] :is(.rail-panel, .hero, .category-card, .page-intro, .article-groups, .article-card, .manage-console, .editor-document, .rail-block, .loading-card) {
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}
html[data-theme='light'] :is(.hero, .article-card, .editor-document) { box-shadow: var(--shadow-md); }
html[data-theme='light'] :is(.filters select, .filters input[type='search'], .filter-menu summary, .bulk-bar select, .editor-rail select, .editor-rail input, .organization-block select, .organization-block input, .article-setup select, .article-setup input, .checkpoint-columns select, .action-dialog select) { background-color: var(--surface-2); }
html[data-theme='light'] .editor-document .title::placeholder,
html[data-theme='light'] .editor-document .body:empty::before { color: var(--text-subtle); }
html[data-theme='light'] .danger-block { border-color: rgba(187, 58, 46, .24); }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .42; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

@media (max-width: 1499px) {
  .editor-shell { grid-template-columns: minmax(0, 1fr) 384px; }
  .editor-sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1101px) and (max-width: 1499px) {
  .editor-shell .editor-sidebar { grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .editor-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'controls' 'editor' 'sidebar'; }
  .editor-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .starter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  #topbar { min-height: 64px; padding: 14px 18px; }
  .brand-context { display: none; }
  .topbar-right { gap: var(--sp-fact); }
  .session #who { display: none; }
  .public-shell { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .rail-panel { position: static; }
  .rail-heading { min-height: 46px; }
  .rail-heading > .machine, .rail-heading > .rail-home { display: none; }
  .rail-toggle { width: 100%; display: flex; justify-content: space-between; }
  .rail { display: none; max-height: min(62vh, 520px); overflow-y: auto; }
  .rail-panel[data-open='true'] .rail { display: block; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-document { min-height: 620px; }
  .draft-preview { min-height: 620px; }
  .attention-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention-strip.single { grid-template-columns: 1fr; }
  .attention-heading { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .brand { gap: 8px; }
  .brand img { width: 20px; height: 20px; }
  .brand-name { font-size: 20px; }
  .topnav { gap: 10px; }
  .workspace-page .topnav { display: none; }
  .updates-page .topnav { display: none; }
  .public-page .topnav > a[aria-current='page'] { display: none; }
  .public-page .topnav .manage-link { font-size: 0; }
  .public-page .topnav .manage-link::before { content: 'Manage'; font-size: 12px; }
  .topnav a { font-size: 12px; }
  .topnav .manage-link { padding: 6px 8px; }
  .topnav .manage-link span { display: none; }
  .public-shell, .manage-shell, .editor-shell { padding: 14px; }
  .hero { min-height: 280px; padding: 38px 24px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-copy { margin-top: 18px; font-size: 14px; }
  .knowledge-search { margin-top: 22px; }
  .search-control { min-height: 50px; gap: 9px; padding-left: 13px; }
  .search-control button { min-height: 34px; padding-inline: 11px; font-size: 12px; }
  .search-result { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .search-result-location { grid-column: 1; grid-row: 2; max-width: none; text-align: left; }
  .search-result-arrow { grid-column: 2; grid-row: 1 / 3; }
  .directory { margin-top: 28px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 126px; }
  .page-intro { padding: 30px 24px 25px; }
  .page-intro h1 { font-size: 40px; }
  .page-summary { align-items: flex-start; flex-wrap: wrap; }
  .summary-rule { display: none; }
  .article-groups { padding: 8px 24px 28px; }
  .breadcrumb { margin-inline: 3px; overflow: hidden; white-space: nowrap; }
  .breadcrumb a { overflow: hidden; text-overflow: ellipsis; }
  .article-header { padding: 35px 24px 27px; }
  .article-header h1 { font-size: 40px; }
  .article-subtitle { font-size: 14px; }
  .article-body { padding: 28px 24px 42px; font-size: 14.5px; }
  .related-articles { margin: 0 24px 34px; }
  .article-feedback { margin: 0 24px 34px; grid-template-columns: 1fr; }
  .feedback-actions { margin-top: 5px; }
  .feedback-status { grid-column: 1; }
  .article-end { grid-template-columns: auto 1fr; padding: 20px; }
  .article-end a { grid-column: 2; }
  .site-footer { padding-inline: 18px; }
  .not-found-main { min-height: auto; padding: 38px 18px 54px; }
  .not-found-main .fatal-meme { width: min(100%, 330px); }
  .not-found-main h1 { font-size: 42px; }
  .admin-gate { padding: 18px; }
  .access-denied-actions { width: 100%; }
  .not-found-main .access-denied-actions .button { width: 100%; }

  .workspace-heading { align-items: flex-start; flex-direction: column; margin-top: 4px; }
  .workspace-heading h1 { font-size: 38px; }
  .workspace-heading .button { width: 100%; }
  .views { overflow-x: auto; }
  .views button { flex: 0 0 auto; padding-inline: 14px; }
  .attention-strip { grid-template-columns: 1fr; }
  .attention-heading { grid-column: auto; }
  .attention-heading small { white-space: normal; }
  .filters { align-items: stretch; flex-wrap: wrap; }
  .filter-group { width: 100%; flex: 1 1 100%; flex-wrap: wrap; }
  .filters .select-wrap, .filter-menu { flex: 1 1 160px; }
  .filters .select-wrap select, .filter-menu summary { width: 100%; min-width: 0; }
  .filters > .proposal-switch { flex: 0 0 auto; }
  .search-wrap { width: 100%; max-width: none; flex: 1 1 100%; margin-left: 0; }
  .search-wrap::before { display: none; }
  .filters .count { width: 100%; margin-left: 0; padding-top: 3px; text-align: right; }
  .filters .filter-menu { position: static; }
  .filter-popover { top: auto; left: 14px; right: 14px; width: auto; margin-top: 7px; }
  .bulk-bar { align-items: stretch; flex-wrap: wrap; }
  .bulk-bar strong { width: 100%; padding: 4px 0 2px; }
  .bulk-bar .select-wrap { flex: 1 1 100%; }
  .bulk-bar select { width: 100%; }
  .action-dialog form { padding: 22px; }
  .action-toast { top: 76px; }
  .articles { min-width: 0; }
  .articles colgroup { display: none; }
  .articles thead { display: none; }
  .articles, .articles tbody, .articles tr, .articles td { display: block; width: 100%; }
  .articles tr.row { padding: 16px; border-bottom: 1px solid var(--border); }
  .articles td { padding: 5px 0; border: 0; }
  .articles td[data-label] { display: flex; justify-content: space-between; gap: 18px; }
  .articles td[data-label]::before { content: attr(data-label); color: var(--text-subtle); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
  .articles td.select-cell { width: auto; padding: 0 0 10px; text-align: left; }
  .articles .status-pill i { display: none; }
  .articles .name { min-width: 0; margin-bottom: 8px; }
  .articles .name .url { max-width: 100%; }
  .articles .empty { display: table-cell; }
  .pagination { grid-template-columns: 1fr auto; gap: 10px; }
  .page-range { order: 1; }
  .page-size { order: 2; }
  .page-controls { grid-column: 1 / -1; order: 3; justify-content: space-between; }

  .editor-heading { margin-inline: 2px; }
  .editor-viewbar { align-items: flex-start; flex-direction: column; gap: 6px; }
  .editor-feedback { width: 100%; justify-content: space-between; gap: 8px; text-align: left; }
  .editor-feedback #note { max-width: 100%; }
  .editor-document { min-height: 560px; padding: 32px 24px; }
  .editor-document .title { font-size: 40px; }
  .body-label { align-items: flex-start; flex-direction: column; gap: 3px; }
  .starter-picker { padding: 15px; }
  .starter-intro { align-items: flex-start; flex-direction: column; gap: 5px; }
  .starter-options { grid-template-columns: 1fr; }
  .editor-document .body { min-height: clamp(480px, 65svh, 640px); }
  .draft-preview { min-height: 560px; }
  .editor-sidebar { grid-template-columns: minmax(0, 1fr); }
  .editor-rail .rail-block { animation: none; }
  .editor-page { padding-bottom: 76px; }
  .publish-actions {
    position: fixed;
    z-index: 50;
    left: 14px;
    right: 14px;
    bottom: 12px;
    justify-content: center;
    margin: 0;
    padding: 8px;
    background: rgba(20, 20, 24, .94);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .7);
    backdrop-filter: blur(14px);
  }
  html[data-theme='light'] .publish-actions {
    background: rgba(250, 247, 236, .94);
    box-shadow: var(--shadow-lg);
  }
}

/* Editing adds an in-flow tools row without covering the controls or document. */
.toolbar {
  position: relative; z-index: 70; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap;
  min-height: 56px; padding: 10px 16px; margin: 0;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm);
  user-select: none;
}
.toolbar[hidden] { display: none !important; }
.toolbar-caption { margin-right: 18px; color: var(--editor-accent-ink); }
.toolbar button {
  min-width: 32px; height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: 5px;
  background: none; color: inherit; font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.toolbar button:hover { background: color-mix(in srgb, var(--editor-accent) 12%, transparent); }
.toolbar button[aria-pressed="true"] { color: var(--editor-accent-ink); background: color-mix(in srgb, var(--editor-accent) 16%, transparent); border-color: color-mix(in srgb, var(--editor-accent) 45%, transparent); }
.toolbar :is(button, select):focus-visible { outline: 2px solid var(--editor-accent); outline-offset: 2px; }
.toolbar .sep { flex: none; width: 1px; height: 18px; background: var(--border-strong); margin: 0 6px; }
.toolbar select {
  height: 32px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 5px;
  background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer;
}
.toolbar select option { color: CanvasText; background: Canvas; }
.emoji-pop { position: absolute; top: calc(100% + 8px); right: 12px; z-index: 5; width: min(340px, calc(100% - 24px)); border-radius: 8px; box-shadow: var(--shadow-lg); }
.emoji-pop[hidden] { display: none; }
.emoji-pop emoji-picker { width: 100%; height: min(380px, calc(100dvh - var(--editor-toolbar-top, 0px) - var(--editor-toolbar-height, 64px) - 28px)); }
.link-pop {
  position: absolute; top: calc(100% + 8px); right: 12px; z-index: 5;
  width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - var(--editor-toolbar-top, 0px) - var(--editor-toolbar-height, 64px) - 24px); overflow-y: auto;
  padding: 16px; border: 1px solid var(--editor-accent); border-radius: 9px;
  color: var(--text); background: var(--bg-raised); box-shadow: var(--shadow-lg); user-select: text;
}
.link-pop[hidden] { display: none; }
.link-pop label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.link-pop input + label { margin-top: 14px; }
.link-pop input { display: block; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); font: 13px/1.4 var(--sans); }
.link-pop input:focus { outline: 2px solid var(--editor-accent); outline-offset: 2px; }
.link-pop #link-error { margin: 9px 0 0; color: var(--error); font-size: 12px; line-height: 1.4; }
.link-pop-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.link-pop-actions a, .link-pop-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; height: auto; padding: 8px; font: 500 12px/1.3 var(--sans); }
.link-pop-actions [hidden] { display: none; }
.link-pop-actions a { margin-right: auto; color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.link-pop-actions a[aria-disabled="true"] { opacity: .5; cursor: default; }
.link-pop-actions #link-save { color: var(--text-strong); background: color-mix(in srgb, var(--editor-accent) 16%, transparent); border-color: var(--editor-accent); }
.link-pop-actions #link-save:hover { background: color-mix(in srgb, var(--editor-accent) 25%, transparent); }
@media (max-width: 760px) {
  .toolbar { gap: 3px; padding: 8px 10px; }
  .toolbar-caption { display: none; }
  .toolbar .sep { margin-inline: 3px; }
}
@media (pointer: coarse) {
  .toolbar button { min-width: 40px; height: 40px; }
  .toolbar select { height: 40px; }
}
@media (max-width: 480px) {
  .toolbar .sep { display: none; }
}
.editor-document .body ul, .editor-document .body ol { padding-left: 24px; margin: 8px 0; }
.editor-document .body img { max-width: 100%; }
.editor-document .body .image-upload-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--text-subtle);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  font: 500 10px var(--mono);
  letter-spacing: .04em;
}
.editor-document .body h1, .editor-document .body h2, .editor-document .body h3,
.editor-document .body h4, .editor-document .body h5, .editor-document .body h6 { margin: 18px 0 6px; line-height: 1.25; }
.editor-document .body blockquote { margin: 8px 0; padding: 4px 14px; border-left: 3px solid rgba(127,127,127,.45); opacity: .85; }
.editor-document .body blockquote[data-article-indent], .article-body blockquote[data-article-indent] { opacity: 1; background: transparent; color: inherit; }
.editor-document .body code { font-family: ui-monospace, "Geist Mono", monospace; font-size: .92em; padding: 1px 5px; border-radius: 4px; background: rgba(127,127,127,.18); }
/* the picture-resize frame */
.image-help { color: var(--text-subtle); font-size: 12px; margin: 0 0 16px; }
.editor-document .body img { user-select: none; -webkit-user-select: none; cursor: pointer; }
.editor-document .body img.image-excluded { outline: 2px dashed var(--text-subtle); outline-offset: 3px; }
.editor-document .body img:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.editor-document { position: relative; }
#img-frame { position: absolute; pointer-events: none; outline: 2px dashed var(--gold, #d4a72c); outline-offset: -1px; z-index: 4; }
#img-frame.selected { outline-style: solid; }
#img-x {
  position: absolute; top: -12px; right: 8px; min-height: 30px; pointer-events: auto;
  border: none; border-radius: 6px; background: #b3261e; color: #fff; font: 700 12px/1 var(--sans);
  text-align: center; padding: 5px 10px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
#img-x:hover { background: #8e1b15; }
#img-alt {
  position: absolute; top: -12px; left: 8px; min-height: 24px; padding: 3px 8px; pointer-events: auto;
  color: #0a0a0c; background: var(--gold); border: 1px solid var(--gold); border-radius: 6px;
  font: 600 10px/1 var(--sans); box-shadow: var(--shadow-sm);
}
#img-alt:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
#img-frame[hidden] { display: none; }
#img-handle {
  position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; pointer-events: auto;
  background: Canvas; border: 2px solid var(--gold, #d4a72c); border-radius: 3px; cursor: nwse-resize;
}
/* the manage page's import / export pair beside Create article */
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.import-note { margin: -8px 0 14px; font-size: 11px; color: var(--text-subtle, #9aa6ae); line-height: 1.5; }
.import-note[hidden] { display: none; }

/* Proposed content uses the existing editor, with its current article nearby. */
.proposal-current { margin-bottom: 20px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; }
.proposal-current summary, #research-notes-block summary { cursor: pointer; font-weight: 600; }
.proposal-current h2 { margin-top: 16px; font: 400 28px/1.2 var(--serif); overflow-wrap: anywhere; }
.proposal-current .article-body { padding: 18px 0 0; }
#research-notes { font-size: 12px; line-height: 1.6; color: var(--text-muted); overflow-wrap: anywhere; }
#research-notes h3 { color: var(--text); font-size: 12px; margin-top: 12px; }
#research-notes ul { padding-left: 16px; }

/* Shared admin feedback and the public updates shelf. */
.feedback-shell, .updates-shell { width: 100%; max-width: 1120px; margin: 0 auto; padding: 38px 28px 64px; flex: 1; }
.feedback-console { overflow: hidden; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.feedback-filters { min-height: 64px; display: flex; align-items: end; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.feedback-filters label { display: grid; gap: 4px; color: var(--text-subtle); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.feedback-filters select { min-width: 170px; padding: 7px 30px 7px 9px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; text-transform: none; letter-spacing: 0; }
.feedback-filters .count { margin-left: auto; padding-bottom: 9px; color: var(--text-subtle); }
.feedback-list { min-height: 260px; }
.feedback-list > .loading-state { min-height: 260px; }
.feedback-card { padding: 22px 24px; border-bottom: 1px solid var(--border-subtle); }
.feedback-card:last-child { border-bottom: 0; }
.feedback-card > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.feedback-card time { color: var(--text-subtle); }
.feedback-badges { display: flex; align-items: center; gap: 7px; }
.feedback-kind, .feedback-state { padding: 4px 7px; border-radius: 999px; font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.feedback-kind { color: var(--gold-soft); background: var(--gold-08); border: 1px solid var(--gold-25); }
.feedback-kind.bug { color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); border-color: color-mix(in srgb, var(--error) 35%, transparent); }
.feedback-kind.interface { color: var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.feedback-state { color: var(--text-subtle); background: var(--surface); border: 1px solid var(--border); }
.feedback-state.resolved { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.feedback-body { margin-top: 16px; color: var(--text-strong); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-card-meta { margin-top: 10px; color: var(--text-subtle); font-size: 11.5px; }
.feedback-card-meta strong { color: var(--text-muted); }
.feedback-card-meta a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 2px; }
.feedback-attachments { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.feedback-attachments button { padding: 6px 9px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.feedback-attachments button:hover { color: var(--text); border-color: var(--border-strong); }
.feedback-reply { margin-top: 18px; padding: 14px 16px; background: var(--surface); border-left: 2px solid var(--gold); border-radius: 0 7px 7px 0; }
.feedback-reply .machine { color: var(--gold-soft); }
.feedback-reply p { margin-top: 6px; color: var(--text); white-space: pre-wrap; }
.feedback-reply small { display: block; margin-top: 7px; color: var(--text-subtle); }
.feedback-card-actions { margin-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.feedback-reply-editor { width: min(100%, 620px); }
.feedback-reply-editor summary { width: fit-content; color: var(--gold-soft); cursor: pointer; font-weight: 600; }
.feedback-reply-editor textarea { width: 100%; min-height: 78px; margin-top: 10px; resize: vertical; padding: 9px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.feedback-reply-editor .button { margin-top: 8px; }
.feedback-empty { min-height: 260px; padding: 48px 24px; display: grid; place-content: center; text-align: center; }
.feedback-empty h2 { color: var(--text-strong); font: 400 30px/1.1 var(--serif); }
.feedback-empty p { margin-top: 8px; color: var(--text-subtle); }

.feedback-dialog { position: fixed; inset: 0; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; color: var(--text); background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.feedback-dialog::backdrop { background: rgba(6, 6, 9, .62); backdrop-filter: blur(3px); }
.feedback-dialog form { padding: 25px; }
.feedback-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.feedback-dialog header .machine { margin-bottom: 5px; color: var(--gold-soft); }
.feedback-dialog h2 { color: var(--text-strong); font: 400 34px/1.05 var(--serif); }
.feedback-dialog-copy { margin: 13px 0 20px; color: var(--text-muted); }
.feedback-dialog label { display: grid; gap: 7px; margin-top: 15px; color: var(--text); font-size: 12px; font-weight: 600; }
.feedback-dialog :is(select, textarea, input[type='file']) { width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.feedback-dialog select { padding: 9px 11px; }
.feedback-dialog textarea { min-height: 130px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.feedback-dialog input[type='file'] { padding: 9px; font-weight: 400; }
.feedback-dialog :is(select, textarea, input):focus { outline: 2px solid var(--gold-15); border-color: var(--gold-40); }
.dialog-close { width: 34px; height: 34px; flex: none; color: var(--text-subtle); background: transparent; border: 1px solid var(--border); border-radius: 7px; font-size: 21px; line-height: 1; }
.dialog-close:hover { color: var(--text); border-color: var(--border-strong); }
.feedback-form-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; color: var(--text-subtle); font: 500 9.5px var(--mono); }
.feedback-file-field > span { color: var(--text-subtle); font-size: 10.5px; font-weight: 400; }
.feedback-file-summary { min-height: 18px; margin-top: 6px; color: var(--text-subtle); font-size: 11px; }
.feedback-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }

.updates-heading { max-width: 700px; padding: 30px 0 32px; }
.updates-heading h1 { color: var(--text-strong); font: 400 clamp(48px, 7vw, 70px)/1 var(--serif); }
.updates-heading > p:last-child { margin-top: 12px; color: var(--text-muted); font-size: 15px; }
.updates-empty { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 40px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; text-align: left; }
.updates-empty > span { color: var(--gold); font: 400 30px Georgia, serif; }
.updates-empty h2 { color: var(--text-strong); font: 400 32px/1.1 var(--serif); }
.updates-empty p { margin-top: 6px; color: var(--text-subtle); }

@media (max-width: 640px) {
  .feedback-shell, .updates-shell { padding: 24px 16px 48px; }
  .feedback-filters { align-items: stretch; flex-direction: column; }
  .feedback-filters select { width: 100%; }
  .feedback-filters .count { margin-left: 0; padding: 2px 0 0; }
  .feedback-card { padding: 19px 16px; }
  .feedback-card > header { align-items: flex-start; flex-direction: column; gap: 9px; }
  .feedback-card-actions { align-items: stretch; flex-direction: column; }
  .feedback-card-actions > .button { width: 100%; }
  .feedback-dialog form { padding: 20px; }
  .feedback-form-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .updates-empty { align-items: flex-start; padding: 28px 22px; }
}

/* Checkpoint selection and the same editor mounted in the comparison's After side. */
.checkpoint-selection { flex: 1; min-width: 0; }
.checkpoint-selection select, .checkpoint-selection select:hover { min-width: 0; width: 100%; text-align: center; text-align-last: center; border-color: var(--gold); outline: 2px solid var(--gold-40); outline-offset: 2px; }
.checkpoint-selection select:focus-visible { background-color: color-mix(in srgb, var(--gold) 12%, var(--bg)); }
.checkpoint-selection label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
#checkpoint-save-effect { font-size: 13px; color: var(--text-muted); }
.public-save-effect { border-left: 3px solid var(--gold); padding: 8px 12px; background: var(--surface); }
.checkpoint-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--text-muted); }
.checkpoint-note-columns { margin: 18px 0; }
.checkpoint-note-columns h3 { font-size: 13px; margin-bottom: 6px; }
#checkpoint-notes, #new-checkpoint-notes { width: 100%; resize: vertical; }
.editing-checkpoint #checkpoint-previews { display: block; margin-top: 18px; }
.editing-checkpoint #checkpoint-previews > summary { display: none; }
.editing-checkpoint #checkpoint-previews > .checkpoint-columns > section { display: block; min-height: 0; max-height: 55vh; overflow: auto; padding: 4px; }
.editing-checkpoint #write-panel { min-height: 0; animation: none; padding: 18px; margin: 0; width: 100%; }
.editing-checkpoint #write-panel .body { min-height: 200px; }
.editing-checkpoint #toolbar { margin-bottom: 12px; z-index: 3; }
.editing-checkpoint #organization-fields, .editing-checkpoint #checkpoint-notes-block { margin-top: 12px; }
.editing-checkpoint #checkpoint-edit-host { min-width: 0; }
@media (max-width: 700px) {
  .editing-checkpoint #checkpoint-previews > .checkpoint-columns > section { max-height: 50vh; }
}

/* Native checkbox choices work with a normal click, touch, or Space. */
.category-choices {
  margin: 0; padding: 6px; min-width: 0; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}
.category-choices label {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px;
  border-radius: 4px; cursor: pointer; overflow-wrap: anywhere;
}
.category-choices label:hover, .category-choices label:focus-within { background: var(--surface-2); }
.category-choices label:has(:checked) { background: var(--seam-wash); }
.category-choices input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--seam); }
.category-choices:disabled { opacity: .6; }

.keyword-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
.keyword-entry-row { display: flex; align-items: center; gap: 8px; }
.keyword-entry-row input { flex: 1; min-width: 0; }
.keyword-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 10px; }
.keyword-tags:empty { display: none; }
.keyword-tags li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 12px; }
.keyword-tags span { min-width: 0; overflow-wrap: anywhere; }
.keyword-tags button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 3px; font-size: 17px; line-height: 1; }
.keyword-tags button:hover { color: var(--text); }
.keyword-controls:disabled { opacity: .6; }
