.app-page {
  min-height: 100%;
  background: #f7f6ff;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 850;
}

.sidebar-toggle {
  border: 1px solid #dddaf5;
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  color: #2a2559;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(63, 50, 150, 0.08);
}

.app-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  background: #f7f6ff;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background: #fff;
  border-right: 1px solid #ecebff;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: #2a2559;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav a:hover {
  background: #f0edff;
}

.sidebar-nav a.active {
  background: var(--background-gradient);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-divider {
  height: 1px;
  background: #ecebff;
}

.sidebar-account {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.mode-toggle {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f6ff;
  border: 1px solid #e2ddff;
}

.mode-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8c86b5;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #edeaff;
  border: 1px solid #ddd7ff;
}

.mode-switch button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  color: #4b4491;
  cursor: pointer;
}

.mode-switch button:focus-visible {
  outline: 2px solid #7a73ff;
  outline-offset: 2px;
}

.mode-switch button.is-active {
  background: var(--background-gradient);
  color: #fff;
  box-shadow: 0 10px 18px rgba(90, 90, 255, 0.2);
}

.sidebar-account .account-summary {
  width: 100%;
  justify-content: space-between;
}

.sidebar-action {
  border: none;
  background: none;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: #2a2559;
  cursor: pointer;
  border-radius: 10px;
}

.sidebar-action:hover {
  background: #f0edff;
}

.sidebar-backdrop {
  display: none;
}

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

.billing-stat {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ecebff;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.billing-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8c86b5;
}

.billing-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2a2559;
  position: relative;
  min-height: 1.2em;
}

.billing-stat-value.is-loading {
  color: transparent;
}

.billing-stat-value.is-loading::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 0.95em;
  width: clamp(90px, 70%, 160px);
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, #ebe7ff 25%, #f8f6ff 50%, #ebe7ff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.app-page .btn[data-loading="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.app-page .btn[data-loading="true"]:hover {
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  opacity: 0.8;
  vertical-align: middle;
}

.btn[data-loading="true"] .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.series-skeleton {
  position: relative;
  overflow: hidden;
}

.series-skeleton .inline-actions {
  margin-top: 16px;
}

.skeleton-line,
.skeleton-block,
.skeleton-pill {
  display: block;
  background: linear-gradient(90deg, #ebe7ff 25%, #f8f6ff 50%, #ebe7ff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
}

.skeleton-block {
  border-radius: 12px;
}

.skeleton-input {
  height: 44px;
  width: 100%;
  border-radius: 10px;
}

.skeleton-pill {
  height: 34px;
  width: 120px;
  border-radius: 999px;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  border-radius: 10px;
}

.skeleton-meta {
  height: 14px;
  width: 72%;
  margin-top: 10px;
}

.skeleton-paragraph {
  height: 54px;
  width: 100%;
  margin-top: 16px;
}

.skeleton-episode-title {
  height: 16px;
  width: 120px;
}

.skeleton-episode-meta {
  height: 14px;
  width: 90px;
}

.skeleton-episode-row {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8f7ff;
  border: 1px solid #ecebff;
  display: grid;
  gap: 6px;
}

.skeleton-episode-row-title {
  height: 14px;
  width: 60%;
}

.skeleton-episode-row-meta {
  height: 12px;
  width: 45%;
}

.field.has-skeleton .field-skeleton {
  display: none;
}

#series-form[data-loading="true"] .field.has-skeleton .field-control {
  display: none;
}

#series-form[data-loading="true"] .field.has-skeleton .field-skeleton {
  display: block;
}

.style-option.style-skeleton {
  display: grid;
  gap: 10px;
}

.style-skeleton-card {
  pointer-events: none;
}

.style-skeleton-card::after {
  content: none;
}

.skeleton-style-label {
  height: 12px;
  width: 60%;
}

.voice-option.voice-skeleton {
  pointer-events: none;
}

.voice-skeleton-card {
  cursor: default;
}

.skeleton-voice-title {
  height: 16px;
  width: 55%;
}

.skeleton-voice-subtitle {
  height: 12px;
  width: 35%;
}

.skeleton-voice-meta {
  height: 12px;
  width: 80%;
}

.plan-card {
  position: relative;
  overflow: hidden;
}

.plan-card .btn {
  width: 100%;
}

.plan-card.current {
  border-color: #6d63ff;
  box-shadow: 0 18px 30px rgba(90, 90, 255, 0.18);
}

.launch-offer {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d8d2ff;
  background: #f5f2ff;
  color: #4a3db0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.plan-price-old {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3f3;
  border: 1px solid #f1c5c5;
  font-weight: 700;
  color: #5a4f80;
  text-decoration: line-through;
  text-decoration-color: #d04a4a;
  text-decoration-thickness: 2px;
}

