/* The Five Y's — built to be easy to read.
 * Montserrat handles navigation; a book-like serif carries long reads; Playfair Display handles
 * headings. Type, hairline rules and whitespace carry the reading layout, with the
 * approved five-leaf brand mark in shared states. Colours are tokens on :root; dark values apply via the OS preference
 * unless the reader picked a theme (data-theme on <html>, set early by theme.js). */

:root {
  color-scheme: light;
  --paper: #F8F8F6;
  --paper-raised: #FFFFFF;
  --paper-sunk: #E9EEF5;
  --ink: #081F3B;
  --ink-soft: #263F5A;
  --muted: #5C6F83;
  --rule: #DCE4EC;
  --rule-strong: #B9C8D8;
  --accent: #1E5A8A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E9EEF5;
  --warm: #1E5A8A;
  --focus: #1E5A8A;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-ui: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-reading: Georgia, "Times New Roman", serif;
  --reader-scale: 1;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #081F3B;
    --paper-raised: #102B49;
    --paper-sunk: #153653;
    --ink: #E9EEF5;
    --ink-soft: #CFDCE9;
    --muted: #A9BED2;
    --rule: #29445F;
    --rule-strong: #45617D;
    --accent: #8EB3D9;
    --accent-ink: #081F3B;
    --accent-soft: #153653;
    --warm: #8EB3D9;
    --focus: #8EB3D9;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #081F3B;
  --paper-raised: #102B49;
  --paper-sunk: #153653;
  --ink: #E9EEF5;
  --ink-soft: #CFDCE9;
  --muted: #A9BED2;
  --rule: #29445F;
  --rule-strong: #45617D;
  --accent: #8EB3D9;
  --accent-ink: #081F3B;
  --accent-soft: #153653;
  --warm: #8EB3D9;
  --focus: #8EB3D9;
}

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
button, select, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.eyebrow { margin: 0; color: var(--accent); font: 700 12px/1.3 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }

