:root {
  color-scheme: dark;
  --bg: #071013;
  --bg-elevated: #0b171a;
  --panel: rgba(11, 23, 26, 0.84);
  --panel-strong: rgba(8, 16, 19, 0.96);
  --border: rgba(111, 175, 176, 0.14);
  --text: #eff8f7;
  --muted: #91b8b8;
  --accent: #6fafb0;
  --accent-strong: #87c9ca;
  --accent-deep: #4d8586;
  --button-text: #071013;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 175, 176, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(111, 175, 176, 0.12), transparent 22%),
    linear-gradient(140deg, #04090b 0%, #091317 46%, #0d191d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 92%);
  pointer-events: none;
}

.app-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.site-header,
.hero-banner,
.workspace-panel,
.mobile-menu {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(16, 28, 31, 0.96), rgba(8, 16, 19, 0.94)),
    linear-gradient(90deg, rgba(111, 175, 176, 0.08), transparent 34%);
}

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

.header-logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.09), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(111, 175, 176, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-logo img {
  width: 34px;
  height: 34px;
}

.header-brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.header-wordmark {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.header-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.desktop-nav a,
.mobile-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}

.desktop-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  transition:
    color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.desktop-nav a:hover,
.mobile-menu a:hover {
  color: var(--text);
}

.desktop-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mobile-menu-button {
  min-height: 44px;
  padding: 10px 0;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: rgba(111, 175, 176, 0.08);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(111, 175, 176, 0.34);
  box-shadow: 0 0 0 5px rgba(111, 175, 176, 0.08);
}

.header-status.is-signed-in .header-status-dot {
  background: var(--accent-strong);
  box-shadow: 0 0 0 5px rgba(111, 175, 176, 0.14);
}

.header-pill,
.mini-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(111, 175, 176, 0.08);
  border: 1px solid rgba(111, 175, 176, 0.14);
  color: var(--muted);
  font-size: 0.9rem;
}

.rebuild-notice {
  max-width: 360px;
  color: #eafcfd;
  background: rgba(44, 98, 100, 0.18);
  border-color: rgba(126, 205, 207, 0.28);
  box-shadow: 0 10px 24px rgba(14, 42, 44, 0.12);
  white-space: normal;
  line-height: 1.25;
}

.menu-button {
  display: none;
  min-height: 48px;
  width: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  background: var(--text);
  border-radius: 999px;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(14, 25, 28, 0.96), rgba(8, 16, 19, 0.94));
}

.mobile-menu a,
.mobile-menu-button {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(111, 175, 176, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.mobile-menu-button {
  color: var(--text);
}

.hero-banner {
  margin-top: 18px;
  padding: 28px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(111, 175, 176, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(11, 23, 26, 0.96), rgba(6, 13, 16, 0.94));
}

.hero-copy {
  max-width: 860px;
}

.hero-note {
  margin-top: 22px;
  max-width: 56ch;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.6;
}

.account-active .hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: end;
  padding: 22px 24px;
}

.account-active .hero-copy {
  max-width: none;
}

.account-active .hero-banner h1 {
  max-width: 14ch;
  font-size: clamp(2.3rem, 4vw, 3.7rem);
  line-height: 0.96;
}

.account-active .hero-banner .lead {
  max-width: 64ch;
  margin-top: 14px;
  font-size: 0.98rem;
  line-height: 1.55;
}

.account-active .hero-note {
  margin-top: 0;
  max-width: 34ch;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-self: end;
  padding: 12px 14px;
  border: 1px solid rgba(111, 175, 176, 0.08);
  border-radius: 16px;
  color: rgba(231, 240, 240, 0.88);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
}

.start-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: 24px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: linear-gradient(180deg, rgba(11, 23, 26, 0.88), rgba(8, 16, 19, 0.9));
  box-shadow: var(--shadow);
}

.start-panel h2 {
  margin: 6px 0 0;
  font-size: 1.45rem;
}

.start-actions {
  display: flex;
  gap: 12px;
}

.workspace-panel {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  padding: 28px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(10, 19, 22, 0.98), rgba(6, 13, 16, 0.95));
}

.eyebrow,
.output-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-strong);
  text-transform: uppercase;
}

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

h1 {
  margin: 10px 0 0;
  max-width: 13ch;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.lead {
  max-width: 62ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.workspace-header h2 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 0.98;
}

.workspace-topbar {
  margin-bottom: 12px;
}

.label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
}

.controls-panel,
.preview-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.controls-panel {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.builder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(111, 175, 176, 0.08);
}

.builder-header h3 {
  margin: 6px 0 0;
  font-size: 1.35rem;
}

.builder-badge {
  padding: 9px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(135, 201, 202, 0.14), rgba(111, 175, 176, 0.08));
  border: 1px solid rgba(135, 201, 202, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 18px rgba(3, 8, 10, 0.12);
  color: #d8f5f5;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.builder-switches {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.mode-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(111, 175, 176, 0.1);
}

.mode-tab {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(135, 201, 202, 0.22), rgba(111, 175, 176, 0.16));
  color: var(--text);
}

.advanced-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.advanced-mode-toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(111, 175, 176, 0.42);
  box-shadow: 0 0 0 4px rgba(111, 175, 176, 0.08);
}

