:root {
    --ink: #202824;
    --muted: #69736f;
    --line: #d9dfdc;
    --paper: #f2f5f3;
    --white: #fff;
    --nav: #1d2824;
    --teal: #087f70;
    --teal2: #19c5b1;
    --blue: #1268f5;
    --red: #c43838;
    --shadow: 0 12px 34px rgba(27,43,36,.07)
}

* {
    box-sizing: border-box
}

html {
    font-size: 15px
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Manrope,"Noto Sans Telugu","Noto Sans Devanagari",sans-serif
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background: var(--nav);
    color: #d3dcda;
    display: flex;
    flex-direction: column;
    z-index: 20
}

.brand {
    height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #34403b
}

    .brand strong {
        font-size: 20px;
        display: block
    }

    .brand small {
        display: block;
        color: #9faca8;
        font-size: 10px;
        letter-spacing: 2px;
        margin-top: 3px
    }

.brand-mark {
    width: 42px;
    height: 42px;
    border: 1px solid #485751;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px
}

    .brand-mark i {
        width: 2px;
        background: var(--teal2);
        border-radius: 4px
    }

        .brand-mark i:nth-child(1), .brand-mark i:nth-child(5) {
            height: 12px
        }

        .brand-mark i:nth-child(2), .brand-mark i:nth-child(4) {
            height: 25px
        }

        .brand-mark i:nth-child(3) {
            height: 18px
        }

.sidebar nav {
    padding: 24px 13px
}

    .sidebar nav p {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1.2px;
        color: #7e908a;
        margin: 18px 12px 9px
    }

    .sidebar nav a {
        display: flex;
        align-items: center;
        gap: 13px;
        color: #bac5c1;
        text-decoration: none;
        padding: 11px 12px;
        border-radius: 7px;
        font-weight: 650;
        margin: 2px 0
    }

        .sidebar nav a:hover, .sidebar nav a.active {
            background: #107a6c;
            color: white
        }

    .sidebar nav b {
        width: 26px;
        height: 26px;
        border: 1px solid #81908b;
        border-radius: 5px;
        display: grid;
        place-items: center;
        font-size: 12px
    }

.offline {
    margin: auto 20px 22px;
    padding: 12px;
    border-top: 1px solid #34403b;
    display: flex;
    gap: 10px;
    align-items: center
}

    .offline > span {
        width: 9px;
        height: 9px;
        background: #24c39d;
        border-radius: 50%;
        box-shadow: 0 0 0 4px rgba(36,195,157,.12)
    }

    .offline strong, .offline small {
        display: block
    }

    .offline strong {
        font-size: 12px
    }

    .offline small {
        font-size: 10px;
        color: #84938e;
        margin-top: 2px
    }

.app-shell {
    margin-left: 264px;
    min-height: 100vh
}

.topbar {
    height: 72px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px
}

    .topbar > span {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1.4px;
        color: var(--muted)
    }

.page {
    padding: 30px 34px 60px;
    max-width: 1700px;
    margin: auto
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px
}

    .page-heading h1 {
        font-size: 32px;
        letter-spacing: -1px;
        margin: 5px 0
    }

    .page-heading p {
        margin: 0;
        color: var(--muted)
    }

.voice-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px
}

.eyebrow {
    font-size: 11px;
    color: var(--teal);
    font-weight: 800;
    letter-spacing: 1.2px
}

.button {
    border: 0;
    border-radius: 6px;
    padding: 11px 17px;
    font: 700 13px Manrope;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

    .button.primary {
        background: var(--blue);
        color: white
    }

    .button.secondary {
        background: white;
        color: #57625e;
        border: 1px solid #98a49f
    }

    .button.danger {
        background: white;
        color: var(--red);
        border: 1px solid var(--red)
    }

    .button.small {
        padding: 9px 13px
    }

.heading-actions, .form-actions {
    display: flex;
    gap: 9px;
    align-items: center
}

    .heading-actions form {
        margin: 0
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
    margin-bottom: 18px
}

    .stats-grid article, .panel {
        background: white;
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow)
    }

    .stats-grid article {
        padding: 22px
    }

    .stats-grid span {
        font-size: 11px;
        color: var(--muted);
        font-weight: 800;
        letter-spacing: .6px
    }

    .stats-grid strong {
        display: block;
        font-size: 34px;
        margin: 7px 0 2px
    }

    .stats-grid small {
        color: var(--muted)
    }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px
}