.plan-price-new {
  font-weight: 700;
  color: #2f286d;
}

.plan-price-credits {
  color: #6a658f;
}

.plan-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--background-gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}

.billing-confirm-shell {
  max-width: 920px;
}

.billing-confirm-card {
  display: grid;
  gap: 20px;
}

.billing-confirm-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.9vw, 2.15rem);
  line-height: 1.2;
  color: #241f4a;
}

.billing-confirm-plan-meta {
  margin: 14px 0 0;
}

.billing-confirm-plan-current {
  font-weight: 700;
  color: #2f286d;
}

.billing-confirm-plan-old {
  margin-left: 4px;
  color: #7e78a8;
  text-decoration: line-through;
  text-decoration-color: #cf5959;
  text-decoration-thickness: 2px;
  font-weight: 600;
}

.billing-testimonials-label {
  margin: 0 0 -2px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #625bac;
}

.billing-confirm-actions {
  justify-content: space-between;
  align-items: center;
}

.billing-confirm-actions .btn.primary {
  margin-left: auto;
}

.billing-proof {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #dad4ff;
  background: #f4f2ff;
}

.billing-proof strong {
  font-size: 1.3rem;
  color: #322b72;
}

.billing-proof span {
  font-weight: 600;
  color: #4f4892;
}

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

.billing-testimonial {
  margin: 0;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid #ebe8ff;
  background: #fff;
  text-align: center;
  display: grid;
  gap: 6px;
  align-content: start;
}

.billing-testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 4px;
  border: 2px solid #ece8ff;
  box-shadow: 0 10px 18px rgba(30, 30, 60, 0.12);
}

.billing-testimonial-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2f2a64;
}

.billing-testimonial-role {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c67a1;
}

.billing-testimonial-quote {
  margin: 4px 0 0;
  color: #3a3569;
  font-weight: 500;
  line-height: 1.4;
  font-size: 0.9rem;
}

.billing-testimonial-rating {
  margin: 6px 0 0;
  font-weight: 700;
  color: #4a3db0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.billing-reassurance {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.billing-reassurance li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2d285a;
  font-weight: 600;
}

.billing-reassurance li span {
  color: #3f37a0;
  font-size: 0.9rem;
}

[hidden] {
  display: none !important;
}

.nav-links button {
  border: none;
  background: none;
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary-text-color);
}

.account-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e2ddff;
  background: #f8f6ff;
  box-shadow: 0 8px 16px rgba(63, 50, 150, 0.1);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8c86b5;
}

.account-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2a2559;
}

.account-summary .status-pill {
  padding: 4px 10px;
  font-size: 0.65rem;
}

.app-shell {
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.app-header > * {
  min-width: 0;
}

.app-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  background: var(--background-gradient);
  -webkit-background-clip: text;
  color: transparent;
}

.app-subtitle {
  margin: 8px 0 0;
  color: #5a5580;
  overflow-wrap: anywhere;
}

.app-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #ecebff;
}

.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 600;
  color: #2a2559;
}

.field input,
.field textarea,
.field select {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #dddaf5;
  background: #fbfaff;
  width: 100%;
  min-width: 0;
}

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

.number-stepper {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.number-stepper input[type="number"] {
  flex: 1;
  text-align: center;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  -moz-appearance: textfield;
}

.number-stepper input[type="number"]::-webkit-outer-spin-button,
.number-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btn {
  width: 48px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #dddaf5;
  background: #f1efff;
  color: #2a2559;
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease, border-color 0.2s ease;
}

.number-stepper .stepper-btn:first-child {
  border-radius: 10px 0 0 10px;
}

.number-stepper .stepper-btn:last-child {
  border-radius: 0 10px 10px 0;
}

.stepper-btn:hover {
  background: #ebe7ff;
  border-color: #cfc9ff;
}

.stepper-btn:active {
  transform: scale(0.97);
}

.stepper-btn:focus-visible {
  outline: 2px solid #6b61ff;
  outline-offset: 2px;
}

.pro-only {
  display: none;
}

.app-page[data-mode="pro"] .pro-only {
  display: block;
}

.app-page[data-mode="pro"] .field.pro-only {
  display: flex;
}

.pro-only-inline {
  display: none;
}

.app-page[data-mode="pro"] .pro-only-inline {
  display: inline-flex;
}

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

.form-grid .field {
  min-width: 0;
}

.scroll-strip {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-top: 4px;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: auto;
}

.style-grid {
  display: grid;
  gap: 12px;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 22vw, 190px);
  width: max-content;
}

.style-option {
  position: relative;
  scroll-snap-align: start;
}

.style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #1d193a;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 3 / 4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.style-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.75) 100%);
}