.advanced-mode-toggle.is-active {
  color: var(--text);
  border-color: rgba(111, 175, 176, 0.3);
  background: linear-gradient(180deg, rgba(135, 201, 202, 0.14), rgba(111, 175, 176, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(111, 175, 176, 0.05),
    0 16px 32px rgba(77, 133, 134, 0.18);
}

.advanced-mode-toggle.is-active .advanced-mode-toggle-dot {
  background: var(--accent-strong);
  box-shadow: 0 0 0 5px rgba(111, 175, 176, 0.14);
}

#ideaModeTopicCard.is-active {
  border-color: rgba(111, 175, 176, 0.22);
  background:
    radial-gradient(circle at top, rgba(135, 201, 202, 0.1), transparent 78%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 32px rgba(77, 133, 134, 0.12);
}

.control-group + .control-group,
.control-grid,
.control-actions {
  margin-top: 14px;
}

.control-row-label {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-row-label.is-active {
  color: var(--accent-strong);
}

.control-grid {
  display: grid;
  gap: 12px;
}

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

.prominent-grid {
  margin-top: 10px;
}

.story-line-range-card {
  grid-column: 1 / -1;
}

.prominent-grid.is-active .control-card {
  border-color: rgba(111, 175, 176, 0.22);
  background:
    radial-gradient(circle at top, rgba(135, 201, 202, 0.09), transparent 80%),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 28px rgba(77, 133, 134, 0.1);
}

.control-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.control-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.control-card.primary {
  padding: 16px;
  border-color: rgba(111, 175, 176, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.018));
}

.advanced-panel {
  margin-top: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.advanced-panel.is-active {
  background: transparent;
  box-shadow: none;
}

.advanced-panel-header {
  padding: 0;
}

.advanced-panel-header h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.advanced-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.setup-mismatch-hint {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(233, 191, 92, 0.16);
  background: rgba(233, 191, 92, 0.08);
  color: rgba(255, 233, 181, 0.92);
  font-size: 0.84rem;
  line-height: 1.45;
}

.advanced-panel .control-grid,
.advanced-panel .control-group {
  padding-left: 16px;
  padding-right: 16px;
}

.advanced-section-label {
  margin: 16px 16px 0;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.advanced-panel .control-card.advanced-wide {
  margin: 10px 0 0;
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.sample-chip {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: rgba(111, 175, 176, 0.07);
  color: var(--text);
  font-size: 0.9rem;
}

.input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

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

input,
textarea,
select {
  width: 100%;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

select {
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: #7ea2a3;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(111, 175, 176, 0.18);
  border-color: rgba(111, 175, 176, 0.45);
}

button {
  min-height: 60px;
  padding: 16px 20px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#generateButton {
  min-width: 160px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent) 55%, var(--accent-deep));
  color: var(--button-text);
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(111, 175, 176, 0.18);
  position: relative;
  overflow: hidden;
}

#generateButton.is-loading {
  opacity: 1;
  cursor: wait;
  background-size: 180% 180%;
  animation: generateButtonPulse 1.7s ease-in-out infinite;
}

#generateButton.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
  transform: translateX(-120%);
  animation: generateButtonSweep 1.35s linear infinite;
}

.continue-button {
  min-width: 180px;
  background: linear-gradient(135deg, #6cff7e, #39d56a 58%, #1ba94b);
  color: #041108;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(41, 180, 86, 0.24);
}

.continue-button:disabled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: rgba(239, 248, 247, 0.42);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

#generateButton:disabled,
.ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

#generateButton.is-loading:disabled {
  opacity: 1;
}

@keyframes generateButtonSweep {
  to {
    transform: translateX(120%);
  }
}

@keyframes generateButtonPulse {
  0%,
  100% {
    box-shadow: 0 14px 26px rgba(111, 175, 176, 0.18);
    filter: saturate(1);
  }

  50% {
    box-shadow: 0 18px 34px rgba(111, 175, 176, 0.28);
    filter: saturate(1.08);
  }
}

.status {
  min-height: 24px;
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.control-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 16px;
}

.control-notes {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.note-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.note-card p {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.55;
}

.output-panel,
.breakdown-panel {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.01));
}

.preview-stage-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.breakdown-panel {
  margin-top: 12px;
  padding-top: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.breakdown-inline {
  margin-top: 18px;
}

.history-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.video-stage-panel {
  margin-top: 24px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(111, 175, 176, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.012));
  box-shadow: var(--shadow);
}

.video-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.video-stage-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.video-stage-back {
  min-height: 48px;
}

.video-stage-canvas {
  display: grid;
  place-items: center;
  min-height: 960px;
  padding: 20px;
  border-radius: 28px;
  background: #00b140;
  box-shadow: inset 0 0 0 1px rgba(4, 17, 8, 0.12);
}

.video-stage-safe-area {
  display: grid;
  place-items: center;
  width: min(100%, 420px);
  aspect-ratio: 9 / 16;
  min-height: 0;
}

.video-stage-preview {
  display: grid;
  align-content: start;
  justify-items: center;
  width: 100%;
  height: 100%;
  padding-top: 76px;
}

.video-stage-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.video-stage-export-status {
  margin-top: 10px;
  max-width: 320px;
  color: rgba(4, 17, 8, 0.82);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
}

.video-stage-export-status.is-loading {
  position: relative;
  padding-left: 24px;
}

.video-stage-export-status.is-loading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(4, 17, 8, 0.18);
  border-top-color: rgba(4, 17, 8, 0.82);
  transform: translateY(-50%);
  animation: video-stage-spin 0.75s linear infinite;
}

.video-stage-export-progress {
  display: block;
  width: min(100%, 320px);
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(4, 17, 8, 0.12);
  box-shadow: inset 0 1px 2px rgba(4, 17, 8, 0.08);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.video-stage-export-progress.is-loading {
  opacity: 1;
}

.video-stage-export-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(44, 98, 100, 0.94), rgba(126, 205, 207, 0.92));
  transition: width 260ms ease;
}

