/* ─────────────────────────────────────────────────────────────────
   Editorial Motorsport — viewer + login aesthetic.
   Inspired by Italian race-photography annuals: oxidised cream on
   warm ink, hairline rules, sweeping serif numerals, restrained
   ferrari-red accents. Print magazine, not dashboard.
   ────────────────────────────────────────────────────────────────── */

.ed-root {
  /* Page surfaces */
  --ed-paper:        #0d0c0a;     /* page — warm ink, not pure black */
  --ed-paper-deep:   #060504;
  --ed-paper-rule:   #1f1c17;
  --ed-frame:        #1a1814;     /* slight contrast surface */

  /* Typographic colours */
  --ed-cream:        #ede5cf;     /* oxidised parchment */
  --ed-cream-dim:    #c2bba2;     /* rule labels */
  --ed-cream-faint:  #6e6a5a;     /* metadata */
  --ed-cream-trace:  #3a3630;

  /* Inks */
  --ed-oxblood:      #841a1a;     /* serious red */
  --ed-ferrari:      #dc1f1f;     /* punctuation red */
  --ed-amber:        #c89b4f;     /* highlight, sparingly */
  --ed-ash:          #847d68;

  /* Rules */
  --ed-rule:         rgba(237, 229, 207, 0.18);
  --ed-rule-strong:  rgba(237, 229, 207, 0.42);
  --ed-rule-ferrari: rgba(220, 31, 31, 0.38);

  /* Fonts */
  --ed-serif: 'Fraunces', 'Cormorant Garamond', 'Times New Roman', serif;
  --ed-body:  'Newsreader', 'Source Serif Pro', Georgia, serif;
  --ed-mono:  'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  background: var(--ed-paper);
  color: var(--ed-cream);
  font-family: var(--ed-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* ── Grain overlay ─────────────────────────────────────────────── */
.ed-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  mix-blend-mode: overlay; opacity: 0.06;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93  0 0 0 0 0.90  0 0 0 0 0.81  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: ed-grain-drift 6s steps(6) infinite;
}
@keyframes ed-grain-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -1%); }
  60%  { transform: translate(-2%, 3%); }
  80%  { transform: translate(3%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ── Vignette ──────────────────────────────────────────────────── */
.ed-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 998;
  background: radial-gradient(ellipse at center,
              transparent 50%, rgba(0,0,0,0.55) 100%);
}

/* ── Type scale ────────────────────────────────────────────────── */
.ed-display {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 0;
  font-weight: 350;
  letter-spacing: -0.025em;
  line-height: 0.86;
  font-feature-settings: 'tnum' 1, 'lnum' 1, 'ss01' 1;
}
.ed-display-italic {
  font-family: var(--ed-serif);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.ed-headline {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 48, 'SOFT' 30';
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.ed-byline {
  font-family: var(--ed-body);
  font-style: italic;
  font-weight: 350;
  letter-spacing: 0.005em;
  line-height: 1.45;
}

/* "All-caps editorial label" — small, wide, sober */
.ed-label {
  font-family: var(--ed-body);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ed-cream-dim);
}
.ed-label--small {
  font-size: 9px;
  letter-spacing: 0.42em;
}

/* "Issue" cover-strip — tiny serif italic with widely-spaced caps */
.ed-strip {
  font-family: var(--ed-serif);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: 'opsz' 14, 'SOFT' 80;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ed-cream-dim);
}

.ed-mono {
  font-family: var(--ed-mono);
  font-variation-settings: 'wght' 400;
  font-feature-settings: 'tnum' 1;
  letter-spacing: 0;
}

/* ── Hairline rules ────────────────────────────────────────────── */
.ed-hr            { height: 1px; background: var(--ed-rule); border: 0; margin: 0; }
.ed-hr--strong    { background: var(--ed-rule-strong); }
.ed-hr--ferrari   { background: var(--ed-rule-ferrari); }
.ed-hr--double    {
  height: 4px; background: transparent; border: 0;
  border-top: 1px solid var(--ed-rule-strong);
  border-bottom: 1px solid var(--ed-rule);
}

/* ── Live indicator (pulsating ferrari dot) ────────────────────── */
.ed-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ed-body);
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ed-ferrari);
}
.ed-live::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ed-ferrari);
  box-shadow: 0 0 0 0 rgba(220, 31, 31, 0.6);
  animation: ed-pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes ed-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 31, 31, 0.45); transform: scale(1); }
  70%  { box-shadow: 0 0 0 9px rgba(220, 31, 31, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(220, 31, 31, 0); transform: scale(1); }
}

