:root {
    --font-ui: "Manrope", "Segoe UI", sans-serif;
    --font-heading: "Space Grotesk", "Trebuchet MS", sans-serif;
    --bg: #08101c;
    --bg-2: #0d1625;
    --panel: rgba(10, 17, 30, 0.92);
    --border: rgba(146, 180, 220, 0.18);
    --text: #eef4ff;
    --muted: #9fb4d2;
    --accent: #4c7dff;
    --accent-2: #77e2ff;
    --danger: #ff9a9a;
    --success: #8af0bd;
    --shadow: 0 22px 48px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-ui);
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(76, 125, 255, 0.16), transparent 58%),
        radial-gradient(760px 380px at 100% 0%, rgba(119, 226, 255, 0.12), transparent 56%),
        linear-gradient(170deg, var(--bg), var(--bg-2));
}

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

.page-shell {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 22px;
}

.panel h1,
.panel h2 {
    margin: 0;
    font-family: var(--font-heading);
}

.hero-strip {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.hero-strip h1 {
    margin-top: 4px;
    font-size: clamp(30px, 4.1vw, 50px);
    line-height: 1.04;
    max-width: 14ch;
}

.hero-copy,
.panel-copy,
.upload-gate-copy {
    color: var(--muted);
    line-height: 1.7;
}

.hero-copy {
    max-width: 66ch;
    margin: 14px 0 0;
}

.section-kicker {
    margin: 0 0 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 800;
}

.hero-badge-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.saved-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(76, 125, 255, 0.12);
    border: 1px solid rgba(76, 125, 255, 0.32);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.saved-pill.is-ready {
    color: #dfffee;
    background: rgba(52, 178, 110, 0.18);
    border-color: rgba(104, 224, 154, 0.36);
}

.saved-pill.is-locked {
    color: #ffd7d7;
    background: rgba(255, 94, 94, 0.12);
    border-color: rgba(255, 132, 132, 0.28);
}

.api-save-shell {
    margin-bottom: 22px;
}

.api-panel-wide {
    padding: 24px;
}

.api-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.field-grow {
    margin-bottom: 0;
}

.api-action-box {
    min-width: 180px;
}

.api-action-box button {
    width: 100%;
}

.studio-grid {
    display: grid;
    grid-template-columns: 420px 1fr 1fr;
    gap: 20px;
}

.main-work-grid {
    align-items: start;
}

.left-stack {
    display: grid;
    gap: 20px;
    align-content: start;
}

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

.section-head-tight h2 {
    margin-top: 2px;
}

.upload-gate-box {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(146, 180, 220, 0.12);
}

.upload-gate-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
}

.upload-gate-copy,
.panel-copy {
    margin: 0;
    font-size: 14px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field span {
    font-size: 14px;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 14px 16px;
}

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

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

button {
    border: 0;
    border-radius: 16px;
    min-height: 50px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.status-box {
    margin-top: 16px;
    min-height: 54px;
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(7, 13, 24, 0.82);
    border: 1px solid rgba(146, 180, 220, 0.14);
    color: var(--muted);
}

.inline-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.hidden-panel {
    display: none;
}

.prompt-panel.is-visible {
    display: block;
}

.prompt-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.active-prompt-line {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.active-prompt-line strong {
    color: var(--text);
}

.prompt-chip {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-weight: 600;
}

.prompt-chip.is-active {
    background: rgba(76, 125, 255, 0.18);
    border-color: rgba(114, 152, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(135, 169, 255, 0.36);
}

.preview-panel {
    min-width: 0;
}

.preview-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 14px;
}

.preview-head span {
    color: var(--muted);
    font-size: 13px;
}

.video-frame {
    position: relative;
    min-height: 520px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(146, 180, 220, 0.12);
    background: #050914;
}

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

.placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    padding: 20px;
    background:
        radial-gradient(circle at center, rgba(76, 125, 255, 0.12), transparent 40%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.placeholder.hidden {
    display: none;
}

@media (max-width: 1180px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }

    .video-frame {
        min-height: 380px;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100%, calc(100% - 20px));
        padding-top: 18px;
    }

    .hero-strip {
        flex-direction: column;
    }

    .hero-strip h1 {
        max-width: none;
    }

    .hero-badge-group {
        justify-content: flex-start;
    }

    .api-form-row {
        grid-template-columns: 1fr;
    }

    .button-row button,
    .api-action-box {
        width: 100%;
    }
}
