:root {
  --bg: #09131d;
  --bg-elevated: rgba(10, 25, 38, 0.82);
  --bg-soft: rgba(16, 38, 56, 0.72);
  --line: rgba(126, 177, 201, 0.22);
  --line-strong: rgba(126, 177, 201, 0.48);
  --text: #edf4f7;
  --muted: #94afbd;
  --accent: #f4b860;
  --accent-strong: #f08e32;
  --accent-cool: #78d3c3;
  --danger: #ff7a6e;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 184, 96, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(120, 211, 195, 0.12), transparent 22%),
    linear-gradient(180deg, #0a1621 0%, #081018 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
  pointer-events: none;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(1400px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar h1,
.hero-card h2,
.panel-header h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  line-height: 0.9;
}

.eyebrow,
.block-label,
.panel-note,
.progress-meta,
.timer-phase,
.segment-countdown,
.status-pill,
.timer-chip,
.episode-picker span {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow,
.panel-note,
.timer-phase,
.segment-countdown,
.progress-meta,
.episode-picker span {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.episode-picker {
  display: grid;
  gap: 8px;
}

.episode-picker select {
  min-width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(5, 13, 20, 0.72);
}

.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 22px;
}

.hero-card,
.console-card,
.segments-panel,
.notes-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.hero-card,
.console-card {
  padding: 28px;
}

.segments-panel,
.notes-panel {
  padding: 24px;
}

.hero-card {
  min-height: 330px;
}

.hero-card::after,
.console-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 184, 96, 0.22), transparent 68%);
  pointer-events: none;
}

.hero-meta,
.timer-header,
.panel-header,
.progress-meta,
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-meta {
  margin-bottom: 16px;
}

.status-pill,
.timer-chip {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 13, 20, 0.5);
  font-size: 0.76rem;
  color: var(--text);
}

.status-pill[data-status="ready"] {
  border-color: rgba(120, 211, 195, 0.42);
  color: var(--accent-cool);
}

.status-pill[data-status="live"] {
  border-color: rgba(120, 211, 195, 0.55);
  color: #c2fff4;
  background: rgba(18, 58, 52, 0.72);
}

.status-pill[data-status="draft"] {
  border-color: rgba(244, 184, 96, 0.4);
  color: var(--accent);
}

.status-pill[data-status="idea"] {
  border-color: rgba(126, 177, 201, 0.4);
  color: #bdd5e1;
}

.hero-card h2 {
  max-width: 14ch;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.94;
}

.hero-premise {
  max-width: 60ch;
  margin: 0 0 22px;
  font-size: 1.06rem;
  color: #d8e7ee;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.block-label {
  margin: 0 0 12px;
  font-size: 0.75rem;
  color: var(--accent-cool);
}

.hero-block p:last-child {
  margin: 0;
}

.console-card {
  display: grid;
  gap: 24px;
}

.timer-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.timer-display-wrap {
  display: grid;
  place-items: center;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: min(100%, 430px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at center, rgba(9, 19, 29, 0.24) 0, rgba(9, 19, 29, 0.82) 56%, rgba(9, 19, 29, 0.96) 100%),
    conic-gradient(var(--accent) 0deg, rgba(255, 255, 255, 0.06) 0deg);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.03);
}

.timer-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.timer-separator {
  opacity: 0.55;
}

.segment-countdown {
  margin: 10px 0 0;
}

.progress-group {
  display: grid;
  gap: 12px;
}

.progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-cool), var(--accent));
  transition: width 220ms ease;
}

.control-row {
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.primary-button {
  border-color: rgba(244, 184, 96, 0.48);
  color: #1d1402;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost-button {
  color: var(--text);
  background: rgba(5, 13, 20, 0.45);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.segments-panel {
  grid-column: 1;
}

.notes-panel {
  grid-column: 2;
  grid-row: 2;
}

.segment-list,
.stories-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.segment-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(7, 17, 26, 0.72);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.segment-card.is-active {
  border-color: rgba(244, 184, 96, 0.48);
  background: linear-gradient(180deg, rgba(244, 184, 96, 0.1), rgba(7, 17, 26, 0.74));
  transform: translateY(-2px);
}

.segment-card.is-complete {
  border-color: rgba(120, 211, 195, 0.34);
}

.segment-card h4 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.segment-kicker {
  margin: 0 0 12px;
  color: var(--accent-cool);
  font-size: 0.82rem;
}

.segment-card ul,
.stories-list {
  margin: 0;
  padding-left: 18px;
}

.segment-card li,
.stories-list li {
  margin-bottom: 8px;
  color: #d7e5ec;
}

.stories-list li::marker,
.segment-card li::marker {
  color: var(--accent);
}

.focus-mode .hero-card,
.focus-mode .notes-panel,
.focus-mode .topbar {
  opacity: 0.2;
  transform: scale(0.99);
  transition: opacity 180ms ease, transform 180ms ease;
}

.focus-mode .console-card,
.focus-mode .segments-panel {
  border-color: rgba(244, 184, 96, 0.36);
}

.timer-warning .timer-ring {
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.03), 0 0 48px rgba(244, 184, 96, 0.16);
}

.timer-overrun .timer-ring {
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.03), 0 0 60px rgba(255, 122, 110, 0.18);
}

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

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .segments-panel,
  .notes-panel {
    grid-column: auto;
    grid-row: auto;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 20px;
  }

  .topbar,
  .hero-meta,
  .timer-header,
  .panel-header,
  .control-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .episode-picker,
  .episode-picker select {
    width: 100%;
  }

  .episode-picker select {
    min-width: 0;
  }

  .hero-card,
  .console-card,
  .segments-panel,
  .notes-panel {
    padding: 20px;
  }
}