.panel {
    overflow: hidden
}

.panel-heading {
    min-height: 74px;
    padding: 19px 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start
}

    .panel-heading h2, .panel h2 {
        font-size: 16px;
        margin: 0
    }

    .panel-heading p {
        font-size: 12px;
        color: var(--muted);
        margin: 5px 0 0
    }

    .panel-heading a {
        font-size: 12px;
        color: var(--teal);
        font-weight: 800;
        text-decoration: none
    }

.table-wrap {
    overflow-x: auto
}

table {
    border-collapse: collapse;
    width: 100%
}

th {
    background: #fafbfa;
    text-align: left;
    padding: 12px 18px;
    font-size: 10px;
    letter-spacing: .5px;
    color: var(--muted);
    border-bottom: 1px solid var(--line)
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid #e7ebe9;
    font-size: 12px;
    color: #5c6662
}

tbody tr:last-child td {
    border-bottom: 0
}

a {
    color: var(--teal)
}

.strong-link {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none
}

.cell-note {
    display: block;
    color: var(--muted);
    margin-top: 5px
}

.status {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 5px;
    background: #e6ebe9;
    color: #63706b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .6px
}

    .status.completed {
        background: #dcf3eb;
        color: #086850
    }

    .status.running, .status.rendering {
        background: #dfeaff;
        color: #1756b5
    }

    .status.queued {
        background: #fff1d2;
        color: #8b6300
    }

    .status.failed, .status.cancelled {
        background: #f9dddd;
        color: #9d2b2b
    }

    .status.draft {
        background: #e9eceb
    }

.progress-row {
    display: flex;
    align-items: center;
    gap: 8px
}

.progress {
    height: 6px;
    flex: 1;
    background: #e4e9e7;
    border-radius: 6px;
    overflow: hidden;
    min-width: 90px
}

    .progress i {
        height: 100%;
        display: block;
        background: var(--teal);
        border-radius: 6px;
        transition: width .3s
    }

.story-list {
    padding: 0 20px
}

    .story-list > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        color: var(--ink);
        padding: 15px 0;
        border-top: 1px solid #e5e9e7;
        gap: 15px
    }

    .story-list strong, .story-list small {
        display: block
    }

    .story-list small {
        color: var(--muted);
        font-size: 11px;
        margin-top: 5px
    }

.empty {
    text-align: center;
    color: #89938f;
    padding: 35px !important
}

.languages {
    display: flex;
    gap: 5px
}

    .languages span {
        background: #edf2f0;
        border-radius: 4px;
        padding: 3px 6px;
        font-size: 9px;
        font-weight: 800
    }

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 12px
}

    .alert.success {
        background: #e3f5ee;
        color: #11634e;
        border: 1px solid #b6dfd1
    }

    .alert.danger {
        background: #fce8e8;
        color: #922f2f;
        border: 1px solid #ecc0c0
    }

.editor-form {
    max-width: 1150px
}

.form-panel {
    padding: 22px;
    margin-bottom: 18px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px
}

label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 16px
}

    label > span {
        display: block;
        margin-bottom: 7px
    }

input, textarea, select {
    width: 100%;
    border: 1px solid #cbd3d0;
    border-radius: 6px;
    padding: 11px 12px;
    background: white;
    color: var(--ink);
    font: 500 13px Manrope,"Noto Sans Telugu","Noto Sans Devanagari",sans-serif;
    outline: none
}

