/* Control room, newsroom console and login. Light theme, deliberately unlike the on-air palette. */
:root {
  color-scheme: light;
  --bg: #edf0f5;
  --surface: #ffffff;
  --inset: #f2f4f9;
  --line: #d5dae3;
  --text: #0e1a33;
  --muted: #5a657c;
  --accent: #2148f0;
  --on-accent: #ffffff;
  --live: #e5243b;
  --danger: #c81e33;
  --ok: #1b8a4a;
  --warn: #d98200;
  --brand-crypto: #c26a00;
  --brand-air: #d61f35;
  --series-1: #2148f0;
  --series-2: #e08a00;
  --series-3: #7d879b;
  --series-4: #c3c9d5;
}

/* Dark theme: chosen in the account menu, or following the OS until a choice is made. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1120;
    --surface: #141c2f;
    --inset: #0f1626;
    --line: #2a3650;
    --text: #e6ebf5;
    --muted: #9aa6bd;
    --accent: #8ba2ff;
    --on-accent: #0b1120;
    --live: #ff5a6a;
    --danger: #ff7380;
    --ok: #45d08a;
    --warn: #f2ad4a;
    --brand-crypto: #f7931a;
    --brand-air: #e5243b;
    --series-1: #7d96ff;
    --series-2: #f2a33a;
    --series-3: #8e99b0;
    --series-4: #3a4662;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #141c2f;
  --inset: #0f1626;
  --line: #2a3650;
  --text: #e6ebf5;
  --muted: #9aa6bd;
  --accent: #8ba2ff;
  --on-accent: #0b1120;
  --live: #ff5a6a;
  --danger: #ff7380;
  --ok: #45d08a;
  --warn: #f2ad4a;
  --brand-crypto: #f7931a;
  --brand-air: #e5243b;
  --series-1: #7d96ff;
  --series-2: #f2a33a;
  --series-3: #8e99b0;
  --series-4: #3a4662;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo Variable", "Liberation Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

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

/* Buttons and fields */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

button:hover:not(:disabled),
.button:hover {
  filter: brightness(1.08);
}

button.quiet,
.button.quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

button[aria-pressed="false"] {
  border-color: var(--accent);
  color: var(--accent);
}

button.danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
}

button.danger.solid {
  background: var(--danger);
  color: var(--on-accent);
}

button.link {
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

a:hover,
button.link:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

label,
legend {
  color: var(--muted);
  font-weight: 550;
}

textarea,
input:not([type="radio"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--inset);
  color: var(--text);
  font: inherit;
}

textarea {
  display: block;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  font-size: 16px;
  font-weight: 450;
  line-height: 1.35;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:not([type="radio"]) {
  height: 38px;
  padding: 0 12px;
  font-weight: 550;
}

/* Icons */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
.button {
  gap: 8px;
}

button.wide {
  width: 100%;
}

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

/* Top bar */

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 28px);
}

