/* ============================================================
   Studio — floating glass shell over an edge-to-edge viewport.
   Uses tokens.css.
   ============================================================ */

html, body { height: 100%; overflow: hidden; }

.studio-body {
    position: relative;
    background:
        radial-gradient(1200px 800px at 50% -10%, rgba(111, 190, 255, 0.06), transparent 60%),
        radial-gradient(800px 600px at 100% 110%, rgba(149, 241, 209, 0.04), transparent 60%),
        var(--bg-deep);
    color: var(--text-primary);
    --studio-panel: rgba(9, 12, 18, 0.86);
    --studio-panel-strong: rgba(15, 19, 28, 0.92);
    --studio-line: rgba(255, 255, 255, 0.09);
}

/* ============================================================
   Edge-to-edge viewport — sits underneath the floating shell
   ============================================================ */

#viewport-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(1100px 700px at 50% 50%, rgba(20, 28, 42, 0.55), transparent 70%),
        var(--bg-deep);
    z-index: var(--z-canvas);
}

#viewport {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

#loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-deep);
    z-index: var(--z-modal);
    transition: opacity 480ms ease;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loader {
    width: 32px; height: 32px;
    border: 2.5px solid rgba(255,255,255,0.10);
    border-top-color: var(--accent-mint);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay p {
    font-size: 12.5px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

/* ============================================================
   Floating top bar
   ============================================================ */

.studio-topbar {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 10px 8px 16px;
    background: linear-gradient(180deg, rgba(18, 22, 31, 0.88), rgba(8, 11, 16, 0.86));
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--studio-line);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,0.05);
    max-width: calc(100vw - 28px);
}

.studio-topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: -0.005em;
    transition: opacity var(--transition);
    white-space: nowrap;
}
.studio-topbar .brand:hover { opacity: 0.85; }
.studio-topbar .brand img {
    filter: drop-shadow(0 2px 6px rgba(149, 241, 209, 0.18));
}
.studio-topbar .topbar-divider {
    width: 1px; height: 18px;
    background: var(--border-strong);
    margin: 0 4px;
    flex-shrink: 0;
}
.studio-topbar .topbar-context {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Topbar icon button (pause/reset) */
.icon-btn {
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}
.icon-btn.playing { color: var(--accent-mint); }
.icon-btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.export-popover {
    position: relative;
}

.export-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: none;
    min-width: 250px;
    padding: 8px;
    background: rgba(9, 12, 18, 0.97);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 20px 52px rgba(0,0,0,0.46), inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.export-popover.open .export-menu {
    display: grid;
    gap: 6px;
}

.export-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    text-align: left;
    background: rgba(255,255,255,0.025);
    transition: background var(--transition), border-color var(--transition);
}

.export-option:hover {
    background: rgba(255,255,255,0.065);
    border-color: rgba(149, 241, 209, 0.20);
}

.export-option-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.export-option-sub {
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.3;
}

.pro-badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0b0e14;
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    border-radius: 999px;
    line-height: 1.4;
}

.record-stop-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255, 99, 125, 0.32);
    border-radius: 10px;
    background: rgba(255, 99, 125, 0.10);
    color: #ffb2bf;
    font-size: 12px;
    font-weight: 700;
}
.record-stop-btn:hover {
    background: rgba(255, 99, 125, 0.16);
    border-color: rgba(255, 99, 125, 0.48);
}
.record-stop-btn[hidden] { display: none; }
.record-stop-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: #ff637d;
    box-shadow: 0 0 12px rgba(255, 99, 125, 0.65);
}

.studio-topbar .btn.recording {
    background: linear-gradient(180deg, #ffd9df 0%, #ff8196 100%);
    color: #26060d;
}

/* ============================================================
   Floating side panels
   ============================================================ */

.floating-panel {
    position: fixed;
    z-index: var(--z-overlay);
    width: 280px;
    top: 80px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 120px),
        var(--studio-panel);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--studio-line);
    border-radius: 14px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.40), inset 0 1px 0 rgba(255,255,255,0.045);
    overflow: hidden;
}

.panel-left  { left: 18px; }
.panel-right { right: 18px; width: 310px; }

/* Subtle title strip at the top of each floating panel */
.panel-handle {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent);
    flex-shrink: 0;
}
.panel-handle-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 700;
}

