/* ==========================================================================
   FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Sans:wght@400;500;600;700&display=swap');


/* ==========================================================================
   THEME VARIABLES (light / paper theme — base values)
   ========================================================================== */
:root {
  color-scheme: dark;
  --ink: #18211f;
  --muted: #6f7c77;
  --paper: #f6f5ef;
  --line: #d8ddd5;
  --acid: #d0ff00;
  --coral: #2097b4;
  --blue: #9de0dc;
  --deep: #253a36;
}


/* ==========================================================================
   RESET / BASE
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
}

button,
input {
  font: inherit;
}


/* ==========================================================================
   APP SHELL / LAYOUT
   ========================================================================== */
.app-shell {
  position: relative;
  min-height: 100vh;
  max-width: 1540px;
  margin: auto;
  padding: 0 44px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, .82fr) minmax(540px, 1.18fr);
  gap: 70px;
  padding: 64px 0 48px;
}


/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  position: relative;
  z-index: 10;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: transparent;
  backdrop-filter: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0em;
  font-size: 14px;
}

.brand em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
  letter-spacing: .08em;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--acid);
  border-radius: 3px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 17px;
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  background: var(--blue);
}

.topbar-status {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-render {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(55, 184, 212, .65);
  border-radius: 3px;
  background: var(--blue);
  color: #071015;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(55, 184, 212, .14);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.topbar-render:hover {
  transform: translateY(-1px);
  background: #65d1e4;
  box-shadow: 0 11px 26px rgba(55, 184, 212, .25);
}

.topbar-render span {
  font-size: 10px;
}

.topbar-render b {
  margin-left: 7px;
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #68b98b;
  box-shadow: 0 0 0 4px #dfeee2;
}

.status-divider {
  height: 17px;
  border-left: 1px solid var(--line);
}


/* ==========================================================================
   CONTROL PANEL — TYPOGRAPHY & INTRO
   ========================================================================== */
.control-panel {
  padding: 0 0 0 7%;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 700;
}

.eyebrow span {
  color: var(--coral);
  margin-left: 7px;
}

h1,
h2 {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  letter-spacing: -.045em;
  margin: 17px 0 15px;
  line-height: .98;
}

h1 {
  font-size: clamp(40px, 5vw, 72px);
}

h1 strong {
  color: var(--coral);
}

h2 {
  font-size: 35px;
  margin: 10px 0 0;
}

.intro {
  max-width: 375px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 40px;
}


/* ==========================================================================
   CONTROL PANEL LOCK (grays out settings while a render is active)
   ========================================================================== */
.control-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #101a22;
}

.control-lock[hidden] {
  display: none;
}

.control-lock-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.make-another-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #071015;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  flex: none;
}

.make-another-button:hover {
  opacity: .85;
}

.form-fields.is-locked {
  opacity: .45;
  filter: grayscale(1);
  pointer-events: none;
  user-select: none;
}


/* ==========================================================================
   FORM FIELDS (text inputs)
   ========================================================================== */
.field-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin: 0 0 9px;
}

.field-label span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #a1aaa5;
  margin-left: 5px;
}

.input-wrap {
  background: #fff;
  height: 60px;
  border: 1px solid #cdd5ce;
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 11px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(36, 57, 50, .04);
}

.input-wrap:focus-within {
  border-color: var(--ink);
}

.input-icon {
  color: var(--coral);
  font-size: 20px;
}

.input-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  color: var(--ink);
}

.input-wrap input::placeholder {
  color: #a8b1ac;
}

.source-badge {
  font-size: 9px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: .1em;
}

.source-kind-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0f1920;
}

.source-kind {
  min-height: 36px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.source-kind.active {
  background: var(--blue);
  color: #071015;
}

.source-upload-panel input[type="file"] {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid #2b3b45;
  border-radius: 4px;
  background: #101a22;
  color: var(--ink);
  font-size: 12px;
}

.source-upload-panel input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  background: var(--blue);
  color: #071015;
  font-weight: 700;
  cursor: pointer;
}

.field-hint {
  color: #94a09a;
  font-size: 11px;
  margin: 8px 0 32px;
}

.text-input {
  height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  outline: 0;
  border-radius: 3px;
  font-size: 13px;
}

.text-input:focus {
  border-color: var(--ink);
}


/* ==========================================================================
   SECTION HEADINGS (small uppercase dividers)
   ========================================================================== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 700;
  margin: 25px 0 12px;
}

.section-line {
  height: 1px;
  flex: 1;
  background: var(--line);
}


/* ==========================================================================
   SEGMENTED CONTROL (e.g. mode switch)
   ========================================================================== */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  padding: 4px;
  gap: 4px;
  background: #eeeee8;
}

