:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --paper: #fbf8f0;
  --ink: #16181d;
  --ink-2: #4a4f5a;
  --ink-3: #7c818c;
  --line: #e2ded4;
  --accent: #d93a3f;
  --accent-ink: #ffffff;
  --bubble-in: #e9e6de;
  --bubble-out: #2f6fed;
  --bubble-out-ink: #ffffff;
  --alert: #b8292e;
  --real: #0f766e;
  --real-bg: #e3f3f1;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 6px 24px rgba(20, 20, 30, .06);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --paper: #1c1f25;
    --ink: #eceef2;
    --ink-2: #b4b9c4;
    --ink-3: #7d8391;
    --line: #2a2f39;
    --bubble-in: #262b34;
    --bubble-out: #3b78f0;
    --alert: #f0565b;
    --real: #4fd1c0;
    --real-bg: #12302d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a20; --surface-2: #1e222a; --paper: #1c1f25;
  --ink: #eceef2; --ink-2: #b4b9c4; --ink-3: #7d8391; --line: #2a2f39;
  --bubble-in: #262b34; --bubble-out: #3b78f0; --alert: #f0565b; --real: #4fd1c0; --real-bg: #12302d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) 0 0;
}
.top-inner, .status { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font-weight: 700; letter-spacing: .14em; font-size: 17px; }
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-family: var(--serif); font-style: italic; font-weight: 600; cursor: pointer;
}
.status { font-size: 13px; color: var(--ink-2); padding-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.status b { color: var(--ink); font-weight: 600; }

/* ---------- layout ---------- */
main { max-width: 620px; margin: 0 auto; padding: 16px 16px 80px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }

/* ---------- banners ---------- */
.banner {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.banner h2 { margin: 0 0 6px; font-size: 15px; }
.banner p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.banner .row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600;
}
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.hero { text-align: center; padding: 40px 20px; }
.hero .tagline { font-family: var(--serif); font-size: 22px; line-height: 1.35; margin: 10px 0 16px; color: var(--ink); }
.hero .countdown { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; margin: 8px 0 4px; }

/* ---------- card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 110px;
}
.card-head { padding: 14px 18px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stamp { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stamp .ep { color: var(--ink-2); }
.form-tag { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.loc { padding: 4px 18px 0; font-size: 13px; color: var(--ink-2); }
.card-body { padding: 12px 18px 18px; }
.card-title { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 2px 0 10px; }
.card.new { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -1px; }

/* prose */
.f-prose .card-body p, .f-event .card-body p {
  font-family: var(--serif); font-size: 18.5px; line-height: 1.62; margin: 0 0 .85em;
}
.f-prose .card-body p:last-child { margin-bottom: 0; }
.f-prose .card-title { font-family: var(--serif); font-weight: 600; font-size: 21px; }

/* messages */
.thread-meta { text-align: center; font-size: 12px; color: var(--ink-3); margin: 0 0 12px; }
.f-messages .frame { font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin: 0 0 12px; }
.msgs { display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 82%; display: flex; flex-direction: column; }
.msg .who { font-size: 11.5px; color: var(--ink-3); margin: 6px 10px 2px; }
.msg .bubble { background: var(--bubble-in); padding: 9px 13px; border-radius: 18px; border-bottom-left-radius: 6px; font-size: 15.5px; line-height: 1.4; white-space: pre-wrap; }
.msg .t { font-size: 10.5px; color: var(--ink-3); margin: 2px 10px 0; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-ink); border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }

/* news alert (fictional) */
.f-news_alert .alert-band {
  background: var(--alert); color: #fff; padding: 8px 18px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  display: flex; justify-content: space-between; gap: 8px;
}
.f-news_alert .alert-band .fic { font-weight: 600; opacity: .85; }
.f-news_alert .card-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.f-news_alert .card-body p { font-size: 15.5px; color: var(--ink-2); margin: 0 0 .7em; }

/* document */
.f-document .card-body { background: var(--paper); margin: 12px 14px 16px; border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.f-document .doc-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--alert); margin-bottom: 8px; }
.f-document .card-title { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.f-document .card-body p { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; margin: 0 0 .8em; white-space: pre-wrap; }

/* transcript */
.f-transcript .rec { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: baseline; gap: 6px; }
.f-transcript .rec::before { flex: none; }
.f-transcript .rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); }
.f-transcript .line { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 10px; }
.f-transcript .spk { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.f-transcript .txt { font-family: var(--mono); font-size: 14px; line-height: 1.55; }
.f-transcript .frame { font-family: var(--serif); font-size: 16px; color: var(--ink-2); }

/* event */
.f-event { border-left: 4px solid var(--ink); }
.f-event .card-title { font-family: var(--sans); font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }

.redact { background: var(--ink); color: transparent; border-radius: 2px; user-select: none; }

/* real world */
.real { border-top: 1px dashed var(--line); padding: 10px 18px 12px; }
.real-toggle {
  background: var(--real-bg); color: var(--real); border: 0; border-radius: 999px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.real-toggle::before { content: "◉"; font-size: 10px; }
.real-list { margin: 10px 0 0; padding: 0; list-style: none; display: none; }
.real.open .real-list { display: block; }
.real-list li { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; }
.real-list a { color: var(--real); font-weight: 600; text-decoration: none; }
.real-list a:hover { text-decoration: underline; }

/* ---------- pill & sheet ---------- */
.pill {
  position: fixed; top: 112px; left: 50%; transform: translateX(-50%); z-index: 11;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer;
}
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 620px; margin: 0 auto; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
.sheet h2 { margin: 0 0 4px; font-size: 20px; }
.sheet .sub { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.sheet p { font-family: var(--serif); font-size: 17.5px; line-height: 1.6; margin: 0 0 1em; }
.sheet ol { padding-left: 0; list-style: none; margin: 0 0 16px; }
.sheet li { margin-bottom: 12px; font-family: var(--serif); font-size: 16.5px; line-height: 1.5; }
.sheet li .when { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.sheet .fine { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.sheet-close { position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 20px; line-height: 1; cursor: pointer; }

.end-note { text-align: center; color: var(--ink-3); font-size: 13px; padding: 28px 0 0; }
.end-note .mark { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2); display: block; margin-bottom: 4px; }