/* Panels scroll their inner content (everything ui.js builds after handle). */
#sidebar, #inspector {
    /* The panels override .floating-panel's overflow and their inner
       sections scroll instead. The handle stays pinned on top. */
}
#sidebar > :not(.panel-handle),
#inspector > :not(.panel-handle) {
    flex: 0 0 auto;
}

/* Make the panel scroll the imperatively-built content. ui.js appends
   children directly to #sidebar / #inspector after .panel-handle, so we
   need to scroll everything except the handle. We achieve this with a
   wrapper-less trick: panel-handle is sticky-positioned for clarity. */
.floating-panel {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-hover) transparent;
}
.floating-panel::-webkit-scrollbar { width: 6px; }
.floating-panel::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
.panel-handle {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(13, 16, 22, 0.92), rgba(13, 16, 22, 0.84));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================================
   Bottom motion dock
   ============================================================ */

.motion-dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: var(--z-overlay);
    width: min(720px, calc(100vw - 680px));
    min-width: 560px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(150px, 0.32fr);
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
        rgba(8, 11, 16, 0.82);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--studio-line);
    border-radius: 14px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,0.05);
}

.motion-dock-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 4px 0 2px;
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    white-space: nowrap;
}
.motion-dock-label span {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-mint), var(--accent-aqua));
}

.motion-preset-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.motion-preset-btn {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    padding: 6px 4px 7px;
    gap: 3px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}
.motion-preset-btn .check { display: none; }
.motion-preset-btn .icon {
    width: auto;
    font-size: 14px;
    line-height: 1;
    color: var(--text-secondary);
}
.motion-preset-btn span:not(.swatch):not(.icon):not(.check) {
    max-width: none;
    width: 100%;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.005em;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.motion-preset-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}
.motion-preset-btn.active {
    background:
        linear-gradient(180deg, rgba(149, 241, 209, 0.16), rgba(111, 190, 255, 0.08)),
        rgba(255,255,255,0.03);
    border-color: rgba(149, 241, 209, 0.30);
}
.motion-preset-btn.active .icon { color: var(--accent-mint); }

.motion-speed-control {
    min-width: 150px;
    padding: 0 2px;
}
.motion-speed-control .field-label {
    flex-direction: row;
    margin-bottom: 5px;
}
.motion-speed-control .slider-value {
    margin-left: auto;
}

/* ============================================================
   Sections (.panel-section + .section-title come from ui.js)
   ============================================================ */

.app-header { display: none; } /* ui.js inserts an old-style header — hide */

.panel-section {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.055);
}
.panel-section:last-child { border-bottom: none; }

.section-title {
    position: relative;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 11px;
    padding-left: 10px;
}

.panel-intro {
    padding: 13px 14px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.055);
    background: linear-gradient(180deg, rgba(149, 241, 209, 0.055), rgba(255,255,255,0.012));
}
.panel-eyebrow {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.2;
}
.panel-copy {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 12px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-mint), var(--accent-aqua));
    opacity: 0.85;
}

/* ============================================================
   Preset buttons (materials / bg / motion)
   ============================================================ */

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.preset-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    width: 100%;
    text-align: left;
}
.preset-btn span:not(.swatch):not(.icon):not(.check) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preset-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.preset-btn.active {
    background:
        linear-gradient(180deg, rgba(149, 241, 209, 0.13), rgba(111, 190, 255, 0.07)),
        rgba(255,255,255,0.02);
    border-color: rgba(149, 241, 209, 0.34);
    color: #fff;
}
.preset-btn .swatch {
    width: 17px; height: 17px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 2px 4px rgba(0,0,0,0.30);
}
.preset-btn .icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.preset-btn.active .icon { color: var(--accent-mint); }
.preset-btn .check {
    margin-left: auto;
    font-size: 13px;
    color: var(--accent-mint);
    opacity: 0;
    transition: opacity var(--transition);
}
.preset-btn.active .check { opacity: 1; }

/* ============================================================
   Form fields (text inputs, sliders, toggles)
   ============================================================ */