.video-stage-save-options {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  width: min(100%, 360px);
}

.video-stage-save-options-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.video-stage-save-option {
  min-width: 0;
  min-height: 42px;
  padding-inline: 14px;
  font-size: 0.84rem;
  color: #d9f3f4;
  background: linear-gradient(135deg, rgba(44, 98, 100, 0.94), rgba(33, 79, 81, 0.94));
  border: 1px solid rgba(126, 205, 207, 0.18);
  box-shadow: 0 12px 24px rgba(14, 42, 44, 0.18);
}

.video-stage-save-option.is-loading {
  position: relative;
  pointer-events: none;
  padding-right: 44px;
}

.video-stage-save-option.is-loading::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(4, 17, 8, 0.22);
  border-top-color: rgba(4, 17, 8, 0.78);
  transform: translateY(-50%);
  animation: video-stage-spin 0.75s linear infinite;
}

.video-stage-save-option.is-muted {
  opacity: 0.58;
}

.video-stage-save-option.ghost {
  color: #d9f3f4;
  background: linear-gradient(135deg, rgba(44, 98, 100, 0.94), rgba(33, 79, 81, 0.94));
  border-color: rgba(126, 205, 207, 0.18);
  box-shadow: 0 12px 24px rgba(14, 42, 44, 0.18);
}

.video-stage-save-option:hover:not(:disabled),
.video-stage-save-option.ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

@keyframes video-stage-spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }

  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.video-stage-debug {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.video-stage-debug span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(4, 17, 8, 0.12);
  background: rgba(0, 0, 0, 0.08);
  color: rgba(4, 17, 8, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.video-stage-play {
  min-width: 210px;
  color: #d9f3f4;
  background: linear-gradient(135deg, rgba(44, 98, 100, 0.94), rgba(33, 79, 81, 0.94));
  border: 1px solid rgba(126, 205, 207, 0.18);
  box-shadow: 0 12px 24px rgba(14, 42, 44, 0.18);
  position: relative;
  overflow: hidden;
}

.video-stage-play.is-loading {
  opacity: 1;
  cursor: wait;
  background-size: 180% 180%;
  animation: generateButtonPulse 1.7s ease-in-out infinite;
}

.video-stage-play.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
  transform: translateX(-120%);
  animation: generateButtonSweep 1.35s linear infinite;
}

.video-stage-export {
  min-width: 210px;
  color: #d9f3f4;
  background: linear-gradient(135deg, rgba(44, 98, 100, 0.94), rgba(33, 79, 81, 0.94));
  border: 1px solid rgba(126, 205, 207, 0.18);
  box-shadow: 0 12px 24px rgba(14, 42, 44, 0.18);
  position: relative;
  overflow: hidden;
}

.video-stage-export.is-loading {
  opacity: 1;
  cursor: wait;
  background-size: 180% 180%;
  animation: generateButtonPulse 1.7s ease-in-out infinite;
}

.video-stage-export.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
  transform: translateX(-120%);
  animation: generateButtonSweep 1.35s linear infinite;
}

.video-stage-back {
  min-width: 170px;
  color: #d9f3f4;
  background: linear-gradient(135deg, rgba(44, 98, 100, 0.94), rgba(33, 79, 81, 0.94));
  border: 1px solid rgba(126, 205, 207, 0.18);
  box-shadow: 0 12px 24px rgba(14, 42, 44, 0.18);
}