.segment {
  border: 0;
  text-align: left;
  background: transparent;
  padding: 12px 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.segment.active {
  background: var(--ink);
  color: white;
}

.segment:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.segment-icon {
  font-size: 22px;
  color: var(--coral);
}

.segment small {
  display: block;
  color: inherit;
  opacity: .65;
  font-size: 10px;
  margin-top: 3px;
}


/* ==========================================================================
   FACECAM MARKER (manual position picker, opens as a full-screen modal)
   ========================================================================== */
.facecam-marker {
  margin-top: 16px;
}

.facecam-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #101a22;
  padding: 10px 12px;
  border-radius: 3px;
}

.facecam-summary .field-hint {
  margin: 0;
}

.facecam-open-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #071015;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
}

.facecam-open-button:hover {
  opacity: .85;
}

body.facecam-modal-open {
  overflow: hidden;
}

.facecam-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 10, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 200;
}

.facecam-modal-backdrop[hidden] {
  display: none;
}

.facecam-modal {
  background: #101a22;
  border: 1px solid #2b3b45;
  border-radius: 4px;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px 26px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.facecam-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.facecam-modal-head .eyebrow {
  display: block;
  margin-bottom: 6px;
}

.facecam-modal-head h3 {
  margin: 0;
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  letter-spacing: -.02em;
  font-size: 24px;
  color: var(--ink);
}

.facecam-modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}

.facecam-modal-close:hover {
  color: var(--ink);
}

.facecam-modal-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.facecam-done-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #071015;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
}

.facecam-done-button:hover {
  opacity: .85;
}

.facecam-frame-wrap {
  border: 1px solid var(--line);
  background: #0b1117;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.facecam-frame-empty {
  padding: 26px;
  text-align: center;
}

.facecam-load-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #071015;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
}

.facecam-load-button:hover {
  opacity: .85;
}

.facecam-load-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.facecam-frame-stage {
  position: relative;
  width: 100%;
  user-select: none;
  line-height: 0;
}

.facecam-frame-stage img {
  width: 100%;
  display: block;
  cursor: crosshair;
}

.facecam-rect {
  position: absolute;
  border: 2px solid var(--acid);
  background: rgba(208, 255, 0, .16);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  cursor: move;
}

.facecam-rect .facecam-rect-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  right: -8px;
  bottom: -8px;
  background: #0b1117;
  border: 2px solid var(--acid);
  border-radius: 50%;
  cursor: nwse-resize;
}

.facecam-loupe {
  position: absolute;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 3px solid var(--acid);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .4);
  pointer-events: none;
  z-index: 5;
  background: #0b1117;
}

.facecam-loupe[hidden] {
  display: none;
}

.facecam-marker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.facecam-marker-actions .field-hint {
  margin: 0;
}

.facecam-clear-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
}

.facecam-clear-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}


/* ==========================================================================
   SETTINGS GRID / TITLE PREVIEW ROW
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 21px;
}

.title-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 17px 0 3px;
}

.tiny-label {
  color: #9aa49e;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: 9px;
}

.mini-title {
  font-family: 'Archivo Black', sans-serif;
  margin-top: 7px;
  font-size: 17px;
}

.wrap-note {
  color: #8e9993;
  font-size: 10px;
}

.visual-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.source-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.source-preview-row .field-hint {
  margin: 0;
}

.source-preview-button {
  flex: none;
  padding: 8px 11px;
  border: 1px solid #3a5360;
  border-radius: 4px;
  background: #14212a;
  color: #dcecef;
  font: 700 10px 'DM Sans', sans-serif;
  cursor: pointer;
}

.source-preview-button:hover {
  border-color: var(--blue);
}

.source-preview-button:disabled {
  cursor: wait;
  opacity: .55;
}

.visual-preset {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #0f1920;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.visual-preset.active {
  border-color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.visual-preset > span:last-child {
  display: block;
  margin-top: 8px;
}

.visual-preset b,
.visual-preset small {
  display: block;
}

.visual-preset b {
  font-size: 11px;
}

.visual-preset small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.preset-swatch {
  display: grid;
  place-items: center;
  width: 100%;
  height: 36px;
  overflow: hidden;
  background: #080c12;
  font-size: 20px;
  text-align: center;
}

.preset-swatch-viral {
  color: #ffe500;
  font-family: 'Anton', sans-serif;
  -webkit-text-stroke: 2px #000;
}

.preset-swatch-clean {
  color: #fff;
  background: #172129;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
}

.preset-swatch-neon {
  color: #28e7ff;
  background: #160525;
  font-family: 'Bangers', cursive;
  text-shadow: 2px 2px #ff39ce;
}

.select-input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--line);
  background: #0f1920;
}

.color-control input {
  width: 52px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.color-control span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.range-input {
  width: 100%;
  height: 43px;
  accent-color: var(--blue);
  cursor: pointer;
}

.visual-toggle {
  margin-top: 14px;
}

/* Numbered step badge shared by "Source link" and every collapsible summary. */
.form-fields {
  counter-reset: step;
  overflow-anchor: none;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.step-row .field-label {
  margin-bottom: 0;
}

.step-badge {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #172530;
  border: 1px solid #2b3b45;
  color: var(--blue);
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  counter-increment: step;
  transition: background .25s ease, color .25s ease;
}

.step-badge::before {
  content: counter(step);
}

.optional-layers {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #0f1920;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.optional-layers:hover {
  border-color: #33474f;
}

.optional-layers[open] {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(55, 184, 212, .1);
}

.optional-layers summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.optional-layers summary::-webkit-details-marker {
  display: none;
}

.optional-layers summary::marker {
  content: '';
}

.optional-layers[open] .step-badge {
  background: var(--blue);
  color: #071015;
}

.step-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.step-copy b {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--ink);
}