/* ---- Buttons ---- */

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 16px/1 var(--font-ui);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, filter 160ms ease;
}
.button-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { filter: brightness(1.08); }
.button-quiet:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---- Top bar ---- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
.topbar-inner { width: min(1180px, 100%); height: var(--topbar-h); margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: calc(100% - 100px); color: var(--ink); text-decoration: none; }
.logo-mark, .brand-name, .why-tree { display: block; flex: none; object-fit: contain; mix-blend-mode: multiply; }
.logo-mark { width: 38px; height: 38px; }
.brand-name { width: auto; height: 48px; }
:root[data-theme="dark"] .logo-mark, :root[data-theme="dark"] .brand-name, :root[data-theme="dark"] .why-tree { filter: invert(1) grayscale(1); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark, :root:not([data-theme="light"]) .brand-name, :root:not([data-theme="light"]) .why-tree { filter: invert(1) grayscale(1); mix-blend-mode: screen; }
}
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); }
.icon-button:hover { background: var(--paper-sunk); color: var(--ink); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-controls { display: flex; flex: none; align-items: center; gap: 2px; }
.language-control { position: relative; cursor: pointer; }
.language-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.language-control:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---- Layout ---- */

.layout { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 72px; align-items: start; }

/* ---- Side column: progress + the five questions ---- */

.rail { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 40px 0 32px; scrollbar-width: thin; }
.rail-title { margin: 0; font: 500 30px/1.1 var(--font-display); letter-spacing: -.02em; }
.progress { width: 100%; margin-top: 18px; display: grid; gap: 10px; padding: 16px 0; border: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; color: inherit; text-align: left; }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.progress-label { color: var(--ink); font-size: 15px; font-weight: 600; }
.progress-compact { display: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.progress-value { display: inline-flex; align-items: center; gap: 10px; }
.progress-value strong { color: var(--accent); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chevron { width: 28px; height: 28px; padding: 6px; border: 1px solid var(--rule-strong); border-radius: 50%; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease, background-color 160ms ease, border-color 160ms ease; }
.progress:hover .chevron { border-color: var(--accent); background: var(--accent-soft); }
.progress[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.progress-track { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: var(--paper-sunk); box-shadow: inset 0 0 0 1px var(--rule); }
.progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 400ms cubic-bezier(.2, .7, .2, 1); }
.progress-foot { color: var(--muted); font-size: 13px; }
.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; }

.question-list { display: none; margin: 0; padding: 0; list-style: none; }
.question-list.is-open { display: block; }
.question-list li { border-bottom: 1px solid var(--rule); }
.question { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) 20px; gap: 12px; align-items: start; padding: 14px 0; border: 0; background: transparent; text-align: left; }
.question-number { color: var(--muted); font: italic 500 20px/1.2 var(--font-display); }
.question-copy { display: grid; gap: 4px; min-width: 0; }
.question-title { color: var(--ink); font: 500 16px/1.35 var(--font-ui); }
.question-meta { color: var(--muted); font-size: 13px; }
.question:hover .question-title { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.question.is-active .question-number, .question.is-active .question-title { color: var(--warm); }
.question.is-active .question-title { font-weight: 600; }
.question.is-read:not(.is-active) .question-title { color: var(--muted); }
.question.is-read .question-number { color: var(--accent); }
.question-check { width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.question.is-read .question-check { border-color: var(--accent); background: var(--accent) center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* ---- The article ---- */

.reader { min-width: 0; padding: 44px 0 80px; outline: none; }
.reader > * { max-width: 680px; }
.notice { margin: 0 0 28px; padding: 12px 16px; border-left: 3px solid var(--warm); color: var(--ink-soft); font-size: 15px; }

.article-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.article-actions { display: flex; flex: none; align-items: center; gap: 2px; }
.article-meta { margin: 0; min-width: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.reading-settings { position: relative; }
.reading-settings-toggle { font: 600 16px/1 var(--font-display); }
.reading-settings-toggle[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.reading-settings-panel { position: absolute; z-index: 15; top: calc(100% + 10px); right: -46px; width: min(290px, calc(100vw - 40px)); padding: 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-raised); box-shadow: 0 14px 36px #081f3b24; }
.settings-title { margin: 0 0 12px; font: 600 15px/1.3 var(--font-ui); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 13px; }
.settings-stepper { display: flex; align-items: center; gap: 5px; }
.settings-stepper button, .settings-spacing { min-height: 36px; border: 1px solid var(--rule-strong); border-radius: 18px; background: transparent; color: var(--ink); }
.settings-stepper button { width: 36px; font-size: 20px; line-height: 1; }
.settings-stepper button:disabled { opacity: .35; }
.settings-stepper output { min-width: 42px; text-align: center; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.settings-spacing { padding: 0 12px; font-size: 12px; font-weight: 600; }
.settings-spacing[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.article-share { flex: none; border: 1px solid var(--rule); }
.article-share .copied-icon { display: none; }
.article-share.is-copied .share-icon { display: none; }
.article-share.is-copied .copied-icon { display: block; }
.article-title { margin: 10px 0 14px; font: 500 clamp(34px, 4vw, 48px)/1.14 var(--font-display); letter-spacing: -.025em; text-wrap: balance; overflow-wrap: anywhere; }
.article-deck { margin: 0; color: var(--ink-soft); font: 400 20px/1.5 var(--font-ui); text-wrap: pretty; }
.translation-notice { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.article-body { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--rule); color: var(--ink); font: 400 calc(19px * var(--reader-scale))/1.7 var(--font-reading); }
.article[lang="zh-Hans"] .article-body, .article[lang="hi"] .article-body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.spacious-reading .article-body { line-height: 1.9; }
.spacious-reading .article-body p { margin-bottom: 1.5em; }
.article-body section { margin-top: 28px; }
.article-body h3 { margin: 0 0 8px; color: var(--ink); font: 600 22px/1.3 var(--font-display); letter-spacing: -.01em; }
.article-body p { max-width: 64ch; margin: 0 0 1.1em; text-wrap: pretty; }
.article-body section:last-child:not(:first-child) { margin-top: 36px; padding-left: 18px; border-left: 2px solid var(--accent); }
.article-body section:last-child:not(:first-child) h3 { color: var(--warm); }
.article-body section:last-child:not(:first-child) p { font-size: inherit; font-weight: 400; }

.source-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.source-list li { display: grid; gap: 1px; }
.source-list a { width: fit-content; color: var(--accent); font-size: 16px; font-weight: 500; text-underline-offset: 3px; }
.source-list a::after { content: " ↗"; }
.source-byline { color: var(--muted); font-size: 14px; }

.article-sources { display: inline-block; margin-top: 24px; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.article-sources:hover { text-decoration: underline; text-underline-offset: 3px; }
.next-button { display: flex; width: fit-content; margin-top: 32px; min-width: 200px; }

.undo-toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 18px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper-raised); color: var(--ink); box-shadow: 0 8px 28px #081f3b2b; font-size: 13px; }
.undo-toast button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; }

.done { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--rule); text-align: center; }
.done-graphic .why-tree { width: 112px; max-width: 40%; }
.done h2 { margin: 12px 0 4px; font: 500 28px/1.2 var(--font-display); }
.done p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---- Brand mark (empty state + finish) ---- */

.why-tree { display: block; height: auto; margin: 0 auto; }

.state { min-height: calc(100vh - var(--topbar-h) - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.state-graphic .why-tree { width: min(260px, 62vw); }
.state-caption { margin: 0; color: var(--muted); font: 600 13px/1.3 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }

body.is-empty .layout { grid-template-columns: minmax(0, 1fr); }
body.is-empty .rail { display: none; }
body.is-empty .reader > * { max-width: none; }

/* ---- Sources page ---- */

.sources-page { flex: 1; padding: 40px 32px 72px; }
.sources-wrap { width: min(100%, 720px); margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--ink-soft); font-size: 15px; font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.sources-wrap h1 { margin: 0; font: 500 clamp(32px, 4vw, 44px)/1.1 var(--font-display); letter-spacing: -.02em; }
.sources-date { margin: 6px 0 24px; color: var(--muted); font-size: 15px; }
.source-groups { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.source-group { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.source-group { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.source-group .question-number { color: var(--warm); }
.source-group-title { display: block; margin-bottom: 10px; color: var(--ink); font: 600 19px/1.3 var(--font-display); text-decoration: none; }
.source-group-title:hover { color: var(--accent); }

/* ---- Archive ---- */

.archive-page { flex: 1; padding: 40px 32px 72px; }
.archive-wrap { width: min(100%, 720px); margin: 0 auto; }
.archive-wrap h1 { margin: 0; font: 500 clamp(32px, 4vw, 44px)/1.1 var(--font-display); letter-spacing: -.02em; }
.archive-editions, .archive-articles { margin: 0; padding: 0; list-style: none; }
.archive-editions { margin-top: 24px; }
.archive-edition { padding: 22px 0; border-top: 1px solid var(--rule); }
.archive-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; cursor: pointer; list-style: none; }
.archive-summary::-webkit-details-marker { display: none; }
.archive-summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.archive-summary:hover .archive-date { color: var(--accent); }
.archive-summary svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.archive-details[open] .archive-summary svg { transform: rotate(180deg); }
.archive-date { margin: 0; font: 500 23px/1.25 var(--font-display); }
.archive-articles { padding-top: 12px; }
.archive-article a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 9px 0; text-decoration: none; }
.archive-number { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.archive-title { color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.4; }
.archive-article a:hover .archive-title { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.archive-status { min-height: 20px; margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.archive-more { margin-top: 12px; }

/* ---- Footer: edition date + sources ---- */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer-inner { width: min(1180px, 100%); margin: 0 auto; padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; align-items: center; gap: 24px; }
.footer-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Loading skeleton ---- */

.skeleton { display: grid; gap: 14px; }
.sk { display: block; height: 16px; border-radius: 6px; background: linear-gradient(90deg, var(--paper-sunk) 0%, var(--rule) 50%, var(--paper-sunk) 100%) 0 0 / 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-kicker { width: 200px; height: 14px; }
.sk-title { height: 42px; width: 90%; }
.sk-title.short { width: 60%; margin-bottom: 18px; }
.sk-line { width: 100%; }
.sk.short { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Responsive ---- */

@media (min-width: 821px) and (max-height: 720px) {
  .rail { position: static; max-height: none; overflow: visible; }
}

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

@media (max-width: 820px) {
  :root { --topbar-h: 58px; }
  .topbar-inner { padding: 0 16px; }
  .brand-name { height: 44px; }
  .logo-mark { width: 34px; height: 34px; }
  .layout { display: block; padding: 0 20px; }
  .rail { position: static; max-height: none; overflow: visible; padding: 0; }
  .rail-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .progress { margin-top: 0; padding: 10px 0 12px; gap: 6px; border-top: 0; }
  .progress-label { display: none; }
  .progress-foot { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .progress-compact { display: inline; }
  .reader { padding: 24px 0 56px; scroll-margin-top: var(--topbar-h); }
  .article-title { font-size: clamp(30px, 8.4vw, 38px); }
  .article-deck { font-size: 17px; line-height: 1.55; }
  .article-body { margin-top: 26px; font-size: calc(18px * var(--reader-scale)); }
  .article-body h3 { font-size: 21px; }
  .article-body section:last-child:not(:first-child) { padding-left: 16px; }
  .next-button { width: 100%; }
  .sources-page { padding: 28px 20px 56px; }
  .archive-page { padding: 28px 20px 56px; }
  .site-footer-inner { padding: 16px 20px; }
}

@media (max-width: 640px) {
  .site-footer-inner { flex-wrap: wrap; gap: 10px; }
  .footer-links { width: 100%; }
}

@media (max-width: 360px) {
  .brand-name { height: 40px; }
  .logo-mark { width: 31px; height: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
}

/* ======================================================================
   Editor (admin)
   ====================================================================== */

.topbar-link { padding: 8px 10px; border-radius: 8px; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-decoration: none; }
.topbar-link:hover { color: var(--accent); }
.admin-shell { flex: 1; width: min(100% - 32px, 1000px); margin: 0 auto; padding: 40px 0 120px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-header h1 { margin: 8px 0 0; font: 500 40px/1.05 var(--font-display); letter-spacing: -.03em; }
.admin-who { margin: 0; color: var(--muted); font-size: 13px; }
.admin-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper-raised); }
.admin-tab { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.is-selected { background: var(--accent); color: var(--accent-ink); }
.admin-panel { padding-top: 24px; }
.admin-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-raised); }
.admin-toolbar label { display: grid; gap: 6px; min-width: 190px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--paper-sunk); color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill.is-published { background: var(--accent-soft); color: var(--accent); }
.status-pill.is-published::before { background: var(--accent); }
.status-pill.is-draft::before { background: var(--warm); }
.admin-message { min-height: 20px; margin: 0; color: var(--muted); font-size: 14px; }
.admin-message.has-error { color: #b3261e; }
:root[data-theme="dark"] .admin-message.has-error { color: #f2a197; }
.admin-page input, .admin-page textarea, .admin-page select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font-ui); }
.admin-page textarea { resize: vertical; }
.admin-page textarea.admin-body { font: 17px/1.65 var(--font-display); }
.admin-page input:focus, .admin-page textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.admin-page input:disabled, .admin-page textarea:disabled { opacity: .7; }
.admin-help { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.admin-help code { padding: 1px 5px; border-radius: 4px; background: var(--paper-sunk); font-size: 12px; }
.admin-article-fields { display: grid; gap: 16px; }
.admin-card { margin: 0; padding: 20px; min-width: 0; display: grid; grid-template-columns: 160px 1fr; gap: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-raised); }
.admin-card legend { float: left; width: 100%; grid-column: 1 / -1; padding: 0; display: flex; justify-content: space-between; align-items: baseline; }
.admin-card-number { color: var(--warm); font: italic 500 26px/1 var(--font-display); }
.admin-card-stats { color: var(--muted); font-size: 12px; }
.admin-card label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.admin-card .span-2 { grid-column: 1 / -1; }
.admin-language-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-language-tab { min-height: 36px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.admin-language-tab.is-ready::after { content: " ✓"; color: var(--accent); }
.admin-language-tab.is-selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.admin-language-tab.is-selected.is-ready::after { color: var(--accent-ink); }
.admin-language-panel { display: grid; grid-template-columns: 160px 1fr; gap: 14px; }
.admin-language-panel[hidden] { display: none; }
.admin-language-panel label { min-width: 0; }
.admin-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 20px; padding: 14px 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; background: linear-gradient(transparent, var(--paper) 30%); }
.admin-actions .admin-message { margin-right: auto; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-raised); }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.analytics-table th, .analytics-table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); text-align: left; }
.analytics-table tr:last-child td { border-bottom: 0; }
.analytics-table th { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.analytics-table td:not(:first-child), .analytics-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.admin-footnote { color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 640px) {
  .admin-header h1 { font-size: 32px; }
  .admin-card { grid-template-columns: 1fr; padding: 16px; }
  .admin-language-panel { grid-template-columns: 1fr; }
  .admin-toolbar > * { width: 100%; }
  .admin-actions { justify-content: stretch; }
  .admin-actions .button { flex: 1; }
}
