/* ============================================================
   Paradise Briefing
   1. Tokens   2. Base   3. Chrome   4. Briefing   5. Panels
   6. Footer   7. States 8. Ceefax theme
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  --ink: #10241c;
  --ink-soft: #55665d;
  --ink-faint: #8b978f;
  --paper: #faf8f4;
  --paper-raised: #ffffff;
  --hair: #e4e1d8;
  --hair-strong: #cfcabb;
  --green: #0b2b21;
  --green-soft: #1c4536;
  --accent: #b08a3e;
  --accent-soft: #d9c295;
  --accent-wash: #f5efe1;
  --link: #1c4536;
  --urgent: #9c3a2a;
  --win: #2f7d55;
  --draw: #9a9384;
  --loss: #b4574a;
  --btn-ink: #1c4536;
  --btn-on-ink: #faf8f4;
  color-scheme: light dark;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --scale: 1;
  --measure: 620px;
}

:root[data-textsize="large"]  { --scale: 1.12; }
:root[data-textsize="xlarge"] { --scale: 1.26; }

/* Dark palette, tuned rather than inverted: a warmer ground, brighter gold so
   it doesn't go muddy, and hairlines lifted enough to still read as rules.
   Applied two ways — by system preference unless the reader has explicitly
   chosen light, and by explicit choice regardless of the system. The two blocks
   must be kept identical; a media-conditional selector can't be merged with a
   plain one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-colour="light"]) {
    --ink: #eeeae1;
    --ink-soft: #aab5ac;
    --ink-faint: #75837a;
    --paper: #0c110e;
    --paper-raised: #121a15;
    --hair: #232e28;
    --hair-strong: #33413a;
    --green: #123024;
    --green-soft: #2b5643;
    --accent: #e0bd7a;
    --accent-soft: #8a7444;
    --accent-wash: #1a1710;
    --link: #a9d4bb;
    --urgent: #e0866f;
    --win: #5cc48b;
    --draw: #8b8878;
    --loss: #d9796a;
    --btn-ink: #e0bd7a;
    --btn-on-ink: #eeeae1;
  }
}

:root[data-colour="dark"] {
  --ink: #eeeae1;
  --ink-soft: #aab5ac;
  --ink-faint: #75837a;
  --paper: #0c110e;
  --paper-raised: #121a15;
  --hair: #232e28;
  --hair-strong: #33413a;
  --green: #123024;
  --green-soft: #2b5643;
  --accent: #e0bd7a;
  --accent-soft: #8a7444;
  --accent-wash: #1a1710;
  --link: #a9d4bb;
  --urgent: #e0866f;
  --win: #5cc48b;
  --draw: #8b8878;
  --loss: #d9796a;
  --btn-ink: #e0bd7a;
  --btn-on-ink: #eeeae1;
}

/* ---------- 2. Base ---------- */

* { box-sizing: border-box; }

/* Author `display` rules beat the UA stylesheet's [hidden] rule, so state it
   explicitly — otherwise anything flex/grid ignores its hidden attribute. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. Chrome ---------- */

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: block; flex: none; }

.brand-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

.tagline {
  margin: 2px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 11px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-display);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn .aa-small { font-size: 0.72rem; font-weight: 600; }
.icon-btn .aa-large { font-size: 1rem; font-weight: 600; }
.icon-btn:hover { border-color: var(--hair-strong); }
.icon-btn:active { background: var(--hair); }

.notify-btn {
  flex: none;
  background: transparent;
  color: var(--btn-ink);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}


.notify-btn:hover { border-color: var(--hair-strong); }
.notify-btn:active { background: var(--hair); }

.notify-btn[data-state="on"] {
  background: var(--green);
  color: var(--btn-on-ink);
  border-color: var(--green);
}


/* Display settings popover */

.display-panel {
  position: absolute;
  right: max(20px, calc(50% - var(--measure) / 2 + 20px));
  top: calc(100% - 6px);
  z-index: 14;
  min-width: 268px;
  background: var(--paper-raised);
  border: 1px solid var(--hair-strong);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  animation: rise 0.16s ease both;
}

.display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
}

.display-row:last-child { border-bottom: none; }

.display-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--hair);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}

