:root {
  color: oklch(22% 0.02 78);
  background: oklch(94% 0.025 82);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

.shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 36px 20px;
}

.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid oklch(77% 0.025 82);
  padding-bottom: 24px;
}

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

.show-image {
  width: 100%;
  aspect-ratio: 1024 / 559;
  object-fit: contain;
  border: 1px solid oklch(70% 0.02 82);
  border-radius: 6px;
  background: oklch(86% 0.02 82);
}

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

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: oklch(42% 0.07 55);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 3rem;
  line-height: 1;
  max-width: 760px;
  margin-bottom: 0;
}

button,
select,
input,
textarea {
  border: 1px solid oklch(35% 0.045 72);
  border-radius: 6px;
  font: inherit;
}

button {
  background: oklch(27% 0.035 72);
  color: oklch(94% 0.02 82);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 oklch(12% 0.02 72 / 0.28);
  transition:
    background-color 140ms ease-out,
    border-color 140ms ease-out,
    color 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 80ms ease-out;
}

button:hover:not(:disabled) {
  border-color: oklch(28% 0.075 64);
  background: oklch(38% 0.07 64);
  color: oklch(98% 0.01 82);
  box-shadow: 0 3px 10px oklch(20% 0.04 72 / 0.22);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid oklch(67% 0.11 64);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  background: oklch(20% 0.035 72);
  box-shadow: inset 0 2px 4px oklch(10% 0.02 72 / 0.34);
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

select,
input,
textarea {
  box-sizing: border-box;
  width: 100%;
  background: oklch(97% 0.012 82);
  color: oklch(22% 0.02 78);
  padding: 10px 12px;
  transition:
    background-color 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out;
}

select:hover,
input:hover,
textarea:hover {
  border-color: oklch(44% 0.07 68);
}

select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  border-color: oklch(52% 0.1 64);
  outline: 3px solid oklch(67% 0.11 64 / 0.72);
  outline-offset: 2px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: oklch(31% 0.035 76);
}

.status-pill {
  display: inline-block;
  margin: 14px 0 0;
  padding: 6px 10px;
  border: 1px solid oklch(70% 0.03 82);
  border-radius: 999px;
  background: oklch(90% 0.018 82);
  color: oklch(34% 0.04 76);
  font-size: 0.86rem;
  font-weight: 700;
}

.episode-tools {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(320px, 0.95fr) minmax(390px, 1.35fr);
  gap: 28px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid oklch(77% 0.025 82);
}

.episode-tools h2 {
  margin-bottom: 10px;
}

.episode-picker,
.episode-create,
.article-management {
  min-width: 0;
}

.episode-create > button {
  margin-top: 6px;
}

.episode-tools textarea {
  margin: 10px 0;
  resize: vertical;
}

.inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 10px;
  align-items: center;
}

.episode-create .inline-controls {
  grid-template-columns: minmax(0, 1fr) minmax(150px, max-content);
}

.article-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-actions button {
  min-height: 52px;
}

.schedule-editor {
  margin-top: 16px;
}

.schedule-actions {
  grid-template-columns: minmax(0, 1fr) minmax(130px, max-content);
  margin-bottom: 8px;
}

.schedule-editor label {
  margin-top: 0;
}

.schedule-editor textarea {
  min-height: 190px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.asset-regeneration {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid oklch(79% 0.02 82);
}

.asset-regeneration legend {
  padding: 0 0 8px;
  color: oklch(31% 0.035 76);
  font-size: 0.86rem;
  font-weight: 800;
}

.asset-regeneration label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-weight: 650;
}

.asset-regeneration input {
  width: auto;
  margin: 0;
}

.player {
  padding: 26px 0;
}

audio {
  width: 100%;
}

#status {
  margin-top: 10px;
  color: oklch(38% 0.025 82);
}

.chapter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chapter-controls button {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.export-link {
  display: inline-block;
  margin-top: 14px;
  color: oklch(25% 0.055 72);
  font-weight: 750;
  text-underline-offset: 3px;
}

.progress-panel {
  margin-top: 16px;
  border: 1px solid oklch(72% 0.02 82);
  border-radius: 6px;
  padding: 12px;
  background: oklch(90% 0.018 82);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-header span {
  color: oklch(40% 0.03 82);
  font-size: 0.9rem;
  font-style: italic;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: oklch(80% 0.02 82);
}

.progress-bar {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: oklch(43% 0.085 58);
  transition: width 220ms ease-out;
}

.progress-detail,
.generation-cost {
  margin: 10px 0 0;
  color: oklch(34% 0.03 82);
  font-size: 0.9rem;
}

#cancel-generation {
  margin-top: 12px;
  background: oklch(91% 0.02 82);
  color: oklch(26% 0.04 72);
}

.rundown {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  border-top: 1px solid oklch(77% 0.025 82);
  padding-top: 24px;
}

.muted {
  color: oklch(42% 0.025 82);
  font-size: 0.9rem;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.article-row {
  display: grid;
  grid-template-columns: 34px minmax(18rem, 1fr) minmax(264px, max-content);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid oklch(80% 0.02 82);
}

.article-position {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: oklch(86% 0.025 82);
  color: oklch(34% 0.04 76);
  font-weight: 800;
  font-size: 0.82rem;
}

.article-details a {
  color: oklch(25% 0.055 72);
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.article-details {
  min-width: 0;
}

.article-details p {
  margin: 6px 0 0;
  color: oklch(42% 0.025 82);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.article-controls {
  display: grid;
  grid-template-columns: minmax(86px, max-content) repeat(3, minmax(64px, max-content));
  gap: 6px;
  justify-content: flex-end;
}

.article-controls button,
.article-coverage {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.article-coverage {
  min-width: 78px;
  width: auto;
  border: 1px solid oklch(66% 0.025 82);
  border-radius: 6px;
  background: oklch(96% 0.01 82);
  color: oklch(29% 0.035 76);
}

.empty-row {
  color: oklch(42% 0.025 82);
  list-style: none;
}

.script-panel {
  border-top: 1px solid oklch(77% 0.025 82);
  padding-top: 24px;
  margin-top: 28px;
}

.script-panel p {
  max-width: 62ch;
  color: oklch(38% 0.025 82);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: oklch(88% 0.018 82);
  border: 1px solid oklch(72% 0.02 82);
  border-radius: 6px;
  padding: 16px;
  max-height: 520px;
  overflow: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

ol {
  padding-left: 20px;
}

li + li {
  margin-top: 10px;
}

.error {
  color: oklch(42% 0.18 32);
  font-weight: 700;
}

@media (max-width: 980px) {
  .episode-tools {
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  }

  .article-management {
    grid-column: 1 / -1;
  }

  .article-actions {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .article-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .article-controls {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .stage,
  .episode-tools,
  .rundown {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-controls {
    grid-template-columns: 1fr;
  }

  .article-actions {
    grid-template-columns: 1fr;
  }

  .article-actions button {
    min-height: 44px;
  }

  .asset-regeneration button {
    width: 100%;
  }

  .article-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
  }

  .article-controls {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .article-controls button,
  .article-coverage {
    width: 100%;
  }

  .shell {
    padding-inline: 14px;
  }
}
