        * { margin: 0; padding: 0; box-sizing: border-box; }

        /* Master text-opacity (dev/privacy). Slider in the top bar drives this.
           Default 0 = all gift text hidden on launch, for working on imagery/Chromata. */
        :root { --text-master-opacity: 1; }

        html, body {
            width: 100vw;
            height: 100vh;
            min-width: 0;
            overflow: hidden;
            background: #0a0a0a;
        }

        /* ===== APP SHELL ===== */
        #app-shell { display: flex; flex-direction: column; height: 100vh; background: #0a0a0a; }

        #app-topbar {
            display: flex; align-items: center; gap: 12px;
            height: 52px; flex-shrink: 0; padding: 0 16px;
            background: linear-gradient(180deg, #1c1c1f 0%, #161618 100%);
            border-bottom: 1px solid #2a2a2a;
        }
        .tb-brand { display:flex; align-items:center; gap:8px; font:600 15px -apple-system, system-ui, sans-serif; color:#fff; letter-spacing:.02em; }
        .tb-dot { width:11px; height:11px; border-radius:50%; background: conic-gradient(from 0deg, #b98cff, #6ad7ff, #ffd86a, #ff8ad0, #b98cff); box-shadow:0 0 10px rgba(150,120,255,.6); }
        .tb-project { display:flex; align-items:center; gap:8px; min-width:0; color:#c9c5ce; font:600 12px -apple-system, system-ui, sans-serif; }
        #tb-project-name { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .tb-save-state { color:#777580; font-size:11px; font-weight:500; }
        .tb-save-state[data-state="saving…"], .tb-save-state[data-state="saving..."] { color:#d8bd78; }
        .tb-save-state[data-state="unsaved"] { color:#eaa28b; }
        .tb-save-state[data-state="saved"] { color:#8cc9a3; }
        .tb-spacer { flex:1; }
        .tb-actions { display:flex; gap:8px; align-items:center; }
        .tb-btn { height:32px; padding:0 14px; border-radius:7px; cursor:pointer; background:#2a2a2e; border:1px solid #3a3a40; color:#ddd; font:500 13px -apple-system, system-ui, sans-serif; transition: all .12s; }
        .tb-btn:hover { background:#34343a; color:#fff; }
        .tb-icon { width:32px; padding:0; font-size:18px; }
        .tb-primary { background: var(--pe-accent, #4a9eff); border-color: var(--pe-accent, #4a9eff); color:#0a0a0a; font-weight:600; }
        .tb-primary:hover { filter:brightness(1.1); }
        .tb-add-images { background:#c8a8f4; border-color:#d7bef7; color:#15121a; font-weight:700; }
        .tb-add-images:hover { background:#d7bef7; color:#0a0810; }

        /* Master text-opacity slider (dev/privacy control) */
        .tb-textop { display:flex; align-items:center; gap:8px; margin-right:10px; color:#8a8a92; font:600 10px -apple-system, system-ui, sans-serif; letter-spacing:.08em; text-transform:uppercase; }
        .tb-textop input[type=range] { width:96px; height:4px; accent-color: var(--pe-accent, #4a9eff); cursor:pointer; }
        .tb-textop .tb-textop-val { width:34px; text-align:right; font-variant-numeric:tabular-nums; color:#c8c8d0; }

        /* app body: tools panel (left) + stage (right) */
        #app-wrapper { display: flex; flex: 1; min-height: 0; background: #0a0a0a; }

        #editor-panel {
            width: 0; height: 100%; overflow: hidden;
            background: #141414; border-right: 1px solid #2a2a2a;
            flex-shrink: 0; transition: width 0.25s ease;
        }
        #editor-panel.open { width: 380px; overflow-y: auto; }

        /* stage: fills remaining space, centers + scales the canvas */
        #canvas-area {
            position: relative; flex: 1; min-width: 0; height: 100%;
            display: flex; align-items: center; justify-content: center; overflow: hidden;
            background: radial-gradient(120% 120% at 50% 0%, #161620 0%, #0a0a0a 60%);
        }
        #canvas-area:focus-visible { outline: 3px solid #7edcf2; outline-offset: -3px; }
        #stage-scale { width: var(--stage-width, 1075px); height: var(--stage-height, 806px); flex: 0 0 auto; transform-origin: center center; box-shadow: 0 16px 60px rgba(0,0,0,.6); }

        /* start overlay (big Play) */
        #stage-overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; z-index:60; pointer-events:none; }
        .stage-play { pointer-events:auto; display:flex; flex-direction:column; align-items:center; gap:10px; background:rgba(10,10,12,.35); backdrop-filter:blur(2px); border:1px solid rgba(255,255,255,.15); color:#fff; width:130px; height:130px; border-radius:50%; cursor:pointer; transition:transform .15s, background .15s; }
        .stage-play:hover { transform:scale(1.06); background:rgba(20,20,26,.55); }
        .stage-play-tri { font-size:38px; line-height:1; margin-left:6px; }
        .stage-play-label { font:600 13px -apple-system, system-ui, sans-serif; letter-spacing:.08em; text-transform:uppercase; }

        .stage-image-ingest {
            position:absolute; inset:18px; z-index:70; display:flex; align-items:center; justify-content:center;
            border:2px dashed rgba(200,168,244,.48); border-radius:18px; pointer-events:none;
            background:rgba(8,8,12,.76); backdrop-filter:blur(7px); transition:border-color .15s, background .15s;
        }
        .stage-image-ingest[hidden] { display:none; }
        .stage-image-ingest.drop-active { border-color:#7edcf2; background:rgba(17,31,39,.88); }
        .stage-image-ingest-card {
            width:min(520px, calc(100% - 44px)); padding:34px; border:1px solid rgba(255,255,255,.12);
            border-radius:16px; color:#f2eef6; background:linear-gradient(150deg, rgba(38,34,49,.96), rgba(18,19,25,.97));
            box-shadow:0 20px 70px rgba(0,0,0,.48); text-align:center; pointer-events:auto;
            font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }
        .stage-image-ingest-kicker { margin:0 0 7px; color:#bba3df; font-size:10px; font-weight:750; letter-spacing:.16em; text-transform:uppercase; }
        .stage-image-ingest h2 { margin:0; font:500 34px/1.1 "Cormorant Garamond", Georgia, serif; }
        .stage-image-ingest #stage-image-ingest-help { max-width:460px; margin:12px auto 20px; color:#b8b4bf; font-size:14px; line-height:1.55; }
        .stage-image-ingest .project-action { min-width:160px; }
        .stage-image-ingest-formats { margin:12px 0 0; color:#7f7b87; font-size:10px; letter-spacing:.04em; }
        .image-import-status {
            position:absolute; top:14px; right:14px; z-index:90; max-width:min(520px, calc(100% - 28px));
            min-height:0; margin:0; padding:9px 12px; border:1px solid rgba(126,220,242,.32); border-radius:8px;
            color:#d9f6fc; background:rgba(20,34,39,.94); opacity:0; transform:translateY(-6px); pointer-events:none;
            font:600 12px/1.4 -apple-system,system-ui,sans-serif; transition:opacity .15s, transform .15s;
        }
        .image-import-status.visible { opacity:1; transform:translateY(0); }
        .image-import-status.error { color:#ffd4ca; border-color:rgba(240,181,167,.44); background:rgba(48,24,23,.95); }
        #canvas-area.image-drag-active { box-shadow:inset 0 0 0 3px rgba(126,220,242,.75); }

        /* PREVIEW MODE - hide chrome, canvas fills viewport */
        body.preview-mode #app-topbar, body.preview-mode #editor-panel,
        body.preview-mode .stage-image-ingest, body.preview-mode .image-import-status { display:none; }
        body.preview-mode #canvas-area { background:#000; }
        body.preview-mode #stage-scale { box-shadow:none; }

        /* ===== TIMELINE DOCK - full-width bottom strip; the timeline view lives here.
           Collapsed by default; opens in timeline mode. The animation pane (#app-wrapper)
           shrinks to make room since the dock takes layout height - no overlay. ===== */
        #timeline-dock {
            flex-shrink: 0; height: 0; overflow: hidden;
            display: flex; flex-direction: column;
            background: linear-gradient(180deg, #141417 0%, #0e0e10 100%);
            border-top: 1px solid #2a2a2a;
            transition: height 0.25s ease;
        }
        #app-shell.tl-open #timeline-dock { height: 390px; }
        body.preview-mode #timeline-dock { display: none; }

        #timeline-dock-bar {
            display: flex; align-items: center; gap: 10px;
            height: 34px; flex-shrink: 0; padding: 0 14px;
            background: #161618; border-bottom: 1px solid #242424;
        }
        #timeline-dock-bar .td-title { font:600 11px -apple-system, system-ui, sans-serif; letter-spacing:.1em; text-transform:uppercase; color:#8a8a92; }
        #timeline-dock-bar .td-spacer { flex: 1; }
        #timeline-dock-bar .td-close {
            width:24px; height:24px; border-radius:5px; cursor:pointer;
            display:flex; align-items:center; justify-content:center;
            background:#232327; border:1px solid #34343a; color:#c8c8c8; font-size:15px; line-height:1;
            transition: background .12s, color .12s;
        }
        #timeline-dock-bar .td-close:hover { background:#34343a; color:#fff; }

        #timeline-dock-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 16px 14px; }
        /* The timeline fills the wide dock: drop the panel-era card chrome so it reads as a
           full-width strip, and give the lanes a touch more height in the roomier context. */
        #timeline-dock-body .pe-tl { margin: 0; background: transparent; border: none; padding: 0; font-size: 12px; }
        #timeline-dock-body .pe-tl-lane { height: 34px; }

        #container {
            position: relative;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
            background: #000;
            transition: opacity 1s ease;
        }

        #container.fading {
            opacity: 0;
        }

        #base-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
        }

        #active-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
            z-index: 2;
        }

        #active-layer canvas {
            position: absolute;
            top: 0;
            left: 0;
        }

        #subject-mask-overlay {
            position: absolute;
            left: 0;
            top: 0;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
            z-index: 58;
            pointer-events: none;
        }
        #subject-mask-overlay.drawing { pointer-events: auto; cursor: crosshair; }

        .studio-dialog {
            position: fixed;
            inset: 72px 22px auto auto;
            width: min(430px, calc(100vw - 44px));
            max-height: calc(100vh - 94px);
            padding: 0;
            overflow: auto;
            color: #eeeaf3;
            background: #15151a;
            border: 1px solid #3a3942;
            border-radius: 14px;
            box-shadow: 0 24px 80px rgba(0,0,0,.7);
            z-index: 10020;
        }
        .studio-dialog-header, .studio-dialog-footer { display:flex; align-items:center; gap:14px; padding:16px 18px; }
        .studio-dialog-header { border-bottom:1px solid #2c2b32; }
        .studio-dialog-header > div { flex:1; min-width:0; }
        .studio-dialog-header h2 { margin:2px 0 0; font:600 17px -apple-system,system-ui,sans-serif; }
        .studio-dialog-kicker { color:#9f9aa8; font:600 10px -apple-system,system-ui,sans-serif; letter-spacing:.12em; text-transform:uppercase; }
        .studio-dialog-close { width:32px; height:32px; color:#d8d4dc; background:#27262d; border:1px solid #3a3942; border-radius:7px; font-size:20px; cursor:pointer; }
        .studio-dialog-body { padding:18px; }
        .studio-dialog-footer { justify-content:flex-end; border-top:1px solid #2c2b32; }
        .subject-privacy, .subject-status, .subject-field-help { color:#aaa5b2; font:12px/1.5 -apple-system,system-ui,sans-serif; }
        .subject-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 10px; }
        .subject-actions .project-action { padding:8px 11px; }
        .subject-status { min-height:36px; padding:8px 10px; background:#0f1014; border-radius:7px; }
        .subject-status.error { color:#f0b5a7; }
        .subject-region-list { display:grid; gap:6px; margin:12px 0; list-style:none; }
        .subject-region-item { display:flex; gap:6px; }
        .subject-region-select, .subject-region-remove { border:1px solid #363540; border-radius:7px; color:#d6d2dc; background:#222127; cursor:pointer; font:500 12px -apple-system,system-ui,sans-serif; }
        .subject-region-select { flex:1; padding:9px; text-align:left; }
        .subject-region-select.active { border-color:#75d3ff; background:#1d2b34; }
        .subject-region-remove { padding:0 9px; color:#c7a39c; }
        .subject-region-empty { padding:12px; color:#8e8996; background:#111217; border:1px dashed #34333b; border-radius:7px; font:12px/1.4 -apple-system,system-ui,sans-serif; }
        .subject-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
        .subject-field-grid label { display:grid; gap:6px; color:#c7c2cd; font:600 11px -apple-system,system-ui,sans-serif; }
        .subject-field-grid label:first-child, .subject-field-grid label:nth-child(2) { grid-column:1 / -1; }
        .subject-field-grid select { color:#eee; background:#222127; border:1px solid #3b3a43; border-radius:6px; padding:8px; }
        .subject-field-grid output { justify-self:end; color:#8fcce8; font-variant-numeric:tabular-nums; }
        .subject-field-grid input[type=range] { width:100%; accent-color:#75d3ff; }
        .subject-overlay-toggle { display:flex; gap:8px; margin-top:16px; color:#aaa5b2; font:12px -apple-system,system-ui,sans-serif; }
        .export-dialog { width:min(500px, calc(100vw - 44px)); }
        .export-settings { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
        .export-settings label { display:grid; gap:6px; color:#c7c2cd; font:600 11px -apple-system,system-ui,sans-serif; }
        .export-settings label:first-child { grid-column:1 / -1; }
        .export-settings input, .export-settings select { min-width:0; padding:9px; color:#eee; background:#222127; border:1px solid #3b3a43; border-radius:6px; }
        .export-summary, .export-progress-label { margin-top:12px; color:#aaa5b2; font:12px/1.5 -apple-system,system-ui,sans-serif; }
        .export-progress { width:100%; height:10px; margin-top:14px; accent-color:#75d3ff; }
        .export-outro { margin:16px 0 0; padding:13px; border:1px solid #34333c; border-radius:9px; }
        .export-outro legend { padding:0 6px; color:#aaa5b2; font:600 10px -apple-system,system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; }
        .export-outro-toggle { display:flex; align-items:center; gap:8px; color:#e2dee7; font:600 12px -apple-system,system-ui,sans-serif; }
        .export-outro-toggle input { accent-color:#75d3ff; }
        .export-outro-settings { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
        .export-outro-settings label { display:grid; gap:5px; min-width:0; color:#aaa5b2; font:600 10px -apple-system,system-ui,sans-serif; }
        .export-outro-settings label:last-child { grid-column:1 / -1; }
        .export-outro-settings input, .export-outro-settings select { min-width:0; padding:8px; color:#eee; background:#222127; border:1px solid #3b3a43; border-radius:6px; }
        .export-outro-settings[aria-disabled="true"] { opacity:.48; }
        .export-outro-note { margin:10px 0 0; color:#918c99; font:11px/1.45 -apple-system,system-ui,sans-serif; }

        .media-dialog { width:min(680px, calc(100vw - 44px)); }
        .media-section + .media-section { margin-top:20px; padding-top:18px; border-top:1px solid #302f37; }
        .media-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:10px; }
        .media-section-heading h3 { margin:0; color:#e8e4eb; font:600 14px -apple-system,system-ui,sans-serif; }
        .media-section-heading p { margin:4px 0 0; color:#918c99; font:12px/1.45 -apple-system,system-ui,sans-serif; }
        .media-section-heading .project-action { flex:0 0 auto; padding:8px 11px; }
        .media-list { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
        .media-empty { padding:12px; color:#8e8996; background:#111217; border:1px dashed #34333b; border-radius:7px; font:12px/1.4 -apple-system,system-ui,sans-serif; }
        .media-item { min-width:0; padding:12px; background:#1b1a20; border:1px solid #34333c; border-radius:9px; }
        .media-missing-item { display:flex; align-items:center; gap:10px; }
        .media-scene-list {
            margin-top:12px; display:grid; gap:10px; max-height:none;
            grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
        }
        .media-scene-item { display:flex; align-items:center; gap:10px; padding:10px 12px; }
        .media-scene-item .media-item-name { font-size:13px; }
        .media-scene-thumb { width:74px; height:50px; flex:0 0 auto; object-fit:cover; border-radius:5px; background:#0a0a0a; }
        .media-dialog { inset:22px; width:auto; max-width:none; max-height:none; }
        .media-dialog .studio-dialog-body { max-height:calc(100vh - 190px); overflow-y:auto; }
        .media-item-summary { flex:1; min-width:0; }
        .media-item-name { overflow:hidden; color:#e2dee7; font:600 12px -apple-system,system-ui,sans-serif; text-overflow:ellipsis; white-space:nowrap; }
        .media-item-meta { margin-top:3px; color:#918c99; font:11px/1.4 -apple-system,system-ui,sans-serif; }
        .media-item .project-action { padding:7px 10px; }
        .media-audio-head { display:flex; align-items:center; gap:9px; }
        .media-audio-head .media-item-summary { margin-right:auto; }
        .media-mute { display:flex; align-items:center; gap:5px; color:#bcb7c3; font:11px -apple-system,system-ui,sans-serif; }
        .media-audio-controls { display:grid; grid-template-columns:1.35fr repeat(3, minmax(72px, .75fr)); gap:9px; margin-top:12px; }
        .media-audio-controls label { display:grid; gap:5px; min-width:0; color:#aaa5b2; font:600 10px -apple-system,system-ui,sans-serif; letter-spacing:.03em; }
        .media-audio-controls input[type=number] { min-width:0; width:100%; padding:7px; color:#eee; background:#111217; border:1px solid #3b3a43; border-radius:6px; font-variant-numeric:tabular-nums; }
        .media-volume-line { display:flex; align-items:center; gap:7px; }
        .media-volume-line input { min-width:0; width:100%; accent-color:#75d3ff; }
        .media-volume-line output { width:34px; color:#8fcce8; font:11px -apple-system,system-ui,sans-serif; font-variant-numeric:tabular-nums; text-align:right; }
        .media-status { margin-top:14px; }
        @media (max-width: 700px) {
            .media-audio-controls { grid-template-columns:1fr 1fr; }
        }

        .source-img { display: none; }

        /* Intro text overlay - matches browser version */
        #intro-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
            pointer-events: none;
            z-index: 50;
        }

        .intro-text-item {
            position: absolute;
            z-index: 51;
            color: rgba(255, 255, 255, 0.95);
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-weight: 300;
            font-size: 32px;
            line-height: 1.4;
            max-width: 50%;
            opacity: 0;
            transform: translateY(8px);
            transition: opacity 0.8s ease, transform 0.8s ease;
            text-shadow: 0 2px 25px rgba(0, 0, 0, 0.8),
                         0 0 50px rgba(0, 0, 0, 0.6);
            letter-spacing: 0.02em;
        }

        .intro-text-item.visible {
            opacity: 1;
            transform: translateY(0);
        }

        /* Narrative text overlay - for images after intro */
        #text-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: var(--stage-width, 1075px);
            height: var(--stage-height, 806px);
            pointer-events: none;
            z-index: 10;
        }

        .narrative-text {
            position: absolute;
            color: rgba(255, 255, 255, 0.95);
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-weight: 300;
            font-size: 28px;
            line-height: 1.5;
            white-space: pre-line;
            opacity: 0;
            transform: translateY(8px);
            transition: opacity 1s ease, transform 1s ease;
            text-shadow: 0 2px 25px rgba(0, 0, 0, 0.8),
                         0 0 50px rgba(0, 0, 0, 0.6);
            letter-spacing: 0.02em;
        }

        .narrative-text.visible {
            opacity: 1;
            transform: translateY(0);
        }

        /* Master text-opacity applied to both text containers; multiplies through to the
           per-item fade animations above without disturbing them. */
        #intro-overlay, #text-overlay { opacity: var(--text-master-opacity, 1); }
        body.canonical-compositor:not(.pro-editor-open) #intro-overlay,
        body.canonical-compositor:not(.pro-editor-open) #text-overlay { visibility: hidden; }

        /* Scroll button - matches browser version exactly */
        #scroll-button {
            position: fixed;
            bottom: 30px;
            right: 30px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: #fff;
            background: rgba(13, 13, 18, 0.88);
            border: 1px solid rgba(255, 255, 255, 0.34);
            border-radius: 999px;
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.6s ease, transform 0.3s ease;
            transform: scale(0.8);
            z-index: 9999;
            padding: 9px 14px 9px 17px;
            box-shadow: 0 10px 36px rgba(0, 0, 0, 0.48);
            font: 650 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        #scroll-button::before { content: "Continue"; }

        #scroll-button.visible {
            opacity: 0.8;
            pointer-events: auto;
            transform: scale(1);
        }

        #scroll-button:hover {
            opacity: 1;
            transform: scale(1.05);
        }

        #scroll-button img {
            width: 34px;
            max-width: 34px;
            height: auto;
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
        }

        /* Loading state */
        #loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #333;
            font-family: system-ui, sans-serif;
            font-size: 14px;
            letter-spacing: 0.1em;
            z-index: 100;
        }
        #loading.hidden { display: none; }

        /* Coordinates display for editor */
        #coords {
            position: absolute;
            bottom: 10px;
            left: 10px;
            background: rgba(0,0,0,0.8);
            padding: 6px 10px;
            border-radius: 4px;
            font-family: monospace;
            font-size: 11px;
            color: #888;
            z-index: 200;
            display: none;
        }

        /* ===== PROJECTS HOME ===== */
        .project-home {
            position: fixed; inset: 0; z-index: 10000;
            display: grid; place-items: center; overflow: auto; padding: 48px 24px;
            color: #f5f1eb;
            background:
                radial-gradient(circle at 18% 14%, rgba(142, 94, 255, .20), transparent 30%),
                radial-gradient(circle at 82% 76%, rgba(72, 198, 218, .14), transparent 34%),
                linear-gradient(145deg, #090a0d, #111018 60%, #090a0d);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }
        body:not(.project-gate-open) .project-home { display: none; }
        body.project-gate-open #app-shell,
        body.project-gate-open > #coords,
        body.project-gate-open > #scroll-button { visibility: hidden; }
        .project-home-card {
            width: min(760px, 100%); padding: clamp(30px, 6vw, 64px);
            border: 1px solid rgba(255,255,255,.10); border-radius: 28px;
            background: linear-gradient(155deg, rgba(31,29,42,.94), rgba(15,16,22,.96));
            box-shadow: 0 30px 100px rgba(0,0,0,.58);
        }
        .project-home-mark {
            width: 54px; height: 54px; margin-bottom: 24px; border-radius: 50%;
            background: conic-gradient(from 20deg, #c395ff, #68dcff, #ffe17c, #ff90ca, #c395ff);
            box-shadow: 0 0 36px rgba(157,111,255,.40);
        }
        .project-home-kicker {
            margin: 0 0 6px; color: #b8a0dd; font-size: 12px; font-weight: 700;
            letter-spacing: .22em; text-transform: uppercase;
        }
        .project-home h1 { margin: 0; font: 400 clamp(42px, 8vw, 68px)/1 "Cormorant Garamond", Georgia, serif; }
        .project-home-intro { max-width: 590px; margin: 18px 0 30px; color: #bbb8c1; font-size: 16px; line-height: 1.6; }
        .project-home-actions { display: flex; flex-wrap: wrap; gap: 10px; }
        .project-action {
            min-height: 44px; padding: 0 17px; border: 1px solid #4a4853; border-radius: 9px;
            color: #e9e6ed; background: #292832; cursor: pointer; font: 650 13px/1 -apple-system, system-ui, sans-serif;
        }
        .project-action:hover { color: #fff; background: #34323f; border-color: #666270; }
        .project-action-primary { color: #15121a; background: #c8a8f4; border-color: #d7bef7; }
        .project-action-primary:hover { color: #0a0810; background: #d7bef7; }
        .project-action:focus-visible, .tb-btn:focus-visible, .td-close:focus-visible, .stage-play:focus-visible {
            outline: 3px solid #7edcf2; outline-offset: 3px;
        }
        .project-recovery {
            display: flex; align-items: center; justify-content: space-between; gap: 18px;
            margin-top: 28px; padding: 16px 18px; border: 1px solid rgba(126,220,242,.28);
            border-radius: 12px; background: rgba(55,134,151,.10);
        }
        .project-recovery h2, .project-recents h2 { margin: 0; font-size: 13px; letter-spacing: .05em; }
        .project-recovery p { margin: 5px 0 0; color: #aaa7b1; font-size: 13px; }
        .project-recents { margin-top: 30px; }
        .project-recents ul { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
        .project-recents li { display: flex; align-items: center; gap: 8px; }
        .project-recent-actions { display: flex; gap: 6px; flex: 0 0 auto; }
        .project-recent-action {
            min-height: 52px; padding: 0 12px; border: 1px solid #34333d; border-radius: 9px;
            background: #17171d; color: #c6c2ce; font: 600 12px -apple-system, system-ui, sans-serif; cursor: pointer;
        }
        .project-recent-action:hover { background: #22222a; color: #fff; }
        .project-recent-action.danger { color: #ff9b9b; border-color: #50313a; }
        .project-recent-action.danger:hover { background: #3f2027; color: #fff; }
        .project-recent-action:disabled { opacity: .45; cursor: not-allowed; }
        .project-recent-button {
            width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between;
            gap: 18px; padding: 10px 14px; color: #e3dfe8; background: #1e1e26;
            border: 1px solid #34333d; border-radius: 9px; cursor: pointer; text-align: left;
        }
        .project-recent-button:hover { background: #272631; }
        .project-recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
        .project-recent-date, .project-empty { color: #8e8b96; font-size: 12px; }
        .project-home-status { min-height: 20px; margin: 18px 0 0; color: #a7dce7; font-size: 13px; }

        @media (max-width: 1380px) {
            #app-topbar { gap: 8px; padding-inline: 10px; }
            .tb-brand { font-size: 0; gap: 0; }
            .tb-brand .tb-dot { display: block; }
            #tb-project-name { max-width: 140px; }
            .tb-actions { gap: 5px; }
            .tb-btn { padding-inline: 9px; }
            .tb-textop { margin-right: 2px; }
            .tb-textop input[type=range] { width: 68px; }
        }

        @media (max-width: 1280px) {
            .tb-textop { display: none; }
            .tb-project { flex: 1; }
            .tb-spacer { display: none; }
            #tb-project-name { max-width: 110px; }
            .tb-btn { padding-inline: 7px; font-size: 12px; }
            .tb-icon { width: 30px; padding: 0; }
        }

        @media (max-width: 1000px) {
            #app-topbar { gap: 5px; padding-inline: 7px; }
            .tb-project { display: none; }
            .tb-actions { margin-left: auto; gap: 4px; }
            .tb-btn { padding-inline: 6px; }
            #tb-undo, #tb-redo, #tb-stop { width: 28px; padding: 0; font-size: 0; }
            #tb-undo::after { content: '↶'; font-size: 17px; }
            #tb-redo::after { content: '↷'; font-size: 17px; }
            #tb-stop::after { content: '■'; font-size: 13px; }
        }

        @media (max-width: 820px), (max-height: 700px) {
            .project-home { place-items: start center; padding: 24px 16px; }
            .project-home-card { padding: 28px; border-radius: 20px; }
            #editor-panel.open { width: min(360px, 42vw); }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
        }
