      html,
      body {
        background: #f7f4ee !important;
        background-color: #f7f4ee !important;
        background-image: none !important;
        background-attachment: scroll !important;
      }
      .project-background-layer,
      body::before,
      body::after {
        background-image: none !important;
      }
      [hidden] {
        display: none !important;
      }
      .dv-header-logo-link {
        background: none !important;
        color: inherit !important;
        text-indent: 0 !important;
      }
      .dv-header-logo {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
      /* ── MODAL OVERLAY ─────────────────────────────────────────── */
      .vg-overlay {
        position: fixed;
        inset: 0;
        z-index: 9000;
        background: rgba(5, 5, 5, 0.55);
        backdrop-filter: blur(6px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
      }
      .vg-overlay.hidden { display: none; }
      .vg-overlay.is-quickgen-context {
        z-index: 10090;
        align-items: flex-start;
        padding-top: var(--restart-overlay-top, 96px);
        background: rgba(5, 5, 5, 0.28);
        backdrop-filter: blur(3px);
      }
      #sceneExistingCdnOverlay {
        z-index: 13000;
      }

      .vg-modal {
        position: relative;
        width: min(100%, 520px);
        background: rgba(255,255,255,0.72);
        border: 4px solid var(--ink);
        border-radius: 28px;
        box-shadow: 0 40px 100px rgba(5, 5, 5, 0.22);
        padding: clamp(28px, 6vw, 48px);
        animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
      }
      .vg-overlay.is-quickgen-context .vg-modal {
        width: min(92vw, 560px);
        max-height: min(78vh, 520px);
        overflow: auto;
        border-width: 3px;
        border-radius: 22px;
        background: rgba(255,255,255,0.92);
        box-shadow: 0 24px 70px rgba(0,0,0,0.38);
      }
      @keyframes modalPop {
        from { transform: scale(0.88); opacity: 0; }
        to   { transform: scale(1);    opacity: 1; }
      }

      .vg-modal-icon {
        font-size: 2.8rem;
        margin-bottom: 14px;
        display: block;
      }
      .vg-modal-logo {
        display: block;
        width: min(220px, 70%);
        height: auto;
        margin: 0 auto 16px;
        object-fit: contain;
      }
      .vg-modal-project-name {
        margin: 2px auto 14px;
        color: var(--lavender-deep);
        font-size: clamp(1.25rem, 3vw, 1.6rem);
        font-weight: 900;
        line-height: 1.25;
        max-width: 100%;
      }
      .vg-modal-eyebrow {
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 8px;
      }
      .vg-modal h2 {
        font-size: clamp(1.3rem, 4vw, 1.9rem);
        font-weight: 800;
        color: var(--lavender-deep);
        line-height: 1.15;
        margin-bottom: 12px;
      }
      #vgOverlay .vg-modal-eyebrow,
      #vgOverlay #vgModalTitle,
      #vgOverlay .vg-modal-project-name,
      #vgOverlay #vgModalBody {
        text-align: center;
      }
      #vgOverlay #vgModalProjectName {
        font-size: clamp(1.25rem, 3vw, 1.6rem);
        line-height: 1.25;
      }
      #vgOverlay .vg-modal {
        text-align: center;
      }
      .page-load-cover {
        position: fixed;
        inset: 0;
        z-index: 30000;
        display: grid;
        place-items: center;
        padding: 24px;
        background:
          linear-gradient(112deg, transparent 0 16%, rgba(213, 192, 255, 0.65) 17%, rgba(213, 192, 255, 0.12) 19%, transparent 23%),
          linear-gradient(148deg, transparent 0 58%, rgba(190, 158, 255, 0.52) 60%, rgba(190, 158, 255, 0.1) 63%, transparent 69%),
          radial-gradient(circle at 48% 28%, rgba(179, 143, 255, 0.18), transparent 34%),
          rgba(0, 0, 0, 0.65);
        color: #fff;
        text-align: center;
      }
      .page-load-cover[hidden] {
        display: none !important;
      }
      .page-load-card {
        width: min(92vw, 520px);
        display: grid;
        gap: 14px;
        justify-items: center;
        padding: 28px 26px;
        border: 2px solid rgba(213, 192, 255, 0.28);
        border-radius: 20px;
        background: rgba(9, 7, 15, 0.72);
        box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(14px);
      }
      .page-load-card img {
        width: min(260px, 72vw);
        max-height: 76px;
        object-fit: contain;
      }
      .page-load-spinner {
        width: 42px;
        height: 42px;
        border: 4px solid rgba(213, 192, 255, 0.2);
        border-top-color: rgba(213, 192, 255, 0.95);
        border-radius: 999px;
        animation: pageLoadSpin 0.9s linear infinite;
      }
      .page-load-card strong {
        color: rgba(223, 208, 255, 0.96);
        font-size: 1rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .page-load-card p {
        margin: 0;
        color: rgba(255, 255, 255, 0.78);
        font-size: 0.92rem;
        font-weight: 750;
        line-height: 1.55;
      }
      @keyframes pageLoadSpin {
        to { transform: rotate(360deg); }
      }
      .character-lock-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-top: 16px;
      }
      .character-lock-layout textarea {
        width: 100%;
        min-height: 180px;
        resize: vertical;
        border: 2px solid var(--ink);
        border-radius: 14px;
        padding: 14px;
        font: inherit;
        font-weight: 600;
        line-height: 1.55;
        background: rgba(255,255,255,0.86);
      }
      .character-lock-preview {
        display: grid;
        gap: 12px;
        max-height: min(46dvh, 520px);
        overflow: auto;
        padding: 14px;
        border: 2px solid rgba(123, 62, 230, 0.22);
        border-radius: 18px;
        background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(246,241,255,0.9));
        box-shadow: 0 18px 42px rgba(28, 16, 56, 0.1);
      }
      .character-lock-preview[hidden] {
        display: none;
      }
      #quickGenGenerateCharacterSamplesButton,
      [data-character-lock-generate] {
        border-color: var(--lavender-deep) !important;
        box-shadow: 0 0 0 1px rgba(123, 62, 230, 0.12), 0 10px 24px rgba(87, 43, 179, 0.12);
      }
      .character-generation-preview {
        display: grid;
        gap: 10px;
        margin-top: 2px;
        padding: 12px;
        border: 2px solid rgba(123, 62, 230, 0.34);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(244,238,255,0.94));
        box-shadow: 0 16px 36px rgba(42, 22, 90, 0.14);
      }
      .character-generation-preview[hidden] {
        display: none !important;
      }
      .character-generation-preview-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
      }
      .character-generation-preview strong {
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 950;
        letter-spacing: 0.1em;
        text-transform: uppercase;
      }
      .character-generation-preview span {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
      }
      .character-generation-preview img {
        display: block;
        width: 100%;
        max-height: min(42dvh, 420px);
        object-fit: cover;
        object-position: 50% 22%;
        border: 1px solid rgba(24, 18, 36, 0.12);
        border-radius: 12px;
        background: #fff;
      }
      .character-lock-section,
      .character-lock-card {
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 16px;
        padding: 14px;
        background: rgba(255,255,255,0.78);
      }
      .character-lock-section-title {
        margin: 0 0 8px;
        color: var(--lavender-deep);
        font-size: 0.76rem;
        font-weight: 950;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .character-lock-cast-summary {
        margin: 0;
        color: var(--ink);
        font-size: 0.92rem;
        font-weight: 800;
        line-height: 1.5;
      }
      .character-lock-card h3 {
        margin: 0 0 8px;
        color: #4d22b8;
        font-size: clamp(1.12rem, 2.2vw, 1.62rem);
        font-weight: 950;
        line-height: 1.05;
      }
      .character-lock-card .character-lock-card-kicker {
        margin: 0 0 10px;
        color: rgba(24, 18, 36, 0.72);
        font-size: 0.7rem;
        font-weight: 900;
        letter-spacing: 0.11em;
        text-transform: uppercase;
      }
      .character-lock-card p,
      .character-lock-notes li,
      .character-lock-decision-list li {
        color: var(--ink);
        font-size: 0.84rem;
        font-weight: 650;
        line-height: 1.55;
      }
      .character-lock-card p {
        margin: 0 0 10px;
      }
      .character-lock-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
      }
      .character-lock-card-header h3 {
        margin: 0;
      }
      .character-lock-delete-button {
        flex: 0 0 auto;
        border: 1px solid rgba(190, 32, 58, 0.22);
        border-radius: 999px;
        padding: 8px 12px;
        background: rgba(255, 244, 246, 0.92);
        color: #b81836;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        cursor: pointer;
      }
      .character-lock-delete-button:hover {
        background: #b81836;
        color: #fff;
      }
      .character-lock-field {
        display: grid;
        gap: 6px;
        margin-top: 10px;
      }
      .character-lock-field span {
        color: rgba(24, 18, 36, 0.68);
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.1em;
        text-transform: uppercase;
      }
      .character-lock-field input,
      .character-lock-field textarea {
        width: 100%;
        border: 1px solid rgba(83, 56, 129, 0.24);
        border-radius: 12px;
        background: rgba(255,255,255,0.92);
        color: var(--ink);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 650;
        line-height: 1.45;
        padding: 10px 12px;
        outline: none;
      }
      .character-lock-field textarea {
        min-height: 150px;
        resize: vertical;
      }
      .character-lock-edit-help {
        margin: 8px 0 0;
        color: rgba(24, 18, 36, 0.62);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .character-lock-name {
        color: #4d22b8;
        font-weight: 950;
      }
      .character-lock-decision-title {
        margin: 10px 0 8px;
        color: var(--lavender-deep);
        font-size: 0.74rem;
        font-weight: 950;
        letter-spacing: 0.1em;
        text-transform: uppercase;
      }
      .character-lock-decision-list,
      .character-lock-notes {
        display: grid;
        gap: 8px;
        margin: 0;
        padding-left: 18px;
      }
      .character-lock-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
      }
      .character-lock-sample {
        position: relative;
        border: 3px solid rgba(24, 18, 36, 0.24);
        border-radius: 16px;
        padding: 8px;
        background: rgba(255,255,255,0.78);
        cursor: pointer;
        text-align: left;
        transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
      }
      .character-lock-sample.is-selected {
        border-color: var(--lavender-deep);
        background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(244,238,255,0.96));
        box-shadow: 0 0 0 5px rgba(123, 62, 230, 0.22), 0 18px 40px rgba(74, 36, 155, 0.24);
        transform: translateY(-2px);
      }
      .character-lock-grid:has(.character-lock-sample.is-selected) .character-lock-sample:not(.is-selected) {
        opacity: 0.58;
      }
      .character-lock-sample.is-selected::after {
        content: "Editing this character";
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 2;
        max-width: calc(100% - 20px);
        border: 1px solid rgba(255,255,255,0.82);
        border-radius: 999px;
        padding: 6px 9px;
        color: #fff;
        background: rgba(79, 35, 184, 0.94);
        box-shadow: 0 10px 22px rgba(34, 18, 80, 0.28);
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        line-height: 1;
        text-transform: uppercase;
      }
      .character-lock-sample img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: contain;
        background: rgba(255,255,255,0.82);
        border-radius: 10px;
        display: block;
      }
      .character-lock-sample span {
        display: block;
        margin-top: 8px;
        font-size: 0.72rem;
        font-weight: 800;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }
      .character-lock-sample-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        margin-top: 9px;
      }
      .character-lock-sample-action {
        border: 2px solid rgba(24, 18, 36, 0.8);
        border-radius: 999px;
        padding: 8px 10px;
        background: #fff;
        color: var(--ink);
        cursor: pointer;
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        line-height: 1.05;
        text-transform: uppercase;
      }
      .character-lock-sample-action.primary {
        border-color: var(--lavender-deep);
        background: var(--lavender-deep);
        color: #fff;
      }
      .quickgen-character-revision {
        margin-top: 16px;
        padding: 14px;
        border: 2px solid rgba(123,62,230,0.24);
        border-radius: 16px;
        background: rgba(255,255,255,0.72);
      }
      .quickgen-character-revision[hidden] {
        display: none;
      }
      .quickgen-character-revision textarea {
        width: 100%;
        min-height: 96px;
        resize: vertical;
        border: 2px solid var(--ink);
        border-radius: 14px;
        padding: 14px;
        font: inherit;
        font-weight: 650;
        line-height: 1.45;
        background: rgba(255,255,255,0.92);
      }
      .quickgen-character-revision .outline-button {
        margin-top: 10px;
        width: min(100%, 240px);
      }
      #quickGenCharacterLockOverlay {
        padding: clamp(10px, 2vw, 18px);
      }
      #quickGenCharacterLockOverlay .vg-modal {
        width: min(880px, calc(100vw - 24px)) !important;
        max-height: calc(100dvh - 24px);
        overflow: auto;
        padding: clamp(16px, 2.4vw, 26px);
        border-width: 3px;
        border-radius: 22px;
      }
      #quickGenCharacterLockOverlay .vg-modal h2 {
        margin-bottom: 8px;
      }
      #quickGenCharacterLockOverlay .vg-modal > p:not(.vg-modal-eyebrow):not(.save-status) {
        margin-bottom: 12px;
        font-size: 0.82rem;
        line-height: 1.45;
      }
      #quickGenCharacterLockOverlay .character-lock-layout {
        gap: 10px;
        margin-top: 10px;
      }
      #quickGenCharacterLockOverlay .character-lock-layout textarea {
        min-height: clamp(96px, 18dvh, 150px);
        max-height: 24dvh;
        padding: 11px 12px;
        font-size: 0.82rem;
        line-height: 1.42;
      }
      #quickGenCharacterLockOverlay .character-lock-grid {
        grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
        gap: 10px;
        max-height: min(46dvh, 430px);
        overflow: auto;
        padding-right: 4px;
      }
      #quickGenCharacterLockOverlay .character-lock-sample {
        border-width: 2px;
        border-radius: 14px;
        padding: 7px;
      }
      #quickGenCharacterLockOverlay .character-lock-sample img {
        min-height: clamp(132px, 18dvh, 210px);
        max-height: min(26dvh, 240px);
        object-fit: contain;
      }
      #quickGenCharacterLockOverlay .character-lock-sample span {
        margin-top: 6px;
        font-size: 0.66rem;
        line-height: 1.25;
      }
      #quickGenCharacterLockOverlay .quickgen-character-revision {
        margin-top: 10px;
        padding: 10px;
      }
      #quickGenCharacterLockOverlay .quickgen-character-revision textarea {
        min-height: clamp(76px, 14dvh, 112px);
        padding: 10px 12px;
        font-size: 0.8rem;
      }
      #quickGenCharacterLockOverlay #quickGenCharacterBibleInput {
        display: none;
      }
      #quickGenCharacterLockOverlay .vg-modal-actions {
        position: sticky;
        bottom: -1px;
        z-index: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 10px;
        margin-top: 8px;
        background: transparent;
        border-radius: 0;
      }
      #quickGenCharacterLockOverlay .vg-modal-actions .primary-button,
      #quickGenCharacterLockOverlay .vg-modal-actions .outline-button {
        flex: 0 1 min(100%, 360px);
        width: min(100%, 360px);
      }
      #quickGenCharacterLockOverlay .vg-modal-actions .outline-button {
        background: rgba(255,255,255,0.08);
      }
      #quickGenCharacterLockOverlay .save-status {
        margin: 8px 0 0;
        font-size: 0.74rem;
        line-height: 1.35;
      }
      .vg-modal p {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--ink);
        line-height: 1.65;
        margin-bottom: 24px;
      }
      .timeline-submit-checklist {
        display: grid;
        gap: 8px;
        margin: 0 0 18px;
        padding: 0;
        list-style: none;
      }
      .timeline-submit-checklist li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 1.5px solid rgba(5, 5, 5, 0.16);
        border-radius: 14px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.68);
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 800;
      }
      .timeline-submit-checklist li::after {
        content: "Pending";
        border-radius: 999px;
        padding: 4px 8px;
        background: rgba(5, 5, 5, 0.08);
        color: var(--muted);
        font-size: 0.66rem;
        text-transform: uppercase;
        white-space: nowrap;
      }
      .timeline-submit-checklist li[data-state="done"] {
        border-color: rgba(20, 130, 82, 0.28);
        background: rgba(220, 252, 237, 0.76);
      }
      .timeline-submit-checklist li[data-state="done"]::after {
        content: "Ready";
        background: rgba(20, 130, 82, 0.14);
        color: #12613c;
      }
      .vg-modal-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .vg-modal-actions .primary-button {
        width: 100%;
        text-align: center;
        font-size: 0.9rem;
      }
      .vg-modal-actions .outline-button {
        width: 100%;
        text-align: center;
        font-size: 0.84rem;
        min-height: 44px;
        cursor: pointer;
      }
      .scene-replace-confirm-copy {
        margin: 8px 0 0;
        color: rgba(24, 18, 36, 0.72);
        font-size: 0.92rem;
        font-weight: 750;
        line-height: 1.55;
      }
      .scene-replace-confirm-actions {
        display: grid;
        grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr);
        gap: 12px;
      }
      .scene-replace-confirm-actions .scene-replace-cancel {
        min-height: 54px;
        font-size: 0.92rem;
      }
      .scene-replace-confirm-actions .scene-replace-confirm {
        min-height: 46px;
        font-size: 0.78rem;
      }
      @media (max-width: 640px) {
        .scene-replace-confirm-actions {
          grid-template-columns: 1fr;
        }
      }
      .teaser-launch-button {
        min-height: 34px;
        padding: 8px 16px;
        font-size: 0.76rem;
        line-height: 1;
      }
      #vgHero {
        display: grid;
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.4fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 0;
        padding: clamp(6px, 1vw, 11px) clamp(10px, 1.5vw, 18px) !important;
      }
      #vgHero .eyebrow {
        margin: 0;
        font-size: clamp(0.52rem, 0.8vw, 0.66rem);
        line-height: 1.15;
      }
      #vgHero h1 {
        font-size: clamp(0.69rem, 1.2vw, 1.02rem);
        line-height: 1.05;
        text-transform: uppercase;
      }
      #vgHero p:not(.eyebrow) {
        margin: 0;
        font-size: clamp(0.62rem, 0.9vw, 0.78rem);
        line-height: 1.25;
        text-transform: uppercase;
      }
      #vgHero .clip-decision-actions {
        margin-top: 0 !important;
        gap: 6px !important;
        justify-content: flex-end !important;
      }
      #vgHero .teaser-launch-button {
        min-height: 28px;
        padding: 6px 10px;
        font-size: 0.62rem;
        white-space: nowrap;
      }
      #vgHero #teaserStatus {
        max-width: 170px;
        font-size: 0.62rem;
        line-height: 1.2;
      }
      .timeline-production-toolkit {
        margin-top: 12px;
        border: 1px solid rgba(126, 87, 255, 0.28);
        border-radius: 16px;
        background:
          linear-gradient(135deg, rgba(20, 16, 34, 0.96), rgba(41, 34, 61, 0.94)),
          radial-gradient(circle at 15% 20%, rgba(184, 161, 255, 0.2), transparent 34%);
        color: #fff;
        box-shadow: 0 14px 34px rgba(16, 12, 34, 0.18);
        padding: 14px;
      }
      .timeline-production-toolkit .panel-label,
      .timeline-production-toolkit .timeline-track-label {
        color: rgba(222, 211, 255, 0.92);
      }
      .timeline-production-toolkit .storyboard-context {
        color: rgba(255, 255, 255, 0.74);
      }
      .timeline-production-grid {
        display: grid;
        grid-template-columns: minmax(250px, 0.82fr) minmax(320px, 1.18fr);
        gap: 12px;
      }
      .custom-clip-upload-card,
      .custom-clip-editor-card,
      .custom-clip-readiness-card {
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        background: rgba(6, 5, 14, 0.48);
        padding: 12px;
      }
      .custom-clip-dropzone {
        display: grid;
        place-items: center;
        min-height: 112px;
        margin: 10px 0;
        border: 1.5px dashed rgba(201, 185, 255, 0.5);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.82);
        text-align: center;
        font-weight: 900;
        cursor: pointer;
        transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
      }
      .custom-clip-dropzone.is-dragover {
        border-color: #cbb8ff;
        background: rgba(203, 184, 255, 0.16);
        transform: translateY(-1px);
      }
      .custom-clip-dropzone small {
        display: block;
        margin-top: 5px;
        color: rgba(255, 255, 255, 0.58);
        font-size: 0.68rem;
        font-weight: 800;
      }
      .custom-clip-toolbar,
      .custom-clip-row-actions,
      .custom-clip-readiness-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
      }
      .custom-clip-toolbar button,
      .custom-clip-row-actions button,
      .custom-clip-readiness-actions button {
        min-height: 30px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 0.66rem;
        font-weight: 900;
        text-transform: uppercase;
        cursor: pointer;
      }
      .custom-clip-toolbar .primary-button,
      .custom-clip-readiness-actions .primary-button {
        background: #d8c8ff;
        color: #130d24;
      }
      .custom-video-modal {
        width: min(100%, 980px);
        max-height: min(88vh, 820px);
        overflow: auto;
      }
      .custom-video-modal-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 12px;
      }
      .custom-video-modal #timelineProductionToolkit {
        margin-top: 0;
      }
      .custom-video-modal #timelineProductionToolkit[hidden] {
        display: none;
      }
      .custom-clip-url-box {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: end;
        margin-top: 10px;
      }
      .custom-clip-url-box label {
        display: grid;
        gap: 5px;
        color: rgba(238, 233, 255, 0.82);
        font-size: 0.64rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .custom-clip-url-box input {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        padding: 8px 9px;
        font-weight: 800;
      }
      .custom-clip-url-box button {
        min-height: 38px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 0.66rem;
        font-weight: 900;
        text-transform: uppercase;
        cursor: pointer;
      }
      .custom-clip-list {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        max-height: 280px;
        overflow: auto;
      }
      .custom-clip-item {
        display: grid;
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.055);
        padding: 8px;
      }
      .custom-clip-item.is-selected {
        border-color: rgba(216, 200, 255, 0.72);
        box-shadow: 0 0 0 2px rgba(216, 200, 255, 0.12);
      }
      .custom-clip-thumb {
        width: 74px;
        aspect-ratio: 16 / 9;
        border-radius: 8px;
        background: #070510;
        object-fit: cover;
      }
      .custom-clip-title {
        color: #fff;
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1.25;
      }
      .custom-clip-meta {
        margin-top: 3px;
        color: rgba(255, 255, 255, 0.58);
        font-size: 0.64rem;
        font-weight: 800;
      }
      .custom-clip-editor-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
      }
      .custom-clip-editor-grid label,
      .custom-clip-editor-card label {
        display: grid;
        gap: 5px;
        color: rgba(238, 233, 255, 0.82);
        font-size: 0.64rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .custom-clip-editor-grid input,
      .custom-clip-editor-grid select,
      .custom-clip-editor-card textarea {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        padding: 8px 9px;
        font-weight: 800;
      }
      .custom-clip-placement-preview {
        align-self: end;
        min-height: 34px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        display: grid;
        place-items: center start;
        padding: 8px 9px;
        font-size: 0.64rem;
        font-weight: 900;
        line-height: 1.25;
        text-transform: uppercase;
      }
      .custom-clip-editor-card textarea {
        min-height: 72px;
        resize: vertical;
      }
      .custom-clip-editor-card option {
        color: #14101f;
      }
      .custom-clip-readiness-card {
        margin-top: 12px;
      }
      .custom-clip-readiness-list {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin: 10px 0;
      }
      .custom-clip-readiness-pill {
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.8);
        padding: 8px;
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .custom-clip-readiness-pill.is-ready {
        background: rgba(192, 255, 212, 0.16);
        color: #d8ffe4;
      }
      .custom-clip-status {
        display: block;
        min-height: 18px;
        margin-top: 8px;
        color: #e5dcff;
        font-size: 0.68rem;
        font-weight: 900;
      }
      .simple-custom-video-flow {
        padding: 12px;
      }
      .simple-custom-video-flow .timeline-production-grid {
        grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1.08fr);
      }
      .simple-custom-video-flow .custom-clip-dropzone {
        min-height: 92px;
        font-size: 0.86rem;
      }
      .simple-custom-video-flow .custom-clip-editor-grid {
        grid-template-columns: minmax(120px, 0.9fr) minmax(170px, 1.1fr);
      }
      .simple-custom-video-flow .custom-advanced-field {
        display: none !important;
      }
      .simple-custom-video-flow .custom-advanced-details {
        margin-top: 10px;
      }
      .simple-custom-video-flow .custom-advanced-details > summary {
        cursor: pointer;
        list-style: none;
        color: rgba(222, 211, 255, 0.82);
        font-size: 0.66rem;
      }
      .simple-custom-video-flow .custom-advanced-details > summary::-webkit-details-marker {
        display: none;
      }
      .simple-custom-video-flow .custom-advanced-details:not([open]) .custom-clip-readiness-list,
      .simple-custom-video-flow .custom-advanced-details:not([open]) .custom-clip-readiness-actions,
      .simple-custom-video-flow .custom-advanced-details:not([open]) .custom-clip-status {
        display: none;
      }
      @media (max-width: 860px) {
        .timeline-production-grid,
        .custom-clip-editor-grid,
        .custom-clip-readiness-list {
          grid-template-columns: 1fr;
        }
      }
      .timeline-analysis-marker {
        position: absolute;
        top: 4px;
        width: 4px;
        height: 16px;
        border-radius: 999px;
        transform: translateX(-50%);
        box-shadow: 0 0 0 2px rgba(255,255,255,0.78);
      }
      .timeline-analysis-marker.beat {
        background: #d91f55;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 0 0 5px rgba(217,31,85,0.12);
      }
      .timeline-analysis-marker.beat-drop {
        width: 7px;
        background: #9b123f;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.86), 0 0 0 6px rgba(155,18,63,0.18);
      }
      .timeline-analysis-marker.face {
        width: 8px;
        background: #28b463;
      }
      .timeline-analysis-marker.no-face {
        width: 8px;
        background: #ffffff;
        border: 1.5px solid rgba(5,5,5,0.22);
      }
      .timeline-analysis-empty {
        display: flex;
        align-items: center;
        height: 100%;
        min-height: 24px;
        padding-left: 10px;
        color: var(--muted);
        font-size: 0.62rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .timeline-analysis-detail {
        margin: -2px 0 10px;
        border: 1px solid rgba(5,5,5,0.08);
        border-radius: 12px;
        background: rgba(255,255,255,0.62);
        padding: 9px 10px;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .timeline-analysis-detail[hidden] {
        display: none;
      }
      .timeline-analysis-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
      }
      .timeline-analysis-pill {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1px solid rgba(5,5,5,0.08);
        border-radius: 999px;
        background: rgba(255,255,255,0.72);
        padding: 3px 7px;
        color: var(--ink);
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-analysis-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #d91f55;
        box-shadow: 0 0 0 2px rgba(217,31,85,0.12);
      }
      .timeline-analysis-dot.beat-drop {
        background: #9b123f;
      }
      .timeline-analysis-dot.face {
        background: #28b463;
      }
      .timeline-analysis-dot.no-face {
        background: #fff;
        border: 1px solid rgba(5,5,5,0.22);
        box-shadow: none;
      }
      .timeline-analysis-times {
        margin-top: 5px;
        color: var(--ink);
        font-weight: 850;
      }
      .timeline-editor-note {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .timeline-playhead {
        position: absolute;
        top: -28px;
        bottom: -4px;
        width: 16px;
        background: transparent;
        cursor: ew-resize;
        pointer-events: auto;
        touch-action: none;
        transform: translateX(-50%);
        z-index: 5;
      }
      .timeline-playhead:focus-visible::before {
        outline: 3px solid rgba(91,57,214,0.34);
        outline-offset: 4px;
      }
      .timeline-playhead::before {
        content: "";
        position: absolute;
        top: -7px;
        left: 50%;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #d91f55;
        transform: translateX(-50%);
      }
      .timeline-playhead::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        background: #d91f55;
        box-shadow: 0 0 0 3px rgba(217,31,85,0.14);
        transform: translateX(-50%);
      }
      .timeline-track-label {
        margin: 0 0 4px;
        color: var(--ink);
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .timeline-duration-control {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin: 12px 0 16px;
        padding: 10px 12px;
        border: 1.5px solid rgba(5,5,5,0.16);
        border-radius: 14px;
        background: rgba(255,255,255,0.56);
      }
      .timeline-duration-control label {
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-duration-control input {
        width: 96px;
        border: 1.5px solid rgba(5,5,5,0.2);
        border-radius: 999px;
        padding: 8px 12px;
        color: var(--ink);
        background: #fff;
        font-weight: 800;
      }
      .timeline-duration-control span {
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
      }
      .timeline-duration-control--tools {
        margin: 0;
        min-height: 42px;
        padding: 5px 8px;
        border-radius: 999px;
        background: rgba(255,255,255,0.9);
      }
      .timeline-duration-control--tools label {
        font-size: 0.58rem;
        line-height: 1;
        white-space: nowrap;
      }
      .timeline-duration-control--tools input {
        width: 76px;
        min-height: 30px;
        padding: 5px 9px;
        font-size: 0.78rem;
      }
      .timeline-clip {
        position: absolute;
        top: 8px;
        width: 200px;
        min-height: 46px;
        border: 1.5px solid rgba(16, 20, 36, 0.72);
        border-radius: 12px;
        background: #fff;
        color: #050505;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.62rem;
        font-weight: 800;
        cursor: grab;
        box-shadow: 0 8px 0 rgba(5, 5, 5, 0.08), 0 12px 22px rgba(49, 31, 96, 0.12);
        overflow: hidden;
        padding: 5px 10px 6px;
        text-align: center;
        touch-action: none;
        user-select: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
      }
      .timeline-scene-start-marker {
        position: absolute;
        inset: 0 auto 0 0;
        width: 6px;
        background: var(--timeline-scene-marker-color, #d91f55);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.55), 0 0 12px color-mix(in srgb, var(--timeline-scene-marker-color, #d91f55) 50%, transparent);
        pointer-events: none;
      }
      .timeline-clip:active { cursor: grabbing; }
      .timeline-clip.is-locked-intro {
        border-color: rgba(217, 31, 85, 0.42);
        background: linear-gradient(135deg, #1d1233 0%, #5b2ccc 52%, #d91f55 100%);
        color: #fff;
        cursor: default;
        box-shadow: 0 10px 24px rgba(91, 44, 204, 0.22);
      }
      .timeline-clip.is-locked-intro::after {
        content: "LOCKED";
        position: absolute;
        right: 8px;
        top: 6px;
        font-size: 0.48rem;
        letter-spacing: 0.04em;
        color: rgba(255,255,255,0.78);
      }
      .timeline-clip.is-locked-intro .timeline-clip-title,
      .timeline-clip.is-locked-intro .timeline-clip-time {
        color: #fff;
      }
      .timeline-clip.audio {
        width: calc(100% - 24px);
        min-height: 14px;
        top: 5px;
        cursor: default;
        border: 0;
        border-radius: 999px;
        background:
          repeating-linear-gradient(90deg, rgba(255,255,255,0.52) 0 2px, transparent 2px 8px),
          linear-gradient(90deg, #7b3ee6 0%, #d91f55 48%, #ffc957 100%);
        color: transparent;
        padding: 0;
        box-shadow: 0 0 0 1px rgba(255,255,255,0.82), 0 8px 18px rgba(123,62,230,0.16);
      }
      .timeline-clip.audio::after {
        content: "";
        position: absolute;
        inset: 3px 10px;
        border-radius: inherit;
        background: linear-gradient(90deg, rgba(255,255,255,0.22), rgba(255,255,255,0.02), rgba(255,255,255,0.28));
        pointer-events: none;
      }
      .timeline-clip.audio .timeline-clip-title,
      .timeline-clip.audio .timeline-clip-time {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
      }
      .timeline-clip.is-selected {
        border-color: rgba(123, 62, 230, 0.72);
        outline: 3px solid rgba(123, 62, 230, 0.2);
        transform: translateY(-2px);
      }
      .timeline-clip.is-range-selected {
        border-color: rgba(217, 31, 85, 0.72);
        outline: 3px solid rgba(217, 31, 85, 0.16);
        background: linear-gradient(135deg, #fff 0%, #fff4f7 55%, #ffe4ec 100%);
      }
      .timeline-clip.is-split-part {
        border-color: rgba(217, 31, 85, 0.62);
        background: linear-gradient(180deg, #fff 0%, #fff 64%, #fff1f6 100%);
        box-shadow: 0 7px 0 rgba(217, 31, 85, 0.16), 0 10px 20px rgba(49, 31, 96, 0.14);
      }
      .timeline-clip.is-split-part[data-split-part="1"],
      .timeline-clip.is-split-part[data-split-part="3"],
      .timeline-clip.is-split-part[data-split-part="5"] {
        top: 4px;
      }
      .timeline-clip.is-split-part[data-split-part="2"],
      .timeline-clip.is-split-part[data-split-part="4"],
      .timeline-clip.is-split-part[data-split-part="6"] {
        top: 13px;
      }
      .timeline-clip-title,
      .timeline-clip-time {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .timeline-scene-number-badge {
        display: none;
      }
      .timeline-clip-title {
        color: #050505;
        font-size: 0.58rem;
        line-height: 1.05;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: uppercase;
      }
      .timeline-clip-time {
        margin-top: 3px;
        color: #050505;
        font-size: 0.56rem;
        font-weight: 900;
        letter-spacing: 0;
        text-transform: none;
      }
      .timeline-resize-handle {
        position: absolute;
        top: 0;
        width: 30px;
        height: 100%;
        background: transparent;
        cursor: ew-resize;
        z-index: 3;
      }
      .timeline-resize-handle[data-edge="start"] {
        left: 0;
      }
      .timeline-resize-handle[data-edge="end"] {
        right: 0;
      }
      .timeline-resize-handle::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 9px;
        background: var(--timeline-scene-marker-color, #7b3ee6);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.45);
      }
      .timeline-resize-handle[data-edge="start"]::after {
        left: 0;
        border-radius: 12px 0 0 12px;
      }
      .timeline-resize-handle[data-edge="end"]::after {
        right: 0;
        border-radius: 0 12px 12px 0;
        background: #7b3ee6;
      }
      .timeline-cut-handle {
        position: absolute;
        top: 6px;
        bottom: 6px;
        left: 50%;
        width: 3px;
        border-radius: 999px;
        background: #d91f55;
        box-shadow: 0 0 0 5px rgba(217,31,85,0.14);
        cursor: default;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%);
        transition: opacity 0.18s ease;
      }
      .timeline-clip.is-selected .timeline-cut-handle {
        opacity: 1;
      }
      .timeline-cut-handle::before {
        content: "SPLIT";
        position: absolute;
        top: -16px;
        left: 50%;
        color: #d91f55;
        font-size: 0.5rem;
        font-weight: 900;
        transform: translateX(-50%);
      }
      .timeline-loop-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        position: sticky;
        left: 8px;
        z-index: 18;
        width: fit-content;
        max-width: calc(100vw - 72px);
        margin: 6px 0 10px;
        padding: 8px;
        border: 1px solid rgba(55,31,114,0.12);
        border-radius: 10px;
        background: rgba(255,255,255,0.94);
        box-shadow: 0 8px 22px rgba(16,12,34,0.08);
        backdrop-filter: blur(10px);
      }
      .timeline-loop-toolbar button {
        border: 2px solid #7b3ee6;
        border-radius: 999px;
        padding: 7px 12px;
        background: #fff;
        color: var(--lavender-deep);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 900;
        cursor: pointer;
        box-shadow: 0 8px 18px rgba(123, 62, 230, 0.1);
      }
      .timeline-loop-toolbar button.is-active,
      .timeline-loop-toolbar button.primary {
        border-color: rgba(217,31,85,0.38);
        background: #d91f55;
        color: #fff;
      }
      .timeline-loop-toolbar button.danger-action {
        border-color: rgba(217,31,85,0.32);
        color: #b01642;
      }
      .timeline-loop-toolbar button.danger-action:not(:disabled) {
        background: #fff3f6;
      }
      .timeline-loop-toolbar button:disabled {
        cursor: not-allowed;
        opacity: 0.62;
        border-color: rgba(123, 62, 230, 0.34);
      }
      .timeline-loop-toolbar .timeline-undo-button {
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding: 0;
        display: inline-grid;
        place-items: center;
        border-radius: 50%;
        font-size: 1rem;
        line-height: 1;
      }
      .timeline-loop-toolbar .timeline-undo-button svg {
        width: 21px;
        height: 21px;
        display: block;
        stroke-width: 3.1;
      }
      .timeline-loop-selection {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
      }
      .timeline-loop-selection[hidden] {
        display: none;
      }
      .custom-video-helper-text {
        color: #fff;
      }
      .timeline-postprod-after-render-row {
        display: grid;
        margin-top: 8px;
      }
      .timeline-postprod-after-render-row button[hidden] {
        display: none;
      }
      .timeline-scene-map-card {
        margin-bottom: 12px;
        border: 1px solid rgba(55,31,114,0.14);
        border-radius: 14px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 10px 24px rgba(16,12,34,0.08);
        overflow: hidden;
        order: 1;
      }
      .timeline-scene-map-card > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        cursor: pointer;
        list-style: none;
      }
      .timeline-scene-map-card > summary::-webkit-details-marker {
        display: none;
      }
      .timeline-scene-map-title {
        display: grid;
        gap: 3px;
      }
      .timeline-scene-map-title strong {
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-scene-map-title span,
      .timeline-scene-map-count {
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 800;
      }
      .timeline-scene-map-count {
        min-width: max-content;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 999px;
        padding: 5px 8px;
        background: #fff;
        color: var(--lavender-deep);
      }
      .timeline-scene-map-body {
        border-top: 1px solid rgba(55,31,114,0.12);
        padding: 10px 12px 12px;
      }
      .timeline-inline-scene-overview {
        display: grid;
        gap: 8px;
        margin: 8px 0 10px;
        padding: 10px;
        border: 1px solid rgba(123,62,230,0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.72);
      }
      .timeline-inline-scene-overview-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }
      .timeline-inline-scene-overview-head strong {
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-inline-scene-overview-head span {
        color: var(--lavender-deep);
        font-size: 0.62rem;
        font-weight: 900;
      }
      .timeline-inline-scene-overview-grid {
        max-height: 160px;
        overflow: auto;
      }
      .timeline-next-guidance {
        margin: 8px 0 0;
        padding: 8px 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.78);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 750;
      }
      .timeline-next-guidance strong {
        color: var(--lavender-deep);
        font-weight: 900;
      }
      .timeline-generation-center {
        margin: 0 0 14px;
        border: 1px solid rgba(55,31,114,0.15);
        border-radius: 12px;
        background: rgba(255,255,255,0.94);
        box-shadow: 0 12px 26px rgba(16,12,34,0.08);
        padding: 12px;
      }
      .timeline-generation-center-main {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
      }
      .timeline-generation-center-title {
        margin: 0;
        color: var(--ink);
        font-size: 0.9rem;
        font-weight: 950;
      }
      .timeline-generation-center-copy {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .timeline-generation-center-scene {
        flex: 0 0 auto;
        border: 1px solid rgba(123,62,230,0.2);
        border-radius: 999px;
        padding: 7px 10px;
        background: #f6f1ff;
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .timeline-generation-steps {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 7px;
      }
      .timeline-generation-step {
        min-height: 44px;
        border: 1px solid rgba(55,31,114,0.13);
        border-radius: 10px;
        padding: 7px 8px;
        background: #fff;
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-generation-step strong {
        display: block;
        margin-bottom: 3px;
        color: var(--ink);
        font-size: 0.7rem;
        text-transform: none;
      }
      .timeline-generation-step.is-done {
        border-color: rgba(23,125,83,0.32);
        background: #f2fff8;
      }
      .timeline-generation-step.is-active {
        border-color: rgba(123,62,230,0.36);
        background: #f5efff;
      }
      .timeline-generation-step.is-error {
        border-color: rgba(190,61,61,0.34);
        background: #fff3f3;
      }
      .video-next-action-highlight {
        position: relative;
        z-index: 35;
        outline: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow:
          0 0 0 4px rgba(123, 62, 230, 0.16),
          0 10px 24px rgba(79, 38, 170, 0.16) !important;
        animation: videoNextActionPulse 1.7s ease-in-out infinite;
      }
      .storyboard-scene-text.video-next-action-highlight,
      .scene-wise-storyboard-input.video-next-action-highlight {
        outline: 3px solid rgba(123, 62, 230, 0.72);
        background: rgba(250, 247, 255, 0.98);
        box-shadow:
          0 0 0 5px rgba(123, 62, 230, 0.14),
          0 16px 34px rgba(79, 38, 170, 0.18) !important;
      }
      @keyframes videoNextActionPulse {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-2px); }
      }
      .video-next-pointer {
        position: fixed;
        z-index: 12000;
        max-width: min(210px, calc(100vw - 28px));
        padding: 8px 36px 8px 10px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.45);
        background: linear-gradient(135deg, #371f72, #7b3ee6);
        color: #fff;
        box-shadow: 0 12px 30px rgba(27,18,58,0.22);
        pointer-events: none;
        opacity: 0;
        transform: translate3d(-50%, -8px, 0);
        transition: opacity 160ms ease, transform 160ms ease;
      }
      .video-next-pointer.is-visible {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
      }
      .video-next-pointer[hidden] {
        display: none;
      }
      .video-next-pointer strong {
        display: block;
        font-size: 0.58rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .video-next-pointer span {
        display: block;
        margin-top: 2px;
        font-size: 0.66rem;
        line-height: 1.28;
        font-weight: 750;
      }
      .video-next-close,
      .timeline-next-step-close {
        display: inline-grid;
        place-items: center;
        width: 26px;
        height: 26px;
        border: 0;
        border-radius: 999px;
        background: rgba(18, 12, 30, 0.88);
        color: #fff;
        font-family: Poppins, Arial, sans-serif;
        font-size: 1rem;
        font-weight: 950;
        line-height: 1;
        cursor: pointer;
      }
      .video-next-close {
        position: absolute;
        top: 7px;
        right: 7px;
        pointer-events: auto;
      }
      .timeline-next-step-close {
        flex: 0 0 auto;
        background: rgba(42, 30, 66, 0.86);
      }
      .video-next-close:focus-visible,
      .timeline-next-step-close:focus-visible {
        outline: 3px solid rgba(123, 62, 230, 0.3);
        outline-offset: 2px;
      }
      .video-next-pointer::after {
        content: "";
        position: absolute;
        left: 50%;
        width: 10px;
        height: 10px;
        background: #5a2cc1;
        transform: translateX(-50%) rotate(45deg);
      }
      .video-next-pointer.is-above::after {
        bottom: -5px;
      }
      .video-next-pointer.is-below::after {
        top: -5px;
      }
      .scene-review-overlay {
        position: fixed;
        inset: 0;
        z-index: 14000;
        display: grid;
        place-items: center;
        padding: 18px;
        background: rgba(15, 10, 30, 0.72);
        backdrop-filter: blur(12px);
      }
      .scene-review-overlay[hidden] {
        display: none;
      }
      .scene-review-dialog {
        width: min(960px, 100%);
        max-height: min(92vh, 820px);
        overflow: auto;
        border: 2px solid rgba(255,255,255,0.82);
        border-radius: 20px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 28px 80px rgba(9, 5, 28, 0.36);
        padding: clamp(16px, 2.6vw, 26px);
      }
      .scene-review-dialog h2 {
        margin: 0;
        color: var(--lavender-deep);
        font-size: clamp(1.2rem, 2.6vw, 2rem);
        font-weight: 900;
        line-height: 1.1;
      }
      .scene-review-dialog p {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 0.86rem;
        font-weight: 700;
        line-height: 1.55;
      }
      .scene-review-video {
        margin-top: 16px;
        border: 2px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        overflow: hidden;
        background: #090612;
      }
      .scene-review-video video {
        display: block;
        width: 100%;
        max-height: 58vh;
        object-fit: contain;
        background: #090612;
      }
      .scene-review-prompt {
        margin-top: 12px;
        border: 1.5px solid rgba(36,28,55,0.24);
        border-radius: 14px;
        padding: 12px;
        background: rgba(255,255,255,0.96);
        color: #140f20 !important;
        font-size: 0.78rem;
        font-weight: 650;
        line-height: 1.55;
        max-height: 120px;
        overflow: auto;
        white-space: pre-wrap;
      }
      .scene-review-change-box {
        margin-top: 14px;
        border: 1.5px solid rgba(123,62,230,0.16);
        border-radius: 16px;
        padding: 12px;
        background: rgba(244,238,255,0.76);
      }
      .scene-review-change-box[hidden] {
        display: none;
      }
      .scene-review-change-box label {
        display: grid;
        gap: 8px;
        color: #140f20;
        font-size: 0.74rem;
        font-weight: 950;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .scene-review-change-box textarea {
        width: 100%;
        min-height: 96px;
        border: 1.5px solid rgba(36,28,55,0.26);
        border-radius: 14px;
        padding: 12px 44px 12px 12px;
        color: #140f20 !important;
        background: #ffffff;
        caret-color: #140f20;
        font: 700 0.84rem/1.5 Poppins, Arial, sans-serif;
        resize: vertical;
        outline: none;
      }
      .scene-review-change-box textarea::placeholder {
        color: rgba(20,15,32,0.58);
      }
      .scene-review-change-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 10px;
        flex-wrap: wrap;
      }
      .negative-prompt-note,
      .scene-review-negative-label {
        display: none !important;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
        border: 1.5px solid rgba(155, 93, 0, 0.22);
        border-radius: 999px;
        padding: 7px 10px;
        background: rgba(255, 247, 232, 0.94);
        color: #6f4300;
        font-size: 0.64rem;
        font-weight: 950;
        line-height: 1.25;
        text-transform: uppercase;
        letter-spacing: 0.02em;
      }
      .negative-prompt-note::before,
      .scene-review-negative-label::before {
        content: "!";
        display: inline-grid;
        place-items: center;
        width: 16px;
        height: 16px;
        border-radius: 999px;
        background: #8a5500;
        color: #fff;
        font-size: 0.66rem;
        font-weight: 950;
      }
      .scene-review-actions {
        margin-top: 16px;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
      }
      .timeline-next-step-bar {
        position: fixed;
        left: 50%;
        bottom: 14px;
        z-index: 8900;
        width: min(720px, calc(100vw - 24px));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 10px 9px 14px;
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 999px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 20px 44px rgba(27,18,58,0.2);
        transform: translateX(-50%);
      }
      .timeline-next-step-bar[hidden] {
        display: none;
      }
      .timeline-next-step-copy {
        min-width: 0;
      }
      .timeline-next-step-copy strong,
      .timeline-next-step-copy span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .timeline-next-step-copy strong {
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .timeline-next-step-copy span {
        color: var(--ink);
        font-size: 0.76rem;
        font-weight: 850;
      }
      .timeline-next-step-button {
        flex: 0 0 auto;
        min-width: 130px;
        border: 0;
        border-radius: 999px;
        padding: 10px 14px;
        background: var(--lavender-deep);
        color: #fff;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-resume-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 12px 0 0;
        padding: 13px 14px;
        border: 1.5px solid rgba(123,62,230,0.2);
        border-radius: 14px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 12px 28px rgba(55,31,114,0.08);
      }
      .timeline-resume-banner[hidden] {
        display: none;
      }
      .timeline-resume-banner strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.9rem;
      }
      .timeline-resume-banner span {
        display: block;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
        margin-top: 2px;
      }
      .timeline-resume-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }
      .timeline-build-progress {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(123,62,230,0.14);
      }
      .timeline-build-progress .storyboard-context {
        margin: 0;
        font-size: 0.76rem;
        line-height: 1.45;
        letter-spacing: 0.02em;
        text-transform: none;
      }
      .timeline-build-progress .timeline-resume-banner {
        margin: 0;
      }
      .timeline-scene-step-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }
      .timeline-scene-step {
        border: 1px solid rgba(123,62,230,0.16);
        border-radius: 12px;
        padding: 9px 10px;
        background: #fff;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        text-transform: uppercase;
      }
      .timeline-scene-step strong {
        display: block;
        color: var(--ink);
        font-size: 0.78rem;
        text-transform: none;
      }
      .timeline-scene-step.is-done {
        border-color: rgba(18,139,92,0.34);
        background: rgba(18,139,92,0.09);
      }
      .timeline-scene-step.is-active {
        border-color: rgba(123,62,230,0.34);
        background: rgba(123,62,230,0.1);
      }
      .timeline-scene-step.is-waiting {
        opacity: 0.72;
      }
      .timeline-scene-map-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 7px;
      }
      .timeline-scene-tile {
        min-height: 64px;
        border: 1.5px solid rgba(55,31,114,0.18);
        border-radius: 10px;
        padding: 8px;
        background: #fff;
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 6px 14px rgba(16,12,34,0.07);
      }
      .timeline-scene-tile:hover,
      .timeline-scene-tile:focus-visible {
        border-color: rgba(123,62,230,0.72);
        outline: 3px solid rgba(123,62,230,0.14);
      }
      .timeline-scene-tile.is-active {
        border-color: var(--lavender-deep);
        background: #f4efff;
      }
      .timeline-scene-tile[data-state="done"] {
        border-color: rgba(23,125,83,0.38);
        background: linear-gradient(135deg, #f2fff8, #ffffff);
      }
      .timeline-scene-tile[data-state="partial"] {
        border-color: rgba(23,125,83,0.28);
        background: linear-gradient(135deg, #f7fff9, #f6f0ff);
      }
      .timeline-scene-tile[data-state="generating"] {
        border-color: rgba(188,111,18,0.45);
        background: linear-gradient(135deg, #fff7e8, #ffffff);
      }
      .timeline-scene-tile[data-state="ready"] {
        border-color: rgba(123,62,230,0.32);
        background: linear-gradient(135deg, #f5f0ff, #ffffff);
      }
      .timeline-scene-tile[data-state="frame"],
      .timeline-scene-tile[data-state="prompt"] {
        border-color: rgba(58,117,175,0.28);
        background: linear-gradient(135deg, #f3f8ff, #ffffff);
      }
      .timeline-scene-tile[data-state="failed"] {
        border-color: rgba(190,61,61,0.42);
        background: linear-gradient(135deg, #fff3f3, #ffffff);
      }
      .timeline-scene-tile-number,
      .timeline-scene-tile-status,
      .timeline-scene-tile-time {
        display: block;
      }
      .timeline-scene-tile-number {
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 900;
      }
      .timeline-scene-tile-status {
        margin-top: 4px;
        color: var(--ink);
        font-size: 0.62rem;
        font-weight: 900;
      }
      .timeline-scene-tile-time {
        margin-top: 3px;
        color: var(--muted);
        font-size: 0.54rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .timeline-actions {
        position: relative;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(32px, 32px));
        gap: 5px;
        margin-top: 0;
        padding: 4px;
        border: 1px solid rgba(5,5,5,0.09);
        border-radius: 999px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 5px 12px rgba(16,12,34,0.06);
        justify-content: center;
        align-items: center;
      }
      .timeline-icon-button {
        position: relative;
        display: inline-grid;
        place-items: center;
        width: 32px;
        height: 32px;
        border: 1px solid rgba(5,5,5,0.18);
        border-radius: 50%;
        background: #fff;
        color: var(--lavender-deep);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(16,12,34,0.06);
      }
      .timeline-icon-button.is-primary {
        background: var(--lavender-deep);
        color: #fff;
        border-color: var(--lavender-deep);
      }
      #saveTimelineContinueButton {
        outline: 2px solid rgba(255,255,255,0.9);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.16), 0 12px 24px rgba(55,31,114,0.18);
      }
      .timeline-save-continue-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-top: 28px;
        padding-top: 12px;
      }
      .timeline-save-continue-row #saveTimelineContinueButton,
      .timeline-save-continue-row #continueTimelineQuickGenButton {
        min-width: 220px;
        outline: none;
      }
      .timeline-save-continue-row .quickgen-continue-note {
        max-width: 520px;
        margin: 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.45;
        text-align: center;
      }
      .timeline-icon-button.is-danger {
        background: #8d1732;
        color: #fff;
        border-color: #8d1732;
      }
      .timeline-add-scene-button {
        position: absolute;
        top: 50%;
        width: 38px;
        height: 38px;
        border: 2px solid rgba(123, 62, 230, 0.24);
        border-radius: 50%;
        background: #ffffff;
        color: var(--lavender-deep);
        font-size: 1.4rem;
        font-weight: 900;
        line-height: 1;
        display: grid;
        place-items: center;
        cursor: pointer;
        transform: translate(-50%, -50%);
        box-shadow: 0 10px 22px rgba(16,12,34,0.16);
        z-index: 7;
      }
      .timeline-add-scene-button:hover,
      .timeline-add-scene-button:focus-visible {
        background: var(--lavender-deep);
        color: #fff;
        outline: none;
      }
      .timeline-add-scene-button::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 9px);
        min-width: max-content;
        border-radius: 999px;
        background: rgba(8,6,18,0.92);
        color: #fff;
        padding: 7px 10px;
        font-size: 0.62rem;
        font-weight: 800;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 4px);
        transition: opacity 0.16s ease, transform 0.16s ease;
      }
      .timeline-add-scene-button:hover::after,
      .timeline-add-scene-button:focus-visible::after {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      .timeline-icon-button svg,
      .custom-song-button svg {
        width: 18px;
        height: 18px;
        display: block;
        color: #fff;
      }
      .timeline-icon-button:hover,
      .timeline-icon-button:focus-visible {
        transform: translateY(-1px);
        outline: none;
        box-shadow: 0 10px 22px rgba(16,12,34,0.18);
      }
      .timeline-icon-button:disabled,
      .timeline-icon-button[aria-disabled="true"] {
        opacity: 0.42;
        cursor: not-allowed;
        filter: grayscale(0.35);
        transform: none;
        box-shadow: none;
      }
      .timeline-icon-button:disabled:hover,
      .timeline-icon-button[aria-disabled="true"]:hover,
      .timeline-icon-button:disabled:focus-visible,
      .timeline-icon-button[aria-disabled="true"]:focus-visible {
        transform: none;
        box-shadow: none;
      }
      .timeline-icon-button::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 10px);
        min-width: max-content;
        max-width: 180px;
        border-radius: 999px;
        background: rgba(8,6,18,0.92);
        color: #fff;
        padding: 7px 10px;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 4px);
        transition: opacity 0.16s ease, transform 0.16s ease;
        z-index: 20;
      }
      .timeline-icon-button:hover::after,
      .timeline-icon-button:focus-visible::after {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      .timeline-edit-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(112px, 1fr));
        gap: 10px;
        align-items: end;
        margin: 0;
        padding: 12px;
        border: 1px solid rgba(5,5,5,0.12);
        border-radius: 16px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 10px 24px rgba(16,12,34,0.08);
      }
      .timeline-edit-toolbar label {
        display: grid;
        gap: 5px;
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-edit-toolbar input {
        width: 100%;
        min-height: 38px;
        border: 1px solid rgba(5,5,5,0.18);
        border-radius: 999px;
        padding: 9px 12px;
        color: var(--ink);
        background: #fff;
        font-weight: 800;
      }
      .timeline-export-button {
        color: #fff !important;
        text-decoration: none;
      }
      .timeline-export-button:visited,
      .timeline-export-button:hover,
      .timeline-export-button:focus-visible {
        color: #fff !important;
      }
      .timeline-clip.is-generating {
        background: linear-gradient(135deg, #fff7d8 0%, #ffe8a3 55%, #ffd36e 100%);
        color: #6f4300;
        cursor: progress;
      }
      .timeline-clip.is-generating::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.58), transparent);
        transform: translateX(-100%);
        animation: timelineGeneratingSweep 1.4s linear infinite;
      }
      .timeline-clip.is-generating .timeline-clip-title,
      .timeline-clip.is-generating .timeline-clip-time {
        position: relative;
        z-index: 1;
      }
      @keyframes timelineGeneratingSweep {
        to { transform: translateX(100%); }
      }
      .storyboard-timing-panel,
      .timeline-scene-panel {
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        padding: 12px;
        background: rgba(255,255,255,0.58);
      }
      .storyboard-timing-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
        margin-top: 10px;
      }
      .storyboard-timing-grid label {
        display: grid;
        gap: 6px;
        color: rgba(37, 23, 52, 0.76);
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .storyboard-timing-grid select,
      .storyboard-timing-grid input,
      .timeline-scene-settings select,
      .timeline-scene-settings input {
        width: 100%;
        min-height: 42px;
        border: 1.5px solid rgba(5,5,5,0.18);
        border-radius: 12px;
        padding: 9px 11px;
        background: rgba(255,255,255,0.78);
        color: var(--ink);
        font: inherit;
        font-weight: 700;
      }
      .timeline-lyric-cue-card {
        display: grid;
        gap: 8px;
        margin: 0 0 10px;
        padding: 10px;
        border: 1px solid rgba(123,62,230,0.22);
        border-radius: 12px;
        background: rgba(13, 9, 24, 0.72);
        color: rgba(255,255,255,0.92);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
      }
      .timeline-lyric-cue-card[hidden] {
        display: none !important;
      }
      .timeline-lyric-cue-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(222,205,255,0.96);
      }
      .timeline-lyric-cue-range {
        color: rgba(255,255,255,0.72);
        white-space: nowrap;
      }
      .timeline-lyric-cue-audio {
        display: grid;
        gap: 6px;
        padding: 8px;
        border-radius: 10px;
        background: rgba(255,255,255,0.07);
      }
      .timeline-lyric-cue-audio[hidden] {
        display: none !important;
      }
      .timeline-lyric-cue-audio-label {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        color: rgba(222,205,255,0.88);
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .timeline-lyric-cue-audio audio {
        width: 100%;
        height: 32px;
      }
      .timeline-lyric-cue-text {
        margin: 0;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 850;
        line-height: 1.45;
      }
      #timelineMatchedLyricCueText {
        color: #fff !important;
      }
      .timeline-lyric-cue-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
      }
      .timeline-lyric-cue-grid div {
        display: grid;
        gap: 4px;
        padding: 8px;
        border-radius: 10px;
        background: rgba(255,255,255,0.07);
      }
      .timeline-lyric-cue-grid strong {
        color: rgba(222,205,255,0.9);
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .timeline-lyric-cue-grid span {
        color: rgba(255,255,255,0.9);
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1.45;
      }
      .timeline-scene-prompt {
        width: 100%;
        min-height: 260px;
        max-height: 55vh;
        overflow: auto;
        border: 2px solid var(--ink);
        border-radius: 14px;
        background: rgba(255,255,255,0.78);
        padding: 12px;
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-start-frame-prompt-panel {
        display: grid;
        gap: 8px;
        margin: 10px 0;
        padding: 10px;
        border: 1.5px solid rgba(79,54,166,0.18);
        border-radius: 14px;
        background: rgba(255,255,255,0.76);
      }
      .timeline-start-frame-prompt-input {
        width: 100%;
        min-height: 150px;
        max-height: 42vh;
        overflow: auto;
        border: 1.5px solid rgba(36,28,55,0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.92);
        color: var(--ink);
        padding: 10px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-start-frame-prompt-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
      }
      .timeline-start-frame-prompt-actions .outline-button {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 0.66rem;
      }
      .timeline-veo-prompt-review-panel {
        margin-top: 10px;
        padding: 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.86);
      }
      .timeline-prompt-source-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 8px 0;
        color: rgba(36,28,55,0.76);
        font-size: 0.68rem;
        font-weight: 850;
        line-height: 1.35;
      }
      .timeline-prompt-source-summary span {
        border: 1px solid rgba(123,62,230,0.16);
        border-radius: 999px;
        background: rgba(255,255,255,0.74);
        padding: 5px 8px;
      }
      .timeline-veo-prompt-input {
        width: 100%;
        min-height: 190px;
        max-height: 46vh;
        overflow: auto;
        border: 1.5px solid rgba(36,28,55,0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.96);
        color: var(--ink);
        padding: 10px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-veo-prompt-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 8px;
        margin-top: 8px;
      }
      .timeline-veo-prompt-advanced {
        margin-top: 8px;
      }
      .timeline-veo-prompt-advanced > summary {
        cursor: pointer;
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .negative-prompt-note[hidden],
      .scene-review-negative-label[hidden] {
        display: none !important;
      }
      .timeline-prompt-details {
        display: none !important;
        margin-top: 8px;
      }
      .timeline-prompt-details > summary {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 6px 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 999px;
        background: rgba(255,255,255,0.86);
        color: var(--lavender-deep);
        font-size: 0.64rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-prompt-details > summary::-webkit-details-marker {
        display: none;
      }
      .timeline-scene-settings {
        display: grid;
        grid-template-columns: minmax(110px, 0.35fr) minmax(180px, 1fr);
        gap: 10px;
        margin-bottom: 10px;
      }
      .timeline-scene-settings label {
        display: grid;
        gap: 6px;
        color: rgba(37, 23, 52, 0.76);
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
      }
	      .timeline-scene-panel-actions {
	        display: grid;
	        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
	        align-items: stretch;
	        gap: 10px;
	        margin-top: 10px;
	      }
	      .timeline-scene-panel-actions .scene-reset-button {
	        border-color: rgba(141, 23, 50, 0.44);
	        color: #8d1732;
	      }
	      .timeline-scene-panel-actions .scene-reset-button:hover,
	      .timeline-scene-panel-actions .scene-reset-button:focus-visible {
	        background: #8d1732;
	        color: #fff;
	        box-shadow: 6px 6px 0 rgba(141, 23, 50, 0.16);
	      }
	      .timeline-debug-actions {
	        display: grid;
	        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	        align-items: stretch;
	        gap: 8px;
        margin-top: 8px;
      }
      .timeline-debug-actions .outline-button {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.68rem;
      }
      .timeline-recovery-card {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        padding: 10px;
        border: 1.5px solid rgba(123, 62, 230, 0.18);
        border-radius: 14px;
        background: rgba(255,255,255,0.56);
      }
      .timeline-recovery-card[hidden] {
        display: none;
      }
      .timeline-recovery-card strong {
        color: var(--ink);
        font-size: 0.82rem;
      }
      .timeline-recovery-card p {
        margin: 0;
        color: var(--muted);
        font-size: 0.75rem;
        line-height: 1.45;
      }
      .timeline-last-save {
        display: block;
        margin-top: 6px;
        color: rgba(37, 23, 52, 0.72);
        font-size: 0.75rem;
        font-weight: 800;
      }
      .duo-timeline-health {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        margin: 4px 0 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
      }
      .duo-timeline-health[hidden] {
        display: none;
      }
      .duo-health-item {
        min-height: 22px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        max-width: min(100%, 320px);
        border: 1px solid rgba(123, 62, 230, 0.14);
        border-radius: 999px;
        padding: 3px 8px;
        background: rgba(255,255,255,0.78);
      }
      .duo-health-item strong {
        display: inline;
        color: var(--ink);
        font-size: 0.56rem;
        font-weight: 950;
        text-transform: uppercase;
        white-space: nowrap;
      }
      .duo-health-item span {
        display: inline;
        margin-top: 0;
        color: rgba(37, 23, 52, 0.72);
        font-size: 0.58rem;
        font-weight: 800;
        line-height: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .duo-health-item.is-alert {
        border-color: rgba(217, 31, 85, 0.28);
        background: rgba(255, 241, 245, 0.9);
      }
      .duo-health-actions {
        display: none;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        grid-column: 1 / -1;
      }
      .duo-health-actions button {
        min-height: 32px;
        border: 1px solid rgba(123, 62, 230, 0.28);
        border-radius: 8px;
        padding: 7px 10px;
        background: #fff;
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .duo-health-actions button:disabled {
        opacity: 0.45;
        cursor: not-allowed;
      }
      .duo-save-receipt {
        display: block;
        margin-left: auto;
        color: rgba(37, 23, 52, 0.72);
        font-size: 0.7rem;
        font-weight: 850;
      }
      .timeline-save-toast {
        position: fixed;
        right: 24px;
        bottom: 24px;
        z-index: 999999;
        max-width: min(420px, calc(100vw - 32px));
        border: 2px solid rgba(22, 163, 74, 0.35);
        border-radius: 14px;
        background: rgba(240, 253, 244, 0.98);
        color: #14532d;
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
        padding: 14px 16px;
        font-weight: 850;
        line-height: 1.45;
      }
      .timeline-save-toast.is-pending {
        border-color: rgba(234, 179, 8, 0.42);
        background: rgba(254, 252, 232, 0.98);
        color: #713f12;
      }
      .timeline-save-toast.is-error {
        border-color: rgba(220, 38, 38, 0.38);
        background: rgba(254, 242, 242, 0.98);
        color: #7f1d1d;
      }
      .timeline-save-toast strong {
        display: block;
        margin-bottom: 3px;
        color: inherit;
        font-size: 0.9rem;
        text-transform: uppercase;
      }
      .duo-timeline-minimap {
        position: relative;
        height: 28px;
        margin: 0 0 8px;
        border: 1px solid rgba(37, 23, 52, 0.1);
        border-radius: 8px;
        overflow: hidden;
        background: repeating-linear-gradient(90deg, rgba(123,62,230,0.05) 0 12px, rgba(37,23,52,0.035) 12px 24px);
      }
      .duo-timeline-minimap[hidden] {
        display: none;
      }
      .duo-minimap-segment,
      .duo-minimap-playhead {
        position: absolute;
        top: 4px;
        bottom: 4px;
        border-radius: 4px;
      }
      .duo-minimap-segment {
        background: rgba(123, 62, 230, 0.44);
        min-width: 3px;
      }
      .duo-minimap-segment.is-seedance {
        background: rgba(15, 118, 110, 0.58);
      }
      .duo-minimap-segment.is-fallback {
        background: rgba(217, 31, 85, 0.58);
      }
      .duo-minimap-playhead {
        top: 0;
        bottom: 0;
        width: 2px;
        background: #121018;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
      }
      .timeline-model-badge {
        position: static;
        display: block;
        z-index: 3;
        max-width: 100%;
        overflow: hidden;
        color: rgba(37, 23, 52, 0.82);
        font-size: 0.56rem;
        font-weight: 950;
        line-height: 1.05;
        text-overflow: ellipsis;
        text-transform: uppercase;
        white-space: nowrap;
        pointer-events: none;
      }
      .timeline-clip[data-video-model="seedance"] .timeline-model-badge {
        color: #0f766e;
      }
      .timeline-clip[data-video-model-fallback="veo"] .timeline-model-badge {
        color: #8d1732;
      }
      .timeline-cost-badge {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: #0f5132;
        font-size: 0.56rem;
        font-weight: 950;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
      }
      .timeline-cost-badge[hidden] {
        display: none;
      }
      .duo-fallback-policy-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
      .duo-fallback-policy-grid .next-scene-choice {
        min-height: 98px;
      }
      @media (max-width: 760px) {
        .duo-timeline-health {
          grid-template-columns: 1fr;
        }
        .duo-save-receipt {
          margin-left: 0;
        }
        .duo-fallback-policy-grid {
          grid-template-columns: 1fr;
        }
      }
      .timeline-start-frame-review {
        display: grid;
        gap: 10px;
        margin-top: 10px;
        padding: 10px;
        border: 1.5px dashed rgba(111, 75, 255, 0.32);
        border-radius: 14px;
        background: rgba(245, 241, 255, 0.68);
      }
	      .timeline-start-frame-preview {
	        min-height: 230px;
	        display: grid;
	        place-items: center;
	        overflow: hidden;
        border-radius: 12px;
        background: rgba(18, 12, 30, 0.08);
        color: rgba(37, 23, 52, 0.62);
        font-size: 0.78rem;
        font-weight: 800;
        text-align: center;
      }
	      .timeline-start-frame-preview img {
	        width: 100%;
	        height: 100%;
	        max-height: 360px;
	        object-fit: cover;
	        display: block;
	      }
      .start-frame-candidate-grid {
        width: 100%;
        display: grid;
	        grid-template-columns: repeat(2, minmax(0, 1fr));
	        gap: 14px;
	        padding: 10px;
	      }
      .start-frame-candidate {
	        position: relative;
	        display: grid;
	        gap: 8px;
	        border: 2px solid rgba(37, 23, 52, 0.12);
	        border-radius: 14px;
	        padding: 8px;
	        background: rgba(255,255,255,0.9);
	        color: var(--ink);
	        text-align: left;
	        box-shadow: 0 12px 28px rgba(16, 12, 34, 0.12);
	      }
	      .start-frame-candidate.is-selected {
	        border-color: var(--lavender-deep);
	        background: linear-gradient(180deg, rgba(238, 230, 255, 0.98), rgba(255,255,255,0.94));
	        box-shadow: 0 0 0 4px rgba(123,62,230,0.22), 0 16px 32px rgba(16, 12, 34, 0.16);
	      }
      .start-frame-candidate.is-selected::after {
        content: "SELECTED";
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        border-radius: 999px;
        background: var(--lavender-deep);
        color: #fff;
        padding: 5px 9px;
        font-size: 0.62rem;
        font-weight: 1000;
        letter-spacing: 0;
        box-shadow: 0 8px 18px rgba(84, 40, 176, 0.28);
      }
	      .start-frame-candidate-button {
	        border: 0;
	        border-radius: 11px;
	        padding: 0;
	        background: transparent;
	        overflow: hidden;
	        cursor: pointer;
	        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.54);
	      }
      .start-frame-candidate-button img {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
        max-height: none;
        object-fit: cover;
        display: block;
      }
	      .start-frame-candidate-actions {
	        display: flex;
	        align-items: center;
	        justify-content: space-between;
	        gap: 8px;
	        padding: 0 2px;
	        font-size: 0.7rem;
	        font-weight: 900;
	        text-transform: uppercase;
	      }
	      .start-frame-candidate-actions a {
	        color: var(--lavender-deep);
	        text-decoration: none;
	      }
	      .start-frame-candidate-prompt {
	        max-height: 104px;
	        overflow: auto;
	        border: 1px solid rgba(37, 23, 52, 0.1);
	        border-radius: 8px;
	        padding: 7px 8px;
	        background: rgba(247, 244, 255, 0.72);
	        color: rgba(37, 23, 52, 0.74);
	        font-size: 0.68rem;
	        line-height: 1.35;
	        font-weight: 600;
	        overflow-wrap: anywhere;
	      }
	      .start-frame-candidate-prompt strong {
	        display: block;
	        margin-bottom: 3px;
	        color: rgba(37, 23, 52, 0.9);
	        font-size: 0.62rem;
	        text-transform: uppercase;
	      }
	      .custom-start-frame-upload {
	        position: relative;
	        display: inline-flex;
	        align-items: center;
	        justify-content: center;
	        border: 2px solid rgba(24, 18, 36, 0.8);
	        border-radius: 999px;
	        padding: 10px 14px;
	        background: rgba(255,255,255,0.92);
	        color: var(--ink);
	        cursor: pointer;
	        font-size: 0.74rem;
	        font-weight: 950;
	        letter-spacing: 0.06em;
	        line-height: 1.1;
	        text-align: center;
	        text-transform: uppercase;
	      }
	      .custom-start-frame-upload:hover {
	        border-color: var(--lavender-deep);
	        color: var(--lavender-deep);
	      }
	      .custom-start-frame-upload input {
	        display: none;
	      }
	      .next-scene-custom-frame-panel {
	        margin: 10px 0 14px;
	        padding: 12px;
	        border: 2px dashed rgba(124, 72, 232, 0.42);
	        border-radius: 14px;
	        background: rgba(247, 244, 255, 0.82);
	      }
	      .next-scene-custom-frame-panel strong {
	        display: block;
	        color: var(--ink);
	        font-size: 0.82rem;
	        font-weight: 950;
	        text-transform: uppercase;
	      }
	      .next-scene-custom-frame-panel p {
	        margin: 6px 0 10px;
	        color: rgba(37, 23, 52, 0.72);
	        font-size: 0.76rem;
	        font-weight: 800;
	        line-height: 1.45;
	      }
	      .next-scene-custom-frame-panel .custom-start-frame-upload {
	        width: 100%;
	        max-width: 320px;
	      }
	      @media (max-width: 560px) {
	        .start-frame-candidate-grid {
	          grid-template-columns: 1fr;
	        }
	      }
      .timeline-start-frame-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        align-items: stretch;
        gap: 8px;
      }
      .timeline-start-frame-actions .primary-button,
      .timeline-start-frame-actions .outline-button,
      .timeline-scene-panel-actions .primary-button,
      .timeline-scene-panel-actions .outline-button,
      .timeline-debug-actions .primary-button,
      .timeline-debug-actions .outline-button,
      .timeline-save-continue-row .primary-button,
      .timeline-save-continue-row .outline-button,
      .timeline-resume-actions .primary-button,
      .timeline-resume-actions .outline-button,
      .clip-decision-actions .primary-button,
      .clip-decision-actions .outline-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 38px;
        padding: 8px 12px;
        text-align: center;
        line-height: 1.15;
      }
      .next-scene-choice-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 18px 0 14px;
      }
      .next-scene-choice {
        position: relative;
        min-height: 132px;
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 14px;
        padding: 14px;
        background: rgba(255,255,255,0.72);
        color: var(--ink);
        cursor: pointer;
        text-align: left;
        font-family: Poppins, Arial, sans-serif;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
      }
      .next-scene-choice strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.82rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .next-scene-choice span {
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
        line-height: 1.45;
      }
      .next-scene-choice.is-selected {
        border-color: var(--lavender-deep);
        background: linear-gradient(180deg, rgba(238,230,255,0.96), rgba(255,255,255,0.92));
        box-shadow: 0 0 0 4px rgba(123,62,230,0.22), 0 12px 26px rgba(16,12,34,0.12);
        transform: translateY(-1px);
      }
      .next-scene-choice.is-selected::after {
        content: "SELECTED";
        position: absolute;
        top: 10px;
        right: 10px;
        border-radius: 999px;
        background: var(--lavender-deep);
        color: #fff;
        padding: 5px 9px;
        font-size: 0.6rem;
        font-weight: 1000;
        line-height: 1;
        letter-spacing: 0;
        box-shadow: 0 8px 18px rgba(84, 40, 176, 0.24);
      }
      .next-scene-choice:disabled {
        cursor: not-allowed;
        opacity: 0.45;
        box-shadow: none;
        transform: none;
      }
      .next-scene-flow-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 14px 0 12px;
      }
      .next-scene-flow-step {
        position: relative;
        border: 1.5px solid rgba(5,5,5,0.12);
        border-radius: 14px;
        padding: 22px 12px 10px;
        background: rgba(255,255,255,0.66);
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .next-scene-flow-step::before {
        content: attr(data-step-marker);
        position: absolute;
        top: -9px;
        left: 10px;
        min-width: 64px;
        padding: 3px 8px;
        border: 1.5px solid rgba(255,255,255,0.9);
        border-radius: 999px;
        background: rgba(32, 24, 52, 0.88);
        color: #fff;
        box-shadow: 0 8px 18px rgba(32,24,52,0.18);
        font-size: 0.62rem;
        font-weight: 950;
        line-height: 1.1;
        text-align: center;
        text-transform: uppercase;
      }
      .next-scene-flow-step strong {
        display: block;
        margin-bottom: 4px;
        color: var(--ink);
        font-size: 0.78rem;
        text-transform: uppercase;
      }
      .next-scene-flow-step span {
        display: block;
      }
      .next-scene-flow-step.is-active {
        border-color: var(--lavender-deep);
        background: rgba(247,244,255,0.96);
        color: var(--ink);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.12);
      }
      .next-scene-flow-step.is-active::before {
        background: linear-gradient(135deg, #7b3ee6, #4c2ca8);
      }
      .next-scene-flow-step.is-done {
        border-color: rgba(34, 139, 96, 0.45);
        background: rgba(234, 250, 241, 0.92);
        color: #176341;
      }
      .next-scene-flow-step.is-done::before {
        content: "DONE";
        background: #176341;
      }
      .next-scene-tutorial-note {
        margin: 8px 0 14px;
        border: 1.5px solid rgba(123,62,230,0.2);
        border-radius: 14px;
        padding: 10px 12px;
        background: rgba(247,244,255,0.74);
        color: var(--ink);
        font-size: 0.82rem;
        font-weight: 820;
        line-height: 1.5;
      }
      .next-scene-custom-prompt {
        margin: 8px 0 16px;
        border: 1.5px solid rgba(123,62,230,0.18);
        border-radius: 16px;
        padding: 14px;
        background: rgba(247,244,255,0.76);
      }
      .next-scene-custom-prompt[hidden] {
        display: none;
      }
      .next-scene-custom-prompt label {
        display: block;
        margin-bottom: 8px;
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .next-scene-custom-prompt textarea {
        width: 100%;
        min-height: 240px;
        max-height: 52vh;
        overflow: auto;
        border: 2px solid rgba(123,62,230,0.2);
        border-radius: 14px;
        padding: 12px;
        background: #fff;
        color: var(--ink);
        font: 700 0.9rem/1.55 Poppins, Arial, sans-serif;
        resize: vertical;
        outline: none;
      }
      .next-scene-custom-prompt textarea:focus {
        border-color: var(--lavender-deep);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.13);
      }
      .scene-replace-hint {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .vg-modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(5,5,5,0.12);
        border-radius: 999px;
        background: rgba(255,255,255,0.9);
        color: var(--ink);
        font-size: 1.15rem;
        font-weight: 900;
        cursor: pointer;
      }
      #nextSceneModeOverlay {
        padding: clamp(10px, 2.6vw, 28px);
      }
      #nextSceneModeOverlay .vg-modal {
        width: min(94vw, 1040px);
        min-height: 75vh;
        max-height: calc(100dvh - 40px);
        overflow: auto;
        padding: clamp(18px, 2.8vw, 34px);
      }
      #nextSceneModeOverlay .next-scene-intro {
        max-width: 760px;
        margin: 0 0 14px;
        color: var(--ink);
        font-size: 0.9rem;
        font-weight: 760;
        line-height: 1.55;
      }
      #nextSceneModeOverlay .next-scene-section-label {
        margin: 18px 0 8px;
        color: #35215f;
        font-size: 0.72rem;
        font-weight: 950;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-flow-steps {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
      }
      #nextSceneModeOverlay .next-scene-context-panel {
        display: grid;
        gap: 12px;
        margin: 14px 0 16px;
        padding: 14px;
        border: 1px solid rgba(123, 62, 230, 0.22);
        border-radius: 16px;
        background: rgba(255,255,255,0.78);
      }
      #nextSceneModeOverlay .next-scene-context-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
      }
      #nextSceneModeOverlay .next-scene-context-item {
        border: 1px solid rgba(83, 56, 129, 0.14);
        border-radius: 12px;
        padding: 10px;
        background: rgba(255,255,255,0.82);
      }
      #nextSceneModeOverlay .next-scene-context-item strong,
      #nextSceneModeOverlay .next-scene-character-title {
        display: block;
        margin-bottom: 5px;
        color: #4d22b8;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.09em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-context-item span,
      #nextSceneModeOverlay .next-scene-context-summary {
        color: var(--ink);
        font-size: 0.8rem;
        font-weight: 750;
        line-height: 1.45;
      }
      #nextSceneModeOverlay .next-scene-sheet-storyboard {
        border: 1px solid rgba(42, 157, 143, 0.28);
        border-radius: 14px;
        padding: 12px;
        background: rgba(42, 157, 143, 0.08);
      }
      #nextSceneModeOverlay .next-scene-sheet-storyboard strong {
        display: block;
        margin-bottom: 6px;
        color: #176a61;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.09em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-sheet-storyboard p {
        margin: 0;
        color: var(--ink);
        font-size: 0.82rem;
        font-weight: 780;
        line-height: 1.5;
        white-space: pre-wrap;
      }
      #nextSceneModeOverlay .next-scene-sheet-storyboard textarea {
        width: 100%;
        min-height: 130px;
        resize: vertical;
        border: 1px solid rgba(42, 157, 143, 0.28);
        border-radius: 10px;
        padding: 10px;
        background: rgba(255,255,255,0.88);
        color: var(--ink);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.5;
      }
      #nextSceneModeOverlay .next-scene-screenplay-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 8px;
      }
      #nextSceneModeOverlay .next-scene-screenplay-actions .outline-button {
        min-height: 34px;
        padding: 7px 12px;
        border-color: rgba(42, 157, 143, 0.35);
        color: #176a61;
        background: rgba(255,255,255,0.86);
        font-size: 0.68rem;
      }
      #nextSceneModeOverlay .next-scene-screenplay-actions .outline-button:disabled {
        opacity: 0.48;
        cursor: not-allowed;
      }
      #nextSceneModeOverlay #lockNextSceneScreenplayButton:not(:disabled) {
        position: relative;
        min-height: 42px;
        padding: 10px 18px 10px 36px;
        border-color: rgba(255, 194, 26, 0.9);
        background: linear-gradient(135deg, #ffc21a, #ffe47a);
        color: #281849;
        box-shadow:
          0 10px 24px rgba(255, 194, 26, 0.24),
          0 0 0 3px rgba(255, 194, 26, 0.18);
        transform: translateY(-1px);
        animation: screenplayNextStepPulse 1.8s ease-in-out infinite;
      }
      #nextSceneModeOverlay #lockNextSceneScreenplayButton:not(:disabled)::before {
        content: ">";
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.9rem;
        font-weight: 900;
        line-height: 1;
      }
      #nextSceneModeOverlay #lockNextSceneScreenplayButton:not(:disabled)::after {
        content: "NEXT";
        position: absolute;
        top: -10px;
        right: -8px;
        padding: 3px 7px;
        border-radius: 999px;
        background: #281849;
        color: #fff;
        font-size: 0.52rem;
        font-weight: 900;
        line-height: 1;
        letter-spacing: 0;
        box-shadow: 0 6px 14px rgba(40, 24, 73, 0.18);
      }
      @keyframes screenplayNextStepPulse {
        0%, 100% {
          box-shadow:
            0 10px 24px rgba(255, 194, 26, 0.24),
            0 0 0 3px rgba(255, 194, 26, 0.18);
        }
        50% {
          box-shadow:
            0 14px 30px rgba(255, 194, 26, 0.34),
            0 0 0 6px rgba(255, 194, 26, 0.13);
        }
      }
      #nextSceneModeOverlay .next-scene-screenplay-import {
        display: grid;
        grid-template-columns: minmax(180px, 1fr) auto;
        gap: 8px;
        align-items: end;
        margin-top: 8px;
        padding: 9px;
        border: 1px solid rgba(42, 157, 143, 0.24);
        border-radius: 10px;
        background: rgba(255,255,255,0.58);
      }
      #nextSceneModeOverlay .next-scene-screenplay-import[hidden] {
        display: none !important;
      }
      #nextSceneModeOverlay .next-scene-screenplay-import label {
        display: grid;
        gap: 5px;
        color: #176a61;
        font-size: 0.66rem;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-screenplay-import select {
        min-height: 34px;
        border: 1px solid rgba(42, 157, 143, 0.34);
        border-radius: 9px;
        padding: 7px 9px;
        background: rgba(255,255,255,0.92);
        color: var(--ink);
        font: inherit;
        font-size: 0.76rem;
        font-weight: 800;
      }
      #nextSceneModeOverlay .next-scene-screenplay-import .outline-button {
        min-height: 34px;
        padding: 7px 12px;
        border-color: rgba(42, 157, 143, 0.35);
        color: #176a61;
        background: rgba(255,255,255,0.9);
        font-size: 0.68rem;
      }
      #nextSceneModeOverlay .next-scene-screenplay-import-status {
        grid-column: 1 / -1;
        min-height: 16px;
        color: rgba(23, 106, 97, 0.82);
        font-size: 0.68rem;
        font-weight: 800;
      }
      #nextSceneModeOverlay .next-scene-style-recovery {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        border: 1px solid rgba(220, 93, 112, 0.28);
        border-radius: 12px;
        padding: 10px;
        background: rgba(220, 93, 112, 0.08);
      }
      #nextSceneModeOverlay .next-scene-style-recovery[hidden] {
        display: none !important;
      }
      #nextSceneModeOverlay .next-scene-style-recovery select {
        width: min(100%, 320px);
        min-height: 38px;
        border: 1px solid rgba(123, 62, 230, 0.26);
        border-radius: 10px;
        padding: 0 10px;
        background: #fff;
        color: var(--ink);
        font: inherit;
        font-size: 0.78rem;
        font-weight: 800;
      }
      #nextSceneModeOverlay .next-scene-style-next-marker {
        position: relative;
        margin-top: 4px;
        width: min(100%, 420px);
        border: 1.5px solid rgba(123, 62, 230, 0.24);
        border-radius: 12px;
        padding: 24px 12px 10px;
        background: rgba(247,244,255,0.88);
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 850;
        line-height: 1.45;
      }
      #nextSceneModeOverlay .next-scene-style-next-marker::before {
        content: attr(data-step-marker);
        position: absolute;
        top: -9px;
        left: 10px;
        min-width: 58px;
        padding: 3px 8px;
        border: 1.5px solid rgba(255,255,255,0.94);
        border-radius: 999px;
        background: linear-gradient(135deg, #7b3ee6, #4c2ca8);
        color: #fff;
        box-shadow: 0 8px 18px rgba(32,24,52,0.18);
        font-size: 0.62rem;
        font-weight: 950;
        line-height: 1.1;
        text-align: center;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-style-next-marker strong {
        display: block;
        color: #4d22b8;
        font-size: 0.74rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-style-next-marker span {
        display: block;
        margin-top: 3px;
        color: var(--ink);
      }
      .timeline-start-frame-pure-prompt-label {
        color: #111 !important;
      }
      #nextSceneModeOverlay .next-scene-character-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        gap: 10px;
      }
      #nextSceneModeOverlay .next-scene-character-card {
        display: grid;
        gap: 6px;
        align-content: start;
      }
      #nextSceneModeOverlay .next-scene-character-card img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 10px;
        border: 1px solid rgba(83, 56, 129, 0.18);
        background: rgba(255,255,255,0.8);
      }
      #nextSceneModeOverlay .next-scene-character-card span {
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1.2;
      }
      #nextSceneModeOverlay .next-scene-character-picker {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        padding: 10px;
        border: 1px solid rgba(123, 62, 230, 0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.62);
      }
      #nextSceneModeOverlay .next-scene-character-picker[hidden] {
        display: none !important;
      }
      #nextSceneModeOverlay .next-scene-character-picker-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }
      #nextSceneModeOverlay .next-scene-character-picker-head strong {
        color: #3c2384;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-character-picker-head span,
      #nextSceneModeOverlay .next-scene-character-picker-status {
        color: rgba(32, 24, 52, 0.72);
        font-size: 0.68rem;
        font-weight: 800;
      }
      #nextSceneModeOverlay .next-scene-character-picker-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
      }
      #nextSceneModeOverlay .next-scene-character-choice {
        display: grid;
        grid-template-columns: auto 42px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        min-height: 54px;
        padding: 7px;
        border: 1px solid rgba(123, 62, 230, 0.18);
        border-radius: 10px;
        background: rgba(255,255,255,0.82);
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 850;
        cursor: pointer;
      }
      #nextSceneModeOverlay .next-scene-character-choice.is-editable {
        cursor: default;
      }
      #nextSceneModeOverlay .next-scene-character-choice input {
        width: 16px;
        height: 16px;
      }
      #nextSceneModeOverlay .next-scene-character-choice input[type="text"] {
        width: 100%;
        min-height: 30px;
        border: 1px solid rgba(123, 62, 230, 0.2);
        border-radius: 8px;
        padding: 5px 8px;
        background: rgba(255,255,255,0.92);
        color: var(--ink);
        font: inherit;
        font-size: 0.72rem;
        font-weight: 850;
      }
      #nextSceneModeOverlay .next-scene-character-choice img {
        width: 42px;
        height: 42px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid rgba(123, 62, 230, 0.2);
        background: #fff;
      }
      #nextSceneModeOverlay .next-scene-character-choice span {
        min-width: 0;
        overflow-wrap: anywhere;
      }
      #nextSceneModeOverlay .next-scene-character-upload-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
      }
      #nextSceneModeOverlay .next-scene-character-upload-row input {
        min-height: 36px;
        border: 1px solid rgba(123, 62, 230, 0.22);
        border-radius: 10px;
        padding: 8px 10px;
        background: rgba(255,255,255,0.94);
        color: var(--ink);
        font: inherit;
        font-size: 0.76rem;
        font-weight: 850;
      }
      #nextSceneModeOverlay #nextSceneCharacterUploadButton {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 999px;
        font-size: 1.3rem;
        line-height: 1;
      }
      #nextSceneModeOverlay .next-scene-character-at-rule {
        color: rgba(42, 157, 143, 0.95);
        font-size: 0.66rem;
        font-weight: 900;
        line-height: 1.25;
      }
      #nextSceneModeOverlay .next-scene-choice-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: 12px;
        margin: 8px 0 12px;
      }
      #nextSceneModeOverlay .next-scene-choice {
        min-height: 88px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
        padding: 14px 16px;
        border-radius: 12px;
      }
      #nextSceneModeOverlay .next-scene-choice strong {
        font-size: clamp(0.78rem, 1.2vw, 0.9rem);
        line-height: 1.28;
      }
      #nextSceneModeOverlay .next-scene-choice span {
        margin-top: 0;
        max-width: 100%;
        color: #5f586d;
        font-size: 0.74rem;
        font-weight: 760;
        line-height: 1.42;
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-panel {
        display: grid;
        gap: 8px;
        margin: 0 0 12px;
        padding: 12px;
        border: 1px solid rgba(42, 157, 143, 0.24);
        border-radius: 12px;
        background: rgba(42, 157, 143, 0.08);
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-panel[hidden] {
        display: none !important;
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-toggle {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        cursor: pointer;
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-toggle input {
        width: 22px;
        height: 22px;
        accent-color: #2a9d8f;
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-toggle strong {
        display: block;
        color: #176a61;
        font-size: 0.78rem;
        font-weight: 950;
        line-height: 1.25;
      }
      #nextSceneModeOverlay .next-scene-seedance-audio-toggle small {
        display: block;
        margin-top: 2px;
        color: rgba(32, 24, 52, 0.72);
        font-size: 0.68rem;
        font-weight: 780;
        line-height: 1.35;
      }
      #nextSceneModeOverlay .duo-fallback-policy-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
      }
      #nextSceneModeOverlay .duo-fallback-policy-grid .next-scene-choice {
        min-height: 78px;
      }
      #nextSceneModeOverlay .vg-modal-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(140px, 0.28fr);
        gap: 10px;
        margin-top: 16px;
      }
      #nextSceneModeOverlay #nextSceneModeStartButton,
      #nextSceneModeOverlay #nextSceneModeCancelButton {
        min-height: 42px;
        border-radius: 999px;
        font-size: 0.76rem;
        letter-spacing: 0.02em;
      }
      #nextSceneModeOverlay .next-scene-custom-prompt textarea {
        min-height: clamp(180px, 30vh, 300px);
      }
      @media (max-width: 760px) {
        #vgHero {
          grid-template-columns: 1fr;
          gap: 5px;
          padding: 7px 10px !important;
        }
        #vgHero .clip-decision-actions {
          justify-content: flex-start !important;
        }
      }
      .teaser-trim-panel {
        display: grid;
        gap: 14px;
        margin: 16px 0 22px;
        text-align: left;
      }
      .teaser-trim-player {
        width: 100%;
      }
      .teaser-range-wrap {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 2px solid var(--ink);
        border-radius: 16px;
        background: rgba(255,255,255,0.72);
      }
      .teaser-range-wrap input[type="range"] {
        width: 100%;
        accent-color: var(--lavender-deep);
        cursor: grab;
      }
      .teaser-duration-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
      }
      .teaser-duration-row label {
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 800;
      }
      .teaser-duration-row select {
        min-height: 38px;
        border: 2px solid var(--ink);
        border-radius: 999px;
        padding: 0 14px;
        background: #fff;
        color: var(--ink);
        font: inherit;
        font-weight: 800;
      }
      .teaser-range-readout {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--ink);
      }

      /* ── LOCKED BADGE on song/lyrics panels ────────────────────── */
      .locked-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        background: rgba(76, 175, 125, 0.12);
        color: #3a9e72;
        border: 2px solid rgba(76, 175, 125, 0.35);
        border-radius: 999px;
        padding: 4px 12px;
        margin-left: 10px;
        vertical-align: middle;
      }

      /* ── VISION TEXTAREA ────────────────────────────────────────── */
      .vision-textarea {
        width: 100%;
        min-height: 190px;
        border: 2px solid var(--ink);
        border-radius: 16px;
        padding: 18px;
        color: var(--ink);
        background: rgba(255, 255, 255, 0.68);
        font-family: Poppins, Arial, sans-serif;
        font-size: 1.08rem;
        font-weight: 600;
        line-height: 1.7;
        resize: vertical;
        margin-top: 14px;
      }
      .vision-textarea:focus {
        outline: 3px solid rgba(159, 109, 242, 0.34);
        outline-offset: 3px;
      }
      .vision-textarea::placeholder {
        color: var(--muted);
        font-weight: 600;
      }
      #visionInput {
        min-height: 230px;
        text-align: left;
        white-space: pre-wrap;
      }
      #visionInput.vision-textarea--concept-note {
        min-height: min(72vh, 680px);
        height: min(72vh, 680px);
        padding: 24px;
        font-size: 0.98rem;
        line-height: 1.72;
        font-weight: 650;
        letter-spacing: 0;
        background: rgba(255, 255, 255, 0.88);
        border-color: rgba(32, 24, 52, 0.82);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 16px 34px rgba(54, 30, 100, 0.12);
      }
      .concept-action-info {
        position: relative;
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid rgba(123, 62, 230, 0.46);
        border-radius: 50%;
        color: var(--lavender-deep);
        background: rgba(255, 255, 255, 0.86);
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1;
        cursor: help;
        box-shadow: 0 8px 18px rgba(123, 62, 230, 0.11);
      }
      .concept-action-info::before {
        content: "i";
      }
      .concept-action-info::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(4px);
        width: max-content;
        max-width: 260px;
        padding: 9px 11px;
        border-radius: 8px;
        background: rgba(32, 24, 52, 0.96);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.4;
        text-align: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.16s ease, transform 0.16s ease;
        z-index: 20;
      }
      .concept-action-info:hover::after,
      .concept-action-info:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
      .concept-action-info:focus-visible {
        outline: 3px solid rgba(159, 109, 242, 0.34);
        outline-offset: 3px;
      }
      .concept-step-button {
        position: relative;
        overflow: visible;
      }
      .concept-step-button::after {
        content: attr(data-step-marker);
        position: absolute;
        top: -12px;
        right: -10px;
        min-width: 54px;
        padding: 3px 7px;
        border-radius: 999px;
        background: #201834;
        color: #fff;
        border: 1.5px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 8px 18px rgba(32, 24, 52, 0.22);
        font-size: 0.62rem;
        font-weight: 900;
        line-height: 1.1;
        letter-spacing: 0;
        text-align: center;
        pointer-events: none;
        z-index: 3;
      }
      .concept-step-button[data-step-marker="NEXT"]::after,
      .concept-step-button[data-step-marker="STEP 1"]::after,
      .concept-step-button[data-step-marker="STEP 2"]::after,
      .concept-step-button[data-step-marker="STEP 3"]::after {
        background: linear-gradient(135deg, #7b3ee6, #4c2ca8);
      }
      .concept-step-button:disabled::after {
        background: rgba(32, 24, 52, 0.54);
      }
      .video-vision-narration-pause {
        min-height: 38px;
        padding: 9px 16px;
        border-color: rgba(123, 62, 230, 0.48);
        background: rgba(255, 255, 255, 0.86);
        color: var(--lavender-deep);
        box-shadow: 0 10px 22px rgba(123, 62, 230, 0.12);
      }
      .video-vision-narration-pause[hidden] {
        display: none !important;
      }
      .vision-suggestion-options {
        display: none;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
        margin-top: 16px;
      }
      .vision-suggestion-options.visible {
        display: grid;
      }
      .vision-suggestion-card {
        text-align: left;
        border: 2px solid rgba(32, 24, 52, 0.24);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.78);
        color: var(--ink);
        padding: 14px;
        box-shadow: 0 12px 26px rgba(54, 30, 100, 0.10);
        cursor: pointer;
      }
      .vision-suggestion-card:hover,
      .vision-suggestion-card:focus-visible {
        border-color: rgba(123, 62, 230, 0.64);
        box-shadow: 0 16px 32px rgba(123, 62, 230, 0.18);
        outline: none;
      }
      .vision-suggestion-card strong {
        display: block;
        margin-bottom: 8px;
        font-size: 0.88rem;
        text-transform: uppercase;
        letter-spacing: 0;
        color: var(--lavender-deep);
      }
      .vision-suggestion-card span {
        display: block;
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 1.55;
        color: rgba(32, 24, 52, 0.86);
      }
      #visionSuggestionOverlay .vg-modal {
        width: min(100%, 1180px);
        max-height: min(88vh, 820px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
      .vision-suggestion-modal-copy {
        margin: 0 0 14px;
        color: var(--muted);
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1.55;
        text-align: center;
      }
      .vision-suggestion-modal-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        overflow: auto;
        padding: 4px 4px 12px;
      }
      .vision-suggestion-note {
        min-height: 0;
        border: 2px solid rgba(32, 24, 52, 0.22);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.84);
        box-shadow: 0 14px 30px rgba(54, 30, 100, 0.11);
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      .vision-suggestion-note-header {
        border-bottom: 1px solid rgba(32, 24, 52, 0.14);
        padding: 12px 14px;
      }
      .vision-suggestion-note-header strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.88rem;
        text-transform: uppercase;
        letter-spacing: 0;
      }
      .vision-suggestion-note-body {
        flex: 1;
        overflow: auto;
        white-space: pre-wrap;
        padding: 14px;
        font-size: 0.78rem;
        line-height: 1.55;
        font-weight: 600;
        color: rgba(32, 24, 52, 0.9);
        max-height: 460px;
      }
      .vision-suggestion-note-actions {
        padding: 12px 14px 14px;
        border-top: 1px solid rgba(32, 24, 52, 0.14);
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .vision-suggestion-note-actions .primary-button {
        flex: 1 1 auto;
        min-height: 40px;
        padding: 10px 14px;
      }
      #reopenVisionSuggestionsBtn[hidden] {
        display: none !important;
      }
      @media (max-width: 900px) {
        .vision-suggestion-modal-grid {
          grid-template-columns: 1fr;
        }
        .vision-suggestion-note-body {
          max-height: 340px;
        }
      }
      .api-wait-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 22px;
        background:
          radial-gradient(circle at 50% 38%, rgba(184,154,255,0.28), transparent 34%),
          linear-gradient(135deg, rgba(5,5,8,0.96), rgba(54,28,109,0.92));
        color: #fff;
      }
      .api-wait-overlay.is-topmost {
        z-index: 10200;
      }
      .api-wait-overlay[hidden] { display: none; }
      .api-wait-card {
        width: min(92vw, 360px);
        border: 2px solid rgba(255,255,255,0.5);
        border-radius: 18px;
        padding: 28px 24px;
        background: rgba(0,0,0,0.42);
        text-align: center;
        box-shadow: 0 28px 80px rgba(0,0,0,0.36);
      }
      .api-wait-brainstorm {
        width: min(92vw, 720px);
        min-height: clamp(260px, 34vh, 420px);
        max-height: min(58vh, 560px);
        overflow: auto;
        border: 1px solid rgba(255,255,255,0.34);
        border-radius: 16px;
        padding: clamp(18px, 2.6vw, 26px);
        background: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.94);
        box-shadow: 0 18px 50px rgba(0,0,0,0.24);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        text-align: left;
      }
      .api-wait-brainstorm[hidden] {
        display: none;
      }
      .api-wait-brainstorm-title {
        margin: 0 0 10px;
        color: #ffc21a;
        font-size: clamp(1.05rem, 2vw, 1.45rem);
        font-weight: 900;
        line-height: 1.32;
        max-width: 680px;
        text-align: left;
      }
      .api-wait-brainstorm p {
        margin: 0;
        max-width: 680px;
        font-size: 0.78rem;
        font-weight: 650;
        line-height: 1.55;
        text-align: left;
      }
      .api-wait-brainstorm-scene-label {
        font-size: 0.86rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .api-wait-brainstorm-scene-text {
        font-size: 1rem;
        font-weight: 800;
      }
      .api-wait-brainstorm.is-typing p::after {
        content: "";
        display: inline-block;
        width: 0.55em;
        height: 1em;
        margin-left: 2px;
        border-right: 2px solid rgba(255,255,255,0.9);
        transform: translateY(2px);
        animation: apiWaitTypingCaret 0.8s steps(1) infinite;
      }
      .api-wait-brainstorm-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
        gap: 14px;
        margin-top: 14px;
      }
      .api-wait-brainstorm-box {
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 12px;
        padding: 12px;
        background: rgba(0,0,0,0.18);
      }
      .api-wait-brainstorm-box strong {
        display: block;
        margin-bottom: 8px;
        color: #fff;
        font-size: 0.7rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .api-wait-brainstorm-notes {
        width: 100%;
        min-height: 124px;
        resize: vertical;
        border: 1px solid rgba(255,255,255,0.28);
        border-radius: 10px;
        padding: 10px;
        background: rgba(255,255,255,0.11);
        color: #fff;
        font: 700 0.76rem/1.45 Poppins, Arial, sans-serif;
        outline: none;
      }
      .api-wait-brainstorm-notes::placeholder {
        color: rgba(255,255,255,0.62);
      }
      .api-wait-brainstorm-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
      }
      .api-wait-brainstorm-actions button {
        min-height: 30px;
        border: 1px solid rgba(255,255,255,0.24);
        border-radius: 999px;
        padding: 6px 10px;
        background: rgba(255,255,255,0.13);
        color: #fff;
        font-size: 0.64rem;
        font-weight: 900;
        cursor: pointer;
      }
      .api-wait-brainstorm-actions button.primary {
        background: #ffc21a;
        color: #281849;
        border-color: transparent;
      }
      .api-wait-brainstorm-actions button:disabled {
        opacity: 0.58;
        cursor: wait;
      }
      .api-wait-brainstorm-chat {
        display: grid;
        gap: 8px;
        margin-top: 10px;
      }
      .api-wait-brainstorm-chat[hidden] {
        display: none;
      }
      .api-wait-brainstorm-chat-message {
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 10px;
        padding: 8px 10px;
        background: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.92);
        font-size: 0.68rem;
        font-weight: 750;
        line-height: 1.45;
        white-space: pre-wrap;
      }
      .api-wait-brainstorm-chat-message strong {
        display: inline;
        margin: 0 5px 0 0;
        color: #ffc21a;
        font-size: 0.66rem;
      }
      .api-wait-brainstorm-checklist {
        display: grid;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.35;
      }
      .api-wait-brainstorm-checklist li {
        display: flex;
        gap: 8px;
        align-items: flex-start;
      }
      .api-wait-brainstorm-checklist li::before {
        content: "";
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
        margin-top: 5px;
        border-radius: 999px;
        background: #ffc21a;
      }
      .api-wait-brainstorm-status {
        min-height: 18px;
        margin-top: 8px;
        color: rgba(255,255,255,0.74);
        font-size: 0.68rem;
        font-weight: 800;
      }
      @media (max-height: 720px) {
        .api-wait-overlay {
          justify-content: flex-start;
          padding-top: max(18px, env(safe-area-inset-top));
        }
        .api-wait-card {
          padding: 20px 22px;
        }
        .api-wait-brainstorm {
          min-height: 190px;
          max-height: min(40vh, 300px);
        }
        .api-wait-brainstorm-title {
          font-size: clamp(1.2rem, 2.1vw, 1.55rem);
        }
      }
      @media (max-width: 760px) {
        .api-wait-brainstorm-layout {
          grid-template-columns: 1fr;
        }
      }
      .api-wait-model-badge {
        position: relative;
        z-index: 1;
        max-width: min(78vw, 360px);
        margin: 0 auto;
        border: 1px solid rgba(255,255,255,0.34);
        border-radius: 999px;
        padding: 9px 14px;
        background: rgba(255,255,255,0.14);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 950;
        line-height: 1.15;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: center;
        box-shadow: 0 14px 38px rgba(0,0,0,0.28);
        backdrop-filter: blur(10px);
      }
      .api-wait-model-badge[hidden] {
        display: none;
      }
      .screenplay-vault-modal {
        width: min(96vw, 920px);
        max-height: min(86vh, 760px);
        overflow: auto;
      }
      .screenplay-vault-list {
        display: grid;
        gap: 10px;
        margin-top: 16px;
      }
      .screenplay-vault-scene {
        border: 1px solid rgba(123, 62, 230, 0.18);
        border-radius: 12px;
        padding: 12px 14px;
        background: rgba(255,255,255,0.8);
      }
      .screenplay-vault-scene strong {
        display: block;
        margin-bottom: 6px;
        color: var(--lavender-deep);
        font-size: 0.74rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .screenplay-vault-scene p {
        margin: 0;
        color: var(--ink);
        font-size: 0.86rem;
        font-weight: 650;
        line-height: 1.55;
        white-space: pre-wrap;
      }
      .screenplay-vault-empty {
        margin: 16px 0 0;
        color: var(--muted);
        font-size: 0.9rem;
        font-weight: 750;
      }
      @keyframes apiWaitTypingCaret {
        0%, 45% { opacity: 1; }
        46%, 100% { opacity: 0; }
      }
      .api-wait-cancel {
        margin-top: 14px;
        width: 100%;
        min-height: 40px;
        border: 2px solid rgba(255,255,255,0.74);
        border-radius: 999px;
        color: #fff;
        background: rgba(198, 49, 62, 0.82);
        font: 900 0.76rem/1 Poppins, Arial, sans-serif;
        letter-spacing: 0;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 12px 26px rgba(0,0,0,0.22);
      }
      .api-wait-cancel[hidden] {
        display: none;
      }
      .api-wait-cancel:hover {
        background: rgba(225, 64, 78, 0.95);
      }
      .api-wait-ring {
        width: 64px;
        height: 64px;
        margin: 0 auto 16px;
        border: 5px solid rgba(255,255,255,0.2);
        border-top-color: #d8c6ff;
        border-radius: 50%;
        animation: apiWaitSpin 0.9s linear infinite;
      }
      .api-wait-card p {
        margin: 0 0 12px;
        font-size: 1rem;
        font-weight: 800;
      }
      .api-wait-stage,
      .api-wait-started {
        display: block;
        margin: 0 auto 10px;
        color: rgba(255,255,255,0.84);
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.4;
      }
      .api-wait-stage {
        width: min(100%, 300px);
      }
      .api-wait-card strong {
        display: inline-grid;
        place-items: center;
        min-width: 48px;
        height: 48px;
        padding: 0 10px;
        border-radius: 50%;
        background: rgba(255,255,255,0.14);
        color: #efe7ff;
        font-size: 1.25rem;
      }
      .api-wait-card strong.is-progress-percent {
        width: auto;
        min-width: 70px;
        border-radius: 999px;
      }
      .api-wait-progress {
        width: 100%;
        height: 8px;
        margin-top: 12px;
        border-radius: 999px;
        overflow: hidden;
        background: rgba(255,255,255,0.18);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
      }
      .api-wait-progress[hidden] {
        display: none;
      }
      .api-wait-progress-fill {
        width: var(--api-progress, 0%);
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #ffc21a, #9df7df);
        transition: width 0.45s ease;
      }
      @keyframes apiWaitSpin {
        to { transform: rotate(360deg); }
      }

      .video-mode-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 18px;
      }
      .video-mode-card {
        position: relative;
        border: 2px solid var(--ink);
        border-radius: 20px;
        padding: 18px;
        background: rgba(255,255,255,0.72);
        text-align: left;
        cursor: pointer;
        box-shadow: 0 16px 34px rgba(5,5,5,0.12);
      }
      .video-mode-card.is-style-locked {
        opacity: 0.64;
        cursor: not-allowed;
        filter: grayscale(0.28);
      }
      .video-mode-card strong {
        display: block;
        margin-bottom: 8px;
        color: var(--lavender-deep);
        font-size: 1rem;
        font-weight: 900;
        letter-spacing: 0.02em;
      }
      .video-mode-card span {
        display: block;
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.5;
      }
      .video-mode-card:hover,
      .video-mode-card:focus {
        outline: 3px solid rgba(159, 109, 242, 0.34);
        outline-offset: 3px;
      }
      .video-mode-modal {
        text-align: center;
      }
      .video-mode-copy {
        max-width: 560px;
        margin: 0 auto 18px;
        color: var(--ink);
        font-weight: 700;
        line-height: 1.55;
      }
      .video-mode-copy-line {
        display: block;
      }
      .video-mode-copy strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 1.12rem;
        font-weight: 900;
        line-height: 1.35;
        margin: 3px auto;
      }
      .video-mode-modal .video-mode-card {
        text-align: center;
      }
      .quickgen-overlay {
        position: fixed;
        inset: 0;
        z-index: 10050;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background:
          radial-gradient(circle at 50% 25%, rgba(214, 195, 255, 0.26), transparent 34%),
          linear-gradient(135deg, rgba(4,4,8,0.96), rgba(48,24,96,0.95));
        color: #fff;
      }
      .quickgen-overlay[hidden] { display: none; }
      .quickgen-card {
        width: min(80vw, 1280px);
        height: min(80vh, 900px);
        max-height: 80vh;
        overflow: auto;
        border: 2px solid rgba(255,255,255,0.5);
        border-radius: 24px;
        padding: clamp(22px, 4vw, 34px);
        background: rgba(0,0,0,0.48);
        box-shadow: 0 34px 90px rgba(0,0,0,0.42);
      }
      .quickgen-card h2 {
        margin: 0 0 10px;
        color: #fff;
        font-size: clamp(1.4rem, 4vw, 2rem);
        font-weight: 900;
      }
      .quickgen-card p {
        margin: 0 0 16px;
        color: rgba(255,255,255,0.82);
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1.6;
      }
      .quickgen-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
      }
      .quickgen-header-row h2 {
        margin: 0;
      }
      .quickgen-song-title {
        display: inline-flex;
        max-width: min(100%, 720px);
        min-height: 34px;
        align-items: center;
        border: 1px solid rgba(216,198,255,0.36);
        border-radius: 999px;
        padding: 6px 12px;
        margin: 0 0 14px;
        color: rgba(255,255,255,0.92);
        background: rgba(255,255,255,0.08);
        font-size: 0.78rem;
        font-weight: 850;
        line-height: 1.25;
        text-transform: uppercase;
        overflow-wrap: anywhere;
      }
      .quickgen-dashboard-exit {
        display: grid;
        justify-items: start;
        gap: 6px;
        margin: -2px 0 16px;
      }
      .quickgen-dashboard-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        border: 2px solid rgba(255,255,255,0.72);
        border-radius: 999px;
        padding: 0 18px;
        color: #160d2c;
        background: rgba(255,255,255,0.94);
        box-shadow: 0 14px 30px rgba(0,0,0,0.2);
        font-size: 0.72rem;
        font-weight: 950;
        line-height: 1;
        text-decoration: none;
        text-transform: uppercase;
      }
      .quickgen-dashboard-button:hover,
      .quickgen-dashboard-button:focus-visible {
        outline: none;
        color: #fff;
        background: var(--lavender-deep);
      }
      .quickgen-dashboard-helper {
        margin: 0;
        color: rgba(255,255,255,0.78);
        font-size: 0.74rem;
        font-weight: 750;
        line-height: 1.35;
      }
      .quickgen-wallet-chip {
        border-color: rgba(216,198,255,0.52);
        background: rgba(255,255,255,0.12);
        box-shadow: 0 12px 28px rgba(0,0,0,0.24);
      }
      .quickgen-status-line {
        display: grid;
        gap: 8px;
        margin: 16px 0;
        padding: 14px;
        border-radius: 18px;
        background: rgba(255,255,255,0.1);
      }
      .quickgen-retry-instruction {
        display: grid;
        gap: 10px;
        margin: 12px 0 16px;
        padding: 14px;
        border: 1px solid rgba(255,255,255,0.28);
        border-radius: 18px;
        background: rgba(255,255,255,0.12);
      }
      .quickgen-retry-instruction[hidden] {
        display: none;
      }
      .quickgen-retry-instruction strong {
        color: #fff;
        font-size: 0.78rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .quickgen-retry-instruction textarea {
        width: 100%;
        min-height: 88px;
        resize: vertical;
        border: 1px solid rgba(255,255,255,0.34);
        border-radius: 14px;
        padding: 12px;
        color: #fff;
        background: rgba(0,0,0,0.28);
        font: inherit;
        font-size: 0.86rem;
        line-height: 1.5;
      }
      .quickgen-retry-instruction textarea::placeholder {
        color: rgba(255,255,255,0.58);
      }
      .quickgen-retry-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-end;
      }
      .quickgen-ready-scenes {
        position: relative;
        display: grid;
        gap: 10px;
        margin: 16px 0;
        padding: 12px;
        border: 1px solid rgba(255,255,255,0.24);
        border-radius: 18px;
        background: rgba(255,255,255,0.09);
      }
      .quickgen-ready-scenes[hidden] {
        display: none;
      }
      .quickgen-ready-scenes strong {
        color: #efe7ff;
        font-size: 0.76rem;
        font-weight: 950;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .quickgen-ready-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
      }
      .quickgen-ready-toggle {
        border: 1px solid rgba(255,255,255,0.32);
        border-radius: 999px;
        padding: 7px 11px;
        color: #fff;
        background: rgba(255,255,255,0.12);
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .quickgen-ready-note {
        color: rgba(255,255,255,0.72);
        font-size: 0.68rem;
        font-weight: 800;
      }
      .quickgen-ready-track {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
        gap: 12px;
        overflow: visible;
        padding: 2px 0 6px;
      }
      .quickgen-ready-scenes:not(.has-overflow) .quickgen-ready-track {
        padding-right: 0;
      }
      .quickgen-ready-card {
        position: relative;
        min-width: 0;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.24);
        border-radius: 14px;
        background: rgba(0,0,0,0.35);
        scroll-snap-align: start;
      }
      .quickgen-ready-card .quickgen-ready-thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        display: grid;
        place-items: center;
        overflow: hidden;
        border: 0;
        background: linear-gradient(135deg, rgba(24, 15, 52, 0.92), rgba(88, 54, 160, 0.74));
        color: #fff;
        cursor: pointer;
      }
      .quickgen-ready-card .quickgen-ready-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
      .quickgen-ready-card .quickgen-ready-thumb::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.42));
        pointer-events: none;
      }
      .quickgen-ready-play {
        position: absolute;
        z-index: 2;
        left: 50%;
        top: 50%;
        width: 42px;
        height: 42px;
        transform: translate(-50%, -50%);
        border: 1px solid rgba(255,255,255,0.64);
        border-radius: 999px;
        background: rgba(18, 10, 34, 0.76);
        box-shadow: 0 10px 24px rgba(0,0,0,0.32);
      }
      .quickgen-ready-play::before {
        content: "";
        position: absolute;
        left: 17px;
        top: 12px;
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 12px solid #fff;
      }
      .quickgen-ready-placeholder {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: grid;
        place-items: center;
        padding: 12px;
        color: rgba(255,255,255,0.74);
        font-size: 0.72rem;
        font-weight: 950;
        text-align: center;
        text-transform: uppercase;
      }
      .quickgen-ready-card.is-failed,
      .quickgen-ready-card.is-generating {
        padding: 12px;
        min-height: 132px;
        display: grid;
        align-content: center;
        gap: 8px;
      }
      .quickgen-ready-card.is-failed {
        border-color: rgba(255, 159, 159, 0.72);
        background: rgba(80, 16, 26, 0.62);
      }
      .quickgen-ready-card.is-generating {
        border-color: rgba(216, 198, 255, 0.54);
        background: rgba(40, 24, 80, 0.58);
      }
      .quickgen-ready-card span {
        display: block;
        padding: 0;
        color: rgba(255,255,255,0.86);
        font-size: 0.7rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .quickgen-ready-card > .quickgen-ready-scene-label {
        position: absolute;
        left: 8px;
        bottom: 8px;
        z-index: 2;
        max-width: calc(100% - 16px);
        padding: 5px 8px;
        border: 1px solid rgba(255,255,255,0.32);
        border-radius: 999px;
        background: rgba(17, 10, 31, 0.76);
        color: #fff;
        box-shadow: 0 8px 20px rgba(0,0,0,0.26);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
      }
      .quickgen-ready-card.is-failed span,
      .quickgen-ready-card.is-generating span {
        padding: 0;
      }
      .quickgen-ready-card .quickgen-failure-reason {
        padding: 8px 10px;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 10px;
        background: rgba(255,255,255,0.1);
        color: rgba(255,245,245,0.94);
        font-size: 0.66rem;
        font-weight: 800;
        line-height: 1.35;
        text-transform: none;
        white-space: normal;
        overflow-wrap: anywhere;
      }
      .quickgen-ready-card button {
        width: 100%;
        border: 1px solid rgba(255,255,255,0.36);
        border-radius: 999px;
        background: rgba(255,255,255,0.14);
        color: #fff;
        padding: 8px 10px;
        font-size: 0.68rem;
        font-weight: 950;
        cursor: pointer;
        text-transform: uppercase;
      }
      .quickgen-ready-card button:disabled {
        cursor: not-allowed;
        opacity: 0.55;
      }
      .quickgen-ready-scroll {
        display: none;
        position: absolute;
        right: 14px;
        top: 50%;
        z-index: 3;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(255,255,255,0.38);
        border-radius: 999px;
        background: rgba(18, 10, 34, 0.82);
        color: #fff;
        cursor: pointer;
        place-items: center;
        font-size: 1.25rem;
        font-weight: 900;
        box-shadow: 0 10px 24px rgba(5,5,5,0.32);
      }
      .quickgen-ready-scenes:not(.has-overflow) .quickgen-ready-scroll {
        display: none;
      }
      .quickgen-animated-text {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #efe7ff;
        font-size: 0.92rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .quickgen-animated-text::after {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #d8c6ff;
        box-shadow: 14px 0 0 rgba(216,198,255,0.64), 28px 0 0 rgba(216,198,255,0.32);
        animation: quickGenPulse 1s infinite ease-in-out;
      }
      @keyframes quickGenPulse {
        0%, 100% { opacity: 0.35; transform: translateY(0); }
        50% { opacity: 1; transform: translateY(-2px); }
      }
      .quickgen-preview {
        min-height: 260px;
        display: none;
        place-items: center;
        border: 2px dashed rgba(255,255,255,0.34);
        border-radius: 18px;
        background: rgba(255,255,255,0.08);
        overflow: hidden;
      }
      .quickgen-preview video {
        width: 100%;
        max-height: 56vh;
        display: block;
        background: #000;
      }
      .quickgen-smart-summary {
        margin-top: 12px;
        border: 1px solid rgba(216,198,255,0.38);
        border-radius: 16px;
        padding: 12px 14px;
        background: rgba(255,255,255,0.08);
        color: rgba(255,255,255,0.9);
        font-size: 0.82rem;
        font-weight: 750;
        line-height: 1.55;
      }
      .quickgen-smart-summary[hidden] {
        display: none;
      }
      .quickgen-smart-summary strong {
        display: block;
        margin-bottom: 6px;
        color: #efe7ff;
        font-size: 0.78rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .quickgen-smart-summary ul {
        margin: 8px 0 0;
        padding-left: 18px;
      }
      .quickgen-smart-summary li {
        margin: 4px 0;
      }
      .timeline-preview.watermarked-preview,
      .quickgen-preview.watermarked-preview {
        position: relative;
      }
      .timeline-preview.watermarked-preview::after,
      .quickgen-preview.watermarked-preview::after {
        content: "";
        position: absolute;
        right: 18px;
        bottom: 18px;
        z-index: 4;
        width: clamp(41px, 7vw, 85px);
        aspect-ratio: 1 / 1;
        background: url("https://m.gaanagpt.com/cdn/1780005052_final.gif") center / contain no-repeat;
        pointer-events: none;
      }
      .quickgen-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 18px;
      }
      .quickgen-actions .primary-button,
      .quickgen-actions .outline-button {
        min-width: 190px;
      }
      .quickgen-actions .danger-button {
        border-color: #b4232c;
        color: #fff;
        background: #b4232c;
      }
      .quickgen-style-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        margin: 18px 0;
        max-height: min(52vh, 420px);
        overflow: auto;
        padding-right: 4px;
      }
      .quickgen-style-choice {
        min-height: 232px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border: 1px solid rgba(83, 56, 129, 0.2);
        border-radius: 16px;
        background: rgba(255,255,255,0.68);
        color: var(--ink);
        padding: 10px;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 12px 30px rgba(54, 34, 94, 0.1);
      }
      .quickgen-style-choice .style-tile-img,
      .quickgen-style-thumb {
        width: 100%;
        aspect-ratio: 16/10;
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 12px;
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
        box-shadow: inset 0 -30px 48px rgba(5,5,5,0.12);
      }
      .quickgen-style-thumb--empty {
        display: block;
        background: linear-gradient(135deg, rgba(239,231,255,0.9), rgba(255,255,255,0.8));
      }
      .quickgen-style-choice .style-tile-img--lyrical span {
        max-width: 86%;
        font-size: 0.68rem;
      }
      .quickgen-style-choice strong {
        display: block;
        font-size: 0.86rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .quickgen-style-choice span {
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 0.76rem;
        line-height: 1.45;
      }
      .quickgen-style-choice.is-selected {
        border-color: var(--lavender-deep);
        background: linear-gradient(135deg, rgba(123,62,230,0.16), rgba(255,255,255,0.94));
        box-shadow: 0 16px 34px rgba(123, 62, 230, 0.18);
      }
      .quickgen-style-choice.is-style-locked {
        opacity: 0.64;
        cursor: not-allowed;
        filter: grayscale(0.28);
      }
      .quickgen-style-choice.is-style-locked:hover {
        border-color: rgba(83, 56, 129, 0.2);
        box-shadow: 0 12px 30px rgba(54, 34, 94, 0.1);
      }
      .quickgen-style-lock-label {
        display: inline-flex !important;
        width: fit-content;
        margin-top: auto !important;
        border: 1px solid rgba(83, 56, 129, 0.28);
        border-radius: 999px;
        background: rgba(255,255,255,0.82);
        color: var(--lavender-deep) !important;
        padding: 5px 8px;
        font-size: 0.62rem !important;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .quickgen-preprod {
        display: grid;
        gap: 14px;
      }
      #quickGenPreProductionOverlay {
        padding: 12px;
      }
      #quickGenPreProductionOverlay .quickgen-preprod-modal {
        width: min(1180px, calc(100vw - 24px)) !important;
        max-height: calc(100dvh - 24px);
        display: grid;
        grid-template-rows: auto auto auto minmax(0, 1fr);
        overflow: hidden;
        padding: clamp(14px, 2vw, 24px);
      }
      .quickgen-preprod-modal .vg-modal-eyebrow {
        margin-bottom: 4px;
      }
      .quickgen-preprod-modal h2 {
        margin-bottom: 8px;
      }
      .quickgen-preprod-modal #quickGenPreProductionCopy {
        margin-bottom: 10px;
        line-height: 1.45;
      }
      .quickgen-preprod-modal .quickgen-preprod {
        min-height: 0;
        grid-template-rows: auto auto minmax(0, 1fr) auto auto;
        gap: 10px;
      }
      .quickgen-preprod-steps {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
      }
      .quickgen-preprod-step {
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.64);
        color: var(--ink);
        padding: 10px;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.05em;
        text-transform: uppercase;
      }
      .quickgen-preprod-step.is-active {
        border-color: var(--lavender-deep);
        background: rgba(123,62,230,0.14);
        color: var(--lavender-deep);
      }
      .quickgen-preprod-step.is-done {
        border-color: rgba(47, 142, 96, 0.38);
        background: rgba(219, 255, 235, 0.72);
      }
      .quickgen-preprod-panel {
        display: grid;
        grid-template-columns: minmax(260px, 0.86fr) minmax(320px, 1.14fr);
        gap: 12px;
        min-height: 0;
        align-items: stretch;
      }
      .quickgen-preprod-guide {
        display: grid;
        gap: 8px;
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 16px;
        padding: 12px 14px;
        background: rgba(255,255,255,0.72);
        color: var(--ink);
        max-height: min(32dvh, 280px);
        overflow: auto;
      }
      .quickgen-preprod-guide strong {
        color: var(--lavender-deep);
        font-size: 0.76rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .quickgen-preprod-guide p {
        margin: 0;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 750;
        line-height: 1.55;
      }
      .quickgen-preprod-guide pre {
        margin: 0;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        border: 1px solid rgba(83, 56, 129, 0.12);
        border-radius: 12px;
        padding: 10px;
        background: rgba(244,238,255,0.62);
        color: var(--ink);
        font: 800 0.76rem/1.5 Poppins, Arial, sans-serif;
      }
      .quickgen-preprod-panel textarea {
        width: 100%;
        min-height: clamp(180px, 34dvh, 360px);
        height: clamp(180px, 34dvh, 360px);
        resize: vertical;
        border: 1px solid rgba(83, 56, 129, 0.24);
        border-radius: 16px;
        padding: 14px;
        color: var(--ink);
        background: rgba(255,255,255,0.78);
        font: inherit;
        font-size: 0.9rem;
        line-height: 1.55;
      }
      .quickgen-autosuggest-stack {
        display: grid;
        gap: 8px;
        width: 100%;
        max-width: 600px;
      }
      .quickgen-autosuggest-stack .outline-button,
      .quickgen-autosuggest-stack .primary-button {
        width: 100%;
      }
      .quickgen-autosuggest-help {
        margin: 0;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 750;
        line-height: 1.32;
      }
      .quickgen-preprod-modal .vg-modal-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, auto) minmax(110px, auto);
        align-items: end;
        gap: 10px;
      }
      .quickgen-autosuggest-layer {
        position: absolute;
        inset: 0;
        z-index: 5;
        display: grid;
        place-items: center;
        padding: 20px;
        border-radius: inherit;
        background: rgba(18, 12, 32, 0.42);
        backdrop-filter: blur(4px);
      }
      .quickgen-autosuggest-layer[hidden] {
        display: none;
      }
      .quickgen-autosuggest-card {
        width: min(460px, 100%);
        border: 2px solid rgba(255,255,255,0.64);
        border-radius: 20px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 24px 70px rgba(0,0,0,0.28);
        padding: 22px;
        text-align: center;
      }
      .quickgen-autosuggest-card strong,
      .quickgen-autosuggest-card span {
        display: block;
      }
      .quickgen-autosuggest-card strong {
        color: var(--lavender-deep);
        font-size: 0.92rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .quickgen-autosuggest-card span {
        margin-top: 8px;
        color: var(--ink);
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1.55;
      }
      .quickgen-autosuggest-spinner {
        width: 42px;
        height: 42px;
        margin: 0 auto 14px;
        border: 4px solid rgba(123,62,230,0.18);
        border-top-color: var(--lavender-deep);
        border-radius: 50%;
        animation: spin 0.9s linear infinite;
      }
      .quickgen-preprod-mini {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
      }
      .quickgen-preprod-mini span {
        border: 1px solid rgba(83, 56, 129, 0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.58);
        padding: 10px;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
      }
      .lyrical-builder-grid {
        display: grid;
        grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
        gap: 14px;
        margin: 16px 0;
      }
      .lyrical-builder-preview {
        min-height: 220px;
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 18px;
        background: rgba(0,0,0,0.12);
        display: grid;
        place-items: center;
        overflow: hidden;
        color: var(--muted);
        font-weight: 800;
        text-align: center;
      }
      .lyrical-builder-preview img,
      .lyrical-builder-preview video {
        width: 100%;
        height: 100%;
        max-height: 360px;
        object-fit: cover;
        display: block;
      }
      .lyrical-builder-controls textarea,
      .lyrical-builder-controls input,
      .lyrical-builder-controls select {
        width: 100%;
        border: 1px solid rgba(83, 56, 129, 0.18);
        border-radius: 14px;
        padding: 12px;
        font: inherit;
      }
      .lyrical-style-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(83, 56, 129, 0.16);
        border-radius: 16px;
        background: rgba(255,255,255,0.58);
      }
      .lyrical-style-panel label {
        align-self: end;
        color: var(--muted);
        font-size: 0.7rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .lyrical-style-panel input[type="color"] {
        min-height: 42px;
        padding: 4px;
        cursor: pointer;
      }
      .lyrical-timing-list {
        max-height: 260px;
        overflow: auto;
        display: grid;
        gap: 8px;
        margin-top: 12px;
      }
      .lyrical-timing-row {
        display: grid;
        grid-template-columns: 72px 72px minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
      }
      .lyrical-timing-row input {
        min-width: 0;
      }
      @media (max-width: 720px) {
        .video-mode-grid { grid-template-columns: 1fr; }
        .quickgen-preview { min-height: 190px; }
        .lyrical-builder-grid { grid-template-columns: 1fr; }
        .lyrical-style-panel { grid-template-columns: 1fr; }
        .lyrical-timing-row { grid-template-columns: 1fr 1fr; }
        .lyrical-timing-row input[data-lyrical-field="text"],
        .lyrical-timing-row button { grid-column: 1 / -1; }
      }

      /* ── PAGE SECTIONS shown/hidden based on choice ─────────────── */
      .vg-section { display: none; }
      .vg-section.visible { display: block; }

      .workflow-rail {
        display: grid;
        grid-template-columns: repeat(8, minmax(92px, 1fr));
        gap: 8px;
        margin: 0 0 18px;
        padding: 12px;
        border: 1px solid rgba(255,255,255,0.52);
        border-radius: 20px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 18px 48px rgba(9, 6, 20, 0.12);
        backdrop-filter: blur(22px);
      }
      .workflow-step {
        position: relative;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 8px;
        min-height: 74px;
        border: 1px solid rgba(5,5,5,0.1);
        border-radius: 14px;
        padding: 10px;
        background: rgba(255,255,255,0.7);
      }
      .workflow-step-number {
        grid-row: span 2;
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border: 2px solid rgba(123, 62, 230, 0.2);
        border-radius: 999px;
        color: var(--lavender-deep);
        background: rgba(244, 238, 255, 0.88);
        font-size: 0.66rem;
        font-weight: 900;
        line-height: 1;
      }
      .workflow-step strong {
        color: var(--ink);
        font-size: 0.7rem;
        font-weight: 800;
        line-height: 1.25;
      }
      .workflow-step[data-workflow-step="prepublish"] strong {
        text-transform: none;
      }
      .workflow-step span {
        color: var(--muted);
        font-size: 0.62rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .workflow-step.is-done {
        border-color: rgba(42, 160, 104, 0.52);
        background: rgba(226, 255, 240, 0.92);
        box-shadow: inset 0 0 0 2px rgba(42, 160, 104, 0.1);
      }
      .workflow-step.is-done span {
        color: #25865a;
      }
      .workflow-step.is-done .workflow-step-number {
        border-color: #2aa068;
        background: #2aa068;
        color: #fff;
      }
      .workflow-step.is-active {
        border-color: rgba(123, 62, 230, 0.42);
        background: rgba(244, 238, 255, 0.94);
        box-shadow: inset 0 0 0 2px rgba(123, 62, 230, 0.12);
      }
      .workflow-step.is-active span {
        color: var(--lavender-deep);
      }
      .workflow-step.is-locked {
        opacity: 0.74;
        background: rgba(255,255,255,0.46);
      }
      .workflow-step.is-locked .workflow-step-number {
        border-color: rgba(5,5,5,0.14);
        color: rgba(37, 23, 52, 0.5);
        background: rgba(255,255,255,0.72);
      }

      .chosen-style-indicator {
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: -6px 0 14px;
        padding: 12px 14px;
        border: 1px solid rgba(123, 62, 230, 0.22);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(244,238,255,0.9));
        box-shadow: 0 12px 30px rgba(31, 18, 68, 0.1);
      }
      .chosen-style-indicator.is-visible {
        display: flex;
      }
      .chosen-style-indicator span {
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .chosen-style-indicator strong {
        color: var(--lavender-deep);
        font-size: clamp(0.98rem, 1.6vw, 1.22rem);
        font-weight: 950;
        line-height: 1.1;
      }
      .chosen-style-indicator small {
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.35;
        opacity: 0.78;
      }

      .project-status-strip {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: -6px 0 18px;
      }
      .project-status-chip {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        border: 1px solid rgba(5,5,5,0.14);
        border-radius: 999px;
        padding: 0 12px;
        color: var(--ink);
        background: rgba(255,255,255,0.78);
        font-size: 0.72rem;
        font-weight: 800;
      }
      .project-status-chip[data-state="ready"],
      .project-status-chip[data-state="locked"] {
        color: #247653;
        background: rgba(232, 255, 243, 0.86);
      }
      .project-status-chip[data-state="pending"] {
        color: #8a5a00;
        background: rgba(255, 247, 218, 0.9);
      }
      .videogen-footer-tools {
        display: flex;
        justify-content: flex-end;
        margin-top: 18px;
        padding: 14px 0 4px;
      }
      .videogen-health-footer-button {
        min-height: 30px;
        padding: 5px 12px;
        font-size: 0.62rem;
        line-height: 1;
        white-space: nowrap;
        opacity: 0.78;
      }
      .videogen-health-footer-button:hover {
        opacity: 1;
      }
      .videogen-health-check {
        margin: 8px 0 18px;
        border: 1px solid rgba(55,31,114,0.14);
        border-radius: 16px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 14px 32px rgba(16,12,34,0.08);
        overflow: hidden;
      }
      .videogen-health-check > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        cursor: pointer;
        list-style: none;
      }
      .videogen-health-check > summary::-webkit-details-marker {
        display: none;
      }
      .videogen-health-title {
        display: grid;
        gap: 2px;
      }
      .videogen-health-title strong {
        color: var(--ink);
        font-size: 0.88rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .videogen-health-title span {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
      }
      .videogen-health-score {
        min-width: max-content;
        border-radius: 999px;
        padding: 7px 10px;
        background: #fff;
        color: var(--lavender-deep);
        font-size: 0.72rem;
        font-weight: 950;
      }
      .videogen-health-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 8px;
        padding: 0 14px 14px;
      }
      .videogen-health-item {
        border: 1px solid rgba(55,31,114,0.12);
        border-radius: 12px;
        background: rgba(255,255,255,0.82);
        padding: 9px 10px;
        min-width: 0;
      }
      .videogen-health-item strong,
      .videogen-health-item span {
        display: block;
      }
      .videogen-health-item strong {
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .videogen-health-item span {
        margin-top: 3px;
        color: var(--muted);
        font-size: 0.7rem;
        font-weight: 750;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .videogen-health-item[data-state="ready"] {
        border-color: rgba(18,139,92,0.32);
        background: rgba(236,255,244,0.84);
      }
      .videogen-health-item[data-state="missing"] {
        border-color: rgba(188,111,18,0.32);
        background: rgba(255,247,229,0.88);
      }

      /* ── STYLE PICKER GRID ───────────────────────────────────────── */
      .style-picker {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
      }
      .style-tile {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 126px;
        border: 3px solid var(--ink);
        border-radius: 20px;
        background: rgba(255,255,255,0.62);
        cursor: pointer;
        padding: 0;
        overflow: visible;
        transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
        box-shadow: 0 5px 0 rgba(5,5,5,0.12);
      }
      .style-tile:hover {
        border-color: var(--lavender);
        transform: translateY(-3px);
        box-shadow: 0 10px 0 rgba(5,5,5,0.10);
      }
      .style-tile.is-selected {
        border-color: var(--lavender-deep);
        border-width: 4px;
        transform: translateY(-3px);
        box-shadow: 0 10px 0 rgba(123,62,230,0.30);
      }
      .style-tile-img {
        width: 100%;
        aspect-ratio: 3/4;
        border-radius: 17px 17px 0 0;
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
        display: block;
        flex-shrink: 0;
      }
      .style-tile-img--custom {
        background: rgba(239,231,255,0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: var(--lavender-deep);
      }
      .style-tile.is-selected .style-tile-img--custom { background: var(--lavender-deep); color: #fff; }
      .style-category-heading {
        flex-basis: 100%;
        grid-column: 1 / -1;
        margin: 12px 0 -2px;
        color: var(--ink-soft);
        font-size: 0.68rem;
        font-weight: 900;
        letter-spacing: 0.12em;
        text-transform: uppercase;
      }
      .style-tile-img--preset {
        position: relative;
        display: grid;
        place-items: center;
        overflow: hidden;
        background: var(--style-thumb, linear-gradient(135deg, #efe7ff, #7b3ee6));
      }
      .style-tile-img--preset::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
          radial-gradient(circle at 24% 20%, rgba(255,255,255,0.36), transparent 28%),
          linear-gradient(180deg, rgba(255,255,255,0.04), rgba(5,5,5,0.34));
      }
      .style-tile-img--preset span {
        position: relative;
        z-index: 1;
        width: 76%;
        border-radius: 999px;
        padding: 6px 8px;
        color: #fff;
        background: rgba(5,5,5,0.46);
        font-size: 0.62rem;
        font-weight: 900;
        line-height: 1.2;
        text-align: center;
        text-shadow: 0 2px 10px rgba(0,0,0,0.32);
      }
      .style-tile-img--lyrical {
        position: relative;
        display: grid;
        place-items: center;
        overflow: hidden;
        background:
          radial-gradient(circle at 28% 20%, rgba(216,198,255,0.34), transparent 32%),
          linear-gradient(135deg, #170c2d, #4a2592 52%, #12091f);
      }
      .style-tile-img--lyrical::before,
      .style-tile-img--lyrical::after {
        content: "";
        position: absolute;
        inset: 12%;
        border-radius: 18px;
        background:
          linear-gradient(145deg, rgba(255,255,255,0.12), rgba(5,5,5,0.42)),
          linear-gradient(135deg, #342066, #0f071b);
        box-shadow: 0 14px 30px rgba(5,5,5,0.24);
        transform: rotate(-6deg);
      }
      .style-tile-img--lyrical::after {
        inset: 24% 8% 16% 30%;
        background:
          linear-gradient(145deg, rgba(255,255,255,0.14), rgba(5,5,5,0.38)),
          linear-gradient(135deg, #6f3add, #1c0d31);
        transform: rotate(8deg);
      }
      .style-tile-img--lyrical span {
        position: relative;
        z-index: 2;
        width: 82%;
        border-radius: 999px;
        padding: 7px 9px;
        color: #fff;
        background: rgba(5,5,5,0.58);
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1.25;
        text-align: center;
        text-shadow: 0 2px 12px rgba(0,0,0,0.42);
      }
      .style-tile-label {
        width: 100%;
        border-radius: 0 0 17px 17px;
        padding: 7px 6px 8px;
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-align: center;
        line-height: 1.2;
        color: var(--ink);
        background: rgba(255,255,255,0.66);
        border-top: 2px solid var(--ink);
      }
      .style-tile.is-selected .style-tile-label {
        background: var(--lavender-deep);
        color: #fff;
        border-top-color: var(--lavender-deep);
      }
      .style-tile--custom {
        border-style: dashed;
      }
      .style-tile--custom.is-selected {
        border-style: solid;
      }
      .style-tile.is-style-locked {
        opacity: 0.64;
        cursor: not-allowed;
        filter: grayscale(0.35);
      }
      .style-tile.is-style-locked:hover {
        border-color: var(--ink);
        transform: none;
        box-shadow: 0 5px 0 rgba(5,5,5,0.12);
      }
      .style-tile.is-style-locked.is-selected {
        border-color: var(--ink);
        transform: none;
        box-shadow: 0 5px 0 rgba(5,5,5,0.12);
      }
      .style-tile-coming-soon {
        position: absolute;
        left: 8px;
        top: 8px;
        z-index: 6;
        border: 2px solid rgba(255,255,255,0.94);
        border-radius: 999px;
        background: rgba(5,5,5,0.76);
        color: #fff;
        padding: 4px 7px;
        font-size: 0.5rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        line-height: 1;
        pointer-events: none;
        text-transform: uppercase;
      }
      .style-info-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 5;
        display: inline-grid;
        place-items: center;
        width: 25px;
        height: 25px;
        border: 2px solid rgba(255,255,255,0.94);
        border-radius: 999px;
        color: #fff;
        background: rgba(21, 12, 42, 0.76);
        box-shadow: 0 8px 18px rgba(5,5,5,0.24);
        font-size: 0.76rem;
        font-weight: 900;
        line-height: 1;
      }
      .style-info-popover {
        position: absolute;
        top: 38px;
        right: -6px;
        z-index: 8;
        width: min(240px, 78vw);
        padding: 12px;
        border: 2px solid var(--ink);
        border-radius: 14px;
        color: var(--ink);
        background: rgba(255,255,255,0.98);
        box-shadow: 0 18px 38px rgba(5,5,5,0.2);
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1.45;
        text-align: left;
        text-transform: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
        pointer-events: none;
      }
      .style-info-popover strong {
        display: block;
        margin-bottom: 4px;
        color: var(--lavender-deep);
        font-size: 0.72rem;
        text-transform: uppercase;
      }
      .style-info-badge:hover + .style-info-popover,
      .style-info-badge:focus + .style-info-popover {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }
      .lyrical-customizer {
        display: none;
        margin-top: 14px;
        border: 2px solid rgba(123, 62, 230, 0.26);
        border-radius: 20px;
        padding: 16px;
        background: rgba(255,255,255,0.64);
      }
      .lyrical-customizer.visible {
        display: block;
      }
      .lyrical-customizer-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(160px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }
      .lyrical-customizer label {
        display: grid;
        gap: 6px;
        color: var(--ink);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .lyrical-customizer input,
      .lyrical-customizer select {
        min-height: 42px;
        border: 2px solid rgba(5,5,5,0.22);
        border-radius: 14px;
        padding: 0 12px;
        color: var(--ink);
        background: rgba(255,255,255,0.78);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 700;
      }
      .lyrical-preview {
        display: grid;
        place-items: center;
        min-height: 110px;
        margin-top: 14px;
        border-radius: 18px;
        overflow: hidden;
        background:
          radial-gradient(circle at 50% 18%, rgba(216,198,255,0.28), transparent 36%),
          linear-gradient(145deg, rgba(31, 15, 59, 0.94), rgba(8, 5, 16, 0.96));
      }
      .lyrical-preview span {
        max-width: 82%;
        text-align: center;
        text-shadow: 0 4px 18px rgba(0,0,0,0.5);
      }
      @media (max-width: 600px) {
        .style-tile { width: calc(33.333% - 10px); }
        .lyrical-customizer-grid { grid-template-columns: 1fr; }
      }

      /* ── IMAGE GRID CARDS ────────────────────────────────────────── */
      /* ── QUICKGEN STORYBOARD INTELLIGENCE REVIEW ───────────────── */
      .quickgen-storyboard-intelligence {
        display: grid;
        gap: 12px;
        margin: 14px 0;
        border: 1px solid rgba(216,198,255,0.34);
        border-radius: 18px;
        padding: 14px;
        background: rgba(255,255,255,0.09);
      }
      .quickgen-storyboard-intelligence[hidden] {
        display: none;
      }
      .quickgen-storyboard-intelligence strong {
        color: #efe7ff;
        font-size: 0.76rem;
        font-weight: 950;
        letter-spacing: 0.1em;
        text-transform: uppercase;
      }
      .quickgen-storyboard-intelligence p,
      .quickgen-storyboard-intelligence li {
        color: rgba(255,255,255,0.84);
        font-size: 0.74rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .quickgen-storyboard-intelligence ul {
        margin: 0;
        padding-left: 18px;
      }
      .storyboard-title {
        margin: 0;
        color: var(--lavender-deep);
        font-size: clamp(1.35rem, 3vw, 2.45rem);
        font-weight: 800;
        line-height: 1.12;
      }
      .panel-label {
        display: flex;
        align-items: center;
        gap: 9px;
        color: var(--lavender-deep);
        font-size: clamp(0.86rem, 1.65vw, 1.08rem);
        font-weight: 900;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        line-height: 1.2;
      }
      .step-roman {
        display: inline-grid;
        place-items: center;
        min-width: 30px;
        height: 30px;
        border-radius: 999px;
        color: #fff;
        background: var(--lavender-deep);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0;
        flex: 0 0 auto;
      }
      .storyboard-context {
        margin: 10px 0 0;
        color: var(--muted);
        font-size: clamp(0.78rem, 2vw, 1rem);
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .storyboard-input-wrap,
      .voice-input-wrap {
        position: relative;
      }
      .voice-input-wrap textarea,
      .voice-input-wrap input[type="text"] {
        width: 100%;
        padding-right: 82px !important;
      }
      .voice-input-wrap textarea {
        padding-bottom: 78px !important;
      }
      #userStoryboardInput {
        width: 100%;
        min-height: 360px;
        border: 2px solid var(--ink);
        border-radius: 16px;
        padding: 18px 18px 78px;
        color: var(--ink);
        background: rgba(255,255,255,0.66);
        line-height: 1.75;
        resize: vertical;
        white-space: pre-wrap;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.96rem;
        font-weight: 600;
      }
      .storyboard-master-input[hidden] {
        display: none !important;
      }
      .scene-wise-storyboard-panel {
        display: grid;
        gap: 14px;
      }
      .screenplay-import-panel {
        display: grid;
        gap: 12px;
        margin: 12px 0 16px;
        padding: 14px;
        border: 2px solid rgba(123, 62, 230, 0.36);
        border-radius: 14px;
        background: rgba(255,255,255,0.72);
      }
      #sectionUserStoryboard.screenplay-workspace-locked .leyla-panel,
      #sectionUserStoryboard.screenplay-workspace-locked .storyboard-manual-heading,
      #sectionUserStoryboard.screenplay-workspace-locked .scene-wise-storyboard-note,
      #sectionUserStoryboard.screenplay-workspace-locked .screenplay-import-panel,
      #sectionUserStoryboard.screenplay-workspace-locked .scene-wise-storyboard-panel,
      #sectionUserStoryboard.screenplay-workspace-locked .storyboard-timing-panel,
      #sectionUserStoryboard.screenplay-workspace-locked #lockSceneWiseScreenplayButton {
        display: none !important;
      }
      .screenplay-import-grid {
        display: grid;
        grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
        gap: 12px;
        align-items: stretch;
      }
      .screenplay-import-panel input[type="file"] {
        width: 100%;
        border: 1.5px solid rgba(18, 16, 27, 0.18);
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        font-weight: 800;
      }
      #screenplayImportText {
        width: 100%;
        min-height: 128px;
        border: 1.5px solid rgba(18, 16, 27, 0.18);
        border-radius: 12px;
        padding: 13px 13px 62px;
        color: var(--ink);
        background: #fff;
        line-height: 1.55;
        resize: vertical;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.9rem;
        font-weight: 650;
      }
      @media (max-width: 760px) {
        .screenplay-import-grid {
          grid-template-columns: 1fr;
        }
      }
      .scene-wise-storyboard-note {
        margin: -4px 0 10px;
        color: var(--muted);
        font-size: 0.86rem;
        font-weight: 800;
        line-height: 1.55;
      }
      .scene-wise-storyboard-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 14px;
      }
      .scene-wise-storyboard-card {
        border: 2px solid rgba(123, 62, 230, 0.55);
        border-radius: 14px;
        background: rgba(255,255,255,0.72);
        padding: 12px;
        box-shadow: 0 10px 28px rgba(30, 18, 68, 0.08);
      }
      .scene-wise-storyboard-card label {
        display: block;
        margin: 0 0 8px;
        color: var(--ink);
        font-size: 0.82rem;
        font-weight: 950;
        letter-spacing: 0;
        text-transform: uppercase;
      }
      .scene-wise-storyboard-input {
        width: 100%;
        min-height: 148px;
        border: 1.5px solid rgba(18, 16, 27, 0.18);
        border-radius: 12px;
        padding: 13px 13px 62px;
        color: var(--ink);
        background: #fff;
        line-height: 1.55;
        resize: vertical;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.9rem;
        font-weight: 650;
      }
      .storyboard-mic-button,
      .voice-mic-button {
        position: absolute;
        right: 16px;
        bottom: 16px;
        min-width: 54px;
        min-height: 54px;
        border: 2px solid var(--ink);
        border-radius: 50%;
        color: var(--ink);
        background: rgba(255,255,255,0.18);
        backdrop-filter: blur(8px);
        cursor: pointer;
        display: inline-grid;
        place-items: center;
        font-size: 1.2rem;
        font-weight: 800;
        box-shadow: 0 8px 0 rgba(5,5,5,0.16);
      }
      .storyboard-mic-button svg,
      .voice-mic-button svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
      }
      .voice-input-wrap input[type="text"] + .voice-mic-button {
        top: 50%;
        bottom: auto;
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        transform: translateY(-50%);
        font-size: 0.96rem;
      }
      .storyboard-mic-button.is-recording,
      .voice-mic-button.is-recording {
        color: #d83b68;
        background: rgba(255,255,255,0.26);
      }
      .storyboard-mic-button:disabled,
      .voice-mic-button:disabled {
        cursor: not-allowed;
        opacity: 0.58;
      }
      .voice-input-status {
        margin: 7px 0 0;
        min-height: 18px;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--muted);
      }
      .storyboard-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 14px;
      }
      .opening-quickgen-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 14px;
      }
      .opening-quickgen-actions .outline-button {
        max-width: min(100%, 340px);
      }
	      .leyla-panel {
	        position: fixed;
	        left: 18px;
	        bottom: 18px;
	        z-index: 12050;
	        width: min(380px, calc(100vw - 36px));
	        max-height: min(560px, calc(100vh - 36px));
	        margin: 0;
	        border: 2px solid rgba(123,62,230,0.28);
	        border-radius: 18px;
	        background: rgba(255,255,255,0.92);
	        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), 0 8px 0 rgba(5,5,5,0.06);
	        overflow: hidden;
	        backdrop-filter: blur(16px);
	        display: flex;
	        flex-direction: column;
	      }
	      .leyla-panel[hidden] {
	        display: none;
	      }
      .leyla-panel:not([open]) {
        left: 0;
        bottom: 94px;
        width: 34px;
        height: 76px;
        max-height: none;
        border-color: rgba(123,62,230,0.48);
        border-left: 0;
        border-radius: 0 14px 14px 0;
        background: var(--lavender-deep);
        box-shadow: 0 14px 36px rgba(87, 43, 179, 0.26), 0 6px 0 rgba(5,5,5,0.08);
      }
      .leyla-panel:not([open]) summary {
        padding: 0;
        gap: 0;
      }
      .leyla-panel:not([open]) .leyla-summary-copy,
      .leyla-panel:not([open]) .leyla-floating-toggle,
      .leyla-panel:not([open]) .leyla-body {
        display: none;
      }
      .leyla-collapsed-button {
        display: none;
        border: 0;
        border-radius: 0 12px 12px 0;
        background: transparent;
        color: #fff;
        width: 34px;
        height: 76px;
        padding: 0;
        font-size: 0.66rem;
        font-weight: 950;
        letter-spacing: 0.12em;
        cursor: pointer;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
      }
      .leyla-panel:not([open]) .leyla-collapsed-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .leyla-panel:not([open]) .leyla-header-controls {
        display: none;
      }
      .leyla-panel:not([open]) .leyla-collapse-button {
        width: 28px;
        height: 28px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #fff;
        box-shadow: none;
      }
	      .leyla-panel.is-expanded {
	        left: 50%;
	        bottom: 18px;
	        width: min(920px, calc(100vw - 36px));
	        height: min(88dvh, 820px);
	        max-height: calc(100vh - 36px);
	        transform: translateX(-50%);
	      }
	      .leyla-panel summary {
	        list-style: none;
	        cursor: pointer;
	        display: flex;
	        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 14px 16px;
        color: var(--ink);
        font-weight: 900;
      }
      .leyla-panel summary::-webkit-details-marker {
        display: none;
      }
      .leyla-panel summary span {
        color: var(--muted);
	        font-size: 0.76rem;
	        font-weight: 800;
	        letter-spacing: 0.06em;
	        text-transform: uppercase;
	      }
	      .leyla-summary-copy {
	        display: grid;
	        gap: 2px;
	        min-width: 0;
	      }
	      .leyla-floating-toggle {
	        flex: 0 0 auto;
	        width: 34px;
	        height: 34px;
	        border: 1.5px solid rgba(123,62,230,0.34);
	        border-radius: 10px;
	        background: rgba(255,255,255,0.78);
	        color: var(--lavender-deep);
	        font-size: 1rem;
	        font-weight: 900;
	        line-height: 1;
	        cursor: pointer;
	      }
      .leyla-collapse-button {
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 10px;
        background: rgba(255,255,255,0.78);
        color: var(--ink);
        font-size: 1.2rem;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
      }
      .leyla-header-controls {
        display: flex;
        align-items: center;
        gap: 8px;
      }
	      .leyla-body {
	        border-top: 1.5px solid rgba(5,5,5,0.12);
	        padding: 14px;
	        overflow: hidden;
	        display: flex;
	        min-height: 0;
	        flex: 1;
	        flex-direction: column;
	      }
      .leyla-panel.is-expanded .leyla-body {
        display: grid;
        grid-template-rows: auto minmax(180px, 1fr) auto auto;
        overflow: hidden;
      }
      .leyla-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, auto));
        gap: 8px;
        margin-bottom: 12px;
        justify-content: start;
      }
      .leyla-chip {
        border: 1.5px solid rgba(123,62,230,0.34);
        border-radius: 999px;
        background: rgba(255,255,255,0.62);
        color: var(--lavender-deep);
        padding: 8px 11px;
        font-size: 0.72rem;
        font-weight: 900;
        cursor: pointer;
        text-transform: uppercase;
      }
      .leyla-chip[data-leyla-action="cinema"],
      .leyla-chip[data-leyla-action="opening"] {
        min-width: 0;
        padding-inline: 9px;
        font-size: 0.66rem;
        white-space: normal;
        line-height: 1.2;
      }
      .leyla-panel.is-expanded .leyla-actions {
        display: flex;
        flex-wrap: wrap;
      }
      .leyla-panel.is-expanded .leyla-chip[data-leyla-action="cinema"],
      .leyla-panel.is-expanded .leyla-chip[data-leyla-action="opening"] {
        font-size: 0.72rem;
        white-space: nowrap;
        line-height: 1.2;
      }
	      .leyla-chat-log {
	        display: grid;
	        gap: 10px;
	        max-height: 240px;
	        overflow: auto;
	        padding-right: 4px;
	      }
	      .leyla-panel.is-expanded .leyla-chat-log {
	        max-height: none;
	        min-height: 180px;
	        flex: 1;
	        align-content: start;
	        overscroll-behavior: contain;
	      }
      .leyla-message {
        position: relative;
        border-radius: 14px;
        padding: 11px 12px;
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 1.65;
        white-space: pre-wrap;
      }
      .leyla-message.user {
        justify-self: end;
        max-width: 88%;
        color: #fff;
        background: linear-gradient(135deg, #5b21b6, #7c3aed);
        border: 1.5px solid rgba(255,255,255,0.2);
      }
      .leyla-message.assistant {
        justify-self: start;
        max-width: 94%;
        color: #12352b;
        background: linear-gradient(135deg, rgba(232, 255, 244, 0.94), rgba(255, 249, 224, 0.92));
        border: 1.5px solid rgba(24, 116, 91, 0.24);
      }
      .leyla-message.assistant {
        padding-right: 44px;
      }
      .leyla-copy-button {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 26px;
        height: 26px;
        border: 1.5px solid rgba(24, 116, 91, 0.22);
        border-radius: 8px;
        background: rgba(255,255,255,0.68);
        color: #18745b;
        cursor: pointer;
        display: inline-grid;
        place-items: center;
        box-shadow: 0 5px 12px rgba(18, 53, 43, 0.1);
      }
      .leyla-copy-button::before,
      .leyla-copy-button::after {
        content: "";
        position: absolute;
        width: 9px;
        height: 11px;
        border: 1.6px solid currentColor;
        border-radius: 2px;
        background: transparent;
      }
      .leyla-copy-button::before {
        transform: translate(2px, -2px);
        opacity: 0.62;
      }
      .leyla-copy-button::after {
        transform: translate(-2px, 2px);
        background: rgba(255,255,255,0.72);
      }
      .leyla-copy-button:hover,
      .leyla-copy-button:focus {
        outline: 2px solid rgba(24, 116, 91, 0.22);
        outline-offset: 2px;
        background: #fff;
      }
      .leyla-copy-button.is-copied {
        color: var(--lavender-deep);
        border-color: rgba(123,62,230,0.32);
      }
      .leyla-compose {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        margin-top: 12px;
      }
      .leyla-panel:not(.is-expanded) .leyla-body {
        overflow: auto;
      }
      .leyla-panel:not(.is-expanded) .leyla-chat-log {
        max-height: 128px;
      }
      .leyla-panel:not(.is-expanded) .leyla-compose {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      .leyla-compose textarea {
        min-height: 58px;
        max-height: 120px;
        border: 1.5px solid rgba(5,5,5,0.2);
        border-radius: 14px;
        padding: 12px;
        background: rgba(255,255,255,0.62);
        color: var(--ink);
        resize: vertical;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 1.5;
      }
      .leyla-compose .voice-input-wrap {
        min-width: 0;
      }
      .leyla-compose .voice-input-wrap textarea {
        padding-right: 62px !important;
        padding-bottom: 12px !important;
      }
      .leyla-compose .voice-mic-button {
        right: 10px;
        bottom: 10px;
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        box-shadow: 0 5px 0 rgba(5,5,5,0.14);
      }
      .leyla-panel:not(.is-expanded) .leyla-compose textarea {
        min-height: 72px;
        max-height: 88px;
      }
      .leyla-panel:not(.is-expanded) .leyla-compose #leylaSendButton {
        width: 100%;
        min-height: 36px;
      }
      .leyla-panel.is-expanded .leyla-compose {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        margin-top: 14px;
      }
      .leyla-panel.is-expanded .leyla-compose textarea {
        min-height: clamp(96px, 14dvh, 150px);
        max-height: clamp(140px, 20dvh, 210px);
      }
      .leyla-panel.is-expanded .leyla-compose #leylaSendButton {
        align-self: end;
        min-height: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
	      .leyla-footer {
	        margin-top: 10px;
	        display: flex;
	        align-items: center;
	        gap: 10px;
	        flex-wrap: wrap;
	      }
      .leyla-footer .save-status:empty {
        display: none;
      }
      .leyla-footer:has(#leylaApplyButton[hidden] + .save-status:empty) {
        display: none;
      }
	      @media (max-width: 760px) {
	        .leyla-panel,
	        .leyla-panel.is-expanded {
	          left: 12px;
	          right: 12px;
	          bottom: 12px;
	          width: auto;
	          max-height: min(82dvh, 620px);
            transform: none;
	        }
        .leyla-panel {
          height: auto;
        }
        .leyla-panel.is-expanded {
          height: min(82dvh, 620px);
        }
          .leyla-panel:not([open]) {
            left: 0;
            right: auto;
            bottom: 86px;
            width: 34px;
            height: 70px;
          }
          .leyla-panel:not([open]) .leyla-collapsed-button {
            height: 70px;
          }
	        .leyla-panel.is-expanded .leyla-chat-log {
	          max-height: none;
	          min-height: 140px;
	        }
	        .leyla-compose {
	          grid-template-columns: 1fr;
	        }
	      }
      .storyboard-output {
        margin-top: 22px;
        display: grid;
        gap: 14px;
      }
      .storyboard-screenplay-panel {
        border: 2px solid rgba(123,62,230,0.32);
        border-radius: 18px;
        padding: 16px;
        background: rgba(255,255,255,0.68);
        box-shadow: 0 8px 0 rgba(5,5,5,0.06);
      }
      .storyboard-screenplay-panel h3 {
        margin: 0 0 10px;
        color: var(--lavender-deep);
        font-size: clamp(1rem, 2vw, 1.22rem);
        font-weight: 900;
      }
      .storyboard-screenplay-panel p {
        margin: 0;
        color: var(--ink);
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.7;
        white-space: pre-wrap;
      }
      .storyboard-review-frame {
        width: min(100%, 980px);
        margin: 0 auto;
        border: 2px solid rgba(5,5,5,0.18);
        border-radius: 22px;
        background: rgba(255,255,255,0.78);
        box-shadow: 0 16px 0 rgba(5,5,5,0.08);
        padding: clamp(18px, 3vw, 34px);
      }
      .storyboard-review-title {
        margin: 0;
        color: var(--lavender-deep);
        font-size: clamp(1.35rem, 3vw, 2.55rem);
        font-weight: 900;
        line-height: 1.12;
      }
      .storyboard-review-meta {
        margin: 10px 0 0;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .storyboard-review-body {
        margin-top: 22px;
        color: var(--ink);
        font-size: clamp(0.95rem, 1.4vw, 1.08rem);
        font-weight: 600;
        line-height: 1.85;
        white-space: pre-wrap;
      }
      .storyboard-review-body p {
        margin: 0 0 18px;
      }
      .storyboard-review-body p:last-child {
        margin-bottom: 0;
      }
      .storyboard-scene-list {
        margin-top: 26px;
        padding-top: 20px;
        border-top: 1px solid rgba(5,5,5,0.16);
        white-space: normal;
      }
      .storyboard-scene-list h3 {
        margin: 0 0 14px;
        color: var(--lavender-deep);
        font-size: 1rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .storyboard-scene-list article {
        padding: 12px 0;
        border-bottom: 1px solid rgba(5,5,5,0.1);
      }
      .storyboard-scene-list article:last-child {
        border-bottom: 0;
      }
      .storyboard-scene-list strong {
        display: block;
        color: var(--ink);
        font-size: 0.86rem;
        font-weight: 900;
      }
      .storyboard-scene-list p {
        margin: 4px 0 0;
        line-height: 1.55;
      }
      .storyboard-review-actions {
        margin-top: 24px;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
      }
      .storyboard-scene-summary {
        border: 1.5px solid rgba(123,62,230,0.28);
        border-radius: 14px;
        padding: 12px 14px;
        color: var(--lavender-deep);
        background: rgba(255,255,255,0.58);
        font-size: 0.88rem;
        font-weight: 800;
        text-align: center;
      }
      .storyboard-clip-card {
        border: 2px solid var(--ink);
        border-radius: 18px;
        background: rgba(255,255,255,0.62);
        padding: 16px;
        box-shadow: 0 10px 0 rgba(5,5,5,0.08);
      }
      .storyboard-clip-card h3 {
        margin: 0 0 12px;
        color: var(--lavender-deep);
        font-size: clamp(1rem, 2vw, 1.2rem);
        font-weight: 800;
      }
      .storyboard-scene-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }
      .storyboard-scene-head h3 {
        margin: 0;
      }
      .storyboard-scene-text {
        width: 100%;
        min-height: 74px;
        max-height: 96px;
        border: 1.5px solid rgba(5,5,5,0.18);
        border-radius: 14px;
        padding: 14px;
        background: rgba(255,255,255,0.58);
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.7;
        overflow: auto;
        resize: vertical;
      }
      .storyboard-scene-save {
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
      }
      .scene-save-status {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
      }
      .storyboard-prompt-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }
      .storyboard-prompt-box {
        border: 1.5px solid rgba(5,5,5,0.18);
        border-radius: 14px;
        padding: 12px;
        background: rgba(255,255,255,0.52);
      }
      .storyboard-prompt-box strong {
        display: block;
        margin-bottom: 8px;
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .storyboard-prompt-box p {
        margin: 0;
        color: var(--ink);
        font-size: 0.84rem;
        font-weight: 600;
        line-height: 1.65;
        white-space: pre-wrap;
      }
      .storyboard-build-panel {
        display: none;
        margin-top: 18px;
        border: 2px solid var(--ink);
        border-radius: 20px;
        background: rgba(255,255,255,0.64);
        padding: 18px;
      }
      .storyboard-build-panel.visible {
        display: block;
      }
      .opening-journey {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin: 18px 0;
      }
      .opening-journey-step {
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 14px;
        background: rgba(255,255,255,0.52);
        padding: 11px;
        opacity: 0.58;
      }
      .opening-journey-step.is-active,
      .opening-journey-step.is-done {
        opacity: 1;
        border-color: rgba(123,62,230,0.44);
        background: rgba(255,255,255,0.76);
      }
      .opening-journey-step.is-active {
        box-shadow: 0 6px 0 rgba(123,62,230,0.14);
      }
      .opening-journey-step strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1.25;
      }
      .opening-journey-step span {
        display: block;
        margin-top: 4px;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .opening-step-card {
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        padding: 14px;
        background: rgba(255,255,255,0.56);
      }
      .opening-step-card.is-active {
        border-color: rgba(123,62,230,0.4);
        background: rgba(255,255,255,0.74);
      }
      .opening-step-card.is-muted {
        opacity: 0.62;
      }
      .opening-step-card > .save-status:first-child {
        margin: 0 0 10px;
        font-size: 0.72rem;
        font-weight: 900;
        color: var(--lavender-deep);
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .storyboard-stage-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        margin-top: 14px;
      }
      .storyboard-stage-box {
        min-height: 240px;
        border: 2px dashed rgba(5,5,5,0.22);
        border-radius: 18px;
        background: rgba(250,248,255,0.72);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
      }
      .storyboard-stage-box img,
      .storyboard-stage-box video {
        width: 100%;
        height: 100%;
        min-height: 240px;
        object-fit: cover;
        display: block;
      }
      .storyboard-stage-placeholder {
        padding: 20px;
        color: var(--muted);
        font-size: 0.86rem;
        font-weight: 700;
        text-align: center;
      }
      .storyboard-stage-note {
        margin: 10px 0 0;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.5;
      }
      .clip-decision-box {
        margin-top: 18px;
        border: 2px solid rgba(123, 62, 230, 0.35);
        border-radius: 18px;
        background: rgba(255,255,255,0.74);
        padding: 16px;
      }
      .clip-decision-box[hidden] {
        display: none;
      }
      .clip-decision-box h3 {
        margin: 0 0 8px;
        color: var(--lavender-deep);
        font-size: 1.05rem;
        font-weight: 800;
      }
      .clip-decision-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 12px;
      }
      .clip-edit-request {
        width: 100%;
        min-height: 92px;
        margin-top: 12px;
        border: 2px solid var(--ink);
        border-radius: 14px;
        background: rgba(255,255,255,0.76);
        padding: 12px;
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.6;
        resize: vertical;
      }
      .timeline-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        align-items: start;
      }
      .timeline-shell.is-lazy-resume {
        grid-template-columns: minmax(0, 1fr) !important;
      }
      .timeline-shell.is-lazy-resume .timeline-prompt-card {
        display: none !important;
      }
      .timeline-shell.is-lazy-resume .timeline-preview-card {
        grid-column: 1 / -1 !important;
      }
      .timeline-shell.is-lazy-resume .timeline-flow-card {
        border-color: rgba(123, 62, 230, 0.26);
        border-left: 7px solid var(--lavender-deep);
        background: #fffefa;
        box-shadow: 0 14px 32px rgba(36, 29, 52, 0.08);
      }
      .timeline-shell.is-lazy-resume .timeline-flow-card h2 {
        font-size: clamp(1.52rem, 2.4vw, 2.2rem);
        line-height: 1.03;
      }
      .timeline-shell.is-lazy-resume .timeline-flow-card p:not(.panel-label) {
        max-width: 680px;
        color: rgba(30, 24, 42, 0.72);
      }
      .timeline-shell.is-lazy-resume .timeline-guide-progress {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
      }
      .timeline-shell.is-lazy-resume .timeline-guide-step {
        min-height: 60px;
        background: #ffffff;
      }
      .timeline-shell.is-lazy-resume .timeline-guide-step::before {
        display: none;
      }
      .timeline-shell.is-lazy-resume .timeline-scene-map-card {
        order: 1;
      }
      .timeline-shell.is-lazy-resume .timeline-preview-card {
        order: 2;
        padding-top: 10px;
      }
      .timeline-shell.is-lazy-resume .timeline-preview-card > .timeline-section-header,
      .timeline-shell.is-lazy-resume .timeline-preview,
      .timeline-shell.is-lazy-resume #audioTimelineTrack,
      .timeline-shell.is-lazy-resume .timeline-analysis-row,
      .timeline-shell.is-lazy-resume .timeline-analysis-track,
      .timeline-shell.is-lazy-resume .timeline-analysis-detail,
      .timeline-shell.is-lazy-resume .timeline-production-toolkit {
        display: none !important;
      }
      .timeline-shell.is-lazy-resume .timeline-tracks-inline > .timeline-section-header {
        margin-bottom: 6px;
      }
      .timeline-shell.is-lazy-resume .timeline-tracks-inline > .timeline-section-header .panel-label {
        font-size: 0.72rem;
      }
      .timeline-shell.is-lazy-resume .timeline-track-label {
        margin: 5px 0;
        font-size: 0.58rem;
      }
      .timeline-shell.is-lazy-resume .timeline-workspace {
        max-height: 250px;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .timeline-shell.is-lazy-resume #copySelectedSceneButton,
      .timeline-shell.is-lazy-resume #rangeSelectScenesButton,
      .timeline-shell.is-lazy-resume #saveTimelineEditsButton,
      .timeline-shell.is-lazy-resume #repairDuoTimelineButton,
      .timeline-shell.is-lazy-resume #deleteSelectedScenesButton,
      .timeline-shell.is-lazy-resume #deleteTimelineClipButton,
      .timeline-shell.is-lazy-resume #undoTimelineEditButton,
      .timeline-shell.is-lazy-resume .timeline-zoom-group {
        display: none !important;
      }
      .timeline-shell.is-lazy-resume #openVideoVaultToolbarButton {
        display: none !important;
      }
      .timeline-left-stack,
      .timeline-right-stack {
        display: contents;
      }
      .timeline-section-card {
        border: 1px solid rgba(5,5,5,0.12);
        border-radius: 16px;
        background: rgba(255,255,255,0.62);
        box-shadow: 0 12px 28px rgba(16,12,34,0.08);
        padding: 12px;
        min-width: 0;
      }
      .timeline-flow-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
        gap: 16px;
        align-items: center;
        width: 100%;
        border: 2px solid rgba(123, 62, 230, 0.2);
        border-radius: 18px;
        padding: 16px;
        background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(247,243,255,0.94));
        box-shadow: 0 18px 42px rgba(16,12,34,0.1);
        order: 0;
      }
      .timeline-flow-card h2 {
        margin: 4px 0 6px;
        color: var(--ink);
        font-size: clamp(1.28rem, 2vw, 1.85rem);
        line-height: 1.05;
      }
      .timeline-flow-card p:not(.panel-label) {
        margin: 0;
        color: var(--muted);
        font-weight: 700;
        line-height: 1.42;
        font-size: 0.9rem;
        max-width: 760px;
      }
      .timeline-guide-progress {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-top: 12px;
      }
      .timeline-guide-step {
        position: relative;
        display: grid;
        gap: 4px;
        min-height: 52px;
        border: 1px solid rgba(5, 5, 5, 0.1);
        border-radius: 13px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.68);
        color: var(--muted);
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-guide-step::before {
        content: attr(data-step);
        display: inline-grid;
        place-items: center;
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: rgba(24, 18, 36, 0.08);
        color: var(--ink);
        font-size: 0.64rem;
      }
      .timeline-guide-step strong {
        color: var(--ink);
        font-size: 0.68rem;
        line-height: 1.1;
      }
      .timeline-guide-step[data-state="done"] {
        border-color: rgba(39, 174, 96, 0.36);
        background: rgba(232, 255, 240, 0.76);
      }
      .timeline-guide-step[data-state="done"]::before {
        content: "✓";
        background: #24a561;
        color: #fff;
      }
      .timeline-guide-step[data-state="active"] {
        border-color: rgba(123, 62, 230, 0.42);
        background: rgba(245, 240, 255, 0.92);
        box-shadow: 0 8px 22px rgba(123, 62, 230, 0.12);
      }
      .timeline-guide-step[data-state="active"]::before {
        background: var(--lavender-deep);
        color: #fff;
      }
      .timeline-flow-actions {
        display: grid;
        gap: 10px;
        justify-content: stretch;
        align-items: stretch;
      }
      .timeline-flow-actions .primary-button,
      .timeline-flow-actions .outline-button {
        width: 100%;
        min-height: 42px;
        border: 2px solid #7b3ee6;
        padding: 8px 14px;
        font-size: 0.78rem;
        white-space: nowrap;
      }
      .timeline-flow-actions .outline-button[data-secondary="true"] {
        opacity: 0.72;
      }
      .timeline-flow-actions #timelineUpdateFullTimelineButton {
        border-color: #1f2937;
        color: #1f2937;
        background: #ffffff;
      }
      .timeline-flow-actions .outline-button[hidden] {
        display: none;
      }
      .timeline-add-scene-button {
        display: none !important;
      }
      .timeline-final-video-card {
        display: none;
        gap: 12px;
        margin-top: 12px;
        border: 1px solid rgba(22, 184, 135, 0.34);
        border-radius: 16px;
        padding: 14px;
        background: linear-gradient(135deg, rgba(235, 255, 247, 0.94), rgba(255, 255, 255, 0.88));
        box-shadow: 0 14px 34px rgba(16, 12, 34, 0.08);
      }
      .timeline-final-video-card.is-visible {
        display: grid;
      }
      .timeline-final-video-card h3,
      .timeline-final-video-card p {
        margin: 0;
      }
      .timeline-final-video-card h3 {
        color: var(--ink);
        font-size: 1rem;
        line-height: 1.15;
      }
      .timeline-final-video-card p {
        color: var(--muted);
        font-size: 0.8rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .timeline-final-video-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .timeline-final-video-actions a,
      .timeline-final-video-actions button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        min-height: 34px;
        border: 2px solid var(--ink);
        border-radius: 999px;
        padding: 0 14px;
        color: var(--ink);
        background: rgba(255, 255, 255, 0.86);
        font: 900 0.66rem/1 Poppins, Arial, sans-serif;
        text-decoration: none;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-final-video-actions a:first-child {
        color: #fff;
        border-color: var(--lavender-deep);
        background: var(--lavender-deep);
      }
      .timeline-publish-checklist {
        display: none;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
      }
      .timeline-publish-check {
        display: grid;
        gap: 3px;
        min-height: 54px;
        border: 1px solid rgba(5, 5, 5, 0.1);
        border-radius: 12px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.66);
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        text-transform: uppercase;
      }
      .timeline-publish-check strong {
        color: var(--ink);
        font-size: 0.72rem;
      }
      .timeline-publish-check[data-state="done"] {
        border-color: rgba(39, 174, 96, 0.4);
        background: rgba(232, 255, 240, 0.72);
      }
      .timeline-publish-check[data-state="active"] {
        border-color: rgba(123, 62, 230, 0.38);
        background: rgba(245, 240, 255, 0.84);
      }
      .timeline-advanced-tools {
        border: 1px solid rgba(5, 5, 5, 0.1);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.54);
        padding: 0;
      }
      .timeline-advanced-tools > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 42px;
        padding: 0 12px;
        color: var(--ink);
        cursor: pointer;
        font-size: 0.78rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .timeline-advanced-tools > summary::after {
        content: "+";
        color: var(--lavender-deep);
        font-size: 1.05rem;
      }
      .timeline-advanced-tools[open] > summary::after {
        content: "-";
      }
      .timeline-advanced-tools-body {
        display: grid;
        gap: 10px;
        padding: 0 12px 12px;
      }
      .timeline-shell.is-publish-ready .timeline-prompt-card {
        display: none;
      }
      .prepublish-panel {
        display: none !important;
        gap: 14px;
      }
      .prepublish-journey-card {
        display: grid;
        gap: 18px;
      }
      .prepublish-gate-card {
        border: 2px dashed rgba(5, 5, 5, 0.26);
        border-radius: 18px;
        padding: 18px;
        background: rgba(255, 255, 255, 0.68);
        font-weight: 800;
        color: var(--muted);
      }
      .workflow-step[role="button"] {
        cursor: pointer;
      }
      .workflow-step[aria-disabled="true"] {
        cursor: not-allowed;
      }
      .videogen-step-back-row {
        display: flex;
        justify-content: flex-start;
        margin: -6px 0 12px;
      }
      .videogen-step-back-button {
        width: fit-content;
        min-height: 30px;
        padding: 0 14px;
        font-size: 0.66rem;
        line-height: 1;
      }
      .prepublish-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
      }
      .prepublish-intro-card {
        display: grid;
        gap: 8px;
        min-width: 0;
        border: 2px solid rgba(5, 5, 5, 0.14);
        border-radius: 14px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--ink);
        text-align: left;
        cursor: pointer;
      }
      .prepublish-intro-card.is-selected {
        border-color: var(--lavender-deep);
        box-shadow: 0 0 0 4px rgba(123, 62, 230, 0.14);
      }
      .prepublish-intro-card video {
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 10px;
        background: #050505;
        object-fit: cover;
      }
      .prepublish-no-intro {
        display: grid;
        place-items: center;
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 10px;
        border: 1px dashed rgba(5, 5, 5, 0.22);
        background: rgba(5, 5, 5, 0.04);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 900;
        text-align: center;
        text-transform: uppercase;
      }
      .prepublish-intro-card strong {
        font-size: 0.72rem;
        line-height: 1.2;
        text-transform: uppercase;
      }
      .prepublish-thumbnail-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: end;
      }
      .prepublish-thumbnail-row textarea {
        min-height: 92px;
        border: 2px solid var(--ink);
        border-radius: 14px;
        padding: 12px;
        font: inherit;
        font-weight: 700;
        resize: vertical;
      }
      .prepublish-thumbnail-preview {
        display: grid;
        place-items: center;
        min-height: 160px;
        border: 2px dashed rgba(5, 5, 5, 0.18);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.54);
        overflow: hidden;
        color: var(--muted);
        font-weight: 800;
        text-align: center;
      }
      .prepublish-thumbnail-preview img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
      }
      .prepublish-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
      }
      .prepublish-cut-panel {
        display: grid;
        gap: 12px;
        padding: 12px;
        border: 2px solid rgba(5, 5, 5, 0.1);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.58);
      }
      .prepublish-cut-controls {
        display: grid;
        grid-template-columns: minmax(130px, 0.8fr) repeat(2, minmax(96px, 0.5fr)) auto;
        gap: 10px;
        align-items: end;
      }
      .prepublish-cut-controls label {
        display: grid;
        gap: 5px;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .prepublish-cut-controls select,
      .prepublish-cut-controls input {
        width: 100%;
        min-height: 36px;
        border: 2px solid var(--line);
        border-radius: 999px;
        padding: 0 12px;
        background: var(--white);
        color: var(--ink);
        font-weight: 850;
      }
      .prepublish-cut-list {
        display: grid;
        gap: 8px;
      }
      .prepublish-cut-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
        align-items: center;
        padding: 8px 10px;
        border: 1px solid rgba(5, 5, 5, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.72);
        font-size: 0.76rem;
        font-weight: 850;
      }
      .prepublish-cut-item a {
        color: var(--lavender-deep);
        text-decoration: none;
        text-transform: uppercase;
      }
      .prepublish-submit-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        justify-content: flex-end;
        padding-top: 4px;
      }
      .prepublish-package-preview {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
      }
      .prepublish-package-item {
        display: grid;
        gap: 5px;
        border: 1px solid rgba(5, 5, 5, 0.12);
        border-radius: 14px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.72);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .prepublish-package-item span {
        color: var(--muted);
        font-size: 0.66rem;
      }
      .timeline-mobile-action-bar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 80;
        display: none;
        gap: 8px;
        align-items: center;
        border: 2px solid rgba(5, 5, 5, 0.16);
        border-radius: 18px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 18px 48px rgba(16, 12, 34, 0.18);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
      }
      .timeline-mobile-action-bar strong {
        min-width: 0;
        flex: 1;
        color: var(--ink);
        font-size: 0.78rem;
        line-height: 1.2;
      }
      .timeline-mobile-action-bar button {
        min-height: 42px;
        border: 0;
        border-radius: 999px;
        padding: 0 15px;
        color: #fff;
        background: var(--lavender-deep);
        font: 900 0.72rem/1 Poppins, Arial, sans-serif;
        text-transform: uppercase;
      }
      @media (max-width: 760px) {
        .timeline-flow-card {
          grid-template-columns: 1fr;
        }
        .timeline-guide-progress {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .prepublish-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .prepublish-thumbnail-row {
          grid-template-columns: 1fr;
        }
        .prepublish-cut-controls,
        .prepublish-cut-item {
          grid-template-columns: 1fr;
        }
        .prepublish-submit-row {
          justify-content: stretch;
        }
        .prepublish-submit-row button {
          width: 100%;
        }
        .prepublish-package-preview {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .timeline-publish-checklist {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }
      @media (max-width: 420px) {
        .timeline-guide-progress {
          grid-template-columns: 1fr;
        }
        .prepublish-grid {
          grid-template-columns: 1fr;
        }
        .timeline-publish-checklist {
          grid-template-columns: 1fr;
        }
        body:has(#sectionTimelineEditor.visible) .timeline-mobile-action-bar,
        body:has(#sectionPrePublishing.visible) .timeline-mobile-action-bar {
          display: flex;
        }
      }
      .timeline-start-frame-help {
        margin: 0;
        color: var(--muted);
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1.45;
      }
      .timeline-preview-card {
        display: flex;
        flex-direction: column;
        width: 100%;
        justify-self: stretch;
        order: 1;
      }
      .timeline-tracks-card {
        order: 2;
      }
      .timeline-prompt-card {
        order: 3;
        width: 100%;
        justify-self: stretch;
      }
      #timelineStatus {
        order: 4;
      }
      .timeline-command-panel {
        order: 7;
      }
      .timeline-section-header {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
      }
      .timeline-section-header .panel-label,
      .timeline-section-header .timeline-track-label {
        margin: 0;
      }
      .timeline-info {
        position: relative;
        flex: 0 0 auto;
        display: inline-grid;
        place-items: center;
        width: 24px;
        height: 24px;
        border: 1px solid rgba(123, 62, 230, 0.28);
        border-radius: 50%;
        background: #fff;
        color: var(--lavender-deep);
        font-size: 0.72rem;
        font-weight: 900;
        cursor: help;
        box-shadow: 0 6px 14px rgba(16,12,34,0.08);
      }
      .timeline-info::after {
        content: attr(data-info);
        position: absolute;
        right: 0;
        top: calc(100% + 9px);
        width: min(270px, 76vw);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 12px;
        background: rgba(8,6,18,0.94);
        color: #fff;
        padding: 10px 12px;
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1.45;
        text-transform: none;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-4px);
        transition: opacity 0.16s ease, transform 0.16s ease;
        z-index: 50;
      }
      .timeline-info:hover::after,
      .timeline-info:focus-visible::after {
        opacity: 1;
        transform: translateY(0);
      }
      .timeline-preview {
        order: 1;
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: clamp(260px, 46vw, 540px);
        border: 2px solid var(--ink);
        border-radius: 18px;
        background: rgba(8, 6, 18, 0.78);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255,255,255,0.72);
        font-weight: 700;
        text-align: center;
      }
      .timeline-preview video {
        width: 100%;
        height: 100%;
        min-height: clamp(260px, 46vw, 540px);
        object-fit: contain;
        display: block;
      }
      .timeline-preview-message {
        padding: 22px;
        color: rgba(255,255,255,0.78);
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1.6;
      }
      .timeline-tools-inline {
        order: 2;
        margin-top: -1px;
        padding: 5px 6px;
        border: 1px solid rgba(5,5,5,0.09);
        border-radius: 0 0 12px 12px;
        background: rgba(255,255,255,0.68);
        box-shadow: 0 5px 14px rgba(16,12,34,0.05);
      }
      .timeline-tools-inline .timeline-section-header {
        margin-bottom: 4px;
      }
      .timeline-tools-inline .panel-label {
        font-size: 0.62rem;
      }
      .timeline-tools-inline .timeline-edit-toolbar {
        margin-top: 10px;
      }
      .timeline-workspace {
        overflow-x: auto;
        border: 1px solid rgba(16, 12, 34, 0.16);
        border-radius: 14px;
        background:
          linear-gradient(180deg, rgba(250,251,255,0.98), rgba(239,242,249,0.88)),
          repeating-linear-gradient(90deg, rgba(20,24,40,0.06) 0 1px, transparent 1px 20px);
        padding: 12px;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 12px 32px rgba(16,12,34,0.08);
      }
      .timeline-tracks-inline {
        order: 3;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(5,5,5,0.1);
      }
      .timeline-tracks-inline .timeline-section-header {
        margin-bottom: 6px;
      }
      .timeline-tracks-inline .timeline-workspace {
        padding: 8px;
        border-radius: 12px;
      }
      #timelineStatus,
      #timelineLastSaveStatus {
        order: 4;
      }
      .timeline-ruler {
        position: relative;
        height: 28px;
        margin-bottom: 6px;
        border-bottom: 1.5px solid rgba(5,5,5,0.16);
        color: var(--muted);
        font-size: 0.6rem;
        font-weight: 800;
      }
      .timeline-ruler-tick {
        position: absolute;
        bottom: 0;
        width: 1px;
        height: 11px;
        background: rgba(5,5,5,0.24);
      }
      .timeline-ruler-tick.is-major {
        height: 16px;
        background: rgba(5,5,5,0.5);
      }
      .timeline-ruler-label {
        position: absolute;
        bottom: 16px;
        transform: translateX(-50%);
        color: var(--lavender-deep);
        font-size: 0.58rem;
        font-weight: 900;
        white-space: nowrap;
      }
      .timeline-dropzone {
        position: relative;
        min-height: 52px;
        margin-bottom: 7px;
        border: 1px solid rgba(16, 20, 36, 0.14);
        border-radius: 10px;
        background:
          linear-gradient(90deg, rgba(16,20,36,0.055) 1px, transparent 1px) 12px 0 / 20px 100%,
          linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,248,252,0.86));
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.82);
      }
      #videoTimelineTrack.timeline-dropzone {
        min-height: 88px;
      }
      .timeline-zoom-group {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px;
        border: 1px solid rgba(55,31,114,0.12);
        border-radius: 999px;
        background: rgba(255,255,255,0.82);
      }
      .timeline-loop-toolbar .timeline-zoom-group button {
        width: 30px;
        min-width: 30px;
        height: 30px;
        padding: 0;
        display: inline-grid;
        place-items: center;
        border-radius: 50%;
        font-size: 0.95rem;
      }
      .timeline-zoom-value {
        min-width: 46px;
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 950;
        text-align: center;
      }
      #audioTimelineTrack.timeline-dropzone {
        min-height: 24px;
        margin-bottom: 8px;
        border-radius: 999px;
        border-color: rgba(114, 80, 11, 0.13);
        background:
          linear-gradient(90deg, rgba(114,80,11,0.08) 1px, transparent 1px) 10px 0 / 18px 100%,
          linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,248,226,0.74));
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 6px 16px rgba(114,80,11,0.06);
      }
      .song-timeline-editor {
        display: grid;
        gap: 8px;
        margin: 0 0 10px;
        padding: 10px;
        border: 1px solid rgba(55,31,114,0.14);
        border-radius: 8px;
        background: rgba(255,255,255,0.86);
      }
      .song-timeline-editor-head,
      .song-timeline-input-row,
      .song-timeline-slider-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .song-timeline-editor-head {
        justify-content: space-between;
        color: var(--lavender-deep);
        font-size: 0.72rem;
      }
      .song-timeline-editor label {
        display: grid;
        gap: 3px;
        min-width: 150px;
        color: var(--muted);
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .song-timeline-editor input[type="range"] {
        width: min(280px, 42vw);
      }
      .song-audio-collapsible {
        margin: 6px 0 10px;
        border: 1px solid rgba(55,31,114,0.12);
        border-radius: 10px;
        background: rgba(255,255,255,0.72);
      }
      .song-audio-collapsible summary {
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 11px;
        cursor: pointer;
        list-style: none;
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .song-audio-collapsible summary::-webkit-details-marker {
        display: none;
      }
      .song-audio-collapsible summary::after {
        content: "+";
        width: 22px;
        height: 22px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(55,31,114,0.1);
        color: var(--lavender-deep);
        font-size: 0.9rem;
        line-height: 1;
      }
      .song-audio-collapsible[open] summary::after {
        content: "-";
      }
      .song-audio-collapsible-body {
        padding: 0 10px 10px;
      }
      .song-timeline-editor input[type="number"] {
        min-height: 30px;
        border: 1px solid rgba(16,20,36,0.14);
        border-radius: 7px;
        padding: 5px 8px;
        font: inherit;
      }
      .song-timeline-editor button {
        min-height: 32px;
        border: 1px solid rgba(55,31,114,0.18);
        border-radius: 999px;
        padding: 6px 10px;
        background: #fff;
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 900;
        cursor: pointer;
      }
      .song-timeline-editor button.primary {
        background: linear-gradient(135deg, #371f72 0%, #d91f55 100%);
        color: #fff;
        border-color: transparent;
      }
      .song-timeline-status {
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 800;
      }
      #songTrimPreviewAudio {
        width: 100%;
        min-height: 36px;
      }
      .timeline-analysis-track {
        position: relative;
        min-height: 24px;
        margin-bottom: 8px;
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 12px;
        background:
          linear-gradient(90deg, rgba(5,5,5,0.045) 1px, transparent 1px) 12px 0 / 20px 100%,
          rgba(255,255,255,0.62);
        overflow: hidden;
      }
      .timeline-analysis-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 6px;
      }
      .timeline-analysis-row .timeline-track-label {
        margin: 0;
      }
      .timeline-analysis-toggle {
        min-height: 22px;
        border: 1px solid rgba(5,5,5,0.16);
        border-radius: 999px;
        padding: 3px 8px;
        color: var(--lavender-deep);
        background: rgba(255,255,255,0.82);
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-analysis-track.is-collapsed {
        display: none;
      }
      .timeline-analysis-marker {
        position: absolute;
        top: 4px;
        width: 4px;
        height: 16px;
        border-radius: 999px;
        transform: translateX(-50%);
        box-shadow: 0 0 0 2px rgba(255,255,255,0.78);
      }
      .timeline-analysis-marker.beat {
        background: #d91f55;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 0 0 5px rgba(217,31,85,0.12);
      }
      .timeline-analysis-marker.beat-drop {
        width: 7px;
        background: #9b123f;
        box-shadow: 0 0 0 2px rgba(255,255,255,0.86), 0 0 0 6px rgba(155,18,63,0.18);
      }
      .timeline-analysis-marker.face {
        width: 8px;
        background: #28b463;
      }
      .timeline-analysis-marker.no-face {
        width: 8px;
        background: #ffffff;
        border: 1.5px solid rgba(5,5,5,0.22);
      }
      .timeline-analysis-empty {
        display: flex;
        align-items: center;
        height: 100%;
        min-height: 24px;
        padding-left: 10px;
        color: var(--muted);
        font-size: 0.62rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .timeline-analysis-detail {
        margin: -2px 0 10px;
        border: 1px solid rgba(5,5,5,0.08);
        border-radius: 12px;
        background: rgba(255,255,255,0.62);
        padding: 9px 10px;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .timeline-analysis-detail[hidden] {
        display: none;
      }
      .timeline-analysis-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
      }
      .timeline-analysis-pill {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1px solid rgba(5,5,5,0.08);
        border-radius: 999px;
        background: rgba(255,255,255,0.72);
        padding: 3px 7px;
        color: var(--ink);
        font-size: 0.62rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-analysis-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #d91f55;
        box-shadow: 0 0 0 2px rgba(217,31,85,0.12);
      }
      .timeline-analysis-dot.beat-drop {
        background: #9b123f;
      }
      .timeline-analysis-dot.face {
        background: #28b463;
      }
      .timeline-analysis-dot.no-face {
        background: #fff;
        border: 1px solid rgba(5,5,5,0.22);
        box-shadow: none;
      }
      .timeline-analysis-times {
        margin-top: 5px;
        color: var(--ink);
        font-weight: 850;
      }
      .timeline-editor-note {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .timeline-playhead {
        position: absolute;
        top: -28px;
        bottom: -4px;
        width: 16px;
        background: transparent;
        cursor: ew-resize;
        pointer-events: auto;
        touch-action: none;
        transform: translateX(-50%);
        z-index: 5;
      }
      .timeline-playhead:focus-visible::before {
        outline: 3px solid rgba(91,57,214,0.34);
        outline-offset: 4px;
      }
      .timeline-playhead::before {
        content: "";
        position: absolute;
        top: -7px;
        left: 50%;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #d91f55;
        transform: translateX(-50%);
      }
      .timeline-playhead::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        background: #d91f55;
        box-shadow: 0 0 0 3px rgba(217,31,85,0.14);
        transform: translateX(-50%);
      }
      .timeline-track-label {
        margin: 0 0 4px;
        color: var(--ink);
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .timeline-duration-control {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin: 12px 0 16px;
        padding: 10px 12px;
        border: 1.5px solid rgba(5,5,5,0.16);
        border-radius: 14px;
        background: rgba(255,255,255,0.56);
      }
      .timeline-duration-control label {
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-duration-control input {
        width: 96px;
        border: 1.5px solid rgba(5,5,5,0.2);
        border-radius: 999px;
        padding: 8px 12px;
        color: var(--ink);
        background: #fff;
        font-weight: 800;
      }
      .timeline-duration-control span {
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
      }
      .timeline-duration-control--tools {
        margin: 0;
        min-height: 42px;
        padding: 5px 8px;
        border-radius: 999px;
        background: rgba(255,255,255,0.9);
      }
      .timeline-duration-control--tools label {
        font-size: 0.58rem;
        line-height: 1;
        white-space: nowrap;
      }
      .timeline-duration-control--tools input {
        width: 76px;
        min-height: 30px;
        padding: 5px 9px;
        font-size: 0.78rem;
      }
      .timeline-clip {
        position: absolute;
        top: 8px;
        width: 200px;
        min-height: 46px;
        border: 1.5px solid rgba(16, 20, 36, 0.72);
        border-radius: 12px;
        background: #fff;
        color: #050505;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.62rem;
        font-weight: 800;
        cursor: grab;
        box-shadow: 0 8px 0 rgba(5, 5, 5, 0.08), 0 12px 22px rgba(49, 31, 96, 0.12);
        overflow: hidden;
        padding: 5px 10px 6px;
        text-align: center;
        touch-action: none;
        user-select: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
      }
      .timeline-scene-start-marker {
        position: absolute;
        inset: 0 auto 0 0;
        width: 6px;
        background: var(--timeline-scene-marker-color, #d91f55);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.55), 0 0 12px color-mix(in srgb, var(--timeline-scene-marker-color, #d91f55) 50%, transparent);
        pointer-events: none;
      }
      .timeline-clip:active { cursor: grabbing; }
      .timeline-clip.is-locked-intro {
        border-color: rgba(217, 31, 85, 0.42);
        background: linear-gradient(135deg, #1d1233 0%, #5b2ccc 52%, #d91f55 100%);
        color: #fff;
        cursor: default;
        box-shadow: 0 10px 24px rgba(91, 44, 204, 0.22);
      }
      .timeline-clip.is-locked-intro::after {
        content: "LOCKED";
        position: absolute;
        right: 8px;
        top: 6px;
        font-size: 0.48rem;
        letter-spacing: 0.04em;
        color: rgba(255,255,255,0.78);
      }
      .timeline-clip.is-locked-intro .timeline-clip-title,
      .timeline-clip.is-locked-intro .timeline-clip-time {
        color: #fff;
      }
      .timeline-clip.audio {
        width: calc(100% - 24px);
        min-height: 14px;
        top: 5px;
        cursor: default;
        border: 0;
        border-radius: 999px;
        background:
          repeating-linear-gradient(90deg, rgba(255,255,255,0.52) 0 2px, transparent 2px 8px),
          linear-gradient(90deg, #7b3ee6 0%, #d91f55 48%, #ffc957 100%);
        color: transparent;
        padding: 0;
        box-shadow: 0 0 0 1px rgba(255,255,255,0.82), 0 8px 18px rgba(123,62,230,0.16);
      }
      .timeline-clip.audio::after {
        content: "";
        position: absolute;
        inset: 3px 10px;
        border-radius: inherit;
        background: linear-gradient(90deg, rgba(255,255,255,0.22), rgba(255,255,255,0.02), rgba(255,255,255,0.28));
        pointer-events: none;
      }
      .timeline-clip.audio .timeline-clip-title,
      .timeline-clip.audio .timeline-clip-time {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
      }
      .timeline-clip.is-selected {
        border-color: rgba(123, 62, 230, 0.72);
        outline: 3px solid rgba(123, 62, 230, 0.2);
        transform: translateY(-2px);
      }
      .timeline-clip-title,
      .timeline-clip-time {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .timeline-scene-number-badge {
        display: none;
      }
      .timeline-clip-title {
        color: #050505;
        font-size: 0.58rem;
        line-height: 1.05;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: uppercase;
      }
      .timeline-clip-time {
        margin-top: 3px;
        color: #050505;
        font-size: 0.56rem;
        font-weight: 900;
        letter-spacing: 0;
        text-transform: none;
      }
      .timeline-resize-handle {
        position: absolute;
        top: 0;
        width: 30px;
        height: 100%;
        background: transparent;
        cursor: ew-resize;
        z-index: 3;
      }
      .timeline-resize-handle[data-edge="start"] {
        left: 0;
      }
      .timeline-resize-handle[data-edge="end"] {
        right: 0;
      }
      .timeline-resize-handle::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 9px;
        background: var(--timeline-scene-marker-color, #7b3ee6);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.45);
      }
      .timeline-resize-handle[data-edge="start"]::after {
        left: 0;
        border-radius: 12px 0 0 12px;
      }
      .timeline-resize-handle[data-edge="end"]::after {
        right: 0;
        border-radius: 0 12px 12px 0;
        background: #7b3ee6;
      }
      .timeline-cut-handle {
        position: absolute;
        top: 6px;
        bottom: 6px;
        left: 50%;
        width: 3px;
        border-radius: 999px;
        background: #d91f55;
        box-shadow: 0 0 0 5px rgba(217,31,85,0.14);
        cursor: default;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%);
        transition: opacity 0.18s ease;
      }
      .timeline-clip.is-selected .timeline-cut-handle {
        opacity: 1;
      }
      .timeline-cut-handle::before {
        content: "SPLIT";
        position: absolute;
        top: -16px;
        left: 50%;
        color: #d91f55;
        font-size: 0.5rem;
        font-weight: 900;
        transform: translateX(-50%);
      }
      .timeline-scene-map-card {
        margin-bottom: 12px;
        border: 1px solid rgba(55,31,114,0.14);
        border-radius: 14px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 10px 24px rgba(16,12,34,0.08);
        overflow: hidden;
        order: 1;
      }
      .timeline-scene-map-card > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        cursor: pointer;
        list-style: none;
      }
      .timeline-scene-map-card > summary::-webkit-details-marker {
        display: none;
      }
      .timeline-scene-map-title {
        display: grid;
        gap: 3px;
      }
      .timeline-scene-map-title strong {
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-scene-map-title span,
      .timeline-scene-map-count {
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 800;
      }
      .timeline-scene-map-count {
        min-width: max-content;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 999px;
        padding: 5px 8px;
        background: #fff;
        color: var(--lavender-deep);
      }
      .timeline-scene-map-body {
        border-top: 1px solid rgba(55,31,114,0.12);
        padding: 10px 12px 12px;
      }
      .timeline-next-guidance {
        margin: 8px 0 0;
        padding: 8px 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.78);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 750;
      }
      .timeline-next-guidance strong {
        color: var(--lavender-deep);
        font-weight: 900;
      }
      .timeline-generation-center {
        margin: 0 0 14px;
        border: 1px solid rgba(55,31,114,0.15);
        border-radius: 12px;
        background: rgba(255,255,255,0.94);
        box-shadow: 0 12px 26px rgba(16,12,34,0.08);
        padding: 12px;
      }
      .timeline-generation-center-main {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
      }
      .timeline-generation-center-title {
        margin: 0;
        color: var(--ink);
        font-size: 0.9rem;
        font-weight: 950;
      }
      .timeline-generation-center-copy {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .timeline-generation-center-scene {
        flex: 0 0 auto;
        border: 1px solid rgba(123,62,230,0.2);
        border-radius: 999px;
        padding: 7px 10px;
        background: #f6f1ff;
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .timeline-generation-steps {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 7px;
      }
      .timeline-generation-step {
        min-height: 44px;
        border: 1px solid rgba(55,31,114,0.13);
        border-radius: 10px;
        padding: 7px 8px;
        background: #fff;
        color: var(--muted);
        font-size: 0.64rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-generation-step strong {
        display: block;
        margin-bottom: 3px;
        color: var(--ink);
        font-size: 0.7rem;
        text-transform: none;
      }
      .timeline-generation-step.is-done {
        border-color: rgba(23,125,83,0.32);
        background: #f2fff8;
      }
      .timeline-generation-step.is-active {
        border-color: rgba(123,62,230,0.36);
        background: #f5efff;
      }
      .timeline-generation-step.is-error {
        border-color: rgba(190,61,61,0.34);
        background: #fff3f3;
      }
      .video-next-action-highlight {
        position: relative;
        z-index: 35;
        outline: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow:
          0 0 0 4px rgba(123, 62, 230, 0.16),
          0 10px 24px rgba(79, 38, 170, 0.16) !important;
        animation: videoNextActionPulse 1.7s ease-in-out infinite;
      }
      @keyframes videoNextActionPulse {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-2px); }
      }
      .video-next-pointer {
        position: fixed;
        z-index: 12000;
        max-width: min(210px, calc(100vw - 28px));
        padding: 8px 36px 8px 10px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.45);
        background: linear-gradient(135deg, #371f72, #7b3ee6);
        color: #fff;
        box-shadow: 0 12px 30px rgba(27,18,58,0.22);
        pointer-events: none;
        opacity: 0;
        transform: translate3d(-50%, -8px, 0);
        transition: opacity 160ms ease, transform 160ms ease;
      }
      .video-next-pointer.is-visible {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
      }
      .video-next-pointer[hidden] {
        display: none;
      }
      .video-next-pointer strong {
        display: block;
        font-size: 0.58rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .video-next-pointer span {
        display: block;
        margin-top: 2px;
        font-size: 0.66rem;
        line-height: 1.28;
        font-weight: 750;
      }
      .video-next-close,
      .timeline-next-step-close {
        display: inline-grid;
        place-items: center;
        width: 26px;
        height: 26px;
        border: 0;
        border-radius: 999px;
        background: rgba(18, 12, 30, 0.88);
        color: #fff;
        font-family: Poppins, Arial, sans-serif;
        font-size: 1rem;
        font-weight: 950;
        line-height: 1;
        cursor: pointer;
      }
      .video-next-close {
        position: absolute;
        top: 7px;
        right: 7px;
        pointer-events: auto;
      }
      .timeline-next-step-close {
        flex: 0 0 auto;
        background: rgba(42, 30, 66, 0.86);
      }
      .video-next-close:focus-visible,
      .timeline-next-step-close:focus-visible {
        outline: 3px solid rgba(123, 62, 230, 0.3);
        outline-offset: 2px;
      }
      .video-next-pointer::after {
        content: "";
        position: absolute;
        left: 50%;
        width: 10px;
        height: 10px;
        background: #5a2cc1;
        transform: translateX(-50%) rotate(45deg);
      }
      .video-next-pointer.is-above::after {
        bottom: -5px;
      }
      .video-next-pointer.is-below::after {
        top: -5px;
      }
      .scene-review-overlay {
        position: fixed;
        inset: 0;
        z-index: 14000;
        display: grid;
        place-items: center;
        padding: 18px;
        background: rgba(15, 10, 30, 0.72);
        backdrop-filter: blur(12px);
      }
      .scene-review-overlay[hidden] {
        display: none;
      }
      .scene-review-dialog {
        width: min(960px, 100%);
        max-height: min(92vh, 820px);
        overflow: auto;
        border: 2px solid rgba(255,255,255,0.82);
        border-radius: 20px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 28px 80px rgba(9, 5, 28, 0.36);
        padding: clamp(16px, 2.6vw, 26px);
      }
      .scene-review-dialog h2 {
        margin: 0;
        color: var(--lavender-deep);
        font-size: clamp(1.2rem, 2.6vw, 2rem);
        font-weight: 900;
        line-height: 1.1;
      }
      .scene-review-dialog p {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 0.86rem;
        font-weight: 700;
        line-height: 1.55;
      }
      .scene-review-video {
        margin-top: 16px;
        border: 2px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        overflow: hidden;
        background: #090612;
      }
      .scene-review-video video {
        display: block;
        width: 100%;
        max-height: 58vh;
        object-fit: contain;
        background: #090612;
      }
      .scene-review-prompt {
        margin-top: 12px;
        border: 1.5px solid rgba(123,62,230,0.18);
        border-radius: 14px;
        padding: 12px;
        background: rgba(247,243,255,0.72);
        color: var(--ink);
        font-size: 0.78rem;
        font-weight: 650;
        line-height: 1.55;
        max-height: 120px;
        overflow: auto;
        white-space: pre-wrap;
      }
      .scene-review-change-box {
        margin-top: 14px;
        border: 1.5px solid rgba(123,62,230,0.16);
        border-radius: 16px;
        padding: 12px;
        background: rgba(244,238,255,0.76);
      }
      .scene-review-change-box[hidden] {
        display: none;
      }
      .scene-review-change-box label {
        display: grid;
        gap: 8px;
        color: var(--ink);
        font-size: 0.74rem;
        font-weight: 950;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .scene-review-change-box textarea {
        width: 100%;
        min-height: 96px;
        border: 1.5px solid rgba(5,5,5,0.16);
        border-radius: 14px;
        padding: 12px 44px 12px 12px;
        color: var(--ink);
        background: rgba(255,255,255,0.96);
        font: 700 0.84rem/1.5 Poppins, Arial, sans-serif;
        resize: vertical;
        outline: none;
      }
      .scene-review-change-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 10px;
        flex-wrap: wrap;
      }
      .negative-prompt-note,
      .scene-review-negative-label {
        display: none !important;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
        border: 1.5px solid rgba(155, 93, 0, 0.22);
        border-radius: 999px;
        padding: 7px 10px;
        background: rgba(255, 247, 232, 0.94);
        color: #6f4300;
        font-size: 0.64rem;
        font-weight: 950;
        line-height: 1.25;
        text-transform: uppercase;
        letter-spacing: 0.02em;
      }
      .negative-prompt-note::before,
      .scene-review-negative-label::before {
        content: "!";
        display: inline-grid;
        place-items: center;
        width: 16px;
        height: 16px;
        border-radius: 999px;
        background: #8a5500;
        color: #fff;
        font-size: 0.66rem;
        font-weight: 950;
      }
      .scene-review-actions {
        margin-top: 16px;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
      }
      .timeline-next-step-bar {
        position: fixed;
        left: 50%;
        bottom: 14px;
        z-index: 8900;
        width: min(720px, calc(100vw - 24px));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 10px 9px 14px;
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 999px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 20px 44px rgba(27,18,58,0.2);
        transform: translateX(-50%);
      }
      .timeline-next-step-bar[hidden] {
        display: none;
      }
      .timeline-next-step-copy {
        min-width: 0;
      }
      .timeline-next-step-copy strong,
      .timeline-next-step-copy span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .timeline-next-step-copy strong {
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 950;
        text-transform: uppercase;
      }
      .timeline-next-step-copy span {
        color: var(--ink);
        font-size: 0.76rem;
        font-weight: 850;
      }
      .timeline-next-step-button {
        flex: 0 0 auto;
        min-width: 130px;
        border: 0;
        border-radius: 999px;
        padding: 10px 14px;
        background: var(--lavender-deep);
        color: #fff;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.68rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-resume-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 12px 0 0;
        padding: 13px 14px;
        border: 1.5px solid rgba(123,62,230,0.2);
        border-radius: 14px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 12px 28px rgba(55,31,114,0.08);
      }
      .timeline-resume-banner[hidden] {
        display: none;
      }
      .timeline-resume-banner strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.9rem;
      }
      .timeline-resume-banner span {
        display: block;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
        margin-top: 2px;
      }
      .timeline-resume-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }
      .timeline-build-progress {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(123,62,230,0.14);
      }
      .timeline-build-progress .storyboard-context {
        margin: 0;
        font-size: 0.76rem;
        line-height: 1.45;
        letter-spacing: 0.02em;
        text-transform: none;
      }
      .timeline-build-progress .timeline-resume-banner {
        margin: 0;
      }
      .timeline-scene-step-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }
      .timeline-scene-step {
        border: 1px solid rgba(123,62,230,0.16);
        border-radius: 12px;
        padding: 9px 10px;
        background: #fff;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        text-transform: uppercase;
      }
      .timeline-scene-step strong {
        display: block;
        color: var(--ink);
        font-size: 0.78rem;
        text-transform: none;
      }
      .timeline-scene-step.is-done {
        border-color: rgba(18,139,92,0.34);
        background: rgba(18,139,92,0.09);
      }
      .timeline-scene-step.is-active {
        border-color: rgba(123,62,230,0.34);
        background: rgba(123,62,230,0.1);
      }
      .timeline-scene-step.is-waiting {
        opacity: 0.72;
      }
      .timeline-scene-map-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 7px;
      }
      .timeline-scene-tile {
        min-height: 64px;
        border: 1.5px solid rgba(55,31,114,0.18);
        border-radius: 10px;
        padding: 8px;
        background: #fff;
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        text-align: left;
        cursor: pointer;
        box-shadow: 0 6px 14px rgba(16,12,34,0.07);
      }
      .timeline-scene-tile:hover,
      .timeline-scene-tile:focus-visible {
        border-color: rgba(123,62,230,0.72);
        outline: 3px solid rgba(123,62,230,0.14);
      }
      .timeline-scene-tile.is-active {
        border-color: var(--lavender-deep);
        background: #f4efff;
      }
      .timeline-scene-tile[data-state="done"] {
        border-color: rgba(23,125,83,0.38);
        background: linear-gradient(135deg, #f2fff8, #ffffff);
      }
      .timeline-scene-tile[data-state="partial"] {
        border-color: rgba(23,125,83,0.28);
        background: linear-gradient(135deg, #f7fff9, #f6f0ff);
      }
      .timeline-scene-tile[data-state="generating"] {
        border-color: rgba(188,111,18,0.45);
        background: linear-gradient(135deg, #fff7e8, #ffffff);
      }
      .timeline-scene-tile[data-state="ready"] {
        border-color: rgba(123,62,230,0.32);
        background: linear-gradient(135deg, #f5f0ff, #ffffff);
      }
      .timeline-scene-tile[data-state="frame"],
      .timeline-scene-tile[data-state="prompt"] {
        border-color: rgba(58,117,175,0.28);
        background: linear-gradient(135deg, #f3f8ff, #ffffff);
      }
      .timeline-scene-tile[data-state="failed"] {
        border-color: rgba(190,61,61,0.42);
        background: linear-gradient(135deg, #fff3f3, #ffffff);
      }
      .timeline-scene-tile-number,
      .timeline-scene-tile-status,
      .timeline-scene-tile-time {
        display: block;
      }
      .timeline-scene-tile-number {
        color: var(--lavender-deep);
        font-size: 0.68rem;
        font-weight: 900;
      }
      .timeline-scene-tile-status {
        margin-top: 4px;
        color: var(--ink);
        font-size: 0.62rem;
        font-weight: 900;
      }
      .timeline-scene-tile-time {
        margin-top: 3px;
        color: var(--muted);
        font-size: 0.54rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .timeline-actions {
        position: relative;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(32px, 32px));
        gap: 5px;
        margin-top: 0;
        padding: 4px;
        border: 1px solid rgba(5,5,5,0.09);
        border-radius: 999px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 5px 12px rgba(16,12,34,0.06);
        justify-content: center;
        align-items: center;
      }
      .timeline-icon-button {
        position: relative;
        display: inline-grid;
        place-items: center;
        width: 32px;
        height: 32px;
        border: 1px solid rgba(5,5,5,0.18);
        border-radius: 50%;
        background: #fff;
        color: var(--lavender-deep);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(16,12,34,0.06);
      }
      .timeline-icon-button.is-primary {
        background: var(--lavender-deep);
        color: #fff;
        border-color: var(--lavender-deep);
      }
      #saveTimelineContinueButton {
        outline: 2px solid rgba(255,255,255,0.9);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.16), 0 12px 24px rgba(55,31,114,0.18);
      }
      .timeline-save-continue-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-top: 28px;
        padding-top: 12px;
      }
      .timeline-save-continue-row #saveTimelineContinueButton,
      .timeline-save-continue-row #continueTimelineQuickGenButton {
        min-width: 220px;
        outline: none;
      }
      .timeline-save-continue-row .quickgen-continue-note {
        max-width: 520px;
        margin: 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.45;
        text-align: center;
      }
      .timeline-icon-button.is-danger {
        background: #8d1732;
        color: #fff;
        border-color: #8d1732;
      }
      .timeline-add-scene-button {
        position: absolute;
        top: 50%;
        width: 38px;
        height: 38px;
        border: 2px solid rgba(123, 62, 230, 0.24);
        border-radius: 50%;
        background: #ffffff;
        color: var(--lavender-deep);
        font-size: 1.4rem;
        font-weight: 900;
        line-height: 1;
        display: grid;
        place-items: center;
        cursor: pointer;
        transform: translate(-50%, -50%);
        box-shadow: 0 10px 22px rgba(16,12,34,0.16);
        z-index: 7;
      }
      .timeline-add-scene-button:hover,
      .timeline-add-scene-button:focus-visible {
        background: var(--lavender-deep);
        color: #fff;
        outline: none;
      }
      .timeline-add-scene-button::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 9px);
        min-width: max-content;
        border-radius: 999px;
        background: rgba(8,6,18,0.92);
        color: #fff;
        padding: 7px 10px;
        font-size: 0.62rem;
        font-weight: 800;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 4px);
        transition: opacity 0.16s ease, transform 0.16s ease;
      }
      .timeline-add-scene-button:hover::after,
      .timeline-add-scene-button:focus-visible::after {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      .timeline-icon-button svg,
      .custom-song-button svg {
        width: 18px;
        height: 18px;
        display: block;
        color: #fff;
      }
      .timeline-icon-button:hover,
      .timeline-icon-button:focus-visible {
        transform: translateY(-1px);
        outline: none;
        box-shadow: 0 10px 22px rgba(16,12,34,0.18);
      }
      .timeline-icon-button:disabled,
      .timeline-icon-button[aria-disabled="true"] {
        opacity: 0.42;
        cursor: not-allowed;
        filter: grayscale(0.35);
        transform: none;
        box-shadow: none;
      }
      .timeline-icon-button:disabled:hover,
      .timeline-icon-button[aria-disabled="true"]:hover,
      .timeline-icon-button:disabled:focus-visible,
      .timeline-icon-button[aria-disabled="true"]:focus-visible {
        transform: none;
        box-shadow: none;
      }
      .timeline-icon-button::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 50%;
        bottom: calc(100% + 10px);
        min-width: max-content;
        max-width: 180px;
        border-radius: 999px;
        background: rgba(8,6,18,0.92);
        color: #fff;
        padding: 7px 10px;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 4px);
        transition: opacity 0.16s ease, transform 0.16s ease;
        z-index: 20;
      }
      .timeline-icon-button:hover::after,
      .timeline-icon-button:focus-visible::after {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      .timeline-edit-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(112px, 1fr));
        gap: 10px;
        align-items: end;
        margin: 0;
        padding: 12px;
        border: 1px solid rgba(5,5,5,0.12);
        border-radius: 16px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 10px 24px rgba(16,12,34,0.08);
      }
      .timeline-edit-toolbar label {
        display: grid;
        gap: 5px;
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .timeline-edit-toolbar input {
        width: 100%;
        min-height: 38px;
        border: 1px solid rgba(5,5,5,0.18);
        border-radius: 999px;
        padding: 9px 12px;
        color: var(--ink);
        background: #fff;
        font-weight: 800;
      }
      .timeline-export-button {
        color: #fff !important;
        text-decoration: none;
      }
      .timeline-export-button:visited,
      .timeline-export-button:hover,
      .timeline-export-button:focus-visible {
        color: #fff !important;
      }
      .timeline-clip.is-generating {
        background: linear-gradient(135deg, #fff7d8 0%, #ffe8a3 55%, #ffd36e 100%);
        color: #6f4300;
        cursor: progress;
      }
      .timeline-clip.is-generating::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.58), transparent);
        transform: translateX(-100%);
        animation: timelineGeneratingSweep 1.4s linear infinite;
      }
      .timeline-clip.is-generating .timeline-clip-title,
      .timeline-clip.is-generating .timeline-clip-time {
        position: relative;
        z-index: 1;
      }
      @keyframes timelineGeneratingSweep {
        to { transform: translateX(100%); }
      }
      .storyboard-timing-panel,
      .timeline-scene-panel {
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        padding: 12px;
        background: rgba(255,255,255,0.58);
      }
      .storyboard-timing-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
        margin-top: 10px;
      }
      .storyboard-timing-grid label {
        display: grid;
        gap: 6px;
        color: rgba(37, 23, 52, 0.76);
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .storyboard-timing-grid select,
      .storyboard-timing-grid input,
      .timeline-scene-settings select,
      .timeline-scene-settings input {
        width: 100%;
        min-height: 42px;
        border: 1.5px solid rgba(5,5,5,0.18);
        border-radius: 12px;
        padding: 9px 11px;
        background: rgba(255,255,255,0.78);
        color: var(--ink);
        font: inherit;
        font-weight: 700;
      }
      .timeline-scene-prompt {
        width: 100%;
        min-height: 260px;
        max-height: 55vh;
        overflow: auto;
        border: 2px solid var(--ink);
        border-radius: 14px;
        background: rgba(255,255,255,0.78);
        padding: 12px;
        color: var(--ink);
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-start-frame-prompt-panel {
        display: grid;
        gap: 8px;
        margin: 10px 0;
        padding: 10px;
        border: 1.5px solid rgba(79,54,166,0.18);
        border-radius: 14px;
        background: rgba(255,255,255,0.76);
      }
      .timeline-start-frame-prompt-input {
        width: 100%;
        min-height: 150px;
        max-height: 42vh;
        overflow: auto;
        border: 1.5px solid rgba(36,28,55,0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.92);
        color: var(--ink);
        padding: 10px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-start-frame-prompt-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
      }
      .timeline-start-frame-prompt-actions .outline-button {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 0.66rem;
      }
      .timeline-veo-prompt-review-panel {
        margin-top: 10px;
        padding: 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 12px;
        background: rgba(255,255,255,0.86);
      }
      .timeline-prompt-source-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 8px 0;
        color: rgba(36,28,55,0.76);
        font-size: 0.68rem;
        font-weight: 850;
        line-height: 1.35;
      }
      .timeline-prompt-source-summary span {
        border: 1px solid rgba(123,62,230,0.16);
        border-radius: 999px;
        background: rgba(255,255,255,0.74);
        padding: 5px 8px;
      }
      .timeline-veo-prompt-input {
        width: 100%;
        min-height: 190px;
        max-height: 46vh;
        overflow: auto;
        border: 1.5px solid rgba(36,28,55,0.14);
        border-radius: 12px;
        background: rgba(255,255,255,0.96);
        color: var(--ink);
        padding: 10px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.55;
        resize: vertical;
      }
      .timeline-veo-prompt-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 8px;
        margin-top: 8px;
      }
      .timeline-veo-prompt-advanced {
        margin-top: 8px;
      }
      .timeline-veo-prompt-advanced > summary {
        cursor: pointer;
        color: var(--lavender-deep);
        font-size: 0.66rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .negative-prompt-note[hidden],
      .scene-review-negative-label[hidden] {
        display: none !important;
      }
      .timeline-prompt-details {
        display: none !important;
        margin-top: 8px;
      }
      .timeline-prompt-details > summary {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 6px 10px;
        border: 1px solid rgba(123,62,230,0.18);
        border-radius: 999px;
        background: rgba(255,255,255,0.86);
        color: var(--lavender-deep);
        font-size: 0.64rem;
        font-weight: 950;
        text-transform: uppercase;
        cursor: pointer;
      }
      .timeline-prompt-details > summary::-webkit-details-marker {
        display: none;
      }
      .timeline-scene-settings {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-bottom: 10px;
      }
      .timeline-scene-settings label {
        display: grid;
        gap: 6px;
        width: min(240px, 100%);
        text-align: center;
        color: rgba(37, 23, 52, 0.76);
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
      }
      .timeline-scene-settings select {
        text-align: center;
        text-align-last: center;
      }
      .timeline-lyric-cue-card {
        display: grid;
        gap: 8px;
        margin: 0 0 10px;
        padding: 10px;
        border: 1px solid rgba(123,62,230,0.22);
        border-radius: 12px;
        background: rgba(13, 9, 24, 0.72);
        color: rgba(255,255,255,0.92);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
      }
      .timeline-lyric-cue-card[hidden] {
        display: none !important;
      }
      .timeline-lyric-cue-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(222,205,255,0.96);
      }
      .timeline-lyric-cue-range {
        color: rgba(255,255,255,0.72);
        white-space: nowrap;
      }
      .timeline-lyric-cue-audio {
        display: grid;
        gap: 6px;
        padding: 8px;
        border-radius: 10px;
        background: rgba(255,255,255,0.08);
      }
      .timeline-lyric-cue-audio[hidden] {
        display: none !important;
      }
      .timeline-lyric-cue-audio-label {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        color: rgba(222,205,255,0.92);
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .timeline-lyric-cue-audio audio {
        width: 100%;
        height: 34px;
        color-scheme: dark;
      }
      .timeline-lyric-cue-text {
        margin: 0;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 850;
        line-height: 1.45;
      }
      #timelineMatchedLyricCueText {
        color: #fff !important;
      }
      .timeline-lyric-cue-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
      }
      .timeline-lyric-cue-grid div {
        display: grid;
        gap: 4px;
        padding: 8px;
        border-radius: 10px;
        background: rgba(255,255,255,0.07);
      }
      .timeline-lyric-cue-grid strong {
        color: rgba(222,205,255,0.9);
        font-size: 0.62rem;
        font-weight: 950;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .timeline-lyric-cue-grid span {
        color: rgba(255,255,255,0.9);
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1.45;
      }
	      .timeline-scene-panel-actions {
	        display: grid;
	        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
	        align-items: stretch;
	        gap: 10px;
	        margin-top: 10px;
	      }
	      .timeline-scene-panel-actions .scene-reset-button {
	        border-color: rgba(141, 23, 50, 0.44);
	        color: #8d1732;
	      }
	      .timeline-scene-panel-actions .scene-reset-button:hover,
	      .timeline-scene-panel-actions .scene-reset-button:focus-visible {
	        background: #8d1732;
	        color: #fff;
	        box-shadow: 6px 6px 0 rgba(141, 23, 50, 0.16);
	      }
	      .timeline-debug-actions {
	        display: grid;
	        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	        align-items: stretch;
	        gap: 8px;
        margin-top: 8px;
      }
      .timeline-debug-actions .outline-button {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.68rem;
      }
      .timeline-recovery-card {
        display: grid;
        gap: 8px;
        margin-top: 10px;
        padding: 10px;
        border: 1.5px solid rgba(123, 62, 230, 0.18);
        border-radius: 14px;
        background: rgba(255,255,255,0.56);
      }
      .timeline-recovery-card[hidden] {
        display: none;
      }
      .timeline-recovery-card strong {
        color: var(--ink);
        font-size: 0.82rem;
      }
      .timeline-recovery-card p {
        margin: 0;
        color: var(--muted);
        font-size: 0.75rem;
        line-height: 1.45;
      }
      .timeline-last-save {
        display: block;
        margin-top: 6px;
        color: rgba(37, 23, 52, 0.72);
        font-size: 0.75rem;
        font-weight: 800;
      }
      .timeline-start-frame-review {
        display: grid;
        gap: 10px;
        margin-top: 10px;
        padding: 10px;
        border: 1.5px dashed rgba(111, 75, 255, 0.32);
        border-radius: 14px;
        background: rgba(245, 241, 255, 0.68);
      }
	      .timeline-start-frame-preview {
	        min-height: 230px;
	        display: grid;
	        place-items: center;
	        overflow: hidden;
        border-radius: 12px;
        background: rgba(18, 12, 30, 0.08);
        color: rgba(37, 23, 52, 0.62);
        font-size: 0.78rem;
        font-weight: 800;
        text-align: center;
      }
	      .timeline-start-frame-preview img {
	        width: 100%;
	        height: 100%;
	        max-height: 360px;
	        object-fit: cover;
	        display: block;
	      }
      .start-frame-candidate-grid {
        width: 100%;
        display: grid;
	        grid-template-columns: repeat(2, minmax(0, 1fr));
	        gap: 14px;
	        padding: 10px;
	      }
	      .start-frame-candidate {
	        position: relative;
	        display: grid;
	        gap: 8px;
	        border: 2px solid rgba(37, 23, 52, 0.12);
	        border-radius: 14px;
	        padding: 8px;
	        background: rgba(255,255,255,0.9);
	        color: var(--ink);
	        text-align: left;
	        box-shadow: 0 12px 28px rgba(16, 12, 34, 0.12);
	      }
	      .start-frame-candidate.is-selected {
	        border-color: var(--lavender-deep);
	        background: linear-gradient(180deg, rgba(238, 230, 255, 0.98), rgba(255,255,255,0.94));
	        box-shadow: 0 0 0 4px rgba(123,62,230,0.22), 0 16px 32px rgba(16, 12, 34, 0.16);
	      }
      .start-frame-candidate.is-selected::after {
        content: "SELECTED";
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        border-radius: 999px;
        background: var(--lavender-deep);
        color: #fff;
        padding: 5px 9px;
        font-size: 0.62rem;
        font-weight: 1000;
        letter-spacing: 0;
        box-shadow: 0 8px 18px rgba(84, 40, 176, 0.28);
      }
	      .start-frame-candidate-button {
	        border: 0;
	        border-radius: 11px;
	        padding: 0;
	        background: transparent;
	        overflow: hidden;
	        cursor: pointer;
	        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.54);
	      }
      .start-frame-candidate-button img {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
        max-height: none;
        object-fit: cover;
        display: block;
      }
	      .start-frame-candidate-actions {
	        display: flex;
	        align-items: center;
	        justify-content: space-between;
	        gap: 8px;
	        padding: 0 2px;
	        font-size: 0.7rem;
	        font-weight: 900;
	        text-transform: uppercase;
	      }
      .start-frame-candidate-actions a {
        color: var(--lavender-deep);
        text-decoration: none;
      }
      .start-frame-candidate-prompt {
        max-height: 104px;
        overflow: auto;
        border: 1px solid rgba(37, 23, 52, 0.1);
        border-radius: 8px;
        padding: 7px 8px;
        background: rgba(247, 244, 255, 0.72);
        color: rgba(37, 23, 52, 0.74);
        font-size: 0.68rem;
        line-height: 1.35;
        font-weight: 600;
        overflow-wrap: anywhere;
      }
      .start-frame-candidate-prompt strong {
        display: block;
        margin-bottom: 3px;
        color: rgba(37, 23, 52, 0.9);
        font-size: 0.62rem;
        text-transform: uppercase;
      }
      @media (max-width: 560px) {
        .start-frame-candidate-grid {
          grid-template-columns: 1fr;
        }
      }
      .start-frame-lightbox {
        width: min(1080px, calc(100vw - 24px));
        max-height: min(92vh, 920px);
        overflow: auto;
      }
      .start-frame-lightbox h2 {
        margin: 4px 0 6px;
        color: var(--lavender-deep);
        font-size: clamp(1.35rem, 3vw, 2.35rem);
        line-height: 1.05;
      }
      .start-frame-lightbox .storyboard-context {
        margin-bottom: 14px;
      }
      .start-frame-lightbox-preview {
        min-height: 320px;
        border-radius: 16px;
      }
      .start-frame-lightbox-preview .start-frame-candidate-grid {
        padding: 0;
        gap: 16px;
      }
      .start-frame-lightbox-preview .start-frame-candidate {
        border-radius: 16px;
      }
      .start-frame-lightbox-preview .start-frame-candidate-button img {
        max-height: 46vh;
      }
      .start-frame-lightbox-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        align-items: stretch;
      }
      .start-frame-lightbox-actions .primary-button:disabled {
        opacity: 0.52;
        cursor: not-allowed;
        filter: grayscale(0.35);
      }
      .timeline-start-frame-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        align-items: stretch;
        gap: 8px;
      }
      .timeline-start-frame-actions .primary-button,
      .timeline-start-frame-actions .outline-button,
      .timeline-scene-panel-actions .primary-button,
      .timeline-scene-panel-actions .outline-button,
      .timeline-debug-actions .primary-button,
      .timeline-debug-actions .outline-button,
      .timeline-save-continue-row .primary-button,
      .timeline-save-continue-row .outline-button,
      .timeline-resume-actions .primary-button,
      .timeline-resume-actions .outline-button,
      .clip-decision-actions .primary-button,
      .clip-decision-actions .outline-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 38px;
        padding: 8px 12px;
        text-align: center;
        line-height: 1.15;
      }
      .next-scene-choice-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 18px 0 14px;
      }
      .next-scene-choice {
        position: relative;
        min-height: 132px;
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 14px;
        padding: 14px;
        background: rgba(255,255,255,0.72);
        color: var(--ink);
        cursor: pointer;
        text-align: left;
        font-family: Poppins, Arial, sans-serif;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
      }
      .next-scene-choice strong {
        display: block;
        color: var(--lavender-deep);
        font-size: 0.82rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .next-scene-choice span {
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
        line-height: 1.45;
      }
      .next-scene-choice.is-selected {
        border-color: var(--lavender-deep);
        background: linear-gradient(180deg, rgba(238,230,255,0.96), rgba(255,255,255,0.92));
        box-shadow: 0 0 0 4px rgba(123,62,230,0.22), 0 12px 26px rgba(16,12,34,0.12);
        transform: translateY(-1px);
      }
      .next-scene-choice.is-selected::after {
        content: "SELECTED";
        position: absolute;
        top: 10px;
        right: 10px;
        border-radius: 999px;
        background: var(--lavender-deep);
        color: #fff;
        padding: 5px 9px;
        font-size: 0.6rem;
        font-weight: 1000;
        line-height: 1;
        letter-spacing: 0;
        box-shadow: 0 8px 18px rgba(84, 40, 176, 0.24);
      }
      .next-scene-choice:disabled {
        cursor: not-allowed;
        opacity: 0.45;
        box-shadow: none;
        transform: none;
      }
      .next-scene-flow-steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 14px 0 12px;
      }
      .next-scene-flow-step {
        border: 1.5px solid rgba(5,5,5,0.12);
        border-radius: 14px;
        padding: 10px 12px;
        background: rgba(255,255,255,0.66);
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        line-height: 1.35;
      }
      .next-scene-flow-step strong {
        display: block;
        margin-bottom: 4px;
        color: var(--ink);
        font-size: 0.78rem;
        text-transform: uppercase;
      }
      .next-scene-flow-step.is-active {
        border-color: var(--lavender-deep);
        background: rgba(247,244,255,0.96);
        color: var(--ink);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.12);
      }
      .next-scene-flow-step.is-done {
        border-color: rgba(34, 139, 96, 0.45);
        background: rgba(234, 250, 241, 0.92);
        color: #176341;
      }
      .next-scene-custom-prompt {
        margin: 8px 0 16px;
        border: 1.5px solid rgba(123,62,230,0.18);
        border-radius: 16px;
        padding: 14px;
        background: rgba(247,244,255,0.76);
      }
      .next-scene-custom-prompt[hidden] {
        display: none;
      }
      .next-scene-custom-prompt label {
        display: block;
        margin-bottom: 8px;
        color: var(--lavender-deep);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
      }
      .next-scene-custom-prompt textarea {
        width: 100%;
        min-height: 240px;
        max-height: 52vh;
        overflow: auto;
        border: 2px solid rgba(123,62,230,0.2);
        border-radius: 14px;
        padding: 12px;
        background: #fff;
        color: var(--ink);
        font: 700 0.9rem/1.55 Poppins, Arial, sans-serif;
        resize: vertical;
        outline: none;
      }
      .next-scene-custom-prompt textarea:focus {
        border-color: var(--lavender-deep);
        box-shadow: 0 0 0 3px rgba(123,62,230,0.13);
      }
      .scene-replace-hint {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 750;
        line-height: 1.45;
      }
      .vg-modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(5,5,5,0.12);
        border-radius: 999px;
        background: rgba(255,255,255,0.9);
        color: var(--ink);
        font-size: 1.15rem;
        font-weight: 900;
        cursor: pointer;
      }
      #nextSceneModeOverlay {
        padding: clamp(10px, 2.6vw, 28px);
      }
      #nextSceneModeOverlay .vg-modal {
        width: min(96vw, 1180px);
        min-height: 75vh;
        max-height: calc(100dvh - 40px);
        overflow: auto;
        padding: clamp(18px, 2.8vw, 34px);
      }
      #nextSceneModeOverlay .next-scene-flow-steps {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
      }
      #nextSceneModeOverlay .next-scene-context-panel {
        display: grid;
        gap: 12px;
        margin: 14px 0 16px;
        padding: 14px;
        border: 1px solid rgba(123, 62, 230, 0.22);
        border-radius: 16px;
        background: rgba(255,255,255,0.78);
      }
      #nextSceneModeOverlay .next-scene-context-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
      }
      #nextSceneModeOverlay .next-scene-context-item {
        border: 1px solid rgba(83, 56, 129, 0.14);
        border-radius: 12px;
        padding: 10px;
        background: rgba(255,255,255,0.82);
      }
      #nextSceneModeOverlay .next-scene-context-item strong,
      #nextSceneModeOverlay .next-scene-character-title {
        display: block;
        margin-bottom: 5px;
        color: #4d22b8;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.09em;
        text-transform: uppercase;
      }
      #nextSceneModeOverlay .next-scene-context-item span,
      #nextSceneModeOverlay .next-scene-context-summary {
        color: var(--ink);
        font-size: 0.8rem;
        font-weight: 750;
        line-height: 1.45;
      }
      #nextSceneModeOverlay .next-scene-character-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        gap: 10px;
      }
      #nextSceneModeOverlay .next-scene-character-card {
        display: grid;
        gap: 6px;
        align-content: start;
      }
      #nextSceneModeOverlay .next-scene-character-card img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 10px;
        border: 1px solid rgba(83, 56, 129, 0.18);
        background: rgba(255,255,255,0.8);
      }
      #nextSceneModeOverlay .next-scene-character-card span {
        color: var(--ink);
        font-size: 0.72rem;
        font-weight: 900;
        line-height: 1.2;
      }
      #nextSceneModeOverlay .next-scene-choice-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: clamp(10px, 1.8vw, 16px);
      }
      #nextSceneModeOverlay .next-scene-choice {
        min-height: 82px;
        display: flex;
        align-items: center;
      }
      #nextSceneModeOverlay .next-scene-choice strong {
        font-size: clamp(0.78rem, 1.2vw, 0.94rem);
        line-height: 1.28;
      }
      #nextSceneModeOverlay .next-scene-custom-prompt textarea {
        min-height: clamp(180px, 30vh, 300px);
      }
      @media (max-width: 760px) {
        .next-scene-choice-grid,
        .next-scene-flow-steps {
          grid-template-columns: 1fr;
        }
        #nextSceneModeOverlay {
          align-items: stretch;
          padding: 8px;
        }
        #nextSceneModeOverlay .vg-modal {
          width: 100%;
          max-height: calc(100dvh - 16px);
          border-width: 3px;
          border-radius: 22px;
        }
        #nextSceneModeOverlay .next-scene-choice-grid,
        #nextSceneModeOverlay .next-scene-flow-steps {
          grid-template-columns: 1fr;
        }
        #nextSceneModeOverlay .next-scene-choice {
          min-height: 72px;
        }
      }
      .timeline-command-panel {
        margin-top: 14px;
        border: 1.5px solid rgba(5,5,5,0.14);
        border-radius: 16px;
        padding: 12px;
        background: rgba(255,255,255,0.58);
      }
      .timeline-command-row {
        display: grid;
        grid-template-columns: auto minmax(180px, 1fr) auto;
        gap: 10px;
      }
      #timelineCommandInput {
        min-height: 42px;
        border: 2px solid var(--ink);
        border-radius: 999px;
        padding: 0 14px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.82rem;
        font-weight: 700;
      }
      .timeline-voice-button {
        border: 2px solid var(--ink);
        border-radius: 999px;
        background: rgba(255,255,255,0.46);
        color: var(--lavender-deep);
        padding: 0 14px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 0.78rem;
        font-weight: 800;
        cursor: pointer;
      }
      .timeline-voice-button.is-listening {
        background: #fff0f4;
        color: #d91f55;
      }
      .timeline-command-log {
        display: grid;
        gap: 5px;
        margin-top: 10px;
        color: var(--ink);
        font-size: 0.76rem;
        font-weight: 700;
      }
      .timeline-command-log p {
        margin: 0;
      }
      .embedded-editor-overlay {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 22px;
        background: rgba(8, 6, 18, 0.72);
        backdrop-filter: blur(18px);
      }
      .embedded-editor-overlay[hidden] {
        display: none;
      }
      .embedded-editor-card {
        width: min(1480px, 100%);
        height: min(880px, calc(100vh - 44px));
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.48);
        border-radius: 24px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 28px 90px rgba(0,0,0,0.38);
      }
      .embedded-editor-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 14px 18px;
        border-bottom: 1px solid rgba(5,5,5,0.12);
      }
      .embedded-editor-header h2 {
        margin: 0;
        color: var(--lavender-deep);
        font-size: 1rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .embedded-editor-header p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
      }
      .embedded-editor-frame {
        width: 100%;
        height: 100%;
        border: 0;
        background: #f6f1ff;
      }
      .hero-song-player {
        width: min(720px, 100%);
        margin: 18px auto 0;
      }
      .custom-song-player {
        display: grid;
        grid-template-columns: auto minmax(180px, 1fr) auto auto;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px;
        border: 1px solid rgba(255,255,255,0.58);
        border-radius: 999px;
        background: rgba(255,255,255,0.72);
        box-shadow: 0 18px 42px rgba(25, 16, 58, 0.16);
        backdrop-filter: blur(18px);
      }
      .custom-song-player--inline {
        grid-template-columns: auto minmax(160px, 1fr) auto;
        width: 100%;
        margin-top: 8px;
        border-radius: 22px;
        background: rgba(255,255,255,0.78);
        box-shadow: 0 12px 30px rgba(25, 16, 58, 0.12);
      }
      .custom-song-button,
      .custom-song-unlock {
        min-height: 38px;
        border: 1px solid rgba(123, 62, 230, 0.28);
        border-radius: 999px;
        cursor: pointer;
        font-family: Poppins, Arial, sans-serif;
        font-weight: 800;
        transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
      }
      .custom-song-button {
        min-width: 46px;
        display: inline-grid;
        place-items: center;
        padding: 0 18px;
        color: white;
        background: linear-gradient(135deg, var(--lavender-deep), #a65df2);
        box-shadow: 0 10px 26px rgba(123, 62, 230, 0.22);
      }
      .custom-song-unlock {
        min-width: 92px;
        padding: 0 16px;
        color: var(--lavender-deep);
        background: rgba(255,255,255,0.86);
      }
      .custom-song-button:hover,
      .custom-song-unlock:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(123, 62, 230, 0.18);
      }
      .custom-song-progress {
        width: 100%;
        height: 8px;
        appearance: none;
        border-radius: 999px;
        cursor: pointer;
        background: linear-gradient(90deg, var(--lavender-deep) var(--song-progress, 0%), rgba(123, 62, 230, 0.16) var(--song-progress, 0%));
        outline: none;
      }
      .custom-song-progress::-webkit-slider-thumb {
        appearance: none;
        width: 18px;
        height: 18px;
        border: 3px solid white;
        border-radius: 50%;
        background: var(--lavender-deep);
        box-shadow: 0 4px 12px rgba(25, 16, 58, 0.24);
      }
      .custom-song-progress::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border: 3px solid white;
        border-radius: 50%;
        background: var(--lavender-deep);
        box-shadow: 0 4px 12px rgba(25, 16, 58, 0.24);
      }
      .custom-song-duration {
        color: #5d4a7d;
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0;
        white-space: nowrap;
      }
      /* Minimal timeline polish: quiet surfaces, clear hierarchy, less visual noise. */
      #sectionTimelineEditor .project-panel,
      #sectionTimelineEditor .timeline-section-card,
      #sectionTimelineEditor .timeline-scene-panel,
      #sectionTimelineEditor .timeline-scene-map-card {
        border: 1px solid rgba(36, 28, 55, 0.08);
        background: rgba(255, 255, 255, 0.78);
        box-shadow: 0 8px 24px rgba(18, 14, 32, 0.055);
      }
      #sectionTimelineEditor .timeline-section-header .panel-label,
      #sectionTimelineEditor .timeline-track-label {
        color: rgba(37, 23, 52, 0.72);
        font-size: 0.62rem;
        letter-spacing: 0.04em;
      }
      #sectionTimelineEditor #timelineScenePromptLabel {
        color: var(--lavender-deep);
        font-size: 0.82rem;
        letter-spacing: 0.03em;
      }
      #sectionTimelineEditor .timeline-info {
        width: 20px;
        height: 20px;
        border-color: rgba(37, 23, 52, 0.12);
        background: rgba(255,255,255,0.72);
        color: rgba(37, 23, 52, 0.58);
        font-size: 0.62rem;
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-preview {
        border: 0;
        background: #121018;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
      }
      #sectionTimelineEditor .timeline-tools-inline,
      #sectionTimelineEditor .timeline-workspace,
      #sectionTimelineEditor .timeline-build-progress,
      #sectionTimelineEditor .timeline-start-frame-review,
      #sectionTimelineEditor .timeline-resume-banner {
        border-color: rgba(36, 28, 55, 0.08);
        background: rgba(255,255,255,0.62);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-actions {
        border-color: rgba(36, 28, 55, 0.08);
        background: rgba(250,250,253,0.86);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-icon-button {
        border-color: transparent;
        background: rgba(37, 23, 52, 0.06);
        color: rgba(37, 23, 52, 0.72);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-icon-button.is-primary {
        background: #4f36a6;
        border-color: #4f36a6;
        color: #fff;
      }
      #sectionTimelineEditor .timeline-icon-button.is-danger {
        background: rgba(141, 23, 50, 0.1);
        border-color: transparent;
        color: #8d1732;
      }
      #sectionTimelineEditor .timeline-icon-button:hover,
      #sectionTimelineEditor .timeline-icon-button:focus-visible {
        transform: translateY(-1px);
        outline: 2px solid rgba(79,54,166,0.14);
      }
      #sectionTimelineEditor .timeline-ruler {
        border-bottom-color: rgba(36, 28, 55, 0.1);
        color: rgba(37, 23, 52, 0.52);
      }
      #sectionTimelineEditor .timeline-ruler-tick {
        background: rgba(36, 28, 55, 0.16);
      }
      #sectionTimelineEditor .timeline-ruler-tick.is-major {
        background: rgba(36, 28, 55, 0.32);
      }
      #sectionTimelineEditor .timeline-dropzone,
      #sectionTimelineEditor .timeline-analysis-track {
        border-color: rgba(36, 28, 55, 0.08);
        background:
          linear-gradient(90deg, rgba(36,28,55,0.032) 1px, transparent 1px) 12px 0 / 24px 100%,
          rgba(252,252,255,0.72);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-clip {
        border-color: rgba(79,54,166,0.12);
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(18,14,32,0.055);
      }
      #sectionTimelineEditor .timeline-clip.is-selected {
        border-color: #4f36a6;
        outline: 2px solid rgba(79,54,166,0.12);
        transform: none;
      }
      #sectionTimelineEditor .timeline-clip.is-range-selected {
        border-color: rgba(217,31,85,0.56);
        outline: 2px solid rgba(217,31,85,0.14);
        background: #fff7fa;
      }
      #sectionTimelineEditor .timeline-clip.is-split-part {
        border-color: rgba(217,31,85,0.62);
        background: linear-gradient(180deg, #fff 0%, #fff 64%, #fff1f6 100%);
        box-shadow: 0 7px 0 rgba(217,31,85,0.14), 0 9px 18px rgba(18,14,32,0.08);
      }
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="1"],
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="3"],
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="5"] {
        top: 4px;
      }
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="2"],
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="4"],
      #sectionTimelineEditor .timeline-clip.is-split-part[data-split-part="6"] {
        top: 13px;
      }
      #sectionTimelineEditor .timeline-scene-tile {
        border: 1px solid rgba(36, 28, 55, 0.08);
        background: rgba(255,255,255,0.86);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-scene-tile.is-active {
        border-color: rgba(79,54,166,0.45);
        background: rgba(79,54,166,0.055);
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state] {
        background-image: none;
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="done"] {
        border-color: rgba(18,139,92,0.34);
        background: linear-gradient(135deg, rgba(221,255,238,0.96), rgba(246,255,250,0.96));
        box-shadow: inset 0 0 0 1px rgba(18,139,92,0.12);
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="done"] .timeline-scene-tile-number,
      #sectionTimelineEditor .timeline-scene-tile[data-state="done"] .timeline-scene-tile-status {
        color: #11784f;
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="partial"] {
        border-color: rgba(18,139,92,0.24);
        background: linear-gradient(135deg, rgba(237,255,246,0.96), rgba(246,241,255,0.96));
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="preparing"] {
        border-color: rgba(58,117,175,0.28);
        background: linear-gradient(135deg, rgba(239,247,255,0.96), rgba(255,255,255,0.94));
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="generating"] {
        border-color: rgba(188,111,18,0.4);
        background: linear-gradient(135deg, rgba(255,245,225,0.96), rgba(255,255,255,0.94));
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="prompt"],
      #sectionTimelineEditor .timeline-scene-tile[data-state="frame"],
      #sectionTimelineEditor .timeline-scene-tile[data-state="ready"] {
        border-color: rgba(79,54,166,0.24);
        background: linear-gradient(135deg, rgba(246,241,255,0.96), rgba(255,255,255,0.94));
      }
      #sectionTimelineEditor .timeline-scene-tile[data-state="failed"] {
        border-color: rgba(190,61,61,0.4);
        background: linear-gradient(135deg, rgba(255,239,239,0.96), rgba(255,255,255,0.94));
      }
      #sectionTimelineEditor .timeline-scene-step {
        border-color: rgba(36, 28, 55, 0.08);
        background: rgba(255,255,255,0.72);
      }
      #sectionTimelineEditor .timeline-scene-step.is-done {
        border-color: rgba(18,139,92,0.22);
        background: rgba(18,139,92,0.055);
      }
      #sectionTimelineEditor .timeline-scene-step.is-active {
        border-color: rgba(79,54,166,0.26);
        background: rgba(79,54,166,0.06);
      }
      #sectionTimelineEditor .timeline-scene-settings input,
      #sectionTimelineEditor .timeline-scene-prompt,
      #sectionTimelineEditor .timeline-start-frame-prompt-input,
      #sectionTimelineEditor .timeline-start-frame-preview {
        border: 1px solid rgba(36, 28, 55, 0.1);
        background: rgba(255,255,255,0.88);
        box-shadow: none;
      }
      #sectionTimelineEditor .timeline-scene-prompt:focus,
      #sectionTimelineEditor .timeline-start-frame-prompt-input:focus,
      #sectionTimelineEditor .timeline-scene-settings input:focus {
        border-color: rgba(79,54,166,0.48);
        outline: 3px solid rgba(79,54,166,0.12);
      }
      @media (max-width: 760px) {
        .storyboard-prompt-grid,
        .storyboard-stage-grid,
        .timeline-shell {
          grid-template-columns: 1fr;
        }
        .timeline-preview,
        .timeline-preview video {
          min-height: 210px;
        }
        .timeline-actions {
          display: grid;
          grid-template-columns: repeat(5, minmax(42px, auto));
          justify-content: start;
          width: max-content;
          max-width: 100%;
          overflow-x: auto;
          border-radius: 18px;
        }
        .timeline-flow-card {
          grid-template-columns: 1fr;
          gap: 8px;
          padding: 10px 12px;
        }
        .timeline-flow-actions {
          justify-content: stretch;
          display: grid;
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }
        .timeline-flow-actions .primary-button,
        .timeline-flow-actions .outline-button {
          width: 100%;
          min-height: 34px;
          padding-inline: 8px;
        }
        .timeline-next-step-bar {
          border-radius: 18px;
          align-items: stretch;
        }
        .timeline-next-step-button {
          min-width: 96px;
        }
        .timeline-edit-toolbar {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .timeline-edit-toolbar button,
        .timeline-export-button {
          min-height: 38px;
          padding-inline: 10px;
          font-size: 0.68rem;
        }
        .timeline-workspace {
          border-radius: 12px;
          padding: 10px;
        }
        .timeline-scene-map-card > summary {
          align-items: flex-start;
          flex-direction: column;
        }
        .timeline-scene-map-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .custom-song-player {
          grid-template-columns: auto minmax(0, 1fr) auto;
          border-radius: 22px;
        }
        .custom-song-unlock {
          grid-column: 1 / -1;
        }
        .custom-song-button,
        .custom-song-unlock {
          width: 100%;
        }
        .custom-song-duration {
          font-size: 0.68rem;
        }
        .timeline-command-row {
          grid-template-columns: 1fr;
        }
        .timeline-resume-banner {
          align-items: flex-start;
          flex-direction: column;
        }
        .timeline-resume-actions {
          width: 100%;
          justify-content: stretch;
        }
        .timeline-resume-actions .primary-button,
        .timeline-resume-actions .outline-button {
          flex: 1;
          min-width: 0;
        }
        .timeline-scene-step-strip {
          grid-template-columns: 1fr;
        }
        .timeline-generation-center-main {
          flex-direction: column;
        }
        .timeline-generation-steps {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .workflow-step {
          min-width: 150px;
        }
        .workflow-rail {
          display: flex;
          overflow-x: auto;
          scroll-snap-type: x mandatory;
        }
      }
      @media (min-width: 1024px) {
        body:has(#sectionTimelineEditor.visible) .project-shell {
          width: min(100%, 1480px);
          padding: 8px 14px 14px;
        }
        body:has(#sectionTimelineEditor.visible) .project-nav {
          margin-bottom: 8px;
          padding: 8px 10px;
          border-radius: 16px;
        }
        body:has(#sectionTimelineEditor.visible) #vgHero {
          display: none;
        }
        body:has(#sectionTimelineEditor.visible) .workflow-rail {
          grid-template-columns: repeat(8, minmax(0, 1fr));
          gap: 3px;
          margin: -2px 0 5px;
          padding: 4px;
          border-radius: 999px;
          box-shadow: none;
          background: rgba(255,255,255,0.64);
        }
        body:has(#sectionTimelineEditor.visible) .workflow-step {
          min-height: 22px;
          display: flex;
          justify-content: center;
          gap: 4px;
          padding: 3px 5px;
          border-radius: 999px;
          background: transparent;
          box-shadow: none;
        }
        body:has(#sectionTimelineEditor.visible) .workflow-step-number {
          width: 15px;
          height: 15px;
          border-width: 1px;
          font-size: 0.5rem;
        }
        body:has(#sectionTimelineEditor.visible) .workflow-step strong {
          font-size: 0.48rem;
          line-height: 1;
          white-space: nowrap;
        }
        body:has(#sectionTimelineEditor.visible) .workflow-step span:not(.workflow-step-number) {
          display: none;
        }
        body:has(#sectionTimelineEditor.visible) .project-status-strip {
          gap: 4px;
          margin: 0 0 5px;
        }
        body:has(#sectionTimelineEditor.visible) .project-status-chip {
          min-height: 20px;
          padding: 3px 7px;
          font-size: 0.52rem;
        }
        body:has(#sectionTimelineEditor.visible) .project-status-chip[data-state="ready"],
        body:has(#sectionTimelineEditor.visible) .project-status-chip[data-state="locked"] {
          display: none;
        }
        #sectionTimelineEditor > .project-panel {
          padding: 8px;
          border-radius: 16px;
        }
        #sectionTimelineEditor .timeline-shell {
          grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
          gap: 8px;
          align-items: start;
        }
        #sectionTimelineEditor .timeline-scene-map-card {
          grid-column: 1 / -1;
          margin-bottom: 0;
          border-radius: 12px;
        }
        #sectionTimelineEditor .timeline-flow-card {
          grid-column: 1 / -1;
          min-height: 0;
          padding: 8px 10px;
        }
        #sectionTimelineEditor .timeline-flow-card h2 {
          font-size: 1rem;
        }
        #sectionTimelineEditor .timeline-flow-card p:not(.panel-label) {
          font-size: 0.68rem;
          line-height: 1.2;
        }
        #sectionTimelineEditor .timeline-flow-actions .primary-button,
        #sectionTimelineEditor .timeline-flow-actions .outline-button {
          min-height: 28px;
          padding: 5px 9px;
          font-size: 0.56rem;
        }
        #sectionTimelineEditor .timeline-scene-map-card > summary {
          padding: 7px 10px;
        }
        #sectionTimelineEditor .timeline-scene-map-body {
          padding: 6px 8px 8px;
          overflow-x: auto;
        }
        #sectionTimelineEditor .timeline-scene-map-grid {
          display: flex;
          grid-template-columns: none;
          gap: 5px;
          min-width: max-content;
        }
        #sectionTimelineEditor .timeline-scene-tile {
          flex: 0 0 74px;
          min-height: 46px;
          padding: 6px;
          border-radius: 8px;
        }
        #sectionTimelineEditor .timeline-scene-tile-number {
          font-size: 0.58rem;
        }
        #sectionTimelineEditor .timeline-scene-tile-status {
          margin-top: 2px;
          font-size: 0.52rem;
        }
        #sectionTimelineEditor .timeline-scene-tile-time {
          display: none;
        }
        #sectionTimelineEditor .timeline-next-guidance {
          margin-top: 6px;
          padding: 6px 8px;
          font-size: 0.62rem;
          line-height: 1.25;
        }
        #sectionTimelineEditor .timeline-preview-card {
          grid-column: 1;
          padding: 8px;
          border-radius: 14px;
        }
        #sectionTimelineEditor .timeline-prompt-card {
          grid-column: 2;
          align-self: stretch;
          padding: 8px;
          border-radius: 14px;
        }
        #sectionTimelineEditor .timeline-section-header {
          margin-bottom: 4px;
        }
        #sectionTimelineEditor .timeline-preview {
          min-height: 0;
          height: clamp(190px, 28vh, 300px);
          aspect-ratio: auto;
          border-radius: 14px 14px 0 0;
        }
        #sectionTimelineEditor .timeline-preview video {
          min-height: 0;
          height: 100%;
        }
        #sectionTimelineEditor .timeline-tools-inline {
          padding: 4px;
        }
        #sectionTimelineEditor .timeline-tools-inline .timeline-section-header {
          display: none;
        }
        #sectionTimelineEditor .timeline-actions {
          gap: 4px;
          padding: 3px;
        }
        #sectionTimelineEditor .timeline-icon-button {
          width: 30px;
          height: 30px;
          font-size: 0.78rem;
        }
        #sectionTimelineEditor .timeline-tracks-inline {
          margin-top: 6px;
          padding-top: 6px;
        }
        #sectionTimelineEditor .timeline-workspace {
          padding: 6px;
        }
        #sectionTimelineEditor .timeline-ruler {
          height: 22px;
          margin-bottom: 4px;
        }
        #sectionTimelineEditor .timeline-ruler-label {
          bottom: 13px;
          font-size: 0.5rem;
        }
        #sectionTimelineEditor .timeline-dropzone {
          min-height: 44px;
          margin-bottom: 5px;
        }
        #sectionTimelineEditor #audioTimelineTrack.timeline-dropzone {
          min-height: 20px;
        }
        #sectionTimelineEditor #videoTimelineTrack .timeline-clip:not(.audio) {
          top: 5px;
          min-height: 46px;
          padding: 5px 10px 6px;
        }
        #sectionTimelineEditor .timeline-clip.audio {
          min-height: 11px;
          top: 4px;
        }
        #sectionTimelineEditor .timeline-analysis-row {
          margin-top: 4px;
        }
        #sectionTimelineEditor .timeline-analysis-toggle {
          min-height: 20px;
          padding: 2px 7px;
          font-size: 0.56rem;
        }
        #sectionTimelineEditor .timeline-editor-note,
        #sectionTimelineEditor #timelineLastSaveStatus {
          display: none;
        }
        #sectionTimelineEditor #timelineStatus {
          min-height: 0;
          margin: 4px 0 0;
          font-size: 0.62rem;
          line-height: 1.25;
        }
        #sectionTimelineEditor .timeline-scene-step-strip {
          gap: 5px;
          margin-bottom: 6px;
        }
        #sectionTimelineEditor .timeline-scene-step {
          min-height: 40px;
          padding: 6px;
          border-radius: 10px;
        }
        #sectionTimelineEditor .timeline-scene-step strong,
        #sectionTimelineEditor .timeline-scene-step span {
          font-size: 0.56rem;
          line-height: 1.1;
        }
        #sectionTimelineEditor .timeline-scene-settings {
          gap: 6px;
          margin-bottom: 6px;
        }
        #sectionTimelineEditor .timeline-scene-settings label {
          gap: 3px;
          font-size: 0.58rem;
        }
        #sectionTimelineEditor .timeline-scene-settings input {
          min-height: 32px;
          padding: 6px 8px;
          border-radius: 10px;
          font-size: 0.72rem;
        }
        #sectionTimelineEditor .timeline-start-frame-review {
          gap: 6px;
          margin-top: 6px;
          padding: 7px;
          border-radius: 12px;
        }
	        #sectionTimelineEditor .timeline-start-frame-preview {
	          min-height: 170px;
	        }
	        #sectionTimelineEditor .timeline-start-frame-preview img {
	          max-height: 260px;
	        }
        #sectionTimelineEditor .timeline-start-frame-actions,
        #sectionTimelineEditor .timeline-scene-panel-actions,
        #sectionTimelineEditor .timeline-debug-actions {
          gap: 5px;
          margin-top: 6px;
        }
        #sectionTimelineEditor .timeline-start-frame-actions .primary-button,
        #sectionTimelineEditor .timeline-start-frame-actions .outline-button,
        #sectionTimelineEditor .timeline-scene-panel-actions .primary-button,
        #sectionTimelineEditor .timeline-scene-panel-actions .outline-button,
        #sectionTimelineEditor .timeline-debug-actions .outline-button {
          min-height: 30px;
          padding: 6px 9px;
          font-size: 0.58rem;
        }
        #sectionTimelineEditor .timeline-scene-prompt {
          min-height: 112px;
          max-height: 20vh;
          padding: 8px;
          border-radius: 12px;
          font-size: 0.72rem;
          line-height: 1.35;
        }
        #sectionTimelineEditor .scene-replace-hint {
          display: none;
        }
      }
      @media (max-width: 600px) {
        .opening-journey { grid-template-columns: 1fr 1fr; }
        .opening-journey-step { padding: 9px; }
      }
    