select {
    appearance: none;
    background-image: linear-gradient(45deg,transparent 50%,#6e7a75 50%),linear-gradient(135deg,#6e7a75 50%,transparent 50%),linear-gradient(to right,transparent,transparent);
    background-position: calc(100% - 18px) calc(50% - 3px),calc(100% - 12px) calc(50% - 3px),100% 0;
    background-size: 6px 6px,6px 6px,2.5em 100%;
    background-repeat: no-repeat;
    padding-right: 38px
}

textarea {
    resize: vertical;
    line-height: 1.8
}

    input:focus, textarea:focus, select:focus {
        border-color: var(--teal);
        box-shadow: 0 0 0 3px rgba(8,127,112,.1)
    }

label small {
    display: flex;
    justify-content: space-between;
    color: #b33;
    font-weight: 500;
    margin-top: 5px
}

.form-grid label[data-chatterbox-speaker] {
    transition: opacity .15s ease,transform .15s ease
}

    .form-grid label[data-chatterbox-speaker][hidden] {
        display: none !important
    }

    .form-grid label[data-chatterbox-speaker] small {
        color: var(--muted)
    }

.word-count {
    color: var(--muted)
}

.script-tabs {
    margin-bottom: 18px
}

.tab-buttons {
    display: flex;
    gap: 4px;
    padding: 12px 18px 0;
    border-bottom: 1px solid var(--line)
}

    .tab-buttons button {
        background: none;
        border: 0;
        border-bottom: 3px solid transparent;
        padding: 11px 14px;
        font: 700 12px Manrope,"Noto Sans Telugu","Noto Sans Devanagari";
        color: var(--muted);
        cursor: pointer
    }

        .tab-buttons button.active {
            color: var(--teal);
            border-color: var(--teal)
        }

    .tab-buttons em {
        font-style: normal;
        font-size: 9px;
        background: #edf2f0;
        padding: 3px 5px;
        border-radius: 3px;
        margin-left: 5px
    }

.tab-pane {
    display: none
}

    .tab-pane.active {
        display: block
    }

.script-tabs .tab-pane {
    padding: 20px
}

.form-actions {
    justify-content: flex-end
}

.details-grid {
    display: grid;
    grid-template-columns: minmax(0,2.3fr) minmax(300px,.7fr);
    gap: 16px
}

.script-reader .tab-pane {
    padding: 18px 22px
}

.script-reader pre {
    white-space: pre-wrap;
    margin: 0;
    line-height: 1.85;
    font: 400 13px Manrope,"Noto Sans Telugu","Noto Sans Devanagari";
    max-height: 650px;
    overflow: auto
}

.detail-side {
    display: flex;
    flex-direction: column;
    gap: 15px
}

.compact {
    padding: 20px
}

    .compact .panel-heading {
        padding: 0 0 16px;
        min-height: 0
    }

    .compact dl {
        margin: 14px 0 0
    }

        .compact dl > div {
            display: flex;
            justify-content: space-between;
            gap: 18px;
            padding: 10px 0;
            border-top: 1px solid #e6eae8;
            font-size: 11px
        }

    .compact dt {
        color: var(--muted)
    }

    .compact dd {
        margin: 0;
        text-align: right;
        font-weight: 650
    }

        .compact dd .audio-badge {
            margin-left: auto;
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

.big-number {
    display: block;
    font-size: 28px;
    margin: 15px 0 8px
}

.audio-card {
    margin-top: 16px
}

    .audio-card b {
        font-size: 11px;
        display: block;
        margin-bottom: 5px
    }

audio {
    width: 100%;
    height: 34px
}

.render-hero {
    background: var(--nav);
    color: white;
    border-radius: 7px;
    padding: 20px;
    margin-bottom: 16px
}

.render-top {
    display: flex;
    justify-content: space-between;
    align-items: center
}

    .render-top > div strong {
        display: block;
        margin-top: 8px
    }

    .render-top > b {
        font-size: 25px;
        color: #53d8c6
    }

.progress.large {
    height: 7px;
    margin: 14px 0
}

.waveform {
    height: 62px;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden
}

    .waveform i {
        display: block;
        min-width: 2px;
        flex: 1;
        max-width: 4px;
        background: #20c7b2;
        border-radius: 4px;
        opacity: .9
    }

.job-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px
}

.outputs {
    padding: 0 20px 18px
}

    .outputs article {
        display: grid;
        grid-template-columns: 150px 1fr;
        gap: 15px;
        align-items: center;
        padding: 12px 0;
        border-top: 1px solid var(--line)
    }

    .outputs strong, .outputs small {
        display: block
    }

    .outputs small {
        font-size: 10px;
        color: var(--muted);
        margin-top: 3px
    }

.log-panel {
    padding-bottom: 18px
}

    .log-panel pre {
        margin: 0 18px;
        background: #17221e;
        color: #b8e4db;
        border-radius: 5px;
        padding: 15px;
        min-height: 220px;
        max-height: 420px;
        overflow: auto;
        font: 11px/1.7 Consolas,monospace;
        white-space: pre-wrap
    }

.live-dot {
    font-size: 9px;
    color: var(--teal);
    font-weight: 800
}

.validation {
    color: #a72e2e;
    margin-bottom: 12px
}

@media(max-width:1050px) {
    .sidebar {
        width: 76px
    }

        .brand span:last-child, .sidebar nav p, .sidebar nav a:not(.active) {
            font-size: 0
        }

        .sidebar nav a {
            justify-content: center
        }

    .offline {
        display: none
    }

    .app-shell {
        margin-left: 76px
    }

    .stats-grid {
        grid-template-columns: repeat(2,1fr)
    }

    .dashboard-grid, .details-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:700px) {
    .topbar, .page {
        padding-left: 16px;
        padding-right: 16px
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .stats-grid {
        grid-template-columns: 1fr
    }

    .form-grid, .job-grid {
        grid-template-columns: 1fr
    }

    .sidebar {
        display: none
    }

    .app-shell {
        margin-left: 0
    }

    .heading-actions {
        flex-wrap: wrap
    }

    .outputs article {
        grid-template-columns: 1fr
    }
}

.render-steps {
    margin-bottom: 16px
}

.step-summary {
    font-size: 11px;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: .4px
}

.step-list {
    list-style: none;
    margin: 0;
    padding: 0 22px 22px;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 0 24px
}

.render-step {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr) auto;
    gap: 11px;
    align-items: start;
    padding: 16px 0;
    border-top: 1px solid #e4e9e7;
    min-width: 0
}

.step-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #edf1ef;
    color: #8a9591;
    display: grid;
    place-items: center
}

    .step-marker b {
        font-size: 11px
    }