/* ── Stage frame for the video ─────────────────────────────────── */
.ed-stage {
  position: relative;
  background: var(--ed-paper-deep);
  border: 1px solid var(--ed-rule);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6) inset,
    0 30px 80px -30px rgba(0,0,0,0.9);
}
.ed-stage::before {
  /* corner ticks like a film slate */
  content: '';
  position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) top    left  / 18px 1px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) top    left  / 1px 18px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) top    right / 18px 1px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) top    right / 1px 18px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) bottom left  / 18px 1px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) bottom left  / 1px 18px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) bottom right / 18px 1px no-repeat,
    linear-gradient(var(--ed-cream-dim), var(--ed-cream-dim)) bottom right / 1px 18px no-repeat;
}

.ed-stage video {
  display: block; width: 100%; height: 100%;
  object-fit: contain; background: #000;
}

/* ── Velocity hero ─────────────────────────────────────────────── */
.ed-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 28px 0 0;
}
.ed-hero__main {
  display: flex; align-items: baseline; gap: 18px;
  position: relative;
}
.ed-hero__num {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 0;
  font-weight: 320;
  font-size: clamp(120px, 22vw, 280px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: var(--ed-cream);
  font-feature-settings: 'tnum' 1, 'lnum' 1, 'ss01' 1;
  white-space: nowrap;
  position: relative;
}
.ed-hero__num::after {
  /* serif "underline" — the pencil-mark a magazine art-director would draw */
  content: '';
  position: absolute; left: 4%; right: 6%; bottom: 0.04em;
  height: 1px;
  background: var(--ed-rule-ferrari);
}
.ed-hero__unit {
  font-family: var(--ed-body);
  font-style: italic;
  font-weight: 350;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--ed-cream-dim);
  margin-bottom: 18px;
}
.ed-hero__aside {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px;
  border-left: 1px solid var(--ed-rule);
  padding-left: 24px;
  min-width: 130px;
}
.ed-hero__aside-num {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 50;
  font-weight: 320;
  font-size: 64px;
  line-height: 0.9;
  color: var(--ed-cream-dim);
  letter-spacing: -0.025em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.ed-hero__aside-unit {
  font-family: var(--ed-body);
  font-style: italic;
  font-size: 11px;
  color: var(--ed-cream-faint);
  letter-spacing: 0.02em;
}

/* digit ticker container — used to animate digits independently */
.ed-ticker {
  display: inline-flex; overflow: hidden;
}
.ed-ticker__digit {
  display: inline-block;
  position: relative;
}
.ed-ticker__digit > span {
  display: block;
  transition: transform 320ms cubic-bezier(0.32, 0.04, 0.18, 1),
              opacity 220ms ease;
}

/* ── Telemetry strip ───────────────────────────────────────────── */
.ed-strip-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--ed-rule);
  border-bottom: 1px solid var(--ed-rule);
}
.ed-strip-cell {
  display: flex; flex-direction: column; gap: 4px;
}
.ed-strip-cell__label {
  font-family: var(--ed-body);
  font-style: italic;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ed-cream-faint);
  text-transform: uppercase;
}
.ed-strip-cell__value {
  font-family: var(--ed-mono);
  font-size: 14px;
  font-feature-settings: 'tnum' 1;
  color: var(--ed-cream);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.ed-btn {
  background: transparent;
  color: var(--ed-cream);
  border: 1px solid var(--ed-rule-strong);
  padding: 11px 22px;
  font-family: var(--ed-body);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
  font-feature-settings: 'kern' 1;
}
.ed-btn:hover { background: var(--ed-cream); color: var(--ed-paper); border-color: var(--ed-cream); }
.ed-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ed-btn--ferrari {
  border-color: var(--ed-ferrari);
  color: var(--ed-ferrari);
}
.ed-btn--ferrari:hover { background: var(--ed-ferrari); color: var(--ed-cream); }
.ed-btn--ghost {
  border-color: var(--ed-rule);
  color: var(--ed-cream-dim);
  font-size: 11px;
  padding: 8px 14px;
}
.ed-btn--ghost:hover { color: var(--ed-cream); border-color: var(--ed-cream-dim); background: transparent; }

.ed-icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--ed-cream-dim);
  border: 1px solid var(--ed-rule);
  cursor: pointer;
  font-size: 14px;
  transition: color 200ms ease, border-color 200ms ease;
}
.ed-icon-btn:hover { color: var(--ed-cream); border-color: var(--ed-cream-dim); }