/* Global Divyaverse button capitalization */
button,
[role="button"],
.primary-button,
.outline-button,
.compact-button,
.cta-button,
.ghost-button,
.idea-button,
.nav-link,
.dashboard-link-button,
.calendar-toggle,
.calendar-details-button,
.calendar-start-button,
.calendar-asset-button,
.calendar-video-link,
.calendar-song-link,
.festival-calendar-button,
.festival-vault-button,
.timeline-export-button,
.timeline-icon-button,
.timeline-add-scene-button,
.timeline-voice-button,
.custom-song-button,
.vg-modal-actions button,
.grokbot-guide-actions button {
  text-transform: uppercase !important;
}

/* Global Divyaverse button capitalization final override */
button,
[role="button"],
.primary-button,
.outline-button,
.compact-button,
.cta-button,
.ghost-button,
.idea-button,
.nav-link,
.dashboard-link-button,
.calendar-toggle,
.calendar-details-button,
.calendar-start-button,
.calendar-asset-button,
.calendar-video-link,
.calendar-song-link,
.festival-calendar-button,
.festival-vault-button,
.timeline-export-button,
.timeline-icon-button,
.timeline-add-scene-button,
.timeline-voice-button,
.custom-song-button,
.vg-modal-actions button,
.grokbot-guide-actions button {
  text-transform: uppercase !important;
}