.step-copy {
    min-width: 0
}

    .step-copy strong, .step-copy small {
        display: block
    }

    .step-copy strong {
        font-size: 12px;
        color: #4e5955
    }

    .step-copy small {
        font-size: 10px;
        color: var(--muted);
        line-height: 1.45;
        margin-top: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

.step-state {
    font-size: 9px;
    font-weight: 800;
    color: #98a19e;
    text-transform: uppercase;
    letter-spacing: .45px;
    padding-top: 5px
}

.step-meter {
    height: 3px;
    background: #edf1ef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 9px
}

    .step-meter i {
        display: block;
        height: 100%;
        width: 0;
        background: var(--teal);
        transition: width .35s ease
    }

.render-step.current .step-marker {
    background: #dfeaff;
    color: #1756b5;
    box-shadow: 0 0 0 4px rgba(18,104,245,.08)
}

.render-step.current .step-copy strong, .render-step.current .step-state {
    color: #1756b5
}

.render-step.current .step-meter i {
    background: var(--blue)
}

.render-step.complete .step-marker {
    background: #dcf3eb;
    color: #086850
}

.render-step.complete .step-copy strong, .render-step.complete .step-state {
    color: #086850
}

.render-step.failed .step-marker {
    background: #f9dddd;
    color: #9d2b2b
}

.render-step.failed .step-copy strong, .render-step.failed .step-state {
    color: #9d2b2b
}

.render-step.failed .step-meter i {
    background: var(--red)
}

@media(max-width:1050px) {
    .step-list {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }
}

@media(max-width:700px) {
    .step-list {
        grid-template-columns: 1fr
    }

    .step-summary {
        display: none
    }
}

.scene-panel-head {
    align-items: center
}

.scene-panel-note {
    background: #eef7f5;
    color: var(--teal);
    font-weight: 800;
    font-size: 11px;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap
}

.scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(290px,1fr));
    gap: 16px;
    padding: 0 22px 22px
}

