/* Reading-first theme. World-specific accent variables remain user configurable. */
:root {
  --radius: 14px;
  --muted: #b0beb9;
  --dim: #8a9c94;
  --sidebar: 272px;
  --motion-normal: calc(180ms * var(--motion-tempo));
  --motion-slow: calc(260ms * var(--motion-tempo));
}
body {
  background: radial-gradient(ellipse at 70% 0, rgba(var(--accent-rgb), .055), transparent 48rem), #080d11;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(var(--accent-rgb), .3); color: var(--text); }
:is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sidebar { background: #0b1115; }
.sidebar-inner { padding: 26px 18px 20px; gap: 28px; }
.brand { padding: 0 9px 25px; gap: 13px; }
.brand-title { display: block; font-size: 1.08rem; letter-spacing: -.025em; }
.brand-subtitle { display: block; font-size: .73rem; }
.nav { gap: 5px; }
.nav-link { position: relative; min-height: 40px; padding-left: 15px; font-size: .88rem; border-radius: 9px; }
.nav-link.active { background: rgba(var(--accent-rgb), .08); border-color: transparent; color: var(--text); }
.nav-link.active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.sidebar-note { padding: 14px; border: 0; background: rgba(255,255,255,.025); font-size: .75rem; line-height: 1.7; }
.topbar { gap: 18px; padding: 14px 28px; background: rgba(8,13,17,.96); border-bottom: 1px solid var(--line); }
.top-actions { gap: 7px; flex-wrap: wrap; }
.top-actions > .top-action { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted); font-size: .78rem; }
.top-actions > .top-action:hover { color: var(--text); border-color: var(--line-strong); background: rgba(var(--accent-rgb),.07); }
.user-badge { font-size: .72rem; background: transparent; }
.world-switch { padding: 3px; border-radius: 10px; background: #0c141a; }
.world-switch-button { border-radius: 7px; font-size: .76rem; }
.search-box { border-radius: 10px; background: #0d151b; }
.content { width: min(100%, 1240px); padding: 46px 40px 90px; }
.page-head { position: relative; gap: 42px; align-items: center; padding: 0 0 36px; margin-bottom: 36px; }
.page-head:not(:has(.hero-media)) { grid-template-columns: minmax(0,1fr); }
.eyebrow { font-size: .68rem; letter-spacing: .14em; margin-bottom: 16px; }
.page-title { font-size: clamp(2.1rem, 4.1vw, 4.2rem); font-weight: 760; letter-spacing: -.045em; line-height: 1.08; text-wrap: balance; }
.page-lead { font-size: 1rem; line-height: 1.8; max-width: 70ch; }
.page-context { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 21px; color: var(--dim); font-size: .72rem; }
.page-context span + span::before { content: "·"; margin-right: 12px; color: var(--accent); }
.hero-media { position: relative; padding: 22px; background: radial-gradient(ellipse at 50% 35%, rgba(var(--accent-rgb),.1), transparent 75%), #0b1318; border-radius: 22px; }
.hero-media img { height: 200px; width: 100%; object-fit: contain; padding: 0; filter: drop-shadow(0 14px 20px rgba(0,0,0,.3)); }
.hero-media figcaption { padding: 18px 0 0; background: transparent; border: 0; text-align: center; font-size: .7rem; letter-spacing: .04em; color: var(--dim); }
.section-block { margin-top: 34px; }
.section-title-row { margin-bottom: 17px; gap: 12px; }
.section-title-row h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; }
.source-label { font-size: .68rem; background: transparent; }
.meta-grid { grid-template-columns: minmax(130px,.7fr) minmax(0,1.7fr) minmax(130px,.8fr); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: 14px; overflow: hidden; }
.meta-card { border: 0; border-radius: 0; padding: 19px; background: #0d151b; }
.meta-card strong { font-weight: 600; font-size: .94rem; }
.quick-grid, .card-grid { gap: 15px; }
.quick-link { min-height: 98px; padding: 21px; background: linear-gradient(120deg, rgba(var(--accent-rgb),.04), transparent), #0d151b; border-radius: 14px; }
.quick-link span { font-weight: 650; }
.quick-link small { color: var(--dim); margin-top: 7px; }
.entity-card, .archive-card, .term-card { background: #0d151b; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.entity-body { padding: 23px; }
.entity-body h3 { font-size: 1.1rem; line-height: 1.45; letter-spacing: -.02em; }
.entity-body p { line-height: 1.75; font-size: .9rem; }
.entity-actions { margin-top: 18px; gap: 8px; }
.source-link { border-radius: 8px; font-size: .78rem; }
.article { padding: clamp(20px, 3vw, 34px); border-radius: 16px; background: #0c1419; }
.article p, .article li { line-height: 1.85; }
.article > p, .article > ul, .article > ol { max-width: 80ch; }
.article h2 { font-size: 1.45rem; letter-spacing: -.025em; }
.article h3 { font-size: 1.18rem; margin-top: 30px; }
.article-editor-buttons .ghost-action { font-size: .73rem; min-height: 30px; padding: 0 10px; }
.article-toc { background: rgba(var(--accent-rgb),.025); border-radius: 12px; padding: 17px 20px; }
.article-toc a { border-radius: 7px; background: #0b1318; font-size: .76rem; }
.archive-image { background: #090f13; }
.archive-filter { border-radius: 9px; }
.editor-modal-panel { border-radius: 20px; background: #10191f; box-shadow: 0 30px 100px #0008; }
.editor-form { gap: 17px; }
.editor-form label { line-height: 1.65; }
.editor-note { color: var(--dim); line-height: 1.7; }
.empty-state { padding: 32px; background: #0d151b; border: 1px dashed var(--line); border-radius: 14px; }
.assistant-panel { width: min(480px,calc(100vw - 28px)); height: min(730px,calc(100dvh - 114px)); max-height: none; border-radius: 20px; border-color: var(--line-strong); box-shadow: 0 28px 95px #0009; }
.assistant-panel.open { grid-template-rows: auto auto minmax(0,1fr) auto auto; }
.assistant-header { padding: 18px 20px; }
.assistant-header strong { color: var(--text); }
.assistant-messages { padding: 20px; gap: 15px; overscroll-behavior: contain; overflow-anchor: none; }
.assistant-message { border-radius: 14px; font-size: .88rem; line-height: 1.75; padding: 14px 16px; }
.assistant-message.user { background: rgba(var(--accent-rgb),.12); color: var(--text); border-color: rgba(var(--accent-rgb),.18); border-bottom-right-radius: 4px; }
.assistant-message.assistant { background: #111c23; border-bottom-left-radius: 4px; }
.assistant-message.error { border-color: rgba(255,138,138,.35); }
.assistant-phase { display: block; margin-top: 7px; color: var(--dim); font-size: .75rem; font-weight: 400; }
.assistant-status { margin: 0; min-height: 22px; padding: 0 18px 10px; }
.assistant-form { gap: 9px; padding: 14px 18px; }
.assistant-form textarea { line-height: 1.55; padding: 12px; }
.assistant-form button { border-radius: 10px; }
.assistant-stop { display: none; }
.assistant-form.generating .assistant-stop { display: block; background: transparent; color: var(--danger); border: 1px solid var(--line); }
.assistant-form.generating button[type="submit"] { display: none; }
.assistant-message p { margin: 0 0 10px; }
.assistant-message p:last-child { margin: 0; }
/* Only a route change animates the reading surface. Stream deltas never animate it. */
.content > *, .quick-grid > *, .card-grid > *, .meta-grid > *, .timeline-list > *, .term-grid > *, .archive-grid > * { animation: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .quick-link:hover, .entity-card:hover, .archive-card:hover { transform: translateY(calc(-3px * var(--motion-intensity))); box-shadow: 0 10px 28px #0003; border-color: var(--line-strong); }
  .nav-link:hover { transform: translateX(calc(2px * var(--motion-intensity))); }
}
@media (max-width: 1200px) { .content { padding: 32px 26px 70px; } .topbar { padding: 12px 20px; } .top-actions { justify-content: flex-end; } }
@media (max-width: 760px) {
  .content { padding: 24px 17px 80px; }
  .page-head { gap: 22px; margin-bottom: 25px; padding-bottom: 25px; }
  .page-title { font-size: clamp(2rem,8vw,3.1rem); }
  .page-lead { font-size: .92rem; }
  .hero-media { padding: 16px; border-radius: 16px; }
  .hero-media img { height: 150px; }
  .meta-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .top-actions > .top-action { font-size: .73rem; }
  .article { padding: 19px; }
  .assistant-widget { right: 14px; bottom: 14px; }
  .assistant-panel { bottom: 66px; height: min(690px,calc(100dvh - 96px)); }
  .assistant-messages { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { .content, .assistant-panel { animation: none !important; } }