.segmented button {
  background: transparent;
  border: 0;
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.4;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented button + button { border-left: 1px solid var(--hair); }
.segmented button:hover { color: var(--ink); }

.segmented button.is-active {
  background: var(--green);
  color: var(--btn-on-ink);
}

.segmented--sizes button { font-family: var(--font-display); padding: 4px 13px; }
.segmented--sizes .size-sm { font-size: 0.68rem; }
.segmented--sizes .size-md { font-size: 0.84rem; }
.segmented--sizes .size-lg { font-size: 1rem; }

.switch {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
}

.switch-track {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: var(--paper);
  position: relative;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.switch.is-on .switch-track { background: var(--green); border-color: var(--green); }
.switch.is-on .switch-thumb { transform: translateX(18px); background: var(--btn-on-ink); }

/* ---------- 4. Briefing ---------- */

.content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 8px 20px;
}

.error { text-align: center; color: var(--ink-soft); padding: 60px 10px; font-size: calc(0.9rem * var(--scale)); }

.top-story {
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--hair);
  animation: rise 0.4s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.top-story-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.top-story-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 480;
  font-size: calc(1.5rem * var(--scale));
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.top-story-actions { display: flex; gap: 8px; margin-top: 18px; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 6px 15px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover { border-color: var(--hair-strong); }
.ghost-btn:active { background: var(--hair); }

.date-line {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.76rem;
  margin: 16px 0 24px;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--hair);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 28px;
  background: var(--paper-raised);
}

.countdown--urgent { border-left-color: var(--urgent); }
.countdown-label { font-size: calc(0.8rem * var(--scale)); font-weight: 600; }

.countdown-value {
  font-size: calc(0.78rem * var(--scale));
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.countdown--urgent .countdown-value { color: var(--urgent); }

/* Sections */

.section { margin-bottom: 34px; }

.section-title, .panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
}

.section-title::before, .panel-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}

.section-note {
  margin: -8px 0 14px;
  font-size: calc(0.75rem * var(--scale));
  color: var(--ink-soft);
  font-style: italic;
}

.item-list { list-style: none; margin: 0; padding: 0; }

.item { padding: 16px 0; border-bottom: 1px solid var(--hair); }
.item:last-child { border-bottom: none; }

.item-heading {
  margin: 0 0 5px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: calc(1.02rem * var(--scale));
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.item-text {
  margin: 0;
  font-size: calc(0.945rem * var(--scale));
  line-height: 1.55;
  color: var(--ink-soft);
}

/* A lead story is given room and a display face; a brief is compressed;
   a quiet item is a note, not a story. */
.item--lead { padding: 22px 0; }

.item--lead .item-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(1.32rem * var(--scale));
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 7px;
}

.item--lead .item-text { font-size: calc(1rem * var(--scale)); color: var(--ink); }

.item--brief { padding: 11px 0; }
.item--brief .item-heading { font-size: calc(0.92rem * var(--scale)); margin-bottom: 3px; }
.item--brief .item-text { font-size: calc(0.875rem * var(--scale)); }

.item--quiet { padding: 10px 0; }

.item--quiet .item-text {
  font-size: calc(0.83rem * var(--scale));
  color: var(--ink-faint);
  font-style: italic;
}

.item--quiet .item-foot { display: none; }

.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.item-source { margin: 0; font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.06em; }

.item-source a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.item-source a:hover, .item-source a:active { color: var(--link); border-color: var(--link); }

.react-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 5px 11px 5px 9px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  flex: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.react-btn svg { width: 11px; height: 11px; fill: currentColor; display: block; }
.react-btn:hover { border-color: var(--hair-strong); }
.react-btn:active { background: var(--hair); }
.react-btn.is-reacted { color: var(--accent); border-color: var(--accent-soft); }

/* ---------- 5. Panels ---------- */

/* Same rules-and-whitespace language as the briefing, no boxes. */
.extras { padding-bottom: 8px; }
.panel { margin-bottom: 30px; }
.panel-foot { margin: 12px 0 0; font-size: 0.68rem; color: var(--ink-faint); }

.fixture-list, .injury-list, .archive-list { list-style: none; margin: 0; padding: 0; }

.fixture { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.fixture:last-child { border-bottom: none; }
.fixture:first-child { padding-top: 0; }

.fixture-main { display: flex; align-items: baseline; gap: 8px; }
.fixture-opponent { font-size: calc(0.92rem * var(--scale)); font-weight: 700; }

.fixture-venue, .injury-status {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 1px 5px;
}

.fixture-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
  font-size: calc(0.75rem * var(--scale));
  color: var(--ink-soft);
}

.injury { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.injury:last-child { border-bottom: none; }
.injury:first-child { padding-top: 0; }
.injury-head { display: flex; align-items: baseline; gap: 8px; }
.injury-player { font-size: calc(0.92rem * var(--scale)); font-weight: 700; }
.injury-status.status--out { color: var(--urgent); border-color: var(--urgent); }
.injury-status.status--doubt { color: var(--accent); border-color: var(--accent-soft); }

.injury-detail {
  margin: 3px 0 0;
  font-size: calc(0.78rem * var(--scale));
  color: var(--ink-soft);
  line-height: 1.5;
}

/* League table */

.table-wrap { overflow-x: auto; }

.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(0.82rem * var(--scale));
}

.league-table th {
  text-align: right;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}

.league-table th.col-pos, .league-table th.col-team, .league-table th.col-form { text-align: left; }
.league-table th + th, .league-table td + td { padding-left: 12px; }