.scene-card {
    border: 1px solid #e5ebe8;
    border-radius: 14px;
    background: #fcfdfc;
    box-shadow: 0 8px 24px rgba(25,37,31,.05);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.scene-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.scene-kicker {
    display: block;
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 800;
    color: var(--teal);
    text-transform: uppercase;
    margin-bottom: 4px
}

.scene-card-head strong {
    display: block;
    font-size: 16px;
    line-height: 1.2
}

.scene-summary {
    margin: 0;
    color: #5b6662;
    line-height: 1.65
}

.badge {
    align-self: flex-start;
    background: #edf2f0;
    color: #67726e;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px
}

.scene-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(110px,1fr));
    gap: 10px
}

    .scene-thumbs.empty {
        grid-template-columns: 1fr
    }

.thumb-placeholder {
    border: 1px dashed #ccd4d1;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #7f8884;
    background: #fafcfa;
    font-size: 12px
}

.scene-thumb {
    margin: 0;
    border: 1px solid #e2e7e4;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
    min-width: 0
}

    .scene-thumb img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        display: block;
        background: #f1f5f3
    }

    .scene-thumb figcaption {
        padding: 10px 10px 11px;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px
    }

        .scene-thumb figcaption strong, .scene-thumb figcaption span {
            display: block
        }

        .scene-thumb figcaption strong {
            font-size: 11px
        }

        .scene-thumb figcaption span {
            font-size: 10px;
            color: var(--muted);
            margin-top: 3px
        }

    .scene-thumb .button.tiny {
        padding: 7px 10px;
        font-size: 11px
    }

.scene-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 2px
}

.scene-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center
}

    .scene-action-row form {
        margin: 0
    }

.scene-upload {
    justify-content: space-between;
    border-top: 1px solid #edf1ef;
    padding-top: 12px
}

.file-picker {
    flex: 1;
    margin: 0
}

    .file-picker span {
        display: block;
        font-size: 11px;
        color: var(--muted);
        margin-bottom: 6px
    }

    .file-picker input[type=file] {
        padding: 9px 0;
        border: 0;
        background: transparent;
        box-shadow: none
    }

.empty-state {
    margin: 0 22px 22px;
    padding: 24px;
    border: 1px dashed #cfd7d4;
    border-radius: 14px;
    background: #fafcfb
}

    .empty-state strong {
        display: block;
        font-size: 15px;
        margin-bottom: 4px
    }

    .empty-state p {
        margin: 0;
        color: var(--muted);
        line-height: 1.6
    }

.scene-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end
}

    .scene-panel-head-actions form {
        margin: 0
    }

.scene-timing {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 3px
}

.scene-thumb figcaption strong {
    display: block
}

.scene-thumb figcaption .scene-time {
    display: block
}

.audio-settings-card {
    border: 1px solid #dbe3e0;
    border-radius: 12px;
    padding: 18px 18px 8px;
    background: #f9fbfa;
    margin: 0 0 16px
}

.audio-settings-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap
}

    .audio-settings-head h3 {
        margin: 0;
        font-size: 15px
    }

    .audio-settings-head p {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 12px
    }

.audio-preset-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.chip {
    border: 1px solid #cbd3d0;
    background: #fff;
    color: #51605b;
    border-radius: 999px;
    padding: 8px 12px;
    font: 700 12px Manrope;
    cursor: pointer
}

    .chip.active {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff
    }