.video-stage-play:hover:not(:disabled),
.video-stage-export:hover:not(:disabled),
.video-stage-back:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.video-stage-empty {
  color: rgba(4, 17, 8, 0.78);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.video-stage-phone {
  width: min(100%, 410px);
  min-height: 0;
  max-height: none;
  transform: none;
  transform-origin: center center;
  box-shadow: 0 28px 50px rgba(4, 17, 8, 0.28);
  transition: height 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.video-stage-shell {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-height: 0;
  max-height: none;
  height: auto;
}

.video-stage-shell .phone-statusbar,
.video-stage-shell .phone-navbar,
.video-stage-shell .chat-preview.video-stage-chat,
.video-stage-shell .phone-composebar {
  background: #000;
}

.video-stage-shell .phone-composebar {
  display: none;
}

.video-stage-opening-panel {
  width: min(100%, 410px);
  background: transparent;
}

.video-stage-opening-frame {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border-radius: 32px;
  background: #000;
  box-shadow: 0 28px 50px rgba(4, 17, 8, 0.28);
}

.video-stage-opening-frame .phone-statusbar,
.video-stage-opening-frame .phone-navbar,
.video-stage-opening-frame .chat-preview.video-stage-chat {
  background: #000;
}

.video-stage-opening-frame .phone-navbar {
  padding-bottom: 18px;
}

.video-stage-opening-frame .contact-meta {
  background: rgba(34, 34, 38, 0.92);
}

.video-stage-shell .chat-preview.video-stage-chat {
  flex: 0 0 auto;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 9px 11px 0;
  overflow: hidden;
  transition: height 360ms cubic-bezier(0.22, 1, 0.36, 1), padding 220ms ease;
}

.video-stage-opening-panel .chat-preview.video-stage-chat {
  padding: 4px 11px 0;
}

.video-stage-shell .chat-preview.video-stage-chat.is-playback-block {
  justify-content: flex-start;
  padding: 0;
  align-self: stretch;
}

.video-stage-shell.video-stage-message-only {
  width: min(100%, 398px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.video-stage-shell.video-stage-post-header .phone-navbar {
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.video-stage-shell.video-stage-post-header .phone-statusbar,
.video-stage-shell.video-stage-post-header .phone-composebar {
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.video-stage-shell.video-stage-post-header .chat-preview.video-stage-chat {
  padding: 0;
  background: transparent;
}

.video-stage-shell.video-stage-message-only .phone-statusbar,
.video-stage-shell.video-stage-message-only .phone-navbar,
.video-stage-shell.video-stage-message-only .phone-composebar {
  display: none;
}

.video-stage-shell.video-stage-message-only .chat-preview.video-stage-chat {
  width: 100%;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.video-stage-shell.video-stage-message-only .message-row {
  width: 100%;
}

.video-stage-shell.video-stage-message-only .message-bubble,
.video-stage-shell.video-stage-message-only .message-media-card {
  box-shadow: none;
}

.video-stage-opening-frame .message-bubble,
.video-stage-message-panel .message-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.29;
}

.video-stage-opening-frame .message-row,
.video-stage-message-panel .message-row {
  margin: 0;
}

.video-stage-opening-frame .message-bubble-text,
.video-stage-message-panel .message-bubble-text {
  padding-right: 0;
}

.video-stage-opening-frame .message-media-card,
.video-stage-message-panel .message-media-card {
  max-width: 258px;
}

.video-stage-opening-frame .message-attachment-image,
.video-stage-message-panel .message-attachment-image {
  max-width: 258px;
  max-height: 332px;
  border-radius: 18px;
}

.video-stage-message-panel {
  width: min(100%, 378px);
  border-radius: 24px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 28px 50px rgba(4, 17, 8, 0.28);
  transition: height 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.video-stage-message-only-chat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: auto;
  padding: 0 12px;
  overflow: hidden;
  background: #000;
  transition: height 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.video-stage-settings {
  margin-top: 20px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.video-stage-settings-header {
  margin-bottom: 14px;
}

.video-stage-settings-header h4 {
  margin: 6px 0 0;
  font-size: 1.04rem;
}

.voice-settings-note-card {
  display: grid;
  align-content: start;
}

.voice-settings-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.voice-line-editor-header {
  margin-top: 14px;
}

.voice-line-editor-header h4 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.voice-line-empty {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.92rem;
}

.voice-line-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.voice-line-list.is-locked .voice-line-top {
  cursor: default;
}

.voice-line-card {
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.022);
}

.voice-line-card summary {
  list-style: none;
}

.voice-line-card summary::-webkit-details-marker {
  display: none;
}

.voice-line-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  cursor: pointer;
}

.voice-line-chevron {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.voice-line-card[open] .voice-line-chevron {
  transform: rotate(180deg);
  color: var(--text);
  background: rgba(111, 175, 176, 0.08);
}

.voice-line-role,
.voice-line-step {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.voice-line-role {
  color: var(--text);
  background: rgba(111, 175, 176, 0.1);
  border: 1px solid rgba(111, 175, 176, 0.14);
}

.voice-line-role.receiver {
  color: #071013;
  background: linear-gradient(135deg, rgba(135, 201, 202, 0.95), rgba(111, 175, 176, 0.92));
  border-color: rgba(135, 201, 202, 0.4);
}

.voice-line-role.sender {
  background: rgba(255, 255, 255, 0.08);
}

.voice-line-step {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-line-preview {
  flex: 1 1 calc(100% - 40px);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.25;
  opacity: 0.92;
}

.voice-line-source {
  display: none;
}

.voice-line-card:not([open]) .voice-line-source,
.voice-line-card:not([open]) .voice-line-grid {
  display: none;
}

.voice-line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.voice-line-control-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}

.voice-line-field {
  display: grid;
  gap: 4px;
}

.voice-line-field .label {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.voice-line-textarea {
  min-height: 44px;
  resize: vertical;
  line-height: 1.3;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.voice-tuning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}

.voice-line-field.voice-line-spoken,
.voice-line-field:last-child {
  grid-column: 1 / -1;
}

.voice-slider-field {
  display: grid;
  gap: 4px;
}

.voice-slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.voice-slider-field input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.voice-toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 0.82rem;
}

.voice-toggle-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.history-card,
.history-empty {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.history-card-title {
  color: var(--text);
  font-weight: 700;
}

.history-card-meta {
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-card-preview {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.history-card-open {
  margin-top: 12px;
}

.history-empty {
  color: var(--muted);
}

.output-header,
.breakdown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.output-header h3,
.breakdown-header h3 {
  margin: 6px 0 0;
  font-size: 1.15rem;
}

.output-header.minimal {
  margin-bottom: 14px;
  align-items: center;
}

.output-header.minimal > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.preview-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin-left: auto;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.preview-switcher::-webkit-scrollbar {
  display: none;
}

.platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: white;
}

.platform-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.platform-icon.imessage {
  background: #0a84ff;
}

.platform-icon.whatsapp {
  background: #25d366;
  color: #04150a;
}

.platform-icon.discord {
  background: #5865f2;
}

.preview-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: auto;
  max-width: none;
}

.preview-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 34px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(111, 175, 176, 0.07);
  color: var(--muted);
  border: 1px solid rgba(111, 175, 176, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.preview-tab > span:last-child {
  line-height: 1;
}

.preview-tab.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.preview-tab.is-disabled {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(239, 248, 247, 0.48);
  border-color: rgba(255, 255, 255, 0.06);
  cursor: not-allowed;
  opacity: 0.9;
}

.preview-tab-note {
  display: none;
}

.ghost {
  min-height: 46px;
  padding: 12px 16px;
  background: rgba(111, 175, 176, 0.07);
  color: var(--text);
  border: 1px solid rgba(111, 175, 176, 0.12);
}

.auth-trigger {
  min-height: 44px;
}

.conversation-meta {
  display: flex;
  align-items: center;
}

.meta-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(111, 175, 176, 0.08);
  border: 1px solid rgba(111, 175, 176, 0.12);
  color: var(--muted);
  font-size: 0.84rem;
}

.phone-shell {
  --preview-chrome-collapse: 0;
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 32px;
  padding: 0;
  min-height: 760px;
  max-height: 760px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 40px rgba(0, 0, 0, 0.28);
}

.preview-whatsapp {
  background: #0b141a;
}

.preview-imessage .nav-side.left,
.preview-imessage .nav-label,
.preview-imessage .back-chevron {
  color: #f5f5f7;
}

.preview-imessage .phone-navbar {
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: start;
  max-height: calc(170px - (170px * var(--preview-chrome-collapse)));
  padding: calc(14px - (14px * var(--preview-chrome-collapse))) 14px calc(22px - (22px * var(--preview-chrome-collapse)));
  border-bottom: 0;
  overflow: visible;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, calc(0.74 - (0.2 * var(--preview-chrome-collapse)))));
  backdrop-filter: blur(14px);
}

.preview-imessage .nav-side.left {
  position: relative;
  width: 38px;
  height: 38px;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 34, 38, 0.92);
}

.preview-imessage .nav-side.right {
  width: 38px;
  justify-self: end;
  justify-content: center;
}

.preview-imessage .nav-label {
  display: none;
}

.preview-imessage .unread-badge {
  position: absolute;
  top: -2px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #f5f5f7;
  color: #111;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 2px #000;
}

.preview-imessage .phone-contact {
  position: relative;
  top: 2px;
  flex-direction: column;
  gap: 6px;
  justify-self: center;
}

.preview-imessage .header-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(34, 34, 38, 0.92);
  border: 0;
  color: #f5f5f7;
}

.preview-imessage .header-icon svg {
  width: 18px;
  height: 18px;
}

.preview-imessage .contact-avatar,
.preview-imessage .contact-avatar-image {
  width: 58px;
  height: 58px;
}

.preview-imessage .contact-meta {
  gap: 2px;
  min-width: 112px;
  padding: 10px 16px 10px;
  border-radius: 18px;
  background: rgba(34, 34, 38, 0.92);
}

.preview-imessage #chatTitle {
  display: block;
  line-height: 1.08;
}

.preview-imessage .contact-subtitle {
  display: block;
  color: rgba(245, 245, 247, 0.7);
  font-size: 0.82rem;
  line-height: 1.15;
}

.preview-imessage .chat-preview {
  min-height: 0;
  padding: 12px 14px 18px;
  background: #000;
}

.preview-imessage .message-bubble {
  max-width: 76%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 0.98rem;
  line-height: 1.28;
}

.preview-imessage .message-bubble.other {
  background: #2a2a2e;
  border-top-left-radius: 8px;
}

.preview-imessage .message-bubble.self {
  background: #4d95ff;
  border-top-right-radius: 8px;
}

.preview-imessage .phone-composebar {
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 0;
  background: #000;
}

.preview-imessage .compose-accessory {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(46, 46, 50, 0.95);
  color: #f5f5f7;
  font-size: 1.45rem;
  line-height: 1;
}

.preview-imessage .compose-input {
  min-height: 36px;
  padding: 0 12px 0 14px;
  background: rgba(34, 34, 38, 0.94);
  border-color: rgba(255, 255, 255, 0.06);
}

.preview-imessage .compose-inline-icon {
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  color: rgba(245, 245, 247, 0.68);
}

.preview-imessage .compose-inline-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-imessage .compose-send {
  display: none;
}

.preview-whatsapp .phone-navbar {
  color: white;
  grid-template-columns: auto 1fr auto;
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: #202c33;
}

.preview-whatsapp .nav-side.left,
.preview-whatsapp .nav-label,
.preview-whatsapp .back-chevron,
.preview-whatsapp .info-dot {
  color: #d9fdd3;
}

.preview-whatsapp .info-dot {
  border-color: transparent;
}

.preview-whatsapp .unread-badge {
  background: #25d366;
  color: #08130d;
}

.preview-whatsapp .phone-contact {
  justify-self: start;
}

.preview-whatsapp .preview-actions,
.preview-whatsapp .header-icon {
  color: #d9fdd3;
}

.preview-whatsapp .contact-avatar {
  background: #25d366;
  color: #04150a;
}

.preview-whatsapp .chat-preview {
  background:
    radial-gradient(circle at top, rgba(37, 211, 102, 0.05), transparent 28%),
    linear-gradient(180deg, #0b141a, #111b21);
}

.preview-whatsapp .message-bubble.other {
  background: #202c33;
}

.preview-whatsapp .message-bubble.self {
  background: #005c4b;
  color: #e9fffb;
}

.preview-whatsapp .compose-send {
  background: #25d366;
  color: #04150a;
  box-shadow: none;
}

.preview-whatsapp .compose-send svg {
  fill: currentColor;
  stroke: none;
}

.preview-whatsapp .compose-input {
  background: #202c33;
}

.preview-discord {
  background: #1e1f22;
}

.preview-discord .phone-navbar {
  color: white;
  grid-template-columns: auto 1fr auto;
  padding: 10px 14px 8px;
  border-bottom-color: rgba(255, 255, 255, 0.04);
  background: #2b2d31;
}

.preview-discord .nav-side.left,
.preview-discord .nav-label,
.preview-discord .back-chevron,
.preview-discord .info-dot {
  color: #c4c9ce;
}

.preview-discord .nav-side.left {
  background: transparent;
  width: 18px;
  height: 18px;
  border-radius: 0;
}

.preview-discord .unread-badge {
  background: #ed4245;
  color: #fff;
}

.preview-discord .phone-contact {
  justify-self: start;
  gap: 8px;
  top: 0;
  flex-direction: row;
}

.preview-discord .preview-actions,
.preview-discord .header-icon {
  color: #c4c9ce;
}

.preview-discord .contact-avatar {
  width: 30px;
  height: 30px;
  background: #444654;
}

.preview-discord .contact-meta {
  justify-items: start;
  padding: 0;
  background: transparent;
  gap: 1px;
}

.preview-discord .contact-subtitle {
  display: none;
}

.preview-discord .chat-preview {
  padding: 10px 14px 16px;
  background: #1e1f22;
}

.preview-discord .message-row {
  justify-content: flex-start;
}

.preview-discord .message-bubble {
  max-width: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: #dbdee1;
  font-size: 1rem;
  line-height: 1.4;
}

.preview-discord .message-bubble.other,
.preview-discord .message-bubble.self {
  background: transparent;
  border-radius: 0;
}

.discord-row {
  gap: 10px;
  align-items: flex-start;
}

.discord-message-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #111214;
  color: #c4c9ce;
  font-size: 0.95rem;
  font-weight: 700;
}

.discord-message-body {
  display: grid;
  gap: 2px;
}

.discord-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discord-message-author {
  color: #f2f3f5;
  font-weight: 700;
}

.discord-message-stamp {
  color: #949ba4;
  font-size: 0.78rem;
}

.preview-discord .phone-composebar {
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 12px 12px;
  background: #1e1f22;
  border-top: 0;
}

.preview-discord .compose-input {
  min-height: 40px;
  padding: 0 10px 0 14px;
  border: 0;
  background: #2b2d31;
  border-radius: 20px;
}

.preview-discord .compose-placeholder {
  color: #949ba4;
}

.preview-discord .compose-accessory {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
}

.preview-discord .compose-inline-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #b5bac1;
}

.preview-discord .compose-send {
  display: none;
}

.discord-compose-actions,
.discord-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discord-compose-chip,
.discord-inline-chip {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #2b2d31;
  color: #dbdee1;
  font-size: 1rem;
}

.discord-compose-chip svg,
.discord-inline-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-discord .header-icon {
  width: 28px;
  height: 28px;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
}

.preview-discord .header-icon svg {
  width: 16px;
  height: 16px;
}

.preview-discord .preview-actions {
  gap: 8px;
}

.preview-stack .output-panel {
  position: relative;
  overflow: hidden;
}

.preview-editor {
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.history-panel {
  padding: 18px;
  min-height: 0;
}

.builder-history-panel {
  margin-top: 16px;
}

.builder-history-panel .history-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.builder-history-panel:has(.history-list[hidden]) {
  align-self: start;
}

.history-panel .breakdown-summary h3 {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.preview-editor-header {
  margin-bottom: 14px;
}

.preview-editor-header h3 {
  margin: 6px 0 0;
  font-size: 1.08rem;
}

.preview-editor-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.preview-message-insert-hint {
  margin-top: 8px;
}

.preview-editor-group {
  margin: 16px 0 10px;
}

.preview-editor-group-title {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.preview-editor .control-grid + .control-grid {
  margin-top: 12px;
}

.preview-editor-full-span {
  grid-column: 1 / -1;
  max-width: none;
}

.stepper-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.stepper-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.compact-card {
  max-width: 240px;
}

.empty-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.preview-stack .output-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 175, 176, 0.12), transparent 65%);
  pointer-events: none;
}

.phone-statusbar {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  max-height: 46px;
  padding: 13px 16px 8px;
  color: #f5f5f7;
  font-size: 0.82rem;
  font-weight: 600;
  overflow: visible;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.92));
}

.preview-whatsapp .phone-statusbar {
  background: #202c33;
}

.phone-time {
  justify-self: start;
  position: relative;
  top: 1px;
}

.status-edit-button {
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: default;
  pointer-events: none;
}

.time-button {
  justify-self: start;
}

.status-meta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.signal-bars span {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
}

.signal-bars span:nth-child(1) {
  height: 4px;
}

.signal-bars span:nth-child(2) {
  height: 6px;
}

.signal-bars span:nth-child(3) {
  height: 8px;
}

.signal-bars span:nth-child(4) {
  height: 10px;
}

.signal-bars.level-1 span:nth-child(-n + 1),
.signal-bars.level-2 span:nth-child(-n + 2),
.signal-bars.level-3 span:nth-child(-n + 3),
.signal-bars.level-4 span:nth-child(-n + 4) {
  opacity: 1;
}

.wifi-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
}

