:root {
  --slate: #2E3438;      /* telescreen housing */
  --form: #D5D8CC;       /* government form paper */
  --slip: #E8EAE1;       /* memo slip */
  --carbon: #1A1D1F;     /* type */
  --party: #A3201C;      /* party red */
  --phosphor: #A9C2A7;   /* telescreen glow */
  --ink: #26405E;        /* carbon-copy blue */
  --rule: #9EA397;
  --muted: #4a5056;

  --c-wire: #5B6166;
  --c-right: #A3201C;
  --c-faith: #7A5C1E;
  --c-left: #26405E;
  --c-intl: #3F6B4E;
  --c-russia: #6B2E5C;
  --c-china: #B04A12;
  --c-texas: #8A3B2A;
  --c-watch: #3a4046;
  --c-indie: #0E6E6D;
  --c-record: #5F5A1E;

  --lvl-1: #7d857d;
  --lvl-2: #5B6166;
  --lvl-3: #9A6F12;
  --lvl-4: #B04A12;
  --lvl-5: #A3201C;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --title: "Major Mono Display", "Courier Prime", monospace;
  --serif: "Spectral", Georgia, serif;
  --type: "Courier Prime", "Courier New", monospace;
  --pad: clamp(1rem, 4vw, 1.5rem);
}

* { box-sizing: border-box; }
html { background: var(--slate); color: var(--carbon); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--serif);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(38, 64, 94, .06) 31px 32px),
    var(--form);
  min-height: 100vh;
}
a { color: var(--ink); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--party); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Telescreen masthead ─────────────────────────── */
.telescreen { background: var(--slate); color: var(--phosphor); padding-top: env(safe-area-inset-top); }
.telescreen__inner {
  max-width: 900px; margin: 0 auto; padding: 1rem var(--pad) .6rem;
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(.75rem, 3vw, 1.5rem); align-items: center;
}
.eye { width: clamp(56px, 14vw, 88px); color: var(--phosphor); }
.eye .iris, .eye .pupil { transition: transform .6s ease-out; }
.mast {
  font: 400 clamp(1.8rem, 9vw, 4.2rem)/1 var(--title);
  letter-spacing: 0; margin: 0; color: var(--form); white-space: nowrap;
  text-shadow: 0 0 18px rgba(169, 194, 167, .25);
}
.mast__sub { font: 500 clamp(.95rem, 3.6vw, 1.15rem)/1.2 var(--display); letter-spacing: .05em; margin: .3rem 0 0; }
.gear {
  align-self: start; color: var(--phosphor); width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%;
}
.gear svg { width: 26px; height: 26px; }
.gear:hover { color: var(--form); }

.slogans {
  max-width: 900px; margin: 0 auto; padding: .55rem var(--pad) .6rem;
  display: flex; justify-content: space-between; gap: .75em; white-space: nowrap; overflow: hidden;
  font: 800 clamp(.7rem, 3.15vw, 1.15rem)/1 var(--display); letter-spacing: .05em; color: var(--form);
  border-top: 2px solid var(--party);
  background-clip: content-box;
}

.ticker { background: var(--phosphor); color: var(--slate); overflow: hidden; border-bottom: 6px solid var(--party); }
.ticker__track {
  display: inline-flex; white-space: nowrap; padding: .55rem 0;
  font: 400 .9rem/1 var(--type);
  animation: marquee var(--ticker-duration, 120s) linear infinite;
}
.ticker__track span { padding-right: 3rem; }
.ticker__track span::before { content: "▪"; color: var(--party); margin-right: .9rem; }
.ticker:hover .ticker__track, .ticker:active .ticker__track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Tabs ───────────────────────────────────────── */
.tabs {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between;
  padding: 0 calc(var(--pad) - .5rem);
  background: var(--form); border-bottom: 1.5px solid var(--carbon);
}
.tabs a {
  font: 800 clamp(.95rem, 4.2vw, 1.15rem)/1 var(--display); letter-spacing: .03em; text-align: center; text-decoration: none;
  white-space: nowrap; color: var(--muted); padding: .9rem .5rem .75rem; border-bottom: 4px solid transparent;
}
.tabs a[aria-selected="true"] { color: var(--carbon); border-bottom-color: var(--party); }