/* ── Form ──────────────────────────────────────────────────────── */
.ed-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ed-rule-strong);
  padding: 14px 0 12px;
  color: var(--ed-cream);
  font-family: var(--ed-body);
  font-size: 18px;
  letter-spacing: 0.005em;
  outline: none;
  transition: border-color 200ms ease;
  font-feature-settings: 'kern' 1;
}
.ed-input:focus { border-color: var(--ed-ferrari); }
.ed-input::placeholder { color: var(--ed-cream-faint); font-style: italic; }

/* ── Layout containers ─────────────────────────────────────────── */
.ed-page {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: 0;
}
.ed-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
  flex: 1;
  display: flex; flex-direction: column;
}
@media (max-width: 800px) {
  .ed-shell { padding: 0 22px; }
  .ed-strip-row { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .ed-hero { grid-template-columns: 1fr; align-items: stretch; }
  .ed-hero__aside { border-left: 0; border-top: 1px solid var(--ed-rule); padding-left: 0; padding-top: 14px; align-items: flex-start; }
}

/* ── Masthead ──────────────────────────────────────────────────── */
.ed-masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px 0 16px;
}
.ed-masthead__logo {
  font-family: var(--ed-serif);
  font-style: italic;
  font-weight: 380;
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'WONK' 1;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--ed-cream);
}
.ed-masthead__center {
  font-family: var(--ed-body);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ed-cream-dim);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-masthead__right {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.ed-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0;
  font-family: var(--ed-body);
  font-style: italic;
  font-size: 11px;
  color: var(--ed-cream-faint);
  letter-spacing: 0.04em;
}
.ed-footer__left  { display: flex; align-items: center; gap: 14px; }
.ed-footer__right { display: flex; align-items: center; gap: 14px; }

/* ── Centered blocks (loading/404/password) ────────────────────── */
.ed-centered {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
}
.ed-card {
  width: 100%; max-width: 460px;
  border-top: 1px solid var(--ed-rule-strong);
  border-bottom: 1px solid var(--ed-rule-strong);
  padding: 56px 0;
}
.ed-card__lead {
  font-family: var(--ed-body);
  font-style: italic;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.36em;
  color: var(--ed-ferrari);
  margin-bottom: 18px;
}
.ed-card__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
  font-weight: 320;
  font-size: 64px;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--ed-cream);
  margin: 0 0 22px;
}
.ed-card__title em {
  font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1;
  font-style: italic;
  font-weight: 300;
}
.ed-card__body {
  font-family: var(--ed-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ed-cream-dim);
  margin-bottom: 28px;
}