.style-card picture {
  display: block;
  width: 100%;
  height: 100%;
}

.style-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.style-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(30, 30, 60, 0.2);
}

.style-option input:focus-visible + .style-card {
  outline: 2px solid #7a73ff;
  outline-offset: 4px;
}

.style-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.style-check {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: #2a2559;
  display: grid;
  place-items: center;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.style-option input:checked + .style-card .style-check {
  opacity: 1;
  transform: scale(1);
}

.voice-grid {
  display: grid;
  gap: 12px;
  grid-auto-flow: column;
  grid-auto-columns: clamp(190px, 24vw, 260px);
  width: max-content;
}

.voice-option {
  position: relative;
  scroll-snap-align: start;
}

.voice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.voice-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ecebff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.voice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(30, 30, 60, 0.12);
}

.voice-option input:focus-visible + .voice-card {
  outline: 2px solid #7a73ff;
  outline-offset: 4px;
}

.voice-option input:checked + .voice-card {
  border-color: #6f67ff;
  box-shadow: 0 18px 30px rgba(79, 70, 229, 0.18);
  transform: translateY(-2px);
}

.voice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.voice-name {
  font-weight: 700;
  color: #2a2559;
  font-size: 0.98rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.voice-provider {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: #f0edff;
  color: #4b4491;
  padding: 3px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.voice-description {
  margin: 0;
  color: #6a658f;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.voice-sample-btn {
  border: 1px solid #d6d1ff;
  background: #fff;
  color: #4b4491;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.voice-sample-btn.is-playing {
  background: var(--background-gradient);
  color: #fff;
  border-color: transparent;
}

.voice-sample-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.voice-sample-status {
  font-size: 0.72rem;
  color: #6a658f;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scroll-strip::-webkit-scrollbar {
  height: 12px;
}

.scroll-strip::-webkit-scrollbar-thumb {
  background: #d7d4f5;
  border-radius: 999px;
}

.scroll-strip::-webkit-scrollbar-track {
  background: transparent;
}

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

.app-page .btn {
  text-decoration: none;
}

.inline-actions .btn.outline {
  border-width: 1px;
  border-color: #c7c2ee;
  color: #5c58a5;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.inline-actions .btn.outline:hover {
  transform: none;
  box-shadow: none;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.app-page[data-mode="quick"] .stepper {
  display: none;
}

.step-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #dad5ff;
  background: #fff;
  font-weight: 600;
  color: #4b4491;
  min-width: 0;
  white-space: normal;
  text-align: center;
}

.step-pill.active {
  background: var(--background-gradient);
  color: #fff;
  border-color: transparent;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f0edff;
  color: #5349aa;
}

.status-pill.success {
  background: #e1f7ea;
  color: #1f7a4f;
}

.status-pill.error {
  background: #ffe8e5;
  color: #b94032;
}

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff6e5;
  color: #7a5200;
  border: 1px solid #f0d9ac;
}

.notice strong {
  color: #5a3b00;
}

.notice.notice-offline {
  background: #eef1ff;
  color: #2a2559;
  border-color: #cdd3ff;
  margin: 16px 0;
}

.notice.notice-offline strong {
  color: #1f1a47;
}

.quick-hero {
  display: none;
  background: #f7f5ff;
  border-color: #e4defe;
}

.app-page[data-mode="quick"] .quick-hero {
  display: block;
}

.app-page[data-mode="quick"] #series-summary {
  display: none;
}

.app-page[data-mode="quick"] #episode-form {
  display: none;
}

.quick-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a64b1;
  margin: 0;
}

.quick-hero-top h2 {
  margin: 8px 0 6px;
  font-size: 1.6rem;
}

.quick-hero-foot {
  margin-top: 12px;
}

.quick-series-summary {
  margin-top: 18px;
}

.series-summary-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ecebff;
}

.series-summary-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.series-summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.series-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1efff;
  border: 1px solid #dcd7ff;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b4491;
}

.series-summary-outline {
  margin: 0;
  color: #4b4766;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-progress {
  display: none;
}

.app-page[data-mode="quick"] .quick-progress {
  display: block;
}

.quick-progress-steps {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quick-progress-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ecebff;
  background: #fbfaff;
}

.quick-progress-step.is-active {
  border-color: #b7afff;
  background: #f1efff;
}

.quick-progress-step.is-complete {
  border-color: #b2e2c9;
  background: #ecf8f1;
}

.quick-progress-step.is-failed {
  border-color: #f3b4ab;
  background: #fff1ef;
}

.quick-step-title {
  font-weight: 600;
  color: #2a2559;
}

.quick-step-status {
  font-size: 0.85rem;
  color: #5a5580;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.quick-progress-step.is-complete .quick-step-status {
  color: #1f7a4f;
}

