        :root {
            color-scheme: dark;
            --bg: #070910;
            --panel: #10131d;
            --line: rgba(255,255,255,.11);
            --text: #f5f7fb;
            --muted: #a7adbd;
            --accent: #61dafb;
            --accent-2: #ff4f8b;
            --ok: #5ee6a8;
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            padding-bottom: 212px;
            font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background:
                radial-gradient(circle at 18% 18%, rgba(97,218,251,.14), transparent 28rem),
                radial-gradient(circle at 82% 10%, rgba(255,79,139,.12), transparent 24rem),
                linear-gradient(180deg, #090b13 0%, var(--bg) 58%, #05060b 100%);
            color: var(--text);
        }
        a { color: inherit; text-decoration: none; }
        .topbar {
            height: 72px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 clamp(18px, 4vw, 52px);
            border-bottom: 1px solid var(--line);
            background: rgba(7,9,16,.74);
            backdrop-filter: blur(18px);
        }
        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 900;
            letter-spacing: 0;
            font-size: 1.18rem;
        }
        .brand-mark {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            display: grid;
            place-items: center;
            color: #071018;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            font-weight: 900;
        }
        .nav-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .nav-actions a,
        .nav-actions button,
        .primary-link {
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 16px;
            border: 1px solid var(--line);
            border-radius: 8px;
            font-size: .9rem;
            font-weight: 800;
            color: var(--text);
            background: rgba(255,255,255,.04);
        }
        .nav-actions .nav-cta,
        .primary-link {
            border-color: transparent;
            color: #071018;
            background: var(--accent);
        }
        .nav-actions button {
            min-height: 40px;
            appearance: none;
            background: rgba(255,255,255,.04);
            color: var(--text);
        }
        .account-pill {
            min-height: 40px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 5px 12px 5px 6px;
            border: 1px solid rgba(97,218,251,.26);
            border-radius: 8px;
            background: rgba(97,218,251,.08);
        }
        .account-avatar {
            width: 28px;
            height: 28px;
            border-radius: 7px;
            display: grid;
            place-items: center;
            color: #071018;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            font-size: .78rem;
            font-weight: 900;
        }
        .account-copy {
            display: grid;
            gap: 1px;
            line-height: 1.1;
        }
        .account-name {
            max-width: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: .88rem;
            font-weight: 900;
        }
        .account-meta {
            color: var(--muted);
            font-size: .68rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: .05em;
        }
        .account-meta.needs-email {
            color: #ffd166;
        }
        .logout-button {
            border-color: rgba(255,79,139,.3);
            color: #ffd8e5;
        }
        main {
            min-height: calc(100vh - 72px);
            display: grid;
            align-items: start;
            padding: 24px clamp(18px, 5vw, 72px) 38px;
        }
        .shell {
            width: min(980px, 100%);
            margin: 0 auto;
        }
        .eyebrow {
            color: var(--accent);
            font-weight: 900;
            font-size: .82rem;
            text-transform: uppercase;
            letter-spacing: .08em;
            margin-bottom: 10px;
        }
        h1 {
            margin: 0;
            max-width: 620px;
            font-size: clamp(2rem, 4.4vw, 4rem);
            line-height: 1;
            letter-spacing: 0;
        }
        .subcopy {
            max-width: 620px;
            margin: 14px 0 20px;
            color: var(--muted);
            font-size: clamp(.94rem, 1.4vw, 1.05rem);
            line-height: 1.5;
        }
        .prompt-panel {
            display: grid;
            gap: 12px;
            padding: 16px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: rgba(16,19,29,.82);
            box-shadow: 0 24px 80px rgba(0,0,0,.28);
        }
        label {
            color: var(--text);
            font-size: .9rem;
            font-weight: 900;
        }
        .prompt-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .prompt-bar {
            min-height: 58px;
            border: 1px solid rgba(245,158,11,0.55);
            border-radius: 8px;
            background:
                linear-gradient(90deg, rgba(245,158,11,.10), rgba(255,255,255,.025) 38%, rgba(255,79,139,.045)),
                #050812;
            padding: 8px;
            box-shadow:
                0 0 0 2px rgba(245,158,11,0.22),
                inset 0 1px 0 rgba(255,255,255,.06),
                inset 0 0 0 1px rgba(255,255,255,.035),
                0 10px 26px rgba(0,0,0,.22);
            transition: box-shadow 0.18s, border-color 0.18s;
        }
        .prompt-bar:focus-within {
            border-color: rgba(245,158,11,0.85);
            box-shadow:
                0 0 0 3px rgba(245,158,11,0.4),
                inset 0 1px 0 rgba(255,255,255,.06),
                inset 0 0 0 1px rgba(255,255,255,.035),
                0 10px 26px rgba(0,0,0,.22);
        }
        .prompt-bar:focus-within {
            border-color: rgba(97,218,251,.85);
            background:
                linear-gradient(90deg, rgba(97,218,251,.2), rgba(255,255,255,.035) 38%, rgba(255,79,139,.055)),
                #060a16;
            box-shadow:
                0 0 0 3px rgba(97,218,251,.14),
                0 14px 34px rgba(0,0,0,.3),
                inset 0 1px 0 rgba(255,255,255,.08);
        }
        .prompt-input {
            width: 100%;
            min-width: 0;
            height: 40px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--text);
            padding: 0 8px;
            font: 500 .98rem/1 Inter, system-ui, sans-serif;
            outline: none;
            caret-color: var(--accent-amber-bright, #FBBF24);
            cursor: text;
        }
        .prompt-input::placeholder {
            color: rgba(245,247,251,.42);
            font-weight: 400;
            font-style: italic;
        }
        .prompt-bar { cursor: text; }
        .prompt-char-counter {
            flex: 0 0 auto;
            font-size: 0.7rem;
            font-weight: 700;
            color: rgba(255,255,255,0.4);
            padding: 0 10px 0 4px;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.02em;
            white-space: nowrap;
            user-select: none;
        }
        .prompt-char-counter.warn { color: #FBBF24; }
        .prompt-char-counter.over { color: #ff8da6; }
        .smart-location-chip {
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: fit-content;
            max-width: 100%;
            margin-top: -4px;
            padding: 7px 9px 7px 10px;
            border: 1px solid rgba(97,218,251,.28);
            border-radius: 8px;
            background: rgba(97,218,251,.08);
            color: #dffbff;
            font-size: .76rem;
            font-weight: 850;
            line-height: 1.25;
        }
        .smart-location-chip.visible {
            display: inline-flex;
        }
        .smart-location-chip span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .smart-location-chip button {
            appearance: none;
            width: 22px;
            height: 22px;
            display: inline-grid;
            place-items: center;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 7px;
            color: rgba(255,255,255,.78);
            background: rgba(255,255,255,.06);
            cursor: pointer;
            font-weight: 900;
        }
        .prompt-advanced-row {
            position: relative;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 6px;
        }
        .prompt-adv-btn {
            appearance: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 11px;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 999px;
            background: rgba(255,255,255,.04);
            color: rgba(255,255,255,.82);
            font-size: .76rem;
            font-weight: 800;
            cursor: pointer;
            transition: background .15s, border-color .15s, color .15s;
        }
        .prompt-adv-btn:hover {
            background: rgba(124,58,237,.14);
            border-color: rgba(124,58,237,.42);
            color: #fff;
        }
        .prompt-adv-icon { font-size: .92rem; line-height: 1; }
        .prompt-date-popover {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            z-index: 12;
            display: none;
            gap: 6px;
            padding: 8px;
            background: #16161c;
            border: 1px solid rgba(255,255,255,.12);
            border-radius: 10px;
            box-shadow: 0 16px 40px rgba(0,0,0,.5);
        }
        .prompt-date-popover.open { display: inline-flex; align-items: center; }
        .prompt-date-input {
            background: #0e0e14;
            color: #fff;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 6px;
            padding: 6px 8px;
            font-size: .82rem;
            font-family: inherit;
        }
        .prompt-date-apply,
        .prompt-date-cancel {
            appearance: none;
            border: 0;
            border-radius: 6px;
            padding: 6px 11px;
            font-size: .76rem;
            font-weight: 900;
            cursor: pointer;
        }
        .prompt-date-apply { background: linear-gradient(135deg,#7c3aed,#22d3ee); color: #0a0a12; }
        .prompt-date-cancel { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }
        .prompt-voice-lang-popover {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            z-index: 12;
            display: none;
            gap: 8px;
            padding: 10px;
            background: #16161c;
            border: 1px solid rgba(255,255,255,.12);
            border-radius: 10px;
            box-shadow: 0 16px 40px rgba(0,0,0,.5);
        }
        .prompt-voice-lang-popover.open { display: inline-flex; align-items: center; }
        .prompt-voice-lang-popover label {
            display: inline-flex;
            flex-direction: column;
            gap: 4px;
            font-size: .72rem;
            font-weight: 800;
            color: rgba(255,255,255,.65);
        }
        .prompt-voice-lang-popover select {
            background: #0e0e14;
            color: #fff;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 6px;
            padding: 6px 8px;
            font-size: .82rem;
            font-family: inherit;
            font-weight: 700;
        }
        .event-date-chip {
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: fit-content;
            max-width: 100%;
            margin-top: 6px;
            padding: 7px 9px 7px 10px;
            border: 1px solid rgba(236,72,153,.32);
            border-radius: 8px;
            background: rgba(236,72,153,.08);
            color: #fce7f3;
            font-size: .76rem;
            font-weight: 850;
            line-height: 1.25;
        }
        .event-date-chip.visible { display: inline-flex; }
        .event-date-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .event-date-chip button {
            appearance: none;
            width: 22px;
            height: 22px;
            display: inline-grid;
            place-items: center;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 7px;
            color: rgba(255,255,255,.78);
            background: rgba(255,255,255,.06);
            cursor: pointer;
            font-weight: 900;
        }
        .custom-dialog-panel {
            display: none;
            margin-top: 8px;
            padding: 12px;
            border: 1px solid rgba(124,58,237,.28);
            border-radius: 12px;
            background: linear-gradient(135deg,rgba(124,58,237,.06),rgba(34,211,238,.04));
            box-shadow: 0 10px 28px rgba(0,0,0,.18);
        }
        .custom-dialog-panel.open { display: block; }
        .custom-dialog-head {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }
        .custom-dialog-title {
            flex: 1 1 auto;
            color: #fff;
            font-size: .85rem;
            font-weight: 900;
            letter-spacing: .01em;
        }
        .custom-dialog-lang {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: .72rem;
            font-weight: 800;
            color: rgba(255,255,255,.68);
        }
        .custom-dialog-lang select {
            background: #0e0e14;
            color: #fff;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 6px;
            padding: 4px 6px;
            font-size: .76rem;
            font-family: inherit;
            font-weight: 800;
        }
        .custom-dialog-close {
            appearance: none;
            width: 24px;
            height: 24px;
            display: inline-grid;
            place-items: center;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 7px;
            color: rgba(255,255,255,.78);
            background: rgba(255,255,255,.06);
            cursor: pointer;
            font-weight: 900;
        }
        .custom-dialog-text {
            width: 100%;
            min-height: 84px;
            box-sizing: border-box;
            padding: 10px 12px;
            background: #0e0e14;
            color: #fff;
            border: 1px solid rgba(255,255,255,.14);
            border-radius: 8px;
            font-family: inherit;
            font-size: .85rem;
            line-height: 1.45;
            resize: vertical;
        }
        .custom-dialog-text:focus {
            outline: none;
            border-color: rgba(124,58,237,.6);
        }
        .custom-dialog-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 8px;
            font-size: .72rem;
            color: rgba(255,255,255,.6);
        }
        .custom-dialog-clear {
            appearance: none;
            border: 0;
            border-radius: 6px;
            padding: 5px 10px;
            font-size: .72rem;
            font-weight: 800;
            color: rgba(255,255,255,.7);
            background: rgba(255,255,255,.06);
            cursor: pointer;
        }
        .custom-dialog-clear:hover { background: rgba(255,255,255,.12); color: #fff; }
        .credit-estimate {
            min-width: 130px;
            min-height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 12px;
            border: 1px solid rgba(97,218,251,.32);
            border-radius: 8px;
            color: #dffbff;
            background:
                linear-gradient(135deg, rgba(97,218,251,.16), rgba(94,230,168,.10)),
                rgba(8,11,19,.92);
            font-size: .76rem;
            font-weight: 900;
            white-space: nowrap;
            box-shadow: inset 0 0 18px rgba(97,218,251,.06);
        }
        .credit-estimate strong {
            color: var(--text);
            font-size: .86rem;
        }
        .credit-estimate .credit-label {
            color: rgba(223,251,255,.7);
            text-transform: uppercase;
            letter-spacing: .06em;
            font-size: .64rem;
        }
        .credit-estimate .credit-meta {
            color: rgba(223,251,255,.64);
            font-size: .7rem;
        }
        .credit-estimate.warning {
            border-color: rgba(255,80,140,.38);
            color: #ffb8cc;
            background: rgba(255,80,140,.08);
        }
        /* CTA-pair variant — sits next to the Create Video button and matches
           its height so they read as a pair of buttons. Non-interactive. */
        .credit-estimate.cta-pair {
            min-height: 46px;
            padding: 0 18px;
            border-radius: 8px;
            font-size: 0.86rem;
            min-width: 110px;
            box-shadow: none;
            cursor: default;
        }
        .credit-estimate.cta-pair strong {
            font-size: 0.92rem;
            font-weight: 900;
        }
        #vidtv-prompt-form button[type="submit"].is-reserving {
            opacity: 0.72;
            filter: saturate(0.75);
            cursor: wait;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 18px rgba(97,218,251,.18);
        }
        .character-add-choice-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .character-add-choice {
            appearance: none;
            border: 1px solid rgba(97,218,251,.28);
            border-radius: 8px;
            min-height: 118px;
            padding: 18px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 8px;
            text-align: left;
            color: #f7fbff;
            background: rgba(10,15,27,.9);
            cursor: pointer;
            font: inherit;
            box-shadow: inset 0 0 22px rgba(97,218,251,.05);
        }
        .character-add-choice:hover {
            border-color: rgba(94,230,168,.55);
            background: rgba(13,26,35,.96);
        }
        .character-add-choice strong {
            font-size: 1rem;
            font-weight: 900;
        }
        .character-add-choice span,
        .character-add-status {
            color: rgba(226,238,255,.68);
            font-size: .84rem;
            line-height: 1.35;
        }
        .character-add-status {
            min-height: 20px;
            margin-top: 12px;
        }
        .form-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }
        .source-song-picker {
            display: none;
            margin-top: 12px;
            padding: 12px;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            border: 1px solid rgba(245,158,11,0.55);
            border-radius: 8px;
            background: rgba(8,12,20,.68);
            box-shadow: 0 0 0 2px rgba(245,158,11,0.22);
            transition: box-shadow 0.18s, border-color 0.18s;
        }
        .source-song-picker:focus-within {
            border-color: rgba(245,158,11,0.85);
            box-shadow: 0 0 0 3px rgba(245,158,11,0.4);
        }
        .source-song-picker.visible {
            display: grid;
            gap: 8px;
        }
        .source-song-picker label {
            color: var(--text);
            font: 900 .78rem Inter, system-ui, sans-serif;
            text-transform: uppercase;
        }
        .source-song-picker select,
        .source-song-picker input[type="file"] {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
            min-height: 42px;
            border: 1px solid rgba(97,218,251,.24);
            border-radius: 8px;
            background: #070a12;
            color: var(--text);
            padding: 0 12px;
            font: 850 .92rem Inter, system-ui, sans-serif;
        }
        .source-song-picker input[type="file"] {
            padding: 10px 12px;
            cursor: pointer;
        }
        .source-song-picker .song-source-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 10px;
        }
        @media (max-width: 720px) {
            .source-song-picker .song-source-grid {
                grid-template-columns: 1fr;
            }
        }
        .source-song-picker small {
            color: var(--muted);
            font-size: .78rem;
        }
        .character-picker {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 35;
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto;
            grid-template-rows: auto auto;
            align-items: center;
            gap: 14px;
            padding: 14px clamp(18px, 5vw, 72px);
            border-top: 1px solid rgba(97,218,251,.22);
            background:
                radial-gradient(circle at 78% 0%, rgba(255,79,139,.12), transparent 20rem),
                linear-gradient(180deg, rgba(12,15,25,.92), rgba(6,8,14,.98));
            box-shadow: 0 -18px 60px rgba(0,0,0,.48);
            backdrop-filter: blur(18px);
            max-height: 220px;
            transition: max-height .32s ease, padding .26s ease, border-color .22s ease, box-shadow .22s ease;
        }
        .character-picker.gallery-expanded {
            align-items: stretch;
            grid-template-rows: auto minmax(0, 1fr);
            max-height: min(52vh, 540px);
            padding-top: 18px;
            padding-bottom: 18px;
            border-top-color: rgba(97,218,251,.45);
            box-shadow: 0 -28px 90px rgba(0,0,0,.62);
        }
        .character-picker.minimized {
            left: auto;
            right: clamp(14px, 3vw, 28px);
            bottom: 14px;
            width: min(250px, calc(100vw - 28px));
            grid-template-columns: 1fr auto;
            padding: 10px 12px;
            border: 1px solid rgba(97,218,251,.25);
            border-radius: 999px;
            box-shadow: 0 18px 60px rgba(0,0,0,.5);
        }
        .character-picker.minimized .character-row,
        .character-picker.minimized .character-picker-head {
            display: none;
        }
        .character-picker-head {
            grid-column: 3;
            grid-row: 1;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            min-width: 0;
        }
        .character-picker-title {
            display: none;
        }
        .character-picker-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .text-button {
            min-height: 34px;
            padding: 0 11px;
            border: 1px solid var(--line);
            border-radius: 8px;
            color: var(--text);
            background: rgba(255,255,255,.04);
            font: 900 .78rem Inter, system-ui, sans-serif;
            white-space: nowrap;
        }
        /* Round expand button stays in column 3 row 2 of the outer picker grid */
        .gallery-expand-button {
            justify-self: center;
            align-self: center;
            width: 40px;
            min-width: 40px;
            height: 40px;
            min-height: 40px;
            padding: 0;
            border-radius: 999px;
            color: #071018;
            background: linear-gradient(180deg, var(--accent), #5ee6a8);
            border: 1px solid transparent;
            font: 950 1rem Inter, system-ui, sans-serif;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 26px rgba(97,218,251,.22);
        }
        /* Secondary actions sit in column 2 of the outer picker grid as a
           clean vertical stack — no overlap, no grid leakage from children. */
        .character-picker-secondary-actions {
            grid-column: 2;
            grid-row: 1 / span 2;
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-self: center;
            justify-content: center;
            min-width: 140px;
            max-width: 170px;
        }
        .create-song-button,
        .view-character-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-width: 0;
            min-height: 36px;
            padding: 0 14px;
            border-radius: 8px;
            text-decoration: none;
            font: 800 .78rem Inter, system-ui, sans-serif;
            line-height: 1.1;
            text-align: center;
            white-space: nowrap;
            transition: filter .15s, border-color .15s, transform .1s;
            cursor: pointer;
        }
        .create-song-button {
            color: #110a1f;
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
            border: 1px solid transparent;
            box-shadow: 0 4px 14px rgba(245,158,11,.28);
        }
        .view-character-button {
            color: #eafcff;
            background: rgba(255,255,255,.05);
            border: 1px solid rgba(97,218,251,.28);
        }
        .create-song-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
        .view-character-button:hover { background: rgba(97,218,251,.12); border-color: rgba(97,218,251,.5); }
        .create-song-button[hidden],
        .view-character-button[hidden] {
            display: none !important;
        }
        .create-song-button.loading {
            pointer-events: none;
            opacity: .7;
        }
        .gallery-expand-button:hover {
            filter: brightness(1.08);
        }
        .character-row {
            grid-column: 1;
            grid-row: 1 / span 2;
            display: flex;
            gap: 9px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 2px 2px 6px;
            scrollbar-width: thin;
            min-width: 0;
            transition: max-height .32s ease;
        }
        .character-picker.gallery-expanded .character-row {
            grid-row: 1 / span 2;
            flex-wrap: wrap;
            align-content: flex-start;
            overflow-x: hidden;
            overflow-y: auto;
            max-height: calc(min(52vh, 540px) - 36px);
            padding-right: 8px;
        }
        .character-tile {
            position: relative;
            flex: 0 0 140px;
            width: 140px;
            min-height: 164px;
            display: grid;
            align-content: end;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,.12);
            border-radius: 8px;
            padding: 8px;
            color: var(--text);
            background: #080b13;
            text-align: left;
        }
        .character-tile img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: .9;
        }
        .character-tile::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,.78));
        }
        .character-tile span {
            position: relative;
            z-index: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: .78rem;
            font-weight: 900;
        }
        .character-tile.add {
            min-height: 164px;
            place-items: center;
            align-content: center;
            text-align: center;
            border-style: dashed;
            color: var(--accent);
            background: rgba(97,218,251,.06);
        }
        .character-tile.add::after {
            display: none;
        }
        .character-tile.add strong {
            display: block;
            font-size: 2rem;
            line-height: 1;
        }
        .character-tile.add em {
            display: block;
            margin-bottom: 7px;
            color: rgba(223,251,255,.68);
            font-style: normal;
            font-size: .68rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: .07em;
        }
        .character-tile.selected {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(97,218,251,.18);
        }
        /* Ghost tile that appears while z-image-turbo is generating an
           auto-character for the current prompt. Glows + spins until real
           image arrives, then this node is replaced by the real tile. */
        .character-tile.pending-z-image {
            flex: 0 0 140px;
            width: 140px;
            min-height: 164px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 10px;
            text-align: center;
            border-radius: 8px;
            border: 1px solid rgba(245,158,11,0.6);
            background:
                linear-gradient(135deg, rgba(245,158,11,0.18), rgba(108,242,255,0.06)),
                #080b13;
            color: rgba(255,255,255,0.85);
            position: relative;
            overflow: hidden;
            animation: pendingZImagePulse 1.6s ease-in-out infinite;
        }
        .character-tile.pending-z-image::before {
            content: 'AUTO';
            position: absolute; top: 8px; left: 8px;
            font-size: 0.58rem;
            font-weight: 900;
            letter-spacing: 0.16em;
            color: #FBBF24;
            background: rgba(0,0,0,0.6);
            padding: 2px 6px;
            border-radius: 4px;
        }
        .pending-z-image-spinner {
            width: 36px; height: 36px;
            border: 3px solid rgba(245,158,11,0.22);
            border-top-color: #FBBF24;
            border-radius: 999px;
            animation: pendingZImageSpin 0.85s linear infinite;
        }
        .pending-z-image-label {
            font-size: 0.72rem;
            font-weight: 800;
            line-height: 1.25;
            color: rgba(255,255,255,0.9);
        }
        .pending-z-image-sub {
            font-size: 0.62rem;
            color: rgba(255,255,255,0.55);
            margin-top: -2px;
        }
        @keyframes pendingZImagePulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); border-color: rgba(245,158,11,0.45); }
            50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); border-color: rgba(245,158,11,1); }
        }
        @keyframes pendingZImageSpin { to { transform: rotate(360deg); } }
        .character-empty {
            flex: 0 0 280px;
            min-height: 164px;
            display: grid;
            place-items: center;
            border: 1px solid var(--line);
            border-radius: 8px;
            color: var(--muted);
            background: rgba(255,255,255,.025);
            font-size: .8rem;
            font-weight: 800;
            text-align: center;
            padding: 12px;
        }
        .advanced-options {
            display: grid;
            gap: 0;
            border: 1px solid rgba(255,255,255,.1);
            border-radius: 8px;
            background: rgba(255,255,255,.025);
        }
        .advanced-options-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
        }
        .advanced-options-title {
            color: var(--text);
            font-size: .86rem;
            font-weight: 900;
        }
        .advanced-options-note {
            color: var(--muted);
            font-size: .76rem;
            font-weight: 800;
        }
        .advanced-grid {
            display: none;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
            padding: 0 12px 12px;
        }
        @media (max-width: 760px) {
            .advanced-grid {
                grid-template-columns: 1fr;
            }
        }
        .advanced-options.open .advanced-grid {
            display: grid;
        }
        .advanced-field {
            display: grid;
            gap: 6px;
        }
        .advanced-field label {
            color: var(--muted);
            font-size: .72rem;
            text-transform: uppercase;
            letter-spacing: .06em;
        }
        .advanced-field select {
            width: 100%;
            min-height: 40px;
            border: 1px solid rgba(255,255,255,.13);
            border-radius: 8px;
            background: #080b13;
            color: var(--text);
            padding: 0 10px;
            font: 850 .86rem Inter, system-ui, sans-serif;
            outline: none;
        }
        .advanced-field.locked-field {
            opacity: .48;
        }
        .advanced-field.locked-field::after {
            content: "N/A for One-Shot MV";
            color: var(--muted);
            font-size: .7rem;
            font-weight: 800;
        }
        .advanced-options.locked {
            opacity: .72;
        }
        .advanced-toggle {
            min-height: 30px;
            padding: 0 10px;
            border: 1px solid var(--line);
            border-radius: 8px;
            color: var(--text);
            background: rgba(255,255,255,.04);
            font: 900 .74rem Inter, system-ui, sans-serif;
        }
        .hint {
            color: var(--muted);
            font-size: .88rem;
        }
        button {
            min-height: 46px;
            border: 0;
            border-radius: 8px;
            padding: 0 22px;
            cursor: pointer;
            color: #071018;
            background: linear-gradient(135deg, var(--accent), #8af5d0);
            font: 900 .96rem Inter, system-ui, sans-serif;
        }
        .job-feed {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            grid-auto-flow: dense;
            gap: 14px;
            margin-top: 22px;
        }
        /* 16:9 cards take two columns so the landscape frame is double the
           width of a portrait card and reads at its natural ratio. dense
           auto-flow lets shorter portrait cards backfill any gaps. */
        .job-card.landscape {
            grid-column: span 2;
        }
        .job-card {
            min-width: 0;
            margin: 0;
            gap: 10px;
            border: 0;
            padding: 0;
            background: transparent;
            cursor: pointer;
            transition: transform .18s ease;
        }
        .job-card > * + * {
            margin-top: 10px;
        }
        .job-card:hover {
            transform: translateY(-1px);
        }
        .job-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }
        .job-title {
            margin: 0;
            font-size: .96rem;
            font-weight: 900;
        }
        .job-prompt {
            margin: 5px 0 0;
            color: var(--muted);
            font-size: .82rem;
            line-height: 1.45;
        }
        .job-badge {
            flex-shrink: 0;
            border: 1px solid rgba(97,218,251,.28);
            border-radius: 999px;
            padding: 6px 10px;
            color: var(--accent);
            background: rgba(97,218,251,.08);
            font-size: .72rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: .05em;
        }
        .job-card.failed .job-badge {
            border-color: rgba(255,79,139,.36);
            color: #ff9fbd;
            background: rgba(255,79,139,.09);
        }
        .job-card.completed .job-badge {
            border-color: rgba(94,230,168,.4);
            color: var(--ok);
            background: rgba(94,230,168,.09);
        }
        .progress-track {
            overflow: hidden;
            height: 8px;
            border-radius: 999px;
            background: rgba(255,255,255,.08);
        }
        .progress-fill {
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, var(--accent), var(--ok));
            transition: width .25s ease;
        }
        .modal-percent-summary {
            display: grid;
            gap: 12px;
            place-items: center;
            min-height: 220px;
            padding: 22px;
            border: 1px solid rgba(97,218,251,.18);
            border-radius: 8px;
            background:
                radial-gradient(circle at 50% 44%, rgba(111,238,214,.12), transparent 8rem),
                rgba(10,13,21,.7);
            text-align: center;
        }
        .modal-percent-ring {
            width: 118px;
            height: 118px;
            border-radius: 999px;
            display: grid;
            place-items: center;
            color: #eafaff;
            font-size: 1.65rem;
            font-weight: 950;
            background:
                radial-gradient(circle at center, rgba(8,10,17,.96) 56%, transparent 58%),
                conic-gradient(from 180deg, var(--accent) var(--progress, 0%), rgba(255,255,255,.08) 0);
            box-shadow: 0 0 34px rgba(97,218,251,.2);
        }
        .modal-percent-summary strong {
            color: #f7fbff;
            font-size: 1rem;
        }
        .modal-percent-summary span {
            display: block;
            color: var(--muted);
            margin-top: 4px;
            font-size: .92rem;
        }
        /* Stage-specific animation that shows up while scenes are rendering.
           Sits below the percent ring inside the modal body. */
        .modal-stage-gif {
            margin-top: 14px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            animation: stageGifIn 0.4s ease;
        }
        .modal-stage-gif img {
            max-width: 220px;
            width: 100%;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: 0 6px 24px rgba(0,0,0,0.4);
            display: block;
        }
        .modal-stage-gif-caption {
            color: rgba(255,255,255,0.55);
            font-size: 0.78rem;
            font-style: italic;
            text-align: center;
        }
        @keyframes stageGifIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .modal-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 12px;
        }
        .cancel-process-button {
            border: 1px solid rgba(255,79,139,.42);
            border-radius: 8px;
            padding: 10px 14px;
            color: #ffd7e4;
            background: rgba(255,79,139,.12);
            font-weight: 900;
            cursor: pointer;
        }
        .cancel-process-button:hover {
            border-color: rgba(255,79,139,.7);
            background: rgba(255,79,139,.2);
        }
        .cancel-process-button[hidden] {
            display: none;
        }
        .job-actions {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 7px;
            align-items: center;
        }
        .job-card.landscape .job-actions,
        .job-card.landscape .job-progress-panel {
            width: 100%;
        }
        .job-media-card {
            position: relative;
            width: 100%;
            aspect-ratio: 9 / 16;
            overflow: hidden;
            border: 1px solid rgba(97,218,251,.24);
            border-radius: 8px;
            background:
                radial-gradient(circle at 50% 22%, rgba(97,218,251,.12), transparent 34%),
                linear-gradient(180deg, rgba(16,19,29,.94), rgba(5,7,13,.98));
            box-shadow: 0 18px 55px rgba(0,0,0,.34);
        }
        .job-media-card::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 1;
            pointer-events: none;
            background:
                radial-gradient(circle at 18% 18%, rgba(97,218,251,.18), transparent 34%),
                radial-gradient(circle at 78% 72%, rgba(255,79,139,.14), transparent 30%),
                linear-gradient(180deg, transparent 24%, rgba(3,5,10,.46) 62%, rgba(3,5,10,.92));
            opacity: 0;
            transition: opacity .2s ease;
        }
        .job-media-card.has-progress::before {
            opacity: 1;
        }
        .job-media-card.landscape {
            aspect-ratio: 16 / 9;
            width: 100%;
        }
        .job-title-card {
            position: absolute;
            inset: 0;
            z-index: 2;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 14px 14px 18px;
            pointer-events: none;
        }
        .job-title-card-top {
            display: grid;
            gap: 5px;
        }
        .job-title-card-bottom {
            display: grid;
            gap: 4px;
            padding-bottom: 10px;
        }
        .job-title-copy {
            min-width: 0;
            display: grid;
            gap: 4px;
        }
        .job-title-card h3 {
            margin: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: .9rem;
            font-weight: 900;
            letter-spacing: 0;
        }
        .job-title-card p {
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            color: rgba(245,247,251,.72);
            font-size: .76rem;
            line-height: 1.35;
        }
        .job-title-status {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 48px;
            height: 48px;
            margin: -24px 0 0 -24px;
            border-radius: 999px;
            display: grid;
            place-items: center;
            border: 0;
            color: #eafaff;
            font-size: .7rem;
            font-weight: 950;
            letter-spacing: 0;
            background:
                radial-gradient(circle at center, rgba(7,9,16,.97) 54%, transparent 57%),
                conic-gradient(from 180deg, var(--accent) var(--progress, 0%), rgba(255,255,255,.09) 0);
            box-shadow: 0 0 24px rgba(97,218,251,.18), inset 0 0 18px rgba(255,255,255,.035);
        }
        .job-title-status::after {
            content: "";
            position: absolute;
            inset: -3px;
            border-radius: inherit;
            border: 2px solid transparent;
            border-top-color: rgba(97,218,251,.95);
            border-right-color: rgba(94,230,168,.78);
            filter: drop-shadow(0 0 9px rgba(97,218,251,.36));
            animation: silky-spin 1.05s linear infinite;
        }
        .job-card.completed .job-title-status {
            color: var(--ok);
        }
        .job-card.completed .job-title-status::after {
            animation: none;
            border-color: rgba(94,230,168,.48);
        }
        .job-card.failed .job-title-status {
            color: #ff9fbd;
        }
        .job-card.failed .job-title-status::after {
            animation: none;
            border-color: rgba(255,79,139,.45);
        }
        .job-card-progress {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 4px;
            display: block;
        }
        .job-card-progress-row {
            display: none;
        }
        .job-card-progress-row span:last-child {
            color: var(--accent);
        }
        .job-card-progress .progress-track {
            height: 100%;
            border-radius: 0;
            background: rgba(255,255,255,.1);
            box-shadow: none;
        }
        .job-card-progress .progress-fill {
            position: relative;
            overflow: hidden;
            border-radius: 0;
            transition: width .6s cubic-bezier(.22,1,.36,1);
        }
        .job-card-progress .progress-fill::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
            transform: translateX(-100%);
            animation: progress-shine 1.55s ease-in-out infinite;
        }
        @keyframes progress-shine {
            to { transform: translateX(100%); }
        }
        @keyframes silky-spin {
            to { transform: rotate(360deg); }
        }
        .job-step-rail {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 6px;
        }
        .job-step-chip {
            min-width: 0;
            border: 1px solid rgba(255,255,255,.11);
            border-radius: 8px;
            padding: 7px 8px;
            background: rgba(8,11,19,.52);
            backdrop-filter: blur(10px);
        }
        .job-step-chip strong,
        .job-step-chip span {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .job-step-chip strong {
            color: rgba(245,247,251,.9);
            font-size: .66rem;
            font-weight: 900;
        }
        .job-step-chip span {
            margin-top: 2px;
            color: rgba(167,173,189,.86);
            font-size: .64rem;
            font-weight: 800;
        }
        .job-step-chip.running {
            border-color: rgba(97,218,251,.34);
            background: rgba(97,218,251,.1);
        }
        .job-step-chip.done {
            border-color: rgba(94,230,168,.34);
            background: rgba(94,230,168,.1);
        }
        .job-step-chip.failed {
            border-color: rgba(255,79,139,.36);
            background: rgba(255,79,139,.1);
        }
        .job-progress-panel {
            width: min(360px, 100%);
            display: grid;
            gap: 7px;
            padding: 10px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: rgba(8,11,19,.72);
        }
        .job-media-title {
            font-size: .92rem;
            font-weight: 900;
            color: var(--text);
        }
        .job-media-message {
            color: var(--muted);
            font-size: .78rem;
            line-height: 1.35;
        }
        .job-step-summary {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
        }
        .job-step-pill {
            min-height: 36px;
            display: grid;
            gap: 2px;
            align-content: center;
            border: 1px solid var(--line);
            border-radius: 8px;
            padding: 7px 9px;
            background: rgba(255,255,255,.055);
        }
        .job-step-pill strong {
            font-size: .73rem;
            font-weight: 900;
            color: var(--text);
        }
        .job-step-pill span {
            font-size: .72rem;
            font-weight: 800;
            color: var(--muted);
        }
        .job-step-pill.running {
            border-color: rgba(97,218,251,.32);
            background: rgba(97,218,251,.08);
        }
        .job-step-pill.done {
            border-color: rgba(94,230,168,.34);
            background: rgba(94,230,168,.08);
        }
        .job-step-pill.failed {
            border-color: rgba(255,79,139,.36);
            background: rgba(255,79,139,.08);
        }
        .job-actions a,
        .job-actions button {
            min-height: 32px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 8px;
            border: 1px solid var(--line);
            border-radius: 8px;
            color: var(--text);
            background: rgba(255,255,255,.04);
            font: 900 .68rem Inter, system-ui, sans-serif;
            line-height: 1.05;
            text-align: center;
        }
        .job-actions a:hover,
        .job-actions button:hover {
            border-color: rgba(97,218,251,.36);
            background: rgba(97,218,251,.08);
        }
        .job-video {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            border: 0;
            border-radius: 0;
            background: #000;
        }
        .job-video-poster {
            position: absolute;
            inset: 0;
            z-index: 1;
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            border: 0;
            pointer-events: none;
            background: #000;
        }
        .job-hover-title {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 3;
            padding: 12px 14px 28px;
            background: linear-gradient(180deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,0) 100%);
            color: #fff;
            font: 800 .82rem Inter, system-ui, sans-serif;
            line-height: 1.25;
            opacity: 0;
            transform: translateY(-6px);
            transition: opacity .18s ease, transform .18s ease;
            pointer-events: none;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .job-media-card:hover .job-hover-title {
            opacity: 1;
            transform: translateY(0);
        }
        .username-strip {
            margin: 18px auto 0;
            max-width: 760px;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 14px;
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(183,140,255,0.10), rgba(108,242,255,0.06));
            backdrop-filter: blur(8px);
        }
        .username-strip-inner {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 12px;
            align-items: center;
        }
        .username-strip-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
        .username-strip-copy strong { font-weight: 800; font-size: 0.85rem; }
        .username-strip-handle { font-weight: 900; color: #b78cff; font-size: 0.95rem; }
        .username-strip-copy small { color: rgba(255,255,255,0.55); font-size: 0.75rem; flex-basis: 100%; }
        /* ===== Welcome claim modal (first-login) ===== */
        .welcome-claim-card {
            max-width: 520px;
            padding: 32px 32px 26px;
            border-radius: 16px;
            background: linear-gradient(180deg, #14182a, #0a0c18);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03) inset;
            position: relative;
        }
        .welcome-claim-close {
            position: absolute; top: 14px; right: 14px;
            width: 34px; height: 34px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.7);
            border-radius: 8px;
            font-size: 18px; line-height: 1;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .welcome-claim-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
        .welcome-claim-eyebrow {
            display: inline-flex; align-items: center; gap: 8px;
            color: #FBBF24;
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 700;
            font-size: 0.72rem;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            margin-bottom: 16px;
        }
        .welcome-claim-dot {
            width: 6px; height: 6px;
            border-radius: 999px;
            background: #FBBF24;
            box-shadow: 0 0 8px #FBBF24;
            animation: welcome-pulse 1.6s ease-in-out infinite;
        }
        @keyframes welcome-pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.45; transform: scale(0.85); }
        }
        #welcome-claim-title {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 900;
            font-size: 1.7rem;
            letter-spacing: -0.02em;
            margin: 0 0 6px;
            color: #fff;
        }
        .welcome-claim-sub {
            margin: 0 0 20px;
            color: rgba(255,255,255,0.55);
            font-size: 0.92rem;
            line-height: 1.45;
        }
        .welcome-claim-preview {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 900;
            font-size: clamp(1.4rem, 4vw, 2rem);
            letter-spacing: -0.02em;
            padding: 18px 22px;
            border-radius: 12px;
            background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(108,242,255,0.05));
            border: 1px solid rgba(245,158,11,0.25);
            color: #FBBF24;
            text-align: center;
            margin-bottom: 24px;
            word-break: break-all;
            line-height: 1.1;
            transition: color 0.15s, border-color 0.15s, background 0.15s;
        }
        .welcome-claim-preview.invalid {
            color: #ff8da6;
            border-color: rgba(255,141,166,0.4);
            background: rgba(255,141,166,0.06);
        }
        .welcome-claim-form {
            display: flex;
            flex-direction: column;
            gap: 0;
        }
        .welcome-claim-label {
            color: rgba(255,255,255,0.75);
            font-size: 0.82rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 8px;
        }
        .welcome-claim-inputrow {
            display: flex;
            align-items: stretch;
            background: rgba(0,0,0,0.4);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 10px;
            overflow: hidden;
            transition: border-color 0.18s, box-shadow 0.18s;
        }
        .welcome-claim-inputrow:focus-within {
            border-color: rgba(245,158,11,0.7);
            box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
        }
        .welcome-claim-inputrow.ok {
            border-color: rgba(74,222,128,0.7);
            box-shadow: 0 0 0 3px rgba(74,222,128,0.18);
        }
        .welcome-claim-inputrow.err {
            border-color: rgba(255,141,166,0.7);
            box-shadow: 0 0 0 3px rgba(255,141,166,0.18);
        }
        .welcome-claim-prefix {
            display: flex; align-items: center;
            padding: 0 14px;
            color: rgba(255,255,255,0.55);
            font-weight: 700;
            font-size: 0.98rem;
            background: rgba(255,255,255,0.03);
            border-right: 1px solid rgba(255,255,255,0.06);
        }
        #welcome-claim-input {
            flex: 1; min-width: 0;
            background: transparent;
            border: 0; outline: none;
            color: #fff;
            font: 700 1.05rem Inter, system-ui, sans-serif;
            padding: 14px 16px;
            text-transform: lowercase;
            caret-color: #FBBF24;
        }
        #welcome-claim-input::placeholder { color: rgba(255,255,255,0.3); font-style: italic; font-weight: 500; }
        .welcome-claim-hint {
            display: block;
            margin: 8px 2px 0;
            color: rgba(255,255,255,0.42);
            font-size: 0.76rem;
        }
        .welcome-claim-msg {
            min-height: 18px;
            margin-top: 10px;
            font-size: 0.82rem;
            color: rgba(255,255,255,0.6);
        }
        .welcome-claim-msg.err { color: #ff8da6; }
        .welcome-claim-msg.ok { color: #4ade80; }
        .welcome-claim-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-top: 18px;
        }
        .welcome-claim-skip {
            background: transparent;
            color: rgba(255,255,255,0.55);
            border: 0;
            padding: 8px 4px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
        }
        .welcome-claim-skip:hover { color: rgba(255,255,255,0.85); }
        .welcome-claim-submit {
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
            color: #110a1f;
            border: 0;
            padding: 12px 22px;
            border-radius: 10px;
            font-weight: 800;
            font-size: 0.92rem;
            cursor: pointer;
            box-shadow: 0 0 24px rgba(245,158,11,0.45);
            transition: transform 0.1s, box-shadow 0.18s;
        }
        .welcome-claim-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 28px rgba(245,158,11,0.55); }
        .welcome-claim-submit:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
        @media (max-width: 520px) {
            .welcome-claim-card { padding: 24px 22px 22px; max-width: calc(100% - 24px); }
            #welcome-claim-title { font-size: 1.4rem; }
            .welcome-claim-actions { flex-direction: column-reverse; align-items: stretch; }
            .welcome-claim-skip { text-align: center; padding: 12px 4px; }
        }
        .username-strip-form { display: flex; align-items: center; gap: 6px; }
        .username-strip-prefix { color: rgba(255,255,255,0.55); font-size: 0.82rem; font-weight: 600; }
        .username-strip-form input {
            background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.10);
            border-radius: 8px; padding: 8px 10px; font: inherit; font-weight: 600; width: 140px;
        }
        .username-strip-form input:focus { outline: none; border-color: #b78cff; box-shadow: 0 0 0 2px rgba(183,140,255,0.25); }
        .username-strip-form input.ok { border-color: #4ade80; }
        .username-strip-form input.err { border-color: #ff6b8a; }
        .username-strip-form button {
            background: #b78cff; color: #110a1f; border: 0; padding: 8px 14px;
            border-radius: 8px; font-weight: 800; cursor: pointer; font-size: 0.85rem;
        }
        .username-strip-form button:disabled { opacity: 0.45; cursor: not-allowed; }
        .username-strip-link { font-weight: 700; font-size: 0.85rem; color: #6cf2ff; }
        .username-strip-msg { grid-column: 1 / -1; font-size: 0.78rem; color: rgba(255,255,255,0.6); min-height: 14px; }
        .username-strip-msg.err { color: #ff8da6; }
        .username-strip-msg.ok { color: #4ade80; }
        @media (max-width: 640px) {
            .username-strip-inner { grid-template-columns: 1fr; }
            .username-strip-form { width: 100%; }
            .username-strip-form input { flex: 1; width: auto; }
        }
        .live-channels {
            margin: 36px auto 0;
            max-width: 1100px;
            padding: 0 12px;
        }
        .live-channels[hidden] { display: none; }
        .live-channels-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 14px;
            margin-top: 16px;
        }
        .live-channel-card {
            display: block;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 14px;
            padding: 12px;
            text-decoration: none;
            color: inherit;
            transition: border-color .2s, transform .2s;
        }
        .live-channel-card:hover { border-color: rgba(183,140,255,0.5); transform: translateY(-2px); }
        .live-channel-card .row { display: flex; align-items: center; gap: 10px; }
        .live-channel-card .avatar {
            width: 40px; height: 40px; border-radius: 999px; background: #2a2440;
            overflow: hidden; flex: 0 0 auto;
        }
        .live-channel-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
        .live-channel-card .handle { font-weight: 800; font-size: 0.9rem; }
        .live-channel-card .meta { color: rgba(255,255,255,0.55); font-size: 0.72rem; margin-top: 2px; }
        .live-channel-card .badge {
            display: inline-flex; align-items: center; gap: 4px;
            font-size: 0.62rem; font-weight: 900; letter-spacing: 0.06em;
            text-transform: uppercase; color: #fff;
            background: #ff4f6f; padding: 2px 7px; border-radius: 6px;
            margin-left: auto;
        }
        .live-channel-card .badge::before {
            content: ''; width: 5px; height: 5px; border-radius: 999px; background: #fff;
            animation: live-pulse 1.4s ease-in-out infinite;
        }
        @keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
        .public-showcase {
            display: none;
            margin-top: 34px;
            padding-top: 26px;
            border-top: 1px solid var(--line);
        }
        .public-showcase.visible {
            display: block;
        }
        .public-showcase-head {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 14px;
        }
        .public-showcase-copy {
            display: grid;
            gap: 5px;
        }
        .public-showcase-kicker {
            color: var(--accent);
            font-size: .76rem;
            font-weight: 900;
            letter-spacing: .08em;
            text-transform: uppercase;
        }
        .public-showcase h2 {
            margin: 0;
            color: var(--text);
            font-size: clamp(1.2rem, 2.2vw, 1.7rem);
            font-weight: 900;
            letter-spacing: 0;
        }
        .public-showcase p {
            margin: 0;
            max-width: 620px;
            color: var(--muted);
            font-size: .9rem;
            line-height: 1.45;
        }
        .public-showcase-link {
            flex-shrink: 0;
            min-height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 13px;
            border: 1px solid rgba(97,218,251,.24);
            border-radius: 8px;
            color: var(--text);
            background: rgba(97,218,251,.07);
            font-size: .78rem;
            font-weight: 900;
        }
        .public-showcase-loadmore-row {
            display: flex;
            justify-content: center;
            margin-top: 22px;
        }
        .public-showcase-loadmore-row[hidden] { display: none; }
        .public-showcase-loadmore {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 44px;
            padding: 0 28px;
            border-radius: 10px;
            border: 1px solid rgba(245,158,11,0.45);
            background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(245,158,11,0.06));
            color: #FBBF24;
            font-weight: 800;
            font-size: 0.9rem;
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s, transform 0.1s;
        }
        .public-showcase-loadmore:hover {
            background: linear-gradient(180deg, rgba(245,158,11,0.28), rgba(245,158,11,0.1));
            border-color: rgba(245,158,11,0.75);
            transform: translateY(-1px);
        }
        .public-showcase-loadmore:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }
        .public-showcase-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 14px;
        }
        .public-video-card {
            min-width: 0;
            display: grid;
            gap: 9px;
            border: 0;
            padding: 0;
            background: transparent;
            color: var(--text);
            cursor: pointer;
            text-align: left;
        }
        /* 16:9 cards take two columns so the landscape frame reads at a usable
           size instead of being squeezed into a portrait slot. */
        .public-video-card.landscape {
            grid-column: span 2;
        }
        .public-video-card .job-media-card {
            box-shadow: 0 18px 45px rgba(0,0,0,.28);
        }
        .public-video-card-title {
            min-width: 0;
            display: grid;
            gap: 3px;
        }
        .public-video-card-title strong,
        .public-video-card-title span {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .public-video-card-title strong {
            font-size: .86rem;
            font-weight: 900;
        }
        .public-video-card-title span {
            color: var(--muted);
            font-size: .72rem;
            font-weight: 800;
        }
        .modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 40;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(3,5,10,.74);
            backdrop-filter: blur(18px);
        }
        .modal-backdrop.visible {
            display: flex;
        }
        .status-modal {
            width: min(560px, 100%);
            border: 1px solid rgba(97,218,251,.22);
            border-radius: 8px;
            background: rgba(10,13,22,.97);
            box-shadow: 0 28px 100px rgba(0,0,0,.5);
        }
        .gallery-modal-card {
            width: min(860px, 100%);
        }
        .video-modal-card {
            width: min(920px, 96vw);
        }
        .video-modal-card.portrait {
            width: min(430px, calc(100vw - 32px));
        }
        .video-modal-card.landscape {
            width: min(920px, 96vw);
        }
        .video-modal-body {
            gap: 12px;
        }
        .video-player-wrap {
            width: 100%;
            display: grid;
            place-items: center;
            overflow: hidden;
            border: 1px solid rgba(97,218,251,.22);
            border-radius: 8px;
            background: #000;
        }
        .video-player-wrap.portrait {
            width: min(100%, 390px);
            aspect-ratio: 9 / 16;
            max-height: min(78vh, 760px);
            margin: 0 auto;
        }
        .video-player-wrap.landscape {
            aspect-ratio: 16 / 9;
        }
        .video-player {
            width: 100%;
            height: 100%;
            max-height: min(78vh, 760px);
            display: block;
            object-fit: contain;
            background: #000;
        }
        .video-player-wrap.portrait .video-player {
            width: 100%;
            max-width: none;
            aspect-ratio: auto;
            object-fit: cover;
        }
        .video-source-frame {
            width: min(100%, 390px);
            margin: 0 auto;
            padding: 10px;
            border: 1px solid rgba(97,218,251,.18);
            border-radius: 8px;
            background: rgba(255,255,255,.035);
        }
        .video-source-frame[hidden] {
            display: none;
        }
        .video-source-label {
            margin: 0 0 8px;
            color: var(--muted);
            font: 800 .72rem Inter, system-ui, sans-serif;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .video-source-frame img {
            width: 100%;
            max-height: 220px;
            display: block;
            object-fit: contain;
            border-radius: 6px;
            background: #000;
        }
        .video-modal-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .video-modal-actions a {
            min-height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 13px;
            border: 1px solid var(--line);
            border-radius: 8px;
            color: var(--text);
            background: rgba(255,255,255,.04);
            font-size: .82rem;
            font-weight: 900;
        }
        .modal-head {
            display: flex;
            justify-content: space-between;
            gap: 14px;
            padding: 18px 18px 12px;
            border-bottom: 1px solid var(--line);
        }
        .modal-head h2 {
            margin: 0;
            font-size: 1.05rem;
        }
        .modal-head p {
            margin: 5px 0 0;
            color: var(--muted);
            font-size: .84rem;
            line-height: 1.45;
        }
        .modal-close {
            width: 36px;
            min-height: 36px;
            padding: 0;
            color: var(--text);
            background: rgba(255,255,255,.05);
        }
        .modal-body {
            display: grid;
            gap: 14px;
            padding: 18px;
        }
        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
            gap: 10px;
            max-height: min(62vh, 620px);
            overflow: auto;
            padding-right: 4px;
        }
        .step-list {
            display: grid;
            gap: 10px;
        }
        .step-item {
            display: grid;
            grid-template-columns: 28px 1fr;
            gap: 10px;
            align-items: start;
            padding: 10px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: rgba(255,255,255,.03);
        }
        .step-dot {
            width: 28px;
            height: 28px;
            border-radius: 999px;
            display: grid;
            place-items: center;
            color: var(--muted);
            background: rgba(255,255,255,.06);
            font-size: .72rem;
            font-weight: 900;
        }
        .step-item.running .step-dot {
            color: #071018;
            background: var(--accent);
        }
        .step-item.done .step-dot {
            color: #071018;
            background: var(--ok);
        }
        .step-item.failed .step-dot {
            color: #fff;
            background: var(--accent-2);
        }
        .step-label {
            font-weight: 900;
            font-size: .9rem;
        }
        .step-detail {
            margin-top: 3px;
            color: var(--muted);
            font-size: .8rem;
            line-height: 1.4;
        }
        .step-count {
            margin-top: 4px;
            color: var(--accent);
            font-size: .72rem;
            font-weight: 900;
        }
        .toast {
            position: fixed;
            right: 18px;
            bottom: 18px;
            max-width: 360px;
            padding: 14px 16px;
            border: 1px solid rgba(94,230,168,.45);
            border-radius: 8px;
            background: rgba(7, 16, 18, .94);
            color: var(--text);
            box-shadow: 0 18px 50px rgba(0,0,0,.36);
            transform: translateY(18px);
            opacity: 0;
            pointer-events: none;
            transition: opacity .18s ease, transform .18s ease;
        }
        .toast.visible {
            opacity: 1;
            transform: translateY(0);
        }
        .toast strong {
            display: block;
            margin-bottom: 4px;
            color: var(--ok);
        }
        @media (max-width: 1100px) {
            .job-feed {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }
        @media (max-width: 760px) {
            .job-feed {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .public-showcase-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 640px) {
            body {
                padding-bottom: 260px;
            }
            .topbar {
                height: auto;
                padding-top: 14px;
                padding-bottom: 14px;
                align-items: flex-start;
                gap: 12px;
            }
            .nav-actions {
                flex-wrap: wrap;
                justify-content: flex-end;
            }
            .nav-actions a,
            .nav-actions button {
                height: 36px;
                padding: 0 12px;
                width: auto;
            }
            .account-pill {
                width: 100%;
                justify-content: flex-start;
            }
            .account-name {
                max-width: 220px;
            }
            .job-card-header {
                display: grid;
            }
            .job-feed {
                grid-template-columns: minmax(0, 1fr);
            }
            /* On mobile single-column the span:2 would push landscape off
               the grid — force back to 1 column. */
            .job-card.landscape {
                grid-column: span 1;
            }
            .public-showcase-head {
                display: grid;
                align-items: start;
            }
            .public-showcase-grid {
                grid-template-columns: 1fr;
            }
            .job-actions {
                grid-template-columns: 1fr;
            }
            main {
                align-items: start;
                padding-top: 58px;
            }
            .form-row {
                align-items: stretch;
            }
            .credit-estimate {
                min-width: 112px;
            }
            .character-picker-head {
                align-items: center;
                justify-content: flex-end;
            }
            .character-picker {
                grid-template-columns: minmax(0, 1fr) auto;
                grid-template-rows: auto auto;
                gap: 8px;
                padding: 10px 14px;
            }
            .character-picker.minimized {
                left: auto;
                right: 10px;
                bottom: 10px;
                width: min(230px, calc(100vw - 20px));
                grid-template-columns: 1fr auto;
                padding: 9px 10px;
                border-radius: 999px;
            }
            .character-picker-head {
                grid-column: 2;
                grid-row: 1;
            }
            .character-picker.minimized .character-picker-head {
                display: none;
            }
            .character-toggle-button {
                grid-column: 2;
                grid-row: 2;
            }
            .character-picker button {
                width: auto;
            }
            .character-row {
                grid-column: 1;
                grid-row: 1 / span 2;
                min-width: 0;
            }
            .character-tile {
                flex-basis: 118px;
                width: 118px;
                min-height: 140px;
            }
            .character-tile.add {
                min-height: 140px;
            }
            .character-row {
                display: flex;
            }
            .character-empty {
                flex-basis: 220px;
                min-height: 140px;
            }
            button {
                width: 100%;
            }
            .nav-actions button {
                width: auto;
            }
        }
        /* Constrain the song-modal iframe to the stage area and kill the
           internal scroll bar that appears when /song/<uuid> is loaded
           inside the modal phone. */
        .home-song-modal-stage,
        .home-song-modal-phone {
            overflow: hidden !important;
        }
        .home-song-modal-phone iframe[data-home-song-frame] {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            border: 0;
            background: #000;
            overflow: hidden;
        }

        /* ===== Advanced (mini link) ===== */
        .advanced-options.advanced-mini {
            background: transparent !important;
            border: 0 !important;
            box-shadow: none !important;
            padding: 0 !important;
            margin: 8px 0 0 !important;
            text-align: center;
        }
        .advanced-mini-toggle {
            background: transparent;
            border: 0;
            padding: 6px 10px;
            color: rgba(255,255,255,0.55);
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            border-radius: 6px;
            transition: color 0.18s, background 0.18s;
        }
        .advanced-mini-toggle:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.04); }
        .advanced-mini-chevron { transition: transform 0.2s; display: inline-block; font-size: 0.7rem; }
        .advanced-options.advanced-mini.open .advanced-mini-chevron { transform: rotate(180deg); }
        .advanced-mini-hidden { display: none; }
        .advanced-options.advanced-mini .advanced-grid {
            margin-top: 10px;
            padding: 14px;
            background: rgba(0,0,0,0.35);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            text-align: left;
        }
        /* ===== Aspect ratio pill selector ===== */
        /* Make the prompt input bar a flex row so the picker floats right */
        .prompt-bar {
            display: flex !important;
            align-items: center;
            gap: 10px;
        }
        .prompt-bar .prompt-input {
            flex: 1 1 auto;
            min-width: 0;
        }
        .prompt-bar-aspect {
            flex: 0 0 auto;
            margin-right: 4px;
        }
        .aspect-picker {
            display: inline-flex;
            gap: 4px;
            background: rgba(0,0,0,0.4);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            padding: 3px;
        }
        .aspect-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 10px;
            border: 0;
            background: transparent;
            color: rgba(255,255,255,0.55);
            font-weight: 700;
            font-size: 0.74rem;
            letter-spacing: 0.04em;
            border-radius: 7px;
            cursor: pointer;
            transition: background 0.18s, color 0.18s;
        }
        .aspect-pill:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.04); }
        .aspect-pill.active {
            background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(245,158,11,0.08));
            color: #FBBF24;
            box-shadow: inset 0 0 0 1px rgba(245,158,11,0.45);
        }
        .aspect-shape {
            display: inline-block;
            border: 1.5px solid currentColor;
            border-radius: 2px;
            opacity: 0.85;
        }
        .aspect-shape.vertical {
            width: 9px;
            height: 14px;
        }
        .aspect-shape.horizontal {
            width: 16px;
            height: 9px;
        }
        .aspect-label {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 700;
        }
        /* Hide the old aspect-ratio field in Advanced since the pill picker
           replaces it. Keep the <select> in the DOM so existing JS can still
           read its .value. */
        .advanced-field:has(#aspect-ratio) { display: none; }
        #aspect-ratio { display: none; }

        /* ===== Mode tabs (Prompt | Music video) ===== */
        .mode-tabs {
            display: inline-flex;
            gap: 10px;
            background: transparent;
            border: 0;
            border-radius: 0;
            padding: 0;
            margin-bottom: 14px;
        }
        .mode-tab {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.04);
            color: rgba(255,255,255,0.6);
            font-weight: 700;
            font-size: 0.88rem;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
        }
        .mode-tab:hover {
            color: rgba(255,255,255,0.95);
            border-color: rgba(255,255,255,0.25);
            background: rgba(255,255,255,0.07);
        }
        .mode-tab.active {
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
            color: #110a1f;
            border-color: transparent;
            box-shadow: 0 0 22px rgba(245,158,11,0.45);
        }
        .mode-tab.locked {
            opacity: 0.5;
            border-color: rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.03);
            box-shadow: none;
        }
        .mode-tab.locked::after {
            content: 'Paid';
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 18px;
            padding: 0 6px;
            border-radius: 999px;
            color: #110a1f;
            background: rgba(251,191,36,0.9);
            font-size: 0.62rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .mode-tab .mode-tab-icon { font-size: 1rem; opacity: 0.85; }
        .mode-tab.active .mode-tab-icon { opacity: 1; }

        /* ===== Audio upload row ===== */
        .audio-upload-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 8px;
            flex-wrap: wrap;
        }
        .audio-upload-or {
            color: rgba(255,255,255,0.45);
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        .audio-upload-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 7px 14px;
            border: 1px dashed rgba(245,158,11,0.45);
            border-radius: 8px;
            cursor: pointer;
            color: #FBBF24;
            font-weight: 700;
            font-size: 0.82rem;
            background: rgba(245,158,11,0.05);
            transition: background 0.18s, border-color 0.18s;
        }
        .audio-upload-btn:hover { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.7); }
        .audio-upload-icon { font-size: 0.95rem; }
        .audio-upload-clear {
            background: rgba(255,79,139,0.12);
            color: #ff9fbd;
            border: 1px solid rgba(255,79,139,0.42);
            border-radius: 8px;
            padding: 5px 10px;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
        }

        /* When a mode button controls the LLM, dim the advanced selector so
           users see it's been auto-set. */
        #llm-provider.mode-locked {
            opacity: 0.45;
            pointer-events: none;
            transition: opacity 0.25s;
        }
        /* Video model is mode-locked but still browseable — user can pull down
           to view all options. The current pick stays bright white, the rest
           shade. We DON'T dim the whole <select> with opacity (that would also
           fade the active label); instead we shade only the disabled <option>s. */
        #video-model.mode-locked {
            cursor: not-allowed;
            color: #fff;
        }
        #video-model.mode-locked option {
            color: #fff;
            background: #050812;
        }
        #video-model.mode-locked option:disabled {
            color: rgba(255,255,255,0.3);
        }

        /* ===== Broadcast theme (z.ai-inspired hero) ===== */
        :root {
            --accent-amber: #F59E0B;
            --accent-amber-bright: #FBBF24;
            --accent-cyan: #06B6D4;
            --live-red: #EF4444;
        }
        body::before {
            content: '';
            position: fixed; inset: 0;
            pointer-events: none; z-index: 1;
            background:
                radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245,158,11,0.10), transparent 60%),
                radial-gradient(ellipse 60% 40% at 90% 30%, rgba(6,182,212,0.07), transparent 70%);
        }
        body::after {
            content: '';
            position: fixed; inset: 0;
            pointer-events: none; z-index: 2;
            background: repeating-linear-gradient(
                0deg,
                rgba(255,255,255,0.025) 0px,
                rgba(255,255,255,0.025) 1px,
                transparent 1px,
                transparent 3px
            );
            mix-blend-mode: overlay;
            opacity: 0.55;
        }
        main, nav, .shell { position: relative; z-index: 3; }
        .broadcast-hero {
            position: relative;
            padding-top: 64px;
        }
        .broadcast-hero .eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 700;
            font-size: 0.72rem;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--accent-amber-bright);
            background: rgba(245,158,11,0.10);
            border: 1px solid rgba(245,158,11,0.35);
            padding: 5px 12px;
            border-radius: 999px;
        }
        .eyebrow-dot {
            width: 7px; height: 7px; border-radius: 999px;
            background: var(--live-red);
            box-shadow: 0 0 8px var(--live-red);
            animation: broadcast-pulse 1.4s ease-in-out infinite;
        }
        @keyframes broadcast-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

        /* Color bars decoration top-right of hero */
        .broadcast-bars {
            position: absolute;
            top: 16px; right: 16px;
            display: flex;
            gap: 0;
            height: 18px;
            border-radius: 4px;
            overflow: hidden;
            opacity: 0.55;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
        }
        .broadcast-bars span { display: block; width: 14px; height: 100%; }
        .broadcast-bars span:nth-child(1) { background: #ffffff; }
        .broadcast-bars span:nth-child(2) { background: #ffe700; }
        .broadcast-bars span:nth-child(3) { background: #00ffff; }
        .broadcast-bars span:nth-child(4) { background: #00ff00; }
        .broadcast-bars span:nth-child(5) { background: #ff00ff; }
        .broadcast-bars span:nth-child(6) { background: #ff0000; }
        .broadcast-bars span:nth-child(7) { background: #0000ff; }

        /* Homepage footer (with bottom padding so the GP bar doesn't cover it) */
        .hero-footer {
            max-width: 1100px;
            margin: 56px auto 0;
            padding: 24px 12px 40px;
            border-top: 1px solid rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.5);
            font-size: 0.82rem;
            text-align: center;
            position: relative;
            z-index: 4;
        }
        .hero-footer-row {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 18px;
            margin-bottom: 14px;
        }
        .hero-footer-row a {
            color: rgba(255,255,255,0.7);
            text-decoration: none;
            font-weight: 600;
        }
        .hero-footer-row a:hover { color: #fff; }
        .hero-footer-bottom {
            color: rgba(255,255,255,0.35);
            font-size: 0.78rem;
        }

        /* Small credits note under the hero claim row */
        .hero-credits-note {
            margin: -8px 0 24px;
            font-size: 0.82rem;
            color: rgba(255,255,255,0.5);
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }
        .hero-credits-note strong { color: rgba(255,255,255,0.9); font-weight: 700; }
        .hero-credits-note a {
            color: #6cf2ff;
            font-weight: 700;
            text-decoration: none;
        }
        .hero-credits-note a:hover { text-decoration: underline; }

        /* Page bottom padding so the GP bar doesn't cover the last content */
        /* Bottom padding accounts for both the fixed character picker (~240px)
           and the GP audio bar (~80px) so the footer scrolls fully into view
           instead of getting trapped underneath. */
        body { padding-bottom: 340px; }
        /* When the character picker is minimized (collapsed pill), we don't
           need nearly as much room — just enough for the GP bar. */
        body:has(.character-picker.minimized) { padding-bottom: 130px; }
        body:has(.character-picker.gallery-expanded) { padding-bottom: min(58vh, 580px); }

        /* Compact hero — the URL IS the headline. Type your handle directly. */
        .hero-claim {
            display: flex;
            align-items: baseline;
            flex-wrap: nowrap;
            gap: 0;
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 900;
            letter-spacing: -0.025em;
            line-height: 1.05;
            font-size: clamp(1.7rem, 5.6vw, 4.2rem);
            margin: 18px 0 12px;
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
        }
        .hero-claim-prefix {
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 32px rgba(245,158,11,0.35);
            display: inline-block;
        }
        .hero-claim-input {
            background: transparent;
            border: 0;
            border-bottom: 3px dashed rgba(255,255,255,0.25);
            color: #fff;
            font: inherit;
            padding: 0 4px 4px;
            margin: 0;
            outline: none;
            width: 13ch;
            min-width: 13ch;
            max-width: 100%;
            flex: 0 1 auto;
            transition: border-color 0.18s, width 0.18s, color 0.18s;
            text-transform: lowercase;
        }
        .hero-claim-input.typing {
            color: rgba(255,255,255,0.55);
            font-style: italic;
            caret-color: transparent;
        }
        .hero-claim-input.typing.real {
            color: rgba(108,242,255,0.92);
            font-style: normal;
        }
        .hero-claim-input:focus {
            border-bottom-color: rgba(245,158,11,0.85);
        }
        .hero-claim-input.ok {
            border-bottom-color: #4ade80;
            color: #4ade80;
        }
        .hero-claim-input.err {
            border-bottom-color: #ff6b8a;
            color: #ff8da6;
        }
        .hero-claim-input::placeholder {
            color: rgba(255,255,255,0.35);
            font-style: italic;
        }
        .hero-claim-status {
            display: inline-block;
            margin-left: 14px;
            font-size: 0.42em; /* relative to the hero font-size for proper scaling */
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            line-height: 1;
            vertical-align: middle;
            opacity: 0;
            transition: opacity 0.2s, color 0.2s;
            color: rgba(255,255,255,0.6);
        }
        .hero-claim-status.visible { opacity: 1; }
        .hero-claim-status.ok { color: #4ade80; }
        .hero-claim-status.err { color: #ff8da6; }
        .hero-claim-sub {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin: 0 0 24px;
        }
        .hero-claim-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 18px;
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
            color: #110a1f;
            border: 0;
            border-radius: 10px;
            font-weight: 800;
            font-size: 0.88rem;
            cursor: pointer;
            box-shadow: 0 0 24px rgba(245,158,11,0.45);
        }
        .hero-claim-btn[hidden] { display: none !important; }
        .hero-claim-open {
            color: #6cf2ff;
            font-weight: 800;
            text-decoration: none;
            font-size: 0.88rem;
        }
        .hero-claim-open[hidden] { display: none !important; }
        /* The old standalone strip is redundant once the hero owns the claim
           flow. Hide it on the homepage. */
        #username-strip { display: none !important; }
        /* Old single hero-title styles (still used elsewhere) */
        #home-title.hero-title-legacy {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 900;
            letter-spacing: -0.025em;
            line-height: 1.02;
            font-size: clamp(2.3rem, 6vw, 4.6rem);
            margin-top: 18px;
        }
        .hero-accent {
            background: linear-gradient(180deg, var(--accent-amber-bright), var(--accent-amber));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 32px rgba(245,158,11,0.35);
        }
        .hero-line2 {
            display: inline-block;
            color: rgba(255,255,255,0.85);
            font-weight: 700;
        }
        .subcopy-handle {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 700;
            color: var(--accent-amber-bright);
            background: rgba(245,158,11,0.10);
            padding: 2px 8px;
            border-radius: 6px;
        }

        /* Restyle the prompt panel as a broadcast console */
        .prompt-panel {
            border: 1px solid rgba(245,158,11,0.18) !important;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 20px 60px rgba(0,0,0,0.55) !important;
        }
        .prompt-input:focus {
            box-shadow: 0 0 0 2px rgba(245,158,11,0.35) !important;
        }
        /* "Create Video" submit gets the amber glow */
        .prompt-actions button[type="submit"],
        .prompt-bar + .prompt-actions button[type="submit"] {
            background: linear-gradient(180deg, var(--accent-amber-bright), var(--accent-amber)) !important;
            color: #110a1f !important;
            box-shadow: 0 0 24px rgba(245,158,11,0.45) !important;
            text-shadow: none !important;
        }

        /* Public showcase / Live Channels headings get Space Grotesk display */
        .public-showcase h2, #live-channels h2 {
            font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
            font-weight: 900;
            letter-spacing: -0.015em;
        }
        .public-showcase-kicker {
            color: var(--accent-amber-bright) !important;
            letter-spacing: 0.16em !important;
        }
