:root {
  --bg: #080808;
  --bg-elevated: #111111;
  --bg-panel: #151515;
  --bg-panel-soft: #1a1a1a;
  --bg-menu: #161616;
  --bg-hover: #222222;
  --bg-selected: #2a2a2a;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --text: #f5f5f5;
  --text-muted: #d1d5db;
  --text-soft: #9ca3af;
  --text-dark: #111111;
  --focus-ring: rgba(229, 231, 235, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
}

body {
  padding: 24px 16px 60px;
}

a {
  color: var(--text);
}

img,
video {
  display: block;
  width: 100%;
  border-radius: 18px;
}

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

button {
  appearance: none;
}

input,
textarea,
select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  box-shadow:
    inset 0 0 0 999px var(--bg-elevated),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
  -webkit-text-fill-color: var(--text-soft);
}

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

input[type="file"] {
  padding: 12px;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border-radius: 6px;
  accent-color: #f5f5f5;
}

select {
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(17, 17, 17, 0.98), rgba(17, 17, 17, 0.98)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6.5L8 10.5L12 6.5' stroke='%23D1D5DB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 14px) 50%;
  background-size: auto, 16px 16px;
  padding-right: 44px;
  color-scheme: dark;
}

select,
option,
optgroup {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

select option,
select optgroup {
  background: var(--bg-menu);
  color: var(--text);
}

select option:hover,
select option:focus {
  background: var(--bg-hover);
}

select option:checked {
  background: var(--bg-selected);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #cfd3d8;
  box-shadow:
    inset 0 0 0 999px var(--bg-elevated),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 4px var(--focus-ring);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: linear-gradient(180deg, #ffffff, #dcdcdc);
  color: var(--text-dark);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(255, 255, 255, 0.08);
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
}

.hero-shell,
.panel-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(23, 23, 23, 0.96), rgba(12, 12, 12, 0.96));
  box-shadow: var(--shadow);
}

.hero-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  padding: 30px;
  margin-bottom: 24px;
}

.hero-copy-shell,
.hero-media-shell,
.primary-column,
.secondary-column {
  min-width: 0;
}

.hero-media-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-media-card {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.hero-media-card figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hero-copy,
.section-copy,
.subtle-copy,
.meta-line {
  color: var(--text-muted);
  line-height: 1.7;
}

.control-bar,
.app-grid {
  display: grid;
  gap: 24px;
}

.app-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  align-items: start;
}

.panel-card {
  padding: 24px;
  margin-bottom: 24px;
}

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

.section-row.compact {
  margin-bottom: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.stats-row.compact {
  margin-top: 0;
  margin-bottom: 18px;
}

.stat-card,
.preview-card,
.result-card,
.theme-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(16, 16, 16, 0.96));
}

.stat-card {
  padding: 16px 18px;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-card strong {
  display: block;
  font-size: 1rem;
  line-height: 1.5;
}

.theme-card,
.result-card,
.preview-card {
  padding: 18px;
}

.preview-card p {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.stack-lg {
  display: grid;
  gap: 18px;
}

.stack-md {
  display: grid;
  gap: 14px;
}

.stack-sm {
  display: grid;
  gap: 8px;
}

.two-col,
.three-col,
.four-col,
.card-grid.two,
.card-grid.three {
  display: grid;
  gap: 14px;
}

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

.two-col.wide-first {
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
}

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

.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.card-grid.three,
.preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-row,
.inline-form {
  margin-top: 10px;
}

.form-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--text);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.button-loading {
  gap: 10px;
  cursor: progress;
  opacity: 0.92;
}

.button-loading:hover {
  transform: none;
  box-shadow: none;
}

.input-shell {
  position: relative;
}

.input-shell input {
  padding-right: 58px;
}

.input-icon-button {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  box-shadow: none;
}

.input-icon-button:hover {
  transform: translateY(-50%);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

.input-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.upload-field {
  display: grid;
  gap: 10px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-empty {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  max-width: 100%;
}

.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.92rem;
}

.attachment-remove {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  box-shadow: none;
}

.attachment-remove:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
}

.attachment-remove:focus {
  outline: none;
  border-color: #cfd3d8;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.checkbox-row,
.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row {
  padding-top: 36px;
}

.scene-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 180px 140px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scene-plan-row:first-of-type {
  border-top: none;
}

.scene-plan-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.96), rgba(14, 14, 14, 0.96));
}