.quick-progress-step.is-failed .quick-step-status {
  color: #b94032;
}

.app-page[data-mode="quick"] #generate-images,
.app-page[data-mode="quick"] #render-video {
  display: none;
}

.app-page[data-mode="quick"] #episode-scenes {
  display: none;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #6a658f;
  border: 1px dashed #d6d1ff;
  border-radius: 16px;
  background: #fff;
}

.series-card h3,
.episode-card h3,
.scene-card h3 {
  margin: 0 0 8px;
}

.episode-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #ecebff;
  display: grid;
  gap: 12px;
}

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

.episode-list-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.episode-view-all {
  font-weight: 600;
  color: #4b4491;
  text-decoration: none;
}

.episode-view-all:hover {
  text-decoration: underline;
}

.episode-list-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #2a2559;
}

.episode-list-items {
  display: grid;
  gap: 12px;
}

.episode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8f7ff;
  border: 1px solid #ecebff;
}

.episode-row-info {
  display: grid;
  gap: 4px;
}

.episode-row-title {
  font-weight: 600;
  color: #2a2559;
}

.episode-row .inline-actions {
  gap: 8px;
}

.meta {
  color: #6a658f;
  font-size: 0.92rem;
}

.credit-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff6e5;
  border: 1px solid #f0d9ac;
  color: #7a5200;
  font-size: 0.9rem;
}

.credit-warning strong {
  color: #5a3b00;
  font-weight: 600;
}

.credit-warning a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.compact-meta {
  margin: 0;
  font-size: 0.84rem;
}

.scene-grid {
  display: grid;
  gap: 16px;
}

.scene-plan {
  display: grid;
  gap: 14px;
}

.scene-plan-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.scene-plan-grid {
  display: grid;
  gap: 16px;
}

.scene-plan-card {
  border: 1px solid #ecebff;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
}

.scene-plan-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #2a2559;
}

.scene-plan-fields {
  display: grid;
  gap: 12px;
}

.scene-plan-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.scene-card {
  display: grid;
  gap: 14px;
  grid-template-columns: 90px 1fr;
  align-items: start;
}

.scene-transcript {
  margin: 6px 0 0;
  color: #2a2559;
  white-space: pre-wrap;
}

.scene-audio {
  margin-top: 6px;
}

.scene-audio audio {
  width: 100%;
}

.scene-thumb {
  width: 90px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  background: #1a1736;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  overflow: hidden;
}

.scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-preview-frame {
  max-width: 360px;
  width: 100%;
}

.video-preview-frame video {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #121127;
}

.auth-card {
  max-width: 480px;
  margin: 60px auto;
}

.oauth-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.btn.google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e0dcff;
  color: #2a2559;
}

.btn.google:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.google-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.google-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.oauth-message {
  margin: 0;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8b86b2;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ecebff;
}

.auth-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-toggle button {
  border: 1px solid #e0dcff;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: #4b4491;
}

.auth-toggle button.active {
  background: var(--background-gradient);
  color: #fff;
  border-color: transparent;
}

.app-footer {
  text-align: center;
  color: #8b86b2;
  font-size: 0.9rem;
  margin-top: 40px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
  opacity: 1;
  pointer-events: all;
  background: transparent;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 36, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(15, 12, 36, 0.2);
  border: 1px solid #ecebff;
  display: grid;
  gap: 14px;
}

.modal-actions {
  justify-content: flex-end;
}

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

  .stepper {
    flex-direction: column;
  }

  .step-pill {
    width: 100%;
  }

  .card-grid.cols-2,
  .card-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .style-grid {
    grid-auto-columns: clamp(120px, 40vw, 170px);
    gap: 10px;
  }

  .voice-grid {
    grid-auto-columns: clamp(150px, 40vw, 210px);
    gap: 10px;
  }

  .scene-card {
    grid-template-columns: 1fr;
  }

  .scene-thumb {
    width: 100%;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .account-summary {
    width: 100%;
    justify-content: flex-end;
  }

  .billing-confirm-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .billing-confirm-actions .btn {
    width: 100%;
    text-align: center;
  }

  .billing-confirm-actions .btn.primary {
    margin-left: 0;
  }

  .billing-testimonials {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 70vw);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .billing-testimonial {
    scroll-snap-align: start;
  }

  .billing-testimonials::-webkit-scrollbar {
    height: 10px;
  }

  .billing-testimonials::-webkit-scrollbar-thumb {
    background: #d7d4f5;
    border-radius: 999px;
  }
}

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

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(280px, 80vw);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 950;
    box-shadow: 0 24px 60px rgba(15, 12, 36, 0.2);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 36, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 900;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (min-width: 961px) {
  .app-topbar {
    display: none;
  }
}