.step-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .02em;
}

.step-chevron {
  flex: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: transform .3s ease, color .25s ease;
}

.optional-layers[open] .step-chevron {
  color: var(--blue);
  transform: rotate(180deg);
}

.optional-layers[open] summary {
  border-bottom: 1px solid var(--line);
}

.optional-layers .details-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.optional-layers .details-body .settings-grid,
.optional-layers .details-body .segmented,
.optional-layers .details-body .facecam-marker,
.optional-layers .details-body .settings-panel-section,
.optional-layers .details-body .toggle-row,
.optional-layers .details-body .section-heading,
.optional-layers .details-body .trim-hint {
  margin: 0;
}

.wrap-icon {
  color: var(--coral);
  font-size: 18px;
  vertical-align: middle;
  margin-right: 3px;
}

.title-position {
  margin-top: 18px;
}


/* ==========================================================================
   COMPUTE OPTIONS (radio-style cards)
   ========================================================================== */
.compute-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compute-card {
  display: flex;
  position: relative;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.compute-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--acid);
}

.compute-card input {
  display: none;
}

.compute-icon {
  font-size: 20px;
  color: var(--coral);
}

.compute-card b {
  display: block;
  font-size: 12px;
}

.compute-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.radio-mark {
  margin-left: auto;
  width: 12px;
  height: 12px;
  border: 1px solid #b8c2bb;
  border-radius: 50%;
}

.selected .radio-mark {
  border: 4px solid var(--coral);
}

.privacy-note {
  color: #98a29d;
  text-align: center;
  font-size: 10px;
  margin: 25px 0 13px;
}

.privacy-note span {
  color: #6cb58d;
  font-size: 17px;
  vertical-align: middle;
  margin-right: 4px;
}


/* ==========================================================================
   PREVIEW PANEL — HEADER / STAGE / GRID
   ========================================================================== */
.preview-panel {
  min-width: 0;
}

@media (min-width: 901px) {
  .preview-sticky {
    position: sticky;
    top: 16px;
  }
}