.audio-settings-note {
    font-size: 11px;
    color: var(--muted);
    padding: 0 0 10px;
    margin-top: -4px
}

.editor-form .form-panel {
    overflow: visible
}

.audio-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf7f5;
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px
}

    .audio-badge.provider-kokoro {
        background: #edf7f5;
        color: var(--teal)
    }

    .audio-badge.provider-chatterbox {
        background: #edf1ff;
        color: #2456d6
    }

.compact dl .audio-badge {
    margin-left: auto
}

.subscene-editor {
    border: 1px solid #e5ebe8;
    border-radius: 14px;
    background: #f8faf9;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.subscene-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap
}

    .subscene-editor-head h3 {
        margin: 0;
        font-size: 14px
    }

    .subscene-editor-head p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.55;
        max-width: 760px
    }

.subscene-card {
    border: 1px solid #e1e7e4;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(27,43,36,.04)
}

.subscene-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px
}

    .subscene-card-head strong {
        font-size: 13px
    }

.subscene-text {
    min-height: 76px
}

.subscene-prompt-row input {
    width: 100%
}

.subscene-actions {
    padding-top: 0;
    border-top: 0
}

    .subscene-actions .scene-action-row {
        justify-content: flex-start
    }

    .subscene-actions .file-picker {
        min-width: 220px;
        flex: 0 1 260px
    }

.scene-panel .scene-card {
    background: linear-gradient(180deg,#fcfefd 0%,#f9fbfa 100%)
}

.scene-card:hover {
    box-shadow: 0 10px 30px rgba(25,37,31,.08);
    transform: translateY(-1px);
    transition: box-shadow .15s ease,transform .15s ease
}

.scene-actions .button.primary {
    min-width: 170px
}

.scene-actions .button.secondary {
    min-width: 120px
}

.scene-upload {
    align-items: flex-end
}

    .scene-upload .file-picker span {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .4px
    }

.scene-panel-head-actions .button.secondary {
    white-space: nowrap
}

.subscene-editor .badge {
    background: #eef7f5;
    color: var(--teal)
}

.scene-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.scene-card.collapsed .scene-summary, .scene-card.collapsed .subscene-editor, .scene-card.collapsed .scene-thumbs, .scene-card.collapsed .scene-actions {
    display: none
}

.scene-card.collapsed {
    padding-bottom: 12px
}

.scene-toggle {
    padding: 7px 10px;
    font-size: 10px
}

.scene-grid-compact {
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: 12px;
    padding: 0 18px 18px
}

.scene-card-compact {
    padding: 14px;
    gap: 10px
}

    .scene-card-compact .scene-summary {
        font-size: 11px;
        line-height: 1.55
    }

.subscene-editor-compact {
    padding: 12px;
    gap: 10px
}

.thumbnail-grid {
    grid-template-columns: repeat(auto-fit,minmax(100px,100px));
    justify-content: flex-start
}

    .thumbnail-grid .scene-thumb {
        max-width: 100px
    }

        .thumbnail-grid .scene-thumb img, .zoomable-thumb {
            width: 100px;
            height: 100px;
            aspect-ratio: 1/1;
            object-fit: cover;
            cursor: zoom-in
        }

.compact-actions {
    gap: 8px
}

    .compact-actions .button.primary {
        min-width: auto;
        padding: 9px 12px
    }

    .compact-actions .button.secondary {
        min-width: auto;
        padding: 9px 12px
    }

.subscene-card {
    padding: 12px
}

.subscene-text {
    min-height: 64px
}

.zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center
}

.zoom-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15,18,17,.72)
}

.zoom-dialog {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: min(92vw,900px);
    max-height: 90vh;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35)
}

    .zoom-dialog img {
        display: block;
        max-width: 100%;
        max-height: 84vh;
        border-radius: 12px
    }

.zoom-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.18)
}

body.zoom-open {
    overflow: hidden
}

