:root {
  color-scheme: light;
  --page: #f5f6f7;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --surface-strong: #eef0f3;
  --ink: #24272c;
  --muted: #6f7580;
  --faint: #9ba1aa;
  --border: #dcdfe4;
  --border-strong: #c9cdd4;
  --accent: #f15a24;
  --accent-soft: #fff0e9;
  --player-accent: #5b5cf0;
  --danger: #b42318;
  --success: #168052;
  --header-height: 112px;
  --parameters-width: 318px;
  --player-height: 86px;
  --radius: 12px;
  --radius-lg: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1117;
  --surface: #151b24;
  --surface-muted: #1b222d;
  --surface-strong: #232c38;
  --ink: #f0f3f7;
  --muted: #aab2bf;
  --faint: #7d8795;
  --border: #303947;
  --border-strong: #424d5e;
  --accent-soft: #3a2118;
  --success: #35b982;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
select,
input[type="range"],
input[type="file"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
}

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

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.3;
}

h3 {
  font-size: 0.9rem;
}

[hidden],
.is-hidden {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(241 90 36 / 25%);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  color: white;
  background: #20242b;
  border-radius: var(--radius);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.studio-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: var(--header-height);
  display: grid;
  grid-template-rows: 58px 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
}

.brand-header__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand__brain {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand__wordmark {
  width: 105px;
  height: auto;
  object-fit: contain;
  filter: brightness(0);
}

:root[data-theme="dark"] .brand__brain,
:root[data-theme="dark"] .brand__wordmark {
  filter: brightness(0) invert(1);
}

.brand-header__divider {
  width: 1px;
  height: 24px;
  flex: 0 0 auto;
  background: var(--border-strong);
}

.brand-header__intro {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.header-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.header-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

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

.header-action--credits strong {
  min-width: 12px;
  font-variant-numeric: tabular-nums;
}

.header-action__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.header-action--icon {
  width: 34px;
  padding: 0;
}

.credit-gem {
  width: 13px;
  height: 13px;
  display: inline-block;
  border: 2px solid var(--player-accent);
  transform: rotate(45deg);
}

.video-editor-symbol {
  position: relative;
  width: 16px;
  height: 12px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.video-editor-symbol::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid currentColor;
  transform: translate(-35%, -50%);
}

.theme-symbol {
  font-size: 18px;
  line-height: 1;
}

.account-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.account-symbol::before {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  content: "";
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
}

.account-symbol::after {
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  height: 5px;
  content: "";
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.workspace-tabs {
  min-height: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}

.workspace-tabs__list {
  display: grid;
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  min-width: 896px;
  min-height: 53px;
}

.workspace-tab {
  width: 100%;
  min-height: 53px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 10px 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-align: center;
  white-space: nowrap;
}

.workspace-tab:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

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

.workspace-tab__index {
  color: var(--faint);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.workspace-tab[aria-selected="true"] .workspace-tab__index {
  color: var(--accent);
}

.studio-frame {
  min-height: calc(100vh - var(--player-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--parameters-width);
  padding-top: var(--header-height);
  padding-bottom: var(--player-height);
}

.studio-frame[data-parameters-hidden="true"] {
  grid-template-columns: minmax(0, 1fr);
}

.studio-content {
  min-width: 0;
  padding: 25px;
}

.workspace-view {
  min-width: 0;
  max-width: 1450px;
  margin: 0 auto;
}

.view-header {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.view-header--workflow {
  grid-template-columns: minmax(300px, 0.82fr) minmax(470px, 1.35fr);
  align-items: start;
  padding: 0 0 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.view-header__intro {
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: 5px 0;
}

.view-header__copy {
  min-width: 0;
}

.view-header p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.eyebrow,
.section-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.view-chip,
.status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.podcast-workspace {
  display: grid;
  grid-template-columns: minmax(290px, 0.68fr) minmax(540px, 1.5fr);
  gap: 18px;
  align-items: start;
}

.two-column-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(470px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.podcast-intro {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.podcast-intro h1 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

.podcast-intro p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.library-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.collection-switch {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.collection-switch button {
  flex: 1 1 0;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
}

.collection-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--border);
}

.character-profiles {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.character-profiles__intro {
  max-width: 850px;
  margin: -4px 0 14px;
}

.workspace-column {
  min-width: 0;
  display: grid;
  gap: 15px;
}

.workspace-column--wide {
  align-content: start;
}

.section-block,
.filter-panel {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
}

.section-block--spaced {
  margin-top: 18px;
}

.filter-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 13px;
}

.section-heading {
  min-height: 35px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -1px -1px 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.field,
.range-field,
.parameter-control {
  min-width: 0;
}

.field {
  display: grid;
  gap: 5px;
}

.field--stacked {
  margin-bottom: 13px;
}

.field--grow {
  min-width: 130px;
}

.field > span,
.range-field > span,
.parameter-control > span {
  font-size: 0.8rem;
  font-weight: 600;
}

.field em {
  color: var(--accent);
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 700;
}

.field span small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
.library-toolbar input,
.library-toolbar select,
.history-toolbar input,
.transcript-row select,
.transcript-row textarea {
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.field textarea,
.transcript-row textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.library-toolbar input:focus,
.history-toolbar input:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(241 90 36 / 12%);
}

.field > small,
.help-text,
.parameter-control small {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.field-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 13px;
}

.field-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.range-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.range-field > span,
.parameter-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-field output,
.parameter-control output {
  min-width: 44px;
  padding: 2px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-field small {
  color: var(--muted);
  font-size: 0.67rem;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.check-field input {
  accent-color: var(--accent);
}

.check-field--boxed {
  width: 100%;
  align-items: flex-start;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.check-field--boxed span {
  display: grid;
  gap: 2px;
}

.check-field--boxed small {
  color: var(--muted);
}

#tts-studio-faq .disclosure {
  margin-bottom: 10px;
}



.section-block--collapsible:hover {
  border-color: var(--border-strong);
}

.section-block--collapsible > .section-heading--summary {
  margin: 0;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  border-bottom: 0;
  user-select: none;
}

.section-block--collapsible > .section-heading--summary::-webkit-details-marker {
  display: none;
}

.section-block--collapsible > .section-heading--summary::after {
  content: "";
  flex: 0 0 auto;
  align-self: center;
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.section-block--collapsible[open] > .section-heading--summary::after {
  transform: rotate(225deg);
}

.section-block--collapsible:not([open]) > .section-heading--summary {
  padding-bottom: 16px;
}

.section-block--collapsible[open] > .section-heading--summary {
  border-bottom: 1px solid var(--border);
}

.section-block--collapsible > .section-block__body {
  padding: 16px 20px 20px;
}

/* ===== Podcast middle column · hero episode card ===== */
.section-block--hero {
  position: relative;
  border-top: 3px solid var(--accent);
}

.section-block--hero .audio-output {
  min-height: 96px;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--player-accent) 9%, var(--surface)), var(--surface-muted));
  border-color: color-mix(in srgb, var(--player-accent) 30%, var(--border));
}

.section-block--hero .audio-output__icon {
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
}

.section-block--hero .audio-output strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.section-block--hero .audio-output small {
  font-size: 0.76rem;
}

.section-block--hero .disclosure {
  margin-top: 12px;
}

/* Script accordion readability */
.section-block--collapsible .draft-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.section-block--collapsible .content-placeholder {
  min-height: 110px;
  padding: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.section-block--collapsible .content-placeholder span {
  color: var(--muted);
}

.section-block--collapsible .draft-grid {
  margin-bottom: 0;
}

.disclosure,
.parameter-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(16 24 40 / 3%);
}

.disclosure > summary,
.parameter-group > summary {
  padding: 13px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
}

.disclosure > summary::-webkit-details-marker,
.parameter-group > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 700;
}

.disclosure[open] > summary::after {
  content: "–";
}

.disclosure__body {
  padding: 0 15px 15px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 5px;
}

.button {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button--small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.68rem;
}

.button--full {
  width: 100%;
}

.button--primary {
  color: white;
  background: #30343a;
  border-color: #30343a;
}

.button--primary:hover {
  background: #1f2227;
}

.button--secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border-strong);
}

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

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

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  filter: brightness(0.97);
}

.button:disabled,
.icon-button:disabled {
  color: var(--faint);
  background: var(--surface-strong);
  border-color: var(--border);
  opacity: 0.8;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row--end {
  justify-content: flex-end;
  margin-bottom: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border-strong);
}

.speaker-list {
  display: grid;
  gap: 8px;
  margin-bottom: 13px;
}

.speaker-row {
  display: grid;
  grid-template-columns: 24px minmax(80px, 0.65fr) minmax(130px, 1.3fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.speaker-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  align-self: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.67rem;
  font-weight: 750;
}

.workflow-progress {
  grid-column: 2;
  width: 100%;
  max-width: none;
  margin: 0 0 0 auto;
  padding: 13px 16px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.workflow-progress-slot {
  min-width: 0;
  margin-bottom: 18px;
}

.workflow-progress-slot .workflow-progress {
  grid-column: auto;
  margin: 0;
  padding-top: 0;
}

.workflow-progress__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.workflow-progress__heading h2 {
  font-size: 0.78rem;
}

.workflow-progress__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.65rem;
  margin-top: 8px;
}

.workflow-progress__track {
  padding: 12px 0 6px;
}

.workflow-progress__status span:last-child {
  flex: 0 0 auto;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 6px 0 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pipeline li {
  min-width: 92px;
  flex: 1 1 0;
  display: flex;
  align-items: flex-start;
  color: var(--faint);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pipeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0 auto;
  text-align: center;
}

.pipeline__circle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
}

.pipeline__label {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline__connector {
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 14px 2px 0;
  color: var(--border-strong);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.workflow-progress__bar {
  height: 6px;
  margin-top: 12px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.workflow-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.pipeline li[data-state="current"] {
  color: var(--ink);
}

.pipeline li[data-state="current"] .pipeline__circle {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pipeline li[data-state="current"] .pipeline__connector {
  color: var(--accent);
}

.pipeline li[data-state="complete"] {
  color: var(--muted);
}

.pipeline li[data-state="complete"] .pipeline__circle {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.pipeline li[data-state="complete"] .pipeline__connector {
  color: var(--accent);
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.progress-row progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}

.progress-row output {
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
}

.draft-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.25fr);
  gap: 12px;
  margin-bottom: 12px;
}

.draft-panel {
  min-width: 0;
  padding: 11px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.draft-panel h3 {
  margin-bottom: 9px;
}

.content-placeholder {
  min-height: 120px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 18px;
  color: var(--faint);
  text-align: center;
}

.content-placeholder--large {
  min-height: 220px;
}

.content-placeholder span {
  margin-bottom: 6px;
  font-weight: 800;
}

.content-placeholder p {
  margin-bottom: 0;
}

.generated-outline,
.generated-transcript {
  display: grid;
  gap: 8px;
}

.generated-outline p,
.generated-transcript p {
  margin: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.generated-transcript strong {
  color: var(--accent);
}

.transcript-editor {
  display: grid;
  gap: 8px;
}

.transcript-row {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 8px;
}

.audio-output {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.audio-output__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--player-accent);
  background: color-mix(in srgb, var(--player-accent) 13%, var(--surface));
  border-radius: 6px;
  font-size: 1.1rem;
}

.audio-output strong,
.audio-output small {
  display: block;
}

.audio-output small {
  margin-top: 2px;
}

.history-toolbar,
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.history-toolbar input,
.library-toolbar input {
  flex: 1;
}

.library-toolbar select {
  width: auto;
  min-width: 140px;
}

.upload-zone {
  min-height: 128px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 17px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
}

.upload-zone[data-dragging="true"] {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone__icon {
  font-size: 1.35rem;
}

.upload-zone small {
  color: var(--faint);
}

.browser-recorder {
  display: grid;
  gap: 11px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.browser-recorder__heading,
.browser-recorder__transport,
.browser-recorder__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browser-recorder__heading h3 {
  margin: 2px 0 0;
  font-size: 0.86rem;
}

.browser-recorder__setup {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.browser-recorder__setup .field {
  margin: 0;
}

.browser-recorder__timer {
  min-width: 64px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.browser-recorder__controls {
  justify-content: flex-end;
}

.browser-recorder__result {
  padding: 9px 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.browser-recorder__result strong,
.browser-recorder__result small {
  display: block;
}

.browser-recorder__result small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
}

.browser-recorder[data-state="recording"] .status-badge,
.browser-recorder[data-state="recording"] .browser-recorder__timer {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}

.browser-recorder[data-state="error"] .status-badge,
.browser-recorder[data-state="unsupported"] .status-badge {
  color: var(--danger);
}

.sample-analysis {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sample-analysis strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.sample-analysis p,
.sample-analysis ul {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
}

.sample-analysis ul {
  padding-left: 17px;
}

.example-list {
  display: grid;
  gap: 6px;
}

.example-list strong {
  font-size: 0.72rem;
}

.example-list button {
  padding: 8px 9px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: left;
}

.voice-card-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.voice-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.voice-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgb(16 24 40 / 7%);
}

.voice-card--custom {
  border-color: var(--player-accent);
  box-shadow: inset 3px 0 var(--player-accent);
}

.voice-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--player-accent) 13%, var(--surface));
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}

.voice-card h3,
.voice-card p {
  margin-bottom: 3px;
}

.voice-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.voice-card p {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-row span {
  padding: 2px 5px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.6rem;
}

.project-card {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgb(16 24 40 / 7%);
}

.project-card__meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.project-card h2,
.project-card h3 {
  margin-bottom: 2px;
  font-size: 1rem;
  line-height: 1.3;
}

.project-card p {
  flex: 1;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.project-card--new {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--surface-muted);
  border-style: dashed;
  text-align: center;
}

.data-table {
  min-width: 720px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-block:has(.data-table) {
  overflow-x: auto;
}

.data-table__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 1fr) 80px 120px 116px;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 8px 11px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.data-table__row:last-child {
  border-bottom: 0;
}

.data-table__head {
  min-height: 37px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table__row strong,
.data-table__row small {
  display: block;
}

.data-table__row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 4px;
}

.compact-table__empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--faint);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.parameters-panel {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--player-height) - var(--header-height));
  align-self: start;
  padding: 15px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

.parameters-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  padding: 2px 1px 12px;
  border-bottom: 1px solid var(--border);
}

.save-indicator {
  padding: 3px 6px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 4px;
  font-size: 0.62rem;
}

.save-indicator[data-state="saving"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.parameter-section {
  margin-bottom: 12px;
  padding: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.parameter-section__title,
.parameter-subheading {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.preset-stack {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.preset-stack button {
  min-height: 34px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.preset-stack button[aria-pressed="true"] {
  color: #b33c11;
  background: var(--accent-soft);
  border-color: #f6aa8e;
  font-weight: 750;
}

.parameter-group {
  margin-bottom: 10px;
  background: var(--surface);
}

.parameter-group__body {
  display: grid;
  gap: 13px;
  padding: 11px;
  border-top: 1px solid var(--border);
}

.parameter-control {
  display: grid;
  gap: 5px;
}

.parameter-control input {
  accent-color: var(--accent);
}

.audio-dock {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: var(--player-height);
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(340px, 1.5fr) minmax(220px, 0.7fr);
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -5px 18px rgb(25 28 33 / 5%);
}

.audio-dock__track,
.audio-dock__transport,
.audio-dock__actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-dock__track strong,
.audio-dock__track small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-dock__track small {
  color: var(--muted);
}

.audio-dock__art {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--player-accent);
  background: color-mix(in srgb, var(--player-accent) 13%, var(--surface));
  border-radius: 6px;
  font-size: 1.15rem;
}

.audio-dock__transport {
  justify-content: center;
}

.audio-dock__progress {
  width: 100%;
  accent-color: var(--player-accent);
}

.audio-dock__actions {
  justify-content: flex-end;
}

.time {
  min-width: 34px;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
}

.volume-control input {
  width: 75px;
  accent-color: var(--player-accent);
}

.app-dialog {
  width: min(450px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgb(20 23 28 / 20%);
}

.app-dialog::backdrop {
  background: rgb(20 23 28 / 55%);
}

.app-dialog__surface {
  padding: 18px;
}

.app-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.app-dialog__surface > p {
  margin-bottom: 16px;
  color: var(--muted);
}

.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 15px;
  bottom: calc(var(--player-height) + 15px);
  width: min(350px, calc(100vw - 30px));
  display: grid;
  gap: 7px;
}

.toast {
  padding: 10px 13px;
  color: white;
  background: #2c3036;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(20 23 28 / 18%);
}

.toast[data-tone="success"] {
  background: var(--success);
}

.toast[data-tone="error"] {
  background: var(--danger);
}

.loading-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: white;
  background: rgb(20 23 28 / 55%);
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgb(255 255 255 / 35%);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

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

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-to-grid li {
  min-width: 0;
  padding: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.how-to-grid li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
}

.how-to-grid li > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.how-to-grid h3 {
  margin: 2px 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.how-to-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

@media (max-width: 1300px) {
  :root {
    --parameters-width: 290px;
  }

  .podcast-workspace,
  .two-column-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-panel {
    position: static;
  }

  .how-to-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .studio-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .parameters-panel {
    position: static;
    height: auto;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .parameter-section,
  .parameter-group {
    max-width: 720px;
  }

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

@media (max-width: 800px) {
  .view-header--workflow {
    grid-template-columns: minmax(0, 1fr);
  }

  .view-header--workflow .workflow-progress {
    grid-column: 1;
    margin: 0;
  }

  :root {
    --header-height: 104px;
    --player-height: 116px;
  }

  .studio-header {
    grid-template-rows: 52px 52px;
  }

  .brand-header {
    gap: 12px;
    padding: 0 14px;
  }

  .brand-header__identity {
    gap: 10px;
  }

  .brand-header__divider,
  .brand-header__intro,
  .header-action__label {
    display: none;
  }

  .header-action--credits {
    min-width: 46px;
    padding: 0 9px;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tabs__list {
    min-height: 51px;
  }

  .studio-frame {
    min-height: 0;
  }

  .studio-content {
    padding: 18px 14px;
  }

  .library-workspace,
  .draft-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-grid--two,
  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .browser-recorder__setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .browser-recorder__transport {
    align-items: flex-start;
    flex-direction: column;
  }

  .browser-recorder__controls {
    justify-content: flex-start;
  }

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

  .speaker-row .field:first-of-type {
    grid-column: 2;
  }

  .speaker-row .field--grow {
    grid-column: 2;
  }

  .speaker-row .icon-button {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .workflow-progress__status {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .pipeline li {
    min-width: 78px;
  }

  .pipeline__circle {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .pipeline__connector {
    margin-top: 11px;
  }

  .audio-dock {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 9px 14px;
  }

  .audio-dock__actions {
    display: none;
  }

  .audio-dock__track small {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-header {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .brand__brain {
    width: 30px;
    height: 30px;
  }

  .brand__wordmark {
    width: 92px;
  }

  .header-actions {
    gap: 5px;
  }

  .header-action--icon {
    width: 32px;
  }

  .how-to-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .view-header {
    display: grid;
  }

  .view-header > .button {
    width: 100%;
  }

  .history-toolbar,
  .library-toolbar,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .browser-recorder__heading,
  .browser-recorder__result {
    align-items: stretch;
    flex-direction: column;
  }

  .browser-recorder__result .button {
    width: 100%;
  }

  .library-toolbar select {
    width: 100%;
  }

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

  .app-dialog__actions {
    flex-direction: column-reverse;
  }

  .app-dialog__actions .button {
    width: 100%;
  }
}

/* ===== Milestone 3 · voice picker ===== */

.voice-picker {
  min-width: 0;
}

.voice-picker__trigger {
  width: 100%;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
}

.voice-picker__trigger:hover {
  border-color: var(--muted);
}

.voice-picker__trigger:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgb(241 90 36 / 12%);
}

.voice-picker__trigger .voice-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  font-size: 0.58rem;
}

.voice-picker__meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.voice-picker__meta strong {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-picker__meta small {
  color: var(--muted);
  font-size: 0.65rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-picker__placeholder {
  color: var(--faint);
  font-size: 0.76rem;
}

.voice-picker__badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-picker__badge[data-state="playing"] {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.voice-picker__badge[data-state="loading"] {
  color: var(--muted);
  background: var(--surface-muted);
}

.voice-picker__badge[data-state="stopped"] {
  color: var(--muted);
  background: var(--surface-muted);
}

.voice-picker__badge[data-state="unavailable"],
.voice-picker__badge[data-state="failed"] {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.voice-picker-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 64px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgb(20 23 28 / 20%);
}

.voice-picker-dialog::backdrop {
  background: rgb(20 23 28 / 55%);
}

.voice-picker-dialog__surface {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  padding: 18px;
}

.voice-picker-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.voice-picker-dialog__header h2 {
  font-size: 0.96rem;
}

.voice-picker-dialog__toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.voice-picker-dialog__toolbar input[type="search"] {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.voice-picker-dialog__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-picker-dialog__filters select {
  flex: 1 1 110px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
}

.voice-picker-dialog__list {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: 380px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 2px;
}

.voice-picker-dialog__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.voice-picker-dialog__row:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

.voice-picker-dialog__row[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.voice-picker-dialog__row[data-unavailable="true"] {
  opacity: 0.62;
}

.voice-picker-dialog__row .voice-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.voice-picker-dialog__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-picker-dialog__meta strong {
  font-size: 0.8rem;
}

.voice-picker-dialog__meta small {
  color: var(--muted);
  font-size: 0.66rem;
}

.voice-picker__favorite[aria-pressed="true"] {
  color: var(--accent);
}

.voice-picker-dialog__status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.voice-picker-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.field.is-disabled {
  opacity: 0.6;
}

.capability-note {
  color: var(--muted);
  font-size: 0.66rem;
}

/* ===== Milestone 3 · companion usability imports ===== */

.char-count--warning {
  color: var(--accent);
  font-weight: 700;
}

.char-count--error {
  color: var(--danger);
  font-weight: 700;
}

.speaker-summary {
  margin: 8px 0 12px;
  font-size: 0.72rem;
  color: var(--muted);
}

.speaker-summary[data-tone="success"] {
  color: var(--success);
  font-weight: 700;
}

.workflow-progress__error {
  margin: 10px 0 0;
  padding: 8px 10px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  border-radius: 6px;
  font-size: 0.72rem;
}

@media (max-width: 800px) {
  .voice-picker-dialog__surface {
    padding: 14px;
  }

  .voice-picker-dialog__actions {
    flex-direction: column-reverse;
  }

  .voice-picker-dialog__actions .button {
    width: 100%;
  }
}

/* ===== Milestone 4 · voiceover script-block editor ===== */

.script-editor__list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.script-block {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.script-block[data-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.script-block__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border);
}

.script-block__order {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 800;
}

.script-block__reorder {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.script-block__reorder .icon-button {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  padding: 0;
}

.script-block__body {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.script-block__voice .voice-picker__trigger {
  min-height: 34px;
  background: var(--surface);
}

.script-block__text {
  width: 100%;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.script-block__text:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(241 90 36 / 12%);
}

.script-block__meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.script-block[data-status="failed"] {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.script-block[data-status="complete"] .script-block__order {
  color: var(--success);
  border-color: var(--success);
}

.status-badge[data-status="complete"],
.status-badge[data-status="approved"] {
  color: var(--success);
}

.status-badge[data-status="failed"] {
  color: var(--danger);
}

.status-badge[data-status="running"],
.status-badge[data-status="queued"] {
  color: var(--accent);
}

.script-editor__generate {
  margin-top: 4px;
}

.script-editor__totals {
  margin: 10px 0 12px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.script-editor__empty {
  padding: 22px;
}

.content-placeholder .steps-hint {
  justify-content: center;
  margin-top: 12px;
}

.take-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.take-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.take-row[data-preferred="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.take-row__label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
}

.take-row__star {
  color: var(--muted);
}

.take-row[data-preferred="true"] .take-row__star {
  color: var(--accent);
}

/* ===== UX pass · waveforms, guided steps, shortcuts, compare, recent ===== */

.waveform {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 34px;
  margin-top: 10px;
  padding: 0 2px;
}

.waveform i {
  flex: 1 1 0;
  min-width: 2px;
  background: linear-gradient(to top, var(--player-accent), color-mix(in srgb, var(--player-accent) 45%, transparent));
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

.steps-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.steps-hint li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.steps-hint li span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
}

.recent-projects {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.recent-projects__label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.recent-projects__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-project-chip {
  display: grid;
  gap: 1px;
  padding: 8px 13px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.recent-project-chip:hover {
  border-color: var(--accent);
}

.recent-project-chip strong {
  font-size: 0.8rem;
}

.recent-project-chip small {
  color: var(--muted);
  font-size: 0.68rem;
}

.voice-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.take-row__qa {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
}

.take-row__qa[data-qa="94"],
.take-row__qa[data-qa="95"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.take-row__slots {
  display: flex;
  gap: 4px;
}

.take-slot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 800;
}

.take-slot[data-active="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.compare-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 8px;
  font-size: 0.76rem;
}

/* ===== Milestone 5 · voice design variants and profiles ===== */

.variant-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.variant-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.variant-card:hover {
  border-color: var(--border-strong);
}

.variant-card[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.variant-card__info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.variant-card__info strong {
  font-size: 0.8rem;
}

.variant-card__info small {
  color: var(--muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.persona-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
}

.persona-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.persona-card__header h3 {
  margin: 0;
  font-size: 0.92rem;
}

.persona-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.persona-card__actions {
  display: flex;
  gap: 6px;
}

.voice-manager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-strong);
}

/* ===== Milestone 6 · staged podcast production editor ===== */

.stage-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stage-bar [data-podcast-stage][data-state="done"] {
  color: var(--success);
  border-color: var(--success);
}

.stage-bar [data-podcast-stage][data-state="current"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.production-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 12px;
  margin-bottom: 12px;
}

.prod-panel {
  min-width: 0;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prod-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.prod-panel__head h3 {
  margin: 0;
  font-size: 0.85rem;
}

.outline-editor,
.dialogue-editor {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow-y: auto;
}

.outline-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.outline-row__order {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
}

.outline-row input[type="text"] {
  min-width: 0;
  padding: 5px 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.78rem;
}

.outline-row input[type="text"]:hover,
.outline-row input[type="text"]:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

.outline-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.outline-row__actions,
.dialogue-row__actions {
  display: flex;
  gap: 3px;
}

.dialogue-row {
  display: grid;
  grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) minmax(110px, 150px) auto auto;
  align-items: start;
  gap: 7px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.dialogue-row[data-selected="true"] {
  border-color: var(--accent);
}

.dialogue-row select {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 0.72rem;
}

.dialogue-row textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
}

.dialogue-row textarea:hover,
.dialogue-row textarea:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

.dialogue-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.dialogue-row__delivery {
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  font-size: 0.68rem;
}

.dialogue-row__delivery:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
}

.dialogue-row__meta {
  align-self: center;
  color: var(--muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.speaker-tracks {
  margin-top: 10px;
}

.speaker-tracks[hidden] {
  display: none !important;
}

.speaker-tracks__label {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

  .stage-bar,

  .dialogue-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dialogue-row select,
  .dialogue-row__delivery {
    grid-column: 1 / -1;
  }
}

/* ===== Milestone 7 · projects, history, export dialog, handoff ===== */

.project-card[data-archived="true"] {
  opacity: 0.7;
}

.history-summary {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.data-table__row[data-job-status="failed"] strong {
  color: var(--danger);
}

.data-table__row[data-job-status="cancelled"] small {
  color: var(--accent);
}

.revision-list {
  display: grid;
  gap: 7px;
}

.revision-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.revision-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.revision-row strong {
  font-size: 0.8rem;
}

.revision-row small {
  color: var(--muted);
  font-size: 0.68rem;
}

.export-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 64px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 50px rgb(20 23 28 / 22%);
}

.export-dialog::backdrop {
  background: rgb(20 23 28 / 55%);
}

.export-dialog__surface {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.export-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.export-dialog__header h2 {
  margin: 0;
  font-size: 1rem;
}

.export-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-formats .check-field {
  padding: 7px 11px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.export-dialog__status {
  min-height: 1.1em;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.artifact-list {
  display: grid;
  gap: 6px;
}

.artifact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

a.button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.export-dialog__divider {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--border);
}


/* ===== Voice Design recipe builder ===== */

.recipe-group {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 8px;
}

.recipe-group:last-child {
  margin-bottom: 0;
}

.recipe-group__label {
  padding-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recipe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recipe-chips button {
  padding: 4px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.recipe-chips button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}


/* ===== Milestone 8 · PHP auth modal (FormModal pattern) ===== */

.am-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(20 23 28 / 62%);
}

.am-backdrop.hidden {
  display: none;
}

.am-modal {
  position: relative;
  width: min(860px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgb(0 0 0 / 30%);
}

.am-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}

.am-form-container {
  display: none;
  max-height: inherit;
  padding: 26px;
  overflow-y: auto;
}

.am-modal:not(.active) .am-signin,
.am-modal.active .am-signup {
  display: block;
}

.am-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.am-subtitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.am-divider {
  height: 1px;
  margin-bottom: 14px;
  background: var(--border);
}

.am-group {
  margin-bottom: 12px;
}

.am-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.74rem;
  font-weight: 700;
}

.am-input,
.am-input-wrap input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.85rem;
}

.am-input:focus {
  outline: none;
  border-color: var(--accent);
}

.am-input.am-invalid {
  border-color: var(--danger);
}

.am-input-wrap {
  position: relative;
}

.am-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 3px 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 0.68rem;
  cursor: pointer;
}

.am-error {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 0.7rem;
}

.am-submit {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.am-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.am-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 40%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: am-spin 0.8s linear infinite;
}

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

.am-footer-link {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.am-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.am-toggle-container {
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--accent);
}

.am-toggle {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.4s ease;
}

.am-modal.active .am-toggle {
  transform: translateX(-50%);
}

.am-toggle-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #fff;
}

.am-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.am-feature-box {
  display: grid;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.am-feature-list {
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  gap: 8px;
}

.am-toggle-btn {
  align-self: start;
  padding: 9px 16px;
  color: var(--accent);
  background: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 760px) {
  .am-modal {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-toggle-container {
    display: none;
  }
}

/* Op argument validation - highlight the offending field */
.op-field-error,
.op-field-error .voice-picker__trigger,
.op-field-error textarea,
.op-field-error input,
.op-field-error select {
  border-color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 7%, transparent) !important;
}