.bar .wordmark {
  margin-right: auto;
  font-size: 20px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav-link {
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.top-nav-link:hover {
  color: var(--text);
}

.top-nav-link[aria-current="page"] {
  background: var(--inset);
  color: var(--text);
}

/* Wordmark: Crypto in Bitcoin orange, AIR lit up like an on-air sign. */
.wordmark {
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-crypto {
  color: var(--brand-crypto);
}

.brand-air {
  display: inline-block;
  margin-left: 0.08em;
  border-radius: 0.18em;
  padding: 0 0.22em;
  background: var(--brand-air);
  color: #fff;
}

/* Account button and dropdown */

.account {
  position: relative;
}

.account-button {
  width: 36px;
  height: 36px;
  min-height: 0;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: none;
  overflow: hidden;
}

.account-button:hover:not(:disabled) {
  filter: none;
}

.account-button:hover .avatar,
.account-button[aria-expanded="true"] .avatar {
  background: color-mix(in srgb, var(--accent) 26%, var(--surface));
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 240px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(8 12 24 / 18%);
}

.menu-signed-in {
  margin-bottom: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.menu-signed-in strong {
  color: var(--text);
  font-weight: 600;
}

.menu-item {
  justify-content: flex-start;
  width: calc(100% + 28px);
  margin: 0 -14px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 0 14px;
  min-height: 44px;
  background: none;
  color: var(--text);
}

.menu-item:last-child {
  margin-bottom: -14px;
  border-radius: 0 0 10px 10px;
}

.menu-item:hover:not(:disabled) {
  filter: none;
  background: var(--inset);
}

/* The theme row offers the other theme: a moon while light, a sun while dark. */
#themeToggle .icon-sun,
#themeToggle.is-dark .icon-moon {
  display: none;
}

#themeToggle.is-dark .icon-sun {
  display: block;
}

/* Console: program and graphics on the left, live stats on the right. */

.console {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 4px clamp(16px, 3vw, 28px) 40px;
}

.main-column,
.side-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.side-column {
  gap: 16px;
}

.monitor-pane {
  margin: 0;
}

.monitor-pane figcaption,
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  margin-bottom: 8px;
}

.caption-note {
  color: var(--muted);
  font-size: 13px;
}


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

.segment {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.segment:last-child {
  border-right: 0;
}

.segment.is-selected {
  background: var(--inset);
  color: var(--text);
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.switch-control input {
  width: auto;
  height: auto;
}








/* Scene lab controls: labelled rows of scene, time of day and moments. */
.scene-lab.card {
  padding: 18px 20px 20px;
}

.scene-lab .segment.is-selected {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
  font-weight: 650;
}

.scene-lab-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.scene-lab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.scene-lab-label {
  width: 72px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scene-lab-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.scene-lab-moments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scene-lab-moments button {
  min-height: 32px;
  padding: 0 12px;
}

.scene-lab-moments button[hidden] {
  display: none;
}

/* Here aria-pressed marks a selected segment or a toggle that is on, not an off state. */
.scene-lab button[aria-pressed="false"] {
  border-color: var(--line);
  color: var(--muted);
}

.scene-lab .scene-lab-moments button[aria-pressed="false"] {
  color: var(--text);
}

.scene-lab .scene-lab-moments button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text);
}

@media (max-width: 640px) {
  .scene-lab-label {
    width: 100%;
  }

  .scene-lab-tools {
    margin-left: 0;
  }
}

.scene-lab-viewer {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.scene-lab-viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.scene-lab-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 28px) 40px;
}

.scene-lab-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.scene-lab-page-head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
}

.scene-lab-page-head .note {
  margin: 6px 0 0;
}

@media (max-width: 640px) {
  .scene-lab-page-head {
    align-items: start;
    flex-direction: column;
  }
}

.monitor {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.monitor.on-air {
  border: 3px solid var(--live);
}

.monitor video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

.monitor iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Player header: title, status pill, then the buttons pushed right. */
.monitor-pane figcaption {
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.monitor-pane figcaption .link-bar {
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 0 auto;
}

.monitor-pane .status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.preview-control-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.monitor-empty {
  display: grid;
  place-items: center;
  background: var(--surface);
}

.monitor-empty iframe {
  display: none;
}

.monitor p {
  max-width: 40ch;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.link-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.link-url {
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  line-height: 36px;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.icon-button {
  flex: 0 0 auto;
  width: 38px;
  padding: 0;
}

.icon-button .icon-done,
.icon-button.copied .icon-copy {
  display: none;
}

.icon-button.copied .icon-done {
  display: block;
}

.icon-button.copied {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button.is-refreshing .icon {
  animation: refresh-spin 700ms linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-button.is-refreshing .icon {
    animation: none;
  }
}

/* Sound toggle on the Program monitor: pressed means muted. */
#tryPreviewMute[aria-pressed="false"] {
  border-color: var(--accent);
  color: var(--accent);
}

#tryPreviewMute .icon-sound,
#tryPreviewMute[aria-pressed="false"] .icon-muted {
  display: none;
}

#tryPreviewMute[aria-pressed="false"] .icon-sound {
  display: block;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.console .card {
  padding: 18px 20px 20px;
}

h2,
h3 {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 15px;
}

.eyebrow {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.status-dot.active {
  background: var(--live);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 22%, transparent);
}

.note {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--muted);
}

.note:empty,
.error:empty {
  display: none;
}

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

.error {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 550;
  white-space: pre-line;
}

/* On screen tabs */

.tabs {
  display: flex;
  gap: 4px;
  margin: 4px -20px 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  overflow-x: auto;
}

.tab {
  min-height: 42px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0 12px;
  background: none;
  color: var(--muted);
  font-weight: 600;
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.tab:hover:not(:disabled) {
  filter: none;
  color: var(--text);
}

.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}

/* Breaking news */

.live-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--live) 8%, var(--surface));
}

.live-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--live);
  font-size: 13px;
  font-weight: 600;
}

.live-label .status-dot {
  width: 8px;
  height: 8px;
}