@media(max-width:1050px) {
    .scene-grid-compact {
        grid-template-columns: repeat(auto-fit,minmax(220px,1fr))
    }

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fit,minmax(100px,1fr))
    }
}

.scene-datatable {
    padding: 0 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.scene-group {
    border: 1px solid #dde4e1;
    border-radius: 14px;
    background: #fbfcfb;
    overflow: hidden
}

.scene-group-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5ebe8;
    background: linear-gradient(180deg,#ffffff 0%,#f7faf8 100%)
}

    .scene-group-head strong {
        display: block;
        font-size: 15px;
        margin-top: 2px
    }

    .scene-group-head .scene-timing {
        margin-top: 3px
    }

.scene-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0
}

    .scene-table thead th {
        position: sticky;
        top: 0;
        background: #f7faf8;
        z-index: 1;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .55px;
        padding: 10px 12px;
        border-bottom: 1px solid #e2e8e5
    }

    .scene-table tbody td {
        padding: 10px 12px;
        vertical-align: top;
        border-bottom: 1px solid #edf1ef;
        background: #fff
    }

    .scene-table tbody tr:last-child td {
        border-bottom: 0
    }

.scene-row-image {
    width: 120px
}

.thumb-cell {
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center
}

.thumb-100 {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover
}

.scene-row-subscene {
    min-width: 420px
}

.compact-text {
    min-height: 76px;
    margin-bottom: 8px
}

.compact-prompt {
    margin: 0
}

.scene-row-actions {
    width: 140px;
    white-space: nowrap
}

    .scene-row-actions .button {
        width: 100%;
        margin-bottom: 8px
    }

.compact-file {
    display: block;
    margin-bottom: 8px
}

    .compact-file input[type=file] {
        width: 100%;
        padding: 6px 0
    }

.scene-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fbfa;
    border-top: 1px solid #e7ece9
}

.scene-card.collapsed .scene-table, .scene-card.collapsed .scene-footer {
    display: none
}

.scene-card.collapsed {
    padding-bottom: 12px
}

.zoom-overlay[hidden] {
    display: none !important
}

.full-width {
    grid-column: 1 / -1
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 12px
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 0 0
}

.compact-summary {
    padding: 22px
}

.summary-top {
    display: grid;
    grid-template-columns: 180px minmax(0,1fr);
    gap: 22px;
    align-items: start
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px 18px;
    min-width: 0
}

    .summary-grid .full-width {
        grid-column: 1 / -1
    }

.field-value {
    border: 1px solid #e3e8e5;
    background: #fbfcfb;
    border-radius: 8px;
    padding: 11px 12px;
    min-height: 42px;
    display: flex;
    align-items: center;
    white-space: pre-wrap;
    line-height: 1.65
}

    .field-value.multiline {
        align-items: flex-start;
        min-height: 84px
    }

.compact-summary .thumb-cell {
    margin-top: 2px
}

.chip-toggle {
    border: 1px solid #cbd3d0;
    background: #fff;
    color: #51605b;
    border-radius: 999px;
    padding: 8px 14px;
    font: 700 12px Manrope;
    cursor: pointer;
    transition: background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease
}

    .chip-toggle:hover {
        border-color: var(--teal);
        transform: translateY(-1px)
    }

    .chip-toggle.active {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff
    }

    .chip-toggle:focus {
        outline: 0;
        box-shadow: 0 0 0 3px rgba(18,104,245,.14)
    }

.chip-dropdown {
    position: relative
}

.chip-dropdown-trigger {
    width: 100%;
    border: 1px solid #cbd3d0;
    background: #fff;
    border-radius: 6px;
    padding: 11px 12px;
    font: 700 13px Manrope;
    color: var(--ink);
    text-align: left;
    cursor: pointer
}

.chip-dropdown-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #dbe3e0;
    border-radius: 12px;
    background: #f9fbfa;
    box-shadow: var(--shadow)
}

