:root {
  color-scheme: dark;
  --bg: #0B0F1A;
  --surface: #111624;
  --surface-2: #171E2E;
  --line: #293148;
  --text: #f5f7fa;
  --muted: #9da3ad;
  --cyan: #2563FF;
  --blue: #2563FF;
  --violet: #8B5CF6;
  --pink: #FF4DFF;
  --coral: #FF6B6B;
  --brand-gradient: linear-gradient(100deg, var(--blue), var(--violet) 52%, var(--pink) 76%, var(--coral));
  --danger: #ff7379;
  --success: #62e6ac;
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
h1, h2, h3, button, .eyebrow, .product-picker strong, .choice-grid strong { font-family: "Sora", "Poppins", ui-sans-serif, system-ui, sans-serif; }
html { background: var(--bg); }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, label, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.page-shell { width: min(100%, 760px); margin: 0 auto; padding: 0 16px max(28px, env(safe-area-inset-bottom)); }
.brand-header { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #24262a; }
.brand-header img { width: 170px; height: auto; display: block; }
.secure-label { color: var(--muted); font-size: 12px; padding-left: 12px; border-left: 2px solid var(--cyan); }
.state-panel { min-height: 55vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); text-align: center; }
.state-panel--error strong { color: var(--text); font-size: 20px; }
.spinner, .button-spinner { width: 22px; height: 22px; border: 2px solid #3b3e45; border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.intro-band { padding: 38px 2px 26px; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }
.intro-band h1, .success-state h1 { margin: 8px 0 10px; font-size: 46px; line-height: 1.03; letter-spacing: 0; }
.intro-band p, .success-state > p { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.55; }
.form-error { margin-bottom: 14px; padding: 13px 14px; border: 1px solid #7d3138; background: #29171a; color: #ffc5c8; border-radius: 6px; font-size: 14px; }
.credit-status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin: 0 0 24px; padding: 14px; border: 1px solid rgba(37, 99, 255, .28); border-left: 3px solid var(--cyan); border-radius: 6px; background: rgba(37, 99, 255, .065); }
.credit-status > div { min-width: 94px; }
.credit-status span, .credit-status small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.credit-status > div strong { display: block; margin-top: 2px; color: var(--cyan); font-size: 30px; line-height: 1; }
.credit-status p { min-width: 0; margin: 0; }
.credit-status p strong { display: block; font-size: 13px; line-height: 1.4; }
.credit-status p small { margin-top: 4px; }
.credit-status.is-empty { border-color: #753137; border-left-color: var(--danger); background: #241517; }
.credit-status.is-empty > div strong { color: var(--danger); }
.form-section { padding: 26px 0; border-top: 1px solid #24262a; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.step-number { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border: 1px solid #3b3e45; color: var(--cyan); font: 700 12px/1 monospace; border-radius: 6px; }
.section-heading h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.field { display: grid; gap: 8px; margin-top: 18px; color: #d9dce2; font-size: 13px; font-weight: 650; }
.field b, legend b, .check-row b { color: var(--cyan); }
input, textarea, select { width: 100%; min-height: 48px; border: 1px solid #353941; border-radius: 6px; background: #111215; color: var(--text); padding: 12px 13px; outline: none; }
textarea { resize: vertical; min-height: 112px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #2563FF18; }
input::placeholder, textarea::placeholder { color: #6f7580; }
.product-picker, .choice-grid { border: 0; padding: 0; margin: 22px 0 0; }
.product-picker legend, .choice-grid legend { margin-bottom: 10px; color: #d9dce2; font-size: 13px; font-weight: 650; }
.product-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.product-picker legend { grid-column: 1 / -1; }
.product-picker label, .choice-grid label { position: relative; min-width: 0; cursor: pointer; }
.product-picker input, .choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.product-picker label > span, .choice-grid label > span { min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 12px; border: 1px solid #34373e; border-radius: 6px; background: var(--surface); }
.product-picker strong, .choice-grid strong { font-size: 14px; }
.product-picker small, .choice-grid small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.product-picker input:checked + span, .choice-grid input:checked + span { border-color: var(--cyan); background: rgba(37, 99, 255, .1); box-shadow: inset 0 0 0 1px #2563FF36; }
.product-picker input:disabled + span { opacity: .42; cursor: not-allowed; filter: grayscale(.45); }
.has-no-credits .form-section { opacity: .48; }
.has-no-credits .form-section:first-of-type { opacity: 1; }
.choice-grid { display: grid; gap: 8px; }
.choice-grid label > span { min-height: 66px; }
.clone-fields { margin-top: 22px; padding: 1px 14px 16px; background: var(--surface); border-left: 2px solid var(--violet); }
.clone-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.compact-upload { min-height: 92px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 12px; border: 1px dashed #464a53; border-radius: 6px; background: #111215; cursor: pointer; }
.compact-upload input, .dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compact-upload span { font-size: 13px; font-weight: 700; }
.compact-upload small { color: var(--cyan); overflow-wrap: anywhere; }
.check-row { display: flex; align-items: flex-start; gap: 11px; margin-top: 16px; color: #cfd2d8; font-size: 12px; line-height: 1.45; cursor: pointer; }
.check-row input { flex: 0 0 22px; width: 22px; min-height: 22px; margin: 0; accent-color: var(--cyan); }
.check-row--legal { padding: 14px; border: 1px solid #34373e; background: var(--surface); border-radius: 6px; }
.source-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; background: #17181b; border: 1px solid #292c31; border-radius: 7px; }
.source-tabs button { min-width: 0; min-height: 44px; padding: 8px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.source-tabs button.is-active { background: #292c32; color: var(--text); }
.source-panel { padding-top: 14px; }
.dropzone { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px 16px; border: 1px dashed #474b55; border-radius: 7px; background: #121316; text-align: center; cursor: pointer; }
.dropzone.is-over { border-color: var(--cyan); background: rgba(37, 99, 255, .1); }
.dropzone--compact { min-height: 132px; }
.dropzone-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #464a53; border-radius: 50%; color: var(--cyan); font-size: 24px; font-weight: 300; }
.dropzone strong { font-size: 15px; }
.dropzone small { max-width: 360px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.order-hint, .field-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.order-hint { margin: 14px 0 10px; }
.image-list, .file-list { display: grid; gap: 9px; }
.image-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid #30333a; border-radius: 7px; background: var(--surface); }
.image-preview { position: relative; width: 92px; height: 116px; overflow: hidden; border-radius: 5px; background: #08090a; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-index { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 5px; border-radius: 4px; background: #090a0cdd; color: var(--cyan); font: 700 11px/1 monospace; }
.image-fields { min-width: 0; display: grid; gap: 8px; align-content: start; }
.image-fields select, .image-fields input { min-height: 42px; padding: 9px 10px; font-size: 12px; }
.image-card-actions { display: flex; align-items: center; gap: 4px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #383b42; border-radius: 5px; background: #111215; color: #c7cbd2; cursor: pointer; }
.icon-button:disabled { opacity: .35; }
.icon-button--remove { margin-left: auto; color: var(--danger); }
.upload-progress { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 3px; background: #2d3036; }
.upload-progress span { display: block; width: var(--progress, 0%); height: 100%; background: var(--brand-gradient); transition: width .15s linear; }
.upload-message { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.upload-message.is-error { color: var(--danger); }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #30333a; background: var(--surface); border-radius: 6px; }
.file-row div { min-width: 0; }
.file-row strong, .file-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row strong { font-size: 13px; }
.file-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.scene-timeline { margin-top: 18px; padding-top: 4px; border-top: 1px solid #24262a; }
.video-file-row { grid-template-columns: 82px minmax(0, 1fr) auto; }
.video-file-row > video { width: 82px; aspect-ratio: 9 / 12; object-fit: cover; border-radius: 5px; background: #08090a; }
.video-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 9px; }
.video-usage button { min-height: 38px; border: 1px solid #383b42; border-radius: 5px; background: #111215; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.video-usage button.is-active { border-color: var(--cyan); background: rgba(37, 99, 255, .11); color: var(--text); }
.video-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
.payment-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 18px; padding: 0 18px; border-radius: 6px; background: var(--brand-gradient); color: #fff; font-weight: 800; text-decoration: none; }
.privacy-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.privacy-note strong { color: var(--success); }
.submit-spacer { height: 106px; }
.sticky-submit { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px max(16px, calc((100vw - 728px) / 2)) calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid #30333a; background: #0B0F1Af2; backdrop-filter: blur(16px); }
.sticky-submit > div { min-width: 0; }
.sticky-submit strong, .sticky-submit span { display: block; }
.sticky-submit strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-submit > div span { margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-submit button { min-width: 142px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: var(--brand-gradient); color: #fff; font-weight: 850; cursor: pointer; }
.sticky-submit button:disabled { background: #2d3035; color: #777d87; cursor: not-allowed; }
.button-spinner { width: 18px; height: 18px; border-color: rgba(255, 255, 255, .32); border-top-color: #fff; }
.success-state { min-height: calc(100vh - 78px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 44px 2px; }
.success-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 50%; background: var(--success); color: #061611; font-size: 25px; font-weight: 900; }
.processing-status { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 28px; padding: 16px; border: 1px solid #30333a; border-radius: 7px; background: var(--surface); }
.processing-status div { min-width: 0; }
.processing-status strong, .processing-status small { display: block; }
.processing-status strong { font-size: 14px; }
.processing-status small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.next-step { margin-top: 24px !important; color: var(--text) !important; }
.success-privacy { margin-top: 10px !important; font-size: 12px; }
[hidden] { display: none !important; }
.is-uploading #briefingForm .form-section { pointer-events: none; opacity: .72; }
@media (max-width: 460px) {
  .page-shell { padding-inline: 13px; }
  .brand-header { height: 68px; }
  .brand-header img { width: 148px; }
  .intro-band { padding-top: 30px; }
  .intro-band h1, .success-state h1 { font-size: 32px; }
  .product-picker { grid-template-columns: 1fr; }
  .identity-grid { grid-template-columns: 1fr; gap: 0; }
  .product-picker label > span { min-height: 58px; }
  .credit-status { grid-template-columns: 82px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .clone-upload-grid { grid-template-columns: 1fr; }
  .image-card { grid-template-columns: 80px minmax(0, 1fr); gap: 9px; padding: 8px; }
  .image-preview { width: 80px; height: 110px; }
  .video-file-row { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: start; }
  .video-file-row > video { width: 64px; }
  .video-usage { grid-template-columns: 1fr; }
  .source-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .source-tabs button { grid-column: span 2; }
  .source-tabs button:nth-last-child(-n + 2) { grid-column: span 3; }
  .sticky-submit { grid-template-columns: minmax(0, 1fr) 132px; padding-inline: 13px; }
  .sticky-submit button { min-width: 0; width: 132px; }
}
@media (min-width: 620px) {
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .source-panel { padding-top: 18px; }
  .image-card { grid-template-columns: 112px minmax(0, 1fr); }
  .image-preview { width: 112px; height: 126px; }
}
@media (prefers-reduced-motion: reduce) { .spinner, .button-spinner { animation-duration: 1.6s; } }