.league-table td {
  padding: 7px 0;
  text-align: right;
  border-bottom: 1px solid var(--hair);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.league-table td:first-child {
  text-align: left;
  width: 28px;
  position: relative;
  padding-left: 8px;
}
.league-table td.col-team { text-align: left; width: 100%; padding-left: 8px; color: var(--ink); }
.league-table td.col-form { text-align: left; padding-left: 10px; }
.league-table td.col-pts { font-weight: 700; color: var(--ink); }
.league-table tr:last-child td { border-bottom: none; }
.league-table tr.is-celtic td { color: var(--ink); font-weight: 700; }

/* Zone markers sit in the position column as a thin coloured rule. */
.league-table tr.zone-europe td:first-child::before,
.league-table tr.zone-playoff td:first-child::before,
.league-table tr.zone-drop td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 2px;
  border-radius: 1px;
}

.league-table tr.zone-europe td:first-child::before { background: var(--win); }
.league-table tr.zone-playoff td:first-child::before { background: var(--draw); }
.league-table tr.zone-drop td:first-child::before { background: var(--loss); }

.pip {
  display: inline-block;
  width: 13px;
  height: 13px;
  line-height: 13px;
  margin-right: 2px;
  border-radius: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  text-align: center;
  color: var(--paper);
  vertical-align: middle;
}

.pip--w { background: var(--win); }
.pip--d { background: var(--draw); }
.pip--l { background: var(--loss); }

/* Archive */

.archive-list { display: flex; flex-wrap: wrap; gap: 8px; }