.quote {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 450;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.counter {
  color: var(--muted);
  font-size: 13px;
}

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

.form-foot .choices {
  margin: 0;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  border: 0;
  padding: 0;
}

.choices legend {
  float: left;
  margin-right: 4px;
  padding: 0;
}

.choices label {
  position: relative;
  cursor: pointer;
}

.choices input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choices span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text);
}

.choices input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.choices input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* News segment */

.tab-panel > .note:first-child {
  margin-top: 0;
}

.panel-actions {
  margin-top: 18px;
}

.audition {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.audition summary {
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.audition .choices {
  margin-top: 10px;
}

/* Broadcast */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.stat-tiles > div {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--inset);
}

.stat-tiles dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.stat-tiles dd {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
}

.stat-tiles > div:first-child dd {
  color: var(--live);
}

#streamActions,
.confirm {
  margin-top: 14px;
}

.confirm {
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.confirm-text {
  margin-bottom: 10px;
  font-weight: 600;
}

/* Health */

.checks {
  margin: 8px 0 0;
}

.checks > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.checks dt {
  color: var(--muted);
}

.checks dd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-align: right;
}

.checks dd::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.checks .info dd::before {
  display: none;
}

.checks .pending dd::before {
  background: var(--line);
}

.checks .warn dd::before {
  background: var(--warn);
}

.checks .bad dd {
  color: var(--danger);
}

.checks .bad dd::before {
  background: var(--danger);
}

/* System: CPU and memory history by process */

.system-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgb(8 12 24 / 30%);
}

.system-dialog::backdrop {
  background: rgb(8 12 24 / 50%);
}

.system-card .card-head {
  flex-wrap: wrap;
  align-items: center;
}

.dialog-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Compact System card in the right column */

.card-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

/* Collapsible right-column cards: the title folds the card. */

/* The whole header row folds the card; only the action buttons beside it don't. */
.card-eyebrow-row > h2 {
  flex: 1 1 auto;
  min-width: 0;
}

.collapse-toggle {
  justify-content: flex-start;
  width: calc(100% + 12px);
  min-height: 32px;
  margin: 0 -6px;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  gap: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.collapse-toggle:hover:not(:disabled) {
  filter: none;
  background: var(--inset);
}

.collapse-toggle .icon {
  width: 16px;
  height: 16px;
  transition: transform 120ms ease-out;
}

.collapsible.collapsed .collapse-toggle .icon {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  .collapse-toggle .icon {
    transition: none;
  }
}

/* Header status pills: color only when it means something. */

.collapse-toggle .status-pill {
  margin-left: auto;
}

.status-pill {
  border-radius: 999px;
  letter-spacing: normal;
  text-transform: none;
  padding: 3px 10px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.live {
  background: var(--live);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.ok {
  background: color-mix(in srgb, var(--ok) 16%, var(--surface));
  color: color-mix(in srgb, var(--ok) 70%, var(--text));
}

.status-pill.warn {
  background: color-mix(in srgb, var(--warn) 20%, var(--surface));
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}

.status-pill.bad {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  color: var(--danger);
}

.icon-button.small {
  width: 32px;
  min-height: 32px;
}

.icon-button.small .icon {
  width: 16px;
  height: 16px;
}

.spark {
  margin-top: 14px;
}

.spark-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.spark-head strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
}

.spark svg {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 6px;
}

.spark .spark-line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.system-rows {
  margin-top: 12px;
}

.spark .chart-axis {
  margin-top: 2px;
}

.sample-badge {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.range-choice {
  display: flex;
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 0;
}

.range-choice label {
  position: relative;
  cursor: pointer;
}

.range-choice input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.range-choice span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text);
  font-size: 13px;
}

.range-choice input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-weight: 600;
}

.range-choice input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.system-summary {
  margin-top: 0;
}

.system-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  margin-top: 16px;
}

.system-chart {
  margin: 0;
}

.system-chart figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.system-chart strong {
  font-size: 18px;
  font-weight: 650;
}

.system-chart svg {
  display: block;
  width: 100%;
  height: 160px;
  border-bottom: 1px solid var(--line);
}

.system-chart .grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.system-chart .layer {
  stroke: var(--surface);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.process-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 13px;
}

.process-table th,
.process-table td {
  border-top: 1px solid var(--line);
  padding: 8px 4px;
  text-align: right;
  white-space: nowrap;
}

.process-table th:first-child {
  text-align: left;
}

.process-table thead th {
  border-top: 0;
  color: var(--muted);
  font-weight: 600;
}

.process-table tbody th {
  font-weight: 550;
}

.process-table .trend-up {
  color: color-mix(in srgb, var(--warn) 65%, var(--text));
  font-weight: 600;
}