@media (min-width: 901px) and (max-height: 850px) {
  .preview-sticky .preview-stage {
    min-height: clamp(400px, calc(100vh - 285px), 500px);
    margin-top: 18px;
  }

  .preview-sticky .vertical-preview {
    transform: scale(.88);
  }

  .preview-sticky .queue-card {
    margin-top: 12px;
    padding: 12px 14px;
  }

  .preview-sticky .queue-body {
    margin-top: 8px;
  }

  .preview-sticky .render-action {
    min-height: 42px;
    margin-top: 8px;
  }
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.format-pill {
  padding: 8px 10px;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
}

.preview-stage {
  position: relative;
  min-height: 585px;
  margin-top: 28px;
  background: #e8eae2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: .45;
  background-image:
    linear-gradient(#d4d9d0 1px, transparent 1px),
    linear-gradient(90deg, #d4d9d0 1px, transparent 1px);
  background-size: 42px 42px;
}

.stage-label {
  position: absolute;
  bottom: 17px;
  left: 20px;
  right: 20px;
  color: #7e8b84;
  font-size: 9px;
  letter-spacing: .14em;
}

.stage-label span {
  float: right;
  color: var(--coral);
}

.preview-stage.has-result {
  background: #253a36;
}

.preview-stage.has-result .stage-grid {
  opacity: .12;
}

.preview-stage.has-result .stage-label {
  display: none;
}


/* ==========================================================================
   OUTPUT PREVIEW — the full 1080 × 1920 composition scaled to the panel
   ========================================================================== */
.vertical-preview {
  position: relative;
  width: 245px;
  height: 435px;
  overflow: hidden;
  border: 0;
  outline: 1px solid rgba(255, 255, 255, .35);
  background: #152d2a;
  box-shadow: 18px 20px 35px rgba(38, 54, 46, .2);
}

.preview-bg {
  position: absolute;
  inset: -20px;
  background:
    radial-gradient(circle at 20% 15%, rgba(55, 184, 212, .38), transparent 60%),
    radial-gradient(circle at 85% 90%, rgba(201, 243, 107, .22), transparent 55%),
    linear-gradient(135deg, #0f232b 0%, #0b1117 100%);
  filter: blur(14px);
  transform: scale(1.12);
}

.preview-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 25% 20%, rgba(55, 184, 212, .3), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(201, 243, 107, .2), transparent 50%),
    linear-gradient(160deg, #0e262d 0%, #0b1117 100%);
  overflow: hidden;
}

.vertical-preview.has-source .preview-main {
  background-color: #05070c;
}

.vertical-preview.has-source .preview-bg {
  opacity: .9;
}

.preview-facecam-layer {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 8.333%;
  overflow: hidden;
  background-repeat: no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

.fake-action {
  position: absolute;
  left: 19%;
  top: 42%;
}

.action-ring {
  display: block;
  width: 70px;
  height: 70px;
  border: 2px solid var(--acid);
  border-radius: 50%;
  opacity: .75;
}

.action-copy {
  position: absolute;
  top: 18px;
  left: 12px;
  font-family: 'Archivo Black';
  color: #fff;
  line-height: .85;
  font-size: 19px;
  transform: rotate(-7deg);
}

.preview-hook {
  position: absolute;
  top: 13px;
  left: 6.48%;
  width: 87.04%;
  color: #fff;
  font-family: 'Archivo Black';
  text-align: center;
  font-size: 14px;
  line-height: 1.05;
  -webkit-text-stroke: 4px #000;
  paint-order: stroke fill;
  text-shadow: 1px 2px 2px rgba(0, 0, 0, .6);
  white-space: pre-line;
}

.mini-title {
  white-space: pre-line;
}

.preview-hook mark {
  background: none;
  color: var(--preview-accent, #ffe500);
}

.preview-hook-layer {
  display: block;
  white-space: pre-line;
}

.preview-hook-front {
  color: var(--preview-text, #fff);
}

.preview-hook-outer {
  position: relative;
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook-middle,
.vertical-preview[data-preset="neon-gaming"] .preview-hook-front {
  position: absolute;
  inset: 0;
}

.preview-eyebrow,
.preview-cta,
.preview-watermark,
.preview-progress {
  position: absolute;
  z-index: 3;
}

.preview-eyebrow {
  top: 7px;
  left: 50%;
  max-width: 52%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--preview-accent, #ffe500);
  color: #080b12;
  font: 900 7px 'Montserrat', sans-serif;
  line-height: 1.25;
  letter-spacing: .15em;
  overflow-wrap: anywhere;
  text-align: center;
  transform: translateX(-50%);
}

.preview-cta {
  bottom: 48px;
  left: 50%;
  max-width: 78%;
  padding: 5px 9px;
  border-radius: 5px;
  background: #fff;
  color: #080b12;
  font: 900 9px 'Montserrat', sans-serif;
  text-align: center;
  transform: translateX(-50%);
}

.preview-watermark {
  top: 10px;
  right: 9px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(8, 12, 18, .58);
  color: #fff;
  font: 700 7px 'Oswald', sans-serif;
  letter-spacing: .08em;
}

.preview-progress {
  right: 10px;
  bottom: 3px;
  left: 10px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255,255,255,.22);
}

.preview-progress span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: var(--preview-accent, #ffe500);
  box-shadow: 0 0 8px var(--preview-accent, #ffe500);
}

.vertical-preview[data-preset="viral-punch"] .preview-hook {
  font-family: 'Anton', sans-serif;
}

.vertical-preview[data-preset="clean-creator"] .preview-hook {
  padding: 7px 5px;
  border-radius: 7px;
  background: rgba(8, 14, 20, .82);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  line-height: 1.08;
  -webkit-text-stroke: 0;
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook {
  font-family: 'Bangers', cursive;
  letter-spacing: .04em;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook-outer {
  color: #160525;
  -webkit-text-stroke: var(--neon-outer-stroke) #160525;
  paint-order: stroke fill;
  text-shadow:
    0 0 var(--neon-glow-tight) var(--preview-glow),
    0 0 var(--neon-glow-wide) var(--preview-glow);
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook-middle {
  color: #ff39ce;
  -webkit-text-stroke: var(--neon-inner-stroke) #ff39ce;
  paint-order: stroke fill;
  transform: translate(var(--neon-offset), var(--neon-offset));
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook-front {
  color: var(--preview-text);
  -webkit-text-stroke: var(--neon-front-stroke) #160525;
  paint-order: stroke fill;
  text-shadow: 0 0 var(--neon-glow-tight) var(--preview-glow);
}

.vertical-preview[data-preset="neon-gaming"] .preview-hook-front mark {
  color: var(--preview-accent);
}

.preview-hook[data-animation="word-pop"] {
  animation: preview-pop .6s cubic-bezier(.16, 1.2, .3, 1) both;
}

.preview-hook[data-animation="slide-up"] {
  animation: preview-slide .6s cubic-bezier(.16, 1, .3, 1) both;
}

.preview-hook[data-animation="zoom-in"] {
  animation: preview-zoom .55s cubic-bezier(.16, 1.25, .3, 1) both;
}

.preview-hook[data-animation="typewriter"] {
  clip-path: inset(0 0 0 0);
  animation: preview-type 1.4s steps(12) both;
}

@keyframes preview-pop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes preview-slide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes preview-zoom {
  from { opacity: 0; transform: scale(.35) rotate(-3deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes preview-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.preview-caption {
  position: absolute;
  bottom: 10px;
  left: 9px;
  color: #fff;
  font-size: 7px;
  letter-spacing: .1em;
  opacity: .8;
}


/* ==========================================================================
   CREATOR BADGE
   Static placement, bottom-left \u2014 matches the fixed layout burned in by
   web_server.py (CREATOR_ALIGNMENT etc.).
   ========================================================================== */
.creator-badge {
  position: absolute;
  z-index: 2;
  top: 89.8%;
  left: 12.25px;
  display: flex;
  align-items: center;
  gap: 3.63px;
  min-height: 19.5px;
  padding: 3.18px 5px 3.18px 3.18px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 35%, #f97316 100%);
  border: .45px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  font-size: 7.71px;
  font-family: Arial, sans-serif;
  letter-spacing: .02em;
  box-shadow: 0 10px 22px rgba(139, 92, 246, .38), inset 0 1px 0 rgba(255, 255, 255, .28);
  transform-origin: top center;
  overflow: hidden;
  animation:
    creator-pop .48s cubic-bezier(.16, 1.35, .3, 1) both,
    creator-glow 3.2s ease-in-out .48s infinite;
}

.creator-badge::before {
  content: "";
  position: absolute;
  inset: -30% auto -30% -15%;
  width: 45%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
  animation: creator-shimmer 2.75s ease-in-out infinite;
}

.creator-badge .creator-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 13.15px;
  height: 13.15px;
  padding: 1.81px;
  background: rgba(255, 255, 255, .94);
  border-radius: 50%;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 0 0 .68px rgba(255, 255, 255, .22);
}

.creator-badge .creator-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.creator-badge .creator-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
}

.creator-badge .creator-label {
  display: block;
  font-size: 7px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}

.creator-badge .creator-name {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  align-self: stretch;
  font-weight: 800;
  font-size: 7.71px;
  line-height: 1;
  letter-spacing: .02em;
}

.creator-badge .creator-dot {
  position: relative;
  z-index: 1;
  width: 3.18px;
  height: 3.18px;
  border-radius: 50%;
  background: #d8ff72;
  box-shadow: 0 0 0 1.59px rgba(216, 255, 114, .18);
  animation: creator-dot-pulse 1.7s ease-in-out infinite;
}

.inline-settings {
  margin-top: 24px;
  padding: 0 16px 18px;
  border: 1px solid #2b3b45;
  border-radius: 4px;
  background: #101a22;
}

.inline-settings > .section-heading {
  margin-top: 16px;
}

.inline-settings .toggle-row {
  margin-top: 17px;
}


/* ==========================================================================
   QUEUE CARD (render job status)
   ========================================================================== */
.queue-card {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px 20px;
}

.queue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-state {
  font-size: 9px;
  letter-spacing: .14em;
  padding: 5px 8px;
  background: #e3f0e3;
  color: #43825d;
}

.queue-state.running {
  background: #fff0cf;
  color: #b17a22;
  animation: status-pulse 1.2s ease-in-out infinite;
}

.queue-state.done {
  background: #dff1ef;
  color: #277d77;
}

.queue-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
}

.queue-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--deep);
  color: var(--acid);
  border-radius: 50%;
  transition: transform .3s;
}

.queue-card:has(.queue-state.running) .queue-icon {
  animation: worker-spin 1.1s linear infinite;
}

.queue-copy strong {
  display: block;
  font-size: 13px;
}

.queue-copy span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.queue-copy a {
  color: var(--coral);
  font-weight: 700;
  text-decoration: none;
}

.queue-progress {
  position: relative;
  width: 100px;
  height: 4px;
  margin-left: auto;
  background: #e9ece8;
  overflow: hidden;
}

.queue-progress span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
  transition: width .3s;
}

.queue-progress span::after {
  content: none;
}

.queue-card:has(.queue-state.running) .queue-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45px;
  background: rgba(255, 255, 255, .65);
  filter: blur(5px);
  animation: progress-sheen 1.1s linear infinite;
}

.cancel-button {
  border: 1px solid #e3b7ad;
  background: #fff7f4;
  color: #b35443;
  padding: 8px 11px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cancel-button:hover {
  background: #ffe9e3;
}

.cancel-button:disabled {
  opacity: .6;
  cursor: wait;
}


/* ==========================================================================
   RESULT CARD / DOWNLOAD
   ========================================================================== */
.result-card {
  position: absolute;
  inset: 20px 20px 42px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.result-card[hidden] {
  display: none;
}

.result-card .eyebrow {
  align-self: center;
  color: #d7e7c0;
}

.result-card video {
  display: block;
  width: min(100%, 245px);
  height: min(435px, calc(100% - 76px));
  margin: 12px auto 20px;
  background: #101917;
  box-shadow: none;
}

.download-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0 20px;
  background: var(--acid);
  color: var(--ink);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border-radius: 3px;
  transition: transform .2s, box-shadow .2s;
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(217, 244, 90, .2);
}

/* ==========================================================================
   POSITION PICKER (title position selector)
   ========================================================================== */
.position-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #eeeee8;
}

.position-option {
  position: relative;
  width: 100%;
  height: 64px;
  border: 1px solid #d3d9d1;
  background: #fff;
  cursor: pointer;
}

.position-option::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 50px;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  border: 1px solid #d9ded8;
  border-radius: 1px;
  background: linear-gradient(#f4f5ee, #e7ebe3);
}

.position-option span {
  position: absolute;
  z-index: 1;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 120, 95, .14);
}

.position-option:nth-child(1) span { top: 14px; }
.position-option:nth-child(2) span { top: 23px; }
.position-option:nth-child(3) span { top: 32px; }
.position-option:nth-child(4) span { top: 39px; }
.position-option:nth-child(5) span { top: 45px; }

.position-option.active {
  border-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--acid);
}

.position-option:not(.active) span {
  background: #aab5ac;
  box-shadow: none;
}


/* ==========================================================================
   TOGGLE ROW (checkbox switch)
   ========================================================================== */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  cursor: pointer;
  color: var(--ink);
}

.toggle-row:has(input:disabled) {
  opacity: .42;
  cursor: not-allowed;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-box {
  width: 18px;
  height: 18px;
  border: 1px solid #aab5ac;
  background: #fff;
  border-radius: 3px;
  flex: none;
}

.toggle-row input:checked + .toggle-box {
  border-color: #9146ff;
  background: #9146ff;
  box-shadow: inset 0 0 0 4px #fff;
}

.toggle-row b {
  display: block;
  font-size: 11px;
}

.toggle-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}


/* ==========================================================================
   ADVANCED SETTINGS (collapsible <details> panel)
   ========================================================================== */
.advanced-settings {
  position: relative;
  z-index: 5;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary b {
  color: var(--coral);
  font-size: 18px;
  font-weight: 400;
  transition: transform .2s;
}

.advanced-settings[open] summary b {
  transform: rotate(45deg);
}

.advanced-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(70vh, 540px);
  overflow: auto;
  padding: 0 18px 18px;
  background: #101a22;
  border: 1px solid #2b3b45;
  border-top: 0;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .34);
}

.advanced-content .settings-grid:first-child {
  margin-top: 4px;
}


/* ==========================================================================
   RENDER ACTION BUTTON
   ========================================================================== */
.render-action {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 243, 107, .6);
  border-radius: 4px;
  background: var(--acid);
  color: #0b1117;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(201, 243, 107, .12);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.render-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(201, 243, 107, .2);
}

.render-action[data-state="running"] {
  background: #ff786f;
  border-color: #ff9a91;
  color: #210d0d;
  box-shadow: 0 10px 24px rgba(255, 120, 111, .16);
}

.render-action[data-state="starting"] {
  cursor: wait;
  opacity: .72;
}

.render-action:disabled {
  cursor: wait;
}


/* ==========================================================================
   SETTINGS MENU (dropdown trigger + panel)
   ========================================================================== */
.settings-menu {
  position: relative;
  z-index: 6;
  margin-top: 20px;
}

.settings-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #2b3b45;
  border-radius: 3px;
  background: #101a22;
  color: #91a4ad;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.settings-trigger span {
  color: var(--blue);
  font-size: 16px;
}

.settings-trigger b {
  flex: 1;
  font-weight: 700;
}

.settings-trigger i {
  color: var(--blue);
  font-size: 17px;
  font-style: normal;
  transition: transform .2s;
}

.settings-trigger.open i {
  transform: rotate(180deg);
}

.settings-trigger:hover,
.settings-trigger.open {
  border-color: var(--blue);
  background: #14242d;
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(72vh, 560px);
  overflow: auto;
  padding: 8px 16px 18px;
  border: 1px solid #2b3b45;
  border-radius: 4px;
  background: #101a22;
  box-shadow: 0 20px 42px rgba(0, 0, 0, .42);
}

.settings-panel[hidden] {
  display: none;
}

.settings-panel-section + .title-position {
  margin-top: 18px;
}

.settings-panel .section-heading {
  margin-top: 14px;
}

.settings-panel .toggle-row {
  margin-top: 17px;
}


/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  color: #a0aaa4;
  font-size: 9px;
  letter-spacing: .12em;
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
}