.chip-filter {
    margin-bottom: 10px
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.chip-toggle {
    border: 1px solid #cbd3d0;
    background: #fff;
    color: #51605b;
    border-radius: 999px;
    padding: 8px 14px;
    font: 700 12px Manrope;
    cursor: pointer;
    transition: background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease
}

    .chip-toggle:hover {
        border-color: var(--teal);
        transform: translateY(-1px)
    }

    .chip-toggle.active {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff
    }

    .chip-toggle:focus {
        outline: 0;
        box-shadow: 0 0 0 3px rgba(18,104,245,.14)
    }


.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(20, 171, 154, 0.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(18, 104, 245, 0.08), transparent 30%),
        linear-gradient(180deg, #eef3f0 0%, #f5f8f6 100%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
}

.login-shell {
    width: min(1240px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: stretch;
}

.login-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 42px;
    background:
        linear-gradient(145deg, rgba(15, 24, 21, 0.97) 0%, rgba(17, 36, 41, 0.94) 55%, rgba(16, 104, 245, 0.82) 100%);
    color: #eff6f4;
    box-shadow: 0 26px 70px rgba(11, 18, 16, .18);
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: auto -18% -40% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 208, 184, 0.35) 0%, rgba(26, 208, 184, 0.12) 35%, transparent 70%);
    filter: blur(10px);
    pointer-events: none;
}

.login-brand-badge {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(160deg, #22d3b8, #1762f2);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    box-shadow: 0 12px 24px rgba(17, 98, 242, .24);
}

.login-eyebrow {
    color: #6fe9d8;
    margin-top: 28px;
}

.login-hero h1 {
    margin: 12px 0 0;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -1.4px;
    max-width: 560px;
}

.login-copy {
    margin: 16px 0 0;
    max-width: 560px;
    color: rgba(238,246,244,.76);
    font-size: 15px;
    line-height: 1.75;
}

.login-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.login-highlights article {
    padding: 16px 16px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(10px);
}

.login-highlights strong {
    display: block;
    font-size: 12px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #86efe0;
    margin-bottom: 10px;
}

.login-highlights span {
    display: block;
    color: rgba(239,246,244,.80);
    font-size: 13px;
    line-height: 1.6;
}

.login-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(14, 27, 24, .08);
    box-shadow: 0 22px 58px rgba(28, 43, 38, .12);
    backdrop-filter: blur(12px);
    padding: 34px;
    display: flex;
    align-items: center;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: auto -22% -34% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(18,104,245,.10), transparent 68%);
    pointer-events: none;
}

.login-card-clean {
    min-height: 100%;
}

.login-card-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.login-card-head h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -1.2px;
    color: var(--ink);
}

.login-card-head p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.login-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #e9f6f3;
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    width: fit-content;
}

.login-form {
    display: grid;
    gap: 16px;
    width: 100%;
    max-width: 420px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-form label {
    margin: 0;
    color: var(--ink);
    font-size: 12px;
}

.login-form input {
    background: #fff;
    border-color: #d7dedb;
    min-height: 52px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.login-form input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(8,127,112,.12);
}

.login-form .button.primary {
    min-height: 52px;
    margin-top: 4px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(18,104,245,.22);
}

.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

    .login-remember input {
        width: 16px;
        height: 16px;
        min-height: 16px;
        box-shadow: none;
        margin: 0;
        accent-color: var(--teal);
    }

.login-help {
    color: var(--teal);
    font-size: 12px;
    text-decoration: none;
    font-weight: 700;
}

.login-form .text-danger {
    color: #b73e3e;
    font-size: 12px;
}

.login-form .validation-summary-errors {
    color: #a63a3a;
    background: #fff1f1;
    border: 1px solid #f0caca;
    border-radius: 12px;
    padding: 12px 14px;
}

.full-width {
    width: 100%;
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 30px;
    }

    .login-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .auth-page {
        padding: 14px;
    }

    .login-hero,
    .login-card {
        border-radius: 20px;
        padding: 22px;
    }

    .login-card-head h2 {
        font-size: 24px;
    }

    .login-brand-badge {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .login-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