.wifi-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wifi-icon path,
.wifi-icon circle {
  opacity: 0.18;
}

.wifi-icon.level-1 path:nth-of-type(3),
.wifi-icon.level-1 circle {
  opacity: 1;
}

.wifi-icon.level-2 path:nth-of-type(2),
.wifi-icon.level-2 path:nth-of-type(3),
.wifi-icon.level-2 circle {
  opacity: 1;
}

.wifi-icon.level-3 path,
.wifi-icon.level-3 circle {
  opacity: 1;
}

.battery-wrap {
  display: inline-flex;
  align-items: center;
}

.battery-pill {
  position: relative;
  width: 24px;
  height: 12px;
  border-radius: 4px;
  border: 1.6px solid currentColor;
  display: inline-block;
}

.battery-pill::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.battery-level {
  position: absolute;
  inset: 1.6px;
  border-radius: 2px;
  background: currentColor;
}

.phone-navbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  max-height: calc(140px - (108px * var(--preview-chrome-collapse)));
  padding: calc(8px - (6px * var(--preview-chrome-collapse))) 14px calc(12px - (10px * var(--preview-chrome-collapse)));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #0a84ff;
  overflow: hidden;
  opacity: calc(1 - var(--preview-chrome-collapse));
  transform: translateY(calc(-20px * var(--preview-chrome-collapse))) scale(calc(1 - (0.12 * var(--preview-chrome-collapse))));
  transform-origin: top center;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    padding 180ms ease,
    max-height 180ms ease;
}