/* ── Hero overlay (speed badge ON the video, alt) ──────────────── */
.ed-stage-meta {
  position: absolute; left: 18px; top: 18px;
  display: flex; align-items: center; gap: 14px;
  pointer-events: none;
}
.ed-stage-foot {
  position: absolute; left: 18px; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  pointer-events: none;
  font-family: var(--ed-mono);
  font-size: 11px;
  color: rgba(237, 229, 207, 0.78);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* ── Loading spinner — horizontal hairline ─────────────────────── */
.ed-loader {
  width: 80px; height: 1px; background: var(--ed-rule);
  position: relative; overflow: hidden;
}
.ed-loader::after {
  content: ''; position: absolute; left: -40%; top: 0;
  width: 40%; height: 100%; background: var(--ed-ferrari);
  animation: ed-loader 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes ed-loader {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ──────────────────────────────────────────────────────────────────
   ADMIN (race control room) — same Editorial DNA, applied to the
   operator interface. Top masthead, segmented tab strip, hairline
   rules for everything. No sidebar.
   ────────────────────────────────────────────────────────────────── */

.ed-app {
  position: relative; min-height: 100%;
  background: var(--ed-paper);
  color: var(--ed-cream);
  display: flex; flex-direction: column;
}

/* App-level masthead — narrower than the viewer's, denser, sticky */
.ed-app__masthead {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(to bottom, rgba(13,12,10,0.96), rgba(13,12,10,0.85));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ed-rule);
}
.ed-app__masthead-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 0.9fr);
  align-items: center; gap: 24px;
  padding: 16px 36px;
}
.ed-app__logo {
  font-family: var(--ed-serif); font-style: italic;
  font-variation-settings: 'opsz' 36, 'SOFT' 100, 'WONK' 1;
  font-weight: 380; font-size: 22px;
  color: var(--ed-cream); letter-spacing: -0.005em;
}
.ed-app__logo-sub {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ed-cream-faint); margin-left: 10px;
}
.ed-app__user {
  display: flex; align-items: center; gap: 14px; justify-content: flex-end;
  font-family: var(--ed-body); font-style: italic;
  font-size: 12px; color: var(--ed-cream-dim);
}

/* Stream-selector pill in the masthead centre */
.ed-stream-pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  border: 1px solid var(--ed-rule-strong);
  background: rgba(237, 229, 207, 0.04);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
  font-family: var(--ed-body); font-size: 13px; color: var(--ed-cream);
}
.ed-stream-pill:hover { border-color: var(--ed-cream-dim); background: rgba(237, 229, 207, 0.07); }
.ed-stream-pill__name { font-weight: 450; }
.ed-stream-pill__loc {
  font-style: italic; color: var(--ed-cream-faint);
  margin-left: 8px; padding-left: 8px;
  border-left: 1px solid var(--ed-rule);
}
.ed-stream-pill__caret {
  margin-left: 6px; color: var(--ed-cream-faint);
  font-family: var(--ed-mono); font-size: 10px;
}

/* Segmented tab strip — like a magazine table of contents */
.ed-app__tabs {
  display: flex; align-items: stretch;
  padding: 0 36px;
  border-bottom: 1px solid var(--ed-rule);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ed-app__tabs::-webkit-scrollbar { display: none; }
.ed-tab {
  background: transparent; border: 0;
  padding: 14px 0;
  margin-right: 32px;
  cursor: pointer; position: relative;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ed-body); font-size: 12px;
  color: var(--ed-cream-faint);
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: color 200ms ease;
  white-space: nowrap;
}
.ed-tab:hover { color: var(--ed-cream-dim); }
.ed-tab[aria-current="true"] { color: var(--ed-cream); }
.ed-tab[aria-current="true"]::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--ed-ferrari);
}
.ed-tab__num {
  font-family: var(--ed-serif); font-style: italic;
  font-variation-settings: 'opsz' 14, 'SOFT' 80;
  font-size: 13px; color: var(--ed-cream-faint);
  letter-spacing: 0;
}
.ed-tab[aria-current="true"] .ed-tab__num { color: var(--ed-ferrari); }