.field-group { display: flex; flex-direction: column; gap: 10px; }
.field-row { display: flex; flex-direction: column; gap: 5px; }
.field-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    background: rgba(6, 9, 14, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(111, 190, 255, 0.12);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
        calc(100% - 17px) 18px,
        calc(100% - 12px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.font-popover {
    position: relative;
}

.font-trigger,
.font-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 9px;
    min-height: 56px;
    padding: 8px 9px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 8px;
    color: var(--text-primary);
    text-align: left;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.font-trigger {
    min-height: 48px;
    background: rgba(6, 9, 14, 0.76);
    border-color: rgba(255, 255, 255, 0.085);
}

.font-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    z-index: 5;
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    background: rgba(9, 12, 18, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.font-popover.open .font-menu { display: grid; }

.font-popover.open .font-trigger,
.font-trigger:hover,
.font-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.13);
}

.font-option.active {
    background:
        linear-gradient(180deg, rgba(149, 241, 209, 0.13), rgba(111, 190, 255, 0.07)),
        rgba(255,255,255,0.02);
    border-color: rgba(149, 241, 209, 0.34);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.font-sample {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 34px;
    border-radius: 7px;
    background: rgba(6, 9, 14, 0.72);
    border: 1px solid rgba(255,255,255,0.075);
    color: #d9fff0;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 0 14px rgba(149, 241, 209, 0.22);
}

.font-caret {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    transition: transform var(--transition);
}
.font-popover.open .font-caret { transform: rotate(180deg); }

.font-preview-helvetiker-bold {
    font-family: Inter, Arial, sans-serif;
    font-weight: 900;
}
.font-preview-helvetiker {
    font-family: Inter, Arial, sans-serif;
    font-weight: 600;
}
.font-preview-optimer {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.font-preview-gentilis {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-style: italic;
}
.font-preview-droid-serif {
    font-family: 'Courier New', Georgia, serif;
    font-weight: 800;
}
.font-preview-droid-sans {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.font-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.font-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
}
.font-hint {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
}
.font-option.active .font-hint { color: rgba(149, 241, 209, 0.82); }

.font-check {
    color: var(--accent-mint);
    font-size: 12px;
    opacity: 0;
}
.font-option.active .font-check { opacity: 1; }

.background-tools {
    margin-bottom: 12px;
}

.color-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-control {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 7px 10px 7px 8px;
    background: rgba(6, 9, 14, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 8px;
}

input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 7px;
}
.color-value {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11.5px;
}

/* ---- Slider ---- */
.slider-row { display: flex; flex-direction: column; gap: 5px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; }
.slider-header .label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.slider-header .value {
    font-size: 10.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg,
        var(--accent-aqua) 0%,
        var(--accent-mint) var(--value-percent, 50%),
        rgba(255,255,255,0.06) var(--value-percent, 50%),
        rgba(255,255,255,0.06) 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f4fff8, #95f1d1);
    border: 2px solid var(--bg-deep);
    box-shadow:
        0 0 0 1px rgba(149, 241, 209, 0.55),
        0 4px 16px rgba(149, 241, 209, 0.30);
    cursor: grab;
    transition: transform var(--transition-fast), box-shadow var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.20);
    box-shadow:
        0 0 0 1px rgba(149, 241, 209, 0.75),
        0 4px 20px rgba(149, 241, 209, 0.45);
}
input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent-mint);
    border: 2px solid var(--bg-deep);
    cursor: grab;
}