/* ── Main column ────────────────────────────────── */
main { max-width: 900px; margin: 0 auto; padding: 0 var(--pad) 3rem; }
.dateline { font: 400 .95rem/1.45 var(--type); margin: 1.25rem 0 1rem; color: var(--muted); }
.dateline span { display: block; }
.dateline span:first-child { color: var(--carbon); }
.note { font-size: .95rem; color: var(--muted); margin: 0 0 1rem; }
h2 { font: 900 1.9rem/1 var(--display); margin: 0 0 .4rem; letter-spacing: .01em; }

/* Story list */
.stories, .board { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; gap: .6rem; }
.story, .flash {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center;
  background: var(--slip); border: 1.5px solid var(--carbon); color: var(--carbon); text-decoration: none;
  padding: .8rem 1rem .75rem;
}
.story:hover, .flash:hover { box-shadow: 4px 4px 0 var(--slate); }
.story:active, .flash:active { transform: translate(1px, 1px); box-shadow: none; }
.story__title {
  font: 700 clamp(1.25rem, 5vw, 1.45rem)/1.1 var(--display); letter-spacing: .01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  min-height: 2.2em;
}
.story__kw { grid-column: 1; font: 400 .8rem var(--type); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story__camps { grid-column: 1; display: flex; align-items: center; gap: .6rem; font: 400 .8rem var(--type); color: var(--muted); }
.story__chev { grid-row: 1 / span 3; grid-column: 2; font: 700 1.6rem var(--display); color: var(--rule); }
.story--hot { border-left: 7px solid var(--party); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 9px; height: 9px; background: var(--camp); display: block; }
.loading { font: 400 1rem var(--type); padding: 1.5rem 0; list-style: none; }
.loading::after { content: "▌"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Tension board */
.tension-summary { font-size: 1.1rem; margin: 0 0 1.25rem; }
.flash__name { font: 700 clamp(1.25rem, 5vw, 1.45rem)/1.1 var(--display); }
.flash__line { grid-column: 1; font-size: .95rem; line-height: 1.45; color: #2c3135; }
.meter { display: flex; align-items: center; gap: .5rem; grid-column: 1; font: 700 .8rem var(--type); color: var(--lvl); }
.meter b { display: inline-flex; gap: 3px; }
.meter b i { width: 16px; height: 8px; background: rgba(26, 29, 31, .14); display: block; }
.meter b i.on { background: var(--lvl); }
.meter small { font-weight: 400; color: var(--muted); }

/* Sections below the list */
.chute { background: var(--carbon); color: var(--form); padding: .4rem 1.1rem .4rem; margin: 1.5rem 0 2.5rem; position: relative; }
.chute .hole:first-child { border-top: 0; }
.subhead { margin-top: 2rem; }
.raw--single { columns: 1; }
.chute::before {
  content: ""; position: absolute; left: 1.1rem; right: 1.1rem; top: -10px; height: 10px;
  background: repeating-linear-gradient(90deg, var(--carbon) 0 14px, transparent 14px 18px);
}
.chute .note { color: var(--phosphor); }
.chute a, .chute .src a { color: var(--slip); }
.hole { border-top: 1px dashed #556; padding: .75rem 0; font-size: .95rem; }
.hole h3 { font: 800 1.15rem/1.15 var(--display); margin: 0 0 .3rem; }
.hole p { margin: .2rem 0; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; font: 400 .75rem var(--type); margin: .3rem 0; }
.tag { padding: .05rem .35rem; background: var(--camp); color: #fff; }
.tag--off { background: transparent; color: #9aa; text-decoration: line-through; border: 1px solid #556; }
.texas, .hits { margin-bottom: 2.5rem; }
.tx { border-left: 4px solid var(--c-texas); padding: .1rem 0 .1rem .8rem; margin-bottom: 1rem; font-size: .95rem; }
.tx h3 { font: 800 1.15rem/1.15 var(--display); margin: 0 0 .2rem; }
.tx h3 a { color: var(--carbon); text-decoration: none; }
.tx p { margin: 0; }
.hits ul { padding-left: 1.1rem; margin: 0; font-size: .95rem; }
.hits li { margin: .35rem 0; }

.records { border-top: 6px solid var(--carbon); padding-top: 1rem; }
.records summary { font: 900 1.9rem/1 var(--display); cursor: pointer; padding: .3rem 0 .8rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filters button {
  font: 500 .95rem var(--display); letter-spacing: .04em; cursor: pointer;
  border: 1.5px solid var(--camp, var(--carbon)); background: var(--slip); color: var(--carbon); padding: .3rem .65rem;
}
.filters button[aria-pressed="true"] { background: var(--camp, var(--carbon)); color: #fff; }
.raw { columns: 2 340px; column-gap: 2.5rem; padding: 0; list-style: none; margin: 0; font-size: .93rem; }
.raw li { break-inside: avoid; padding: .3rem 0 .3rem .7rem; border-left: 3px solid var(--camp); margin-bottom: .35rem; }
.raw small { font: 400 .78rem var(--type); color: #50565c; display: block; }

/* ── Sheet (story detail, flashpoint detail, settings) ── */
.sheet {
  position: fixed; inset: 0; z-index: 50; background: var(--form); overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sheet__bar {
  position: sticky; top: 0; z-index: 2; background: var(--slate);
  padding: calc(env(safe-area-inset-top) + .4rem) var(--pad) .4rem; border-bottom: 4px solid var(--party);
}
.back { color: var(--form); font: 800 1.2rem/1 var(--display); letter-spacing: .04em; text-decoration: none; display: inline-block; padding: .6rem .2rem; }
.sheet__body:focus { outline: none; }
.sheet__body { max-width: 760px; margin: 0 auto; padding: 1.25rem var(--pad) 4rem; }
.sheet__body h2 { font: 800 clamp(1.8rem, 7vw, 2.4rem)/1.02 var(--display); margin: 0 0 .5rem; }
.kicker { font: 400 .9rem var(--type); color: var(--muted); margin: 0 0 .3rem; }
.sheet__body h3 { font: 800 1.2rem/1.2 var(--display); letter-spacing: .03em; margin: 1.6rem 0 .5rem; }
.stamp {
  display: inline-block; font: 900 .9rem/1 var(--display); letter-spacing: .1em; color: var(--lvl, var(--party));
  border: 3px double var(--lvl, var(--party)); padding: .3rem .45rem; transform: rotate(-3deg); margin: .3rem 0 .5rem;
}
.facts, .disputed, .latest { margin: 0; padding-left: 1.2rem; }
.facts li, .disputed li, .latest li { margin: .25rem 0; }
.facts li::marker { content: "✓  "; color: var(--c-intl); font-weight: 700; }
.disputed li::marker { content: "?  "; color: var(--party); font-weight: 700; font-family: var(--type); }
.latest li::marker { content: "▪  "; color: var(--party); }

.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.slip {
  font: 400 .92rem/1.5 var(--type); background: #fbfbf6; border: 1px solid var(--rule);
  border-top: 7px solid var(--camp, var(--c-wire)); padding: .65rem .8rem .7rem; margin: 0;
}
.slip__camp { font: 800 1rem/1.1 var(--display); letter-spacing: .04em; color: var(--camp); margin: 0 0 .35rem; }
.slip p { margin: 0 0 .45rem; }
.src { list-style: none; padding: 0; margin: 0; font: 400 .8rem/1.45 var(--type); }
.src li { margin: .2rem 0; }
.src a { color: #3a4046; }

.silent { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .9rem; font: 400 .85rem var(--type); }
.silent__bar { background: var(--carbon); padding: 0 .4rem; color: var(--form); font-size: .78rem; }

.newspeak { width: 100%; border-collapse: collapse; font-size: .95rem; }
.newspeak td { border-top: 1px solid var(--rule); padding: .4rem .5rem .4rem 0; vertical-align: top; }
.newspeak td:first-child { font: 700 .85rem var(--type); color: var(--camp); white-space: nowrap; }
.newspeak .term { font-style: italic; }
.newspeak .plain::before { content: "= "; color: var(--party); font-family: var(--type); }

.matters { background: var(--slate); color: var(--form); padding: .8rem 1rem; margin-top: 1.5rem; }
.matters strong { font: 800 1.05rem var(--display); letter-spacing: .04em; color: var(--phosphor); display: block; }
.watch { font-style: italic; margin: 1rem 0 0; }

/* Settings */
.setting { border-top: 1.5px solid var(--carbon); padding: 1rem 0; }
.setting p { margin: .3rem 0; }
.setting ol { padding-left: 1.3rem; margin: .5rem 0; }
.setting li { margin: .3rem 0; }
.setting code { font: 700 .9rem var(--type); background: var(--slip); padding: 0 .25rem; }
.pill { font: 700 .85rem var(--type); padding: .1rem .45rem; color: #fff; background: var(--c-intl); }
.pill--off { background: var(--c-wire); }
.status-list { columns: 2 200px; padding-left: 1rem; font: 400 .85rem/1.5 var(--type); }
.status-list .bad { color: var(--party); }
.warn { font: 400 .9rem var(--type); background: #e9d9c6; border-left: 4px solid var(--c-china); padding: .6rem .9rem; }

body.sheet-open { overflow: hidden; }

@media (min-width: 700px) {
  .stories, .board { gap: .8rem; }
  .story, .flash { padding: 1rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .ticker { overflow-x: auto; }
}

/* Source balance (Settings) */
.spectrum { display: flex; height: 26px; margin: .6rem 0 .3rem; border: 1.5px solid var(--carbon); }
.spectrum span { display: grid; place-items: center; font: 700 .75rem var(--type); color: #fff; min-width: 0; overflow: hidden; }
.spectrum-key { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font: 400 .8rem var(--type); margin: .3rem 0 .8rem; }
.spectrum-key i { display: inline-block; width: 10px; height: 10px; margin-right: .3rem; vertical-align: -1px; }
.lean-group h4 { font: 800 1.05rem var(--display); margin: 1rem 0 .2rem; letter-spacing: .03em; }
.lean-group ul { list-style: none; padding: 0; margin: 0; font: 400 .85rem/1.6 var(--type); columns: 2 180px; }
.lean-group .est { color: var(--muted); }
.lean-group .bad { color: var(--party); }

.brand { min-width: 0; }

/* Daily briefing player */
.brief { background: var(--slate); color: var(--form); margin: 0 0 1.25rem; padding: 1rem 1rem .8rem; border-bottom: 5px solid var(--party); }
.brief__top { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; }
.brief__play {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--party); color: var(--form); display: grid; place-items: center;
}
.brief__play svg { width: 28px; height: 28px; fill: currentColor; }
.brief__play .i-pause, .brief.playing .brief__play .i-play { display: none; }
.brief.playing .brief__play .i-pause { display: inline; }
.brief__label h2 { color: var(--form); font-size: 1.6rem; margin: 0; }
.brief__label p { margin: .15rem 0 0; font: 400 .85rem var(--type); color: var(--phosphor); }
.brief__speed {
  font: 700 .9rem var(--type); color: var(--phosphor); background: transparent; cursor: pointer;
  border: 1.5px solid var(--phosphor); padding: .35rem .55rem; min-width: 3.4rem;
}
.brief__bar { height: 4px; background: rgba(169, 194, 167, .2); margin: .9rem 0 .2rem; }
.brief__bar i { display: block; height: 100%; width: 0; background: var(--phosphor); transition: width .4s linear; }
.brief__text { font-size: 1rem; line-height: 1.6; max-height: 6.4em; overflow: hidden; position: relative; }
.brief__text p { margin: .7rem 0 0; }
.brief__text p.now { color: #fff; background: rgba(169, 194, 167, .12); box-shadow: -.5rem 0 0 rgba(169, 194, 167, .12), .5rem 0 0 rgba(169, 194, 167, .12); }
.brief.open .brief__text { max-height: none; }
.brief:not(.open) .brief__text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em;
  background: linear-gradient(transparent, var(--slate));
}
.brief__more { background: none; border: 0; color: var(--phosphor); font: 700 .9rem var(--type); padding: .6rem 0 .2rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Narrative check */
.ncheck { background: var(--carbon); color: var(--form); padding: .2rem 1.1rem 1rem; margin: 1.6rem 0; border-top: 5px solid var(--party); }
.ncheck h3 { color: var(--form); }
.ncheck h4 { font: 700 .85rem var(--type); color: var(--phosphor); margin: 1rem 0 .3rem; letter-spacing: .02em; }
.ncheck p { margin: 0; }
.ncheck ul { margin: 0; padding-left: 1.2rem; }
.ncheck li { margin: .3rem 0; }
.ncheck .omit li::marker { content: "▮  "; color: var(--party); }
.ncheck .ask li::marker { content: "?  "; color: var(--phosphor); font-family: var(--type); font-weight: 700; }
.ncheck .flags li::marker { content: "⚑  "; color: #d9a441; }
