:root {
  color-scheme: dark;
  --canvas: #0e0e0e;
  --surface: #171717;
  --surface-raised: #1f1f1f;
  --surface-hover: #292929;
  --border: #2e2e2e;
  --border-subtle: #242424;
  --monitor: #070809;
  --text: #f2f2f2;
  --text-muted: #bfbfbf;
  --text-dim: #8c8c8c;
  --cyan: #63d1ff;
  --red: #c70800;
  --live-text: #ff4a43;
  --critical: #ff6b61;
  --green: #1fb340;
  --yellow: #fad138;
  --violet: #bf59f2;
  --focus: #8bddff;
  --header-height: 64px;
  --rail-width: clamp(350px, 29vw, 420px);
  --radius-panel: 7px;
  --radius-control: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.ingest-status { padding: 20px; }
.ingest-observation + .ingest-observation { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.ingest-observation p { color: var(--text-muted); overflow-wrap: anywhere; max-width: 80ch; margin: 8px 0 0; }
.ingest-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; align-items: baseline; }
.ingest-heading strong { font-size: 16px; }
.ingest-heading > span { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.receive-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; margin: 24px 0 20px; }
.receive-metrics dt { font-size: 13px; color: var(--text-muted); }
.receive-metrics dd { margin: 8px 0 0; font-size: clamp(22px, 2.2vw, 32px); font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.receive-metrics .metric-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.receive-metrics small { display: block; margin-top: 8px; color: var(--text-muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.receive-metrics dd[data-tone="healthy"], .ingest-heading strong[data-tone="healthy"] { color: var(--green); }
.receive-metrics dd[data-tone="warning"], .ingest-heading strong[data-tone="warning"] { color: var(--yellow); }
.receive-metrics dd[data-tone="info"] { color: var(--cyan); }
.sender-links { margin: 0 0 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.sender-links-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 18px; }
.sender-links-heading h3 { margin: 0; font-size: 13px; font-weight: 650; }
.sender-links-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.sender-links-heading time { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sender-links-summary { margin: 14px 0 8px !important; color: var(--text); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sender-link-list { margin: 0; padding: 0; list-style: none; }
.sender-link-row { display: grid; min-height: 52px; grid-template-columns: minmax(0, 1fr) auto minmax(116px, auto); align-items: center; gap: 12px 20px; border-top: 1px solid var(--border-subtle); }
.sender-link-identity { min-width: 0; }
.sender-link-identity strong, .sender-link-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-link-identity strong { font-size: 12px; font-weight: 650; }
.sender-link-identity small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.sender-link-state { color: var(--text-muted); font-size: 10px; font-weight: 750; letter-spacing: .025em; white-space: nowrap; }
.sender-link-state[data-tone="healthy"] { color: var(--green); }
.sender-link-state[data-tone="warning"] { color: var(--yellow); }
.sender-link-state[data-tone="critical"] { color: var(--critical); }
.sender-link-rate { display: block; color: var(--cyan); text-align: right; font-variant-numeric: tabular-nums; }
.sender-link-rate strong { display: block; font-size: 18px; line-height: 1.2; }
.sender-link-rate strong span { color: var(--text-muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.sender-link-rate small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.sender-links-note, .sender-links-empty { margin: 10px 0 0 !important; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.ingest-details { border-top: 1px solid var(--border); padding-top: 12px; color: var(--text-muted); font-size: 12px; }
.ingest-details summary { cursor: pointer; width: fit-content; padding: 4px 0; }
.ingest-details p { line-height: 1.6; }
.session-history > summary { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; color: var(--text-muted); list-style: none; }
.session-history > summary::-webkit-details-marker { display: none; }
.session-history > summary::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
.session-history[open] > summary::before { transform: rotate(45deg); }
.session-history h2 { display: inline; font-size: 13px; font-weight: 550; margin: 0; }
.session-history .count-label { margin-left: auto; }
.session-history .history-explanation { font-size: 12px; color: var(--text-muted); margin: 0; padding: 0 20px 18px; max-width: 85ch; line-height: 1.6; }
.session-history > summary:hover { background: var(--surface-hover); color: var(--text); }
@media (min-width: 921px) and (max-width: 1200px), (max-width: 640px) { .receive-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .sender-links-heading { align-items: flex-start; }
  .sender-link-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "identity rate" "state rate"; gap: 4px 12px; padding: 9px 0; }
  .sender-link-identity { grid-area: identity; }
  .sender-link-state { grid-area: state; }
  .sender-link-rate { grid-area: rate; align-self: center; }
  .broadcast-route { grid-template-columns: 1fr; }
  .broadcast-route-node { padding: 14px 0; }
  .broadcast-route-connector { min-height: 24px; }
  .broadcast-route-connector::before { top: 0; bottom: 4px; left: 12px; width: 1px; height: auto; }
  .broadcast-route-connector::after { top: auto; right: auto; bottom: 2px; left: 8px; transform: rotate(135deg); }
}

.programme-panel, .destination-editor { padding: 20px; }
.destination-editor summary { cursor: pointer; font-weight: 650; }
.destination-editor form { margin-top: 20px; }
.output-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.output-fields select, #destination-edit, #replacement-source, #replacement-kind { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-raised); color: var(--text); padding: 8px; font: inherit; }
#destination-form > .field-stack { margin-bottom: 18px; }
.broadcast-state { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); font-size: 9px; font-weight: 780; letter-spacing: .05em; white-space: nowrap; }
.broadcast-state[data-tone="live"] { border-color: rgba(199, 8, 0, .7); background: rgba(199, 8, 0, .16); color: #ff746e; }
.broadcast-state[data-tone="warning"] { border-color: rgba(250, 209, 56, .38); color: var(--yellow); }
.broadcast-route { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.broadcast-route-node { display: grid; min-width: 0; align-content: center; gap: 6px; padding: 18px 0; }
.broadcast-route-node > span, .broadcast-format > span { color: var(--text-dim); font-size: 9px; font-weight: 760; letter-spacing: .055em; }
.broadcast-route-node strong { overflow: hidden; font-size: 18px; font-weight: 680; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.broadcast-route-node strong[data-tone="healthy"] { color: var(--green); }
.broadcast-route-node strong[data-tone="warning"] { color: var(--yellow); }
.broadcast-route-node strong[data-tone="live"] { color: var(--live-text); }
.broadcast-route-node strong[data-tone="info"] { color: var(--cyan); }
.broadcast-route-node strong[data-tone="disabled"] { color: var(--text-muted); }
.broadcast-route-node small { overflow: hidden; color: var(--text-muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; }
.broadcast-route-connector { position: relative; min-width: 56px; }
.broadcast-route-connector::before { content: ""; position: absolute; top: 50%; right: 12px; left: 8px; height: 1px; background: var(--cyan); }
.broadcast-route-connector::after { content: ""; position: absolute; top: calc(50% - 4px); right: 9px; width: 8px; height: 8px; border-top: 1px solid var(--cyan); border-right: 1px solid var(--cyan); transform: rotate(45deg); }
.broadcast-format { display: grid; gap: 5px; padding: 14px 0 2px; }
.broadcast-format strong { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 630; }
.broadcast-lease { margin: 16px 0 0; padding: 10px 12px; border-left: 3px solid var(--cyan); background: rgba(99, 209, 255, .07); color: var(--text); font-size: 11px; font-weight: 680; line-height: 1.45; font-variant-numeric: tabular-nums; }
.broadcast-lease[data-tone="warning"] { border-left-color: var(--yellow); background: rgba(250, 209, 56, .09); color: var(--yellow); }
.broadcast-lease[data-tone="critical"] { border-left-color: var(--critical); background: rgba(255, 107, 97, .12); color: var(--critical); }
.broadcast-readiness { margin: 16px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.broadcast-readiness[data-tone="healthy"] { color: var(--green); }
.broadcast-readiness[data-tone="warning"] { color: var(--yellow); }
.broadcast-live-button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; padding: 0 18px; border-radius: var(--radius-control); background: var(--red); color: #fff; font-size: 13px; font-weight: 780; letter-spacing: .035em; transition: background 120ms ease, transform 80ms ease, opacity 120ms ease; }
.broadcast-live-button:hover:not(:disabled) { background: #e00a02; }
.broadcast-live-button:active:not(:disabled) { transform: translateY(1px); }
.broadcast-live-button:disabled { opacity: .32; }
.broadcast-live-dot { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.programme-status { margin: 20px 0 12px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 11px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.diagnostic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.diagnostic-actions > a.quiet-button { display: inline-flex; align-items: center; text-decoration: none; }
.diagnostic-actions > a.quiet-button[hidden] { display: none; }
.programme-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.broadcast-truth { max-width: 60ch; margin: 18px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.form-hint { color: var(--text-muted); font-size: 12px; line-height: 1.6; max-width: 85ch; margin: 14px 0; }
@media (max-width: 650px) { .output-fields { grid-template-columns: 1fr; } }

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
a {
  cursor: pointer;
}

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

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

::selection {
  background: color-mix(in srgb, var(--cyan) 34%, transparent);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--canvas);
}

::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid var(--canvas);
  border-radius: 8px;
  background: #3a3a3a;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

[hidden] {
  display: none !important;
}

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

.app-frame {
  min-height: 100dvh;
  background: var(--canvas);
}

.boot-view {
  display: grid;
  min-height: 100dvh;
  place-content: center;
  justify-items: center;
  gap: 24px;
}

.boot-view p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.boot-lockup,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.boot-lockup img,
.brand-lockup img {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  height: auto;
  max-width: 100%;
}

.boot-lockup > div,
.brand-lockup > div {
  display: grid;
  line-height: 1;
}

.boot-lockup strong,
.brand-lockup strong {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.boot-lockup span,
.brand-lockup span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.boot-lockup b,
.brand-lockup b {
  font-size: 12px;
  font-style: italic;
  font-weight: 900;
}

.boot-lockup i,
.brand-lockup i {
  padding: 3px 5px 2px;
  border-radius: 2px;
  background: var(--cyan);
  color: var(--canvas);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.boot-line {
  width: 184px;
  height: 2px;
  overflow: hidden;
  background: var(--border-subtle);
}

.boot-line span {
  display: block;
  width: 46%;
  height: 100%;
  background: var(--cyan);
  transform: translateX(-110%);
}

@media (prefers-reduced-motion: no-preference) {
  .boot-line span {
    animation: boot-progress 1.25s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  }
}

@keyframes boot-progress {
  0% { transform: translateX(-110%); }
  65%, 100% { transform: translateX(320%); }
}

.login-view {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.35fr) minmax(410px, 0.65fr);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  padding: clamp(28px, 4vw, 64px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(99, 209, 255, 0.025), transparent 32%),
    var(--monitor);
}

.login-brand::after {
  position: absolute;
  right: -18%;
  bottom: -34%;
  width: min(70vw, 840px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 209, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 72px rgba(99, 209, 255, 0.018),
    0 0 0 144px rgba(99, 209, 255, 0.012);
  content: "";
  pointer-events: none;
}

.brand-lockup-large {
  gap: 12px;
}

.brand-lockup-large strong {
  font-size: 17px;
}

.brand-lockup-large b {
  font-size: 18px;
}

.brand-lockup-large i {
  padding: 4px 7px 3px;
  font-size: 11px;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-top: auto;
  margin-bottom: auto;
}

.section-label {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-copy h1 {
  max-width: 680px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(42px, 6.2vw, 86px);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.login-copy > p:last-child {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.5;
}

.login-truth {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 590px;
  grid-template-columns: 3px 1fr;
  gap: 14px;
}

.truth-bar {
  display: block;
  min-height: 54px;
  border-radius: 2px;
  background: var(--yellow);
}

.login-truth strong {
  font-size: 12px;
  font-weight: 650;
}

.login-truth p {
  max-width: 70ch;
  margin: 5px 0 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.login-panel-wrap {
  display: grid;
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 64px);
  place-items: center;
  border-left: 1px solid var(--border-subtle);
  background: var(--surface);
}

.login-panel {
  width: min(100%, 430px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin: 7px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.mode-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(140, 140, 140, 0.25);
  border-radius: 999px;
  background: rgba(140, 140, 140, 0.11);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.field-stack {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.field-stack label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.field-stack input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--canvas);
  color: var(--text);
  caret-color: var(--cyan);
  font-size: 14px;
  transition: border-color 120ms ease, background 120ms ease;
}

.field-stack input:hover {
  border-color: #454545;
}

.field-stack input:focus {
  border-color: var(--cyan);
  background: #111213;
  box-shadow: 0 0 0 1px rgba(99, 209, 255, 0.16);
}

.form-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 97, 0.36);
  border-radius: var(--radius-control);
  background: rgba(255, 107, 97, 0.08);
  color: var(--critical);
  font-size: 12px;
  line-height: 1.4;
}

.primary-button,
.quiet-button,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.primary-button:active:not(:disabled),
.quiet-button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 14px;
  background: var(--cyan);
  color: #0e0e0e;
}

.primary-button:hover {
  background: #83dcff;
}

.button-key {
  font-size: 10px;
  letter-spacing: 0.05em;
}

.portal-view {
  min-height: 100dvh;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(23, 23, 23, 0.98);
}

.header-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.header-telemetry {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(14px, 2.2vw, 28px);
  margin: 0;
}

.header-telemetry > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.header-telemetry dt,
.header-telemetry dd {
  margin: 0;
  font-size: 10px;
}

.header-telemetry dt {
  color: var(--text-dim);
  font-weight: 700;
}

.header-telemetry dd {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.header-telemetry dd[data-tone="healthy"] { color: var(--green); }
.header-telemetry dd[data-tone="warning"] { color: var(--yellow); }
.header-telemetry dd[data-tone="critical"] { color: var(--critical); }
.header-telemetry dd[data-tone="info"] { color: var(--cyan); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.clock-block {
  display: grid;
  min-width: 96px;
  justify-items: end;
  margin-right: 4px;
}

.clock-block time {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 560;
  letter-spacing: 0.015em;
}

.clock-block span {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quiet-button,
.icon-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
}

.quiet-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: #444;
  background: var(--surface-hover);
  color: var(--text);
}

.icon-button {
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.035em;
}

.icon-button.is-loading {
  color: var(--text-dim);
}

.global-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 107, 97, 0.35);
  background: rgba(255, 107, 97, 0.08);
}

.global-error strong {
  color: var(--critical);
  font-size: 12px;
}

.global-error p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.workspace {
  display: block;
  min-height: calc(100dvh - var(--header-height));
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
}

.server-resources { padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.server-resources-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.server-resources-heading h2 { margin: 0; font-size: 13px; font-weight: 650; }
.server-resources-heading span, .server-resources p { color: var(--text-muted); font-size: 12px; }
.server-resources-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; margin: 12px 0 0; }
.server-resources-values dt { color: var(--text-muted); font-size: 12px; }
.server-resources-values dd { margin: 5px 0 0; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.server-resources [data-tone="warning"] { color: var(--yellow); }
.server-resources p { margin: 10px 0 0; line-height: 1.5; }
@media (max-width: 640px) { .server-resources-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.primary-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-areas: "monitor output" "ingest output" "destinations destinations" "sessions sessions";
  align-items: start;
  min-width: 0;
  border-right: 1px solid var(--border-subtle);
}

.operations-panel { grid-area: monitor; min-width: 0; }
.ingest-section { grid-area: ingest; min-width: 0; }
.output-section { grid-area: output; min-width: 0; height: 100%; border-left: 1px solid var(--border-subtle); }
.destinations-section { grid-area: destinations; }
.sessions-section { grid-area: sessions; }
.output-section .output-fields { grid-template-columns: 1fr; }
.output-section .primary-button { width: 100%; }
.output-section .resource-header { align-items: start; flex-direction: column; gap: 8px; }
.live-button { background: var(--red); color: #fff; }
.received-monitor { position: relative; width: 100%; min-width: 0; aspect-ratio: 16 / 9; max-height: calc(100dvh - 550px); min-height: 220px; background: #000; }
.received-monitor video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.preview-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 56px 24px 24px; background: #000; text-align: center; }
.preview-placeholder strong { font-size: 22px; font-weight: 650; }
.preview-placeholder p { max-width: 48ch; color: var(--text-muted); line-height: 1.5; }
.preview-placeholder[hidden] { display: none; }
.preview-origin { position: absolute; top: 12px; left: 12px; padding: 5px 8px; background: rgba(0,0,0,.8); color: var(--text-muted); font-size: 11px; pointer-events: none; }
.preview-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); font-size: 12px; color: var(--text-muted); }
.preview-toolbar > #preview-state { margin-right: auto; }
.preview-quality-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preview-quality-control select { max-width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-raised); color: var(--text); font: inherit; }
#preview-quality-hint { flex-basis: 100%; font-size: 11px; line-height: 1.5; margin: 0; max-width: 85ch; }
.output-section .release-confirm-button { min-height: 36px; padding: 8px 12px; border: 1px solid var(--critical); border-radius: var(--radius-control); background: var(--surface-raised); color: var(--text); font-size: 12px; }
.output-section .release-confirm-button:hover:not(:disabled) { background: var(--surface-hover); }
.output-section #destination-add-button { justify-self: start; margin-top: 8px; color: var(--cyan); }
.operations-panel .signal-map { display: none; }

.operations-panel,
.resource-section {
  border-bottom: 1px solid var(--border-subtle);
}

.section-header,
.resource-header,
.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-header {
  min-height: 68px;
  padding: 12px 18px;
  background: var(--surface);
}

.section-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section-header .section-label {
  margin-bottom: 5px;
  color: var(--text-dim);
}

.sync-meta {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.sync-meta span {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
}

.sync-meta span[data-tone="warning"] {
  color: var(--yellow);
}

.sync-meta time {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.signal-map {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-rows: 1fr auto auto;
  padding: 16px 18px;
  overflow: hidden;
  background: var(--monitor);
}

.signal-map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.035) 0);
  background-size: 12.5% 100%;
  pointer-events: none;
}

.signal-map-heading,
.signal-route,
.signal-map-footer {
  position: relative;
  z-index: 1;
}

.signal-map-heading {
  align-self: center;
  max-width: 720px;
}

.signal-map-heading > span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.signal-map-heading strong {
  display: block;
  max-width: none;
  margin-top: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.032em;
  line-height: 1.02;
}

.signal-map-heading p {
  max-width: 62ch;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.signal-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.route-segment {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 17px 16px 4px 0;
}

.route-segment:not(:last-child) {
  margin-right: 12px;
}

.route-line {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}

.route-segment[data-tone="healthy"] .route-line { background: var(--green); }
.route-segment[data-tone="warning"] .route-line { background: var(--yellow); }
.route-segment[data-tone="critical"] .route-line { background: var(--critical); }
.route-segment[data-tone="info"] .route-line { background: var(--cyan); }
.route-segment[data-tone="live"] .route-line { background: var(--red); }
.route-segment[data-tone="disabled"] .route-line { background: var(--text-dim); }

.route-segment strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-segment small {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-map-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.resource-section {
  background: var(--surface);
}

.resource-header {
  min-height: 61px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-raised);
}

.resource-header h2,
.rail-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.resource-header p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 10px;
}

.count-label {
  color: var(--text-dim);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.resource-list {
  min-height: 82px;
}

.action-feedback {
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.action-feedback[data-tone="critical"] {
  color: var(--critical);
}

.action-feedback[data-tone="healthy"] {
  color: var(--green);
}

.resource-row {
  display: grid;
  min-height: 60px;
  grid-template-columns: minmax(180px, 1.3fr) minmax(125px, 0.65fr) minmax(120px, 0.75fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.resource-row:last-child {
  border-bottom: 0;
}

.resource-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.resource-primary,
.resource-meta {
  min-width: 0;
}

.resource-primary strong,
.resource-meta strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-primary span,
.resource-meta span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-word {
  justify-self: end;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.status-word[data-tone="healthy"] { color: var(--green); }
.status-word[data-tone="warning"] { color: var(--yellow); }
.status-word[data-tone="critical"] { color: var(--critical); }
.status-word[data-tone="info"] { color: var(--cyan); }
.status-word[data-tone="live"] { color: var(--live-text); }
.status-word[data-tone="disabled"] { color: var(--text-dim); }

.resource-actions {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.session-release-button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 107, 97, 0.32);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.035em;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.session-release-button:hover:not(:disabled) {
  border-color: rgba(255, 107, 97, 0.68);
  background: rgba(255, 107, 97, 0.07);
  color: var(--text);
}

.session-release-button:active:not(:disabled) {
  transform: translateY(1px);
}

.empty-state {
  display: grid;
  min-height: 112px;
  align-content: center;
  gap: 5px;
  padding: 20px 18px;
}

.empty-state strong {
  color: var(--text-muted);
  font-size: 12px;
}

.empty-state p {
  max-width: 65ch;
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.skeleton-row {
  display: grid;
  min-height: 60px;
  grid-template-columns: 1.4fr 0.8fr 0.65fr;
  align-items: center;
  gap: 28px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-row span {
  display: block;
  height: 9px;
  border-radius: 2px;
  background: var(--surface-hover);
}

.skeleton-row span:nth-child(2) { width: 74%; }
.skeleton-row span:nth-child(3) { width: 58%; justify-self: end; }

@media (prefers-reduced-motion: no-preference) {
  .skeleton-row span {
    animation: skeleton-pulse 1.4s ease-in-out infinite alternate;
  }
}

@keyframes skeleton-pulse {
  from { opacity: 0.42; }
  to { opacity: 0.86; }
}

.continuity-rail {
  position: relative;
  top: auto;
  display: block;
  height: auto;
  min-height: 0;
  align-self: start;
  background: var(--surface);
}

.system-diagnostics > summary {
  cursor: pointer;
  list-style: none;
}

.system-diagnostics > summary::-webkit-details-marker {
  display: none;
}

.system-diagnostics > summary h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-diagnostics > summary h2::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.system-diagnostics[open] > summary h2::before {
  transform: rotate(45deg);
}

.rail-header {
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-raised);
}

.rail-header:hover {
  background: var(--surface-hover);
}

.rail-header span {
  color: var(--yellow);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.rail-header span[data-tone="healthy"] { color: var(--green); }
.rail-header span[data-tone="critical"] { color: var(--critical); }

.continuity-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.continuity-stage {
  display: grid;
  min-height: 94px;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.stage-marker {
  display: block;
  width: 3px;
  height: 28px;
  border-radius: 2px;
  background: var(--text-dim);
}

.continuity-stage[data-tone="healthy"] .stage-marker { background: var(--green); }
.continuity-stage[data-tone="warning"] .stage-marker { background: var(--yellow); }
.continuity-stage[data-tone="critical"] .stage-marker { background: var(--critical); }
.continuity-stage[data-tone="info"] .stage-marker { background: var(--cyan); }
.continuity-stage[data-tone="live"] .stage-marker { background: var(--red); }
.continuity-stage[data-tone="disabled"] .stage-marker { background: #565656; }

.stage-copy {
  min-width: 0;
}

.stage-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.stage-title-row h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.stage-title-row span {
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.continuity-stage[data-tone="healthy"] .stage-title-row span { color: var(--green); }
.continuity-stage[data-tone="warning"] .stage-title-row span { color: var(--yellow); }
.continuity-stage[data-tone="critical"] .stage-title-row span { color: var(--critical); }
.continuity-stage[data-tone="info"] .stage-title-row span { color: var(--cyan); }
.continuity-stage[data-tone="live"] .stage-title-row span { color: var(--live-text); }

.stage-copy > p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.45;
}

.stage-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 13px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--border-subtle);
}

.stage-metrics div {
  min-width: 0;
}

.stage-metrics dt,
.stage-metrics dd {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-metrics dt {
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 700;
}

.stage-metrics dd {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.action-dock {
  padding: 15px 18px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
}

.action-dock-copy strong {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 650;
}

.action-dock-copy p {
  margin: 5px 0 12px;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.45;
}

.locked-action {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(250, 209, 56, 0.24);
  border-radius: var(--radius-control);
  background: rgba(250, 209, 56, 0.08);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.045em;
}

.release-dialog {
  width: min(calc(100% - 32px), 560px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--text);
}

.release-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.release-dialog-panel {
  padding: 24px;
}

.release-dialog h2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.release-dialog-summary {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.release-dialog > .release-dialog-panel > p:not(.release-dialog-summary) {
  max-width: 68ch;
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
}

.release-dialog > .release-dialog-panel > p strong {
  color: var(--yellow);
}

.release-boundary {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(250, 209, 56, 0.24);
  border-radius: var(--radius-control);
  background: rgba(250, 209, 56, 0.055);
}

.release-boundary strong {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
}

.release-boundary p {
  margin: 5px 0 0;
  color: color-mix(in srgb, var(--yellow) 72%, var(--text));
  font-size: 11px;
  line-height: 1.5;
}

.release-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.release-dialog-actions button {
  min-height: 42px;
  padding: 0 14px;
}

.release-confirm-button {
  border: 1px solid rgba(255, 107, 97, 0.48);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease;
}

.release-confirm-button:hover:not(:disabled) {
  border-color: var(--critical);
  background: rgba(255, 107, 97, 0.09);
}

.release-confirm-button:active:not(:disabled) {
  transform: translateY(1px);
}

noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 40;
  padding: 14px;
  border: 1px solid rgba(255, 107, 97, 0.4);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--critical);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1180px) {
  :root {
    --rail-width: 350px;
  }

  .header-telemetry > div:nth-child(2) {
    display: none;
  }

  .resource-row {
    grid-template-columns: minmax(180px, 1.3fr) minmax(120px, 0.8fr) auto;
  }

  .resource-row .resource-meta:nth-of-type(3) {
    display: none;
  }
}

@media (max-width: 920px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 44dvh;
    padding: 28px;
  }

  .login-copy {
    margin: 52px 0;
  }

  .login-truth {
    display: none;
  }

  .login-panel-wrap {
    min-height: 56dvh;
    padding: 42px 24px;
    border-top: 1px solid var(--border-subtle);
    border-left: 0;
  }

  .workspace-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 14px;
  }

  .header-divider,
  .header-telemetry {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .primary-workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "monitor" "ingest" "output" "destinations" "sessions";
    border-right: 0;
  }

  .continuity-rail {
    position: relative;
    top: auto;
    height: auto;
    min-height: auto;
    border-top: 1px solid var(--border);
  }

  .continuity-stages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .continuity-stage {
    border-right: 1px solid var(--border-subtle);
  }

  .continuity-stage:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .login-brand {
    min-height: 42dvh;
    padding: 22px 18px;
  }

  .brand-lockup-large img {
    width: 205px;
    height: auto;
  }

  .brand-lockup-large strong {
    font-size: 14px;
  }

  .brand-lockup-large b {
    font-size: 15px;
  }

  .login-copy h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .login-copy > p:last-child {
    max-width: 34ch;
    font-size: 14px;
  }

  .login-panel-wrap {
    padding: 34px 18px;
  }

  .workspace-header {
    min-height: 58px;
    gap: 6px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .workspace-header > .mode-pill,
  .clock-block {
    display: none;
  }

  .header-actions {
    gap: 6px;
    margin-left: auto;
  }

  #refresh-button,
  #logout-button {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 9px;
  }

  #refresh-button span {
    display: none;
  }

  #refresh-button::after {
    content: "SYNC";
  }

  .section-header {
    min-height: 62px;
    padding: 10px 14px;
  }

  .signal-map {
    min-height: 0;
    padding: 16px 14px;
  }

  .signal-map-heading strong {
    max-width: none;
    font-size: 15px;
  }

  .signal-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 8px;
  }

  .route-segment:not(:last-child) {
    margin-right: 0;
  }

  .signal-map-footer {
    display: grid;
    gap: 5px;
  }

  .resource-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .resource-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 12px 14px;
  }

  .resource-row .resource-meta {
    display: none;
  }

  .resource-row .status-word {
    align-self: start;
  }

  .resource-actions {
    align-items: flex-end;
  }

  .session-release-button {
    min-height: 44px;
  }

  .release-dialog-panel {
    padding: 20px 18px;
  }

  .release-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .release-dialog-actions button {
    width: 100%;
    min-height: 44px;
  }

  .continuity-stages {
    grid-template-columns: 1fr;
  }

  .continuity-stage,
  .continuity-stage:nth-child(2n) {
    border-right: 0;
  }

  .global-error {
    align-items: flex-start;
    flex-direction: column;
  }

  .broadcast-route {
    grid-template-columns: 1fr;
  }

  .broadcast-route-node {
    padding: 14px 0;
  }

  .broadcast-route-connector {
    min-height: 24px;
  }

  .broadcast-route-connector::before {
    top: 0;
    bottom: 4px;
    left: 12px;
    width: 1px;
    height: auto;
  }

  .broadcast-route-connector::after {
    top: auto;
    right: auto;
    bottom: 2px;
    left: 8px;
    transform: rotate(135deg);
  }

  .brand-lockup,
  .quiet-button,
  .icon-button,
  .output-fields select,
  #destination-edit,
  .preview-quality-control select,
  .output-section .release-confirm-button,
  .destination-editor summary,
  .ingest-details summary {
    min-height: 44px;
  }

  .destination-editor summary,
  .ingest-details summary {
    display: flex;
    align-items: center;
  }
}

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

@media (forced-colors: active) {
  .stage-marker,
  .route-line,
  .truth-bar {
    border: 1px solid CanvasText;
  }

  .session-release-button,
  .release-dialog,
  .release-boundary,
  .release-confirm-button {
    border: 1px solid CanvasText;
  }
}

/* Source management extends the existing broadcast console. */
.replacement-selection { margin: 16px 0; }
.field-hint { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.replacement-editor { margin: 16px 0; border-top: 1px solid var(--border); padding-top: 12px; }
.replacement-editor summary { cursor: pointer; padding: 6px 0; font-size: 13px; font-weight: 650; }
.replacement-editor summary:hover { color: var(--cyan); }
.replacement-editor form { display: grid; gap: 14px; margin-top: 18px; }
.replacement-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.replacement-actions button { height: auto; min-height: 36px; padding-block: 8px; white-space: normal; }
.replacement-editor input[type="file"] { width: 100%; min-width: 0; height: auto; padding: 8px; color: var(--text-muted); font: inherit; font-size: 12px; }
.replacement-editor input::file-selector-button { background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px; margin-right: 8px; cursor: pointer; }
.replacement-editor progress { width: 100%; height: 8px; accent-color: var(--cyan); }
.replacement-editor .action-feedback:empty { display: none; }

@media (pointer: coarse) {
  #replacement-source, #replacement-kind, .replacement-actions button, .replacement-editor summary { min-height: 44px; }
}