/* ---- Toggle ---- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 7px 0;
}
.toggle-row .label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.toggle {
    position: relative;
    width: 36px; height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background var(--transition), border-color var(--transition);
}
.toggle input:checked + .toggle-track {
    background: linear-gradient(180deg, #cdfbe6, #75dabd);
    border-color: transparent;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.30);
}
.toggle input:checked + .toggle-track::after {
    transform: translateX(16px);
}

/* ============================================================
   Buttons inside panels
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    background: rgba(20, 25, 34, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    width: 100%;
    justify-content: center;
}
.btn:hover {
    background: rgba(28, 35, 47, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
}
.btn-icon {
    width: 14px; height: 14px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
}
.btn-accent {
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    border-color: transparent;
    color: #051218;
    font-weight: 600;
    box-shadow:
        0 6px 20px rgba(135, 230, 197, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.55);
}
.btn-accent:hover {
    background: linear-gradient(180deg, #e8fff4 0%, #9defd2 60%, #7ce0ff 100%);
}

/* Override for topbar-located inline btn (Pricing / Home) — small + dense */
.studio-topbar .btn {
    min-height: 34px;
    width: auto;
    padding: 7px 12px;
    font-size: 12px;
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.studio-topbar .btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}
.studio-topbar .btn.btn-ghost { color: var(--text-secondary); }
.studio-topbar .btn.btn-accent {
    color: #071217;
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 62%, #67d8ff 100%);
    border-color: transparent;
    font-weight: 700;
}
.studio-topbar .btn.btn-accent:hover {
    color: #041116;
    background: linear-gradient(180deg, #e7fff4 0%, #9cf0d2 62%, #78ddff 100%);
}

/* ============================================================
   Account / file info / status text
   ============================================================ */

.file-info {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.export-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.account-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.account-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.account-label { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.account-email {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.plan-chip {
    flex-shrink: 0;
    min-width: 46px;
    padding: 4px 9px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.plan-chip.pro {
    background: rgba(149, 241, 209, 0.18);
    border-color: rgba(149, 241, 209, 0.34);
    color: #d6f9ea;
}

.account-actions, .feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feature-list { padding-top: 2px; }
.feature-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-size: 11px;
}
.feature-list strong { color: var(--text-secondary); font-weight: 600; }

.plan-note {
    padding: 9px 11px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11.5px;
    line-height: 1.45;
}

/* ============================================================
   Disabled state
   ============================================================ */
.disabled { opacity: 0.40; pointer-events: none; }

/* ============================================================
   Sign-up gate (full-screen, blocks the Studio for guests)
   ============================================================ */

.studio-gated #viewport-container,
.studio-gated .studio-topbar,
.studio-gated #sidebar,
.studio-gated #inspector,
.studio-gated #motion-dock {
    pointer-events: none;
    user-select: none;
    filter: blur(6px) saturate(0.85);
    transition: filter 320ms ease;
}

.studio-gate {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 600px at 50% 20%, rgba(149, 241, 209, 0.10), transparent 60%),
        rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    animation: gate-fade 320ms ease;
}
/* `display: flex` above wins over the UA `[hidden] { display: none }` rule
   because of class-level specificity. Re-assert hidden explicitly. */
.studio-gate[hidden] { display: none; }

/* ── Logo import best-practice tip ───────────────────────────── */
.logo-tip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 32px 10px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--studio-line);
    border-radius: 10px;
    margin-top: 4px;
}
.logo-tip-thumbs {
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}
.logo-tip-thumb {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--studio-line);
    background-size: cover;
    background-position: center;
}
.logo-tip-thumb.good {
    background:
        radial-gradient(circle at 28% 38%, #000 0 32%, transparent 33%) #fff,
        #fff;
}
.logo-tip-thumb.bad {
    background:
        radial-gradient(circle at 28% 38%, #6fbeff 0 32%, transparent 33%) #0e1424,
        #0e1424;
}
.logo-tip-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    padding: 2px;
    border-radius: 50%;
    background: #1ed98c;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.40);
}
.logo-tip-thumb.bad .logo-tip-badge { background: #ff637d; }

.logo-tip-text {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-secondary);
}
.logo-tip-text strong { color: var(--text-primary); font-weight: 700; }

.logo-tip-close {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
}
.logo-tip-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

/* ============================================================
   Upgrade modal (Pro paywall)
   ============================================================ */

.upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: upgrade-fade 220ms ease;
}
@keyframes upgrade-fade { from { opacity: 0; } to { opacity: 1; } }

.upgrade-modal-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 600px at 50% 30%, rgba(149, 241, 209, 0.08), transparent 60%),
        rgba(2, 4, 8, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    cursor: pointer;
}

