
:root {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  --accent: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

body[data-theme='light'] {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --surface: #f1f5f9;
  --surface-strong: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --chip-bg: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1220;
  --card: #111827;
  --surface: #0b1324;
  --surface-strong: #0d1426;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1f2937;
  --chip-bg: rgba(255, 255, 255, 0.05);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, rgba(34, 197, 94, 0.12), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.1), transparent 45%),
    var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.hero {
  padding: 48px 24px 24px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__content {
  flex: 1 1 360px;
}

.theme-toggle {
  align-self: flex-start;
  white-space: nowrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 36px);
}

.lede {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  gap: 18px;
}

.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h2 { margin: 0 0 12px; }

.card h3 { margin: 0 0 12px; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.field span { font-size: 14px; }

.field input,
.field textarea,
.field select {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}

.field textarea { min-height: 100px; resize: vertical; }

.field--wide { grid-column: 1 / -1; }
.ivoox-actions {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.ivoox-actions__buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.semaphore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.semaphore::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.semaphore--idle::before { background: var(--danger); }
.semaphore--working::before { background: var(--warning); }
.semaphore--ready::before { background: var(--accent); }

.upload {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.saved-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
}

.saved-row__controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.saved-row__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.select {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-width: 220px;
}

.file-label {
  position: relative;
  overflow: hidden;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.file-label input { display: none; }

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-groups {
  display: grid;
  gap: 18px;
}

.settings-group {
  display: grid;
  gap: 14px;
}

.settings-field {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.settings-meta {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

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

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tts-playground {
  gap: 16px;
}

.tts-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    var(--surface);
}

.tts-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tts-panel__header h3 {
  margin: 0;
  font-size: 18px;
}

.tts-control-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tts-speakers-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tts-speaker-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  min-height: 190px;
}

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

.tts-speaker-card h3 {
  margin: 0;
  font-size: 16px;
}

.tts-speaker-card input[type="file"] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--surface);
}

.tts-speaker-card__action {
  width: 100%;
  justify-content: center;
}

.tts-mode-switch {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.tts-mode-switch legend {
  padding: 0 6px;
  font-weight: 600;
}

.tts-mode-switch__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.tts-mode-switch__option input {
  margin: 0;
}

.tts-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.tts-action-bar__group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tts-result-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.tts-result-audio {
  width: 100%;
  margin-bottom: 0.75rem;
}

@media (max-width: 760px) {
  .tts-action-bar {
    align-items: stretch;
  }

  .tts-action-bar__group {
    width: 100%;
  }

  .tts-action-bar__group .btn {
    flex: 1 1 180px;
  }
}

.btn:hover:not(:disabled) { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  border: none;
  color: #0b1220;
}

.btn--ghost { border-style: dashed; }
.btn--danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  border: none;
  color: #0b1220;
}

.quote-playlist {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.quote-playlist__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quote-playlist__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-playlist__player {
  width: 100%;
}

.quote-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.quote-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: grid;
  gap: 8px;
}

.quote-item__title {
  font-weight: 600;
}

.quote-item__meta {
  font-size: 13px;
  color: var(--muted);
}

.quote-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-name { color: var(--muted); margin: 6px 0 0; }

#job-create-status {
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.job-create-status--error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  padding: 10px 12px;
}

.job-create-status--success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 12px;
}
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.hint--error { color: var(--danger); }

.field--error span {
  color: var(--danger);
}

.field--error input,
.field--error textarea,
.field--error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}

.progress {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress__label {
  font-size: 0.9rem;
  color: var(--text);
}

.progress__track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #f37335 0%, #fdc830 100%);
  width: 0%;
  transition: width 180ms ease-out;
}

.actions .buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 600px;
  width: min(600px, 90vw);
  color: var(--text);
}

.modal--access {
  max-width: 420px;
  width: min(420px, 92vw);
}

.modal--fullscreen {
  max-width: 70vw;
  width: 70vw;
  max-height: 90vh;
  height: 90vh;
}

.modal--fullscreen .modal__body {
  max-height: 90vh;
  overflow-y: auto;
}

.modal::backdrop { background: rgba(0, 0, 0, 0.65); }

.modal--scrollable .modal__body {
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 14px;
}

.modal__body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__header { margin-bottom: 6px; }
.modal__header h3 { margin: 0; }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.prompt-card h4 {
  margin: 0;
  font-size: 15px;
}