/* Page container — used by every tab */
.ed-app__main { flex: 1; padding: 36px 36px 64px; }
.ed-app__main--narrow { max-width: 980px; margin: 0 auto; }

/* Page header inside a tab (not the masthead) */
.ed-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
}
.ed-page-head__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
  font-weight: 320; font-size: 56px; line-height: 0.95;
  letter-spacing: -0.025em; margin: 0;
  color: var(--ed-cream);
}
.ed-page-head__title em {
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1;
  color: var(--ed-ferrari);
}
.ed-page-head__lead {
  font-family: var(--ed-body); font-style: italic;
  font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ed-cream-faint); margin-bottom: 10px;
}
.ed-page-head__actions { display: flex; gap: 10px; align-items: center; }

/* Disclosure (collapsible) section */
.ed-disclosure {
  border-top: 1px solid var(--ed-rule);
  padding: 22px 0 0;
  margin-top: 22px;
}
.ed-disclosure__head {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  padding-bottom: 18px;
}
.ed-disclosure__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 32, 'SOFT' 50;
  font-weight: 400; font-size: 22px;
  color: var(--ed-cream); letter-spacing: -0.005em;
}
.ed-disclosure__caret {
  font-family: var(--ed-mono); font-size: 11px;
  color: var(--ed-cream-faint);
}

/* Detail grid (label + value rows, very magazine-spec-sheet) */
.ed-detail {
  display: grid; grid-template-columns: 140px 1fr; gap: 0 24px;
}
.ed-detail__label {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ed-cream-faint);
  padding: 14px 0; border-bottom: 1px solid var(--ed-rule);
}
.ed-detail__value {
  font-family: var(--ed-body); font-size: 14px;
  color: var(--ed-cream);
  padding: 14px 0; border-bottom: 1px solid var(--ed-rule);
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.ed-detail__value .ed-mono { font-size: 13px; }

/* URL row — code chip + copy button */
.ed-url {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.ed-url__code {
  flex: 1; min-width: 0;
  font-family: var(--ed-mono); font-size: 12px;
  color: var(--ed-cream);
  background: rgba(237, 229, 207, 0.04);
  border: 1px solid var(--ed-rule);
  padding: 8px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-url__copy {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--ed-rule);
  color: var(--ed-cream-dim);
  padding: 8px 12px;
  font-family: var(--ed-body); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; transition: all 180ms ease;
}
.ed-url__copy:hover { color: var(--ed-cream); border-color: var(--ed-cream-dim); }

/* Card list — replaces tables for sessions/replays/clips/devices */
.ed-list { display: flex; flex-direction: column; }
.ed-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 24px; align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--ed-rule);
}
.ed-list__row:last-child { border-bottom: 1px solid var(--ed-rule); }
.ed-list__row--inline { padding: 14px 0; }

.ed-list__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 24, 'SOFT' 30;
  font-weight: 400; font-size: 19px;
  color: var(--ed-cream); letter-spacing: -0.005em;
  line-height: 1.2;
}
.ed-list__sub {
  font-family: var(--ed-body); font-style: italic;
  font-size: 12px; color: var(--ed-cream-faint);
  margin-top: 3px;
}
.ed-list__meta {
  font-family: var(--ed-mono); font-size: 12px; color: var(--ed-cream-dim);
}
.ed-list__actions { display: flex; gap: 6px; align-items: center; }

.ed-list__empty {
  padding: 64px 24px; text-align: center;
  border-top: 1px solid var(--ed-rule);
  border-bottom: 1px solid var(--ed-rule);
}
.ed-list__empty-lead {
  font-family: var(--ed-body); font-style: italic;
  font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ed-cream-faint); margin-bottom: 16px;
}
.ed-list__empty-text {
  font-family: var(--ed-body); font-size: 15px; line-height: 1.55;
  color: var(--ed-cream-dim); max-width: 480px; margin: 0 auto;
}