.scene-plan-preview {
  min-height: 180px;
}

.scene-plan-preview img,
.scene-plan-placeholder {
  height: 100%;
  min-height: 180px;
}

.scene-plan-preview img {
  object-fit: cover;
}

.scene-plan-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  text-align: center;
}

.scene-plan-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.scene-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scene-plan-note {
  margin-bottom: 0;
}

.scene-plan-controls {
  display: grid;
  grid-template-columns: 180px 160px;
  gap: 16px;
  align-items: center;
}

.scene-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.scene-state-badge.included {
  background: rgba(24, 56, 41, 0.46);
  border-color: rgba(84, 208, 148, 0.28);
  color: #e8fff2;
}

.scene-state-badge.excluded {
  background: rgba(64, 42, 16, 0.4);
  border-color: rgba(255, 178, 66, 0.28);
  color: #f4dcc1;
}

.prompt-review-card {
  display: grid;
  gap: 16px;
}

.prompt-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.prompt-review-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.prompt-include-check {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.prompt-include-check.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.prompt-include-check input[type="checkbox"] {
  appearance: none;
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #111111;
  display: inline-grid;
  place-items: center;
  box-shadow: none;
  cursor: pointer;
}

.prompt-include-check input[type="checkbox"]::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s ease;
}

.prompt-include-check input[type="checkbox"]:checked {
  background: #f5f5f5;
  border-color: #f5f5f5;
}

.prompt-include-check input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.prompt-review-card [data-generated-prompt].is-readonly {
  opacity: 0.7;
}

.prompt-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.toggle-choice.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.toggle-choice input {
  display: none;
}

.prompt-review-template-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px);
  gap: 14px;
}

.template-prompt-shell[hidden] {
  display: none;
}

.alert {
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(20, 56, 35, 0.45);
  border-color: rgba(58, 189, 130, 0.36);
}

.alert-error {
  background: rgba(74, 23, 23, 0.45);
  border-color: rgba(255, 112, 112, 0.4);
}

.alert-warn {
  background: rgba(64, 42, 16, 0.45);
  border-color: rgba(255, 178, 66, 0.4);
}

.alert-info {
  background: rgba(24, 34, 62, 0.45);
  border-color: rgba(120, 152, 255, 0.4);
}

.text-link {
  color: var(--text);
  text-decoration: underline;
}

.sticky-card {
  position: sticky;
  top: 20px;
}

@media (max-width: 1180px) {
  .hero-shell,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero-media-shell,
  .two-col,
  .three-col,
  .four-col,
  .card-grid.two,
  .card-grid.three,
  .stats-row,
  .scene-plan-row,
  .scene-plan-card,
  .scene-plan-controls,
  .prompt-review-template-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-row {
    padding-top: 0;
  }

  .scene-plan-preview {
    min-height: 220px;
  }

  .scene-plan-head,
  .prompt-review-head {
    flex-direction: column;
  }

  .prompt-review-actions {
    justify-items: start;
  }
}

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

.editor-hero {
  align-items: stretch;
}

.editor-grid {
  align-items: start;
}

.editor-architecture-card {
  min-height: 100%;
}

.editor-step-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.editor-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.editor-inline-code {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.editor-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.editor-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.editor-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.85rem;
}

.editor-json {
  margin: 0;
  padding: 1rem;
  border-radius: 18px;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.editor-requirements-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.editor-project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 900px) {
  .editor-checkbox-grid,
  .editor-status-grid {
    grid-template-columns: 1fr;
  }
}