button.is-click-locked,
a.is-click-locked,
[role="button"].is-click-locked {
  cursor: progress !important;
  filter: saturate(0.88);
}

.videogen-floating-previous-step {
  left: max(14px, env(safe-area-inset-left));
  bottom: max(118px, calc(env(safe-area-inset-bottom) + 118px));
  z-index: 9001;
}

body.dv-tools-collapsed .videogen-floating-previous-step {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
}

      /* Mobile optimization for VideoGen, QuickGen, storyboard, and timeline surfaces. */
      @media (max-width: 760px) {
        html,
        body {
          max-width: 100%;
          overflow-x: hidden;
        }

        body {
          background-attachment: scroll, scroll;
        }

        button,
        input,
        select,
        textarea {
          font-size: max(16px, 1rem);
        }

        #vgHero {
          grid-template-columns: 1fr !important;
          gap: 8px;
          padding: 12px !important;
          text-align: left;
        }

        #vgHero h1 {
          font-size: clamp(1.2rem, 7vw, 2rem);
          line-height: 1.08;
          overflow-wrap: anywhere;
        }

        #vgHero p:not(.eyebrow) {
          font-size: 0.72rem;
          line-height: 1.35;
        }

        .workflow-rail {
          display: flex;
          gap: 8px;
          width: 100%;
          margin: 0 0 14px;
          padding: 10px;
          overflow-x: auto;
          scroll-snap-type: x proximity;
          border-radius: 0;
          -webkit-overflow-scrolling: touch;
        }

        .workflow-step {
          flex: 0 0 min(230px, 72vw);
          min-height: 66px;
          scroll-snap-align: start;
        }

        .project-status-strip {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 7px;
        }

        .project-status-chip {
          justify-content: center;
          min-width: 0;
          min-height: 38px;
          border-radius: 12px;
          text-align: center;
          white-space: normal;
          line-height: 1.2;
        }

        .vg-overlay {
          align-items: stretch;
          justify-content: stretch;
          padding: 10px;
        }

        .vg-modal,
        .vg-overlay.is-quickgen-context .vg-modal {
          width: 100%;
          max-height: calc(100dvh - 20px);
          overflow: auto;
          border-width: 3px;
          border-radius: 18px;
          padding: 18px;
        }

        #quickGenPreProductionOverlay .quickgen-preprod-modal {
          width: 100% !important;
          max-height: calc(100dvh - 20px);
          overflow: auto;
          padding: 14px;
        }

        .quickgen-preprod-modal #quickGenPreProductionCopy {
          font-size: 0.76rem;
          line-height: 1.35;
          margin-bottom: 8px;
        }

        .quickgen-preprod-modal .quickgen-preprod {
          gap: 8px;
        }

        .quickgen-preprod-modal .quickgen-preprod-step {
          padding: 8px;
          font-size: 0.62rem;
        }

        .quickgen-preprod-modal .quickgen-preprod-panel {
          grid-template-columns: 1fr;
          gap: 8px;
        }

        .quickgen-preprod-modal .quickgen-preprod-guide {
          max-height: 22dvh;
          padding: 10px;
        }

        .quickgen-preprod-modal .quickgen-preprod-guide p,
        .quickgen-preprod-modal .quickgen-preprod-guide pre,
        .quickgen-preprod-modal .quickgen-preprod-mini,
        .quickgen-preprod-modal .save-status {
          font-size: 0.7rem;
          line-height: 1.35;
        }

        .quickgen-preprod-modal .quickgen-preprod-panel textarea {
          min-height: 26dvh;
          height: 26dvh;
        }

        .quickgen-preprod-modal .vg-modal-actions {
          position: sticky;
          bottom: -1px;
          z-index: 3;
          display: grid !important;
          grid-template-columns: 1fr;
          gap: 8px;
          padding-top: 8px;
          background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.96) 28%);
          border-radius: 14px;
        }

        .quickgen-preprod-modal .quickgen-autosuggest-help {
          font-size: 0.66rem;
          line-height: 1.25;
        }

        #quickGenCharacterLockOverlay {
          align-items: center;
          justify-content: center;
          padding: 8px;
        }

        #quickGenCharacterLockOverlay .vg-modal {
          width: min(100%, calc(100vw - 16px)) !important;
          max-height: calc(100dvh - 16px);
          padding: 12px;
          border-radius: 16px;
        }

        #quickGenCharacterLockOverlay .vg-modal-eyebrow {
          margin-bottom: 4px;
          font-size: 0.62rem;
        }

        #quickGenCharacterLockOverlay .vg-modal h2 {
          font-size: clamp(1.04rem, 5.6vw, 1.32rem);
          margin-bottom: 6px;
        }

        #quickGenCharacterLockOverlay .vg-modal > p:not(.vg-modal-eyebrow):not(.save-status) {
          margin-bottom: 8px;
          font-size: 0.72rem;
          line-height: 1.35;
        }

        #quickGenCharacterLockOverlay .character-lock-layout {
          gap: 8px;
          margin-top: 8px;
        }

        #quickGenCharacterLockOverlay .character-lock-layout textarea {
          min-height: 82px;
          max-height: 18dvh;
          font-size: 0.76rem;
        }

        #quickGenCharacterLockOverlay #quickGenCharacterBibleInput {
          display: none;
        }

        #quickGenCharacterLockOverlay .character-lock-preview {
          max-height: 34dvh;
          padding: 9px;
          gap: 8px;
        }

        #quickGenCharacterLockOverlay .character-lock-section,
        #quickGenCharacterLockOverlay .character-lock-card {
          padding: 10px;
          border-radius: 13px;
        }

        #quickGenCharacterLockOverlay .character-lock-card h3 {
          font-size: 1.08rem;
        }

        #quickGenCharacterLockOverlay .character-lock-card p,
        #quickGenCharacterLockOverlay .character-lock-notes li,
        #quickGenCharacterLockOverlay .character-lock-decision-list li {
          font-size: 0.72rem;
          line-height: 1.42;
        }

        #quickGenCharacterLockOverlay .character-lock-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
          gap: 8px;
          max-height: 42dvh;
        }

        #quickGenCharacterLockOverlay .character-lock-sample {
          padding: 6px;
          border-radius: 12px;
        }

        #quickGenCharacterLockOverlay .character-lock-sample img {
          min-height: clamp(118px, 32vw, 176px);
          max-height: 42vw;
          object-fit: contain;
        }

        #quickGenCharacterLockOverlay .character-lock-sample span {
          font-size: 0.58rem;
          letter-spacing: 0.04em;
        }

        #quickGenCharacterLockOverlay .quickgen-character-revision {
          margin-top: 8px;
          padding: 8px;
        }

        #quickGenCharacterLockOverlay .quickgen-character-revision textarea {
          min-height: 68px;
          max-height: 14dvh;
          font-size: 0.74rem;
        }

        #quickGenCharacterLockOverlay .vg-modal-actions {
          justify-content: center;
          gap: 7px;
          padding-top: 8px;
        }

        #quickGenCharacterLockOverlay .vg-modal-actions .primary-button,
        #quickGenCharacterLockOverlay .vg-modal-actions .outline-button {
          flex-basis: min(100%, 320px);
          width: min(100%, 320px);
        }

        .vg-modal h2,
        .quickgen-card h2 {
          font-size: clamp(1.18rem, 6vw, 1.65rem);
          line-height: 1.12;
        }

        .vg-modal-actions,
        .quickgen-actions,
        .storyboard-actions,
        .storyboard-review-actions,
        .storyboard-scene-save,
        .timeline-edit-toolbar,
        .timeline-command-panel,
        .timeline-duration-control {
          display: grid !important;
          grid-template-columns: 1fr;
          align-items: stretch;
          gap: 8px;
        }

        .vg-modal-actions button,
        .quickgen-actions button,
        .storyboard-actions button,
        .storyboard-review-actions button,
        .timeline-edit-toolbar button,
        .timeline-command-panel button,
        .primary-button,
        .outline-button {
          width: 100%;
          min-width: 0;
          min-height: 44px;
          white-space: normal;
          line-height: 1.15;
          overflow-wrap: anywhere;
        }

        .character-lock-grid,
        .quickgen-style-grid,
        .quickgen-preprod-steps,
        .storyboard-stage-grid,
        .storyboard-prompt-grid,
        .video-mode-grid {
          grid-template-columns: 1fr !important;
        }

        .character-lock-sample img,
        .quickgen-style-choice .style-tile-img,
        .quickgen-style-thumb,
        .storyboard-stage-box img,
        .storyboard-stage-box video {
          max-height: 56vw;
          object-fit: cover;
        }

        #quickGenCharacterLockOverlay .character-lock-sample img {
          object-fit: contain;
        }

        .quickgen-overlay {
          padding: 10px;
        }

        .quickgen-card {
          width: 100%;
          max-height: calc(100dvh - 20px);
          overflow: auto;
          border-radius: 18px;
          padding: 16px;
        }

        .quickgen-ready-track {
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
          overflow: visible;
          padding-bottom: 8px;
        }

        .quickgen-ready-card {
          scroll-snap-align: start;
        }

        .quickgen-preview {
          display: none;
          min-height: 0;
        }

        .quickgen-song-title {
          width: 100%;
          justify-content: center;
          border-radius: 14px;
          text-align: center;
          font-size: 0.72rem;
        }

        .storyboard-title {
          font-size: clamp(1.2rem, 7vw, 1.8rem);
          line-height: 1.12;
          overflow-wrap: anywhere;
        }

        .storyboard-input-wrap textarea,
        #userStoryboardInput,
        .quickgen-preprod-panel textarea,
        .character-lock-layout textarea,
        #timelineScenePrompt {
          min-height: 180px;
          font-size: 16px;
          line-height: 1.6;
        }

        .timeline-shell {
          grid-template-columns: 1fr;
          gap: 10px;
        }

        .timeline-section-card {
          border-radius: 14px;
          padding: 10px;
        }

        .timeline-preview {
          min-height: 190px;
          border-radius: 14px;
        }

        .timeline-preview video {
          min-height: 190px;
        }

        .timeline-workspace {
          margin-inline: -4px;
          padding: 10px;
          overflow-x: auto;
          -webkit-overflow-scrolling: touch;
        }

        .timeline-ruler,
        .timeline-dropzone,
        .timeline-analysis-track {
          min-width: 760px;
        }

        .timeline-info::after {
          right: auto;
          left: 50%;
          width: min(260px, 84vw);
          transform: translate(-50%, -4px);
        }

        .timeline-info:hover::after,
        .timeline-info:focus-visible::after {
          transform: translate(-50%, 0);
        }

        .timeline-next-step,
        #timelineNextStepBar {
          display: none !important;
        }

        .style-picker {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 10px;
        }

        .style-tile {
          width: 100%;
        }
      }

      @media (max-width: 420px) {
        #vgHero,
        .timeline-section-card,
        .quickgen-card,
        .vg-modal {
          padding: 12px;
        }

        .project-status-strip,
        .style-picker {
          grid-template-columns: 1fr;
        }

        .workflow-step {
          flex-basis: 82vw;
        }

        .timeline-ruler,
        .timeline-dropzone,
        .timeline-analysis-track {
          min-width: 640px;
        }
      }

      .timeline-render-history {
        margin: 10px 0 14px;
        border: 1px solid rgba(124, 72, 215, 0.24);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.86);
        padding: 10px 12px;
      }

      .timeline-render-history summary {
        cursor: pointer;
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #6b46c1;
      }

      .timeline-render-history-list {
        display: grid;
        gap: 8px;
        margin-top: 10px;
      }

      .timeline-render-history-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border-top: 1px solid rgba(24, 18, 43, 0.08);
        padding-top: 8px;
        font-size: 0.82rem;
        color: #4b4560;
      }

      .timeline-render-history-item a {
        color: #5b2fd8;
        font-weight: 900;
        text-decoration: none;
        white-space: nowrap;
      }

      /* Final responsive button polish for the VideoGen work surfaces. */
      #sectionTimelineEditor .timeline-actions {
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
      }

      #sectionTimelineEditor .timeline-flow-actions,
      #sectionTimelineEditor .timeline-start-frame-actions,
      #sectionTimelineEditor .timeline-scene-panel-actions,
      #sectionTimelineEditor .timeline-debug-actions,
      #sectionTimelineEditor .timeline-save-continue-row,
      #sectionTimelineEditor .timeline-resume-actions {
        display: grid;
        align-items: stretch;
      }

      #sectionTimelineEditor .timeline-flow-actions {
        grid-template-columns: 1fr;
        min-width: 0;
      }

      #sectionTimelineEditor .timeline-start-frame-actions,
      #sectionTimelineEditor .timeline-scene-panel-actions,
      #sectionTimelineEditor .timeline-debug-actions,
      #sectionTimelineEditor .timeline-resume-actions {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      }

      #sectionTimelineEditor .timeline-save-continue-row {
        grid-template-columns: minmax(190px, 320px);
        justify-content: center;
      }

      #sectionTimelineEditor .timeline-flow-actions .primary-button,
      #sectionTimelineEditor .timeline-flow-actions .outline-button,
      #sectionTimelineEditor .timeline-start-frame-actions .primary-button,
      #sectionTimelineEditor .timeline-start-frame-actions .outline-button,
      #sectionTimelineEditor .timeline-scene-panel-actions .primary-button,
      #sectionTimelineEditor .timeline-scene-panel-actions .outline-button,
      #sectionTimelineEditor .timeline-debug-actions .primary-button,
      #sectionTimelineEditor .timeline-debug-actions .outline-button,
      #sectionTimelineEditor .timeline-resume-actions .primary-button,
      #sectionTimelineEditor .timeline-resume-actions .outline-button,
	      #sectionTimelineEditor .timeline-save-continue-row .primary-button,
	      #sectionTimelineEditor .timeline-save-continue-row .outline-button {
	        width: 100%;
	        min-width: 0;
	        white-space: normal;
	        overflow-wrap: anywhere;
	      }

	      @media (min-width: 1024px) {
	        body:has(#sectionTimelineEditor.visible) .project-shell {
	          width: min(98vw, 1920px);
	          max-width: 98vw;
	          padding: 6px 10px 10px;
	        }

	        body:has(#sectionTimelineEditor.visible) .project-nav {
	          margin-bottom: 6px;
	          padding: 7px 9px;
	        }

	        body:has(#sectionTimelineEditor.visible) .workflow-rail {
	          margin-bottom: 4px;
	        }

	        #sectionTimelineEditor > .project-panel {
	          width: 100%;
	          max-width: none;
	          max-height: calc(100dvh - 118px);
	          overflow: auto;
	          padding: 7px;
	        }

	        #sectionTimelineEditor .timeline-shell {
	          grid-template-columns: minmax(0, 1.56fr) minmax(330px, 0.74fr);
	          gap: 8px;
	        }

	        #sectionTimelineEditor .timeline-scene-map-card,
	        #sectionTimelineEditor .timeline-flow-card {
	          grid-column: 1 / -1;
	        }

	        #sectionTimelineEditor .timeline-scene-map-card > summary {
	          min-height: 30px;
	          padding: 6px 9px;
	        }

	        #sectionTimelineEditor .timeline-scene-map-body {
	          padding: 5px 7px 7px;
	        }

	        #sectionTimelineEditor .timeline-scene-map-grid {
	          display: flex;
	          grid-template-columns: none;
	          gap: 5px;
	          min-width: max-content;
	        }

	        #sectionTimelineEditor .timeline-scene-tile {
	          flex: 0 0 70px;
	          min-height: 42px;
	          padding: 5px 6px;
	        }

	        #sectionTimelineEditor .timeline-next-guidance {
	          margin-top: 5px;
	          padding: 5px 7px;
	          font-size: 0.6rem;
	          line-height: 1.2;
	        }

	        #sectionTimelineEditor .timeline-flow-card {
	          grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
	          gap: 8px;
	          padding: 7px 9px;
	        }

	        #sectionTimelineEditor .timeline-publish-checklist {
	          grid-template-columns: repeat(4, minmax(0, 1fr));
	          gap: 5px;
	          margin-top: 6px;
	        }

	        #sectionTimelineEditor .timeline-publish-check {
	          min-height: 42px;
	          padding: 6px 7px;
	          font-size: 0.56rem;
	        }

	        #sectionTimelineEditor .timeline-flow-actions {
	          min-width: min(420px, 100%);
	          gap: 6px;
	        }

	        #sectionTimelineEditor .timeline-preview-card,
	        #sectionTimelineEditor .timeline-prompt-card {
	          padding: 7px;
	        }

	        #sectionTimelineEditor .timeline-preview {
	          height: clamp(215px, 31dvh, 360px);
	          min-height: 0;
	          aspect-ratio: auto;
	        }

	        #sectionTimelineEditor .timeline-preview video {
	          min-height: 0;
	          height: 100%;
	        }

	        #sectionTimelineEditor .timeline-tracks-inline {
	          margin-top: 5px;
	          padding-top: 5px;
	        }

	        #sectionTimelineEditor .timeline-workspace {
	          padding: 6px;
	        }

	        #sectionTimelineEditor .timeline-ruler {
	          height: 20px;
	          margin-bottom: 4px;
	        }

	        #sectionTimelineEditor .timeline-ruler-label {
	          bottom: 12px;
	          font-size: 0.48rem;
	        }

        #sectionTimelineEditor .timeline-dropzone {
          min-height: 40px;
          margin-bottom: 5px;
        }
        #sectionTimelineEditor #videoTimelineTrack.timeline-dropzone {
          min-height: 64px;
        }
        #sectionTimelineEditor #videoTimelineTrack.timeline-dropzone .timeline-clip:not(.audio) {
          top: 8px;
          min-height: 46px;
          padding: 5px 10px 6px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          gap: 2px;
          text-align: center;
        }

        #sectionTimelineEditor #audioTimelineTrack.timeline-dropzone,
	        #sectionTimelineEditor .timeline-analysis-track {
	          min-height: 18px;
	          margin-bottom: 5px;
	        }

	        #sectionTimelineEditor .timeline-analysis-row {
	          margin-top: 4px;
	        }

	        #sectionTimelineEditor .timeline-tools-inline {
	          margin-top: -1px;
	          padding: 4px;
	        }

	        #sectionTimelineEditor .timeline-tools-inline .timeline-section-header {
	          display: none;
	        }

	        #sectionTimelineEditor .timeline-actions {
	          gap: 4px;
	          padding: 3px;
	        }

	        #sectionTimelineEditor .timeline-icon-button {
	          width: 30px;
	          height: 30px;
	          font-size: 0.76rem;
	        }

	        #sectionTimelineEditor .timeline-prompt-card {
	          max-height: calc(100dvh - 190px);
	          overflow: auto;
	        }

	        #sectionTimelineEditor .timeline-scene-step-strip {
	          gap: 5px;
	          margin-bottom: 6px;
	        }

	        #sectionTimelineEditor .timeline-scene-step {
	          min-height: 40px;
	          padding: 6px;
	        }

	        #sectionTimelineEditor .timeline-scene-settings {
	          gap: 6px;
	          margin-bottom: 6px;
	        }

	        #sectionTimelineEditor .timeline-scene-settings label {
	          gap: 3px;
	          font-size: 0.58rem;
	        }

	        #sectionTimelineEditor .timeline-scene-settings input {
	          min-height: 31px;
	          padding: 5px 8px;
	          font-size: 0.72rem;
	        }

	        #sectionTimelineEditor .timeline-start-frame-review {
	          gap: 6px;
	          margin-top: 6px;
	          padding: 7px;
	        }

	        #sectionTimelineEditor .timeline-start-frame-preview {
	          min-height: clamp(132px, 22dvh, 230px);
	        }

	        #sectionTimelineEditor .timeline-start-frame-preview img {
	          max-height: 230px;
	        }

	        #sectionTimelineEditor .scene-replace-hint,
	        #sectionTimelineEditor .timeline-save-continue-row .quickgen-continue-note {
	          display: none;
	        }

	        #sectionTimelineEditor .timeline-save-continue-row {
	          margin-top: 10px;
	          padding-top: 6px;
	          gap: 6px;
	        }
	      }

	      @media (max-width: 760px) {
	        #sectionTimelineEditor .timeline-actions {
	          grid-auto-flow: column;
          grid-auto-columns: 32px;
          grid-template-columns: none;
          width: 100%;
          justify-content: start;
          overflow-x: auto;
          scrollbar-width: thin;
        }

        #sectionTimelineEditor .timeline-flow-actions {
          min-width: 0;
          grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        #sectionTimelineEditor .timeline-start-frame-actions,
        #sectionTimelineEditor .timeline-scene-panel-actions,
        #sectionTimelineEditor .timeline-debug-actions,
        #sectionTimelineEditor .timeline-resume-actions {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

	      @media (max-width: 430px) {
	        #sectionTimelineEditor .timeline-flow-actions,
	        #sectionTimelineEditor .timeline-start-frame-actions,
	        #sectionTimelineEditor .timeline-scene-panel-actions,
	        #sectionTimelineEditor .timeline-debug-actions,
	        #sectionTimelineEditor .timeline-resume-actions {
	          grid-template-columns: 1fr;
	        }
	      }

      /* Guided creator mode wins over older compact timeline editor rules. */
      #sectionTimelineEditor .timeline-flow-card {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) !important;
        gap: 16px !important;
        padding: 16px !important;
      }

      #sectionTimelineEditor .timeline-guide-progress {
        display: grid;
      }

      #sectionTimelineEditor .timeline-publish-checklist,
      #sectionTimelineEditor .timeline-add-scene-button {
        display: none !important;
      }

      #sectionTimelineEditor #timelineFinalVideoPrePublishButton {
        display: none !important;
      }

      #sectionTimelineEditor .timeline-flow-actions {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        min-width: min(320px, 100%) !important;
      }

      #sectionTimelineEditor .timeline-flow-actions #timelinePrimaryFlowButton {
        min-height: 52px !important;
        padding: 13px 30px !important;
        border-radius: 999px;
        font-size: 1.09rem !important;
        box-shadow:
          0 14px 30px rgba(91, 44, 204, 0.24),
          0 0 0 4px rgba(123, 62, 230, 0.08);
      }

      #sectionTimelineEditor .timeline-flow-actions #timelinePrimaryFlowButton[data-flow-action="next-scene"] {
        min-width: min(360px, 100%);
      }

      @media (max-width: 760px) {
        #sectionTimelineEditor .timeline-flow-card {
          grid-template-columns: 1fr !important;
        }

        #sectionTimelineEditor .timeline-guide-progress {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      @media (max-width: 430px) {
        #sectionTimelineEditor .timeline-guide-progress {
          grid-template-columns: 1fr;
        }
      }

      #sectionTimelineEditor .timeline-preview,
      #sectionTimelineEditor .timeline-workspace,
      #sectionTimelineEditor .timeline-start-frame-preview {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto !important;
      }

      #sectionTimelineEditor .timeline-preview {
        min-height: 0 !important;
        border-radius: 14px 14px 0 0;
      }

      #sectionTimelineEditor .timeline-preview video {
        width: 100%;
        height: 100%;
        min-height: 0 !important;
        object-fit: contain;
      }

      #sectionTimelineEditor .timeline-workspace {
        min-height: 0;
        max-height: min(38vh, 360px);
      }

      #sectionTimelineEditor .timeline-start-frame-preview {
        min-height: 0 !important;
        max-height: none;
      }

      #sectionTimelineEditor .timeline-start-frame-preview img {
        width: 100%;
        height: 100%;
        max-height: none !important;
        object-fit: cover;
      }

      #sectionTimelineEditor .timeline-clip.is-resume-placeholder {
        box-shadow: inset 0 0 0 1px rgba(123,62,230,0.12);
      }

      #sectionTimelineEditor .timeline-clip.is-resume-placeholder[data-status="pending"] {
        opacity: 0.68;
        border-style: dashed;
      }

      #sectionTimelineEditor #approveStartFrameButton {
        min-height: 44px;
        padding: 12px 18px;
        font-size: 0.82rem;
        font-weight: 950;
      }

      @media (min-width: 1024px) {
        #sectionTimelineEditor .timeline-shell {
          align-items: stretch;
        }
        #sectionTimelineEditor .timeline-prompt-card {
          min-height: calc(100dvh - 132px);
          max-height: none !important;
          overflow: visible !important;
        }
        #sectionTimelineEditor .timeline-start-frame-prompt-input {
          min-height: clamp(190px, 28dvh, 360px);
          max-height: none;
        }
        #sectionTimelineEditor .timeline-veo-prompt-input {
          min-height: clamp(220px, 32dvh, 420px);
          max-height: none;
        }
      }

      /* Duo timeline viewport: keep the workspace compact but allow page scrolling. */
      @media (min-width: 1024px) {
        body:has(#sectionTimelineEditor.visible) {
          overflow-x: hidden;
          overflow-y: auto;
        }

        body:has(#sectionTimelineEditor.visible) .project-shell {
          min-height: 100dvh;
          height: auto;
          overflow: visible;
        }

        #sectionTimelineEditor {
          min-height: 0;
        }

        #sectionTimelineEditor > .project-panel {
          min-height: calc(100dvh - 112px);
          height: auto;
          max-height: none;
          overflow: visible !important;
        }

        #sectionTimelineEditor .timeline-shell {
          min-height: calc(100dvh - 132px);
          height: auto;
          grid-template-rows: auto auto minmax(0, 1fr);
          align-content: start;
          overflow: visible;
        }

        #sectionTimelineEditor .timeline-scene-map-card > summary {
          min-height: 24px;
          padding: 4px 8px;
        }

        #sectionTimelineEditor .timeline-scene-map-body {
          display: none;
        }

        #sectionTimelineEditor .timeline-flow-card {
          min-height: 0;
          grid-template-columns: minmax(0, 1fr) minmax(230px, 280px) !important;
          gap: 8px !important;
          padding: 7px 10px !important;
        }

        #sectionTimelineEditor .timeline-flow-card h2 {
          margin: 1px 0 2px;
          font-size: 0.9rem;
          line-height: 1.05;
        }

        #sectionTimelineEditor .timeline-flow-card p:not(.panel-label) {
          font-size: 0.6rem;
          line-height: 1.15;
        }

        #sectionTimelineEditor .timeline-guide-progress {
          display: none;
        }

        #sectionTimelineEditor .timeline-flow-actions {
          min-width: 0 !important;
          gap: 5px !important;
        }

        #sectionTimelineEditor .timeline-flow-actions .primary-button,
        #sectionTimelineEditor .timeline-flow-actions .outline-button {
          min-height: 26px;
          padding: 5px 8px;
          font-size: 0.54rem;
        }

        #sectionTimelineEditor .timeline-flow-actions #timelinePrimaryFlowButton {
          min-height: 44px !important;
          padding: 10px 16px !important;
          font-size: 0.88rem !important;
        }

        #sectionTimelineEditor .timeline-preview-card,
        #sectionTimelineEditor .timeline-prompt-card {
          min-height: 0;
          max-height: 100%;
          overflow: hidden;
        }

        #sectionTimelineEditor .timeline-preview-card {
          display: flex;
          flex-direction: column;
        }

        #sectionTimelineEditor .timeline-preview-card > .timeline-section-header {
          display: none;
        }

        #sectionTimelineEditor .timeline-preview {
          flex: 0 0 clamp(130px, 19dvh, 210px);
          height: clamp(130px, 19dvh, 210px) !important;
        }

        #sectionTimelineEditor .timeline-tools-inline {
          flex: 0 0 auto;
        }

        #sectionTimelineEditor .timeline-tracks-inline {
          flex: 1 1 auto;
          min-height: 0;
          margin-top: 4px;
          padding-top: 4px;
          overflow: hidden;
        }

        #sectionTimelineEditor .timeline-tracks-inline > .timeline-section-header {
          min-height: 20px;
          margin-bottom: 3px;
        }

        #sectionTimelineEditor .timeline-tracks-inline > .timeline-section-header .panel-label {
          font-size: 0.56rem;
        }

        #sectionTimelineEditor .timeline-workspace {
          height: clamp(520px, 58dvh, 760px) !important;
          max-height: clamp(520px, 58dvh, 760px) !important;
          aspect-ratio: auto !important;
          overflow: auto;
          padding: 5px;
        }

        #sectionTimelineEditor #videoTimelineTrack.timeline-dropzone {
          min-height: 76px;
        }

        #sectionTimelineEditor #audioTimelineTrack.timeline-dropzone {
          min-height: 34px;
        }

        #sectionTimelineEditor .timeline-analysis-track {
          min-height: 28px;
        }

        #sectionTimelineEditor .timeline-loop-toolbar {
          position: sticky;
          top: 0;
          z-index: 8;
          min-width: max-content;
          background: rgba(255,255,255,0.94);
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
        }

        #sectionTimelineEditor .duo-timeline-health,
        #sectionTimelineEditor .duo-timeline-minimap {
          max-height: 36px;
          overflow: hidden;
        }

        #sectionTimelineEditor .timeline-production-toolkit {
          max-height: 52px;
          overflow: auto;
        }

        #sectionTimelineEditor .timeline-prompt-card {
          overflow: auto !important;
        }
      }
      #sectionTimelineEditor .timeline-preview-card .timeline-preview {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        width: min(100%, 960px, 81.777dvh) !important;
        height: min(56.25vw, 46dvh, 540px) !important;
        aspect-ratio: 16 / 9 !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-inline: auto;
      }
      #sectionTimelineEditor .timeline-preview-card {
        max-height: none !important;
        overflow: visible !important;
      }
      #sectionTimelineEditor .timeline-preview-card .timeline-preview video {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        aspect-ratio: 16 / 9 !important;
        object-fit: contain !important;
      }
      #sectionTimelineEditor #timelineResumeBanner {
        display: none !important;
      }
      @media (min-width: 1024px) {
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .project-shell {
          padding-top: 4px;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .project-nav {
          min-height: 0;
          margin-bottom: 3px;
          padding: 5px 8px;
          border-radius: 14px;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .workflow-rail {
          min-height: 0;
          margin: -4px 0 4px;
          padding: 3px;
          gap: 3px;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .workflow-step {
          min-height: 18px;
          padding: 2px 4px;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .workflow-step-number {
          width: 14px;
          height: 14px;
          font-size: 0.46rem;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .workflow-step strong {
          font-size: 0.46rem;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .chosen-style-indicator,
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .project-status-strip {
          display: none !important;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .videogen-step-back-row {
          margin: -3px 0 5px;
        }
        body:has(#sectionTimelineEditor.visible .timeline-shell.is-lazy-resume) .videogen-step-back-button {
          min-height: 22px;
          padding: 0 10px;
          font-size: 0.52rem;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume {
          gap: 7px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-card {
          grid-template-columns: minmax(0, 1fr) minmax(420px, auto);
          gap: 8px !important;
          padding: 6px 9px !important;
          border-radius: 14px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-card h2 {
          margin: 0 0 2px;
          font-size: clamp(1.05rem, 1.35vw, 1.34rem);
          line-height: 1.02;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-card p:not(.panel-label) {
          font-size: 0.62rem;
          line-height: 1.18;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-guide-progress {
          grid-template-columns: repeat(4, minmax(0, 1fr));
          gap: 4px;
          margin-top: 6px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-guide-step {
          min-height: 38px;
          padding: 5px 7px;
          border-radius: 9px;
          font-size: 0.5rem;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-guide-step strong {
          font-size: 0.56rem;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-actions {
          display: grid;
          grid-template-columns: repeat(3, minmax(0, 1fr));
          min-width: min(520px, 100%);
          gap: 6px !important;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-actions .primary-button,
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-flow-actions .outline-button {
          min-height: 28px;
          padding: 5px 8px;
          font-size: 0.56rem;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-scene-map-card {
          display: none;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-preview-card {
          padding: 6px !important;
          border-radius: 12px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #timelineStatus,
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #timelineLastSaveStatus,
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #timelineFinalVideoCard,
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #timelineResumeBanner {
          display: none !important;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-tracks-inline {
          margin-top: 0 !important;
          padding-top: 0 !important;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-tracks-inline > .timeline-section-header {
          display: flex;
          min-height: 18px;
          margin-bottom: 2px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-workspace {
          height: clamp(440px, 58dvh, 720px) !important;
          max-height: clamp(440px, 58dvh, 720px) !important;
          padding: 5px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-ruler {
          height: 18px;
          margin-bottom: 3px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #videoTimelineTrack.timeline-dropzone {
          min-height: 76px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume #audioTimelineTrack.timeline-dropzone {
          min-height: 34px;
        }
        #sectionTimelineEditor .timeline-shell.is-lazy-resume .timeline-analysis-track {
          min-height: 28px;
        }
      }