/* Status pills */
.ed-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ed-body); font-size: 10px;
  letter-spacing: 0.32em; text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid currentColor;
}
.ed-pill--live    { color: var(--ed-ferrari); }
.ed-pill--live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: ed-pulse 1.6s infinite;
}
.ed-pill--public  { color: var(--ed-amber); }
.ed-pill--private { color: var(--ed-amber); }
.ed-pill--pending { color: var(--ed-amber); border-style: dashed; }
.ed-pill--ended   { color: var(--ed-cream-faint); }
.ed-pill--ready   { color: var(--ed-amber); }
.ed-pill--offline { color: var(--ed-cream-faint); }

/* Toggle (editorial style) */
.ed-toggle {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none;
}
.ed-toggle__track {
  width: 36px; height: 18px;
  border: 1px solid var(--ed-rule-strong);
  background: transparent; position: relative;
  transition: border-color 200ms ease, background 200ms ease;
}
.ed-toggle__thumb {
  position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px;
  background: var(--ed-cream-dim);
  transition: left 200ms ease, background 200ms ease;
}
.ed-toggle--on .ed-toggle__track { border-color: var(--ed-ferrari); background: rgba(220,31,31,0.08); }
.ed-toggle--on .ed-toggle__thumb { left: 19px; background: var(--ed-ferrari); }
.ed-toggle__label {
  font-family: var(--ed-body); font-size: 13px; color: var(--ed-cream);
}
.ed-toggle__sub {
  display: block;
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; color: var(--ed-cream-faint); margin-top: 1px;
}

/* Choice tiles — for the visibility picker, codec picker, etc. */
.ed-choice-grid { display: grid; gap: 8px; }
.ed-choice {
  background: transparent;
  border: 1px solid var(--ed-rule);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--ed-body);
  color: var(--ed-cream);
  transition: border-color 200ms ease, background 200ms ease;
  display: flex; flex-direction: column; gap: 4px;
}
.ed-choice:hover { border-color: var(--ed-cream-dim); }
.ed-choice[aria-selected="true"] {
  border-color: var(--ed-ferrari);
  background: rgba(220, 31, 31, 0.06);
}
.ed-choice__title {
  font-size: 14px; font-weight: 500;
}
.ed-choice__sub {
  font-style: italic; font-size: 11px; color: var(--ed-cream-faint);
}

/* Modal (full-screen overlay with framed card) */
.ed-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 5, 4, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ed-modal {
  width: min(720px, 96vw);
  max-height: 92vh; overflow: auto;
  background: var(--ed-paper);
  border-top: 2px solid var(--ed-cream);
  border-bottom: 2px solid var(--ed-cream);
  padding: 36px 44px;
  position: relative;
}
.ed-modal--wide { width: min(960px, 96vw); }
.ed-modal__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.ed-modal__lead {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ed-ferrari); margin-bottom: 6px;
}
.ed-modal__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 64, 'SOFT' 30;
  font-weight: 320; font-size: 36px; line-height: 1;
  letter-spacing: -0.02em; color: var(--ed-cream);
  margin: 0;
}
.ed-modal__title em {
  font-style: italic;
  font-variation-settings: 'opsz' 64, 'SOFT' 100, 'WONK' 1;
}
.ed-modal__close {
  background: transparent; border: 1px solid var(--ed-rule);
  width: 32px; height: 32px;
  color: var(--ed-cream-dim); cursor: pointer;
  font-family: var(--ed-mono); font-size: 14px;
}
.ed-modal__close:hover { color: var(--ed-cream); border-color: var(--ed-cream-dim); }
.ed-modal__body { display: flex; flex-direction: column; gap: 20px; }
.ed-modal__foot {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--ed-rule);
}