.upgrade-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 30px 28px 24px;
    background:
        linear-gradient(180deg, rgba(22, 28, 40, 0.96), rgba(10, 14, 22, 0.98));
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    text-align: center;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(149, 241, 209, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(8px);
    animation: upgrade-pop 280ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
@keyframes upgrade-pop {
    from { transform: translateY(16px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

.upgrade-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    color: #0b0e14;
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    box-shadow: 0 12px 30px rgba(103, 216, 255, 0.30);
}

.upgrade-modal-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.upgrade-modal-card p {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.upgrade-modal-feats {
    list-style: none;
    margin: 0 0 22px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--studio-line);
    border-radius: 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.upgrade-modal-feats li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.3;
}
.upgrade-modal-feats svg { color: var(--accent-mint); flex-shrink: 0; }

.upgrade-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: stretch;
}
.upgrade-modal-actions .btn { flex: 1; justify-content: center; }
.upgrade-modal-actions .btn-primary {
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    color: #0b0e14;
    border: none;
}
.upgrade-modal-actions .btn-primary:hover { filter: brightness(1.05); }

/* ============================================================
   Clerk UserProfile — Billing custom page
   ============================================================ */

.billing-page {
    padding: 4px 4px 8px;
    color: var(--text-primary);
    font-family: var(--font);
}
.billing-head h1 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.billing-head p {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.billing-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border: 1px solid var(--border-strong);
    border-radius: 12px;
}
.billing-card[data-state="loading"] { color: var(--text-muted); font-size: 13px; padding: 24px; text-align: center; }

.billing-plan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.billing-chip {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.billing-chip.pro {
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    color: #0b0e14;
}
.billing-chip.free {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-secondary);
}
.billing-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.billing-price small { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.billing-note {
    margin: 0 0 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.billing-warn { color: #ffb866; }

.billing-feats {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--studio-line);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--text-primary);
}

.billing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.billing-actions .btn { width: 100%; justify-content: center; }
.billing-actions .btn-primary {
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    color: #0b0e14;
    border: none;
}
.billing-actions .btn-primary:hover { filter: brightness(1.05); }

.billing-fine {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.45;
}

/* Clerk UserButton in the topbar */
.clerk-user-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.clerk-user-button .cl-userButtonBox,
.clerk-user-button .cl-userButtonTrigger {
    height: 30px;
    width: 30px;
}
.clerk-user-button .cl-userButtonAvatarBox {
    height: 30px;
    width: 30px;
}
@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }

.gate-card {
    width: 100%;
    max-width: 460px;
    padding: 36px 32px 28px;
    border-radius: var(--r-xl);
    background:
        linear-gradient(180deg, rgba(17, 21, 28, 0.95), rgba(8, 11, 16, 0.95));
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
    text-align: center;
    position: relative;
}

.gate-mark {
    margin: 0 auto 18px;
    filter: drop-shadow(0 6px 18px rgba(149, 241, 209, 0.25));
}

.gate-title {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 10px;
}

.gate-sub {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 38ch;
    margin: 0 auto 26px;
}

/* OAuth providers */
.gate-oauth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.gate-oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.gate-oauth-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.22);
}
.gate-oauth-btn:disabled { opacity: 0.55; cursor: progress; }
.gate-oauth-btn[data-provider="apple"] { color: #fff; }

/* "or" separator */
.gate-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 16px 0;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
}
.gate-or::before, .gate-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.gate-success {
    margin-top: 4px;
    padding: 9px 12px;
    background: rgba(149, 241, 209, 0.08);
    border: 1px solid rgba(149, 241, 209, 0.22);
    border-radius: var(--r-sm);
    color: var(--accent-mint);
    font-size: 12.5px;
    text-align: center;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}
.gate-form input[type="email"], .gate-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: rgba(8, 11, 16, 0.78);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.gate-form input[type="email"], .gate-form input[type="password"]::placeholder { color: var(--text-muted); }
.gate-form input[type="email"], .gate-form input[type="password"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(111, 190, 255, 0.16);
}
.gate-hint {
    margin: -2px 0 4px;
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
}

/* Let Clerk's "Last used" badge and other absolute decorations overflow
   their container instead of being clipped by Clerk's default overflow:hidden. */
#clerk-signin-mount,
#clerk-signin-mount .cl-rootBox,
#clerk-signin-mount .cl-cardBox,
#clerk-signin-mount .cl-card,
#clerk-signin-mount .cl-socialButtons,
#clerk-signin-mount .cl-socialButtonsBlockButton {
    overflow: visible !important;
}

