:root {
    --gv-bg: #08111f;
    --gv-bg-soft: #0e1a2f;
    --gv-card: #111f36;
    --gv-border: rgba(255,255,255,.09);
    --gv-text: #ecf2ff;
    --gv-muted: #9cacbf;
    --gv-accent: #7c6cff;
    --gv-accent-2: #23c8ff;
}

html { scroll-behavior: smooth; }
body {
    min-height: 100%;
    background: #f7f9fc;
    color: #152238;
}
.gv-nav {
    background: rgba(8,17,31,.96);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
}
.navbar-brand span { color: #8d82ff; }
.hero {
    background:
        radial-gradient(circle at 10% 10%, rgba(124,108,255,.25), transparent 30%),
        radial-gradient(circle at 90% 15%, rgba(35,200,255,.18), transparent 28%),
        var(--gv-bg);
    color: var(--gv-text);
    padding: 86px 0 80px;
}
.hero .lead { color: #b9c7d9; max-width: 760px; }
.hero-badge {
    display: inline-flex;
    border: 1px solid rgba(141,130,255,.4);
    background: rgba(124,108,255,.10);
    border-radius: 999px;
    padding: .45rem .8rem;
    font-size: .9rem;
    color: #d8d3ff;
}
.btn-gv {
    background: linear-gradient(135deg, var(--gv-accent), #6154ef);
    border: 0;
    color: white;
    font-weight: 600;
}
.btn-gv:hover, .btn-gv:focus { color: white; filter: brightness(1.06); }
.section-title { max-width: 720px; }
.tool-card {
    border: 1px solid #e5eaf1;
    border-radius: 18px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(31,42,68,.08); }
.tool-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f0efff;
    color: #5c4fe0;
    font-weight: 800;
}
.gv-panel {
    background: white;
    border: 1px solid #e6ebf2;
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(31,42,68,.06);
}
.gv-result {
    background: #0d1729;
    color: #eaf1ff;
    border-radius: 16px;
    min-height: 180px;
    white-space: pre-wrap;
}
.form-control, .form-select {
    border-radius: 12px;
    min-height: 46px;
}
textarea.form-control { min-height: 96px; }
.metric-card {
    border: 1px solid #e5eaf1;
    border-radius: 16px;
    background: #fff;
    padding: 1rem;
    height: 100%;
}
.metric-label { color: #6d7b8d; font-size: .86rem; }
.metric-value { font-size: 1.65rem; font-weight: 750; letter-spacing: -.02em; }
.gv-footer { background: #0a1322; color: #e9effa; }
.text-secondary { color: #8e9db0 !important; }
.kicker { color: #6558dd; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.notice { border-left: 4px solid #7667ef; background: #f2f0ff; }
@media (max-width: 767px) {
    .hero { padding: 62px 0 56px; }
    .hero h1 { font-size: 2.25rem; }
}

.scene-card { overflow: hidden; }
.scene-kicker {
    color: #6558dd;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.scene-meta {
    border: 1px solid #e5eaf1;
    border-radius: 14px;
    padding: .85rem 1rem;
    height: 100%;
    background: #fbfcfe;
}
.scene-meta span {
    display: block;
    color: #7a8798;
    font-size: .78rem;
    margin-bottom: .2rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.scene-meta strong { display: block; font-size: .95rem; }
.scene-prompt { min-height: 0; font-size: .92rem; line-height: 1.6; }
.min-w-0 { min-width: 0; }
@media (min-width: 992px) {
    .position-lg-sticky { position: sticky; }
}

/* Scene Builder v3 */
.scene-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.scene-meta-wide { grid-column: 1 / -1; }
.scene-meta strong {
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.scene-prompt-details {
    border-top: 1px solid #edf0f5;
    padding-top: .9rem;
}
.scene-prompt-details summary {
    cursor: pointer;
    color: #5147c8;
    font-weight: 700;
    user-select: none;
    list-style-position: inside;
}
.scene-prompt-details[open] summary { margin-bottom: .25rem; }
.scene-engine-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .5rem;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.scene-engine-badge.is-ai {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}
.scene-engine-badge.is-local {
    color: #5b6472;
    background: #f1f4f8;
    border: 1px solid #e2e7ee;
}
@media (max-width: 575.98px) {
    .scene-spec-grid { grid-template-columns: 1fr; }
    .scene-meta-wide { grid-column: auto; }
}

/* Scene Builder v4 */
.scene-card { overflow: visible; }
.scene-meta { height: auto; min-height: 88px; }
.scene-meta strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: block;
    max-height: none;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
}
.scene-objective { overflow-wrap: anywhere; }
.scene-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}
.scene-lock-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.scene-lock-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border: 1px solid #ddd9ff;
    background: #f6f4ff;
    color: #4f46b9;
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .78rem;
    font-weight: 700;
    max-width: 100%;
}
.consistency-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.consistency-item {
    border: 1px solid #e5eaf1;
    background: #fbfcfe;
    border-radius: 14px;
    padding: .75rem;
    min-width: 0;
}
.consistency-item textarea.form-control {
    min-height: 78px;
    resize: vertical;
}
.lock-switch {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    color: #5f6d7f;
    cursor: pointer;
    user-select: none;
}
.lock-switch input { accent-color: #6558dd; }
.scene-prompt-model {
    display: inline-flex;
    margin-left: .4rem;
    border-radius: 999px;
    padding: .12rem .45rem;
    background: #f0efff;
    color: #5147c8;
    font-size: .72rem;
    font-weight: 800;
    vertical-align: middle;
}
.scene-convert-row {
    display: grid;
    grid-template-columns: auto minmax(130px, 220px) auto;
    align-items: center;
    gap: .6rem;
    padding-top: .85rem;
    border-top: 1px solid #edf0f5;
}
.scene-convert-row .form-select { min-height: 38px; }
.scene-edit-form textarea { min-height: 90px; resize: vertical; }
.scene-edit-form .scene-edit-large { min-height: 130px; }
.scene-edit-form .scene-edit-prompt {
    min-height: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .88rem;
    line-height: 1.5;
}
.scene-editing { border-color: #d8d2ff; }
@media (max-width: 767.98px) {
    .consistency-grid { grid-template-columns: 1fr; }
    .scene-action-bar { justify-content: flex-start; }
    .scene-convert-row { grid-template-columns: 1fr; }
}

/* Image to Video Prompt */
.image-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 160px;
    padding: 1.25rem;
    border: 1.5px dashed #cfd7e3;
    border-radius: 16px;
    background: #fbfcfe;
    color: #526074;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.image-upload-zone:hover,
.image-upload-zone.is-dragging {
    border-color: #7667ef;
    background: #f6f4ff;
}
.image-upload-zone.has-file { border-style: solid; }
.image-upload-zone span:last-child { font-size: .82rem; color: #8592a4; }
.image-upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f0efff;
    color: #5c4fe0;
    font-size: 1.45rem;
    font-weight: 500;
}
.image-preview-wrap img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid #e5eaf1;
    background: #0d1729;
}
.image-preserve-options {
    border: 1px solid #e5eaf1;
    border-radius: 14px;
    padding: .9rem 1rem;
    background: #fbfcfe;
}
.image-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.image-analysis-wide { grid-column: 1 / -1; }
.image-video-prompt-result {
    min-height: 0;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
@media (max-width: 767.98px) {
    .image-analysis-grid { grid-template-columns: 1fr; }
    .image-analysis-wide { grid-column: auto; }
}
