:root {
  color-scheme: dark;
  --ink: #f7f2e7;
  --muted: #a59e90;
  --panel: #17191c;
  --line: #30343a;
  --gold: #f0b84b;
  --green: #57c98b;
  --red: #ef796f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #0d0f11; color: var(--ink); font-size: 16px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 3px; background: var(--gold); }
a { color: var(--gold); }
.topbar, main { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: 2rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.topbar > div { margin-right: auto; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; }
h2 { margin-bottom: .4rem; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.eyebrow { margin-bottom: .25rem; color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.coffee { padding: .65rem .9rem; border: 1px solid var(--gold); border-radius: 999px; text-decoration: none; font-weight: 700; }
main { padding: 1.5rem 0 4rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: .8rem; }
.metrics article, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.metrics article { min-height: 116px; padding: 1rem; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: .85rem; }
.metrics strong { display: block; margin-top: .35rem; font: 500 1.65rem Georgia, serif; }
.progress { height: 5px; margin-top: .6rem; overflow: hidden; background: #30343a; border-radius: 99px; }
.progress i { display: block; height: 100%; background: var(--gold); }
.panel { padding: 1.25rem; }
.subject { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.handle, .muted { color: var(--muted); }
.status { display: inline-block; margin-left: .5rem; padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.workspace { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr); gap: .8rem; align-items: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin-bottom: 0; }
.fact-list { padding: 0; list-style: none; }
.fact-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.fact-list p { margin: .35rem 0; }
.fact-state { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fact-state.verified { color: var(--green); }
.fact-state.unverified { color: var(--red); }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.stack { display: grid; gap: .8rem; margin-top: 1rem; }
label { color: var(--muted); font-size: .85rem; }
input, textarea { display: block; width: 100%; margin-top: .3rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; background: #0e1012; color: var(--ink); font: inherit; }
input[type="hidden"] { display: none; }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: .55rem; align-items: center; }
.check input { width: auto; margin: 0; }
button { padding: .7rem .9rem; border: 1px solid var(--gold); border-radius: 8px; background: var(--gold); color: #17120a; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.quiet { background: transparent; color: var(--muted); border-color: transparent; }
.draft-list { display: grid; gap: 1rem; margin-top: 1rem; }
.draft-card { padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: #111316; }
.draft-meta { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.draft-meta .status { margin-left: auto; }
.status.approved { color: var(--green); border-color: var(--green); }
.status.rejected { color: var(--red); border-color: var(--red); }
.status.posted { color: var(--gold); border-color: var(--gold); }
.preview { margin: 1rem 0; font-size: 1.05rem; white-space: pre-wrap; }
.tip-link { white-space: nowrap; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .75rem; }
.actions .approve { background: var(--green); border-color: var(--green); }
.actions .reject { background: transparent; border-color: var(--red); color: var(--red); }
.publish-actions { padding-top: .75rem; border-top: 1px solid var(--line); }
.published-record { margin: .75rem 0 0; color: var(--green); font-size: .8rem; }
.citations { display: flex; gap: .7rem; margin-top: .7rem; font-size: .8rem; }
.notice { margin-bottom: .8rem; padding: .8rem 1rem; border: 1px solid var(--green); border-radius: 8px; color: var(--green); }
.notice.error { border-color: var(--red); color: var(--red); }
.empty { padding: 3rem 1.25rem; text-align: center; }
.analytics-panel { margin-bottom: .8rem; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.analytics-grid h3 { font-size: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .45rem; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
.analytics-forms { display: flex; gap: 1.5rem; }
.analytics-forms details { flex: 1; }
.metric-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .75rem; }
.metric-form button { grid-column: 1 / -1; }
.recent-ledger { margin: 1rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-page { min-height: 100vh; display: grid; place-items: center; }
.auth-shell { width: min(430px, calc(100% - 2rem)); padding: 1rem 0; }
.auth-card { padding: 2rem; }
.auth-card h1 { margin-bottom: 1.5rem; }
.auth-card pre { overflow-x: auto; padding: 1rem; background: #0e1012; border-radius: 8px; color: var(--muted); font-size: .8rem; }
@media (max-width: 800px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { align-items: flex-start; }
  .metrics { grid-template-columns: 1fr; }
  .subject, .section-heading { align-items: flex-start; flex-direction: column; }
  .analytics-forms { flex-direction: column; gap: 0; }
  .metric-form { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