.prompt-card small {
  color: var(--muted);
}

.script-output {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
  width: 100%;
  max-width: 100%;
}

.notifications {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100% - 32px));
  z-index: 10;
}

.notification {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  align-items: center;
}

.notification__icon {
  font-size: 18px;
}

.notification__text {
  margin: 0;
  line-height: 1.4;
}

.notification__close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

.notification__close:hover {
  color: var(--text);
}

.notification--success {
  border-color: #22c55e44;
}

.notification--error {
  border-color: #ef444444;
}

.notification--info {
  border-color: #3b82f644;
}

.steps-list {
  display: grid;
  gap: 14px;
}

.steps-cost-summary {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.steps-cost-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.steps-cost-summary__grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.steps-cost-summary__grid strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.steps-cost-summary__meta {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.step-sessions {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 16px;
}

.step-sessions__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-sessions input,
.step-sessions select {
  width: 100%;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}

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

.step-card__title {
  margin: 0;
  font-size: 16px;
}

.step-card__meta {
  color: var(--muted);
}

.step-card__columns {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.step-cost {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--card);
}

.step-cost__placeholder {
  font-size: 13px;
  color: var(--muted);
}

.step-cost__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.step-cost__grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-cost__grid strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.step-cost__grid span {
  font-size: 13px;
  color: var(--text);
}

.step-cost__meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.step-context {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--card);
}

.step-context__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.step-context__grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-context__grid strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.step-context__grid span {
  font-size: 13px;
}

.step-context__ok {
  color: var(--accent);
}

.step-context__pending {
  color: var(--warning);
}

.step-card textarea {
  min-height: 180px;
  resize: vertical;
}

.context-viewer {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.context-viewer__textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.step-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.step-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.step-label small {
  color: var(--muted);
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--chip-bg);
  color: var(--muted);
}

.step-output {
  background: var(--surface-strong);
  min-height: 260px;
}

.json-tool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.json-tool__input {
  flex: 1 1 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 720px) {
  .actions__header { align-items: flex-start; flex-direction: column; }
}

.step7-voice textarea {
  min-height: 180px;
}

.step7-voice__errors {
  list-style: disc;
  padding-left: 24px;
  margin: 12px 0;
  color: var(--danger);
  font-size: 14px;
}

.step7-voice__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.step7-voice__log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.step7-voice__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.96));
  border: 1px solid color-mix(in srgb, var(--border) 88%, white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.step7-voice__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.98), rgba(255, 255, 255, 0.96));
  color: color-mix(in srgb, var(--text) 78%, white);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.step7-voice__table th,
.step7-voice__table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 14px 12px;
  vertical-align: top;
}

.step7-voice__row:last-child td {
  border-bottom: none;
}

.step7-voice__row:hover td {
  background: color-mix(in srgb, var(--accent) 4%, white);
}

.step7-voice__table a {
  color: var(--accent);
  text-decoration: none;
}

.step7-voice__table a:hover {
  text-decoration: underline;
}

.step7-voice__inline-player {
  display: block;
  width: 100%;
  min-width: 220px;
  max-width: 340px;
  height: 36px;
}

.step7-voice__table th:nth-child(1),
.step7-voice__table td:nth-child(1) {
  width: 58px;
}

.step7-voice__table th:nth-child(2),
.step7-voice__table td:nth-child(2) {
  width: 150px;
}

.step7-voice__table th:nth-child(3),
.step7-voice__table td:nth-child(3) {
  width: 102px;
}

.step7-voice__table th:nth-child(4),
.step7-voice__table td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
  width: auto;
}

.step7-voice__table th:nth-child(5),
.step7-voice__table td:nth-child(5) {
  width: 88px;
}

.step7-voice__table th:nth-child(6),
.step7-voice__table td:nth-child(6) {
  width: 320px;
  min-width: 240px;
}

.step7-voice__table th:nth-child(7),
.step7-voice__table td:nth-child(7) {
  width: 110px;
}

@media (max-width: 960px) {
  .step7-voice__inline-player {
    min-width: 180px;
  }

  .step7-voice__table th:nth-child(6),
  .step7-voice__table td:nth-child(6) {
    width: 240px;
    min-width: 190px;
  }

  .step7-voice__table th,
  .step7-voice__table td {
    padding: 12px 10px;
  }
}

.step7-voice__preview-details {
  cursor: pointer;
}

.step7-voice__preview-details summary {
  color: var(--text);
}