.footer-line {
  display: flex;
  justify-content: space-between;
}

.privacy-details {
  margin-top: 12px;
  max-width: 680px;
  letter-spacing: 0;
}

.privacy-details summary {
  width: fit-content;
  color: #81949d;
  cursor: pointer;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-details p {
  margin: 10px 0 0;
  color: #71858e;
  font-size: 11px;
  line-height: 1.6;
}


/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes creator-pop {
  0%   { opacity: 0; transform: translateY(-10px) scale(.72); }
  62%  { opacity: 1; transform: translateY(3px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes creator-glow {
  0%, 100% {
    box-shadow: 0 10px 22px rgba(139, 92, 246, .38), inset 0 1px 0 rgba(255, 255, 255, .28);
  }
  50% {
    box-shadow: 0 12px 28px rgba(168, 85, 247, .50), 0 0 0 8px rgba(168, 85, 247, .08), inset 0 1px 0 rgba(255, 255, 255, .28);
  }
}

@keyframes creator-shimmer {
  0%   { transform: translateX(-110%) rotate(18deg); opacity: 0; }
  15%  { opacity: 1; }
  45%  { transform: translateX(260%) rotate(18deg); opacity: 0; }
  100% { transform: translateX(260%) rotate(18deg); opacity: 0; }
}

@keyframes creator-dot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(216, 255, 114, .3); }
  50%      { transform: scale(1.2); box-shadow: 0 0 0 7px rgba(216, 255, 114, 0); }
}

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

@keyframes progress-sheen {
  from { transform: translateX(-60px); }
  to   { transform: translateX(120px); }
}

@keyframes status-pulse {
  50% { opacity: .55; }
}


/* ==========================================================================
   RESPONSIVE — LIGHT THEME
   ========================================================================== */
@media (max-width: 900px) {
  .app-shell { padding: 0 20px; }
  .workspace { grid-template-columns: 1fr; gap: 40px; padding-top: 38px; }
  .control-panel { padding-left: 0; }
  .preview-panel {
    order: -1;
  }
  .preview-stage { min-height: 470px; }
  .topbar-status { display: none; }
}

@media (max-width: 520px) {
  h1 { font-size: 43px; }
  .settings-grid,
  .compute-options { grid-template-columns: 1fr; }
  .workspace { padding-top: 28px; }
  .preview-stage { min-height: 420px; }
  .vertical-preview { transform: scale(.82); }
  .preview-header { align-items: start; flex-direction: column; gap: 15px; }
  footer { line-height: 2; }
  .footer-line { display: block; }
}


/* ==========================================================================
   DARK STUDIO THEME (overrides the light theme above)
   ========================================================================== */
:root {
  --ink: #edf4f5;
  --muted: #9aabb1;
  --paper: #111a20;
  --line: #34444b;
  --acid: #c9f36b;
  --coral: #37b8d4;
  --blue: #37b8d4;
  --deep: #18252b;
}

body {
  background: var(--paper);
  color: var(--ink);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 34px 34px;
}

.topbar { border-bottom-color: var(--line); }
.brand { color: var(--ink); }
.brand em { color: #7d909a; }
.brand-mark { background: #edf4f5; color: #111a20; }
.topbar-status { color: #8ba0aa; }
.status-dot { background: #c9f36b; box-shadow: 0 0 0 4px rgba(201, 243, 107, .12); }
.status-divider { border-color: var(--line); }
.topbar-render { background: var(--blue); }

h1, h2 { color: #f0f7f9; }
h1 strong { color: var(--blue); }
.intro { color: #8ea1ab; }
.eyebrow { color: #71858f; }
.eyebrow span { color: var(--blue); }

.field-label { color: #91a4ad; }
.field-label span { color: #60747e; }
.field-hint { color: #647983; }

.input-wrap,
.text-input,
.compute-card,
.format-pill,
.queue-card {
  background: #17232a;
  border-color: #354750;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}

.input-wrap:focus-within,
.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(55, 184, 212, .1);
}

.input-wrap input,
.text-input {
  color: var(--ink);
}

.input-wrap input::placeholder { color: #5d707a; }
.input-icon { color: var(--blue); }
.source-badge { border-color: #32444e; color: #8da1aa; }

.section-heading { color: #8298a2; }
.section-line { background: #263640; }

.segmented,
.position-picker {
  background: #162128;
  border-color: #354750;
}

.segment { color: #81949e; }
.segment.active { background: #dcecf0; color: #0b1117; }
.segment-icon { color: var(--blue); }
.segment small { color: inherit; }

.title-preview-row,
.title-position { color: var(--ink); }
.mini-title { color: #eff8fa; }
.wrap-note { color: #71858e; }

.position-option { background: #14212a; border-color: #30424c; }
.position-option::before { border-color: #3a4e58; background: linear-gradient(#1b2a33, #111b22); }
.position-option.active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue), 0 0 0 1px rgba(55, 184, 212, .18); }
.position-option:not(.active) span { background: #63757d; }

.toggle-box { background: #17232a; border-color: #526973; }
.toggle-row { color: var(--ink); }
.toggle-row small { color: #71858e; }
.toggle-row input:checked + .toggle-box { border-color: var(--blue); background: var(--blue); }

.compute-card.selected { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.compute-card b { color: #edf7f8; }
.compute-card small { color: #71858e; }
.radio-mark { border-color: #536872; }
.selected .radio-mark { border-color: var(--blue); }

.render-button { background: var(--blue); color: #071015; box-shadow: 0 10px 25px rgba(55, 184, 212, .18); }
.render-button:hover { box-shadow: 0 14px 30px rgba(55, 184, 212, .3); }
.privacy-note { color: #71858e; }

.preview-header h2 { color: #eef7f8; }
.format-pill { color: #8ea2ab; }
.preview-stage { background: #18252c; border: 1px solid #354952; box-shadow: inset 0 0 80px rgba(55, 184, 212, .035); }
.stage-grid {
  opacity: .25;
  background-image:
    linear-gradient(#263943 1px, transparent 1px),
    linear-gradient(90deg, #263943 1px, transparent 1px);
}
.stage-label { color: #69808b; }
.stage-label span { color: var(--blue); }

.vertical-preview { background: #071015; box-shadow: 0 22px 45px rgba(0, 0, 0, .45); outline: 1px solid #40525b; }

.preview-stage.has-result { background: #0d171e; }
.result-card video { background: #071015; box-shadow: none; }
.result-card .eyebrow { color: #b9eaf1; }
.download-button { background: var(--acid); color: #0b1117; }

.creator-badge { background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 42%, #f97316 100%); }

.queue-card { background: #17232a; }
.queue-state { background: rgba(201, 243, 107, .12); color: var(--acid); }
.queue-state.running { background: rgba(55, 184, 212, .14); color: var(--blue); }
.queue-state.done { background: rgba(55, 184, 212, .14); color: #74d8e9; }
.queue-icon { background: #dcecf0; color: #0b1117; }
.queue-copy span { color: #71858e; }
.queue-progress { background: #1e2c34; }
.queue-progress span { background: var(--blue); }
.cancel-button { background: #211c24; border-color: #684f5b; color: #e4a7bd; }

.architecture-note { display: flex; align-items: flex-start; gap: 10px; padding: 17px 4px; color: #71858e; font-size: 11px; line-height: 1.5; }
.architecture-note p { margin: 0; }
.architecture-note b { color: #dcebef; }
.note-mark { width: 17px; height: 17px; border: 1px solid #4b626d; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 10px; flex: none; }

footer { border-top-color: var(--line); color: #60747e; }


/* ==========================================================================
   RESPONSIVE — DARK THEME
   ========================================================================== */
@media (max-width: 520px) {
  .app-shell { padding: 0 14px; }
  .topbar { height: 70px; }
  .brand { font-size: 12px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .topbar-actions { gap: 0; }
  .topbar-render { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .topbar-render b { display: none; }
}