/* Form rows */
.ed-form-row {
  display: flex; flex-direction: column; gap: 8px;
}
.ed-form-row__label {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ed-cream-faint);
}
.ed-form-row--double {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* Hero broadcast card on the stream tab */
.ed-broadcast-card {
  border-top: 2px solid var(--ed-cream);
  border-bottom: 1px solid var(--ed-rule-strong);
  padding: 28px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: end;
}
.ed-broadcast-card__title {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 50, 'WONK' 0;
  font-weight: 320; font-size: 64px; line-height: 0.92;
  letter-spacing: -0.025em; color: var(--ed-cream);
  margin: 0 0 8px;
}
.ed-broadcast-card__title em {
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1;
  color: var(--ed-ferrari);
}
.ed-broadcast-card__sub {
  font-family: var(--ed-body); font-style: italic;
  font-size: 13px; color: var(--ed-cream-dim);
  letter-spacing: 0.04em;
}
.ed-broadcast-card__chips {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.ed-broadcast-card__actions {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}

.ed-broadcast-stat {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.ed-broadcast-stat__num {
  font-family: var(--ed-serif);
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
  font-weight: 320; font-size: 56px; line-height: 0.9;
  color: var(--ed-cream); letter-spacing: -0.025em;
  font-feature-settings: 'tnum' 1;
}
.ed-broadcast-stat__unit {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ed-cream-faint);
}

/* Toast */
.ed-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px;
  background: var(--ed-paper);
  border-top: 1px solid var(--ed-cream);
  border-bottom: 1px solid var(--ed-cream);
  font-family: var(--ed-body); font-size: 13px;
  color: var(--ed-cream); z-index: 1000;
  animation: ed-toast-in 220ms ease;
}
.ed-toast--error {
  border-color: var(--ed-ferrari); color: var(--ed-ferrari);
}
@keyframes ed-toast-in {
  from { transform: translate(-50%, 8px); opacity: 0; }
  to   { transform: translate(-50%, 0);   opacity: 1; }
}

/* Spinner for loading buttons */
.ed-spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ed-spin 0.8s linear infinite;
}
@keyframes ed-spin { to { transform: rotate(360deg); } }

/* KV row used in cards (used in incoming popup, broadcast section) */
.ed-kv {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--ed-rule);
  font-family: var(--ed-body); font-size: 13px;
}
.ed-kv:last-child { border-bottom: 0; }
.ed-kv__k {
  font-style: italic; color: var(--ed-cream-faint);
  font-size: 12px; letter-spacing: 0.04em;
}
.ed-kv__v { color: var(--ed-cream); }
.ed-kv__v.ed-mono { font-size: 12px; }

/* Sidebar/Aside section in the stream tab */
.ed-aside-section {
  padding: 22px 0;
  border-top: 1px solid var(--ed-rule);
}
.ed-aside-section:first-child { border-top: 0; padding-top: 0; }
.ed-aside-section__title {
  font-family: var(--ed-body); font-style: italic;
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ed-cream-faint);
  margin-bottom: 14px;
}

/* Sidebar — only shows up in narrow contexts (devices form etc.) */
.ed-side-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 1100px) {
  .ed-side-grid { grid-template-columns: 1fr; gap: 24px; }
  .ed-broadcast-card { grid-template-columns: 1fr; gap: 16px; }
  .ed-broadcast-card__actions { justify-content: flex-start; }
  .ed-page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ed-form-row--double { grid-template-columns: 1fr; }
  .ed-detail { grid-template-columns: 100px 1fr; gap: 0 16px; }
  .ed-app__masthead-row { grid-template-columns: 1fr auto; padding: 14px 22px; }
  .ed-app__user { display: none; }
  .ed-app__tabs { padding: 0 22px; }
  .ed-app__main { padding: 22px 22px 64px; }
}
