﻿:root {
  color-scheme: only light;
  --bg: #000;
  --text: #fff;
  --muted: #9d9d9d;
  --line: #f5f5f5;
  --box: #070707;
  --box-2: #111;
  --disabled: #343434;
  --danger: #ff5a5a;
}

* {
  box-sizing: border-box;
  forced-color-adjust: none;
}

html {
  min-height: 100%;
  background: #000 !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: #000 !important;
  color: #fff !important;
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
}

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

.wizard-shell {
  width: min(1480px, calc(100vw - 72px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(18px, 3vh, 34px) 0 48px;
}

.wizard-topbar {
  display: grid;
  grid-template-columns: 140px 1fr 170px 196px;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin-bottom: clamp(16px, 2.6vh, 28px);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.back-button,
.account-button,
.status-mark,
.progress-mark {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.back-button {
  width: 104px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.account-button {
  justify-self: end;
  width: 190px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}

.progress-mark {
  justify-self: center;
  color: var(--muted);
}

.status-mark {
  justify-self: end;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.status-mark[data-tone="done"] {
  color: var(--text);
}

.status-mark[data-tone="working"] {
  color: #d7d7d7;
}

.status-mark[data-tone="error"] {
  color: var(--danger);
}

.wizard-root {
  display: flex;
  min-height: calc(100vh - 116px);
  min-height: calc(100svh - 116px);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

body[data-step="mode"] .wizard-shell {
  width: min(1320px, calc(100vw - 36px));
}

body[data-step="mode"] .wizard-topbar {
  grid-template-columns: 1fr auto;
  margin-bottom: 0;
}

body[data-step="mode"] .account-button {
  grid-column: 2;
}

body[data-step="auth"] .wizard-topbar {
  grid-template-columns: minmax(120px, 1fr) auto minmax(210px, 1fr);
}

body[data-step="auth"] .progress-mark {
  grid-column: 1;
  justify-self: start;
}

body[data-step="auth"] .status-mark {
  grid-column: 2;
  justify-self: center;
  max-width: none;
}

body[data-step="auth"] .account-button {
  grid-column: 3;
  justify-self: end;
  width: auto;
  min-width: 190px;
}

.page-title {
  margin: 0 0 clamp(18px, 3vh, 30px);
  color: var(--text);
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.mode-screen {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 116px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
}

.mode-title {
  margin: 0 0 22px;
  color: var(--text);
  font-size: 62px;
  font-weight: 500;
  line-height: 0.98;
  text-align: center;
  text-transform: uppercase;
}

.mode-grid {
  display: grid;
  width: min(1120px, 90vw);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 5vw, 78px);
}

.mode-card {
  display: grid;
  gap: 20px;
  justify-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  text-align: center;
  transform: translateY(-16px);
  transition: transform 160ms ease, opacity 160ms ease;
}

.mode-card.primary {
  transform: translateY(4px);
}

.mode-card:hover,
.mode-card:focus-visible {
  outline: 0;
  opacity: 1;
  transform: translateY(-22px) scale(1.018);
}

.mode-card.primary:hover,
.mode-card.primary:focus-visible {
  transform: translateY(-2px) scale(1.018);
}

.mode-preview {
  display: flex;
  width: auto;
  height: min(445px, 44vh);
  aspect-ratio: 9 / 14.1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #bdbdbd;
  background: #040404;
  overflow: hidden;
}

.mode-card.primary .mode-preview {
  height: min(538px, 50vh);
  aspect-ratio: 9 / 13.2;
  border: 2px solid var(--line);
}

.mode-card:hover .mode-preview,
.mode-card:focus-visible .mode-preview {
  border-color: var(--line);
}

.mode-preview-line {
  display: block;
  height: 2px;
  margin: 0 auto 26px;
  background: #363636;
}

.mode-preview-box {
  display: block;
  width: 54%;
  height: 60px;
  margin-top: 6px;
  border: 1px solid #2f2f2f;
}

.mode-preview-video {
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #080808;
  box-shadow: none;
  margin: 0;
  overflow: hidden;
}

.mode-preview-clip {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.mode-preview-livebox {
  display: block;
  height: 34px;
  margin: 0 auto 8px;
  border: 1px solid #303030;
}

.mode-preview-line.live-line {
  margin-top: 46px;
  margin-bottom: 0;
}

.mode-copy {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.mode-label {
  font-size: 42px;
  line-height: 0.92;
  text-transform: uppercase;
}

.mode-card.primary .mode-label {
  font-size: 48px;
}

.mode-subtitle,
.mode-soon,
.mode-instruction {
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mode-subtitle {
  color: #d4d4d4;
  font-size: 15px;
  font-weight: 700;
}

.mode-soon {
  margin-top: 8px;
  border: 1px solid #444;
  color: #9d9d9d;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mode-instruction {
  margin-top: 16px;
  color: #b8b8b8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
}

.mode-placeholder {
  width: min(360px, 76vw);
}

.showcase-rect {
  display: flex;
  width: auto;
  height: min(540px, 56vh);
  aspect-ratio: 9 / 16;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #030303;
  overflow: hidden;
  padding: 0;
  text-align: center;
}

.theme-showcase {
  height: min(540px, 56vh);
}

.format-showcase {
  height: min(540px, 56vh);
  background: #030303;
}

.showcase-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-line {
  max-width: 36ch;
  font-size: 44px;
  line-height: 1.14;
  text-transform: uppercase;
}

.showcase-line + .showcase-line {
  margin-top: 14px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.choice-row,
.bottom-actions,
.script-actions,
.final-controls {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: clamp(18px, 2.8vh, 32px);
  flex-wrap: wrap;
}

.choice-button,
.primary-action,
.secondary-action,
.format-preview-button,
.control-button {
  border: 1px solid var(--line);
  background: var(--box);
  color: var(--text);
  min-width: 190px;
  padding: clamp(15px, 2.2vh, 22px) 28px;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}

.choice-button {
  font-size: 34px;
}

.choice-button.selected,
.format-preview-button.selected,
.script-option.selected,
.background-card.selected,
.primary-action {
  background: var(--text);
  color: var(--bg);
}

.primary-action {
  min-width: 280px;
  font-size: 34px;
}

.secondary-action {
  min-width: 210px;
  padding: 16px 24px;
  font-size: 22px;
}

button:disabled {
  cursor: not-allowed;
}

.disabled-choice {
  border-color: #555;
  background: var(--disabled) !important;
  color: #777 !important;
}

.format-preview-button {
  width: min(320px, 72vw);
  padding: 26px;
  font-size: 44px;
}

.script-list {
  display: grid;
  width: min(820px, 88vw);
  gap: 20px;
}

.generation-list {
  display: grid;
  width: min(820px, 88vw);
  gap: 18px;
}

.script-option {
  display: grid;
  width: 100%;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--box);
  color: var(--text);
  padding: 22px 26px;
  cursor: pointer;
  text-align: left;
}

.generation-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--box);
  color: var(--text);
  padding: 22px 26px;
}

.generation-title {
  font-size: 32px;
  line-height: 1.05;
  text-transform: uppercase;
}

.generation-meta {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generation-snippet {
  color: #cfcfcf;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.generation-card .secondary-action,
.generation-card .download-link {
  justify-self: start;
}

.script-option.selected .script-snippet,
.script-option.selected .script-meta {
  color: #111;
}

.script-hook {
  font-size: 34px;
  line-height: 1.05;
}

.script-snippet {
  color: #cfcfcf;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.script-meta {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.empty-box,
.auth-box,
.custom-script-box,
.confirm-box,
.progress-panel {
  width: min(820px, 88vw);
  border: 1px solid var(--line);
  background: var(--box);
  padding: 26px;
}

.empty-box {
  text-align: center;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.custom-script-box {
  display: grid;
  gap: 18px;
}

.auth-box {
  display: grid;
  width: min(520px, 88vw);
  gap: 18px;
}

.auth-note {
  width: min(520px, 88vw);
  margin: -14px 0 24px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.progress-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  font-family: Arial, Helvetica, sans-serif;
}

.progress-panel.active {
  border-width: 3px;
  background: #fff;
  color: #000;
}

.progress-pulse {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
}

.progress-panel.active .progress-pulse {
  animation: progressPulse 0.82s ease-in-out infinite alternate;
}

.progress-copy {
  display: grid;
  gap: 6px;
}

.progress-title {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.progress-message {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.generating-screen {
  display: flex;
  width: min(760px, 92vw);
  min-height: min(540px, 64vh);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.generating-word {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-width: min(720px, 92vw);
  color: var(--text);
  font-size: 96px;
  font-weight: 500;
  line-height: 0.92;
  text-transform: uppercase;
}

.generating-base {
  grid-column: 2;
}

.generating-dots {
  display: inline-block;
  grid-column: 3;
  width: 0.9em;
  text-align: left;
}

.generating-subtext {
  margin-top: 24px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.generating-note {
  max-width: 56ch;
  margin-top: 18px;
  color: #d8d8d8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

@keyframes progressPulse {
  from {
    transform: scale(0.72);
    opacity: 0.38;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.custom-title,
.auth-input,
.custom-text,
.final-script,
.control-select {
  width: 100%;
  border: 1px solid var(--line);
  background: #030303;
  color: var(--text);
  padding: 16px;
}

.custom-title {
  font-size: 28px;
  text-transform: uppercase;
}

.auth-input {
  min-height: 58px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
}

.custom-text {
  min-height: 360px;
  resize: vertical;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.background-grid {
  display: grid;
  width: min(980px, 92vw);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.background-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.background-preview {
  display: flex;
  width: auto;
  height: min(470px, 50vh);
  aspect-ratio: 9 / 16;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #050505;
  overflow: hidden;
  padding: 0;
  text-align: left;
  font-size: 42px;
  line-height: 1.15;
}

.background-card.disabled-choice {
  background: transparent !important;
}

.background-card.disabled-choice .background-preview,
.background-card.disabled-choice .background-select {
  border-color: #555;
  background: #030303 !important;
  color: #777 !important;
}

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

.background-placeholder {
  padding: 24px;
}

.background-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--box);
  padding: 12px;
  font-size: 28px;
  text-align: center;
}

.background-card.selected .background-preview,
.background-card.selected .background-select {
  background: var(--text);
  color: var(--bg);
}

.background-card.selected .background-preview {
  border-width: 3px;
}

.summary-line {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.summary-line:last-child {
  border-bottom: 0;
}

.summary-label {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.summary-value {
  font-size: 27px;
  line-height: 1.12;
}

.final-script {
  width: min(860px, 90vw);
  min-height: min(560px, 56vh);
  resize: vertical;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.final-controls {
  width: min(860px, 90vw);
  align-items: end;
}

.credit-note {
  width: min(860px, 90vw);
  margin-top: 14px;
  color: #d8d8d8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.credit-note.empty {
  color: var(--danger);
}

.select-control {
  display: grid;
  min-width: 210px;
  gap: 8px;
}

.select-label {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.control-button {
  min-width: 150px;
  align-self: stretch;
}

.output-box {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(480px, 82vw);
  padding: 0;
  background: transparent;
  border: 0;
}

.output-box video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  background: #050505;
  object-fit: contain;
}

.download-link {
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 18px;
  text-decoration: none;
}

.generation-pending {
  justify-self: start;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

@media (min-width: 1200px) and (min-height: 850px) {
  .wizard-shell {
    width: min(1560px, calc(100vw - 96px));
    padding-top: 42px;
  }

  .wizard-topbar {
    margin-bottom: 28px;
  }

  .page-title {
    margin-bottom: 32px;
    font-size: 68px;
  }

  .mode-title {
    font-size: 70px;
  }

  .mode-grid {
    width: min(1280px, 88vw);
    gap: 86px;
  }

  .mode-preview {
    height: min(540px, 48vh);
  }

  .mode-card.primary .mode-preview {
    height: min(660px, 56vh);
  }

  .theme-showcase,
  .format-showcase,
  .showcase-rect {
    height: min(640px, 58vh);
  }

  .choice-row,
  .bottom-actions,
  .script-actions,
  .final-controls {
    gap: 28px;
    margin-top: 30px;
  }

  .choice-button {
    min-width: 218px;
    padding: 22px 32px;
    font-size: 40px;
  }

  .primary-action {
    min-width: 320px;
    padding: 22px 34px;
    font-size: 38px;
  }

  .secondary-action {
    min-width: 230px;
    padding: 18px 28px;
    font-size: 24px;
  }

  .script-list,
  .generation-list,
  .custom-script-box,
  .confirm-box,
  .progress-panel {
    width: min(960px, 82vw);
  }

  .script-option,
  .generation-card {
    padding: 28px 34px;
  }

  .script-hook {
    font-size: 38px;
  }

  .script-snippet,
  .generation-snippet {
    font-size: 17px;
  }

  .background-grid {
    width: min(1120px, 92vw);
    gap: 28px;
  }

  .background-preview {
    height: min(590px, 58vh);
  }

  .final-script,
  .final-controls,
  .credit-note {
    width: min(980px, 82vw);
  }

  .output-box {
    width: min(560px, 40vw);
  }
}

@media (min-width: 1900px) and (min-height: 1000px) {
  .wizard-shell {
    width: min(1680px, calc(100vw - 120px));
  }

  .page-title {
    font-size: 76px;
  }

  .theme-showcase,
  .format-showcase,
  .showcase-rect {
    height: min(700px, 59vh);
  }

  .choice-button {
    min-width: 240px;
    font-size: 46px;
  }

  .primary-action {
    min-width: 360px;
    font-size: 42px;
  }

  .background-preview {
    height: min(650px, 59vh);
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .wizard-shell {
    padding-top: 16px;
  }

  .wizard-topbar {
    margin-bottom: 14px;
  }

  .page-title {
    margin-bottom: 18px;
    font-size: 46px;
  }

  .theme-showcase,
  .format-showcase,
  .showcase-rect {
    height: min(430px, 48vh);
  }

  .choice-row,
  .bottom-actions,
  .script-actions,
  .final-controls {
    margin-top: 18px;
  }
}

@media (max-width: 760px) {
  .wizard-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 16px;
  }

  .wizard-topbar {
    grid-template-columns: 82px 1fr 80px;
    gap: 8px;
  }

  body[data-step="mode"] .wizard-topbar {
    grid-template-columns: 1fr;
  }

  body[data-step="mode"] .account-button {
    grid-column: 1;
  }

  .back-button {
    width: 82px;
    padding: 8px;
  }

  .account-button {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    padding: 9px 10px;
  }

  .status-mark {
    max-width: 80px;
  }

  .page-title {
    margin-bottom: 24px;
    font-size: 34px;
    line-height: 1.04;
  }

  .mode-screen {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 24px;
  }

  .mode-title {
    margin-bottom: 22px;
    font-size: 38px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
    width: min(360px, 92vw);
    gap: 34px;
  }

  .mode-card,
  .mode-card.primary,
  .mode-card:hover,
  .mode-card.primary:hover,
  .mode-card:focus-visible,
  .mode-card.primary:focus-visible {
    transform: none;
  }

  .mode-card.primary {
    order: -1;
  }

  .mode-preview,
  .mode-card.primary .mode-preview {
    aspect-ratio: 9 / 13.8;
  }

  .mode-label,
  .mode-card.primary .mode-label {
    font-size: 30px;
  }

  .mode-preview-word {
    font-size: 24px;
  }

  .showcase-rect {
    width: min(300px, 76vw);
    height: min(470px, 58vh);
  }

  .background-grid {
    grid-template-columns: 1fr;
  }

  .background-preview {
    max-height: 520px;
  }

  .summary-line {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .choice-button,
  .primary-action,
  .secondary-action {
    width: 100%;
    min-width: 0;
    font-size: 28px;
  }

  .secondary-action {
    font-size: 21px;
  }

  .script-hook,
  .generation-title,
  .progress-title {
    font-size: 26px;
  }

  .format-preview-button,
  .showcase-line,
  .background-preview,
  .background-select,
  .summary-value {
    font-size: 28px;
  }

  .generating-word {
    min-width: min(360px, 92vw);
    font-size: 50px;
  }


}