.nav-side {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-button {
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
}

.nav-side.right {
  justify-content: flex-end;
}

.back-chevron {
  font-size: 1.5rem;
  line-height: 1;
}

.nav-label {
  color: #0a84ff;
  font-size: 0.92rem;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.unread-badge.is-dot {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  color: transparent;
}

.badge-popover {
  position: absolute;
  top: calc(100% - 4px);
  left: 12px;
  z-index: 2;
  display: inline-grid;
  grid-template-columns: auto 52px auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(28, 28, 30, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}

.status-popover {
  top: calc(100% - 2px);
  right: 12px;
  left: auto;
  grid-template-columns: 1fr;
  width: min(240px, calc(100% - 24px));
}

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

.status-editor-field {
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
  color: rgba(245, 245, 247, 0.78);
}

.status-editor-field input,
.status-editor-field select {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: #111216;
  color: #f5f5f7;
}

.phone-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  color: #f5f5f7;
  font-weight: 600;
}

.avatar-trigger {
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #5b7cfa;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-avatar-image {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.contact-meta {
  display: grid;
  justify-items: center;
  gap: 1px;
}

.contact-subtitle {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 500;
}

.info-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #0a84ff;
  color: #0a84ff;
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.preview-actions {
  gap: 10px;
}

.header-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: #0a84ff;
}

.header-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon.dots {
  font-size: 1rem;
  line-height: 1;
}

.imessage-facetime {
  color: #f5f5f7;
}

.chat-preview {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  min-height: 0;
  padding: 18px 14px;
  overflow: visible;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.035), transparent 30%),
    linear-gradient(180deg, #111216, #0b0c0f);
  transition:
    margin-top 180ms ease,
    padding 180ms ease;
}