.archive-link {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.archive-link:hover { border-color: var(--hair-strong); }
.archive-link:active { background: var(--hair); }

/* ---------- 6. Footer ---------- */

.footer {
  max-width: var(--measure);
  margin: 8px auto 40px;
  padding: 22px 20px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.7rem;
  line-height: 1.7;
  border-top: 1px solid var(--hair);
}

.stats-line { font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.footer p { margin: 0 0 4px; }
.footer-actions { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover { color: var(--ink-soft); }
.footer a { color: var(--ink-faint); text-underline-offset: 2px; }
.dot { opacity: 0.5; }

/* ---------- 7. States ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  z-index: 20;
  max-width: calc(100vw - 40px);
  text-align: center;
  animation: rise 0.2s ease both;
}

.skeleton { padding: 30px 0; }

.sk {
  background: var(--hair);
  border-radius: 3px;
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-eyebrow  { width: 34%; height: 9px;  margin-bottom: 18px; }
.sk-headline { width: 100%; height: 24px; margin-bottom: 10px; }
.sk-headline--short { width: 62%; margin-bottom: 26px; }
.sk-rule     { width: 100%; height: 1px; margin-bottom: 26px; animation: none; }
.sk-line     { width: 100%; height: 12px; margin-bottom: 10px; }
.sk-line--short { width: 45%; }

@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- 8. Ceefax theme ---------- */

:root[data-theme="ceefax"] {
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --ink-faint: #00ff00;
  --paper: #000000;
  --paper-raised: #000000;
  --hair: #0000cc;
  --hair-strong: #0000ff;
  --green: #0000aa;
  --green-soft: #00ffff;
  --accent: #ffff00;
  --accent-soft: #00ffff;
  --accent-wash: #000000;
  --link: #00ffff;
  --urgent: #ff0000;
  --win: #00ff00;
  --draw: #ffff00;
  --loss: #ff0000;
  --btn-ink: #00ffff;
  --btn-on-ink: #000000;
  --font-display: var(--font-mono);
  --font-body: var(--font-mono);
  --measure: 46rem;
  background: #000;
}

:root[data-theme="ceefax"] body {
  background: #000;
  letter-spacing: 0.02em;
}

/* Teletext header row */

.teletext-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 10px 16px 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 3.1vw, 0.95rem);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.tt-page { color: #fff; }
.tt-service { color: #000; background: #00ff00; padding: 1px 8px; }
.tt-clock { color: #00ffff; }

/* Everything square, blocky and high-contrast */

:root[data-theme="ceefax"] .topbar {
  background: #000;
  border-bottom: 0;
  position: static;
}

:root[data-theme="ceefax"] .brand-mark { display: none; }

:root[data-theme="ceefax"] .brand-text h1 {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  color: #ffff00;
  font-size: clamp(1.1rem, 5.6vw, 1.9rem);
  letter-spacing: 0.04em;
}

:root[data-theme="ceefax"] .tagline { color: #00ffff; text-transform: uppercase; }

:root[data-theme="ceefax"] .icon-btn,
:root[data-theme="ceefax"] .notify-btn,
:root[data-theme="ceefax"] .ghost-btn,
:root[data-theme="ceefax"] .archive-link,
:root[data-theme="ceefax"] .react-btn {
  border-radius: 0;
  border-color: #00ffff;
  color: #00ffff;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

:root[data-theme="ceefax"] .notify-btn[data-state="on"] {
  background: #00ff00;
  color: #000;
  border-color: #00ff00;
}

:root[data-theme="ceefax"] .react-btn.is-reacted { color: #ffff00; border-color: #ffff00; }

:root[data-theme="ceefax"] .top-story { border-bottom: 0; padding-bottom: 8px; }
:root[data-theme="ceefax"] .top-story-label { color: #00ffff; }

:root[data-theme="ceefax"] .top-story-text {
  color: #ffff00;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: calc(1.15rem * var(--scale));
  line-height: 1.45;
  letter-spacing: 0;
}

:root[data-theme="ceefax"] .date-line { color: #00ffff; text-transform: uppercase; }

/* Section headings become full-width teletext bars */

:root[data-theme="ceefax"] .section-title,
:root[data-theme="ceefax"] .panel-title {
  background: #0000aa;
  color: #ffff00;
  border-bottom: 0;
  padding: 5px 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

:root[data-theme="ceefax"] .section-title::before,
:root[data-theme="ceefax"] .panel-title::before { display: none; }

:root[data-theme="ceefax"] .item { border-bottom: 0; padding: 8px 0; }
:root[data-theme="ceefax"] .item-heading { color: #00ffff; font-family: var(--font-mono); letter-spacing: 0; }
:root[data-theme="ceefax"] .item--lead .item-heading { font-size: calc(1.05rem * var(--scale)); }
:root[data-theme="ceefax"] .item-text { color: #fff; }
:root[data-theme="ceefax"] .item--quiet .item-text { color: #00ff00; font-style: normal; }
:root[data-theme="ceefax"] .item-source a { color: #00ff00; border-bottom: 0; }
:root[data-theme="ceefax"] .section-note { color: #00ff00; font-style: normal; }

:root[data-theme="ceefax"] .countdown {
  border: 0;
  border-radius: 0;
  background: #aa0000;
  color: #fff;
  padding: 6px 10px;
}

:root[data-theme="ceefax"] .countdown-label { color: #fff; }
:root[data-theme="ceefax"] .countdown-value { color: #ffff00; }

:root[data-theme="ceefax"] .fixture-venue,
:root[data-theme="ceefax"] .injury-status {
  border-radius: 0;
  border-color: #00ffff;
  color: #00ffff;
}

:root[data-theme="ceefax"] .fixture,
:root[data-theme="ceefax"] .injury { border-bottom: 0; padding: 5px 0; }

:root[data-theme="ceefax"] .fixture-opponent,
:root[data-theme="ceefax"] .injury-player { color: #ffff00; }

:root[data-theme="ceefax"] .fixture-meta,
:root[data-theme="ceefax"] .injury-detail { color: #fff; }

:root[data-theme="ceefax"] .league-table td,
:root[data-theme="ceefax"] .league-table th {
  border-bottom: 0;
  color: #fff;
  font-family: var(--font-mono);
}

:root[data-theme="ceefax"] .league-table th { color: #00ffff; }
:root[data-theme="ceefax"] .league-table tr.is-celtic td { color: #ffff00; }
:root[data-theme="ceefax"] .league-table td.col-pts { color: #00ff00; }

:root[data-theme="ceefax"] .pip { border-radius: 0; color: #000; }

:root[data-theme="ceefax"] .footer,
:root[data-theme="ceefax"] .panel-foot,
:root[data-theme="ceefax"] .stats-line { border-top-color: #0000cc; color: #00ff00; }

:root[data-theme="ceefax"] .link-btn,
:root[data-theme="ceefax"] .footer a { color: #00ffff; }

:root[data-theme="ceefax"] .toast {
  border-radius: 0;
  background: #ffff00;
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Fastext shortcut bar */

/* Pinned to the bottom of the viewport, the way the real thing was. */
.fastext {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 12;
}

:root[data-theme="ceefax"] body { padding-bottom: 54px; }

.ft {
  border: 0;
  padding: 10px 4px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #000;
  cursor: pointer;
}

.ft-red { background: #ff0000; color: #fff; }
.ft-green { background: #00ff00; }
.ft-yellow { background: #ffff00; }
.ft-cyan { background: #00ffff; }

/* Shown when the newest edition is more than about a day and a half old — a
   failed run should say so rather than quietly passing yesterday off as today. */
.stale-note {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 10px 20px;
  font-size: calc(0.78rem * var(--scale));
  color: var(--ink-soft, #6b6b6b);
  border-left: 3px solid var(--accent);
  background: rgba(0,0,0,0.03);
}
:root[data-theme="ceefax"] .stale-note {
  border-left: 0; background: #0000cc; color: #fff; border-radius: 0;
}
