:root {
  color-scheme: dark;
  --ink: #020617;
  --panel: rgba(12, 22, 42, .88);
  --panel-deep: rgba(4, 12, 27, .94);
  --gold: #d6ae61;
  --gold-soft: #f7dfb0;
  --violet: #b078be;
  --line: rgba(214, 174, 97, .34);
  --muted: #c3cede;
  --danger: #f5a8a8;
  font-family: Lato, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: #f5f2ea; background: radial-gradient(ellipse at 15% 8%, #253d61 0%, transparent 39%), radial-gradient(ellipse at 80% 22%, #3c2945 0%, transparent 32%), var(--ink); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .2; background-image: linear-gradient(90deg, transparent 0 49%, rgba(247,223,176,.18) 50%, transparent 51%), linear-gradient(0deg, transparent 0 49%, rgba(247,223,176,.12) 50%, transparent 51%); background-size: 62px 62px; mask-image: linear-gradient(to bottom, black, transparent 85%); }
.shell { width: min(1440px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 28px 0 48px; }
.masthead, .card { border: 1px solid var(--line); background: linear-gradient(135deg, rgba(20,35,62,.92), var(--panel-deep)); box-shadow: 0 18px 45px rgba(0,0,0,.26); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 28px; border-radius: 5px 5px 0 0; }
.sigil { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold-soft); font: 27px Cinzel, Georgia, serif; border-radius: 50%; box-shadow: inset 0 0 0 4px rgba(214,174,97,.12); }
.brand { display: flex; align-items: center; gap: 15px; }
h1, h2, h3, .eyebrow { font-family: Cinzel, Georgia, serif; letter-spacing: .055em; }
h1 { font-size: clamp(1.25rem, 2vw, 1.75rem); margin: 0; color: var(--gold-soft); }
.eyebrow { margin: 0 0 4px; font-size: .72rem; color: var(--gold); text-transform: uppercase; }
.session { color: var(--muted); font-size: .9rem; text-align: right; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: 16px; margin-top: 16px; }
.card { padding: 20px; border-radius: 3px; }
.sidebar { min-width: 0; align-self: start; }
.sidebar h2, .questions h2, .detail h2 { margin: 0 0 14px; font-size: 1rem; color: var(--gold-soft); }
label { display: grid; gap: 7px; font-weight: 700; color: var(--muted); font-size: .85rem; }
input, textarea, button { font: inherit; }
input, textarea { width: 100%; border: 1px solid rgba(247,223,176,.35); color: #fff; background: rgba(1,8,21,.72); border-radius: 2px; padding: 10px; }
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
button { border: 1px solid var(--gold); color: var(--ink); background: linear-gradient(135deg, var(--gold-soft), var(--gold)); padding: 9px 12px; cursor: pointer; font-weight: 800; border-radius: 2px; }
button.secondary { color: var(--gold-soft); background: transparent; border-color: rgba(247,223,176,.55); }
button.danger { color: #fff7f7; border-color: #d88787; background: rgba(104,29,39,.68); }
button:hover { filter: brightness(1.08); }
.stack { display: grid; gap: 12px; }
.entry-list, .question-list, .history { display: grid; gap: 9px; }
.entry-list { min-width: 0; max-height: clamp(14rem, 55vh, 42rem); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-color: var(--gold) rgba(1,8,21,.72); padding-right: 8px; }
.entry-list::-webkit-scrollbar { width: 12px; }
.entry-list::-webkit-scrollbar-track { background: rgba(1,8,21,.72); border-radius: 999px; }
.entry-list::-webkit-scrollbar-thumb { background: var(--gold); border: 3px solid rgba(1,8,21,.72); border-radius: 999px; }
.entry { display: block; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; white-space: normal; text-align: left; color: #fff; background: rgba(255,255,255,.025); border: 1px solid rgba(214,174,97,.18); padding: 13px; }
.entry strong { display: block; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.entry:hover, .entry[aria-current="true"] { border-color: var(--gold); background: rgba(214,174,97,.11); }
.entry small, .source, .hint { color: var(--muted); display: block; margin-top: 5px; }
.entry small { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.tag { display: inline-block; border: 1px solid rgba(176,120,190,.65); color: #e7c7ee; font-size: .72rem; padding: 2px 6px; margin-right: 5px; border-radius: 999px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.detail { min-height: 520px; }
.detail h2 { font-size: 1.42rem; }
.body { white-space: pre-wrap; line-height: 1.6; }
.history-item { padding: 13px; border-left: 2px solid var(--gold); background: rgba(255,255,255,.035); }
.editorial-article { padding: clamp(16px, 3vw, 30px); }
.article-version { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.article-lead { margin: 22px 0; color: #fffaf0; font-size: 1.08rem; line-height: 1.75; }
.key-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 26px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.key-facts div { min-width: 0; padding: 12px 14px; background: rgba(3, 12, 27, .96); }
.key-facts dt { color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.key-facts dd { margin: 5px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.article-section { padding: 18px 0; border-top: 1px solid rgba(214,174,97,.2); }
.article-section h3 { margin: 0 0 12px; color: var(--gold-soft); font-size: 1rem; }
.article-section p { margin: 0 0 12px; line-height: 1.75; }
.editorial-notice { margin: 18px 0; padding: 13px 15px; border-left: 3px solid var(--violet); background: rgba(176,120,190,.1); }
.editorial-notice p { margin: 6px 0 0; line-height: 1.6; }
.provenance, .raw-history { margin-top: 18px; border: 1px solid rgba(214,174,97,.25); background: rgba(1,8,21,.38); }
.provenance summary, .raw-history summary { padding: 12px 14px; color: var(--gold-soft); cursor: pointer; font-weight: 800; }
.provenance dl, .raw-history-content { margin: 0; padding: 0 14px 14px; }
.provenance dt { margin-top: 10px; color: var(--muted); font-size: .75rem; }
.provenance dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.provenance a { color: var(--gold-soft); }
.provenance code { white-space: normal; word-break: break-all; }
.question { border-bottom: 1px solid rgba(214,174,97,.2); padding: 13px 0; }
.question:first-child { padding-top: 0; }
.question p { line-height: 1.45; margin: 4px 0 11px; }
.question-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.composer { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(214,174,97,.25); }
.notice { margin: 0 0 14px; padding: 10px; border-left: 3px solid var(--gold); background: rgba(214,174,97,.1); color: var(--gold-soft); }
.notice.error { border-color: var(--danger); color: #ffe0e0; background: rgba(129,27,37,.24); }
.archive-toggle { margin-top: 10px; }
.subtle { font-size: .82rem; color: var(--muted); }
@media (max-width: 1100px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } .questions { grid-column: 1 / -1; } }
@media (max-width: 760px) { .shell { width: min(100% - 20px, 680px); padding-top: 10px; } .masthead { align-items: flex-start; padding: 18px; } .session { font-size: .78rem; } .layout { grid-template-columns: 1fr; } .questions { grid-column: auto; } .sidebar { order: 1; } .detail { order: 2; } .questions { order: 3; } .key-facts { grid-template-columns: 1fr; } .editorial-article { padding: 15px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