.phone-shell.is-scrollable .chat-preview {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  margin-top: calc(-40px * var(--preview-chrome-collapse));
}

.phone-shell.is-scrollable .chat-preview::-webkit-scrollbar {
  width: 8px;
}

.phone-shell.is-scrollable .chat-preview::-webkit-scrollbar-track {
  background: transparent;
}

.phone-shell.is-scrollable .chat-preview::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.message-row {
  display: flex;
}

.message-row.left {
  justify-content: flex-start;
}

.message-row.right {
  justify-content: flex-end;
}

.message-bubble {
  position: relative;
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 1rem;
  line-height: 1.34;
  letter-spacing: -0.01em;
  z-index: 0;
}

.message-bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: inherit;
}

.message-row.left .message-bubble-stack {
  align-items: flex-start;
}

.message-row.right .message-bubble-stack {
  align-items: flex-end;
}

.message-bubble-text {
  display: block;
  padding-right: 6px;
}

.message-media-card {
  padding: 0;
  overflow: hidden;
  max-width: 248px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message-attachment-image {
  display: block;
  width: 100%;
  max-width: 248px;
  height: auto;
  max-height: 332px;
  margin: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.message-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
}

.message-attachment-file svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-bubble-actions {
  position: absolute;
  top: 6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(2px);
  z-index: 3;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.message-row.left .message-bubble-actions,
.message-row.right .message-bubble-actions {
  right: -12px;
}

.message-edit-button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(17, 18, 22, 0.26);
  color: inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  transition:
    background 140ms ease,
    transform 140ms ease,
    border-color 140ms ease;
}

.message-delete-button {
  min-width: 42px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(17, 18, 22, 0.26);
  color: inherit;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  transition:
    background 140ms ease,
    transform 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease;
}

.message-delete-button::after {
  content: "Delete";
}

.message-edit-button svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-delete-button svg {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-bubble:hover .message-bubble-actions,
.message-bubble:focus-within .message-bubble-actions {
  opacity: 1;
  transform: translateY(0);
}

.message-bubble:hover,
.message-bubble:focus-within {
  z-index: 2;
}

.message-bubble.other .message-edit-button,
.message-bubble.other .message-delete-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.07);
  color: rgba(245, 245, 247, 0.92);
}

.message-bubble.self .message-edit-button,
.message-bubble.self .message-delete-button {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.message-edit-button:hover,
.message-delete-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.message-delete-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.message-edit-input {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  resize: none;
  background: rgba(0, 0, 0, 0.14);
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.message-edit-input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.24);
}

.message-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.message-attach-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.message-attach-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-edit-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  line-height: 1;
}