.step7-voice__preview-full {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
}

.step7-voice__preview-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.52;
  color: color-mix(in srgb, var(--text) 96%, white);
  font-size: 0.99rem;
  font-weight: 500;
  max-width: 34ch;
}

.step7-voice__preview-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.step7-voice__preview-editor {
  width: 100%;
  min-height: 120px;
  margin-top: 8px;
}

.step7-voice__index-cell,
.step7-voice__type-cell,
.step7-voice__status-cell,
.step7-voice__action-cell {
  white-space: nowrap;
}

.step7-voice__index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--text);
  font-weight: 800;
  font-size: 0.84rem;
}

.step7-voice__audioid-cell {
  min-width: 0;
}

.step7-voice__audioid {
  display: inline-block;
  padding: 0.34rem 0.55rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 82%, white);
  border: 1px solid color-mix(in srgb, var(--border) 82%, white);
  color: color-mix(in srgb, var(--text) 72%, white);
  font-size: 0.74rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.step7-voice__audioid-link {
  appearance: none;
  background: color-mix(in srgb, #22c55e 12%, white);
  border-color: color-mix(in srgb, #22c55e 28%, var(--border));
  color: #166534;
  cursor: pointer;
  text-align: left;
}

.step7-voice__audioid-link:hover,
.step7-voice__audioid-link:focus-visible {
  border-color: color-mix(in srgb, #22c55e 46%, var(--border));
  color: #166534;
  text-decoration: underline;
}

.step7-voice__attempt-fails {
  margin-top: 0.45rem;
  max-width: 340px;
  color: #991b1b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.step7-voice__attempt-fails summary {
  cursor: pointer;
  font-weight: 800;
}

.step7-voice__attempt-fails ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.step7-voice__attempt-fails li + li {
  margin-top: 0.25rem;
}

.step7-voice__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.77rem;
  font-weight: 800;
  line-height: 1;
}

.step7-voice__chip--type {
  background: color-mix(in srgb, var(--surface) 70%, white);
  border-color: color-mix(in srgb, var(--border) 86%, white);
  color: color-mix(in srgb, var(--text) 88%, white);
}

.step7-voice__chip--narracion {
  background: color-mix(in srgb, #38bdf8 12%, white);
  border-color: color-mix(in srgb, #38bdf8 28%, var(--border));
}

.step7-voice__chip--cita {
  background: color-mix(in srgb, #f59e0b 14%, white);
  border-color: color-mix(in srgb, #f59e0b 30%, var(--border));
}

.step7-voice__chip--quote_intro,
.step7-voice__chip--titulo_bloque {
  background: color-mix(in srgb, #c084fc 12%, white);
  border-color: color-mix(in srgb, #c084fc 28%, var(--border));
}

.step7-voice__chip--status {
  min-width: 72px;
}

.step7-voice__chip--ok,
.step7-voice__chip--skipped {
  background: color-mix(in srgb, #22c55e 14%, white);
  border-color: color-mix(in srgb, #22c55e 28%, var(--border));
  color: #166534;
}

.step7-voice__chip--error,
.step7-voice__chip--failed {
  background: color-mix(in srgb, #ef4444 14%, white);
  border-color: color-mix(in srgb, #ef4444 28%, var(--border));
  color: #991b1b;
}

.step7-voice__chip--pending,
.step7-voice__chip--running {
  background: color-mix(in srgb, #f59e0b 16%, white);
  border-color: color-mix(in srgb, #f59e0b 30%, var(--border));
  color: #92400e;
}

.step7-voice__chip--cancelled,
.step7-voice__chip--unknown {
  background: color-mix(in srgb, var(--surface) 88%, white);
  border-color: color-mix(in srgb, var(--border) 88%, white);
  color: var(--muted);
}

.step7-voice__output-cell {
  vertical-align: middle;
}

.step7-voice__action-cell {
  vertical-align: middle;
}

.step7-voice__action-btn {
  width: 100%;
  min-width: 82px;
  justify-content: center;
}

.job-final-audio {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.job-final-audio audio {
  width: min(760px, 100%);
}

#jobs-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.jobs-kpi {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
}

.jobs-kpi strong {
  font-weight: 600;
  color: var(--muted);
}

.jobs-kpi b {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.jobs-kpi--total {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.jobs-table__row td {
  overflow-wrap: anywhere;
}

/* Colores alternos para jobs - misma fila de control y auditoría comparten color */
.jobs-table__row[data-job-index]:nth-child(4n+1),
.jobs-table__summary-row[data-job-index]:nth-child(4n+2) {
  background: white;
}

.jobs-table__row[data-job-index]:nth-child(4n+3),
.jobs-table__summary-row[data-job-index]:nth-child(4n+4) {
  background: #f3f4f6;
}

/* Borde superior e inferior para delimitar cada job completo */
.jobs-table__row[data-job-index] {
  border-top: 4px solid #cbd5e1;
}

.jobs-table__summary-row[data-job-index] {
  border-bottom: 4px solid #cbd5e1;
}

/* Quitar bordes interiores de las celdas dentro de cada job */
.jobs-table__row[data-job-index] td {
  border-bottom: none;
}

.jobs-table__summary-row[data-job-index] td {
  border-bottom: none;
}

.jobs-table {
  table-layout: fixed;
}

.jobs-table th:nth-child(1),
.jobs-table td:nth-child(1) {
  width: 14%;
}

.jobs-table th:nth-child(2),
.jobs-table td:nth-child(2) {
  width: 27%;
}

.jobs-table th:nth-child(3),
.jobs-table td:nth-child(3) {
  width: 9%;
}

.jobs-table th:nth-child(4),
.jobs-table td:nth-child(4) {
  width: 14%;
}

.jobs-table th:nth-child(5),
.jobs-table td:nth-child(5) {
  width: 7%;
}

.jobs-table th:nth-child(6),
.jobs-table td:nth-child(6) {
  width: 8%;
}

.jobs-table th:nth-child(7),
.jobs-table td:nth-child(7) {
  width: 10%;
}

.jobs-table th:nth-child(8),
.jobs-table td:nth-child(8) {
  width: 11%;
}

.jobs-table__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: color-mix(in srgb, var(--text) 78%, white);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.jobs-table__primary {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.jobs-table__secondary {
  color: var(--muted);
  line-height: 1.35;
}

.jobs-table__mode {
  margin-bottom: 0.35rem;
}

.jobs-table__mode-chip {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

.jobs-table__failure {
  min-height: 1.2rem;
  margin-top: 0.35rem;
  font-size: 12px;
  line-height: 1.35;
  color: transparent;
}

.jobs-table__failure--visible {
  color: var(--danger);
  font-weight: 600;
}

.jobs-table__failure .jobs-table__failure-link {
  color: var(--danger) !important;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--danger);
  cursor: pointer;
  display: inline;
}

.jobs-table__failure .jobs-table__failure-link:link {
  color: var(--danger) !important;
}

.jobs-table__failure .jobs-table__failure-link:visited {
  color: var(--danger) !important;
}

.jobs-table__failure .jobs-table__failure-link:hover {
  text-decoration: underline;
  color: var(--danger) !important;
}

.jobs-table__failure .jobs-table__failure-link:active {
  color: var(--danger) !important;
}

.jobs-table__status,
.jobs-table__step,
.jobs-table__metric,
.jobs-table__updated {
  white-space: normal;
  vertical-align: top;
}

.jobs-table__status {
  white-space: nowrap;
  overflow-wrap: normal;
}

.jobs-table__step {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.jobs-table__metric {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.jobs-table__updated {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}

.jobs-table__actions {
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.jobs-table__actions .btn {
  width: 100%;
  padding: 9px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
}

.jobs-table__row[data-job-index="0"],
.jobs-table__row[data-job-index="2"],
.jobs-table__row[data-job-index="4"],
.jobs-table__row[data-job-index="6"],
.jobs-table__summary-row[data-job-index="0"],
.jobs-table__summary-row[data-job-index="2"],
.jobs-table__summary-row[data-job-index="4"],
.jobs-table__summary-row[data-job-index="6"] {
  background-color: white;
}

.jobs-table__row[data-job-index="1"],
.jobs-table__row[data-job-index="3"],
.jobs-table__row[data-job-index="5"],
.jobs-table__row[data-job-index="7"],
.jobs-table__summary-row[data-job-index="1"],
.jobs-table__summary-row[data-job-index="3"],
.jobs-table__summary-row[data-job-index="5"],
.jobs-table__summary-row[data-job-index="7"] {
  background-color: #f8fafc;
}

.jobs-table__btn-audit {
  background-color: #8b5cf6 !important;
  color: white !important;
  border-color: #8b5cf6 !important;
}

.jobs-table__btn-clone {
  background-color: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

.jobs-table__btn-clone:disabled {
  opacity: 0.5;
}

.jobs-table__btn-download-audio {
  background-color: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

.jobs-table__btn-download-json {
  background-color: #06b6d4 !important;
  color: white !important;
  border-color: #06b6d4 !important;
}

.jobs-table__btn-pause {
  background-color: #f59e0b !important;
  color: white !important;
  border-color: #f59e0b !important;
}

.jobs-table__btn-resume {
  background-color: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

.jobs-table__btn-cancel {
  background-color: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
}

.jobs-table__btn-delete {
  background-color: #dc2626 !important;
  color: white !important;
  border-color: #dc2626 !important;
}

.jobs-table__btn-pitch {
  background-color: #ec4899 !important;
  color: white !important;
  border-color: #ec4899 !important;
}

.jobs-table__btn-lock {
  color: #ffffff !important;
  border: none !important;
}

.jobs-table__btn-lock--free {
  background-color: #16a34a !important;
  border-color: #16a34a !important;
}

.jobs-table__btn-lock--locked {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
}

.jobs-table__actions .btn--ghost {
  background: var(--card);
  border-style: solid;
}

.jobs-table__status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.jobs-table__status-chip--completed {
  background: color-mix(in srgb, #22c55e 14%, white);
  border-color: color-mix(in srgb, #22c55e 30%, var(--border));
  color: #166534;
}

.jobs-table__status-chip--running,
.jobs-table__status-chip--queued {
  background: color-mix(in srgb, #38bdf8 14%, white);
  border-color: color-mix(in srgb, #38bdf8 30%, var(--border));
  color: #0f4c81;
}

.jobs-table__status-chip--paused,
.jobs-table__status-chip--cancelled {
  background: color-mix(in srgb, var(--surface) 88%, white);
  border-color: color-mix(in srgb, var(--border) 88%, white);
  color: var(--muted);
}

.jobs-table__status-chip--failed {
  background: color-mix(in srgb, #ef4444 14%, white);
  border-color: color-mix(in srgb, #ef4444 30%, var(--border));
  color: #991b1b;
}

.jobs-table__id-text {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.jobs-table__lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
}

.jobs-table__lock-badge--free {
  background: #16a34a;
}

.jobs-table__lock-badge--locked {
  background: #dc2626;
}

.jobs-table__row--locked,
.jobs-table__summary-row.jobs-table__row--locked {
  box-shadow: inset 4px 0 0 0 #dc2626;
}

.jobs-table__step-main {
  font-weight: 700;
  color: color-mix(in srgb, var(--text) 88%, white);
  line-height: 1.25;
  white-space: nowrap;
  overflow-wrap: normal;
}

.jobs-table__podcast {
  overflow: hidden;
  max-width: 0;
}

.jobs-table__podcast,
.jobs-table__podcast * {
  overflow-wrap: break-word;
  word-break: break-word;
}

.jobs-table__primary,
.jobs-table__secondary,
.jobs-table__failure {
  max-width: 100%;
}

.jobs-table__empty {
  color: var(--muted);
  text-align: center;
  padding: 1.25rem 0.75rem;
}

.podcast-state {
  padding: 0.6rem 0.75rem 0.75rem;
  margin: 0 -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  width: calc(100% + 1.5rem);
  /* Quitamos el borde superior porque ya está delimitado por el borde del job completo */
  border-top: none;
  /* El fondo es transparente para heredar el color de la fila padre */
  background: transparent;
}

.jobs-table__summary-row > td {
  width: 100% !important;
  padding: 0 0.75rem 0.55rem !important;
  /* Quitamos el borde inferior porque ya está el borde del job completo */
  border-bottom: none;
}

.jobs-table__job-row-wrapper {
  display: flex !important;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.jobs-table__job-info {
  flex: 1;
  min-width: 0;
}

.jobs-table__buttons-group {
  display: flex !important;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.jobs-table__buttons-group .btn {
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 11px;
  flex-shrink: 0;
  border-radius: 6px;
  min-width: fit-content;
}

.podcast-state__title {
  margin: 0 0 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.podcast-state__fails,
.podcast-state__label {
  margin: 0.35rem 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.podcast-state__fails,
.podcast-state__clip-fails {
  color: var(--danger);
}

.podcast-state__disclosure {
  margin-top: 0.55rem;
  font-size: 0.78rem;
}

.podcast-state__disclosure > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}

.podcast-state__clips {
  display: grid;
  gap: 0.65rem;
  margin: 0.45rem 0 0;
  padding-left: 1.4rem;
}

.podcast-state__clips li {
  padding-left: 0.2rem;
  line-height: 1.45;
  font-size: 0.74rem;
}

.podcast-state__clip-main a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.podcast-state__failure-list {
  margin-top: 0.4rem;
}

.podcast-state__failure-detail {
  margin-top: 0.3rem;
  padding: 0.35rem 0.45rem;
  border-left: 3px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.podcast-state__failure-detail > summary {
  cursor: pointer;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.podcast-state__failure-evaluation {
  max-height: 28rem;
  margin: 0.45rem 0 0;
  padding: 0.6rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 0.7rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tts-qc-clip-anchor {
  scroll-margin-top: 1rem;
}

.tts-qc-clip-anchor:target {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 3px;
}

#audit-tts-qc-section,
#audit-tts-qc-section *,
#audit-tts-qc-list {
  box-sizing: border-box;
  min-width: 0;
}

#audit-tts-qc-summary,
#audit-tts-qc-list {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#audit-tts-qc-list .saved-row__actions {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#audit-tts-qc-list .btn {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#audit-tts-qc-list .saved-row__actions > .btn {
  align-self: stretch;
  max-height: 34rem;
  overflow: auto;
  line-height: 1.25;
}

#audit-tts-qc-list small,
#audit-tts-qc-list span,
#audit-tts-qc-list p {
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#audit-tts-qc-list table {
  width: 100%;
  max-width: 100%;
  table-layout: auto;
}

#audit-tts-qc-list th,
#audit-tts-qc-list td {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#audit-tts-qc-list td:first-child {
  width: 1%;
  min-width: 8rem;
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
}

#audit-tts-qc-list td:first-child + td {
  white-space: normal;
}

#audit-tts-qc-list pre {
  white-space: pre-wrap !important;
  overflow: auto;
}

body[data-jobs-view] .hero,
body[data-jobs-view] .layout {
  max-width: 1080px;
}

body[data-jobs-view] .layout > .card,
body[data-jobs-view] .job-final-audio,
body[data-jobs-view] #job-tts-qc-audit-wrap,
body[data-jobs-view] #job-tts-script-output,
body[data-jobs-view] #job-detail-output,
body[data-jobs-view] #job-hallucination-audit-output,
body[data-jobs-view] #job-parts-audit-output,
body[data-jobs-view] #job-cost-study-output,
body[data-jobs-view] #job-gemini-deliverables-output {
  min-width: 0;
}

body[data-jobs-view] #job-tts-script-output,
body[data-jobs-view] #job-detail-output,
body[data-jobs-view] #job-hallucination-audit-output,
body[data-jobs-view] #job-parts-audit-output,
body[data-jobs-view] #job-cost-study-output,
body[data-jobs-view] #job-gemini-deliverables-output {
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tts-failures-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.tts-failures-kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: color-mix(in srgb, var(--surface) 88%, white);
}

.tts-failures-kpi__label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tts-failures-kpi__value {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.tts-failures-kpi__hint {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.72;
}

.tts-failures-chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.tts-failures-chart {
  width: 100%;
  min-width: 720px;
  height: 280px;
  display: block;
}

.tts-failures-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-top: 0.75rem;
}

.tts-failures-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.tts-failures-legend__swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  display: inline-block;
}

.tts-failures-types {
  display: grid;
  gap: 0.75rem;
}

.tts-failures-type-row {
  display: grid;
  gap: 0.35rem;
}

.tts-failures-type-row__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.tts-failures-type-row__label span {
  font-size: 0.92rem;
  opacity: 0.72;
}

.tts-failures-type-row__bar {
  width: 100%;
  height: 0.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 35%, transparent);
  overflow: hidden;
}

.tts-failures-type-row__fill {
  height: 100%;
  border-radius: 999px;
}

.jobs-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  overflow: visible;
  padding: 0.3rem 0.1rem 0.1rem;
  margin: 0 -0.1rem;
}

.jobs-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 88px;
  min-height: 68px;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.jobs-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.jobs-action__icon-svg {
  width: 1rem;
  height: 1rem;
  display: block;
  opacity: 0.92;
}

.jobs-action__label {
  display: block;
  max-width: 8.4rem;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
  text-wrap: balance;
}

.jobs-action.btn--primary .jobs-action__icon {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.jobs-action.btn--danger .jobs-action__icon {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.jobs-action:disabled {
  box-shadow: none;
}

.job-lock-btn {
  border: none;
  color: #ffffff;
}

.job-lock-btn--free {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ffffff;
}

.job-lock-btn--locked {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #ffffff;
}

.job-lock-btn--free .jobs-action__icon,
.job-lock-btn--locked .jobs-action__icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.job-lock-btn:disabled {
  opacity: 0.55;
}

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

.jobs-table__lock-badge:disabled {
  cursor: default;
  opacity: 0.9;
}

.jobs-table__lock-badge.is-locking::before,
.job-lock-btn.is-locking .jobs-action__label::before {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.35rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  vertical-align: -0.08em;
  animation: jobs-lock-spin 0.7s linear infinite;
}

.job-final-audio--sticky {
  position: sticky;
  top: 12px;
  z-index: 6;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(56, 189, 248, 0.06)),
    var(--card);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.job-final-audio__content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-final-audio--sticky audio {
  flex: 1 1 420px;
  min-width: min(100%, 320px);
}

@media (max-width: 960px) {
  .jobs-table__id,
  .jobs-table__podcast,
  .jobs-table__actions {
    width: auto;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 28px 16px 18px;
  }

  .layout {
    padding: 0 16px 32px;
    gap: 14px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .job-final-audio--sticky {
    top: 8px;
    padding: 10px;
  }

  .job-final-audio__content {
    align-items: stretch;
  }

  .job-final-audio--sticky audio,
  .job-final-audio__content .btn {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .field--wide {
    grid-column: auto;
  }

  .jobs-hero__actions,
  .jobs-toolbar,
  .jobs-detail__actions {
    width: 100%;
    align-items: stretch;
  }

  .jobs-hero__actions {
    flex-direction: column;
  }

  .jobs-hero__actions .btn {
    width: 100%;
    text-align: center;
  }

  .jobs-toolbar .btn,
  .jobs-detail__actions .btn,
  .jobs-detail__actions select,
  .jobs-detail__actions input {
    width: auto;
  }

  .jobs-detail__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }


  .jobs-action {
    min-width: 0;
    width: 100%;
  }

  .jobs-toolbar .field {
    width: 100%;
  }

  .jobs-toolbar .field select {
    width: 100%;
  }

  .jobs-table-wrapper {
    overflow: visible;
  }

  .jobs-table,
  .jobs-table tbody,
  .jobs-table tr,
  .jobs-table td {
    display: block;
    width: 100%;
  }

  .jobs-table thead {
    display: none;
  }

  .jobs-table__row {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .jobs-table__row td {
    border-bottom: 1px dashed var(--border);
    padding: 10px 0;
  }

  .jobs-table__row td:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .jobs-table__row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-transform: uppercase;
  }

  .jobs-table__id {
    font-size: 11px;
    width: auto;
  }

  .jobs-table__podcast,
  .jobs-table__status,
  .jobs-table__step,
  .jobs-table__metric,
  .jobs-table__updated,
  .jobs-table__actions {
    width: auto;
  }

  .jobs-table__podcast {
    max-width: none;
    overflow: visible;
  }

  .jobs-table__step,
  .jobs-table__metric {
    max-width: none;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
  }

  .jobs-table__status {
    white-space: normal;
  }

  .jobs-table__actions .btn {
    margin-bottom: 8px;
  }

  .jobs-table__actions .btn:last-child {
    margin-bottom: 0;
  }

  .job-final-audio audio {
    width: 100%;
  }

  #job-detail-output,
  #job-tts-script-output,
  #job-hallucination-audit-output,
  #job-parts-audit-output,
  #job-cost-study-output,
  #job-gemini-deliverables-output {
    max-height: 50vh;
    font-size: 12px;
    padding: 12px;
  }
}

/* Support Tabs */
.support-tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
}

.support-tab {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.support-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-radius: 8px 8px 0 0;
}

.support-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.support-view {
  display: none;
}

.support-view[data-active="true"] {
  display: block;
}

/* History Timeline */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
}

.history-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.history-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-description {
  font-size: 0.95rem;
}

.history-comment {
  padding: 0.5rem;
  background: var(--surface);
  border-radius: 4px;
  font-style: italic;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.history-timestamp {
  font-size: 0.85rem;
  color: var(--muted);
}