.process-table .trend-steady {
  color: var(--muted);
}

/* YouTube setup */

.details {
  margin: 8px 0 0;
}

.details > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  min-width: 0;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.details dd small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.details .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 450;
}

.details dd.unset {
  color: var(--muted);
  font-weight: 450;
}

.health-issues {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 10px 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.health-issues li + li {
  margin-top: 4px;
}


/* Newsroom console (newsroom.kiok.org) */

.newsroom-workers {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.newsroom-worker {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.newsroom-worker:last-child {
  padding-bottom: 0;
}

.newsroom-worker > div {
  flex: 1 1 auto;
  min-width: 0;
}

.newsroom-worker strong {
  font-weight: 600;
}

.newsroom-worker .newsroom-meta {
  margin-top: 2px;
}

/* Same dot as the control room's player pill: running reads green, paused amber. */
.newsroom-worker .status-pill.ok::before,
.newsroom-worker .status-pill.warn::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.newsroom-worker button {
  flex: 0 0 auto;
}

/* A worker that can't be paused keeps its pill in line with the others. */
.newsroom-worker .status-pill:last-child {
  margin-right: 42px;
}

.newsroom-stories,
.newsroom-sources {
  margin: 0;
  padding: 0;
  list-style: none;
}

.newsroom-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.newsroom-toolbar .segment {
  font-size: 13px;
}

/* Here aria-pressed marks the selected filter, not an off toggle. */
.newsroom-toolbar .segment[aria-pressed="false"] {
  border-color: var(--line);
  color: var(--muted);
}

.newsroom-toolbar .segment.is-selected {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
  font-weight: 650;
}

/* Count badge: a small rounded number beside a filter or topic name. */
.newsroom-badge {
  display: inline-block;
  min-width: 22px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 1px 7px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
}

.segment.is-selected .newsroom-badge {
  background: var(--surface);
  color: var(--text);
}

.newsroom-badge:empty {
  display: none;
}

.newsroom-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.newsroom-per-page select,
.newsroom-pager select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
}

/* Stories table: rows run edge to edge inside the card. */
.newsroom-table {
  width: calc(100% + 40px);
  margin: 16px -20px 0;
  border-collapse: collapse;
}

.newsroom-table th {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.newsroom-table td {
  border-top: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
}

.newsroom-table th:first-child,
.newsroom-table td:first-child {
  padding-left: 20px;
}

.newsroom-table th:last-child,
.newsroom-table td:last-child {
  padding-right: 20px;
}

.newsroom-story:hover {
  background: var(--inset);
}

.newsroom-col-source {
  width: 1%;
}

/* Site icon over a lettered tile; the tile shows when the icon is missing. */
.newsroom-logo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.newsroom-logo img {
  position: absolute;
  inset: 4px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #fff;
}

.newsroom-col-story h3 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.newsroom-col-story h3 a {
  color: var(--text);
  font-weight: inherit;
}

.newsroom-col-story h3 a:hover {
  color: var(--accent);
}

.newsroom-col-story .status-pill {
  display: inline-block;
  margin: 6px 6px 0 0;
}

.newsroom-col-topic {
  width: 1%;
  white-space: nowrap;
}

.newsroom-col-when {
  width: 1%;
  color: var(--muted);
  white-space: nowrap;
}

.newsroom-col-action {
  width: 1%;
  text-align: right;
}

.newsroom-summary {
  display: -webkit-box;
  margin-top: 4px;
  max-width: 72ch;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.newsroom-story button {
  min-height: 32px;
  padding: 0 12px;
}

.newsroom-story.is-off td:not(.newsroom-col-action) {
  opacity: 0.55;
}

/* Sortable headers: the whole label is the button; the arrow marks the sorted column. */
.newsroom-sort {
  min-height: 0;
  gap: 4px;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.newsroom-sort:hover:not(:disabled) {
  filter: none;
  color: var(--text);
}

.newsroom-sort-arrow::after {
  content: "↕";
  opacity: 0.35;
}

th[aria-sort] .newsroom-sort {
  color: var(--text);
}

th[aria-sort="ascending"] .newsroom-sort-arrow::after {
  content: "↑";
  opacity: 1;
}

th[aria-sort="descending"] .newsroom-sort-arrow::after {
  content: "↓";
  opacity: 1;
}

/* Filters beside the status buttons. */
.newsroom-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.newsroom-filters input[type="search"] {
  width: 200px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
}

.newsroom-filters select {
  max-width: 180px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.newsroom-pager-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* Topic colours: eight hues, each mixed toward the theme's surface and text so they work light and dark. */
.topic-color-0 { --topic: #3b6ff5; }
.topic-color-1 { --topic: #0f9d8a; }
.topic-color-2 { --topic: #4a9a2f; }
.topic-color-3 { --topic: #c98a00; }
.topic-color-4 { --topic: #e0661b; }
.topic-color-5 { --topic: #d43f5e; }
.topic-color-6 { --topic: #8a55e0; }
.topic-color-7 { --topic: #c64fa8; }

.status-pill[class*="topic-color-"] {
  background: color-mix(in srgb, var(--topic) 18%, var(--surface));
  color: color-mix(in srgb, var(--topic) 72%, var(--text));
}

.newsroom-topic[class*="topic-color-"] {
  border-color: color-mix(in srgb, var(--topic) 45%, var(--line));
}

.newsroom-topic[class*="topic-color-"] input {
  accent-color: var(--topic);
}

.newsroom-topic[class*="topic-color-"] .newsroom-badge {
  background: color-mix(in srgb, var(--topic) 18%, var(--surface));
  color: color-mix(in srgb, var(--topic) 72%, var(--text));
}

.newsroom-topic.is-blocked {
  border-color: var(--line);
}

/* Narrow screens: each story becomes a stacked block, header row hidden. */
@media (max-width: 760px) {
  .newsroom-table thead {
    display: none;
  }

  .newsroom-table,
  .newsroom-table tbody,
  .newsroom-table tr,
  .newsroom-table td {
    display: block;
  }

  .newsroom-table tr {
    position: relative;
    border-top: 1px solid var(--line);
    padding: 12px 20px;
  }

  .newsroom-table td {
    border: 0;
    padding: 0 !important;
    width: auto;
  }

  .newsroom-col-source {
    display: inline-block !important;
    margin-right: 10px;
    vertical-align: top;
  }

  .newsroom-col-story {
    display: inline-block !important;
    width: calc(100% - 120px) !important;
  }

  .newsroom-col-topic,
  .newsroom-col-when {
    display: inline-block !important;
    margin: 8px 10px 0 0;
  }

  .newsroom-col-action {
    position: absolute;
    top: 10px;
    right: 20px;
  }
}

.newsroom-sources .is-off {
  opacity: 0.5;
}

.newsroom-sources strong {
  font-weight: 600;
}

.newsroom-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.newsroom-empty {
  border-top: 1px solid var(--line);
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
}

.newsroom-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -20px -20px;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}

.newsroom-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.newsroom-page {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border-color: transparent;
  background: none;
  font-weight: 600;
}

.newsroom-page[aria-current="page"] {
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.newsroom-gap {
  padding: 0 4px;
  color: var(--muted);
}

/* Topics: checked is on air, unchecked is blocked. */
.newsroom-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.newsroom-topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.newsroom-topic:hover {
  background: var(--inset);
}

.newsroom-topic input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.newsroom-topic .newsroom-badge {
  margin-left: 0;
}

.newsroom-topic.is-blocked {
  border-style: dashed;
  color: var(--muted);
}

.newsroom-topic.is-blocked > span:first-of-type {
  text-decoration: line-through;
}

.newsroom-topic:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.newsroom-flip {
  transform: scaleX(-1);
}



.newsroom-segments {
  display: grid;
  gap: 16px;
}

.newsroom-segment .card-head {
  align-items: flex-start;
  margin-bottom: 0;
}

.newsroom-sources li {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.newsroom-segment .actions {
  margin-top: 14px;
}

.newsroom-lines {
  margin-top: 14px;
}

.newsroom-line {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.newsroom-line p {
  margin-top: 4px;
}

.newsroom-line audio {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 8px;
}

/* Login */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  min-height: 100vh;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px);
}

.login-intro h1 {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: 0;
}

.login-intro h1 .wordmark {
  display: block;
}

.login-intro h1 .login-sub {
  display: block;
  color: var(--accent);
  font-weight: 400;
}

.login-intro p {
  margin-top: 18px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 16px;
}

.login-card {
  padding: 24px;
}

.login-card h2 {
  margin-bottom: 8px;
}

.login-card label {
  display: block;
  margin: 18px 0 8px;
}

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 24px;
}

.error {
  min-height: 24px;
  margin-top: 12px;
  color: var(--danger);
  font-weight: 550;
  white-space: pre-line;
}

@media (max-width: 900px) {
  .console,
  .login {
    grid-template-columns: minmax(0, 1fr);
  }

  .login {
    align-content: center;
  }
}