.message-edit-attachment-pill span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.message-bubble.other {
  background: #2c2c2e;
  color: #f5f5f7;
  border-top-left-radius: 6px;
}

.message-bubble.self {
  background: #0a84ff;
  color: #fff;
  border-top-right-radius: 6px;
  font-weight: 500;
}

.message-media-card.other {
  background: transparent;
}

.message-media-card.self {
  background: transparent;
}

.message-media-card.is-standalone {
  background: transparent;
  box-shadow: none;
}

.message-media-card.is-standalone .message-attachment-image {
  border-radius: 22px;
}

.message-media-card.is-standalone.self .message-attachment-image {
  border-bottom-right-radius: 8px;
}

.message-media-card.is-standalone.other .message-attachment-image {
  border-bottom-left-radius: 8px;
}

.message-bubble-stack .message-media-card.self .message-attachment-image {
  border-bottom-right-radius: 10px;
}

.message-bubble-stack .message-media-card.other .message-attachment-image {
  border-bottom-left-radius: 10px;
}

.message-row.right .message-media-card {
  margin-right: -6px;
}

.message-row.left .message-media-card {
  margin-left: -6px;
}

.attachment-bubble.is-standalone .message-attachment-file {
  margin: 0;
  border-radius: 16px;
}

.phone-composebar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
}

.compose-input {
  min-height: 38px;
  border-radius: 999px;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.compose-placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.92rem;
}

.compose-accessory,
.compose-inline-icon {
  display: none;
}

.compose-send {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0a84ff;
  color: white;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.compose-send svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-control-button {
  width: 100%;
}

pre {
  margin: 16px 0 0;
  min-height: 180px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(4, 9, 11, 0.98), rgba(8, 16, 19, 0.98));
  border: 1px solid rgba(111, 175, 176, 0.08);
  color: #eff8f7;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.breakdown-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(111, 175, 176, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.breakdown-tag {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.line-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.line-list li + li {
  margin-top: 6px;
}

.breakdown-summary {
  margin-bottom: 12px;
}

.breakdown-summary h3 {
  margin: 4px 0 0;
  font-size: 0.98rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 9, 11, 0.66);
  backdrop-filter: blur(10px);
}

.auth-card {
  position: relative;
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: linear-gradient(180deg, rgba(11, 23, 26, 0.98), rgba(8, 16, 19, 0.96));
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 8px 0 0;
  font-size: 2rem;
  line-height: 1;
}

.auth-copy {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 40px;
  width: 40px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.auth-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-email-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.account-info-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.account-info-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.account-info-label {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signout-button {
  margin-top: 6px;
}

.auth-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-mode-tab {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(111, 175, 176, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.auth-mode-tab.is-active {
  background: rgba(111, 175, 176, 0.14);
  border-color: rgba(111, 175, 176, 0.34);
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field input {
  min-height: 46px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(111, 175, 176, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0 14px;
}

.auth-field input::placeholder {
  color: var(--muted);
}

.subtle {
  opacity: 0.92;
}

@media (max-width: 1024px) {
  .studio-layout,
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .desktop-nav,
  .header-pill {
    display: none;
  }

  .header-status {
    display: none;
  }

  .menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .app-frame {
    width: min(100%, calc(100% - 18px));
    padding-top: 14px;
  }

  .site-header,
  .hero-banner,
  .workspace-panel,
  .mobile-menu {
    border-radius: 24px;
  }

  .site-header,
  .hero-banner,
  .workspace-panel {
    padding: 18px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .workspace-header,
  .output-header,
  .breakdown-header,
  .start-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .input-wrap,
  .control-grid.two-up,
  .control-actions {
    grid-template-columns: 1fr;
  }

  #generateButton,
  .start-actions button {
    width: 100%;
  }

  .site-header {
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
  }

  .header-brand {
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
  }

  .header-brand-copy {
    min-width: 0;
  }

  .header-wordmark {
    font-size: 0.9rem;
    letter-spacing: 0.18em;
  }

  .header-subtitle {
    font-size: 0.78rem;
  }

  .account-active .hero-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .account-active .hero-note {
    min-height: 0;
    justify-self: stretch;
  }

  .header-actions {
    width: auto;
    margin-left: 0;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 10px;
  }

  .auth-trigger {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 0.88rem;
    flex: 0 1 auto;
  }

  .menu-button {
    width: 44px;
    min-height: 44px;
    flex: 0 0 auto;
  }

  .start-actions {
    flex-direction: column;
  }

  .builder-header {
    flex-direction: column;
    align-items: stretch;
  }

  .builder-badge {
    align-self: flex-start;
  }

  .preview-switcher {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .preview-tabs {
    width: max-content;
    max-width: none;
    padding-right: 4px;
  }

  .video-stage-panel {
    padding: 16px;
    border-radius: 24px;
  }

  .video-stage-canvas {
    min-height: auto;
    padding: 14px;
    border-radius: 22px;
  }

  .video-stage-preview {
    padding-top: 56px;
  }

  .video-stage-play,
  .video-stage-export,
  .video-stage-back,
  .video-stage-save-option {
    width: 100%;
    min-width: 0;
  }

  .video-stage-save-options,
  .video-stage-export-status,
  .video-stage-export-progress {
    width: 100%;
    max-width: 100%;
  }

  .video-stage-save-options-actions {
    width: 100%;
    flex-direction: column;
  }

  .auth-modal {
    padding: 12px;
  }

  .auth-card {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .auth-card h2 {
    font-size: 1.65rem;
  }

  .message-bubble {
    max-width: 92%;
  }
}