.auth-toggle {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: rgba(244, 246, 251, 0.65);
}
.auth-toggle a {
    color: #67d8ff;
    text-decoration: none;
    font-weight: 500;
}
.auth-toggle a:hover { color: #9be4ff; text-decoration: underline; }

.gate-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: var(--r-md);
    background: linear-gradient(180deg, #d6fbe9 0%, #88e6c5 60%, #67d8ff 100%);
    color: #051218;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        0 8px 28px rgba(135, 230, 197, 0.22),
        inset 0 1px 0 rgba(255,255,255,0.55);
    transition: background var(--transition), transform var(--transition-fast);
}
.gate-cta:hover {
    background: linear-gradient(180deg, #e8fff4 0%, #9defd2 60%, #7ce0ff 100%);
}
.gate-cta:active { transform: translateY(1px); }

.gate-error {
    min-height: 18px;
    margin-top: 4px;
    color: var(--danger);
    font-size: 12.5px;
    text-align: center;
}

.gate-feats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.gate-feats li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}
.gate-feats li svg { color: var(--accent-mint); flex-shrink: 0; }

.gate-fine {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.55;
    margin-bottom: 14px;
}
.gate-fine a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.gate-fine a:hover { color: var(--text-primary); }

.gate-back {
    display: inline-block;
    color: var(--text-muted);
    font-size: 12px;
    transition: color var(--transition);
}
.gate-back:hover { color: var(--text-secondary); }

@media (max-width: 480px) {
    .studio-gate { padding: 16px; }
    .gate-card {
        padding: 26px 18px 20px;
        max-width: 100%;
    }
    .gate-title { font-size: 1.35rem; }
    .gate-sub { font-size: 13px; margin-bottom: 20px; }
    .gate-feats li { font-size: 12.5px; }
}

/* Clerk widget — force every nested container to respect the card width
   instead of falling back to its default min-width: 25rem. Without this
   the email input + Continue button overflow on phones < 400px wide. */
#clerk-signin-mount,
#clerk-signin-mount .cl-rootBox,
#clerk-signin-mount .cl-cardBox,
#clerk-signin-mount .cl-card,
#clerk-signin-mount .cl-form,
#clerk-signin-mount .cl-formFieldRow,
#clerk-signin-mount .cl-formField,
#clerk-signin-mount .cl-socialButtons,
#clerk-signin-mount .cl-socialButtonsBlockButton,
#clerk-signin-mount .cl-formButtonPrimary,
#clerk-signin-mount input,
#clerk-signin-mount button {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
#clerk-signin-mount .cl-formFieldInput,
#clerk-signin-mount .cl-formButtonPrimary {
    width: 100% !important;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Compact desktop: narrower right panel */
@media (max-width: 1180px) {
    .panel-left  { width: 240px; }
    .panel-right { width: 280px; }
    .motion-dock {
        width: min(620px, calc(100vw - 540px));
        min-width: 480px;
    }
    .motion-preset-btn span:not(.swatch):not(.icon):not(.check) {
        font-size: 9.5px;
    }
}

/* Tablet: panels narrower, topbar full width  */
@media (max-width: 980px) {
    .floating-panel {
        top: 76px;
    }
    .panel-left  { width: 220px; left: 12px; }
    .panel-right { width: 260px; right: 12px; }
    .studio-topbar { top: 10px; }
    .topbar-context, .topbar-divider { display: none; }
    .motion-dock {
        width: calc(100vw - 32px);
        min-width: 0;
        bottom: 12px;
    }
}

/* Mobile: stack panels under the viewport, viewport becomes scroll-target */
@media (max-width: 760px) {
    html, body { overflow: auto; height: auto; }
    .studio-body { min-height: 100vh; }

    #viewport-container {
        position: relative;
        height: 56vh;
        min-height: 360px;
    }

    .studio-topbar {
        position: sticky;
        top: 8px;
        left: 8px;
        right: 8px;
        max-width: calc(100vw - 16px);
        width: calc(100vw - 16px);
        font-size: 12px;
        padding: 6px 8px;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .studio-topbar .brand-name { display: none; }
    .studio-topbar .brand img { width: 22px; height: 22px; }
    .topbar-actions { gap: 6px; flex: 1; justify-content: flex-end; }
    .topbar-actions .btn { padding: 6px 10px; font-size: 11.5px; }
    /* Hide the redundant inline Pricing/Home text links on phones — the
       Clerk avatar dropdown already exposes account & billing, and Home
       is reachable via the brand mark on the left. */
    .studio-topbar > .topbar-actions > a[href="pricing.html"],
    .studio-topbar > .topbar-actions > a[href="index.html"] {
        display: none;
    }

    .floating-panel {
        position: relative;
        inset: auto;
        top: auto; bottom: auto; left: auto; right: auto;
        width: calc(100% - 24px);
        margin: 12px;
        max-height: none;
    }

    .motion-dock {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: calc(100% - 24px);
        margin: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        grid-template-columns: 1fr;
        gap: 9px;
    }
    .studio-body { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .motion-preset-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .motion-speed-control {
        min-width: 0;
        padding: 4px 2px 0;
    }
}
