@import url('/static/vendor/css/fonts.css');

:root {
    --ink: #1e192d;
    --ink-soft: #352e46;
    --deep-blue: #4e5b99;
    --deep-blue-dark: #3e487c;
    --mist-blue: #b2b6df;
    --neon-pink: #e16ad9;
    --ribbon-pink: #c93b8a;
    --frost: #f8f4fa;
    --blush: #f3e6f2;
    --paper: var(--frost);
    --paper-deep: var(--blush);
    --surface: #fffcff;
    --surface-strong: #ffffff;
    --line: rgba(53, 46, 70, .12);
    --line-strong: rgba(78, 91, 153, .27);
    --muted: #686273;
    --faint: #8c8497;
    --accent: var(--neon-pink);
    --accent-dark: var(--ribbon-pink);
    --accent-soft: #f9e9f7;
    --success: #39775f;
    --warning: #8a5578;
    --danger: #a5365a;
    --shadow-sm: 0 8px 24px rgba(30, 25, 45, .07);
    --shadow-md: 0 24px 64px rgba(30, 25, 45, .14);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 28px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --brand-lockup-gap: 7px;
}

* { box-sizing: border-box; }

html { min-height: 100%; color-scheme: light; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), a { cursor: pointer; }

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid rgba(78, 91, 153, .3);
    outline-offset: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: var(--brand-lockup-gap);
    color: var(--ink);
    text-decoration: none;
}

.brand-lockup > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.brand-lockup strong { font-size: 19px; line-height: 1; font-weight: 850; letter-spacing: .03em; }
.brand-lockup small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .18em; }
.brand-wordmark { display: block; width: 76px; height: auto; object-fit: contain; }
.brand-lockup--large { gap: var(--brand-lockup-gap); }
.brand-lockup--large strong { font-size: 23px; }
.brand-lockup--large small { font-size: 9px; }
.brand-lockup--large .brand-wordmark { width: 76px; height: auto; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: white;
    background: transparent;
    box-shadow: none;
}

.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-mark svg { width: 26px; height: 26px; stroke-width: 2.2; }
.brand-lockup--large .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
.brand-lockup--large .brand-mark svg { width: 31px; height: 31px; }

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.primary-button, .secondary-button, .text-button, .icon-button {
    border: 0;
    border-radius: 12px;
    transition: transform .18s var(--ease), background-color .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.primary-button {
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    background: var(--deep-blue);
    box-shadow: 0 10px 24px rgba(78, 91, 153, .22);
    font-size: 14px;
    font-weight: 750;
}

.primary-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--deep-blue-dark); box-shadow: 0 14px 30px rgba(62, 72, 124, .26); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
.primary-button svg { width: 19px; height: 19px; stroke-width: 2.2; }
.primary-button--full { width: 100%; }

.secondary-button {
    min-height: 42px;
    padding: 0 17px;
    color: var(--ink-soft);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
}

.secondary-button:hover:not(:disabled) { transform: translateY(-1px); color: var(--deep-blue); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.text-button { padding: 9px 12px; color: var(--accent-dark); background: transparent; font-size: 13px; font-weight: 750; }
.text-button:hover { background: var(--accent-soft); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; }
.icon-button:hover { color: var(--deep-blue); background: var(--paper); }
.icon-button svg { width: 20px; height: 20px; }

button:disabled { cursor: wait; opacity: .58; }
button.is-busy > * { display: none; }
button.is-busy::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .38);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
.secondary-button.is-busy::before, .text-button.is-busy::before {
    border-color: rgba(78, 91, 153, .24);
    border-top-color: var(--deep-blue);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span:first-child { color: var(--ink-soft); font-size: 13px; font-weight: 720; }
.field em { margin-left: 6px; color: var(--faint); font-style: normal; font-size: 11px; font-weight: 550; }
.field input, .field textarea, .field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: rgba(255, 252, 255, .84);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    outline: none;
}
.field input { height: 48px; padding: 0 14px; }
.field select { height: 48px; padding: 0 38px 0 14px; font: inherit; }
.field textarea { min-height: 104px; padding: 13px 14px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #aaa2b2; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(78, 91, 153, .62); background: white; box-shadow: 0 0 0 4px rgba(178, 182, 223, .3); }
.field small { margin-top: -2px; color: var(--faint); font-size: 11px; }

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 64px; }
.password-toggle {
    position: absolute;
    top: 6px;
    right: 7px;
    height: 36px;
    padding: 0 9px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}
.password-toggle:hover { color: var(--ink); background: var(--paper); }

.form-error {
    margin: 0;
    padding: 11px 12px;
    color: var(--danger);
    background: #fbeef3;
    border: 1px solid rgba(165, 54, 90, .16);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.55;
}

.form-notice {
    margin: 0 0 18px;
    padding: 11px 12px;
    color: var(--success);
    background: #edf7f3;
    border: 1px solid rgba(57, 119, 95, .16);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.55;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(78, 91, 153, .16);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* AI image generation: full-frame synthesis field, reserved for actual image work. */
.ai-image-loader {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(141,154,255,.2);
    border-radius: inherit;
    background:
        radial-gradient(circle at 18% 24%, rgba(178,182,223,.18), transparent 29%),
        radial-gradient(circle at 82% 78%, rgba(225,106,217,.13), transparent 34%),
        linear-gradient(145deg, #1e192d 0%, #282238 48%, #3e487c 150%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        inset 0 0 38px rgba(78,91,153,.2);
}
.ai-image-loader::before {
    content: '';
    position: absolute;
    z-index: 6;
    inset: 8px;
    border: 1px solid rgba(178,182,223,.19);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(225,106,217,.035);
    pointer-events: none;
}
.ai-image-loader::after {
    content: '';
    position: absolute;
    z-index: 5;
    inset: 0;
    background: linear-gradient(180deg, transparent 0 55%, rgba(178,182,223,.055) 56%, transparent 57% 100%);
    background-size: 100% 9px;
    mix-blend-mode: screen;
    opacity: .62;
    pointer-events: none;
}
.ai-image-loader-atmosphere {
    position: absolute;
    z-index: 0;
    inset: -45%;
    background:
        radial-gradient(circle at 32% 38%, rgba(78,91,153,.48), transparent 18%),
        radial-gradient(circle at 66% 52%, rgba(178,182,223,.28), transparent 22%),
        radial-gradient(circle at 48% 74%, rgba(225,106,217,.26), transparent 19%);
    filter: blur(25px) saturate(1.25);
    animation: ai-image-loader-atmosphere 9s linear infinite;
}
.ai-image-loader-grid {
    position: absolute;
    z-index: 1;
    inset: -24%;
    background-image:
        linear-gradient(rgba(178,182,223,.13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(225,106,217,.11) 1px, transparent 1px);
    background-size: 32px 32px;
    transform: perspective(360px) rotateX(58deg) translateY(12%);
    transform-origin: center bottom;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
    animation: ai-image-loader-grid 3.8s linear infinite;
}
.ai-image-loader-beam {
    position: absolute;
    z-index: 2;
    top: -15%;
    bottom: -15%;
    left: -34%;
    width: 34%;
    background: linear-gradient(90deg, transparent, rgba(78,91,153,.06), rgba(178,182,223,.24), rgba(225,106,217,.2), transparent);
    filter: blur(.4px);
    transform: skewX(-9deg);
    box-shadow: 13px 0 35px rgba(225,106,217,.1);
    animation: ai-image-loader-beam 2.9s cubic-bezier(.42,0,.58,1) infinite;
}
.ai-image-loader-hud {
    position: absolute;
    z-index: 7;
    right: 13px;
    bottom: 12px;
    left: 13px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(240,237,249,.86);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ai-image-loader-hud::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(178,182,223,.48), rgba(225,106,217,.2), transparent);
}
.ai-image-loader-hud i {
    color: var(--neon-pink);
    font-size: 11px;
    font-style: normal;
    text-shadow: 0 0 12px rgba(225,106,217,.75);
    animation: ai-image-loader-spark 1.25s ease-in-out infinite;
}
.ai-image-loader-node {
    position: absolute;
    z-index: 4;
    width: 5px;
    height: 5px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 50%;
    background: var(--mist-blue);
    box-shadow: 0 0 0 4px rgba(178,182,223,.06), 0 0 11px rgba(178,182,223,.72);
    animation: ai-image-loader-node 2.2s ease-in-out infinite;
}
.ai-image-loader > .ai-image-loader-node:nth-of-type(1) { top: 21%; left: 18%; animation-delay: -.2s; }
.ai-image-loader > .ai-image-loader-node:nth-of-type(2) { top: 34%; right: 19%; animation-delay: -.8s; }
.ai-image-loader > .ai-image-loader-node:nth-of-type(3) { top: 62%; left: 34%; animation-delay: -1.4s; }
.ai-image-loader > .ai-image-loader-node:nth-of-type(4) { right: 31%; bottom: 24%; animation-delay: -.5s; }
.ai-image-loader > .ai-image-loader-node:nth-of-type(5) { top: 48%; left: 52%; animation-delay: -1.8s; }
.ai-image-loader > .ai-image-loader-node:nth-of-type(2),
.ai-image-loader > .ai-image-loader-node:nth-of-type(4) {
    background: var(--neon-pink);
    box-shadow: 0 0 0 4px rgba(225,106,217,.06), 0 0 11px rgba(225,106,217,.68);
}

@keyframes ai-image-loader-atmosphere {
    0%, 100% { transform: translate3d(-4%,-2%,0) rotate(-4deg) scale(.96); }
    25% { transform: translate3d(3%,-4%,0) rotate(2deg) scale(1.02); }
    50% { transform: translate3d(5%,4%,0) rotate(6deg) scale(1.08); }
    75% { transform: translate3d(-2%,5%,0) rotate(0deg) scale(1.02); }
}
@keyframes ai-image-loader-grid {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 32px, 32px 0; }
}
@keyframes ai-image-loader-beam {
    0% { transform: translateX(0) skewX(-9deg); opacity: 0; }
    13% { opacity: .78; }
    70% { opacity: .74; }
    100% { transform: translateX(410%) skewX(-9deg); opacity: 0; }
}
@keyframes ai-image-loader-spark {
    0%, 100% { opacity: .45; transform: scale(.82) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.12) rotate(45deg); }
}
@keyframes ai-image-loader-node {
    0%, 100% { opacity: .18; transform: scale(.58); }
    44% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-image-loader-atmosphere,
    .ai-image-loader-grid,
    .ai-image-loader-beam,
    .ai-image-loader-hud i,
    .ai-image-loader-node { animation: none; }
}

/* AI video generation: branded temporal frame stream. */
.ai-video-loader {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(178,182,223,.18);
    border-radius: inherit;
    background:
        radial-gradient(circle at 17% 28%, rgba(78,91,153,.34), transparent 32%),
        radial-gradient(circle at 82% 72%, rgba(201,59,138,.2), transparent 34%),
        linear-gradient(145deg, #1e192d, #282238 55%, #23213d);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 42px rgba(78,91,153,.18);
}
.ai-video-loader::before {
    content: '';
    position: absolute;
    z-index: 5;
    inset: 8px;
    border: 1px solid rgba(178,182,223,.17);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(225,106,217,.025);
}
.ai-video-loader::after {
    content: '';
    position: absolute;
    z-index: 4;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0 6px, rgba(178,182,223,.035) 7px);
    pointer-events: none;
}
.ai-video-loader-atmosphere {
    position: absolute;
    z-index: 0;
    inset: -35%;
    background:
        conic-gradient(from 80deg at 50% 50%, transparent, rgba(78,91,153,.3), transparent 34%, rgba(225,106,217,.2), transparent 69%),
        radial-gradient(circle, rgba(178,182,223,.16), transparent 54%);
    filter: blur(28px);
    animation: ai-video-loader-atmosphere 7.5s linear infinite;
}
.ai-video-loader-track {
    position: absolute;
    z-index: 1;
    top: 22%;
    right: auto;
    left: -10%;
    width: calc(240% + 8px);
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 8px;
    transform: rotate(-2.5deg);
    animation: ai-video-loader-track 5.8s linear infinite;
}
.ai-video-loader-track i {
    aspect-ratio: 16 / 10;
    display: block;
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 7px;
    background:
        linear-gradient(145deg, rgba(178,182,223,.08), rgba(78,91,153,.2)),
        repeating-linear-gradient(90deg, transparent 0 11px, rgba(225,106,217,.055) 12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(7,6,14,.12);
    opacity: .72;
}
.ai-video-loader-track i:nth-child(2),
.ai-video-loader-track i:nth-child(5),
.ai-video-loader-track i:nth-child(8),
.ai-video-loader-track i:nth-child(10),
.ai-video-loader-track i:nth-child(13),
.ai-video-loader-track i:nth-child(16) { border-color: rgba(225,106,217,.26); background-color: rgba(201,59,138,.08); }
.ai-video-loader-playhead {
    position: absolute;
    z-index: 3;
    top: 12%;
    bottom: 19%;
    left: 9%;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--neon-pink) 18% 82%, transparent);
    box-shadow: 0 0 12px rgba(225,106,217,.72), 0 0 28px rgba(201,59,138,.25);
    animation: ai-video-loader-playhead 2.8s cubic-bezier(.42,0,.58,1) infinite;
}
.ai-video-loader-playhead::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 50%;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 0 0 10px rgba(225,106,217,.8);
    transform: translateX(-50%);
}
.ai-video-loader-hud {
    position: absolute;
    z-index: 6;
    right: 13px;
    bottom: 12px;
    left: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(240,237,249,.87);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: .08em;
}
.ai-video-loader-hud > i { color: var(--neon-pink); font-size: 8px; font-style: normal; text-shadow: 0 0 10px rgba(225,106,217,.72); }
.ai-video-loader-waveform { height: 15px; margin-left: auto; display: flex; align-items: center; gap: 2px; }
.ai-video-loader-waveform i { width: 2px; height: 32%; display: block; border-radius: 99px; background: linear-gradient(180deg, var(--mist-blue), var(--neon-pink)); animation: ai-video-loader-wave 1.05s ease-in-out infinite alternate; }
.ai-video-loader-waveform i:nth-child(2) { animation-delay: -.2s; }
.ai-video-loader-waveform i:nth-child(3) { animation-delay: -.45s; }
.ai-video-loader-waveform i:nth-child(4) { animation-delay: -.7s; }
.ai-video-loader-waveform i:nth-child(5) { animation-delay: -.35s; }
.ai-video-loader-waveform i:nth-child(6) { animation-delay: -.6s; }
.ai-video-loader-waveform i:nth-child(7) { animation-delay: -.1s; }

@keyframes ai-video-loader-atmosphere {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.06); }
    100% { transform: rotate(360deg) scale(1); }
}
@keyframes ai-video-loader-track {
    0% { transform: translateX(0) rotate(-2.5deg); }
    100% { transform: translateX(calc(-50% - 4px)) rotate(-2.5deg); }
}
@keyframes ai-video-loader-playhead {
    0%, 100% { left: 9%; opacity: .35; }
    50% { left: 91%; opacity: 1; }
}
@keyframes ai-video-loader-wave { to { height: 100%; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .ai-video-loader-atmosphere,
    .ai-video-loader-track,
    .ai-video-loader-playhead,
    .ai-video-loader-waveform i { animation: none; }
}

/* Login and first-run setup */
.auth-page { overflow-x: hidden; }

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.15fr) minmax(460px, .85fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 13% 12%, rgba(232, 79, 183, .13), transparent 25%),
        radial-gradient(circle at 52% 80%, rgba(178, 182, 223, .24), transparent 36%),
        linear-gradient(145deg, #faf7fb 0%, #f5f1f8 57%, #f0f1f9 100%);
}

.auth-shell::before {
    content: '';
    position: absolute;
    left: -18vw;
    bottom: -43vw;
    width: 84vw;
    height: 84vw;
    border-radius: 48% 52% 46% 54%;
    background: conic-gradient(from 210deg, rgba(232,79,183,.12), rgba(178,182,223,.04), rgba(78,91,153,.09), rgba(232,79,183,.12));
    filter: blur(36px);
    opacity: .7;
    animation: auth-aurora 22s ease-in-out infinite alternate;
    pointer-events: none;
}

.auth-story {
    position: relative;
    min-height: 100vh;
    padding: clamp(34px, 5vw, 72px) clamp(34px, 6vw, 96px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;
    overflow: hidden;
    z-index: 1;
}

.auth-story::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(30,25,45,.038) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30,25,45,.038) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(145deg, transparent 5%, rgba(0,0,0,.72) 44%, transparent 92%);
    pointer-events: none;
    z-index: -1;
}

.auth-motion { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-motion::before {
    content: '';
    position: absolute;
    width: min(42vw, 620px);
    height: min(42vw, 620px);
    right: -12%;
    top: 17%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,79,183,.16) 0%, rgba(178,182,223,.09) 34%, transparent 70%);
    filter: blur(8px);
    animation: auth-glow 13s ease-in-out infinite alternate;
}
.auth-motion-frame {
    position: absolute;
    display: block;
    border: 1px solid rgba(30,25,45,.15);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.34), rgba(248,244,250,.08));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.38), 0 28px 80px rgba(30,25,45,.05);
    backdrop-filter: blur(2px);
}
.auth-motion-frame::before,
.auth-motion-frame::after,
.auth-motion-frame i::before,
.auth-motion-frame i::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: rgba(30,25,45,.46);
    border-style: solid;
}
.auth-motion-frame::before { left: 14px; top: 14px; border-width: 2px 0 0 2px; }
.auth-motion-frame::after { right: 14px; top: 14px; border-width: 2px 2px 0 0; }
.auth-motion-frame i::before { left: 14px; bottom: 14px; border-width: 0 0 2px 2px; }
.auth-motion-frame i::after { right: 14px; bottom: 14px; border-width: 0 2px 2px 0; }
.auth-motion-frame--wide { width: 46%; aspect-ratio: 16 / 9; right: 5%; top: 18%; transform: rotate(-5deg); animation: auth-frame-wide 17s ease-in-out infinite alternate; }
.auth-motion-frame--portrait { width: 25%; aspect-ratio: 9 / 13; right: 13%; bottom: 8%; transform: rotate(7deg); animation: auth-frame-portrait 19s ease-in-out infinite alternate; }
.auth-motion-frame--detail { width: 30%; aspect-ratio: 4 / 3; left: 7%; bottom: 9%; transform: rotate(-8deg); animation: auth-frame-detail 15s ease-in-out infinite alternate; }
.auth-motion-scan {
    position: absolute;
    top: 11%;
    bottom: 8%;
    left: 58%;
    width: 1px;
    background: linear-gradient(transparent, rgba(232,79,183,.72) 35%, rgba(232,79,183,.72) 65%, transparent);
    box-shadow: 0 0 24px rgba(232,79,183,.34);
    animation: auth-scan 11s cubic-bezier(.65,0,.35,1) infinite;
}
.auth-motion-path {
    position: absolute;
    width: 64%;
    height: 38%;
    right: -8%;
    bottom: 18%;
    border: 1px solid rgba(78,91,153,.18);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
    transform: rotate(-14deg);
}
.auth-motion-node { position: absolute; width: 11px; height: 11px; border-radius: 3px; background: #e84fb7; box-shadow: 0 0 0 7px rgba(232,79,183,.09); }
.auth-motion-node--one { right: 9%; top: 46%; animation: auth-node 6s ease-in-out infinite alternate; }
.auth-motion-node--two { left: 36%; bottom: 21%; width: 7px; height: 7px; opacity: .72; animation: auth-node 8s 1s ease-in-out infinite alternate-reverse; }
.auth-motion-caption { position: absolute; right: 7%; bottom: 5%; color: rgba(30,25,45,.38); font: 750 9px/1 'JetBrains Mono', monospace; letter-spacing: .18em; }

@keyframes auth-aurora { to { transform: translate3d(5vw,-3vw,0) rotate(18deg) scale(1.06); } }
@keyframes auth-glow { to { transform: translate3d(-8%,8%,0) scale(1.12); opacity: .66; } }
@keyframes auth-frame-wide { to { transform: translate3d(-2.5%,5%,0) rotate(-1deg); } }
@keyframes auth-frame-portrait { to { transform: translate3d(-9%,-7%,0) rotate(3deg); } }
@keyframes auth-frame-detail { to { transform: translate3d(7%,-5%,0) rotate(-3deg); } }
@keyframes auth-scan { 0%, 12% { transform: translateX(-19vw); opacity: 0; } 23%, 77% { opacity: .72; } 88%, 100% { transform: translateX(18vw); opacity: 0; } }
@keyframes auth-node { to { transform: translate3d(6px,-9px,0) scale(.82); opacity: .56; } }

.auth-pitch { margin: clamp(70px, 12vh, 150px) 0 56px; max-width: 680px; }
.auth-pitch h1 { margin: 0; font-size: clamp(45px, 5.5vw, 82px); line-height: 1.04; letter-spacing: -.055em; font-weight: 780; }
.auth-pitch h1 span { color: var(--accent); }
.auth-pitch-copy { max-width: 500px; margin: 28px 0 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.8; }

.auth-promises { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 28px; list-style: none; }
.auth-promises li { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 620; }
.auth-promises li span { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 800; }

.auth-panel {
    position: relative;
    min-height: 100vh;
    padding: 42px clamp(28px, 5vw, 78px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 252, 255, .94);
    border-left: 1px solid var(--line);
    z-index: 2;
}

.auth-card { width: min(100%, 430px); }
.auth-state { animation: rise-in .45s var(--ease) both; }
.auth-state--center { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.auth-state--center > p { max-width: 320px; margin: 15px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-state--center h2 { margin: 20px 0 0; font-size: 22px; }

.auth-card-heading { margin-bottom: 30px; }
.auth-step { display: inline-flex; min-height: 25px; padding: 0 10px; align-items: center; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.auth-card-heading h2 { margin: 15px 0 8px; font-size: 29px; line-height: 1.2; letter-spacing: -.025em; }
.auth-card-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .primary-button { margin-top: 4px; }
.secondary-button--full { width: 100%; justify-content: center; }
.auth-switch { margin-top: 24px; text-align: center; }
.auth-switch p { margin: 10px 12px 0; color: var(--faint); font-size: 10px; line-height: 1.6; }
.auth-divider { display: flex; margin: 0 0 14px; align-items: center; gap: 12px; color: var(--faint); font-size: 10px; font-weight: 650; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-assurance { display: flex; margin: -2px 0 0; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-assurance span { flex: 0 0 auto; display: inline-grid; width: 17px; height: 17px; place-items: center; color: #38775f; background: rgba(79,145,118,.12); border-radius: 50%; font-size: 10px; font-weight: 900; }
.auth-back-button { min-height: 34px; padding: 0; color: var(--accent-dark); background: transparent; border: 0; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.auth-back-button:hover { color: var(--accent); }
.auth-footnote { position: absolute; bottom: 28px; margin: 0; display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 10px; font-weight: 650; }
.auth-footnote a { color: inherit; text-decoration: none; text-underline-offset: 3px; transition: color .18s ease, text-decoration-color .18s ease; }
.auth-footnote a:hover { color: var(--deep-blue); text-decoration: underline; text-decoration-color: rgba(78,91,153,.42); }
.auth-footnote a:focus-visible { color: var(--deep-blue); outline: 2px solid rgba(78,91,153,.32); outline-offset: 4px; border-radius: 3px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #4f9176; box-shadow: 0 0 0 4px rgba(79, 145, 118, .12); }
.state-icon { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; }
.state-icon svg { width: 25px; height: 25px; }
.state-icon--warning { color: var(--warning); background: var(--accent-soft); }
.noscript-note { position: fixed; inset: auto 20px 20px; z-index: 100; margin: 0; padding: 12px; color: white; background: var(--danger); border-radius: 10px; text-align: center; }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Authenticated app shell */
.app-page { height: 100vh; overflow: hidden; background: var(--frost); }
.app-loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 17px; color: var(--muted); background: var(--paper); font-size: 12px; font-weight: 650; }
.brand-mark--loader { width: 50px; height: 50px; border-radius: 16px; animation: loader-pulse 1.5s ease-in-out infinite; }
.brand-mark--loader svg { width: 34px; height: 34px; }
@keyframes loader-pulse { 50% { transform: scale(.94); box-shadow: 0 6px 16px rgba(225, 106, 217, .18); } }

.app-shell { width: 100%; height: 100vh; display: grid; grid-template-columns: 242px minmax(0, 1fr); }
.app-sidebar {
    position: relative;
    z-index: 10;
    min-height: 0;
    padding: 26px 18px 20px;
    display: flex;
    flex-direction: column;
    background: var(--ink);
    color: white;
}
.app-sidebar .brand-lockup { margin: 0 10px 36px; gap: var(--brand-lockup-gap); color: white; }
.app-sidebar .brand-lockup small { color: rgba(255, 255, 255, .42); }
.app-sidebar .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
.app-sidebar .brand-mark svg { width: 25px; height: 25px; }
.app-sidebar .brand-wordmark { width: 76px; height: auto; }

.app-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 0;
    border-radius: 12px;
    color: rgba(255, 255, 255, .52);
    background: transparent;
    font-size: 13px;
    font-weight: 680;
    transition: color .18s ease, background-color .18s ease, transform .18s var(--ease);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { color: white; background: rgba(178, 182, 223, .09); }
.nav-item.is-active { color: white; background: rgba(178, 182, 223, .14); }
.nav-item.is-active::after { content: ''; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--accent); }

.sidebar-bottom { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.install-button {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .65);
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, .16);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 650;
}
.install-button:hover { color: white; border-color: rgba(178, 182, 223, .36); background: rgba(178, 182, 223, .07); }
.install-button svg { width: 17px; height: 17px; }
.account-area { position: relative; }
.account-button {
    width: 100%;
    min-height: 62px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: rgba(178, 182, 223, .07);
    border: 1px solid rgba(178, 182, 223, .1);
    border-radius: 14px;
    text-align: left;
}
.account-button:hover { background: rgba(178, 182, 223, .12); }
.user-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--deep-blue), var(--ribbon-pink)); border-radius: 11px; font-size: 13px; font-weight: 850; }
.account-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-copy small { color: rgba(255, 255, 255, .38); font-size: 9px; }
.account-copy small.is-credit-ready { color: rgba(226, 217, 255, .82); font-weight: 700; }
.mobile-credit-balance {
    margin-left: auto;
    padding: 5px 8px;
    color: var(--deep-blue);
    background: rgba(78, 91, 153, .08);
    border: 1px solid rgba(78, 91, 153, .14);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}
.account-chevron { width: 16px; height: 16px; color: rgba(255, 255, 255, .38); }

.account-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 9px);
    padding: 7px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    animation: menu-in .16s var(--ease) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(6px); } }
.account-menu-user { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--line); }
.account-menu-user strong { font-size: 12px; }
.account-menu-user span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu button { width: 100%; min-height: 39px; margin-top: 5px; padding: 0 10px; display: flex; align-items: center; gap: 9px; background: transparent; border: 0; border-radius: 9px; font-size: 11px; font-weight: 700; }
.account-menu-action { color: var(--ink-soft); }
.account-menu-action:hover { color: var(--ink); background: var(--paper); }
.account-menu-danger { color: var(--danger); }
.account-menu-danger:hover { background: #fbeef3; }
.account-menu button svg { width: 16px; height: 16px; }
.account-menu-divider { height: 1px; margin: 6px 4px 1px; background: var(--line); }

.app-main {
    min-width: 0;
    height: 100vh;
    overflow: auto;
    background:
        radial-gradient(circle at 96% 2%, rgba(225, 106, 217, .07), transparent 26%),
        radial-gradient(circle at 18% 100%, rgba(178, 182, 223, .11), transparent 30%),
        var(--paper);
}
.app-view { width: min(1260px, 100%); min-height: 100%; margin: 0 auto; padding: clamp(42px, 7vh, 78px) clamp(30px, 5vw, 72px) 70px; }
.view-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.view-heading h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.045em; }
.view-subtitle { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.mobile-topbar, .mobile-nav { display: none; }

.notice-banner { margin: -12px 0 24px; padding: 11px 13px; display: flex; align-items: center; gap: 9px; color: var(--warning); background: var(--accent-soft); border: 1px solid rgba(201, 59, 138, .14); border-radius: 11px; font-size: 11px; font-weight: 650; }
.notice-banner svg { width: 17px; height: 17px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.production-card {
    position: relative;
    min-width: 0;
    min-height: 260px;
    padding: 19px;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: rgba(255, 252, 255, .92);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(30, 25, 45, .035);
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s ease;
}
.production-card:not(.production-card--skeleton):hover { transform: translateY(-5px); border-color: rgba(78, 91, 153, .28); box-shadow: 0 20px 50px rgba(78, 91, 153, .12); }
.production-cover {
    position: relative;
    height: 136px;
    margin: -9px -9px 17px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ink) 0%, var(--deep-blue) 68%, #6671aa 100%);
}
.production-cover::before, .production-cover::after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); }
.production-cover::before { width: 170px; height: 170px; right: -45px; top: -80px; background: rgba(225, 106, 217, .42); }
.production-cover::after { width: 110px; height: 110px; left: -45px; bottom: -65px; border: 1px solid rgba(178, 182, 223, .42); box-shadow: 0 0 0 24px rgba(178, 182, 223, .06); }
.production-initial { position: relative; z-index: 1; color: rgba(255, 255, 255, .9); font-family: 'Songti SC', 'STSong', serif; font-size: 44px; font-weight: 700; text-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.production-status { position: absolute; z-index: 2; top: 11px; left: 11px; min-height: 24px; padding: 0 9px; display: inline-flex; align-items: center; color: rgba(255, 255, 255, .86); background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .13); border-radius: 999px; backdrop-filter: blur(8px); font-size: 9px; font-weight: 750; }
.production-card h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.3; }
.production-description { min-height: 36px; margin: 7px 0 15px; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.production-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.production-date { color: var(--faint); font-size: 9px; }
.production-card-actions { display: flex; align-items: center; gap: 5px; }
.production-delete { min-height: 32px; padding: 0 9px; color: var(--faint); background: transparent; border: 1px solid transparent; border-radius: 9px; font-size: 10px; font-weight: 700; }
.production-delete:hover { color: var(--danger); background: #fbeef3; }
.production-open { min-height: 32px; padding: 0 11px; color: var(--ink-soft); background: var(--paper); border: 1px solid transparent; border-radius: 9px; font-size: 10px; font-weight: 730; }
.production-open:hover { color: var(--deep-blue); background: rgba(178, 182, 223, .22); }

.production-card--skeleton { min-height: 260px; border-color: transparent; background: linear-gradient(100deg, rgba(243,230,242,.42) 20%, rgba(255,252,255,.92) 38%, rgba(178,182,223,.18) 56%) var(--paper-deep); background-size: 220% 100%; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { to { background-position-x: -220%; } }

.content-state, .empty-studio { min-height: min(520px, 56vh); padding: 45px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.content-state h2, .empty-studio h2 { margin: 20px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.content-state p, .empty-studio p { max-width: 470px; margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-visual { position: relative; width: 160px; height: 130px; margin-bottom: 16px; }
.empty-frame { position: absolute; width: 112px; height: 84px; border-radius: 13px; border: 1px solid var(--line-strong); }
.empty-frame--back { left: 17px; top: 5px; transform: rotate(-9deg); background: var(--paper-deep); }
.empty-frame--front { right: 10px; bottom: 6px; padding: 13px; display: flex; flex-direction: column; justify-content: flex-end; color: white; background: linear-gradient(145deg, var(--ink-soft), var(--deep-blue)); box-shadow: var(--shadow-md); }
.empty-frame--front span { font-family: 'Songti SC', 'STSong', serif; font-size: 16px; }
.empty-frame--front i { width: 26px; height: 2px; margin-top: 7px; display: block; background: var(--accent); }
.empty-spark { position: absolute; right: 0; top: 0; color: var(--accent); font-size: 25px; }

.coming-soon { min-height: calc(100vh - 150px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.coming-icon { width: 64px; height: 64px; margin-bottom: 25px; display: grid; place-items: center; color: var(--deep-blue); background: linear-gradient(145deg, rgba(178, 182, 223, .28), var(--accent-soft)); border: 1px solid rgba(78, 91, 153, .14); border-radius: 20px; transform: rotate(-3deg); }
.coming-icon svg { width: 29px; height: 29px; }
.coming-soon h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.coming-soon > p:not(.eyebrow) { max-width: 490px; margin: 16px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* User Credits wallet */
.app-view--wallet { width: min(1180px, 100%); }
.wallet-view-heading { align-items: center; }
.wallet-refresh-button { display: inline-flex; align-items: center; gap: 8px; }
.wallet-refresh-button svg { width: 17px; height: 17px; }
.wallet-loading {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.wallet-error { margin-bottom: 18px; }
.wallet-content { display: flex; flex-direction: column; gap: 20px; animation: rise-in .28s var(--ease) both; }
.wallet-balance-card {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: clamp(28px, 4vw, 46px);
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(420px, 1.35fr);
    align-items: center;
    gap: 38px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 14%, rgba(225, 106, 217, .34), transparent 36%),
        linear-gradient(135deg, #282238, #4e5b99 72%, #6f5391);
    border-radius: 25px;
    box-shadow: 0 24px 60px rgba(30, 25, 45, .19);
}
.wallet-balance-card::after {
    content: '';
    position: absolute;
    right: -55px;
    bottom: -95px;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
}
.wallet-balance-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.wallet-balance-copy > span { color: rgba(255,255,255,.62); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.wallet-balance-copy strong { font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -.055em; }
.wallet-balance-copy strong small { font-size: 13px; letter-spacing: 0; opacity: .65; }
.wallet-balance-copy p { margin: 2px 0 0; color: rgba(255,255,255,.7); font-size: 11px; }
.wallet-balance-details { position: relative; z-index: 1; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.wallet-balance-details div { min-height: 94px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.085); border: 1px solid rgba(255,255,255,.1); border-radius: 15px; backdrop-filter: blur(8px); }
.wallet-balance-details dt { color: rgba(255,255,255,.53); font-size: 9px; font-weight: 650; }
.wallet-balance-details dd { margin: 0; font-size: 12px; font-weight: 780; }
.wallet-section { padding: clamp(20px, 3vw, 30px); background: rgba(255,252,255,.88); border: 1px solid var(--line); border-radius: 21px; box-shadow: var(--shadow-sm); }
.wallet-section-heading { margin-bottom: 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.wallet-section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.wallet-section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.wallet-payment-status { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; color: var(--warning); background: var(--accent-soft); border-radius: 999px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.wallet-section-message { margin-bottom: 14px; padding: 12px 13px; color: var(--muted); background: var(--paper); border-radius: 11px; font-size: 9px; line-height: 1.55; }
.wallet-section-message.is-error { color: var(--warning); background: var(--accent-soft); }
.wallet-membership-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.wallet-membership-card { min-height: 300px; padding: 20px; display: flex; flex-direction: column; background: linear-gradient(155deg, #fff 42%, rgba(178,182,223,.11)); border: 1px solid var(--line); border-radius: 17px; }
.wallet-membership-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wallet-membership-name { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wallet-membership-name span { color: var(--accent-dark); font-size: 8px; font-weight: 780; letter-spacing: .08em; }
.wallet-membership-name h3 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.wallet-membership-price { flex: 0 0 auto; display: flex; align-items: baseline; gap: 3px; color: var(--deep-blue); }
.wallet-membership-price strong { font-size: 19px; letter-spacing: -.025em; }
.wallet-membership-price span { color: var(--muted); font-size: 8px; }
.wallet-membership-credit { margin-top: 22px; padding: 15px; display: flex; align-items: baseline; gap: 7px; background: rgba(78,91,153,.07); border-radius: 13px; }
.wallet-membership-credit strong { font-size: 27px; letter-spacing: -.035em; }
.wallet-membership-credit span { color: var(--muted); font-size: 8px; font-weight: 700; }
.wallet-membership-benefits { margin: 14px 0 17px; display: flex; flex-direction: column; }
.wallet-membership-benefits div { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.wallet-membership-benefits div:last-child { border-bottom: 0; }
.wallet-membership-benefits dt { color: var(--muted); font-size: 8px; }
.wallet-membership-benefits dd { margin: 0; font-size: 9px; font-weight: 730; text-align: right; }
.wallet-membership-action { width: 100%; min-height: 39px; margin-top: auto; font-size: 10px; }
.wallet-membership-action:disabled { cursor: not-allowed; opacity: .66; }
.wallet-package-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.wallet-package-card { min-height: 205px; padding: 18px; display: flex; flex-direction: column; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 16px; transition: border-color .18s ease, transform .18s var(--ease); }
.wallet-package-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.wallet-package-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wallet-package-heading h3 { margin: 0; font-size: 12px; }
.wallet-package-heading > strong { color: var(--deep-blue); font-size: 15px; }
.wallet-package-credits { margin-top: 18px; display: flex; align-items: baseline; gap: 6px; }
.wallet-package-credits strong { font-size: 28px; letter-spacing: -.035em; }
.wallet-package-credits span { color: var(--muted); font-size: 9px; font-weight: 720; }
.wallet-package-details { min-height: 32px; margin: 7px 0 16px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.wallet-package-action { width: 100%; min-height: 38px; margin-top: auto; font-size: 10px; }
.wallet-package-action:disabled { cursor: not-allowed; opacity: .7; }
.wallet-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; align-items: start; }
.wallet-record-list { display: flex; flex-direction: column; }
.wallet-record { min-height: 66px; padding: 13px 2px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.wallet-record:first-child { padding-top: 2px; }
.wallet-record:last-child { padding-bottom: 2px; border-bottom: 0; }
.wallet-record-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wallet-record-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.wallet-record-copy span { color: var(--faint); font-size: 8px; }
.wallet-record-delta, .wallet-order-status { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wallet-record-delta strong, .wallet-order-status strong { font-size: 11px; }
.wallet-record-delta span, .wallet-order-status span { color: var(--faint); font-size: 8px; }
.wallet-record-delta.is-positive strong { color: var(--success); }
.wallet-record-delta.is-negative strong { color: var(--danger); }
.wallet-empty { min-height: 100px; display: grid; place-items: center; color: var(--faint); background: var(--paper); border: 1px dashed var(--line); border-radius: 13px; font-size: 10px; text-align: center; }

/* A quote is informational until the user explicitly confirms it. */
.credit-quote-dialog { width: min(520px, calc(100vw - 28px)); max-width: none; padding: 0; overflow: visible; color: var(--ink); background: transparent; border: 0; }
.credit-quote-dialog::backdrop { background: rgba(22, 18, 34, .58); backdrop-filter: blur(7px); }
.credit-quote-card { overflow: hidden; background: var(--surface-strong); border: 1px solid rgba(255,255,255,.32); border-radius: 23px; box-shadow: 0 28px 90px rgba(18,14,29,.34); }
.credit-quote-heading { padding: 24px 25px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.credit-quote-heading .eyebrow { margin-bottom: 8px; }
.credit-quote-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.credit-quote-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.credit-quote-body { padding: 22px 25px; }
.credit-quote-price { padding: 21px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(145deg, rgba(178,182,223,.18), var(--accent-soft)); border: 1px solid rgba(78,91,153,.11); border-radius: 17px; text-align: center; }
.credit-quote-price span { color: var(--muted); font-size: 9px; font-weight: 720; }
.credit-quote-price strong { font-size: 26px; letter-spacing: -.03em; }
.credit-quote-price small { color: var(--deep-blue); font-size: 10px; font-weight: 720; }
.credit-quote-summary { margin: 15px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.credit-quote-summary div { padding: 13px 14px; background: var(--paper); border-radius: 12px; }
.credit-quote-summary dt { color: var(--muted); font-size: 8px; }
.credit-quote-summary dd { margin: 6px 0 0; font-size: 11px; font-weight: 750; }
.credit-quote-summary dd.is-insufficient { color: var(--danger); }
.credit-quote-warning { margin-top: 13px; padding: 11px 12px; display: flex; align-items: center; gap: 9px; color: var(--danger); background: #fbeef3; border-radius: 11px; font-size: 9px; font-weight: 650; line-height: 1.5; }
.credit-quote-warning svg { width: 17px; height: 17px; flex: 0 0 17px; }
.credit-quote-note { margin: 14px 2px 0; color: var(--faint); font-size: 8px; line-height: 1.6; }
.credit-quote-actions { padding: 15px 25px 22px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; }
.credit-quote-actions .primary-button, .credit-quote-actions .secondary-button { width: 100%; }

/* Shared Credits components are rendered by the separate Admin console. */
.app-view--credits { width: min(1380px, 100%); }
.credits-view-heading { align-items: center; }
.credits-admin-badge {
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--deep-blue);
    background: rgba(255, 252, 255, .78);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: var(--shadow-sm);
}
.credits-admin-badge svg { width: 16px; height: 16px; }
.credits-admin-shell {
    overflow: hidden;
    background: rgba(255, 252, 255, .8);
    border: 1px solid rgba(78, 91, 153, .14);
    border-radius: 22px;
    box-shadow: 0 18px 54px rgba(30, 25, 45, .075);
    backdrop-filter: blur(14px);
}
.credits-section-nav {
    padding: 9px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    background: rgba(243, 230, 242, .34);
    border-bottom: 1px solid var(--line);
}
.credits-section-tab {
    min-width: 0;
    min-height: 54px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 740;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease, box-shadow .18s var(--ease), transform .18s var(--ease);
}
.credits-section-tab:hover { color: var(--ink); background: rgba(255, 252, 255, .7); transform: translateY(-1px); }
.credits-section-tab.is-active { color: #fff; background: var(--deep-blue); box-shadow: 0 9px 22px rgba(78, 91, 153, .2); }
.credits-section-tab svg { width: 17px; height: 17px; flex: 0 0 17px; }
.credits-section-content { min-height: 480px; }
.credits-section-panel { min-height: 480px; padding: clamp(24px, 4vw, 42px); animation: rise-in .24s var(--ease) both; }
.credits-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.credits-panel-heading .eyebrow { margin-bottom: 8px; }
.credits-panel-heading h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.credits-panel-heading p:last-child { max-width: 620px; margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.credits-retry-button { min-height: 39px; flex: 0 0 auto; }
.credits-retry-button svg { width: 16px; height: 16px; }
.credits-overview-state {
    min-height: 290px;
    margin-top: 24px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: var(--muted);
    background: rgba(248, 244, 250, .72);
    border: 1px dashed var(--line-strong);
    border-radius: 17px;
}
.credits-overview-state > div { display: flex; flex-direction: column; gap: 5px; }
.credits-overview-state strong { color: var(--ink-soft); font-size: 13px; }
.credits-overview-state span:not(.loading-spinner):not(.credits-state-icon) { max-width: 560px; font-size: 11px; line-height: 1.65; }
.credits-overview-state--empty, .credits-overview-state--error { align-items: flex-start; justify-content: flex-start; min-height: 0; }
.credits-overview-state--empty { background: rgba(178, 182, 223, .09); border-style: solid; }
.credits-overview-state--error { color: var(--danger); background: #fbeef3; border-color: rgba(165, 54, 90, .16); border-style: solid; }
.credits-state-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    color: var(--deep-blue);
    background: var(--surface-strong);
    border-radius: 12px;
}
.credits-overview-state--error .credits-state-icon { color: var(--danger); }
.credits-state-icon svg { width: 20px; height: 20px; }
.credits-overview-state code, .credits-feature-placeholder code {
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
    padding: 5px 8px;
    overflow-wrap: anywhere;
    color: var(--deep-blue);
    background: rgba(255, 255, 255, .8);
    border-radius: 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
}
.credits-overview-ready { margin-top: 24px; }
.credits-source-note {
    min-height: 37px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    background: #edf7f3;
    border: 1px solid rgba(57, 119, 95, .14);
    border-radius: 11px;
    font-size: 10px;
    font-weight: 680;
}
.credits-source-note .status-dot { flex: 0 0 6px; }
.credits-overview-metrics {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.credits-overview-metric {
    min-width: 0;
    min-height: 116px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 15px;
}
.credits-overview-metric span { color: var(--muted); font-size: 9px; font-weight: 720; line-height: 1.45; }
.credits-overview-metric strong {
    overflow: hidden;
    color: var(--ink);
    font-size: clamp(19px, 2vw, 27px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.credits-overview-metric small { margin-top: -9px; color: var(--faint); font-size: 8px; }
.credits-overview-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    color: var(--muted);
    background: rgba(178, 182, 223, .08);
    border: 1px dashed var(--line-strong);
    border-radius: 13px;
    font-size: 11px;
    line-height: 1.65;
}
.credits-readiness { margin-top: 18px; }
.credits-readiness h3 { margin: 0 0 10px; font-size: 13px; }
.credits-readiness-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
}
.credits-readiness-item {
    min-height: 44px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(248, 244, 250, .72);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.credits-readiness-item span { color: var(--ink-soft); font-size: 10px; font-weight: 680; }
.credits-readiness-status {
    min-height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: var(--muted);
    background: var(--surface-strong);
    border-radius: 999px;
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
}
.credits-readiness-status.is-ready { color: var(--success); background: #e6f4ee; }
.credits-readiness-status.is-pending { color: var(--warning); background: var(--accent-soft); }
.credits-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}
.credits-membership-ready { margin-top: 24px; }
.credits-membership-list {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}
.credits-membership-card {
    min-width: 0;
    padding: 19px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: 0 10px 28px rgba(30, 25, 45, .035);
}
.credits-membership-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}
.credits-membership-identity { min-width: 0; }
.credits-membership-identity code {
    display: block;
    overflow: hidden;
    color: var(--deep-blue);
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.credits-membership-identity h3 {
    margin: 6px 0 3px;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 17px;
    letter-spacing: -.02em;
}
.credits-membership-identity > span { color: var(--faint); font-size: 8px; font-weight: 680; }
.credits-membership-status {
    min-height: 25px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: var(--muted);
    background: rgba(178, 182, 223, .14);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 820;
}
.credits-membership-status.is-draft { color: var(--warning); background: var(--accent-soft); }
.credits-membership-status.is-published { color: var(--success); background: #e6f4ee; }
.credits-membership-status.is-retired { color: var(--muted); background: rgba(178, 182, 223, .15); }
.credits-membership-primary {
    margin-top: 17px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.credits-membership-primary .credits-membership-metric {
    min-height: 76px;
    padding: 12px;
    background: rgba(255, 252, 255, .8);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.credits-membership-metric {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7px;
}
.credits-membership-metric span { color: var(--muted); font-size: 8px; font-weight: 700; line-height: 1.45; }
.credits-membership-metric strong {
    overflow-wrap: anywhere;
    color: var(--ink-soft);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}
.credits-membership-primary .credits-membership-metric strong { font-size: 20px; letter-spacing: -.025em; }
.credits-membership-terms {
    margin: 13px 0 0;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 15px;
    background: rgba(248, 244, 250, .68);
    border-radius: 12px;
}
.credits-membership-terms > div { min-width: 0; }
.credits-membership-terms dt,
.credits-membership-benefits dt { color: var(--faint); font-size: 8px; font-weight: 680; }
.credits-membership-terms dd,
.credits-membership-benefits dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    color: var(--ink-soft);
    font-size: 9px;
    font-weight: 720;
    line-height: 1.45;
}
.credits-membership-benefits { margin-top: 14px; }
.credits-membership-benefits h4,
.credits-membership-economics h4 { margin: 0; font-size: 10px; }
.credits-membership-benefits dl {
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.credits-membership-benefits dl > div {
    min-width: 0;
    padding: 8px 9px;
    background: rgba(255, 252, 255, .72);
    border: 1px solid var(--line);
    border-radius: 9px;
}
.credits-membership-economics {
    margin-top: 14px;
    padding: 13px;
    color: var(--ink-soft);
    background: linear-gradient(145deg, rgba(78, 91, 153, .075), rgba(243, 230, 242, .3));
    border: 1px solid rgba(78, 91, 153, .11);
    border-radius: 13px;
}
.credits-membership-economics-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.credits-membership-economics-heading > span {
    color: var(--deep-blue);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .04em;
}
.credits-membership-economics-metrics {
    margin-top: 11px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}
.credits-membership-economics-metrics .credits-membership-metric {
    min-height: 66px;
    padding: 9px;
    background: rgba(255, 252, 255, .72);
    border-radius: 9px;
}
.credits-membership-metric.is-passed strong { color: var(--success); }
.credits-membership-metric.is-failed strong { color: var(--danger); }
.credits-membership-metric.is-unknown strong { color: var(--muted); }
.credits-feature-placeholder {
    min-height: 390px;
    padding: 38px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0, rgba(178, 182, 223, .16), transparent 40%),
        rgba(248, 244, 250, .48);
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
}
.credits-placeholder-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 15px;
    display: grid;
    place-items: center;
    color: var(--deep-blue);
    background: linear-gradient(145deg, var(--surface-strong), var(--accent-soft));
    border: 1px solid rgba(78, 91, 153, .13);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}
.credits-placeholder-mark svg { width: 27px; height: 27px; }
.credits-status-pill {
    min-height: 24px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 820;
    letter-spacing: .06em;
}
.credits-feature-placeholder h2 { margin: 14px 0 8px; font-size: 25px; letter-spacing: -.03em; }
.credits-feature-placeholder p { max-width: 600px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.credits-feature-placeholder .secondary-button { margin-top: 20px; }

/* Director workbench — the same spacing and surface tokens are shared by every creation step. */
.app-view--workbench { width: min(1240px, 100%); padding-top: 22px; }
.workbench-topbar {
    min-height: 70px;
    display: grid;
    grid-template-columns: minmax(145px, 1fr) minmax(0, 2fr) minmax(145px, 1fr);
    align-items: center;
    gap: 20px;
}
.workbench-back {
    width: max-content;
    min-height: 44px;
    padding: 0 12px 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 720;
}
.workbench-back:hover { color: var(--deep-blue); background: rgba(178, 182, 223, .18); }
.workbench-back svg { width: 20px; height: 20px; }
.workbench-identity { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.workbench-identity h1 { margin: 4px 0 0; overflow: hidden; font-size: 22px; line-height: 1.2; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.workbench-format { min-height: 24px; padding: 0 7px; display: inline-flex; align-items: center; color: var(--faint); background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 9px; font-weight: 760; letter-spacing: .04em; }
.workbench-format:hover { color: var(--deep-blue); background: rgba(178,182,223,.16); border-color: rgba(78,91,153,.12); }
.workbench-save-status {
    min-height: 38px;
    margin-left: auto;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.workbench-save-status:not(.is-saved):hover { background: var(--surface); }
.workbench-save-status.is-saved { cursor: default; }
.save-status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--success); }
.workbench-save-status.is-saving .save-status-dot { background: var(--deep-blue); animation: loader-pulse 1s ease-in-out infinite; }
.workbench-save-status.is-pending .save-status-dot { background: var(--warning); }
.workbench-save-status.is-error { color: var(--danger); }
.workbench-save-status.is-error .save-status-dot { background: var(--danger); }

.workbench-steps {
    min-height: 62px;
    margin: 4px 0 30px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) 24px
        minmax(0, 1fr) 24px
        minmax(0, 1fr) 24px
        minmax(0, 1fr) 24px
        minmax(0, 1fr);
    align-items: center;
    background: rgba(255, 252, 255, .9);
    border: 1px solid rgba(78, 91, 153, .13);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(30, 25, 45, .045);
    backdrop-filter: blur(14px);
}
.workbench-steps > i { height: 1px; background: linear-gradient(90deg,rgba(78,91,153,.13),rgba(78,91,153,.34),rgba(78,91,153,.13)); }
.workbench-step {
    min-height: 48px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 12px;
    transition: color .18s ease, background .18s ease, box-shadow .18s var(--ease), transform .18s var(--ease);
}
.workbench-step:hover { color: var(--ink); background: rgba(248,244,250,.78); transform: translateY(-1px); }
.workbench-step > span { width: 25px; height: 25px; display: grid; place-items: center; color: var(--muted); background: var(--paper-deep); border-radius: 8px; font-size: 10px; font-weight: 850; }
.workbench-step strong {
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: .01em;
}
.workbench-step em { min-width: 19px; padding: 2px 6px; color: var(--faint); background: var(--paper); border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 750; }
.workbench-step.is-active { color: var(--ink); background: linear-gradient(135deg,rgba(178,182,223,.25),rgba(249,233,247,.7)); box-shadow: inset 0 0 0 1px rgba(78,91,153,.08),0 7px 18px rgba(78,91,153,.08); }
.workbench-step.is-active > span { color: #fff; background: linear-gradient(145deg,var(--deep-blue),#6875b7); box-shadow: 0 5px 14px rgba(78,91,153,.24); }
.workbench-step.is-complete > span { color: #fff; background: var(--deep-blue); font-size: 0; }
.workbench-step.is-complete > span::before {
    width: 13px;
    height: 13px;
    display: block;
    content: '';
    background: center / 13px 13px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.25 6.35 4.85 8.8 9.85 3.35' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.workbench-notice { margin: 0 0 18px; font-size: 12px; }
.workbench-notice > span { flex: 1; }
.workbench-notice .text-button { min-height: 34px; padding: 0 10px; flex: 0 0 auto; font-size: 11px; }
.workbench-notice--conflict { color: var(--danger); background: #fbeef3; border-color: rgba(165, 54, 90, .16); }
.workbench-loading { min-height: min(520px, 58vh); display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 650; }
.workbench-loading .loading-spinner { width: 24px; height: 24px; }
.workbench-error { min-height: min(520px, 58vh); }
.workbench-error-actions { display: flex; gap: 9px; }
.workbench-content { padding-bottom: 60px; }
.workbench-stage { animation: rise-in .28s var(--ease) both; }
.workbench-stage--story { max-width: 830px; margin: 0 auto; }
.workbench-stage--story.is-wide { max-width: none; }
.workbench-stage-heading { margin: 0 0 25px; }
.workbench-stage-heading h2 { margin: 0; font-size: clamp(28px, 3.8vw, 43px); line-height: 1.12; letter-spacing: -.045em; }
.workbench-stage-heading > p:last-child, .workbench-stage-heading > div > p:last-child { max-width: 660px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.workbench-stage-heading--with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.frames-next-actions {
    padding: 15px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg,rgba(255,252,255,.98),rgba(238,240,250,.88));
    border: 1px solid rgba(78,91,153,.16);
    border-radius: 17px;
    box-shadow: 0 12px 32px rgba(78,91,153,.08);
}
.frames-next-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.frames-next-copy strong { font-size: 12px; }
.frames-next-copy span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.frames-next-actions .primary-button { flex: 0 0 auto; }
.frames-next-actions .primary-button svg { width: 17px; height: 17px; }

.story-panes {
    width: fit-content;
    max-width: 100%;
    min-height: 48px;
    margin: 0 auto 26px;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    background: rgba(255,252,255,.78);
    border: 1px solid var(--line);
    border-radius: 14px;
    scrollbar-width: none;
}
.story-panes::-webkit-scrollbar { display: none; }
.story-pane-button {
    min-height: 36px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 740;
}
.story-pane-button:hover { color: var(--ink); background: var(--paper); }
.story-pane-button.is-active { color: #fff; background: var(--deep-blue); box-shadow: 0 6px 16px rgba(78,91,153,.16); }
.story-pane-button em { min-width: 17px; padding: 2px 5px; color: inherit; background: rgba(255,255,255,.14); border-radius: 99px; font-size: 8px; font-style: normal; }
.story-pane[hidden] { display: none; }

.story-editor {
    padding: 23px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 252, 255, .92);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.story-editor > span { color: var(--ink-soft); font-size: 14px; font-weight: 750; }
.story-editor textarea, .workbench-input, .workbench-textarea, .shot-duration-input {
    width: 100%;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.story-editor textarea { min-height: 310px; padding: 19px; resize: vertical; font-size: 16px; line-height: 1.9; }
.story-editor textarea::placeholder, .workbench-input::placeholder, .workbench-textarea::placeholder { color: #aaa2b2; }
.story-editor textarea:focus, .workbench-input:focus, .workbench-textarea:focus, .shot-duration-input:focus { border-color: rgba(78, 91, 153, .62); box-shadow: 0 0 0 4px rgba(178, 182, 223, .25); }
.story-editor small { display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 11px; line-height: 1.5; }
.story-breakdown-panel {
    margin-top: 15px;
    padding: 17px 19px;
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(178, 182, 223, .18), rgba(255, 252, 255, .88));
    border: 1px solid rgba(78, 91, 153, .16);
    border-radius: 16px;
    transition: background-color .18s ease, border-color .18s ease;
}
.story-breakdown-icon { width: 45px; height: 45px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(255,255,255,.72); border: 1px solid rgba(78,91,153,.12); border-radius: 14px; }
.story-breakdown-icon svg { width: 23px; height: 23px; }
.story-breakdown-panel strong { display: block; font-size: 14px; }
.story-breakdown-panel p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.story-breakdown-panel.is-ready { background: linear-gradient(135deg, rgba(178,182,223,.27), rgba(255,252,255,.96)); border-color: rgba(78,91,153,.28); }
.story-breakdown-panel.is-working .story-breakdown-icon { animation: loader-pulse 1.2s ease-in-out infinite; }
.story-breakdown-panel.is-warning { background: #fbf0f7; border-color: rgba(201,59,138,.17); }
.story-breakdown-panel.is-protected, .story-breakdown-panel.is-unavailable { background: rgba(255,252,255,.58); border-color: var(--line); }
.story-breakdown-panel.is-protected .story-breakdown-icon, .story-breakdown-panel.is-unavailable .story-breakdown-icon { color: var(--faint); }
.model-audition-entry {
    width: 100%; margin-top: 10px; padding: 12px 15px; display: grid;
    grid-template-columns: 42px minmax(0,1fr) 20px; align-items: center; gap: 12px;
    color: var(--ink); text-align: left; background: rgba(255,252,255,.72);
    border: 1px dashed rgba(78,91,153,.24); border-radius: 15px; cursor: pointer;
    transition: transform .18s var(--ease), border-color .18s ease, background-color .18s ease;
}
.model-audition-entry:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255,252,255,.96); border-color: rgba(201,59,138,.34); }
.model-audition-entry:disabled { color: var(--faint); cursor: default; opacity: .72; }
.model-audition-entry-mark { width: 42px; height: 34px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.2); border-radius: 10px; font: 800 10px/1 'JetBrains Mono', monospace; }
.model-audition-entry-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.model-audition-entry-copy > span:first-child { display: flex; align-items: center; gap: 8px; }
.model-audition-entry-copy strong { font-size: 12px; }
.model-audition-entry-copy small { padding: 3px 7px; color: var(--ribbon-pink); background: rgba(232,58,166,.09); border-radius: 99px; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.model-audition-entry-copy > span:last-child { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-audition-entry > svg { width: 18px; color: var(--deep-blue); }
.story-generation-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100dvh - 28px)); padding: 0; overflow: hidden; color: var(--ink); background: transparent; border: 0; border-radius: 24px; box-shadow: 0 28px 90px rgba(26,22,48,.28); }
.story-generation-dialog::backdrop { background: rgba(28,25,43,.48); backdrop-filter: blur(5px); }
.story-generation-shell { overflow: hidden; background: linear-gradient(160deg, #fffafd, #f6f3ff); border: 1px solid rgba(78,91,153,.14); border-radius: inherit; }
.story-generation-heading { padding: 24px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.story-generation-heading h2 { margin: 4px 0 6px; font-size: 24px; }
.story-generation-heading p:last-child { max-width: 430px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.story-generation-options { padding: 18px; display: grid; gap: 12px; }
.story-generation-option { width: 100%; padding: 17px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; color: var(--ink); text-align: left; background: rgba(255,255,255,.74); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.story-generation-option:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(78,91,153,.36); box-shadow: 0 12px 28px rgba(78,91,153,.09); }
.story-generation-option.is-recommended { background: linear-gradient(135deg, rgba(178,182,223,.22), rgba(255,255,255,.9)); border-color: rgba(78,91,153,.24); }
.story-generation-option:disabled { opacity: .46; cursor: not-allowed; }
.story-generation-option-mark { width: 48px; height: 48px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.24); border-radius: 15px; font-size: 22px; font-weight: 900; }
.story-generation-option-mark.is-audition { color: var(--ribbon-pink); background: rgba(232,58,166,.09); font: 800 9px/1 'JetBrains Mono', monospace; }
.story-generation-option-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.story-generation-option-copy > span:first-child { display: flex; align-items: center; gap: 8px; }
.story-generation-option-copy strong { font-size: 14px; }
.story-generation-option-copy small { padding: 3px 7px; color: var(--deep-blue); background: rgba(78,91,153,.09); border-radius: 99px; font-size: 9px; font-weight: 800; }
.story-generation-option-copy > span:last-child { color: var(--muted); font-size: 11px; line-height: 1.55; }
.story-generation-option em { color: var(--deep-blue); font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.workbench-stage-actions { margin-top: 22px; display: flex; justify-content: flex-end; }
.workbench-stage-actions--story { align-items: center; justify-content: space-between; gap: 12px; }
.story-manual-button { color: var(--deep-blue); }
.story-breakdown-panel + .workbench-stage-actions button:disabled { cursor: default; }

.workbench-card-list, .shot-scene-groups { display: flex; flex-direction: column; gap: 15px; }
.workbench-card, .shot-scene-group {
    background: rgba(255, 252, 255, .93);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 5px 18px rgba(30, 25, 45, .035);
}
.workbench-card { padding: 19px; }
.workbench-card-head, .shot-scene-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.workbench-card-number { display: inline-flex; align-items: center; gap: 9px; color: var(--deep-blue); font-size: 12px; font-weight: 820; }
.workbench-card-number span { width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--deep-blue); border-radius: 9px; font-size: 10px; }
.workbench-card-actions { display: flex; align-items: center; gap: 4px; }
.workbench-card-action {
    min-width: 42px;
    min-height: 38px;
    padding: 0 10px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}
.workbench-card-action:hover:not(:disabled) { color: var(--deep-blue); background: rgba(178, 182, 223, .18); }
.workbench-card-action.is-danger:hover:not(:disabled) { color: var(--danger); background: #fbeef3; }
.workbench-card-action:disabled { cursor: default; opacity: .32; }
.workbench-fields { margin-top: 17px; display: grid; grid-template-columns: minmax(190px, .75fr) minmax(0, 1.65fr); gap: 14px; }
.workbench-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.workbench-field > span { color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.workbench-input { height: 48px; padding: 0 13px; font-size: 14px; }
.workbench-textarea { min-height: 86px; padding: 12px 13px; resize: vertical; font-size: 14px; line-height: 1.65; }

.workbench-empty { min-height: 330px; padding: 42px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(255, 252, 255, .58); border: 1px dashed var(--line-strong); border-radius: 20px; }
.workbench-empty-number { width: 58px; height: 58px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178, 182, 223, .22); border-radius: 18px; font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 800; transform: rotate(-3deg); }
.workbench-empty h3 { margin: 20px 0 7px; font-size: 20px; }
.workbench-empty p { max-width: 430px; margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.65; }

.shot-scene-group { overflow: hidden; }
.shot-scene-heading { min-height: 70px; padding: 14px 18px; background: rgba(178, 182, 223, .1); border-bottom: 1px solid var(--line); }
.shot-scene-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.shot-scene-index { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; color: #fff; background: var(--ink-soft); border-radius: 10px; font-size: 10px; font-weight: 850; }
.shot-scene-title > div { min-width: 0; }
.shot-scene-title h3 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.shot-scene-title p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.shot-scene-heading .secondary-button { min-height: 40px; padding: 0 13px; }
.shots-list { padding: 13px; display: flex; flex-direction: column; gap: 10px; }
.continuous-shot-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.shot-insert {
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
    align-items: center;
    gap: 9px;
}
.shot-insert-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(78,91,153,.18));
}
.shot-insert-line:last-child {
    background: linear-gradient(90deg, rgba(78,91,153,.18), transparent);
}
.shot-insert-button {
    min-height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
    background: rgba(255,252,255,.76);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 760;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s var(--ease);
}
.shot-insert-plus {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--deep-blue);
    background: rgba(178,182,223,.2);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
}
.shot-insert-copy { max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap; transition: max-width .2s var(--ease), opacity .16s ease; }
.shot-insert-button:hover:not(:disabled),
.shot-insert-button:focus-visible {
    color: var(--deep-blue);
    background: var(--surface-strong);
    border-color: rgba(78,91,153,.2);
    box-shadow: 0 7px 18px rgba(78,91,153,.09);
    transform: translateY(-1px);
}
.shot-insert-button:hover:not(:disabled) .shot-insert-copy,
.shot-insert-button:focus-visible .shot-insert-copy {
    max-width: 92px;
    opacity: 1;
}
.shot-insert-button:disabled { cursor: default; opacity: .42; }
.shot-card { padding: 15px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 14px; }
.shot-card .workbench-fields { grid-template-columns: minmax(160px, .65fr) minmax(280px, 1.55fr) 112px; }
.shot-duration-wrap { position: relative; }
.shot-duration-input { height: 48px; padding: 0 36px 0 13px; font-size: 14px; }
.shot-duration-unit { position: absolute; top: 14px; right: 12px; color: var(--faint); font-size: 11px; pointer-events: none; }
.shot-image-comparison-panel { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.shot-image-comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.shot-image-comparison-heading > div { min-width: 0; }
.shot-image-comparison-heading h4 { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.4; }
.shot-image-comparison-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.shot-image-generate-button { min-width: 136px; flex: 0 0 auto; white-space: nowrap; }
.shot-image-comparison-loading { position: relative; min-height: 112px; margin-top: 12px; display: flex; align-items: flex-end; justify-content: flex-start; overflow: hidden; color: rgba(237,242,255,.86); background: #131626; border: 1px solid rgba(117,132,222,.18); border-radius: 13px; font-size: 9px; }
.shot-image-comparison-loading .ai-image-loader { position: absolute; inset: 0; min-height: 0; border: 0; }
.shot-image-comparison-loading > span:last-child { position: relative; z-index: 8; margin: 0 12px 11px; padding: 5px 8px; background: rgba(18,20,38,.54); border: 1px solid rgba(161,175,255,.15); border-radius: 999px; backdrop-filter: blur(10px); }
.shot-image-candidates { margin-top: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot-image-candidate { min-width: 0; padding: 10px; background: rgba(248,244,250,.72); border: 1px solid var(--line); border-radius: 13px; transition: border-color .18s ease, box-shadow .18s ease, opacity .18s ease; }
.shot-image-candidate.is-selected { border-color: rgba(201,59,138,.45); box-shadow: 0 0 0 2px rgba(225,106,217,.1); }
.shot-image-candidate.is-not-selected { background: rgba(248,244,250,.45); }
.shot-image-candidate-heading { min-height: 25px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shot-image-candidate-heading strong { color: var(--deep-blue); font-size: 11px; letter-spacing: .04em; }
.shot-image-candidate-result { padding: 3px 7px; color: var(--muted); background: var(--surface-strong); border-radius: 999px; font-size: 8px; font-weight: 780; }
.shot-image-candidate.is-selected .shot-image-candidate-result { color: var(--accent-dark); background: var(--accent-soft); }
.shot-image-candidate-preview { width: 100%; aspect-ratio: 4 / 3; padding: 0; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: #eee9f1; border: 0; border-radius: 10px; }
button.shot-image-candidate-preview:hover { box-shadow: 0 0 0 2px rgba(78,91,153,.15); }
.shot-image-candidate-preview img { width: 100%; height: 100%; display: block; object-fit: contain; background: #eee9f1; }
.shot-image-candidate-preview .ai-image-loader { min-height: 0; border: 0; border-radius: inherit; }
.shot-image-candidate-preview.is-placeholder { cursor: default; }
.shot-image-candidate-preview.is-retry { cursor: pointer; }
.shot-image-candidate-preview.is-retry:hover:not(:disabled) .shot-image-candidate-failed-mark { transform: rotate(-28deg) scale(1.06); box-shadow: 0 8px 22px rgba(184,49,107,.14); }
.shot-image-candidate-preview.is-retry:focus-visible { outline: 3px solid rgba(78,91,153,.24); outline-offset: 3px; }
.shot-image-candidate-preview.is-retry:disabled { cursor: not-allowed; opacity: .72; }
.shot-image-candidate-preview.is-error { padding: 16px; font-size: 10px; line-height: 1.55; text-align: center; }
.shot-image-candidate-failed-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--danger); background: #fbeef3; border-radius: 12px; font-size: 24px; font-weight: 750; line-height: 1; transition: transform .18s ease, box-shadow .18s ease; }
.shot-image-candidate-status { min-height: 34px; margin: 8px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.shot-image-candidate-status.is-revealed { color: var(--ink-soft); font-weight: 650; }
.shot-image-choice-button { width: 100%; min-height: 40px; margin-top: 8px; }
.shot-image-reroll-button {
    width: auto;
    min-height: 34px;
    margin: 12px auto 0;
    padding: 5px 10px;
    display: flex;
    color: var(--deep-blue);
    background: transparent;
    border-color: transparent;
    border-radius: 9px;
    box-shadow: none;
    font-size: 10px;
    font-weight: 720;
}
.shot-image-reroll-button:hover:not(:disabled) {
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-color: transparent;
    box-shadow: none;
}
.shot-version-history-toggle {
    width: auto;
    min-height: 34px;
    margin: 11px auto 0;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--deep-blue);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 10px;
    font-weight: 720;
}
.shot-version-history-toggle::after { content: "⌄"; margin-left: 6px; font-size: 12px; transition: transform .18s ease; }
.shot-version-history-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.shot-version-history-toggle:hover { color: var(--accent-dark); background: var(--accent-soft); }
.shot-version-history-toggle:focus-visible { outline: 3px solid rgba(78,91,153,.12); }
.shot-version-history {
    margin-top: 8px;
    padding: 12px;
    background: rgba(178,182,223,.07);
    border: 1px solid var(--line);
    border-radius: 13px;
}
.shot-version-history-heading,
.shot-version-history-meta,
.shot-version-history-candidate > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.shot-version-history-heading strong { color: var(--ink-soft); font-size: 11px; }
.shot-version-history-heading span { color: var(--muted); font-size: 8px; text-align: right; }
.shot-version-history-list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.shot-version-history-group { padding: 9px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 11px; }
.shot-version-history-meta { margin-bottom: 7px; }
.shot-version-history-meta strong { color: var(--ink-soft); font-size: 9px; }
.shot-version-history-meta span { padding: 3px 6px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 8px; }
.shot-version-history-candidates { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.shot-version-history-candidate { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.shot-version-history-preview { width: 100%; aspect-ratio: 4 / 3; padding: 0; display: block; overflow: hidden; background: #eee9f1; border: 0; }
.shot-version-history-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.shot-version-history-candidate > div { min-height: 34px; padding: 4px 7px; }
.shot-version-history-candidate > div > span { color: var(--ink-soft); font-size: 8px; font-weight: 720; }
.shot-version-history-candidate .text-button { min-height: 28px; padding: 3px 5px; font-size: 8px; }
.shot-version-history-empty { min-height: 58px; margin: 9px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 9px; text-align: center; }
.shot-version-history-empty .loading-spinner { width: 19px; height: 19px; border-width: 2px; }
.shot-version-history-error { margin: 8px 0 0; color: var(--danger); font-size: 8px; }
.shot-version-history-list.is-video { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.shot-version-history-list.is-video .shot-video-take { min-width: 0; margin-top: 0; }
.shot-video-take.is-history .shot-video-preview.has-playable-video { height: min(30vh, 220px); min-height: 160px; }
.shot-video-take.is-history .shot-video-select-button { min-height: 36px; }
@media (max-width: 720px) {
    .shot-version-history-list.is-video { grid-template-columns: 1fr; }
}
.shot-image-comparison-notice { margin-top: 11px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 10px; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.shot-image-comparison-notice.is-error { color: var(--danger); background: #fbeef3; border: 1px solid rgba(165,54,90,.13); }
.shot-image-comparison-notice > span { min-width: 0; }
.shot-image-comparison-notice .text-button { min-height: 34px; padding: 5px 8px; flex: 0 0 auto; font-size: 10px; }
.shot-video-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.shot-video-panel.is-stale { --shot-video-accent: var(--ribbon-pink); }
.shot-video-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.shot-video-heading > div { min-width: 0; }
.shot-video-heading h4 { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.4; }
.shot-video-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.shot-video-generate-button { min-width: 136px; min-height: 40px; flex: 0 0 auto; white-space: nowrap; }
.shot-video-specs { margin-top: 12px; padding: 12px; background: rgba(178,182,223,.08); border: 1px solid var(--line); border-radius: 12px; }
.shot-video-specs-heading { margin-bottom: 9px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shot-video-specs-heading strong { color: var(--ink-soft); font-size: 11px; }
.shot-video-specs-heading span { color: var(--muted); font-size: 9px; text-align: right; }
.shot-video-specs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.shot-video-spec-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.shot-video-spec-field > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.shot-video-spec-field select,
.shot-video-spec-value { width: 100%; min-height: 38px; padding: 8px 10px; color: var(--ink); background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 10px; }
.shot-video-spec-field select:focus { border-color: rgba(78,91,153,.45); outline: 3px solid rgba(78,91,153,.1); }
.shot-video-spec-value { display: flex; align-items: center; color: var(--ink-soft); background: rgba(248,244,250,.72); }
.shot-video-specs > small { margin-top: 8px; display: block; color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-video-continuity { margin-top: 10px; padding: 11px 12px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; color: var(--ink-soft); background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.shot-video-continuity:hover:not(.is-disabled) { border-color: rgba(78,91,153,.32); }
.shot-video-continuity.is-on { background: rgba(178,182,223,.12); border-color: rgba(78,91,153,.34); box-shadow: 0 0 0 2px rgba(78,91,153,.05); }
.shot-video-continuity.is-disabled { cursor: not-allowed; opacity: .62; }
.shot-video-continuity > input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.shot-video-continuity-switch { position: relative; width: 38px; height: 22px; display: block; background: rgba(126,120,139,.26); border-radius: 999px; transition: background .18s ease; }
.shot-video-continuity-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(31,27,40,.18); transition: transform .18s ease; }
.shot-video-continuity.is-on .shot-video-continuity-switch { background: var(--deep-blue); }
.shot-video-continuity.is-on .shot-video-continuity-switch::after { transform: translateX(16px); }
.shot-video-continuity:focus-within { outline: 3px solid rgba(78,91,153,.1); border-color: rgba(78,91,153,.45); }
.shot-video-continuity-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shot-video-continuity-copy strong { color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.shot-video-continuity-copy small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.shot-video-prompt-field { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.shot-video-prompt-label-row { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shot-video-prompt-label-row > span { color: var(--ink-soft); font-size: 10px; font-weight: 720; }
.shot-video-enhance-button { min-height: 34px; padding: 5px 10px; flex: 0 0 auto; color: var(--deep-blue); font-size: 10px; }
.shot-video-prompt-field textarea { width: 100%; min-height: 70px; padding: 11px 12px; color: var(--ink); background: rgba(255,255,255,.76); border: 1px solid var(--line); border-radius: 11px; resize: vertical; font: inherit; font-size: 12px; line-height: 1.6; }
.shot-video-prompt-field textarea:focus { border-color: rgba(78,91,153,.45); outline: 3px solid rgba(78,91,153,.1); }
.shot-video-prompt-field textarea:disabled { color: var(--muted); background: rgba(248,244,250,.72); }
.shot-video-prompt-field small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-video-current-generate-action { margin-top: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: linear-gradient(135deg, rgba(78,91,153,.10), rgba(249,233,247,.58)); border: 1px solid rgba(78,91,153,.20); border-radius: 13px; }
.shot-video-current-generate-action p { min-width: 0; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.shot-video-current-generate-button { min-width: 245px; min-height: 46px; flex: 0 0 auto; margin: 0; }
.shot-video-current-generate-button > span { color: inherit; font-size: 10px; font-weight: 780; }
.shot-video-loading { position: relative; min-height: 120px; margin-top: 12px; display: flex; align-items: flex-start; justify-content: flex-start; overflow: hidden; color: rgba(240,237,249,.88); background: #1e192d; border: 1px solid rgba(78,91,153,.22); border-radius: 13px; font-size: 9px; }
.shot-video-loading .ai-video-loader { position: absolute; inset: 0; min-height: 0; border: 0; }
.shot-video-loading-copy { position: relative; z-index: 8; margin: 11px 0 0 12px; padding: 5px 8px; background: rgba(30,25,45,.58); border: 1px solid rgba(178,182,223,.15); border-radius: 999px; backdrop-filter: blur(10px); }
.shot-video-take { margin-top: 13px; padding: 10px; background: rgba(248,244,250,.72); border: 1px solid var(--line); border-radius: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
.shot-video-take.is-selected { background: #f4f8f6; border-color: rgba(43,127,99,.24); box-shadow: 0 0 0 2px rgba(43,127,99,.06); }
.shot-video-take.is-stale { background: #fff7fb; border-color: rgba(201,59,138,.24); }
.shot-video-take-heading { min-height: 25px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shot-video-take-heading strong { color: var(--deep-blue); font-size: 11px; }
.shot-video-take-heading span { padding: 3px 7px; color: var(--muted); background: var(--surface-strong); border-radius: 999px; font-size: 8px; font-weight: 780; }
.shot-video-take.is-selected .shot-video-take-heading span { color: var(--success); background: rgba(43,127,99,.09); }
.shot-video-take.is-stale .shot-video-take-heading span { color: var(--accent-dark); background: var(--accent-soft); }
.shot-video-take-spec { margin: -1px 0 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.shot-video-take-spec span { padding: 3px 7px; color: var(--ink-soft); background: rgba(178,182,223,.14); border-radius: 999px; font-size: 8px; font-weight: 680; }
.shot-video-preview { position: relative; width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 11px; overflow: hidden; color: rgba(255,255,255,.74); background: #171420; border-radius: 10px; font-size: 10px; line-height: 1.55; text-align: center; }
.shot-video-preview > .ai-video-loader { position: absolute; inset: 0; min-height: 0; border: 0; }
.shot-video-preview.has-playable-video { height: min(66vh, 520px); min-height: 280px; }
.shot-video-poster-fallback, .shot-video-poster, .shot-video-player { position: absolute; inset: 0; width: 100%; height: 100%; }
.shot-video-poster-fallback { z-index: 0; display: grid; place-items: center; color: rgba(255,255,255,.26); background: radial-gradient(circle at 50% 42%, rgba(178,182,223,.17), transparent 38%), #171420; font-size: 34px; }
.shot-video-poster { z-index: 1; display: block; object-fit: contain; background: #171420; opacity: 1; transition: opacity .16s ease; }
.shot-video-player { z-index: 2; display: block; visibility: hidden; object-fit: contain; background: #171420; border: 0; border-radius: inherit; }
.shot-video-preview.has-frame .shot-video-poster { opacity: 0; pointer-events: none; }
.shot-video-preview.has-frame .shot-video-player { visibility: visible; }
.shot-video-play-button { position: relative; z-index: 3; min-height: 45px; padding: 6px 15px 6px 7px; display: inline-flex; align-items: center; gap: 9px; color: #fff; background: rgba(25,21,34,.76); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; box-shadow: 0 10px 30px rgba(10,8,15,.28); font: inherit; font-weight: 760; backdrop-filter: blur(10px); }
.shot-video-play-button:hover:not(:disabled) { background: rgba(38,32,50,.9); }
.shot-video-play-button:focus-visible, .shot-video-reload-button:focus-visible { outline: 3px solid rgba(255,255,255,.34); outline-offset: 2px; }
.shot-video-play-button:disabled { cursor: wait; opacity: .72; }
.shot-video-play-button[hidden], .shot-video-reload-button[hidden], .shot-video-play-status[hidden] { display: none !important; }
.shot-video-play-icon { width: 31px; height: 31px; display: grid; place-items: center; padding-left: 2px; color: #fff; background: var(--deep-blue); border-radius: 50%; font-size: 11px; }
.shot-video-reload-button { position: absolute; z-index: 4; top: 10px; right: 10px; min-height: 30px; padding: 0 10px; color: rgba(255,255,255,.9); background: rgba(25,21,34,.68); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font: inherit; font-size: 8px; font-weight: 730; backdrop-filter: blur(9px); }
.shot-video-play-status { position: absolute; z-index: 4; left: 50%; bottom: 14px; max-width: calc(100% - 28px); padding: 6px 9px; color: rgba(255,255,255,.9); background: rgba(25,21,34,.72); border-radius: 999px; font-size: 8px; transform: translateX(-50%); backdrop-filter: blur(8px); }
.shot-video-theater { position: fixed; z-index: 300; inset: 0; width: 100vw; height: 100dvh; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); isolation: isolate; color: #fff; background: #0f0d17; overscroll-behavior: contain; touch-action: manipulation; }
.shot-video-theater:focus { outline: none; }
.shot-video-theater-header { min-height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; align-items: center; gap: 10px; background: linear-gradient(180deg, rgba(22,19,32,.98), rgba(15,13,23,.94)); border-bottom: 1px solid rgba(178,182,223,.12); box-shadow: 0 8px 28px rgba(7,6,12,.12); backdrop-filter: blur(18px); }
.shot-video-theater-header::after { content: ''; width: 40px; height: 40px; }
.shot-video-theater-header > div { min-width: 0; display: grid; justify-items: center; gap: 2px; }
.shot-video-theater-header strong { color: rgba(255,255,255,.96); font-size: 13px; font-weight: 760; letter-spacing: .035em; }
.shot-video-theater-header span { overflow: hidden; color: rgba(218,220,244,.58); font-size: 9px; font-weight: 560; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.shot-video-theater-close { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: rgba(242,243,255,.9); background: linear-gradient(145deg, rgba(178,182,223,.14), rgba(255,255,255,.055)); border: 1px solid rgba(202,205,238,.16); border-radius: 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 7px 22px rgba(5,4,10,.2); font: inherit; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.shot-video-theater-close:hover { color: #fff; background: rgba(178,182,223,.19); border-color: rgba(202,205,238,.26); }
.shot-video-theater-close:active { transform: scale(.95); }
.shot-video-theater-close:disabled { opacity: .58; }
.shot-video-theater-close:focus-visible { outline: 3px solid rgba(178,182,223,.55); outline-offset: 2px; }
.shot-video-control-icon { width: 18px; height: 18px; display: block; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.shot-video-theater-stage { position: relative; width: 100%; height: 100%; min-height: 0; margin: 0 auto; overflow: hidden; background: #100d18; }
.shot-video-theater-stage.is-portrait { max-width: min(100vw, 560px); }
.shot-video-theater-stage .shot-video-player { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; border-radius: 0; object-fit: contain; pointer-events: none; }
.shot-video-theater-stage .shot-video-player::-webkit-media-controls,
.shot-video-theater-stage .shot-video-player::-webkit-media-controls-enclosure,
.shot-video-theater-stage .shot-video-player::-webkit-media-controls-panel { display: none !important; -webkit-appearance: none; }
.shot-video-theater-stage .shot-video-player::-webkit-media-controls-fullscreen-button { display: none !important; }
.shot-video-theater.has-frame .shot-video-player { visibility: visible; }
.shot-video-theater-poster { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; background: #100d18; transition: opacity .16s ease; }
.shot-video-theater.has-frame .shot-video-theater-poster { opacity: 0; pointer-events: none; }
.shot-video-theater-status { position: absolute; z-index: 4; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: calc(100% - 36px); padding: 8px 11px; color: rgba(255,255,255,.92); background: rgba(25,21,34,.82); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; font-size: 10px; text-align: center; transform: translateX(-50%); backdrop-filter: blur(10px); }
.shot-video-theater-status[hidden] { display: none; }
.shot-video-theater-controls { position: absolute; z-index: 5; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; min-height: 50px; padding: 7px 11px; display: grid; grid-template-columns: 36px 42px minmax(0,1fr) 42px; align-items: center; gap: 9px; color: #fff; background: linear-gradient(135deg, rgba(30,26,43,.86), rgba(18,16,27,.88)); border: 1px solid rgba(202,205,238,.15); border-radius: 17px; box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 14px 38px rgba(0,0,0,.3); backdrop-filter: blur(18px); }
.shot-video-theater-play { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: rgba(247,247,255,.94); background: rgba(178,182,223,.14); border: 1px solid rgba(202,205,238,.16); border-radius: 12px; font: inherit; transition: background .16s ease, transform .16s ease; }
.shot-video-theater-play:hover { background: rgba(178,182,223,.22); }
.shot-video-theater-play:active { transform: scale(.95); }
.shot-video-theater-play:focus-visible { outline: 3px solid rgba(178,182,223,.55); outline-offset: 2px; }
.shot-video-theater-time { color: rgba(235,236,252,.76); font-size: 9px; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: .02em; text-align: center; }
.shot-video-theater-seek { width: 100%; min-width: 0; height: 22px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; touch-action: none; }
.shot-video-theater-seek::-webkit-slider-runnable-track { height: 3px; background: rgba(223,224,245,.25); border-radius: 999px; }
.shot-video-theater-seek::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5.5px; appearance: none; -webkit-appearance: none; background: #c5c9f0; border: 2px solid #f7f7ff; border-radius: 50%; box-shadow: 0 3px 10px rgba(0,0,0,.28); }
.shot-video-theater-seek::-moz-range-track { height: 3px; background: rgba(223,224,245,.25); border: 0; border-radius: 999px; }
.shot-video-theater-seek::-moz-range-progress { height: 3px; background: #aeb4ec; border-radius: 999px; }
.shot-video-theater-seek::-moz-range-thumb { width: 11px; height: 11px; background: #c5c9f0; border: 2px solid #f7f7ff; border-radius: 50%; box-shadow: 0 3px 10px rgba(0,0,0,.28); }
.shot-video-theater-seek:disabled { opacity: .55; }
body.shot-video-theater-open .app-main { overflow: hidden; }
.shot-video-preview .loading-spinner { width: 25px; height: 25px; flex: 0 0 auto; border-color: rgba(255,255,255,.28); border-top-color: #fff; }
.shot-video-preview.is-error { padding: 20px; }
.shot-video-failed-mark { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; color: #fff; background: rgba(201,59,138,.78); border-radius: 10px; font-size: 17px; font-weight: 850; }
.shot-video-take-actions { margin-top: 9px; display: flex; gap: 8px; }
.shot-video-take-actions .shot-video-select-button,
.shot-video-take-actions .shot-video-adjust-button { min-height: 42px; margin-top: 0; flex: 1 1 0; }
.shot-video-select-button { width: 100%; min-height: 42px; margin-top: 9px; }
.shot-video-adjustment-dialog { width: min(920px, calc(100vw - 24px)); max-height: min(90vh, 860px); padding: 0; overflow: hidden; border: 0; border-radius: 24px; background: var(--surface); box-shadow: 0 28px 80px rgba(31,27,40,.26); }
.shot-video-adjustment-shell { max-height: min(90vh, 860px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.shot-video-adjustment-shell > header { padding: 24px 28px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.shot-video-adjustment-shell > header span { color: var(--accent-dark); font-size: 10px; font-weight: 780; letter-spacing: .12em; }
.shot-video-adjustment-shell > header h2 { margin: 7px 0 0; color: var(--ink); font-size: 24px; line-height: 1.3; }
.shot-video-adjustment-shell > header p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.shot-video-adjustment-body { padding: 22px 28px; overflow: auto; }
.shot-video-adjustment-prompt { display: flex; flex-direction: column; gap: 8px; }
.shot-video-adjustment-prompt strong,
.shot-video-adjustment-reference-head strong { color: var(--ink-soft); font-size: 12px; }
.shot-video-adjustment-prompt textarea { min-height: 108px; padding: 13px 14px; color: var(--ink); background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 13px; resize: vertical; font: inherit; font-size: 12px; line-height: 1.65; }
.shot-video-adjustment-prompt textarea:focus { border-color: rgba(78,91,153,.46); outline: 3px solid rgba(78,91,153,.1); }
.shot-video-adjustment-reference-head { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shot-video-adjustment-reference-head > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shot-video-adjustment-reference-head > div > span { color: var(--muted); font-size: 9px; }
.shot-video-adjustment-add-reference { min-height: 34px; padding: 0 13px; flex: 0 0 auto; border-radius: 999px; font-size: 9px; }
.shot-video-adjustment-add-reference span { color: inherit; font-size: inherit; font-weight: inherit; }
.shot-video-adjustment-assets { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shot-video-adjustment-asset { min-width: 0; padding: 8px; display: grid; grid-template-columns: auto 52px minmax(0, 1fr); align-items: center; gap: 9px; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.shot-video-adjustment-asset.is-selected { background: rgba(178,182,223,.13); border-color: rgba(78,91,153,.38); box-shadow: 0 0 0 2px rgba(78,91,153,.05); }
.shot-video-adjustment-asset input { width: 18px; height: 18px; accent-color: var(--deep-blue); }
.shot-video-adjustment-asset-preview { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; color: var(--deep-blue); background: var(--surface-strong); border-radius: 9px; }
.shot-video-adjustment-asset-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.shot-video-adjustment-asset-preview svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.shot-video-adjustment-asset-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shot-video-adjustment-asset-copy strong { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.shot-video-adjustment-asset-copy small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.shot-video-adjustment-empty { grid-column: 1 / -1; min-height: 92px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); background: rgba(178,182,223,.07); border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 10px; }
.shot-video-adjustment-empty.is-error { color: var(--danger); }
.shot-video-adjustment-note { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.shot-video-adjustment-shell > footer { padding: 14px 28px 18px; border-top: 1px solid var(--line); }
.shot-video-adjustment-shell > footer .form-error { margin: 0 0 9px; }
.shot-video-adjustment-shell > footer > div { display: flex; justify-content: flex-end; gap: 9px; }
.shot-video-adjustment-shell > footer button { min-width: 120px; }
.shot-video-notice { margin-top: 11px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 10px; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.shot-video-notice.is-error { color: var(--danger); background: #fbeef3; border: 1px solid rgba(165,54,90,.13); }
.shot-video-notice > span { min-width: 0; }
.shot-video-notice .text-button { min-height: 34px; padding: 5px 8px; flex: 0 0 auto; font-size: 10px; }
.shot-empty { min-height: 110px; padding: 24px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--muted); text-align: center; }
.shot-empty p { margin: 0; font-size: 13px; }
.delete-work-item-dialog .dialog-body { padding-top: 0; padding-bottom: 8px; }

/* Project settings and shot reference bindings */
.settings-summary {
    min-height: 48px;
    margin: -8px 0 13px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    color: var(--ink-soft);
    background: linear-gradient(135deg, rgba(178,182,223,.16), rgba(255,252,255,.84));
    border: 1px solid rgba(78,91,153,.14);
    border-radius: 13px;
    font-size: 11px;
    line-height: 1.6;
}

.frame-status-overview {
    margin-top: 17px;
    padding: 15px;
    overflow: hidden;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(78,91,153,.13);
    border-radius: 16px;
    box-shadow: none;
}
.frame-status-overview::before { content: ''; display: block; width: 38px; height: 2px; margin: -15px 0 12px; background: linear-gradient(90deg, var(--deep-blue), var(--neon-pink)); border-radius: 99px; }

.frame-status-overview.is-empty { color: var(--muted); font-size: 11px; }
.frame-status-overview.is-resolving {
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(106,117,190,.12), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,.9), rgba(244,245,251,.92));
}
.frame-status-resolving-heading { display: flex; align-items: center; gap: 11px; }
.frame-status-resolving-heading > div { min-width: 0; flex: 1; }
.frame-status-resolving-heading strong { display: block; color: var(--ink-soft); font-size: 12px; }
.frame-status-resolving-heading div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.frame-status-resolving-indicator {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid rgba(78,91,153,.12);
    border-radius: 11px;
    background: rgba(255,255,255,.74);
    box-shadow: 0 6px 16px rgba(64,57,92,.07);
}
.frame-status-resolving-indicator i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #6674b4;
    animation: frame-status-dot 1.05s ease-in-out infinite;
}
.frame-status-resolving-indicator i:nth-child(2) { animation-delay: .13s; }
.frame-status-resolving-indicator i:nth-child(3) { animation-delay: .26s; }
.frame-status-resolving-progress {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: #66709e;
    border: 1px solid rgba(78,91,153,.1);
    border-radius: 999px;
    background: rgba(255,255,255,.66);
    font-size: 8px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}
.frame-status-overview.is-paused .frame-status-resolving-indicator i { animation: none; background: #a3a8bd; }
.frame-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.frame-status-heading-copy { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.frame-status-heading-copy > span { color: var(--accent-dark); font-size: 7px; font-weight: 820; letter-spacing: .12em; }
.frame-status-heading-copy > strong { color: var(--ink-soft); font-size: 12px; letter-spacing: .01em; }
.frame-status-total { min-height: 27px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; color: var(--deep-blue); background: rgba(178,182,223,.14); border: 1px solid rgba(78,91,153,.09); border-radius: 999px; }
.frame-status-total strong { font-size: 9px; font-variant-numeric: tabular-nums; }
.frame-status-total small { color: var(--muted); font-size: 7px; font-weight: 680; }
.frame-status-grid { position: relative; margin-top: 11px; padding: 9px; display: grid; grid-template-columns: repeat(var(--frame-status-columns, 14), minmax(0, 1fr)); justify-content: stretch; gap: 7px 6px; background: rgba(178,182,223,.07); border: 1px solid rgba(78,91,153,.07); border-radius: 11px; }
.frame-status-cell {
    position: relative;
    width: 100%;
    max-width: 68px;
    height: auto;
    aspect-ratio: 1;
    padding: 0;
    display: grid;
    place-items: center;
    justify-self: center;
    border-radius: 8px;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: background-color .16s ease, border-color .16s ease, opacity .16s ease;
}
.frame-status-cell::after { display: none; }
.frame-status-cell.is-complete { color: #fff; background: var(--deep-blue); border: 1px solid var(--deep-blue); box-shadow: none; }
.frame-status-cell.is-pending { color: #fff; background: var(--ribbon-pink); border: 1px solid var(--ribbon-pink); box-shadow: none; }
.frame-status-grid.is-resolving { pointer-events: none; }
.frame-status-cell.is-resolving {
    color: rgba(82,90,124,.5);
    border: 1px solid rgba(78,91,153,.08);
    background: linear-gradient(110deg, rgba(236,237,245,.82) 20%, rgba(250,250,253,.98) 42%, rgba(236,237,245,.82) 64%);
    background-size: 220% 100%;
    box-shadow: none;
    animation: frame-status-shimmer 1.55s ease-in-out infinite;
    animation-delay: calc(var(--frame-status-delay, 0) * 35ms);
}
.frame-status-cell.is-resolving::after { display: none; }
.frame-status-overview.is-paused .frame-status-cell.is-resolving { animation: none; background: rgba(238,239,246,.72); }
.frame-status-cell:hover { opacity: .84; }
.frame-status-cell:active { opacity: .68; }
.frame-status-cell:focus-visible { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; }

@media (max-width: 720px) {
    .frame-status-grid { grid-template-columns: repeat(7, minmax(0,1fr)); justify-content: stretch; }
    .frame-status-cell { max-width: none; }
}

@keyframes frame-status-dot {
    0%, 65%, 100% { transform: translateY(0); opacity: .42; }
    32% { transform: translateY(-3px); opacity: 1; }
}

@keyframes frame-status-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .frame-status-resolving-indicator i,
    .frame-status-cell.is-resolving { animation: none; }
}

.setting-extraction-tool,
.production-style-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(73, 83, 151, .14);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(235, 237, 255, .88), rgba(255, 239, 249, .72));
}

.setting-extraction-tool-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, #5060aa, #ec5eb0);
}

.setting-extraction-tool-copy,
.production-style-card > div {
    min-width: 0;
    flex: 1;
}

.setting-extraction-tool-copy strong,
.production-style-card h3 {
    display: block;
    margin: 0 0 5px;
    color: var(--ink-strong, #202136);
    font-size: 17px;
}

.setting-extraction-tool-copy p,
.production-style-card p {
    margin: 0;
    color: var(--ink-muted, #707187);
    line-height: 1.55;
}

#extract-settings {
    display: grid;
    gap: 2px;
    flex: 0 0 auto;
}

#extract-settings small {
    font-weight: 600;
    color: #59649f;
}

.production-style-card {
    align-items: flex-start;
    background: rgba(255, 255, 255, .88);
}

.production-style-card .setting-card-badge {
    position: static;
    display: inline-flex;
    margin-bottom: 10px;
}

.production-style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0;
}

.production-style-tags span {
    padding: 5px 9px;
    border-radius: 999px;
    color: #4e568c;
    background: #eef0ff;
    font-size: 12px;
    font-weight: 700;
}

.setting-extraction-shell {
    width: min(760px, calc(100vw - 24px));
    max-height: min(88vh, 900px);
}

.setting-extraction-body {
    min-height: 220px;
    padding: 20px;
    overflow: auto;
}

.setting-extraction-items {
    display: grid;
    gap: 12px;
}

.setting-extraction-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(72, 80, 140, .14);
    border-radius: 17px;
    background: #fff;
}

.setting-extraction-item.is-existing {
    opacity: .68;
    background: #f7f7fb;
}

.setting-extraction-item > input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 7px;
    accent-color: #5261aa;
}

.setting-extraction-item-fields {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
}

.setting-extraction-item-fields label:last-child {
    grid-column: 1 / -1;
}

.setting-extraction-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #7b7d91;
    font-size: 12px;
}

.setting-extraction-style {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(72, 80, 140, .12);
}

.setting-extraction-style h3 {
    margin: 0 0 12px;
}

@media (max-width: 700px) {
    .setting-extraction-tool,
    .production-style-card {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .setting-extraction-tool-copy {
        flex-basis: calc(100% - 62px);
    }

    #extract-settings,
    .production-style-card > button {
        width: 100%;
    }

    .setting-extraction-item-fields {
        grid-template-columns: 1fr;
    }

    .setting-extraction-item-fields label:last-child {
        grid-column: auto;
    }
}
.setting-filters { margin-bottom: 20px; padding: 5px; display: flex; align-items: center; gap: 4px; overflow-x: auto; background: rgba(255,252,255,.72); border: 1px solid var(--line); border-radius: 13px; scrollbar-width: none; }
.setting-filters::-webkit-scrollbar { display: none; }
.setting-filter { min-height: 36px; padding: 0 15px; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 10px; font-weight: 730; }
.setting-filter:hover { color: var(--ink); background: var(--paper); }
.setting-filter.is-active { color: #fff; background: var(--deep-blue); }
.settings-state { min-height: 230px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); text-align: center; background: rgba(255,252,255,.55); border: 1px dashed var(--line-strong); border-radius: 18px; font-size: 11px; }
.settings-state .loading-spinner { width: 24px; height: 24px; }
.settings-state strong { color: var(--ink); font-size: 14px; }
.settings-state .secondary-button { margin-top: 5px; }
.settings-state.is-error { color: var(--danger); }
.setting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 14px; }
.setting-card { min-width: 0; padding: 11px; background: rgba(255,252,255,.92); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 18px rgba(30,25,45,.035); }
.setting-card-preview { position: relative; width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: linear-gradient(145deg, rgba(178,182,223,.2), rgba(243,230,242,.5)); border-radius: 12px; }
.setting-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.setting-card-placeholder { width: 48px; height: 48px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(255,255,255,.66); border-radius: 15px; font-size: 18px; font-weight: 830; }
.setting-card-badge { position: absolute; left: 9px; bottom: 9px; min-height: 24px; padding: 0 8px; display: inline-flex; align-items: center; color: #fff; background: rgba(30,25,45,.68); border-radius: 99px; font-size: 8px; font-weight: 780; backdrop-filter: blur(8px); }
.setting-card-body { padding: 13px 3px 2px; }
.setting-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.setting-card-heading > div { min-width: 0; }
.setting-card-heading h3 { margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.setting-card-heading small { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; }
.setting-status { min-height: 23px; padding: 0 8px; display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--warning); background: var(--accent-soft); border-radius: 99px; font-size: 8px; font-weight: 780; }
.setting-status.is-ready { color: var(--success); background: #edf7f3; }
.setting-card-description { min-height: 36px; margin: 10px 0 12px; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.setting-card-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.setting-card-actions .secondary-button { min-height: 36px; padding: 0 9px; font-size: 9px; }
.setting-card-actions .setting-delete-button { color: var(--danger); }
.setting-card-actions .setting-delete-button:hover:not(:disabled) { background: #fbeef3; border-color: rgba(165,54,90,.18); }
.setting-audio-note { margin: 0; padding: 11px 12px; color: var(--muted); background: var(--paper); border-radius: 10px; font-size: 10px; line-height: 1.6; }
.setting-audio-sample { padding: 13px; display: grid; gap: 11px; background: rgba(178,182,223,.09); border: 1px solid var(--line); border-radius: 12px; }
.setting-audio-sample strong { display: block; font-size: 11px; }
.setting-audio-sample p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.setting-audio-sample audio { width: 100%; height: 42px; }
.setting-audio-sample .secondary-button { min-height: 38px; font-size: 9px; }
.setting-audio-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.setting-audio-actions .secondary-button { flex: 1 1 150px; }

.setting-reference-picker-dialog { width: min(940px, calc(100vw - 32px)); }
.setting-reference-picker-shell { min-height: min(690px, calc(100vh - 34px)); }
.setting-reference-picker-body { min-height: 0; padding: 18px 27px 24px; flex: 1; overflow: auto; overscroll-behavior: contain; }
.setting-reference-picker-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.setting-reference-asset-item { min-width: 0; }
.setting-reference-asset-card { width: 100%; height: 100%; min-width: 0; padding: 8px; display: flex; flex-direction: column; align-items: stretch; color: var(--ink); text-align: left; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 15px rgba(30,25,45,.035); transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.setting-reference-asset-card:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(78,91,153,.3); box-shadow: 0 14px 34px rgba(78,91,153,.1); }
.setting-reference-asset-card.is-current { background: linear-gradient(145deg, rgba(178,182,223,.16), rgba(255,252,255,.96)); border-color: rgba(78,91,153,.3); box-shadow: inset 0 0 0 1px rgba(78,91,153,.05); }
.setting-reference-asset-card.is-current:disabled { cursor: default; opacity: 1; }
.setting-reference-asset-card.is-selecting { border-color: rgba(201,59,138,.42); box-shadow: 0 0 0 2px rgba(225,106,217,.11); opacity: 1; }
.setting-reference-asset-preview { position: relative; width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; color: rgba(78,91,153,.54); background: linear-gradient(145deg, rgba(178,182,223,.23), rgba(243,230,242,.48)); border-radius: 11px; }
.setting-reference-asset-preview > * { grid-area: 1 / 1; }
.setting-reference-asset-preview img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: cover; }
.setting-reference-asset-fallback { width: 46px; height: 46px; display: grid; place-items: center; background: rgba(255,255,255,.55); border-radius: 14px; }
.setting-reference-asset-fallback svg { width: 24px; height: 24px; }
.setting-reference-asset-copy { min-width: 0; padding: 12px 3px 9px; display: flex; flex-direction: column; gap: 4px; }
.setting-reference-asset-copy strong { overflow: hidden; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.setting-reference-asset-copy > span { overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.setting-reference-asset-copy small { overflow: hidden; color: var(--faint); font-size: 8px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.setting-reference-asset-action { min-height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: center; color: var(--deep-blue); background: rgba(178,182,223,.18); border-radius: 9px; font-size: 9px; font-weight: 760; }
.setting-reference-asset-card.is-current .setting-reference-asset-action { color: var(--success); background: #edf7f3; }
.setting-reference-asset-card.is-selecting .setting-reference-asset-action { color: var(--accent-dark); background: var(--accent-soft); }
.setting-reference-asset-card.is-selecting .setting-reference-asset-action::before { content: ''; width: 12px; height: 12px; margin-right: 6px; border: 2px solid rgba(201,59,138,.2); border-top-color: var(--accent-dark); border-radius: 50%; animation: spin .75s linear infinite; }
.setting-reference-picker-state { min-height: 370px; padding: 35px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; background: rgba(248,244,250,.55); border: 1px dashed var(--line-strong); border-radius: 17px; font-size: 10px; line-height: 1.6; }
.setting-reference-picker-state strong { margin-top: 4px; color: var(--ink); font-size: 15px; }
.setting-reference-picker-state > span:not(.loading-spinner):not(.state-icon):not(.setting-reference-empty-visual) { max-width: 410px; }
.setting-reference-picker-state .loading-spinner { width: 25px; height: 25px; }
.setting-reference-picker-state .secondary-button, .setting-reference-picker-state .primary-button { min-height: 40px; margin-top: 8px; font-size: 11px; }
.setting-reference-picker-state.is-error { color: var(--danger); }
.setting-reference-empty-visual { width: 62px; height: 62px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.19); border-radius: 19px; transform: rotate(-3deg); }
.setting-reference-empty-visual svg { width: 29px; height: 29px; }
.setting-reference-picker-body .form-error { margin-top: 13px; }
.setting-reference-picker-footer > div { flex: 0 0 auto; display: flex; gap: 8px; }
.setting-reference-picker-footer .primary-button, .setting-reference-picker-footer .secondary-button { min-height: 40px; padding: 0 15px; font-size: 11px; }

/* AI setting-image flow */
.setting-generation-dialog { width: min(820px, calc(100vw - 32px)); }
.setting-generation-shell { min-height: min(610px, calc(100vh - 34px)); }
.setting-generation-body { min-height: 0; padding: 22px 27px 25px; flex: 1; overflow: auto; overscroll-behavior: contain; }
.setting-generation-state { min-height: 410px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); text-align: center; background: rgba(248,244,250,.55); border: 1px dashed var(--line-strong); border-radius: 18px; font-size: 10px; line-height: 1.6; }
.setting-generation-state .ai-image-loader { width: min(460px, 100%); height: clamp(190px, 34vh, 260px); min-height: 190px; flex: 0 0 auto; margin-bottom: 8px; border-radius: 19px; }
.setting-generation-state strong { margin-top: 5px; color: var(--ink); font-size: 15px; }
.setting-generation-setup { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(235px, .75fr); align-items: stretch; gap: 14px; }
.setting-generation-current { grid-column: 1 / -1; min-width: 0; padding: 12px; display: grid; grid-template-columns: minmax(180px, .72fr) minmax(260px, 1.28fr); gap: 16px; background: linear-gradient(145deg, rgba(178,182,223,.12), rgba(255,252,255,.92)); border: 1px solid var(--line); border-radius: 15px; }
.setting-generation-current-preview { min-height: 190px; display: grid; place-items: center; overflow: hidden; color: var(--deep-blue); background: rgba(248,244,250,.72); border: 1px solid var(--line); border-radius: 12px; font-size: 11px; font-weight: 780; }
.setting-generation-current-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.setting-generation-current-copy { min-width: 0; padding: 8px 6px 8px 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.setting-generation-current-title { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.setting-generation-current-title small { display: block; color: var(--deep-blue); font-size: 8px; font-weight: 780; }
.setting-generation-current-title h3 { margin: 7px 0 0; font-size: 20px; }
.setting-generation-current-copy > p { margin: 13px 0 17px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.setting-generation-current-copy > .secondary-button { min-height: 38px; padding: 0 14px; font-size: 9px; }
.setting-generation-prompt-field, .setting-generation-reference-section, .setting-generation-controls { min-width: 0; margin: 0; padding: 17px; background: rgba(255,252,255,.82); border: 1px solid var(--line); border-radius: 15px; }
.setting-generation-prompt-field { grid-column: 1; }
.setting-generation-prompt-field > span { font-size: 12px; font-weight: 790; }
.setting-generation-prompt-field textarea { min-height: 218px; margin-top: 10px; padding: 13px 14px; line-height: 1.7; resize: vertical; }
.setting-generation-prompt-field small { display: block; margin-top: 9px; color: var(--muted); font-size: 8px; line-height: 1.55; }
.setting-generation-reference-section { grid-column: 2; }
.setting-generation-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.setting-generation-section-heading > div { min-width: 0; }
.setting-generation-section-heading strong, .setting-generation-section-heading span { display: block; }
.setting-generation-section-heading strong { font-size: 12px; }
.setting-generation-section-heading strong em { margin-left: 5px; color: var(--muted); font-size: 8px; font-style: normal; font-weight: 650; }
.setting-generation-section-heading span { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.55; }
.setting-generation-section-heading .text-button { min-height: 28px; flex: 0 0 auto; font-size: 8px; }
.setting-generation-reference-empty { min-height: 128px; margin-top: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--faint); background: rgba(248,244,250,.62); border: 1px dashed var(--line-strong); border-radius: 12px; }
.setting-generation-reference-empty > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.18); border-radius: 11px; font-size: 19px; }
.setting-generation-reference-empty p { margin: 0; font-size: 9px; }
.setting-generation-reference-selected { min-height: 128px; margin-top: 13px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; gap: 7px; }
.setting-generation-reference-selected[data-count="1"] { grid-template-columns: minmax(0, 128px); }
.setting-generation-reference-selected[data-count="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.setting-generation-reference-thumb { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 11px; }
.setting-generation-reference-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.setting-generation-reference-thumb button { position: absolute; top: 5px; right: 5px; width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: rgba(30,25,45,.64); border: 0; border-radius: 50%; font-size: 13px; backdrop-filter: blur(7px); }
.setting-generation-reference-thumb.is-source > span { position: absolute; right: 5px; bottom: 5px; left: 5px; min-height: 22px; display: grid; place-items: center; color: #fff; background: rgba(30,25,45,.66); border-radius: 7px; font-size: 7px; font-weight: 760; backdrop-filter: blur(7px); }
.setting-generation-reference-actions { margin-top: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.setting-generation-reference-actions .secondary-button { min-height: 39px; padding: 0 9px; font-size: 9px; }
.setting-generation-controls { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 18px; }
.setting-generation-model-field { min-width: 0; }
.setting-generation-model-field > span, .setting-generation-count legend { display: block; padding: 0; color: var(--ink); font-size: 10px; font-weight: 780; }
.setting-generation-model-field select { width: 100%; min-height: 44px; margin-top: 9px; padding: 0 38px 0 12px; color: var(--ink); background-color: var(--surface-strong); border: 1px solid var(--line); border-radius: 11px; font: inherit; font-size: 10px; font-weight: 700; }
.setting-generation-model-field select:focus-visible { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; }
.setting-generation-model-field small { display: block; min-height: 0; margin-top: 6px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.setting-generation-model-field small:empty { display: none; }
.setting-generation-count { min-width: 176px; padding: 0; border: 0; }
.setting-generation-count-options { margin-top: 9px; display: grid; grid-template-columns: repeat(3,52px); gap: 6px; }
.setting-generation-count-options label { position: relative; cursor: pointer; }
.setting-generation-count-options input { position: absolute; opacity: 0; pointer-events: none; }
.setting-generation-count-options span { min-height: 44px; display: grid; place-items: center; color: var(--ink-soft); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 11px; font-size: 11px; font-weight: 760; transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.setting-generation-count-options label:hover span { border-color: rgba(78,91,153,.28); }
.setting-generation-count-options input:checked + span { color: var(--deep-blue); background: rgba(178,182,223,.2); border-color: rgba(78,91,153,.36); box-shadow: inset 0 0 0 1px rgba(78,91,153,.05); }
.setting-generation-count-options input:focus-visible + span { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; }
.setting-generation-results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.setting-generation-results-heading h3 { margin: 0; font-size: 16px; }
.setting-generation-results-heading p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.setting-generation-results-heading .setting-generation-mode-summary { width: fit-content; min-height: 24px; margin-top: 9px; padding: 0 9px; display: inline-flex; align-items: center; color: var(--deep-blue); background: rgba(178,182,223,.16); border-radius: 99px; font-size: 8px; font-weight: 740; }
.setting-generation-results-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.setting-generation-results-actions .text-button { min-height: 28px; padding: 0 8px; color: var(--deep-blue); font-size: 8px; }
.setting-generation-progress { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--deep-blue); background: rgba(178,182,223,.18); border-radius: 99px; font-size: 8px; font-weight: 770; }
.setting-generation-candidates { margin-top: 16px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.setting-generation-candidates[data-count="1"] { max-width: 560px; grid-template-columns: 1fr; }
.setting-generation-candidates[data-count="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.setting-generation-candidate { min-width: 0; padding: 9px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px rgba(30,25,45,.035); }
.setting-generation-candidate.is-selected { border-color: rgba(43,127,99,.32); box-shadow: 0 0 0 2px rgba(43,127,99,.07); }
.setting-generation-candidate.is-rejected { opacity: .54; }
.setting-generation-candidate-preview { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: linear-gradient(145deg, rgba(178,182,223,.2), rgba(243,230,242,.45)); border: 0; border-radius: 12px; }
button.setting-generation-candidate-preview { padding: 0; cursor: zoom-in; }
.setting-generation-candidate-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.setting-generation-candidate-preview .ai-image-loader { min-height: 0; border: 0; border-radius: inherit; }
.setting-generation-candidate-preview.is-failed { color: var(--danger); font-size: 9px; }
.setting-generation-candidate-copy { padding: 11px 3px 7px; }
.setting-generation-candidate-copy strong { display: block; font-size: 11px; }
.setting-generation-candidate-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.setting-generation-candidate-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 7px; }
.setting-generation-candidate-actions .primary-button, .setting-generation-candidate-actions .secondary-button { min-height: 38px; padding: 0 8px; font-size: 9px; }
.setting-generation-candidate-selected { min-height: 38px; display: grid; place-items: center; color: var(--success); background: #edf7f3; border-radius: 10px; font-size: 9px; font-weight: 780; }
.setting-generation-candidate-readonly { min-height: 38px; display: grid; place-items: center; color: var(--muted); background: rgba(248,244,250,.78); border: 1px solid var(--line); border-radius: 10px; font-size: 9px; font-weight: 740; }
.setting-generation-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.setting-generation-history-heading h3 { margin: 0; font-size: 16px; }
.setting-generation-history-heading p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.setting-generation-history-heading > div:last-child { flex: 0 0 auto; display: flex; gap: 7px; }
.setting-generation-history-heading .secondary-button { min-height: 36px; padding: 0 11px; font-size: 8px; }
.setting-generation-history-state { min-height: 330px; margin-top: 15px; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; background: rgba(248,244,250,.55); border: 1px dashed var(--line-strong); border-radius: 16px; font-size: 9px; line-height: 1.55; }
.setting-generation-history-state strong { color: var(--ink); font-size: 14px; }
.setting-generation-history-state .loading-spinner { width: 25px; height: 25px; }
.setting-generation-history-state .secondary-button { min-height: 38px; margin-top: 5px; font-size: 9px; }
.setting-generation-history-state.is-error { color: var(--danger); }
.setting-generation-history-list { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.setting-generation-history-item { min-width: 0; }
.setting-generation-history-button { width: 100%; min-height: 67px; padding: 12px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto 18px; align-items: center; gap: 10px; color: var(--ink); text-align: left; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: transform .18s var(--ease), border-color .18s ease, box-shadow .18s ease; }
.setting-generation-history-button:hover { transform: translateY(-2px); border-color: rgba(78,91,153,.3); box-shadow: 0 8px 22px rgba(78,91,153,.08); }
.setting-generation-history-button:focus-visible { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; }
.setting-generation-history-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.setting-generation-history-main strong { font-size: 11px; }
.setting-generation-history-main small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.setting-generation-history-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.setting-generation-history-badges em { min-height: 23px; padding: 0 8px; display: inline-flex; align-items: center; color: var(--deep-blue); background: rgba(178,182,223,.18); border-radius: 99px; font-size: 7px; font-style: normal; font-weight: 760; }
.setting-generation-history-badges em.is-stale { color: var(--muted); background: rgba(248,244,250,.9); border: 1px solid var(--line); }
.setting-generation-history-arrow { color: var(--faint); font-size: 20px; line-height: 1; }
.setting-generation-body > .form-error { margin-top: 13px; }
.setting-generation-footer > div { flex: 0 0 auto; display: flex; gap: 8px; }
.setting-generation-footer .primary-button, .setting-generation-footer .secondary-button { min-height: 41px; padding: 0 16px; font-size: 10px; }

.frame-scene-groups .shot-scene-heading { min-height: 62px; }
.frame-scene-groups { overflow-anchor: none; }
.frame-scene-groups .shot-scene-group { overflow: visible; }
.frame-scene-groups .shot-scene-heading { border-radius: 17px 17px 0 0; }
.frame-scene-groups .shots-list { border-radius: 0 0 17px 17px; }
.frame-shot-card { padding: 15px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 14px; transition: border-color .22s ease, background-color .22s ease, box-shadow .22s ease; }
.continuous-shot-list--frames > .shot-insert { min-height: 44px; }
@media (hover: none) {
    .shot-insert-copy { max-width: 92px; opacity: 1; }
}
.frame-shot-card.is-targeted { border-color: rgba(225,106,217,.72); background: #fffaff; box-shadow: 0 0 0 5px rgba(225,106,217,.14), 0 18px 46px rgba(63,48,91,.14); }
.frame-shot-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.frame-shot-copy { min-width: 0; }
.frame-shot-copy strong { display: block; font-size: 13px; }
.frame-shot-copy p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.frame-shot-actions { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.frame-shot-edit-button { min-height: 36px; padding: 0 12px; flex: 0 0 auto; font-size: 9px; }
.frame-shot-delete-button { min-height: 36px; padding: 0 10px; color: var(--muted); font-size: 9px; }
.frame-shot-delete-button:hover:not(:disabled) { color: var(--danger); background: #fbeef3; }
.frame-shot-inline-editor { margin-top: 10px; }
.frame-shot-inline-editor .workbench-textarea { min-height: 104px; }
.frame-shot-inline-editor-footer { min-height: 40px; margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.frame-shot-inline-error { color: var(--danger); font-size: 9px; line-height: 1.5; }
.frame-shot-inline-actions { margin-left: auto; display: flex; gap: 7px; }
.frame-shot-inline-actions .primary-button, .frame-shot-inline-actions .secondary-button { min-height: 38px; padding: 0 14px; font-size: 10px; }
.shot-reference-strip { margin-top: 13px; padding: 11px; background: rgba(178,182,223,.08); border: 1px solid var(--line); border-radius: 12px; }
.shot-reference-strip.is-ready { background: #f4f8f6; border-color: rgba(43,127,99,.16); }
.shot-reference-strip.is-blocked { background: #fbf0f7; border-color: rgba(201,59,138,.16); }
.shot-reference-strip.is-outdated { background: #fff5fb; border-color: rgba(201,59,138,.3); box-shadow: inset 3px 0 0 rgba(201,59,138,.58); }
.shot-reference-strip.is-loading { opacity: .72; }
.shot-reference-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shot-reference-strip-copy { min-width: 0; }
.shot-reference-strip-copy strong { display: block; color: var(--ink-soft); font-size: 11px; }
.shot-reference-strip-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.shot-reference-strip .secondary-button { min-height: 36px; padding: 0 11px; flex: 0 0 auto; font-size: 9px; }
.shot-reference-chips { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.shot-reference-chip { min-height: 25px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); background: rgba(255,255,255,.76); border: 1px solid var(--line); border-radius: 99px; font-size: 8px; font-weight: 720; }
.shot-reference-chip::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; background: var(--success); border-radius: 50%; }
.shot-reference-chip.is-audio::before { background: var(--mist-blue); }
.shot-reference-chip.is-outdated { color: #9c2f73; background: #fff1f9; border-color: rgba(201,59,138,.3); }
.shot-reference-chip.is-outdated::before { background: var(--ribbon-pink); box-shadow: 0 0 0 3px rgba(201,59,138,.12); }
.final-workspace { display: flex; flex-direction: column; gap: 18px; }
.final-heading { padding: 21px 22px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: linear-gradient(135deg,rgba(255,252,255,.98),rgba(244,240,251,.92)); border: 1px solid var(--line); border-radius: 18px; }
.final-heading h2 { margin: 3px 0 0; font-size: clamp(23px,3vw,34px); letter-spacing: -.035em; }
.final-heading p:last-child { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.final-heading > .secondary-button { min-width: 112px; flex: 0 0 auto; }
.final-state:empty { display: none; }
.final-state.is-error, .final-loading { min-height: 78px; padding: 15px 18px; display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--muted); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 15px; font-size: 10px; }
.final-state.is-error { justify-content: space-between; color: var(--danger); }
.final-loading .loading-spinner { width: 23px; height: 23px; }
.final-sequence-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(245px,1fr)); gap: 13px; }
.final-clip-card { min-width: 0; padding: 11px; background: rgba(255,252,255,.95); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px rgba(30,25,45,.035); }
.final-clip-card.is-missing { background: rgba(248,244,250,.68); border-style: dashed; }
.final-clip-heading { min-height: 43px; margin-bottom: 9px; display: flex; align-items: center; gap: 10px; }
.final-clip-heading > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; color: #fff; background: var(--deep-blue); border-radius: 9px; font-size: 9px; font-weight: 850; }
.final-clip-heading > div { min-width: 0; flex: 1; }
.final-clip-heading strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.final-clip-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.final-clip-heading em { padding: 4px 7px; flex: 0 0 auto; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 780; }
.final-video-preview.has-playable-video { height: 290px; min-height: 220px; }
.final-clip-missing { min-height: 190px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; color: var(--muted); background: var(--paper); border-radius: 11px; font-size: 10px; }
.final-clip-missing .secondary-button { min-height: 40px; }
.final-export-panel { padding: 18px; background: rgba(255,252,255,.97); border: 1px solid rgba(78,91,153,.18); border-radius: 18px; box-shadow: 0 10px 30px rgba(78,91,153,.06); }
.final-export-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.final-export-heading h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.final-export-heading p { max-width: 680px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.final-export-heading > .primary-button,
.final-export-heading > .secondary-button { min-width: 170px; flex: 0 0 auto; }
.final-export-progress { min-height: 88px; margin-top: 15px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--deep-blue); background: rgba(178,182,223,.12); border-radius: 13px; font-size: 11px; font-weight: 720; }
.final-export-progress .loading-spinner { width: 25px; height: 25px; }
.final-export-panel > .final-video-preview { width: min(560px,100%); height: min(68vh,640px); margin: 16px auto 0; }
.final-export-footer { margin-top: 14px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.final-export-footer > span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.final-download-button { min-width: 150px; flex: 0 0 auto; text-decoration: none; }
.final-export-note { margin-top: 14px; padding: 12px 14px; color: var(--muted); background: var(--paper); border-radius: 11px; font-size: 9px; line-height: 1.6; }
.rough-cut-workspace { display: flex; flex-direction: column; gap: 18px; }
.rough-cut-modebar { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(135deg,rgba(255,252,255,.98),rgba(238,240,250,.72)); border: 1px solid rgba(78,91,153,.16); border-radius: 16px; }
.rough-cut-modebar-copy { min-width: 0; }
.rough-cut-modebar-copy strong,
.rough-cut-modebar-copy span { display: block; }
.rough-cut-modebar-copy strong { font-size: 12px; }
.rough-cut-modebar-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.rough-cut-view-switch { padding: 3px; display: flex; flex: 0 0 auto; background: rgba(78,91,153,.08); border-radius: 11px; }
.rough-cut-view-switch button { min-height: 36px; padding: 0 15px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font: inherit; font-size: 9px; font-weight: 780; cursor: pointer; transition: color .16s,background .16s,box-shadow .16s; }
.rough-cut-view-switch button.is-active { color: var(--deep-blue); background: #fff; box-shadow: 0 4px 14px rgba(78,91,153,.12); }
.rough-cut-shell { display: grid; grid-template-columns: minmax(300px,.88fr) minmax(420px,1.12fr); gap: 18px; align-items: start; }
.rough-cut-preview-panel,
.rough-cut-editor-panel,
.rough-cut-track-panel { padding: 18px; background: rgba(255,252,255,.97); border: 1px solid rgba(78,91,153,.14); border-radius: 20px; box-shadow: 0 10px 30px rgba(78,91,153,.055); }
.rough-cut-panel-heading { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rough-cut-panel-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.rough-cut-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.rough-cut-preview { position: relative; min-height: 340px; aspect-ratio: 9/16; max-height: 62vh; margin: 0 auto; overflow: hidden; background: #171520; border-radius: 14px; }
.rough-cut-preview:fullscreen,
.rough-cut-preview:-webkit-full-screen { width: 100vw; height: 100vh; max-height: none; border: 0; border-radius: 0; background: #000; }
.rough-cut-preview:fullscreen .rough-subtitle-canvas-handle,
.rough-cut-preview:-webkit-full-screen .rough-subtitle-canvas-handle,
.rough-cut-preview:fullscreen .rough-cut-subtitle-box::after,
.rough-cut-preview:-webkit-full-screen .rough-cut-subtitle-box::after { display: none; }
.rough-cut-preview video { width: 100%; height: 100%; display: block; object-fit: contain; background: #171520; }
.rough-cut-preview-empty { height: 100%; min-height: 340px; padding: 25px; display: grid; place-items: center; color: rgba(255,255,255,.68); text-align: center; font-size: 10px; }
.rough-cut-subtitle-overlay { position: absolute; right: 7%; bottom: 8%; left: 7%; z-index: 3; display: flex; justify-content: center; pointer-events: none; transform: translate3d(var(--subtitle-position-x,0px),var(--subtitle-position-y,0px),0); will-change: transform; }
.rough-cut-subtitle-box { position: relative; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; transform: rotate(var(--subtitle-rotation,0deg)); transform-origin: 50% 50%; will-change: transform; }
.rough-cut-subtitle-copy { max-width: 100%; padding: 4px 8px; display: inline-block; color: var(--subtitle-color,#fff); font-size: var(--subtitle-render-size,clamp(13px,1.45vw,22px)); font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; text-align: center; text-shadow: -1px -1px 0 var(--subtitle-outline,rgba(20,18,28,.95)),1px -1px 0 var(--subtitle-outline,rgba(20,18,28,.95)),-1px 1px 0 var(--subtitle-outline,rgba(20,18,28,.95)),1px 1px 0 var(--subtitle-outline,rgba(20,18,28,.95)),0 2px 5px rgba(0,0,0,.72); white-space: pre-wrap; pointer-events: none; }
.rough-cut-subtitle-overlay.is-selected .rough-cut-subtitle-copy { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.rough-cut-subtitle-overlay.is-moving .rough-cut-subtitle-copy { cursor: grabbing; }
.rough-cut-subtitle-overlay.is-selected .rough-cut-subtitle-box::after { content: ""; position: absolute; inset: -6px; border: 1px solid rgba(255,255,255,.78); border-radius: 7px; box-shadow: 0 0 0 1px rgba(78,91,153,.76),0 3px 14px rgba(8,7,12,.28); pointer-events: none; }
button.rough-subtitle-canvas-handle { position: absolute; z-index: 2; width: 18px; height: 18px; padding: 0; border: 2px solid #fff; background: #5364a9; border-radius: 50%; box-shadow: 0 2px 8px rgba(8,7,12,.35); pointer-events: auto; touch-action: none; }
.rough-subtitle-canvas-handle:focus-visible { outline: 3px solid rgba(255,98,181,.92); outline-offset: 3px; }
button.rough-subtitle-canvas-resize { cursor: nwse-resize; }
.rough-subtitle-canvas-resize.is-nw { top: -14px; left: -14px; }
.rough-subtitle-canvas-resize.is-ne { top: -14px; right: -14px; cursor: nesw-resize; }
.rough-subtitle-canvas-resize.is-se { right: -14px; bottom: -14px; }
.rough-subtitle-canvas-resize.is-sw { bottom: -14px; left: -14px; cursor: nesw-resize; }
button.rough-subtitle-canvas-rotate { top: -44px; left: 50%; margin-left: -9px; cursor: grab; background: #db3991; }
.rough-subtitle-canvas-rotate::after { content: ""; position: absolute; top: 16px; left: 7px; width: 2px; height: 21px; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(8,7,12,.28); pointer-events: none; }
.rough-cut-subtitle-overlay.is-transforming .rough-cut-subtitle-box::after { border-color: #ffb7df; box-shadow: 0 0 0 2px rgba(219,57,145,.72),0 4px 18px rgba(8,7,12,.34); }
.rough-cut-subtitle-overlay.is-transforming .rough-subtitle-canvas-rotate { cursor: grabbing; }
.rough-cut-time { margin-top: 10px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.rough-cut-editor-panel { position: static; }
.rough-cut-clip-title { margin: 0 0 14px; font-size: 18px; }
.rough-cut-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rough-cut-field { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.rough-cut-field input[type="number"] { min-height: 43px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; font: inherit; font-size: 11px; }
.rough-cut-field input[type="range"] { width: 100%; accent-color: var(--deep-blue); }
.rough-cut-toggle { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 9px; color: var(--ink); background: var(--paper); border-radius: 11px; font-size: 10px; }
.rough-cut-toggle input { width: 18px; height: 18px; accent-color: var(--deep-blue); }
.rough-cut-edit-actions { margin-top: 13px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.rough-cut-edit-actions button { min-height: 42px; }
.rough-cut-track-panel { grid-column: 1/-1; }
.rough-cut-clip-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.rough-cut-clip { position: relative; width: 184px; min-width: 184px; padding: 10px; overflow: hidden; cursor: pointer; text-align: left; background: linear-gradient(155deg,#fff,rgba(238,240,250,.52)); border: 1px solid var(--line); border-radius: 15px; scroll-snap-align: start; transition: border-color .18s,transform .18s,box-shadow .18s,background .18s; }
.rough-cut-clip:hover { transform: translateY(-2px); }
.rough-cut-clip.is-selected { background: linear-gradient(155deg,#fff,rgba(238,218,242,.28)); border-color: var(--deep-blue); box-shadow: 0 0 0 3px rgba(78,91,153,.1),0 9px 22px rgba(78,91,153,.08); }
.rough-cut-clip.is-selected::after { content: ""; position: absolute; right: 12px; bottom: 0; left: 12px; height: 3px; background: linear-gradient(90deg,var(--deep-blue),var(--accent)); border-radius: 3px 3px 0 0; }
.rough-cut-clip-index { width: 28px; height: 28px; margin-bottom: 8px; display: grid; place-items: center; color: #fff; background: var(--deep-blue); border-radius: 8px; font-size: 9px; font-weight: 850; }
.rough-cut-clip strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rough-cut-clip small { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; }
.rough-cut-audio-list { display: flex; flex-direction: column; gap: 9px; }
.rough-cut-audio-card { padding: 12px; display: grid; grid-template-columns: repeat(3,minmax(100px,1fr)); gap: 10px; align-items: end; background: linear-gradient(135deg,rgba(238,240,250,.68),rgba(255,247,252,.8)); border: 1px solid rgba(78,91,153,.14); border-radius: 13px; }
.rough-cut-audio-card strong { grid-column: 1/-1; align-self: center; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.rough-cut-audio-card .rough-cut-field { gap: 4px; }
.rough-cut-audio-card .rough-cut-field input[type="number"] { min-height: 36px; }
.rough-cut-audio-card .rough-cut-edit-actions { grid-column: 1/-1; grid-template-columns: repeat(3,minmax(0,1fr)); }
.rough-cut-audio-empty { padding: 22px; color: var(--muted); background: var(--paper); border-radius: 12px; text-align: center; font-size: 9px; }
.rough-cut-subtitle-list { display: flex; flex-direction: column; gap: 9px; }
.rough-cut-subtitle-card { position: relative; padding: 12px 12px 12px 46px; display: grid; grid-template-columns: minmax(220px,1fr) minmax(120px,.32fr) minmax(120px,.32fr) auto; gap: 10px; align-items: end; background: linear-gradient(135deg,rgba(255,247,252,.9),rgba(238,240,250,.58)); border: 1px solid rgba(219,57,145,.15); border-radius: 13px; }
.rough-cut-subtitle-index { position: absolute; top: 13px; left: 12px; width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 7px; font-size: 8px; font-weight: 850; }
.rough-cut-subtitle-text textarea { min-height: 58px; padding: 9px 11px; resize: vertical; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 10px; line-height: 1.45; }
.rough-cut-subtitle-remove { min-height: 38px; padding: 0 10px; color: var(--accent-dark); }
.rough-cut-footer { position: sticky; bottom: 10px; z-index: 4; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: rgba(255,252,255,.94); border: 1px solid rgba(78,91,153,.18); border-radius: 16px; box-shadow: 0 14px 40px rgba(30,25,45,.14); backdrop-filter: blur(15px); }
.rough-cut-footer-copy { color: var(--muted); font-size: 9px; line-height: 1.5; }
.rough-cut-footer-copy strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.rough-cut-footer-actions { display: flex; gap: 9px; }
.rough-cut-footer-actions button,
.rough-cut-footer-actions a { min-width: 132px; }
.rough-cut-export-preview { width: min(500px,100%); margin: 14px auto 0; }
.rough-timeline-panel { grid-column: 1/-1; padding: 16px; overflow: hidden; background: #201d2a; border: 1px solid rgba(178,182,223,.18); border-radius: 20px; box-shadow: 0 15px 36px rgba(30,25,45,.13); color: #fff; }
.rough-timeline-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.rough-timeline-heading h3 { margin: 0; font-size: 16px; }
.rough-timeline-heading p { margin: 5px 0 0; color: rgba(255,255,255,.56); font-size: 9px; line-height: 1.5; }
.rough-timeline-tools { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.rough-timeline-tools::-webkit-scrollbar { display: none; }
.rough-timeline-tools .secondary-button { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; flex: 0 0 42px; color: rgba(255,255,255,.86); background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.13); border-radius: 10px; font-size: 8px; font-weight: 780; line-height: 1.08; text-align: center; white-space: pre-line; }
.rough-timeline-tools .secondary-button:disabled { color: rgba(255,255,255,.28); background: rgba(255,255,255,.035); }
.rough-timeline-tools .rough-timeline-undo:not(:disabled) { color: #ffd8ee; border-color: rgba(255,98,181,.34); }
.rough-timeline-tools .rough-timeline-play-toggle { position: relative; display: grid; place-items: center; overflow: hidden; color: transparent; background: linear-gradient(145deg,var(--deep-blue),#6876bf); border-color: rgba(178,182,223,.42); }
.rough-timeline-play-toggle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #fff; transform: translate(-42%,-50%); }
.rough-timeline-play-toggle.is-playing::before { width: 8px; height: 11px; border: 0; background: linear-gradient(90deg,#fff 0 3px,transparent 3px 5px,#fff 5px 8px); transform: translate(-50%,-50%); }
.rough-timeline-play-toggle.is-loading::before { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.28); border-top-color: #fff; border-radius: 50%; animation: roughTimelineSpin .7s linear infinite; transform: translate(-50%,-50%); }
.rough-timeline-zoom { min-height: 36px; padding: 0 11px; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.58); background: rgba(255,255,255,.06); border-radius: 10px; font-size: 8px; font-weight: 740; }
.rough-timeline-zoom input { width: 92px; accent-color: var(--soft-pink); }
.rough-timeline-bottom-zoom { width: 100%; margin-top: 8px; display: grid; grid-template-columns: auto minmax(0,1fr); border: 1px solid rgba(255,255,255,.07); }
.rough-timeline-bottom-zoom input { width: 100%; min-width: 0; }
.rough-timeline-inline-zoom { width: 142px; min-width: 142px; min-height: 42px; margin: 0 0 0 2px; padding: 0 10px; flex: 0 0 142px; border: 1px solid rgba(255,255,255,.08); }
.rough-timeline-inline-zoom input { width: 88px; min-width: 0; }
.rough-timeline { position: relative; display: grid; grid-template-columns: 104px minmax(0,1fr); overflow: hidden; background: #171520; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; }
.rough-timeline-labels { position: relative; z-index: 5; color: rgba(255,255,255,.64); background: #1a1722; border-right: 1px solid rgba(255,255,255,.08); box-shadow: 8px 0 18px rgba(8,6,12,.14); }
.rough-timeline-label { padding: 0 11px; display: flex; align-items: center; gap: 7px; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.055); font-size: 8px; font-weight: 720; white-space: nowrap; }
.rough-timeline-label.is-ruler { height: 30px; color: rgba(255,255,255,.38); }
.rough-timeline-label.is-video { height: 72px; color: #fff; }
.rough-timeline-label.is-subtitle { height: 44px; color: #f5c1df; }
.rough-timeline-label.is-source-audio { height: 30px; }
.rough-timeline-label.is-audio { height: 44px; }
.rough-timeline-label.is-audio span { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; color: #fff; background: rgba(219,57,145,.62); border-radius: 6px; font-size: 7px; }
.rough-timeline-label.is-audio strong { overflow: hidden; text-overflow: ellipsis; }
.rough-timeline-scroll { min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; transition: box-shadow .12s ease; }
.rough-timeline-scroll::-webkit-scrollbar { display: none; }
.rough-timeline-scroll.is-auto-scrolling-left { box-shadow: inset 22px 0 22px -20px rgba(246,180,220,.95); }
.rough-timeline-scroll.is-auto-scrolling-right { box-shadow: inset -22px 0 22px -20px rgba(246,180,220,.95); }
.rough-timeline-canvas { position: relative; min-width: 100%; contain: layout paint style; background: linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px); background-size: 48px 100%; }
.rough-timeline-ruler { position: relative; height: 30px; overflow: hidden; cursor: ew-resize; border-bottom: 1px solid rgba(255,255,255,.07); touch-action: none; }
.rough-timeline-tick { position: absolute; top: 0; height: 100%; padding: 8px 0 0 6px; color: rgba(255,255,255,.38); border-left: 1px solid rgba(255,255,255,.15); font-size: 7px; font-variant-numeric: tabular-nums; }
.rough-timeline-row { position: relative; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.055); }
.rough-timeline-video-track { height: 72px; background: rgba(98,112,190,.07); }
.rough-timeline-source-audio { height: 30px; }
.rough-timeline-subtitle-track { height: 44px; background: rgba(219,57,145,.035); }
.rough-timeline-subtitle-empty { padding-left: 14px; display: flex; align-items: center; height: 100%; color: rgba(255,255,255,.3); font-size: 8px; }
.rough-timeline-subtitle-block { position: absolute; top: 6px; bottom: 6px; min-width: 28px; display: flex; align-items: center; overflow: visible; color: #fff; background: linear-gradient(135deg,#d94797,#a83279); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; box-shadow: 0 4px 12px rgba(7,5,10,.18); cursor: grab; transform: translate3d(0,0,0); touch-action: pan-y; }
.rough-timeline-subtitle-block > span { min-width: 0; padding: 0 10px; overflow: hidden; color: var(--subtitle-color,#fff); font-size: 8px; text-shadow: 0 1px 2px var(--subtitle-outline,rgba(20,18,28,.95)); text-overflow: ellipsis; white-space: nowrap; }
.rough-timeline-subtitle-block.is-interacting { z-index: 8; opacity: .9; will-change: transform,width; }
.rough-timeline-subtitle-block.is-snapped { border-color: rgba(255,255,255,.92); box-shadow: 0 0 0 2px rgba(255,98,181,.42),0 4px 12px rgba(7,5,10,.18); }
button.rough-timeline-subtitle-trim { position: absolute; top: 3px; bottom: 3px; z-index: 2; width: 8px; padding: 0; background: rgba(255,255,255,.78); border: 0; border-radius: 4px; cursor: ew-resize; opacity: .25; touch-action: none; }
.rough-timeline-subtitle-block:hover .rough-timeline-subtitle-trim,
.rough-timeline-subtitle-trim:focus-visible { opacity: .9; }
.rough-timeline-subtitle-trim.is-start { left: -3px; }
.rough-timeline-subtitle-trim.is-end { right: -3px; }
.rough-timeline-audio-track { height: 44px; background: rgba(219,57,145,.025); }
.rough-timeline-audio-track.is-empty { padding-left: 15px; display: flex; align-items: center; color: rgba(255,255,255,.32); font-size: 8px; }
.rough-timeline-clip { position: absolute; top: 5px; bottom: 5px; min-width: 24px; display: flex; overflow: visible; background: linear-gradient(135deg,#5968b7,#394783); border: 1px solid rgba(255,255,255,.17); border-radius: 8px; box-shadow: inset 0 1px rgba(255,255,255,.08); transform: translate3d(0,0,0); transition: box-shadow .14s,border-color .14s,opacity .14s; }
.rough-timeline-clip.is-selected { z-index: 3; border-color: #f6b4dc; box-shadow: 0 0 0 2px rgba(219,57,145,.45),0 6px 15px rgba(5,4,9,.25); }
.rough-timeline-clip.is-drop-target { border-color: #ffd3eb; box-shadow: 0 0 0 3px rgba(255,98,181,.48),0 8px 18px rgba(5,4,9,.3); }
.rough-timeline-clip.is-drop-before::before,
.rough-timeline-clip.is-drop-after::after { content: ''; position: absolute; top: -5px; bottom: -5px; z-index: 9; width: 3px; background: #ff62b5; border-radius: 999px; box-shadow: 0 0 0 2px rgba(255,98,181,.18),0 0 10px rgba(255,98,181,.7); }
.rough-timeline-clip.is-drop-before::before { left: -5px; }
.rough-timeline-clip.is-drop-after::after { right: -5px; }
.rough-timeline-clip.is-interacting,
.rough-timeline-audio-block.is-interacting { z-index: 8; opacity: .9; will-change: transform,width; transition: none; }
.rough-timeline-clip-body { min-width: 0; padding: 7px 8px; display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-rows: 1fr auto; gap: 1px 6px; flex: 1; overflow: hidden; color: #fff; background: transparent; border: 0; cursor: grab; text-align: left; touch-action: pan-y; }
.rough-timeline-clip-body:active { cursor: grabbing; }
.rough-timeline-clip-number { width: 22px; height: 22px; grid-row: 1/-1; align-self: center; display: grid; place-items: center; color: #27315f; background: rgba(255,255,255,.9); border-radius: 6px; font-size: 7px; font-weight: 850; }
.rough-timeline-clip-body strong { min-width: 0; align-self: end; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.rough-timeline-clip-body small { align-self: start; color: rgba(255,255,255,.62); font-size: 7px; }
.rough-timeline-trim { position: absolute; top: 3px; bottom: 3px; z-index: 4; width: 9px; padding: 0; background: rgba(255,255,255,.72); border: 0; border-radius: 4px; cursor: ew-resize; opacity: 0; touch-action: none; transition: opacity .14s; }
.rough-timeline-clip:hover .rough-timeline-trim,
.rough-timeline-clip.is-selected .rough-timeline-trim,
.rough-timeline-trim:focus-visible { opacity: .9; }
.rough-timeline-trim.is-start { left: -3px; }
.rough-timeline-trim.is-end { right: -3px; }
.rough-timeline-source-block { position: absolute; top: 5px; bottom: 5px; min-width: 24px; padding: 0 7px; display: flex; align-items: center; overflow: hidden; color: rgba(255,255,255,.55); background: repeating-linear-gradient(90deg,rgba(93,205,168,.26) 0 2px,rgba(93,205,168,.08) 2px 5px); border-radius: 4px; font-size: 7px; white-space: nowrap; }
.rough-timeline-source-block.is-muted { color: rgba(255,255,255,.3); background: rgba(255,255,255,.055); }
.rough-timeline-audio-block { position: absolute; top: 5px; bottom: 5px; min-width: 46px; padding: 0 10px; display: flex; align-items: center; gap: 7px; overflow: hidden; color: #fff; background: linear-gradient(135deg,#bd367e,#7b2e68); border: 1px solid rgba(255,255,255,.14); border-radius: 7px; cursor: grab; text-align: left; transform: translate3d(0,0,0); touch-action: pan-y; }
.rough-timeline-audio-block strong { min-width: 0; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.rough-timeline-audio-block small { color: rgba(255,255,255,.56); font-size: 7px; }
.rough-timeline-audio-block.is-muted { opacity: .45; filter: saturate(.35); }
.rough-timeline-playhead { position: absolute; top: 0; bottom: 0; z-index: 10; width: 13px; margin-left: -6px; pointer-events: auto; cursor: ew-resize; background: transparent; transform: translate3d(0,0,0); touch-action: none; user-select: none; }
.rough-timeline-playhead::before { content: ""; position: absolute; top: 0; left: 2px; width: 9px; height: 9px; background: #ff62b5; border-radius: 2px 2px 6px 6px; }
.rough-timeline-playhead::after { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 1px; background: #ff62b5; box-shadow: 0 0 7px rgba(255,98,181,.58); }
.rough-timeline-playhead:focus-visible { outline: 2px solid rgba(255,255,255,.92); outline-offset: 2px; }
.rough-timeline-canvas.is-scrubbing .rough-timeline-playhead::after { width: 2px; box-shadow: 0 0 10px rgba(255,98,181,.8); }
.rough-timeline-playhead-time { position: absolute; top: 8px; left: 12px; padding: 2px 5px; color: #fff; background: rgba(219,57,145,.88); border-radius: 5px; font-size: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rough-timeline-settings-trigger { position: relative; z-index: 1; width: 40px; min-width: 40px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,var(--soft-pink),var(--accent-dark)); border: 1px solid rgba(255,255,255,.42); border-radius: 10px; box-shadow: 0 7px 18px rgba(201,59,138,.26),0 0 0 2px rgba(225,106,217,.1); cursor: pointer; touch-action: manipulation; }
.rough-timeline-settings-trigger::before { content: ''; width: 16px; height: 16px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 7h5m4 0h7M4 17h9m4 0h3'/%3E%3Ccircle cx='11' cy='7' r='2'/%3E%3Ccircle cx='15' cy='17' r='2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 7h5m4 0h7M4 17h9m4 0h3'/%3E%3Ccircle cx='11' cy='7' r='2'/%3E%3Ccircle cx='15' cy='17' r='2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.rough-timeline-delete-trigger { width: 40px; min-width: 40px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; color: #ff77bb; background: rgba(201,59,138,.1); border-color: rgba(225,106,217,.28); }
.rough-timeline-delete-trigger:disabled { color: rgba(225,106,217,.28); background: rgba(201,59,138,.035); border-color: rgba(225,106,217,.1); }
.rough-timeline-delete-trigger::before { content: ''; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3m3 0-1 13H7L6 7m4 4v5m4-5v5'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.rough-timeline-kicker { color: rgba(255,255,255,.52); font-size: 8px; font-weight: 760; letter-spacing: .08em; white-space: nowrap; }
.rough-timeline-browser { position: absolute; right: 0; bottom: 0; left: 104px; z-index: 11; height: 20px; overflow: hidden; pointer-events: none; }
.rough-timeline-browser-control { min-width: 0; height: 100%; padding: 0 7px; }
.rough-timeline-browser-rail { position: relative; min-width: 0; height: 20px; cursor: pointer; outline: none; pointer-events: auto; touch-action: none; user-select: none; }
.rough-timeline-browser-rail::before { content: ''; position: absolute; right: 0; bottom: 5px; left: 0; height: 3px; background: rgba(255,255,255,.075); border-radius: 999px; box-shadow: inset 0 1px 1px rgba(0,0,0,.28); }
.rough-timeline-browser-thumb { position: absolute; bottom: 3px; left: 0; width: 48px; height: 7px; overflow: hidden; background: #7f8dd6; border: 0; border-radius: 999px; box-shadow: 0 1px 4px rgba(4,3,9,.42),inset 0 1px rgba(255,255,255,.2); cursor: grab; transform: translate3d(0,0,0); will-change: transform,width; transition: height .12s,bottom .12s,background .12s,box-shadow .12s; }
.rough-timeline-browser-thumb::before,
.rough-timeline-browser-thumb span { display: none; }
.rough-timeline-browser-rail:hover .rough-timeline-browser-thumb,
.rough-timeline-browser-rail:focus-visible .rough-timeline-browser-thumb { bottom: 2px; height: 9px; background: #94a1e7; box-shadow: 0 2px 6px rgba(4,3,9,.45),0 0 0 1px rgba(205,211,255,.2); }
.rough-timeline-browser-rail:focus-visible::before { background: rgba(127,141,214,.2); }
.rough-timeline-browser-rail.is-dragging .rough-timeline-browser-thumb { bottom: 2px; height: 9px; cursor: grabbing; background: #a2ace9; box-shadow: 0 2px 7px rgba(4,3,9,.48),0 0 0 2px rgba(127,141,214,.16); }
.rough-timeline-browser:not(.has-overflow) .rough-timeline-browser-thumb { opacity: .45; cursor: default; }

/* Unified rough-cut workspace: one program monitor, one contextual inspector, one timeline. */
.rough-cut-workspace { gap: 14px; }
.rough-cut-shell.rough-cut-unified {
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
}
.rough-cut-mobile-editor-scroll { display: contents; }
.rough-cut-editing-surface { grid-column: 1/-1; min-width: 0; overflow: hidden; background: linear-gradient(165deg,#24202d 0%,#17151f 58%,#1d1928 100%); border: 1px solid rgba(178,182,223,.17); border-radius: 20px; box-shadow: 0 15px 36px rgba(30,25,45,.13); }
.rough-cut-mobile-editor-scroll > .rough-cut-footer { grid-column: 1/-1; }
.rough-cut-unified .rough-cut-preview-panel,
.rough-cut-unified .rough-cut-editor-panel {
    min-width: 0;
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(54,48,79,.055);
}
.rough-cut-program-panel {
    background: linear-gradient(160deg,#26222f,#17151f);
    border-color: rgba(255,255,255,.08);
    color: #fff;
}
.rough-cut-program-panel .rough-cut-panel-heading p { color: rgba(255,255,255,.56); }
.rough-cut-program-panel .rough-cut-panel-heading .rough-cut-preview-eyebrow { margin: 0 0 5px; color: #ef5ba7; font-size: 8px; font-weight: 840; letter-spacing: .12em; line-height: 1.1; }
.rough-cut-editing-surface > .rough-cut-program-panel { width: min(760px,100%); margin: 0 auto; padding: 16px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.rough-cut-editing-surface > .rough-timeline-panel { width: 100%; margin: 0; padding: 16px; background: transparent; border: 0; border-top: 1px solid rgba(255,255,255,.075); border-radius: 0; box-shadow: none; }
.rough-monitor-clip {
    max-width: 42%;
    padding: 6px 9px;
    overflow: hidden;
    color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rough-cut-unified .rough-cut-preview {
    width: 100%;
    height: clamp(350px,52vh,620px);
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    background: #09080d;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
}
.rough-cut-program-panel .rough-cut-preview .rough-monitor-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: none;
}
.rough-cut-program-panel .rough-cut-preview .rough-monitor-video::-webkit-media-controls,
.rough-cut-program-panel .rough-cut-preview .rough-monitor-video::-webkit-media-controls-enclosure,
.rough-cut-program-panel .rough-cut-preview .rough-monitor-video::-webkit-media-controls-panel {
    display: none !important;
    opacity: 0 !important;
}
.rough-cut-program-panel .rough-cut-preview .rough-monitor-video.is-active {
    z-index: 1;
    opacity: 1;
}
.rough-monitor-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: none;
    background: #09080d;
    pointer-events: none;
}
.rough-monitor-controls {
    min-height: 48px;
    margin-top: 10px;
    padding: 6px 7px;
    display: grid;
    grid-template-columns: auto minmax(110px,1fr) auto;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 11px;
}
.rough-monitor-play {
    min-width: 62px;
    min-height: 36px;
    padding: 0 11px;
    color: #fff;
    background: rgba(255,255,255,.085);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 9px;
    font: inherit;
    font-size: 9px;
    font-weight: 760;
    cursor: pointer;
}
.rough-monitor-play { color: #fff; background: linear-gradient(135deg,var(--deep-blue),#6473c5); }
.rough-monitor-progress {
    width: 100%;
    min-width: 0;
    accent-color: var(--soft-pink);
    cursor: pointer;
}
.rough-monitor-time {
    min-width: 92px;
    color: rgba(255,255,255,.68);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}
.rough-cut-inspector {
    align-self: start;
    overflow: visible;
}
.rough-inspector-context {
    min-height: 38px;
    margin: 0 0 11px;
    padding: 6px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg,rgba(78,91,153,.075),rgba(219,57,145,.055));
    border: 1px solid rgba(78,91,153,.12);
    border-radius: 10px;
}
.rough-inspector-context span {
    padding: 4px 7px;
    color: var(--deep-blue);
    background: #fff;
    border: 1px solid rgba(78,91,153,.13);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 820;
    white-space: nowrap;
}
.rough-inspector-context strong {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rough-cut-inspector-tabs {
    margin: 0 0 14px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 3px;
    background: var(--paper-deep);
    border-radius: 12px;
}
.rough-cut-inspector-tabs button {
    min-height: 39px;
    padding: 0 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 9px;
    font-weight: 780;
    cursor: pointer;
}
.rough-cut-inspector-tabs button.is-active {
    color: var(--deep-blue);
    background: #fff;
    box-shadow: 0 5px 14px rgba(64,57,92,.1);
}
.rough-cut-inspector-body { min-width: 0; }
.rough-cut-inspector-dialog { width: min(680px,calc(100vw - 40px)); max-height: min(86vh,820px); margin: auto; padding: 0; overflow: hidden; color: var(--ink); background: #fffaff; border: 1px solid rgba(78,91,153,.18); border-radius: 20px; box-shadow: 0 26px 80px rgba(30,25,45,.3); }
.rough-cut-inspector-dialog::backdrop { background: rgba(22,18,34,.48); backdrop-filter: blur(7px); }
.rough-cut-inspector-dialog[open] { display: flex; flex-direction: column; }
.rough-cut-inspector-dialog-heading { min-height: 62px; padding: 11px 14px 10px 18px; display: grid; grid-template-columns: minmax(0,1fr) 44px; grid-template-rows: auto auto; align-items: center; flex: 0 0 auto; border-bottom: 1px solid rgba(78,91,153,.12); }
.rough-cut-inspector-dialog-heading > div { font-size: 16px; font-weight: 820; }
.rough-cut-inspector-dialog-heading > span { grid-column: 1; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rough-cut-inspector-close { position: relative; grid-column: 2; grid-row: 1/-1; width: 40px; height: 40px; color: var(--ink); background: rgba(178,182,223,.14); border: 0; border-radius: 12px; }
.rough-cut-inspector-close::before,
.rough-cut-inspector-close::after { content: ''; position: absolute; top: 19px; left: 12px; width: 16px; height: 2px; background: currentColor; border-radius: 999px; transform: rotate(45deg); }
.rough-cut-inspector-close::after { transform: rotate(-45deg); }
.rough-cut-inspector-dialog .rough-cut-inspector { width: 100%; max-width: none; max-height: calc(min(86vh,820px) - 62px); padding: 16px; overflow-x: hidden; overflow-y: auto; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.rough-cut-inspector-dialog .rough-cut-inspector > .rough-cut-panel-heading,
.rough-cut-inspector-dialog .rough-inspector-context { display: none; }
.rough-inspector-identity {
    margin-bottom: 10px;
    padding: 8px;
    display: grid;
    grid-template-columns: 28px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg,rgba(178,182,223,.15),rgba(238,218,242,.2));
    border: 1px solid rgba(78,91,153,.12);
    border-radius: 12px;
}
.rough-inspector-identity > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--deep-blue);
    border-radius: 8px;
    font-size: 8px;
    font-weight: 850;
}
.rough-inspector-identity > div {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    font-weight: 790;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rough-inspector-identity small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.rough-inspector-toolbar {
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.rough-inspector-toolbar > div { color: var(--muted); font-size: 9px; }
.rough-inspector-toolbar .secondary-button { min-height: 38px; }
.rough-inspector-select {
    width: 100%;
    min-height: 43px;
    margin-bottom: 11px;
    padding: 0 35px 0 12px;
    overflow: hidden;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
}
.rough-inspector-card {
    padding: 12px;
    background: linear-gradient(145deg,rgba(255,247,252,.78),rgba(238,240,250,.52));
    border: 1px solid rgba(78,91,153,.12);
    border-radius: 13px;
}
.rough-subtitle-style-controls {
    margin: 11px 0;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
    align-items: end;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(78,91,153,.11);
    border-radius: 12px;
}
.rough-subtitle-font-select {
    width: 100%;
    min-height: 38px;
    padding: 0 31px 0 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 9px;
    font-weight: 720;
}
.rough-subtitle-font-select:focus-visible,
.rough-subtitle-custom-color:focus-within {
    outline: 2px solid rgba(78,91,153,.5);
    outline-offset: 2px;
}
.rough-subtitle-color-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.rough-subtitle-color-field legend {
    margin-bottom: 7px;
    padding: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}
.rough-subtitle-color-row {
    min-height: 38px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.rough-subtitle-swatches {
    display: flex;
    align-items: center;
    gap: 4px;
}
.rough-subtitle-swatch {
    position: relative;
    width: 26px;
    height: 26px;
    padding: 0;
    flex: 0 0 26px;
    background: var(--swatch-color);
    border: 2px solid rgba(255,255,255,.96);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(30,25,45,.16);
    cursor: pointer;
}
.rough-subtitle-swatch::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid transparent;
    border-radius: 50%;
    pointer-events: none;
}
.rough-subtitle-swatch.is-selected::after {
    border-color: var(--deep-blue);
}
.rough-subtitle-swatch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.rough-subtitle-custom-color {
    min-width: 76px;
    height: 34px;
    padding: 3px 7px 3px 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
}
.rough-subtitle-custom-color input[type="color"] {
    width: 26px;
    height: 26px;
    padding: 0;
    flex: 0 0 26px;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}
.rough-subtitle-custom-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rough-subtitle-custom-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.rough-subtitle-color-value {
    font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
    font-size: 7px;
    font-weight: 720;
}
.rough-subtitle-transform-controls {
    margin: 0 0 11px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(78,91,153,.11);
    border-radius: 12px;
}
.rough-subtitle-transform-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.rough-subtitle-transform-value {
    color: var(--deep-blue);
    font-size: 8px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.rough-subtitle-transform-field input[type="range"] {
    min-height: 26px;
    cursor: ew-resize;
}
.rough-inspector-card > .secondary-button { width: 100%; min-height: 40px; margin-top: 11px; }
.rough-inspector-audio-card > strong { display: block; margin-bottom: 11px; font-size: 11px; }
.rough-cut-unified .rough-cut-field-grid { gap: 8px; }
.rough-cut-unified .rough-cut-field { min-width: 0; }
.rough-cut-unified .rough-cut-field input[type="number"] { width: 100%; min-width: 0; min-height: 36px; }
.rough-cut-unified .rough-cut-subtitle-text textarea { min-height: 96px; resize: vertical; }
.rough-cut-unified .rough-cut-edit-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.rough-cut-unified .rough-cut-edit-actions .primary-button { grid-column: 1/-1; }
.rough-cut-unified .rough-cut-clip-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.rough-cut-unified .rough-cut-clip-actions button { min-height: 36px; padding: 0 8px; font-size: 8px; }
.rough-cut-unified .rough-timeline-panel { grid-column: 1/-1; }
.rough-timeline-subtitle-block.is-selected,
.rough-timeline-audio-block.is-selected {
    z-index: 4;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,.28),0 7px 16px rgba(5,4,9,.28);
}
.rough-timeline-clip.is-selected,
.rough-timeline-subtitle-block.is-selected,
.rough-timeline-audio-block.is-selected {
    z-index: 6;
    border-color: rgba(255,255,255,.98);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.96),
        0 0 0 4px rgba(178,182,223,.82),
        0 0 20px rgba(78,91,153,.72),
        0 7px 16px rgba(5,4,9,.28);
    filter: brightness(1.1);
}
.rough-cut-footer {
    position: sticky;
    bottom: 10px;
    z-index: 12;
    padding: 9px 11px;
    background: rgba(255,252,255,.92);
    border-color: rgba(78,91,153,.16);
    box-shadow: 0 12px 30px rgba(37,31,57,.13);
    backdrop-filter: blur(18px);
}
.rough-cut-footer-copy {
    display: grid;
    grid-template-columns: 8px auto;
    align-items: center;
    column-gap: 7px;
}
.rough-cut-footer-copy > span:last-child { grid-column: 2; }
.rough-cut-footer-copy strong { margin: 0; font-size: 9px; }
.rough-cut-status-dot {
    width: 7px;
    height: 7px;
    display: block;
    background: #54ae88;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(84,174,136,.11);
}
.rough-cut-status-dot.is-dirty { background: var(--accent); box-shadow: 0 0 0 3px rgba(219,57,145,.11); }
.rough-cut-status-dot.is-saving { animation: roughCutSavingPulse 1.05s ease-in-out infinite; }
@keyframes roughCutSavingPulse { 50% { opacity: .38; transform: scale(.82); } }
.rough-cut-footer-actions { align-items: center; gap: 7px; }
.rough-cut-footer-actions button,
.rough-cut-footer-actions a {
    min-width: 0;
    min-height: 38px;
    padding: 0 14px;
    font-size: 9px;
}
.rough-cut-footer-actions .rough-cut-save-button { min-width: 76px; }
.rough-cut-footer-actions .rough-cut-export-button { min-width: 126px; }
.rough-cut-footer-actions .rough-cut-download-button { min-width: 126px; display: inline-flex; align-items: center; justify-content: center; }
.rough-cut-export-preview {
    width: 100%;
    margin: 0;
    overflow: hidden;
    background: rgba(255,252,255,.82);
    border: 1px solid rgba(78,91,153,.14);
    border-radius: 14px;
}
.rough-cut-export-preview > summary {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: var(--deep-blue);
    font-size: 10px;
    font-weight: 780;
    cursor: pointer;
    list-style: none;
}
.rough-cut-export-preview > summary::-webkit-details-marker { display: none; }
.rough-cut-export-preview > summary::after { content: "展开"; margin-left: auto; color: var(--muted); font-size: 8px; }
.rough-cut-export-preview[open] > summary::after { content: "收起"; }
.rough-cut-export-preview-body { padding: 0 14px 14px; }
.rough-cut-export-preview-body .final-video-preview { width: min(520px,100%); height: min(60vh,560px); margin: 0 auto; }

.delivery-workspace { width: min(1120px,100%); margin: 0 auto; }
.delivery-heading {
    padding: 6px 0 20px;
    align-items: flex-start;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(78,91,153,.12);
    border-radius: 0;
}
.delivery-stage { min-height: 620px; display: grid; place-items: center; }
.delivery-stage.is-static { min-height: 0; padding-top: 18px; place-items: start stretch; }
.delivery-stage.is-ready { min-height: 0; display: block; padding-top: 26px; }
.delivery-processing,
.delivery-ready,
.delivery-empty {
    width: min(820px,100%);
    padding: clamp(24px,4vw,48px);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg,rgba(255,252,255,.98),rgba(242,239,250,.92));
    border: 1px solid rgba(78,91,153,.15);
    border-radius: 30px;
    box-shadow: 0 26px 80px rgba(37,31,57,.14);
}
.delivery-processing { text-align: center; }
.delivery-processing::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    top: -250px;
    right: -170px;
    background: radial-gradient(circle,rgba(219,57,145,.2),transparent 68%);
    pointer-events: none;
}
.delivery-processing-visual {
    width: min(460px,78vw);
    aspect-ratio: var(--delivery-aspect,16/9);
    margin: 0 auto 34px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 25px;
    isolation: isolate;
}
.delivery-processing-screen {
    position: absolute;
    inset: 4px;
    z-index: 2;
    overflow: hidden;
    background:
        linear-gradient(120deg,transparent 0 38%,rgba(255,255,255,.09) 48%,transparent 58%),
        radial-gradient(circle at 50% 44%,rgba(178,182,223,.2),transparent 37%),
        #181520;
    background-size: 230% 100%,100% 100%,100% 100%;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 22px;
    box-shadow: inset 0 0 40px rgba(0,0,0,.36),0 18px 50px rgba(30,25,45,.22),0 0 24px rgba(121,209,255,.13);
    animation: deliveryScreenSweep 3.6s ease-in-out infinite;
}
.delivery-processing-screen::after {
    content: "PAIBAN";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.16);
    font-size: clamp(25px,5vw,52px);
    font-weight: 900;
    letter-spacing: .28em;
    text-indent: .28em;
}
.delivery-trace {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.delivery-trace rect {
    x: 4px;
    y: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    rx: 21px;
    ry: 21px;
    fill: none;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}
.delivery-trace-rail {
    stroke: rgba(178,182,223,.24);
    stroke-width: 1;
}
.delivery-trace-glow,
.delivery-trace-core {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 135 865;
    animation: deliveryTraceRun 3.6s linear infinite;
    animation-delay: var(--delivery-trace-delay,0ms);
    will-change: stroke-dashoffset;
}
.delivery-trace-glow {
    stroke: rgba(225,106,217,.68);
    stroke-width: 6;
    opacity: .34;
}
.delivery-trace-core {
    stroke: url("#delivery-trace-gradient");
    stroke-width: 1.8;
    filter: drop-shadow(0 0 4px rgba(255,86,181,.88));
}
.delivery-agent { display: flex; align-items: center; justify-content: center; gap: 13px; text-align: left; }
.delivery-agent-mark {
    width: 50px;
    height: 50px;
    padding: 3px;
    position: relative;
    display: block;
    flex: 0 0 50px;
    background: linear-gradient(145deg,rgba(125,228,255,.6),rgba(225,106,217,.82));
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 17px;
    box-shadow: 0 12px 30px rgba(78,91,153,.2),0 0 18px rgba(225,106,217,.16);
}
.delivery-agent-mark img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 13px;
}
.delivery-agent-mark::after {
    content: "";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    background: #58c99b;
    border: 2px solid #fbf8fc;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(88,201,155,.12);
}
.delivery-agent strong { display: block; color: var(--ink); font-size: 13px; }
.delivery-agent p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.delivery-progress { margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; list-style: none; }
.delivery-progress li { min-width: 0; color: rgba(78,91,153,.45); font-size: 8px; font-weight: 760; }
.delivery-progress li span {
    width: 25px;
    height: 25px;
    margin: 0 auto 7px;
    display: grid;
    place-items: center;
    background: rgba(178,182,223,.16);
    border: 1px solid rgba(78,91,153,.11);
    border-radius: 50%;
}
.delivery-progress li strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-progress li.is-active { color: var(--deep-blue); }
.delivery-progress li.is-active span { color: #fff; background: var(--accent); box-shadow: 0 0 0 6px rgba(219,57,145,.1),0 0 22px rgba(219,57,145,.4); animation: deliveryPulse 1.2s ease-in-out infinite; }
.delivery-progress li.is-complete { color: #3f8a70; }
.delivery-progress li.is-complete span { color: #fff; background: #54ae88; }
.delivery-wait-note { margin: 25px 0 0; color: var(--muted); font-size: 9px; }
.delivery-ready-heading { margin-bottom: 24px; display: flex; align-items: center; gap: 14px; }
.delivery-ready-mark,
.delivery-empty-mark { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; color: #fff; background: linear-gradient(145deg,#54ae88,#3a9878); border-radius: 16px; font-size: 20px; font-weight: 900; box-shadow: 0 12px 28px rgba(84,174,136,.22); }
.delivery-ready {
    width: 100%;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.delivery-ready-heading { width: min(680px,100%); margin: 0 auto 22px; }
.delivery-ready-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    background: #50aa85;
    border-radius: 50%;
    font-size: 14px;
    box-shadow: none;
}
.delivery-ready-heading .eyebrow { margin: 0 0 3px; color: #3f8a70; font-size: 8px; letter-spacing: .12em; }
.delivery-ready-heading h3 { margin: 2px 0 5px; font-size: clamp(22px,3vw,34px); }
.delivery-ready-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.delivery-media-frame.is-portrait { width: min(320px,68vw); }
.delivery-media-frame.is-square { width: min(410px,74vw); }
.delivery-ready .final-video-preview {
    width: min(460px,78vw);
    height: auto;
    min-height: 0;
    aspect-ratio: var(--delivery-aspect,16/9);
    margin: 0 auto;
    animation: deliveryReadyReveal .42s cubic-bezier(.2,.75,.25,1) both;
}
.delivery-ready .final-video-preview.is-portrait { width: min(320px,68vw); }
.delivery-ready .final-video-preview.is-square { width: min(410px,74vw); }
.delivery-ready .shot-video-play-button {
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    justify-content: center;
    background: rgba(25,21,34,.62);
    border-radius: 50%;
}
.delivery-ready .shot-video-play-icon { width: 40px; height: 40px; flex: 0 0 40px; }
.delivery-ready .shot-video-play-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.delivery-ready-actions { width: min(460px,78vw); margin: 16px auto 0; display: flex; justify-content: center; }
.delivery-ready-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.delivery-ready-actions .primary-button { min-height: 44px; padding: 0 26px; border-radius: 12px; box-shadow: 0 9px 24px rgba(78,91,153,.16); }
.delivery-empty {
    width: 100%;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    background: rgba(255,252,255,.82);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(37,31,57,.08);
}
.delivery-empty-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.delivery-empty.is-failed .delivery-empty-mark { color: var(--danger); background: rgba(219,57,145,.09); border: 1px solid rgba(219,57,145,.18); box-shadow: none; }
.delivery-empty-copy { min-width: 0; }
.delivery-empty h3 { margin: 0 0 5px; font-size: 18px; }
.delivery-empty p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
@keyframes deliveryTraceRun {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -1000; }
}
@keyframes deliveryReadyReveal {
    from { opacity: .5; transform: translateY(4px) scale(.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes deliveryPulse { 50% { transform: scale(.88); box-shadow: 0 0 0 3px rgba(219,57,145,.08),0 0 12px rgba(219,57,145,.26); } }
@keyframes deliveryScreenSweep { 50% { background-position: -110% 0,0 0,0 0; } }
@media (prefers-reduced-motion: reduce) {
    .delivery-trace-glow,
    .delivery-trace-core,
    .delivery-processing-screen,
    .delivery-ready .final-video-preview,
    .delivery-progress li.is-active span { animation: none; }
}
@media (max-width: 700px) {
    .delivery-heading {
        padding: 2px 0 14px;
        align-items: flex-start;
        flex-direction: row;
        gap: 12px;
    }
    .delivery-heading > div { min-width: 0; }
    .delivery-heading h2 { font-size: 24px; }
    .delivery-heading p:last-child { margin-top: 6px; font-size: 10px; }
    .delivery-stage { min-height: 520px; }
    .delivery-stage.is-static { min-height: 0; padding-top: 12px; }
    .delivery-stage.is-ready { min-height: 0; padding-top: 18px; }
    .delivery-processing,
    .delivery-ready,
    .delivery-empty { padding: 16px; gap: 12px; border-radius: 16px; }
    .delivery-ready { padding: 0; border-radius: 0; }
    .delivery-ready-heading { margin-bottom: 16px; align-items: flex-start; gap: 10px; }
    .delivery-ready-heading h3 { font-size: 22px; }
    .delivery-ready-heading p:not(.eyebrow) { font-size: 10px; line-height: 1.55; }
    .delivery-ready-mark { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
    .delivery-ready .final-video-preview.is-portrait { width: min(360px,88vw); }
    .delivery-ready-actions { width: min(360px,88vw); margin-top: 12px; }
    .delivery-empty .delivery-empty-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
    .delivery-processing-visual { width: 100%; margin-bottom: 26px; }
    .delivery-progress { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; padding-top: 8px; overflow: visible; }
    .delivery-progress li strong { font-size: 7px; }
    .delivery-agent { align-items: flex-start; justify-content: flex-start; }
    .delivery-ready-actions { display: grid; grid-template-columns: 1fr; }
    .delivery-ready-actions button,
    .delivery-ready-actions a { width: 100%; }
}

.setting-editor-dialog { width: min(560px,calc(100vw - 32px)); }
.shot-reference-dialog { width: min(760px,calc(100vw - 32px)); }
.shot-reference-shell { min-height: min(650px,calc(100vh - 34px)); }
.shot-reference-body { min-height: 0; padding: 18px 27px 22px; flex: 1; overflow: auto; overscroll-behavior: contain; }
.shot-reference-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.shot-reference-option { position: relative; min-width: 0; padding: 11px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto auto; align-items: center; gap: 9px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 12px; }
.shot-reference-option-main { display: contents; cursor: pointer; }
.shot-reference-option:has(input:checked) { background: rgba(178,182,223,.16); border-color: rgba(78,91,153,.32); }
.shot-reference-option input { width: 18px; height: 18px; margin: 0; grid-column: 4; accent-color: var(--deep-blue); cursor: pointer; }
.shot-reference-option.is-pending { background: rgba(255,255,255,.55); border-style: dashed; cursor: default; }
.shot-reference-edit { min-height: 32px; padding: 0 10px; grid-column: 3; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--deep-blue); background: rgba(78,91,153,.08); border: 1px solid rgba(78,91,153,.18); border-radius: 999px; box-shadow: 0 5px 14px rgba(54,64,112,.08); font-size: 9px; font-weight: 760; white-space: nowrap; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.shot-reference-edit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shot-reference-edit:hover { color: #fff; background: var(--deep-blue); border-color: var(--deep-blue); transform: translateY(-1px); }
.shot-reference-edit:focus-visible { outline: 2px solid rgba(78,91,153,.35); outline-offset: 2px; }
.shot-reference-edit:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.shot-reference-option.is-pending .shot-reference-edit { grid-column: 3 / 5; color: #9b2f74; background: rgba(201,59,138,.08); border-color: rgba(201,59,138,.18); }
.shot-reference-option.is-pending .shot-reference-edit:hover { color: #fff; background: var(--ribbon-pink); border-color: var(--ribbon-pink); }
.shot-reference-thumb { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; color: var(--deep-blue); background: var(--paper-deep); border-radius: 10px; font-size: 13px; font-weight: 820; }
.shot-reference-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-reference-option-copy { min-width: 0; }
.shot-reference-option-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.shot-reference-option-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.shot-reference-empty { grid-column: 1 / -1; min-height: 150px; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: var(--paper); border: 1px dashed var(--line-strong); border-radius: 13px; text-align: center; font-size: 10px; }
.shot-reference-empty strong { color: var(--ink); font-size: 13px; }
.shot-reference-video { margin-top: 14px; padding: 14px; display: grid; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.shot-reference-video > div:first-child strong { font-size: 11px; }
.shot-reference-video > div:first-child small { margin-left: 5px; color: var(--muted); font-size: 8px; font-weight: 600; }
.shot-reference-video p, .shot-reference-video > small { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-reference-video select { width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 10px; }
.shot-reference-video-preview { padding: 10px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 11px; }
.shot-reference-video-preview video { width: 100%; max-height: 220px; display: block; background: #171521; border-radius: 8px; }
.shot-reference-video-preview > div { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shot-reference-video-preview strong { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.shot-continuity-option { margin-top: 14px; padding: 13px; display: flex; align-items: flex-start; gap: 11px; color: var(--ink); background: linear-gradient(135deg,rgba(178,182,223,.16),rgba(238,218,242,.22)); border: 1px solid rgba(78,91,153,.2); border-radius: 12px; cursor: pointer; }
.shot-continuity-option:has(input:checked) { border-color: rgba(78,91,153,.46); box-shadow: inset 3px 0 0 var(--deep-blue); }
.shot-continuity-option.is-disabled { cursor: not-allowed; opacity: .56; }
.shot-continuity-option input { width: 19px; height: 19px; margin: 1px 0 0; flex: 0 0 19px; accent-color: var(--deep-blue); }
.shot-continuity-option span { min-width: 0; }
.shot-continuity-option strong, .shot-continuity-option small { display: block; }
.shot-continuity-option strong { font-size: 11px; }
.shot-continuity-option small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-reference-chip.is-continuity::before { background: var(--deep-blue); }
.shot-no-reference-option { margin-top: 14px; padding: 13px; display: flex; align-items: flex-start; gap: 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.shot-no-reference-option input { width: 19px; height: 19px; margin: 1px 0 0; flex: 0 0 19px; accent-color: var(--deep-blue); }
.shot-no-reference-option span { min-width: 0; }
.shot-no-reference-option strong, .shot-no-reference-option small { display: block; }
.shot-no-reference-option strong { font-size: 11px; }
.shot-no-reference-option small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-reference-body > .field { margin-top: 12px; }
.shot-reference-body .form-error { margin-top: 12px; }
.shot-reference-footer > div { display: flex; gap: 8px; }
.shot-reference-footer .primary-button, .shot-reference-footer .secondary-button { min-height: 40px; }

/* Editable AI storyboard preview */
.storyboard-preview-dialog { width: min(980px, calc(100vw - 34px)); max-height: calc(100vh - 34px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 32px 90px rgba(30,25,45,.3); overflow: hidden; }
.storyboard-preview-shell { height: min(860px, calc(100vh - 36px)); min-height: 520px; display: flex; flex-direction: column; }
.storyboard-preview-heading { padding: 20px 22px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; background: rgba(255,252,255,.96); border-bottom: 1px solid var(--line); }
.storyboard-preview-heading .eyebrow { margin-bottom: 6px; }
.storyboard-preview-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.storyboard-preview-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.storyboard-preview-body { min-height: 0; padding: 20px 22px 26px; flex: 1; overflow: auto; overscroll-behavior: contain; background: var(--paper); }
.storyboard-preview-footer { min-height: 82px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: rgba(255,252,255,.97); border-top: 1px solid var(--line); }
.storyboard-preview-footer-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.storyboard-preview-footer-copy strong { font-size: 11px; }
.storyboard-preview-footer-copy > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.storyboard-preview-footer-copy .storyboard-preview-form-error { color: var(--danger); }
.storyboard-preview-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.storyboard-preview-actions .primary-button, .storyboard-preview-actions .secondary-button { min-height: 42px; padding: 0 16px; font-size: 11px; }
.storyboard-preview-state { min-height: 100%; padding: 40px 20px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.storyboard-preview-state .loading-spinner { width: 28px; height: 28px; margin-bottom: 17px; }
.storyboard-preview-state-icon { width: 48px; height: 48px; margin-bottom: 17px; display: grid; place-items: center; color: var(--danger); background: #fbeef3; border-radius: 15px; font-size: 19px; font-weight: 850; }
.storyboard-preview-state h3 { margin: 0; font-size: 20px; }
.storyboard-preview-state p { max-width: 430px; margin: 9px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.storyboard-draft-summary { margin-bottom: 15px; padding: 15px 17px; background: rgba(178,182,223,.17); border: 1px solid rgba(78,91,153,.13); border-radius: 14px; }
.storyboard-draft-summary span { color: var(--deep-blue); font-size: 9px; font-weight: 820; letter-spacing: .08em; }
.storyboard-draft-summary p { margin: 5px 0 0; font-size: 13px; line-height: 1.65; }
.storyboard-draft-notice { margin: 0 0 15px; color: var(--warning); background: #fbf0f7; border-color: rgba(201,59,138,.16); font-size: 11px; }
.storyboard-draft-scenes { display: flex; flex-direction: column; gap: 15px; }
.storyboard-draft-scene { overflow: hidden; background: rgba(255,252,255,.96); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 5px 18px rgba(30,25,45,.035); }
.storyboard-draft-scene-heading { min-height: 64px; padding: 13px 17px; display: flex; align-items: center; gap: 11px; background: rgba(178,182,223,.1); border-bottom: 1px solid var(--line); }
.storyboard-draft-scene-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #fff; background: var(--deep-blue); border-radius: 10px; font-size: 10px; font-weight: 850; }
.storyboard-draft-scene-heading > div { display: flex; flex-direction: column; gap: 3px; }
.storyboard-draft-scene-heading strong { font-size: 13px; }
.storyboard-draft-scene-heading small { color: var(--muted); font-size: 9px; }
.storyboard-draft-scene-fields { padding: 16px 17px; display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1.5fr); gap: 13px; border-bottom: 1px solid var(--line); }
.storyboard-draft-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.storyboard-draft-field > span { color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.storyboard-draft-field .workbench-textarea { min-height: 82px; }
.storyboard-draft-field [aria-invalid="true"] { border-color: rgba(165,54,90,.65); box-shadow: 0 0 0 3px rgba(165,54,90,.1); }
.storyboard-draft-shots { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.storyboard-draft-shot { padding: 13px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 13px; }
.storyboard-draft-shot-number { margin-bottom: 10px; color: var(--deep-blue); font-size: 10px; font-weight: 820; }
.storyboard-draft-shot-fields { display: grid; grid-template-columns: minmax(150px,.6fr) minmax(260px,1.45fr) 108px; gap: 12px; }
.storyboard-draft-shot .workbench-input, .storyboard-draft-shot .shot-duration-input { height: 44px; }
.storyboard-draft-shot .workbench-textarea { min-height: 76px; }

/* Internal anonymous model audition */
.model-audition-dialog { width: min(1040px, calc(100vw - 34px)); max-height: calc(100vh - 34px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 32px 90px rgba(30,25,45,.3); overflow: hidden; }
.model-audition-shell { height: min(900px, calc(100vh - 36px)); min-height: 560px; display: flex; flex-direction: column; }
.model-audition-heading { padding: 19px 22px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; background: rgba(255,252,255,.97); border-bottom: 1px solid var(--line); }
.model-audition-heading .eyebrow { margin-bottom: 5px; }
.model-audition-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.model-audition-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.model-audition-tabs { padding: 9px 22px; display: flex; gap: 7px; overflow-x: auto; background: rgba(255,252,255,.97); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.model-audition-tabs::-webkit-scrollbar { display: none; }
.model-audition-tab { min-width: 68px; min-height: 40px; padding: 0 13px; color: var(--muted); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.model-audition-tab.is-active { color: var(--deep-blue); background: rgba(178,182,223,.2); border-color: rgba(78,91,153,.28); }
.model-audition-tab.is-rated::after { content: ' · 已评'; color: var(--ribbon-pink); font-size: 8px; }
.model-audition-tab.is-failed { color: var(--faint); text-decoration: line-through; }
.model-audition-body { min-height: 0; padding: 20px 22px 28px; flex: 1; overflow: auto; overscroll-behavior: contain; background: var(--paper); }
.model-audition-footer { min-height: 82px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: rgba(255,252,255,.98); border-top: 1px solid var(--line); }
.model-audition-footer-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.model-audition-footer-copy strong { font-size: 11px; }
.model-audition-footer-copy > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.model-audition-footer-copy .storyboard-preview-form-error { color: var(--danger); }
.model-audition-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.model-audition-actions .primary-button, .model-audition-actions .secondary-button { min-height: 42px; padding: 0 16px; font-size: 11px; }
.model-audition-state { min-height: 100%; padding: 36px 20px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.model-audition-state .loading-spinner { width: 29px; height: 29px; margin-bottom: 17px; }
.model-audition-state-mark { min-width: 54px; height: 54px; margin-bottom: 16px; padding: 0 12px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.18); border-radius: 16px; font: 850 12px/1 'JetBrains Mono', monospace; }
.model-audition-state h3 { margin: 0; font-size: 21px; }
.model-audition-state p { max-width: 500px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.model-audition-rules { max-width: 620px; margin: 21px auto 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; text-align: left; }
.model-audition-rule { padding: 13px; background: rgba(255,252,255,.86); border: 1px solid var(--line); border-radius: 13px; }
.model-audition-rule strong { display: block; margin-bottom: 5px; font-size: 10px; }
.model-audition-rule span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.model-audition-candidate-intro { margin-bottom: 15px; padding: 14px 16px; background: rgba(178,182,223,.14); border: 1px solid rgba(78,91,153,.12); border-radius: 14px; }
.model-audition-candidate-intro > span { color: var(--deep-blue); font: 820 9px/1 'JetBrains Mono', monospace; letter-spacing: .08em; }
.model-audition-candidate-intro p { margin: 6px 0 0; font-size: 13px; line-height: 1.65; }
.model-audition-scene-list { display: flex; flex-direction: column; gap: 9px; }
.model-audition-scene { overflow: hidden; background: rgba(255,252,255,.96); border: 1px solid var(--line); border-radius: 15px; }
.model-audition-scene > summary { min-height: 55px; padding: 12px 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; background: rgba(178,182,223,.08); }
.model-audition-scene > summary::-webkit-details-marker { display: none; }
.model-audition-scene-number { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 31px; color: #fff; background: var(--deep-blue); border-radius: 9px; font-size: 9px; font-weight: 850; }
.model-audition-scene-heading { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.model-audition-scene-heading strong { font-size: 12px; }
.model-audition-scene-heading small { color: var(--muted); font-size: 9px; }
.model-audition-scene-description { margin: 0; padding: 12px 15px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; line-height: 1.65; }
.model-audition-shot-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.model-audition-shot { padding: 11px 12px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 11px; }
.model-audition-shot header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-audition-shot strong { font-size: 10px; }
.model-audition-shot small { color: var(--faint); font-size: 8px; }
.model-audition-shot p { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }
.model-audition-rating { margin-top: 18px; padding: 17px; background: rgba(255,252,255,.97); border: 1px solid rgba(78,91,153,.16); border-radius: 16px; }
.model-audition-rating > h3 { margin: 0; font-size: 15px; }
.model-audition-rating > p { margin: 6px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.model-audition-rating-grid { display: grid; gap: 11px; }
.model-audition-score-row { min-width: 0; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(145px,1fr) minmax(250px,1.35fr); align-items: center; gap: 14px; border: 0; }
.model-audition-score-row legend { padding: 0; font-size: 10px; font-weight: 760; }
.model-audition-score-row legend span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.model-audition-score-options { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; }
.model-audition-score-option { min-width: 0; }
.model-audition-score-option input { position: absolute; opacity: 0; pointer-events: none; }
.model-audition-score-option span { min-height: 42px; display: grid; place-items: center; color: var(--muted); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 11px; font-weight: 800; }
.model-audition-score-option input:checked + span { color: #fff; background: var(--deep-blue); border-color: var(--deep-blue); }
.model-audition-score-option input:focus-visible + span { outline: 2px solid var(--ribbon-pink); outline-offset: 2px; }
.model-audition-note { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.model-audition-note textarea { min-height: 70px; padding: 10px 12px; resize: vertical; }
.model-audition-winner { margin-top: 16px; padding: 16px; background: rgba(232,58,166,.055); border: 1px solid rgba(201,59,138,.14); border-radius: 15px; }
.model-audition-winner h3 { margin: 0; font-size: 14px; }
.model-audition-winner p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; }
.model-audition-winner-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 7px; }
.model-audition-winner-option input { position: absolute; opacity: 0; pointer-events: none; }
.model-audition-winner-option span { min-height: 44px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(255,252,255,.9); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 850; }
.model-audition-winner-option input:checked + span { color: #fff; background: var(--ribbon-pink); border-color: var(--ribbon-pink); }
.model-audition-results { display: flex; flex-direction: column; gap: 11px; }
.model-audition-result { padding: 16px; background: rgba(255,252,255,.96); border: 1px solid var(--line); border-radius: 16px; }
.model-audition-result.is-winner { border-color: rgba(201,59,138,.38); box-shadow: 0 7px 22px rgba(201,59,138,.08); }
.model-audition-result header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.model-audition-result-alias { display: inline-flex; align-items: center; gap: 9px; color: var(--deep-blue); font: 850 12px/1 'JetBrains Mono', monospace; }
.model-audition-result-alias small { padding: 3px 7px; color: var(--ribbon-pink); background: rgba(232,58,166,.09); border-radius: 99px; font: 800 8px/1 'Inter', sans-serif; }
.model-audition-result-score { color: var(--deep-blue); font-size: 14px; font-weight: 850; }
.model-audition-result h3 { margin: 12px 0 3px; font-size: 15px; }
.model-audition-result-model { color: var(--muted); font: 500 9px/1.5 'JetBrains Mono', monospace; overflow-wrap: anywhere; }
.model-audition-result-metrics { margin-top: 12px; display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; }
.model-audition-result-metric { padding: 8px 6px; text-align: center; background: var(--surface-strong); border-radius: 9px; }
.model-audition-result-metric span { display: block; color: var(--muted); font-size: 8px; }
.model-audition-result-metric strong { display: block; margin-top: 3px; font-size: 11px; }

/* Personal asset library */
.app-view--assets { position: relative; }

.asset-toolbar {
    min-height: 54px;
    margin: -8px 0 24px;
    padding: 10px 12px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 252, 255, .72);
    border: 1px solid var(--line);
    border-radius: 15px;
    backdrop-filter: blur(12px);
}

.asset-filter-stack { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.asset-filter-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.asset-filter-label { flex: 0 0 auto; color: var(--faint); font-size: 8px; font-weight: 780; letter-spacing: .08em; }
.asset-filters, .asset-view-toggle { display: flex; align-items: center; gap: 4px; }
.asset-usage-filters { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.asset-usage-filters::-webkit-scrollbar { display: none; }
.asset-usage-divider { width: 1px; height: 22px; margin: 0 5px; flex: 0 0 1px; background: var(--line-strong); }
.asset-filter, .asset-view-button {
    min-height: 38px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 720;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.asset-filter { padding: 0 16px; }
.asset-filter--secondary { min-height: 33px; padding: 0 12px; font-size: 9px; }
.asset-filter:hover, .asset-view-button:hover { color: var(--deep-blue); background: rgba(178, 182, 223, .14); }
.asset-filter.is-active { color: white; background: var(--deep-blue); box-shadow: 0 6px 16px rgba(78, 91, 153, .17); }
.asset-filter--history { color: var(--faint); }
.asset-filter--history::before { content: '↺'; margin-right: 5px; font-size: 13px; line-height: 1; }
.asset-filter--history.is-active { background: linear-gradient(135deg, var(--deep-blue), #7c5aa8); }
.asset-filter--secondary.is-active { color: var(--deep-blue); background: rgba(178, 182, 223, .24); box-shadow: none; }
.asset-production-filter { min-width: 0; display: flex; align-items: center; gap: 8px; }
.asset-select-shell { position: relative; min-width: 0; display: block; }
.asset-select-shell select {
    width: min(220px, 28vw);
    height: 34px;
    padding: 0 34px 0 11px;
    overflow: hidden;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid transparent;
    border-radius: 9px;
    appearance: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 680 9px/1 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
.asset-select-shell select:hover { color: var(--deep-blue); background: rgba(178, 182, 223, .14); }
.asset-select-shell select:focus { outline: 2px solid rgba(225, 106, 217, .28); outline-offset: 1px; }
.asset-select-shell svg { position: absolute; right: 9px; top: 50%; width: 15px; height: 15px; color: var(--muted); pointer-events: none; transform: translateY(-50%); }
.asset-filter-divider { width: 1px; height: 22px; margin: 0 2px; flex: 0 0 1px; background: var(--line); }
.asset-toolbar-note { margin: 0; color: var(--faint); font-size: 9px; line-height: 1.5; }
.asset-view-toggle { align-self: center; padding-left: 11px; border-left: 1px solid var(--line); }
.asset-view-button { width: 38px; padding: 0; display: grid; place-items: center; }
.asset-view-button svg { width: 17px; height: 17px; }
.asset-view-button.is-active { color: var(--deep-blue); background: rgba(178, 182, 223, .24); }

.asset-collection.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.asset-collection.is-list { display: flex; flex-direction: column; gap: 11px; }

.asset-card {
    min-width: 0;
    color: var(--ink);
    background: rgba(255, 252, 255, .94);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(30, 25, 45, .035);
    overflow: hidden;
    transition: transform .22s var(--ease), border-color .2s ease, box-shadow .22s var(--ease);
}
.asset-card:not(.asset-card--skeleton):hover { transform: translateY(-3px); border-color: rgba(78, 91, 153, .26); box-shadow: 0 16px 40px rgba(78, 91, 153, .1); }
.asset-preview-button {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--mist-blue);
    background: linear-gradient(145deg, var(--ink), var(--deep-blue));
    border: 0;
    overflow: hidden;
}
.asset-preview-button::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(30, 25, 45, .2), transparent 42%); pointer-events: none; }
.asset-preview-button:focus-visible { outline-offset: -4px; }
.asset-preview-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .35s var(--ease), opacity .2s ease; }
.asset-card:hover .asset-preview-media { transform: scale(1.025); }
.asset-preview-fallback { position: relative; z-index: 0; width: 52px; height: 52px; display: grid; place-items: center; color: rgba(255,255,255,.62); background: rgba(255,255,255,.08); border-radius: 16px; }
.asset-preview-fallback svg { width: 26px; height: 26px; }
.asset-kind-badge, .asset-duration {
    position: absolute;
    z-index: 2;
    bottom: 10px;
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    color: white;
    background: rgba(30, 25, 45, .68);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    font-size: 8px;
    font-weight: 750;
}
.asset-kind-badge { left: 10px; padding: 0 8px; gap: 5px; }
.asset-kind-badge svg { width: 12px; height: 12px; }
.asset-duration { right: 10px; padding: 0 8px; font-family: 'JetBrains Mono', monospace; }
.asset-card-body { min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 13px; }
.asset-card-copy { min-width: 0; }
.asset-semantic-meta { min-width: 0; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.asset-semantic-badge { min-height: 21px; padding: 0 8px; flex: 0 0 auto; display: inline-flex; align-items: center; color: var(--deep-blue); background: rgba(178, 182, 223, .2); border-radius: 999px; font-size: 8px; font-weight: 780; }
.asset-semantic-badge.is-setting-reference { color: #914b8d; background: rgba(225, 106, 217, .13); }
.asset-semantic-badge.is-setting-candidate { color: #9c5a27; background: rgba(231, 169, 94, .14); }
.asset-semantic-badge.is-shot-result { color: var(--deep-blue); background: rgba(178, 182, 223, .24); }
.asset-semantic-badge.is-unclassified { color: var(--muted); background: var(--paper-deep); }
.asset-project-name { min-width: 0; overflow: hidden; color: var(--faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-copy h2 { margin: 0; overflow: hidden; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-copy p { min-height: 16px; margin: 6px 0 3px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.asset-date { color: var(--faint); font-size: 8px; }
.asset-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.asset-card-actions.is-download-only { grid-template-columns: 1fr; }
.asset-action {
    min-height: 33px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid transparent;
    border-radius: 9px;
    text-decoration: none;
    font-size: 9px;
    font-weight: 720;
}
button.asset-action { font: inherit; font-size: 9px; font-weight: 720; }
.asset-action:hover { color: var(--deep-blue); background: rgba(178, 182, 223, .2); border-color: rgba(78, 91, 153, .12); }
.asset-action.is-danger { color: var(--danger); }
.asset-action.is-danger:hover { background: #fbeef3; border-color: rgba(165, 54, 90, .12); }
.asset-action svg { width: 14px; height: 14px; }

.asset-collection.is-list .asset-card { min-height: 116px; padding: 9px; display: grid; grid-template-columns: 158px minmax(0, 1fr); align-items: stretch; }
.asset-collection.is-list .asset-preview-button { aspect-ratio: auto; min-height: 96px; border-radius: 11px; }
.asset-collection.is-list .asset-card-body { padding: 8px 8px 8px 15px; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
.asset-collection.is-list .asset-card-copy { flex: 1; }
.asset-collection.is-list .asset-card-copy h2 { font-size: 14px; }
.asset-collection.is-list .asset-card-actions { width: 170px; flex: 0 0 170px; }
.asset-collection.is-list .asset-card-actions.is-download-only { width: 90px; flex-basis: 90px; }
.asset-card--skeleton { min-height: 255px; border-color: transparent; background: linear-gradient(100deg, rgba(243,230,242,.42) 20%, rgba(255,252,255,.92) 38%, rgba(178,182,223,.18) 56%) var(--paper-deep); background-size: 220% 100%; animation: shimmer 1.5s infinite linear; }
.asset-collection.is-list .asset-card--skeleton { min-height: 116px; }

.asset-empty { min-height: min(500px, 54vh); }
.asset-empty-visual { position: relative; width: 170px; height: 126px; margin-bottom: 17px; }
.asset-empty-image, .asset-empty-video { position: absolute; display: block; border: 1px solid var(--line-strong); border-radius: 15px; }
.asset-empty-image { left: 11px; top: 12px; width: 106px; height: 84px; transform: rotate(-7deg); background: var(--paper-deep); }
.asset-empty-image::before { content: ''; position: absolute; left: 17px; top: 17px; width: 12px; height: 12px; border: 2px solid var(--deep-blue); border-radius: 50%; opacity: .62; }
.asset-empty-image i { position: absolute; left: 15px; right: 15px; bottom: 15px; height: 27px; background: linear-gradient(135deg, transparent 0 26%, rgba(78,91,153,.32) 27% 51%, transparent 52%), linear-gradient(45deg, transparent 0 28%, rgba(225,106,217,.35) 29% 58%, transparent 59%); }
.asset-empty-video { right: 7px; bottom: 5px; width: 106px; height: 78px; background: linear-gradient(145deg, var(--ink-soft), var(--deep-blue)); box-shadow: var(--shadow-md); }
.asset-empty-video i { position: absolute; left: 43px; top: 25px; width: 0; height: 0; border-top: 13px solid transparent; border-bottom: 13px solid transparent; border-left: 20px solid rgba(255,255,255,.84); }
.asset-empty-visual .empty-spark { right: 0; top: 0; }
.asset-filter-empty .state-icon { color: var(--deep-blue); background: rgba(178, 182, 223, .2); }

.upload-panel { margin: -10px 0 24px; padding: 16px; background: rgba(255,252,255,.88); border: 1px solid rgba(78,91,153,.18); border-radius: 16px; box-shadow: var(--shadow-sm); }
.upload-panel-heading { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.upload-panel-heading > div { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.upload-panel-heading h2 { margin: 0; font-size: 13px; }
.upload-panel-heading span { color: var(--muted); font-size: 9px; }
.upload-panel-heading .text-button { min-height: 31px; padding: 0 9px; font-size: 9px; }
.upload-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; }
.upload-row { min-width: 0; min-height: 57px; padding: 9px 10px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; background: var(--paper); border: 1px solid transparent; border-radius: 11px; }
.upload-row.is-error { border-color: rgba(165,54,90,.14); background: #fbeef3; }
.upload-kind-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(178,182,223,.22); border-radius: 9px; }
.upload-kind-icon svg { width: 17px; height: 17px; }
.upload-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.upload-copy strong, .upload-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-copy strong { font-size: 10px; }
.upload-copy > span { color: var(--muted); font-size: 8px; }
.upload-row.is-error .upload-copy > span { color: var(--danger); white-space: normal; }
.upload-track { position: relative; width: 100%; height: 3px; overflow: hidden; background: rgba(178,182,223,.24); border-radius: 999px; }
.upload-track i { position: absolute; inset: 0 auto 0 -45%; width: 45%; background: linear-gradient(90deg, var(--deep-blue), var(--accent)); border-radius: inherit; animation: upload-slide 1.1s ease-in-out infinite; }
@keyframes upload-slide { to { left: 105%; } }
.upload-done { width: 23px; height: 23px; display: grid; place-items: center; color: white; background: var(--success); border-radius: 50%; font-size: 10px; font-weight: 800; }
.upload-retry { min-height: 31px; padding: 0 8px; font-size: 9px; }

.asset-drop-overlay { position: absolute; z-index: 40; inset: 26px; min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: rgba(248,244,250,.94); border: 2px dashed var(--accent); border-radius: 24px; box-shadow: 0 26px 80px rgba(30,25,45,.2); backdrop-filter: blur(15px); }
.asset-drop-icon { width: 66px; height: 66px; margin-bottom: 8px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--deep-blue), var(--ribbon-pink)); border-radius: 21px; box-shadow: 0 16px 36px rgba(78,91,153,.24); }
.asset-drop-icon svg { width: 29px; height: 29px; }
.asset-drop-overlay strong { font-size: 21px; }
.asset-drop-overlay > span:last-child { color: var(--muted); font-size: 11px; }

.asset-preview-dialog { width: min(980px, calc(100vw - 34px)); max-height: calc(100vh - 34px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 32px 90px rgba(30,25,45,.3); overflow: hidden; }
.asset-preview-shell { max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.asset-preview-heading { padding: 20px 22px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.asset-preview-heading .eyebrow { margin-bottom: 6px; }
.asset-preview-heading h2 { max-width: min(700px, 70vw); margin: 0; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.asset-preview-stage { min-height: 300px; flex: 1; display: grid; place-items: center; overflow: auto; background: var(--ink); }
.asset-preview-stage > * { grid-area: 1 / 1; }
.asset-preview-large { display: block; max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; }
.asset-preview-stage video.asset-preview-large { width: 100%; }
.asset-preview-loading { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(255,255,255,.72); text-align: center; }
.asset-preview-loading .loading-spinner { width: 25px; height: 25px; }
.asset-preview-loading p { max-width: 320px; margin: 0; font-size: 11px; line-height: 1.6; }
.asset-preview-loading .state-icon { color: #fff; background: rgba(255,255,255,.1); }
.asset-preview-footer { min-height: 70px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.asset-preview-footer > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.asset-preview-footer > div { flex: 0 0 auto; display: flex; gap: 8px; }
.asset-preview-footer .primary-button, .asset-preview-footer .secondary-button { min-height: 40px; padding: 0 15px; font-size: 11px; text-decoration: none; }
.asset-delete-button { color: var(--danger); }
.delete-asset-dialog .dialog-body { padding-top: 0; padding-bottom: 8px; }
.danger-button { background: var(--danger); box-shadow: 0 10px 24px rgba(165,54,90,.2); }
.danger-button:hover:not(:disabled) { background: #8d294b; box-shadow: 0 14px 30px rgba(165,54,90,.24); }

/* App dialogs */
.create-dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 32px 90px rgba(30, 25, 45, .28); overflow: auto; }
.create-dialog::backdrop, .management-dialog::backdrop, .asset-preview-dialog::backdrop, .storyboard-preview-dialog::backdrop, .model-audition-dialog::backdrop { background: rgba(30, 25, 45, .55); backdrop-filter: blur(5px); }
.create-dialog[open], .management-dialog[open], .asset-preview-dialog[open], .storyboard-preview-dialog[open], .model-audition-dialog[open] { animation: dialog-in .25s var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.dialog-heading { padding: 25px 25px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.dialog-heading .eyebrow { margin-bottom: 8px; }
.dialog-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.dialog-copy { max-width: 380px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.delete-production-dialog .dialog-body { padding-top: 0; padding-bottom: 8px; }
.delete-production-warning { margin: 0; padding: 12px 13px; color: var(--danger); background: #fbeef3; border: 1px solid rgba(176, 48, 93, .12); border-radius: 10px; font-size: 11px; line-height: 1.6; }
.dialog-body { padding: 6px 25px 24px; display: flex; flex-direction: column; gap: 18px; }
.creation-mode-picker { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; border: 0; }
.creation-mode-picker label { position: relative; cursor: pointer; }
.creation-mode-picker input { position: absolute; opacity: 0; pointer-events: none; }
.creation-mode-picker label > span { min-height: 72px; padding: 13px; display: flex; flex-direction: column; justify-content: center; gap: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.creation-mode-picker strong { color: var(--ink); font-size: 12px; }
.creation-mode-picker small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.creation-mode-picker input:checked + span { background: rgba(178, 182, 223, .16); border-color: rgba(78, 91, 153, .5); box-shadow: inset 0 0 0 1px rgba(78, 91, 153, .1); }
.script-scope-picker { margin: 0; padding: 0; border: 0; }
.script-scope-picker legend { margin-bottom: 8px; color: var(--ink); font-size: 11px; font-weight: 800; }
.script-scope-picker label { margin-right: 7px; display: inline-flex; cursor: pointer; }
.script-scope-picker input { position: absolute; opacity: 0; pointer-events: none; }
.script-scope-picker label span { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; font-size: 10px; font-weight: 700; }
.script-scope-picker input:checked + span { color: var(--deep-blue); background: rgba(178, 182, 223, .2); border-color: rgba(78, 91, 153, .38); }
.production-aspect-picker { margin: 0; padding: 0; border: 0; }
.production-aspect-picker legend { margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 800; }
.production-aspect-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.production-aspect-options label { position: relative; min-width: 0; cursor: pointer; }
.production-aspect-options input { position: absolute; opacity: 0; pointer-events: none; }
.production-aspect-options label > span { min-height: 78px; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.production-aspect-options b { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-style: normal; }
.production-aspect-options strong { color: var(--ink); font-size: 12px; white-space: nowrap; }
.production-aspect-options small { font-size: 9px; line-height: 1.4; }
.production-aspect-options input:checked + span { color: var(--deep-blue); background: rgba(178,182,223,.2); border-color: rgba(78,91,153,.38); box-shadow: inset 0 0 0 1px rgba(78,91,153,.1); }
.production-aspect-options input:focus-visible + span { outline: 2px solid var(--deep-blue); outline-offset: 2px; }
.aspect-shape { flex: 0 0 auto; display: block; border: 2px solid currentColor; border-radius: 5px; box-shadow: inset 0 0 0 3px rgba(178,182,223,.14); }
.aspect-shape.is-vertical { width: 24px; height: 42px; }
.aspect-shape.is-horizontal { width: 42px; height: 24px; }
.production-aspect-picker > p { margin: 8px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.production-format-note { margin: 0; padding: 12px 13px; color: var(--ink-soft); background: rgba(178,182,223,.12); border: 1px solid rgba(78,91,153,.11); border-radius: 11px; font-size: 10px; line-height: 1.65; }
.work-source-panel { margin-bottom: 15px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(178, 182, 223, .15); border: 1px solid rgba(78, 91, 153, .18); border-radius: 14px; }
.work-source-panel[hidden] { display: none; }
.work-source-panel strong { font-size: 12px; }
.work-source-panel p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.work-source-panel .secondary-button { flex: 0 0 auto; }
.work-source-script { width: 100%; min-height: min(52vh, 520px); padding: 14px; resize: vertical; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 11px; line-height: 1.7; }
.format-note { min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 9px; color: var(--muted); background: var(--paper); border-radius: 10px; font-size: 10px; font-weight: 650; }
.format-note i { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.production-duration-picker { margin: 0; padding: 0; border: 0; }
.production-duration-picker legend { margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 800; }
.production-duration-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.production-duration-options label { position: relative; min-width: 0; cursor: pointer; }
.production-duration-options input { position: absolute; opacity: 0; pointer-events: none; }
.production-duration-options span { min-height: 64px; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.production-duration-options strong { color: var(--ink); font-size: 13px; }
.production-duration-options small { font-size: 9px; }
.production-duration-options input:checked + span { color: var(--deep-blue); background: rgba(178,182,223,.2); border-color: rgba(78,91,153,.38); box-shadow: inset 0 0 0 1px rgba(78,91,153,.1); }
.production-duration-options input:focus-visible + span { outline: 2px solid var(--deep-blue); outline-offset: 2px; }
.custom-duration-field { margin-top: 9px; display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.custom-duration-field[hidden] { display: none; }
.custom-duration-field input { width: 100%; min-height: 40px; padding: 8px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.production-duration-picker > p { margin: 8px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.dialog-actions { padding: 16px 25px 23px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.dialog-actions .primary-button, .dialog-actions .secondary-button { min-height: 42px; }

.password-dialog { width: min(500px, calc(100vw - 32px)); }
.forced-password-notice { padding: 12px 13px; display: flex; align-items: flex-start; gap: 9px; color: var(--warning); background: var(--accent-soft); border: 1px solid rgba(201, 59, 138, .15); border-radius: 11px; font-size: 11px; line-height: 1.6; }
.forced-password-notice svg { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 18px; }

.management-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 32px 90px rgba(30, 25, 45, .28); overflow: hidden; }
.management-shell { max-height: calc(100vh - 34px); display: flex; flex-direction: column; }
.management-heading { padding: 25px 27px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.management-heading .eyebrow { margin-bottom: 8px; }
.management-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.management-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.management-toolbar { padding: 17px 27px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.management-toolbar > div { display: flex; flex-direction: column; gap: 4px; }
.management-toolbar strong { font-size: 14px; }
.management-toolbar > div > span { color: var(--muted); font-size: 10px; }
.primary-button--compact { min-height: 38px; padding: 0 14px; font-size: 11px; box-shadow: none; }
.primary-button--compact svg { width: 16px; height: 16px; }
.icon-button--small { width: 34px; height: 34px; }

.member-create-panel { margin: 0 27px 16px; padding: 18px; flex: 0 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.member-create-heading { margin-bottom: 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.member-create-heading > div { display: flex; flex-direction: column; gap: 4px; }
.member-create-heading strong { font-size: 13px; }
.member-create-heading span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.member-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-form-grid .field input { background: var(--surface-strong); }
.member-password-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.member-create-panel .form-error { margin-top: 12px; }
.member-form-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 9px; }
.member-form-actions .primary-button, .member-form-actions .secondary-button { min-height: 38px; padding: 0 14px; font-size: 11px; }

.members-loading, .members-message { min-height: 220px; margin: 0 27px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; font-size: 11px; }
.members-loading .loading-spinner { width: 24px; height: 24px; }
.members-message strong { color: var(--ink); font-size: 14px; }
.members-message span { max-width: 360px; line-height: 1.6; }
.members-message .secondary-button { margin-top: 4px; }
.members-list { min-height: 120px; margin: 0 27px; flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-strong); }
.member-row { padding: 15px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-avatar { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-soft); background: var(--paper-deep); border-radius: 12px; font-size: 13px; font-weight: 800; }
.member-avatar.is-admin { color: #fff; background: var(--deep-blue); }
.member-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.member-meta-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.member-meta h3 { margin: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.member-meta > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.member-badge { min-height: 20px; padding: 0 7px; display: inline-flex; align-items: center; color: var(--muted); background: var(--paper); border-radius: 999px; font-size: 8px; font-weight: 750; }
.member-badge.is-disabled { color: var(--danger); background: #fbeef3; }
.member-badge.is-current { color: var(--success); background: #edf7f3; }
.member-actions { display: flex; align-items: center; gap: 6px; }
.member-action-button { min-height: 31px; padding: 0 10px; color: var(--ink-soft); background: var(--paper); border: 1px solid transparent; border-radius: 8px; font-size: 9px; font-weight: 700; }
.member-action-button:hover { color: var(--ink); border-color: var(--line); background: var(--surface-strong); }
.member-action-button.is-danger { color: var(--danger); }
.member-inline-panel { grid-column: 1 / -1; margin-top: 2px; padding: 13px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; background: var(--paper); border-radius: 11px; }
.member-inline-panel .field { flex: 1; }
.member-inline-panel .field input { height: 40px; background: var(--surface-strong); }
.member-inline-panel .secondary-button, .member-inline-panel .primary-button { min-height: 40px; padding: 0 12px; font-size: 10px; }
.member-inline-copy { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.member-inline-copy strong { color: var(--danger); font-size: 11px; }
.member-inline-copy span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.member-inline-error { width: 100%; flex: 1 0 100%; margin: 8px 0 0; color: var(--danger); font-size: 9px; }
.management-footer { padding: 15px 27px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.management-footer p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.management-footer .secondary-button { min-height: 38px; }

.toast-region { position: fixed; z-index: 1000; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; pointer-events: none; }
.toast { max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; display: flex; align-items: center; gap: 10px; color: white; background: var(--ink); border: 1px solid rgba(178, 182, 223, .16); border-radius: 12px; box-shadow: var(--shadow-md); font-size: 11px; font-weight: 650; line-height: 1.5; animation: toast-in .25s var(--ease) both; }
.toast::before { content: ''; width: 7px; height: 7px; flex: 0 0 7px; background: var(--accent); border-radius: 50%; }
.toast.is-error::before { background: #f08aaa; }
.toast.is-leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.mobile-account-dialog { display: none; }

@media (max-width: 1040px) {
    .auth-shell { grid-template-columns: 1fr 440px; }
    .auth-story { padding-left: 45px; padding-right: 45px; }
    .auth-pitch h1 { font-size: clamp(43px, 5.8vw, 65px); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wallet-balance-card { grid-template-columns: 1fr; gap: 24px; }
    .wallet-membership-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wallet-package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wallet-history-grid { grid-template-columns: 1fr; }
    .credits-section-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .credits-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .asset-collection.is-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .shot-card .workbench-fields { grid-template-columns: minmax(150px, .7fr) minmax(0, 1.4fr); }
    .shot-card .workbench-field:last-child { grid-column: 1 / -1; max-width: 150px; }
    .storyboard-draft-shot-fields { grid-template-columns: minmax(150px,.65fr) minmax(0,1.35fr); }
    .storyboard-draft-shot-fields .storyboard-draft-field:last-child { grid-column: 1 / -1; max-width: 150px; }
}

@media (max-width: 760px) {
    .auth-shell { display: block; min-height: 100svh; background: var(--surface); }
    .auth-shell::before { display: none; }
    .auth-story { min-height: auto; padding: 24px 22px 28px; background: var(--paper); }
    .auth-promises { display: none; }
    .auth-story::after { background-size: 42px 42px; opacity: .62; }
    .auth-motion::before { width: 320px; height: 320px; right: -46%; top: 4%; opacity: .72; }
    .auth-motion-frame--wide { width: 240px; right: -92px; top: 86px; opacity: .42; transform: rotate(-4deg); animation: none; }
    .auth-motion-frame--portrait, .auth-motion-frame--detail, .auth-motion-scan, .auth-motion-path, .auth-motion-caption, .auth-motion-node--two { display: none; }
    .auth-motion-node--one { right: 18px; top: 152px; animation: none; opacity: .7; }
    .auth-pitch { margin: 48px 0 0; }
    .auth-pitch h1 { font-size: clamp(38px, 11vw, 54px); }
    .auth-pitch-copy { margin-top: 18px; font-size: 13px; }
    .auth-panel { min-height: auto; padding: 38px 22px 74px; border: 0; }
    .auth-card { width: min(100%, 460px); }
    .auth-footnote { bottom: 24px; }

    .app-page { height: 100svh; }
    .app-shell { height: 100svh; display: block; }
    .app-sidebar { display: none; }
    .app-main { height: calc(100svh - 70px); padding-top: 64px; }
    .workbench-open .app-main { height: 100svh; padding-top: 0; }
    .workbench-open .mobile-topbar, .workbench-open .mobile-nav { display: none; }
    .mobile-topbar {
        position: fixed;
        z-index: 20;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        padding: 0 18px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        background: rgba(248, 244, 250, .9);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(16px);
    }
    .auth-story .brand-lockup--large { gap: var(--brand-lockup-gap); }
    .auth-story .brand-lockup--large .brand-mark { width: 29px; height: 29px; flex-basis: 29px; border-radius: 9px; }
    .auth-story .brand-lockup--large .brand-wordmark { width: 64px; height: auto; }
    .mobile-topbar .brand-mark { width: 29px; height: 29px; flex-basis: 29px; border-radius: 9px; }
    .mobile-topbar .brand-lockup { gap: var(--brand-lockup-gap); }
    .mobile-topbar .brand-mark svg { width: 22px; height: 22px; }
    .mobile-topbar .brand-lockup strong { font-size: 17px; }
    .mobile-topbar .brand-wordmark { width: 64px; height: auto; }
    .mobile-credit-balance {
        min-height: 30px;
        margin-left: auto;
        padding: 0 11px;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: var(--deep-blue-dark);
        background: linear-gradient(135deg,rgba(238,240,250,.96),rgba(255,247,252,.94));
        border: 0;
        box-shadow: inset 0 0 0 1px rgba(78,91,153,.09),0 5px 15px rgba(78,91,153,.08);
        font-size: 9px;
        font-weight: 820;
        letter-spacing: -.01em;
    }
    .mobile-credit-balance::before {
        content: "";
        width: 6px;
        height: 6px;
        flex: 0 0 6px;
        background: linear-gradient(145deg,var(--deep-blue),var(--ribbon-pink));
        border-radius: 2px;
        box-shadow: 0 0 0 3px rgba(78,91,153,.07);
        transform: rotate(45deg);
    }
    .mobile-account-button {
        width: 40px;
        height: 40px;
        margin-left: 12px;
        padding: 2px;
        display: grid;
        place-items: center;
        background: rgba(255,255,255,.66);
        border: 1px solid rgba(78,91,153,.1);
        border-radius: 13px;
        box-shadow: 0 5px 15px rgba(64,57,92,.08);
    }
    .mobile-account-button .user-avatar { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
    .mobile-nav {
        position: fixed;
        z-index: 30;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(70px + env(safe-area-inset-bottom));
        padding: 7px 10px env(safe-area-inset-bottom);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: rgba(30, 25, 45, .97);
        backdrop-filter: blur(18px);
    }
    .is-admin .mobile-nav { grid-template-columns: repeat(4, 1fr); }
    .mobile-nav .nav-item { min-height: 56px; padding: 5px; flex-direction: column; justify-content: center; gap: 4px; border-radius: 10px; font-size: 9px; }
    .mobile-nav .nav-item svg { width: 20px; height: 20px; }
    .mobile-nav .nav-item.is-active::after { display: none; }
    .app-view { min-height: calc(100svh - 134px); padding: 32px 18px 40px; }
    .app-view--workbench { min-height: 100svh; padding: 0 14px calc(32px + env(safe-area-inset-bottom)); }
    .workbench-topbar {
        position: sticky;
        z-index: 18;
        top: 0;
        min-height: 66px;
        margin: 0 -14px;
        padding: env(safe-area-inset-top) 14px 0;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 7px;
        background: rgba(248, 244, 250, .94);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(16px);
    }
    .workbench-back { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
    .workbench-back span { display: none; }
    .workbench-identity h1 { font-size: 15px; }
    .workbench-identity h1 { margin-top: 1px; }
    .workbench-format { min-height: 20px; padding: 0 5px; display: inline-flex; font-size: 8px; }
    .workbench-save-status { min-height: 36px; padding: 0 7px; font-size: 10px; }
    .workbench-steps {
        position: sticky;
        z-index: 17;
        top: calc(66px + env(safe-area-inset-top));
        min-height: 54px;
        margin: 0 -14px 24px;
        padding: 6px 12px;
        grid-template-columns: 1fr 6px 1fr 6px 1fr 6px 1fr 6px 1fr;
        border-width: 0 0 1px;
        border-radius: 0;
        background: rgba(255, 252, 255, .95);
        backdrop-filter: blur(16px);
    }
    .workbench-step { min-height: 42px; padding: 0 6px; gap: 5px; }
    .workbench-step > span { width: 23px; height: 23px; border-radius: 7px; }
    .workbench-step strong { font-size: 11px; }
    .workbench-step em { display: none; }
    .workbench-notice { margin-top: -8px; align-items: flex-start; }
    .workbench-notice--conflict { flex-wrap: wrap; }
    .workbench-notice--conflict .text-button { margin-left: 24px; }
    .workbench-loading, .workbench-error { min-height: calc(100svh - 170px); }
    .workbench-content { padding: 0 2px 32px; }
    .workbench-stage-heading { margin-bottom: 19px; }
    .workbench-stage-heading h2 { font-size: 30px; }
    .frame-status-overview { margin-top: 14px; padding: 12px; border-radius: 15px; }
    .frame-status-heading { align-items: flex-start; }
    .frame-status-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); justify-content: stretch; gap: 7px; }
    .frame-status-cell { width: 100%; max-width: none; height: auto; aspect-ratio: 1; border-radius: 8px; font-size: 9px; }
    .workbench-stage-heading > p:last-child, .workbench-stage-heading > div > p:last-child { margin-top: 10px; font-size: 14px; line-height: 1.65; }
    .workbench-stage-heading--with-action { align-items: flex-start; }
    .workbench-stage-heading--with-action .primary-button { min-height: 42px; padding: 0 13px; flex: 0 0 auto; }
    .story-panes { width: 100%; margin: -7px 0 20px; justify-content: flex-start; }
    .story-pane-button { min-height: 40px; padding: 0 13px; }
    .story-editor { padding: 16px; border-radius: 17px; }
    .story-editor textarea { min-height: 300px; padding: 15px; font-size: 16px; }
    .story-editor small > span:first-child { max-width: 70%; }
    .story-breakdown-panel { padding: 14px; grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
    .story-breakdown-icon { width: 42px; height: 42px; border-radius: 13px; }
    .workbench-stage-actions { position: sticky; z-index: 8; bottom: 0; margin: 22px -2px 0; padding: 11px 0 calc(5px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 74%, rgba(248,244,250,0)); }
    .workbench-stage-actions .primary-button { width: 100%; }
    .frames-next-actions { align-items: stretch; flex-direction: column; gap: 11px; padding: 13px; }
    .frames-next-actions .primary-button { width: 100%; }
    .workbench-stage-actions--story { align-items: stretch; flex-direction: column-reverse; gap: 4px; }
    .workbench-stage-actions--story .story-manual-button { width: 100%; min-height: 40px; }
    .workbench-card { padding: 15px; border-radius: 16px; }
    .workbench-card-head { align-items: flex-start; }
    .workbench-card-actions { margin: -5px -5px 0 0; flex-wrap: wrap; justify-content: flex-end; }
    .workbench-card-action { min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 10px; }
    .workbench-fields, .shot-card .workbench-fields { grid-template-columns: 1fr; gap: 13px; }
    .shot-card .workbench-field:last-child { grid-column: auto; max-width: 150px; }
    .workbench-input, .shot-duration-input { height: 48px; }
    .workbench-textarea { min-height: 96px; }
    .workbench-empty { min-height: 300px; padding: 34px 20px; }
    .shot-scene-heading { padding: 13px; align-items: flex-start; }
    .shot-scene-heading .secondary-button { min-width: 44px; min-height: 44px; padding: 0 11px; }
    .shot-scene-heading .secondary-button span { display: inline; }
    .shots-list { padding: 10px; }
    .shot-card { padding: 13px; }
    .shot-image-comparison-heading { align-items: stretch; flex-direction: column; gap: 11px; }
    .shot-image-comparison-heading h4 { font-size: 15px; }
    .shot-image-comparison-heading p { font-size: 11px; }
    .shot-image-generate-button { width: 100%; min-height: 44px; }
    .shot-image-candidates { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .shot-image-candidate { padding: 8px; }
    .shot-image-candidate-heading { min-height: 22px; margin-bottom: 6px; }
    .shot-image-candidate-status { min-height: 28px; margin-top: 6px; }
    .shot-image-choice-button { min-height: 44px; }
    .shot-image-reroll-button { width: auto; min-height: 38px; }
    .shot-image-comparison-notice { align-items: stretch; flex-direction: column; }
    .shot-image-comparison-notice .text-button { min-height: 40px; align-self: flex-start; }
    .shot-video-heading { align-items: stretch; flex-direction: column; gap: 11px; }
    .shot-video-heading h4 { font-size: 15px; }
    .shot-video-heading p { font-size: 11px; }
    .shot-video-generate-button { width: 100%; min-height: 44px; }
    .shot-video-specs-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .shot-video-specs-heading span { text-align: left; }
    .shot-video-specs-grid { grid-template-columns: 1fr; }
    .shot-video-spec-field select, .shot-video-spec-value { min-height: 44px; }
    .shot-video-prompt-label-row { align-items: flex-start; }
    .shot-video-enhance-button { min-height: 40px; }
    .shot-video-prompt-field textarea { min-height: 82px; }
    .shot-video-preview { min-height: 150px; padding: 0; flex-direction: column; }
    .shot-video-preview.has-playable-video { height: min(68svh, 520px); min-height: 250px; }
    .shot-video-preview:not(.has-playable-video) { padding: 22px; }
    .shot-video-select-button { min-height: 44px; }
    .shot-video-take-actions { flex-direction: column-reverse; }
    .shot-video-current-generate-action { padding: 13px; align-items: stretch; flex-direction: column; gap: 10px; }
    .shot-video-current-generate-action p { font-size: 10px; }
    .shot-video-current-generate-button { width: 100%; min-width: 0; min-height: 50px; }
    .shot-video-adjustment-dialog { width: calc(100vw - 12px); max-height: 94vh; border-radius: 18px; }
    .shot-video-adjustment-shell { max-height: 94vh; }
    .shot-video-adjustment-shell > header { padding: 20px 18px 15px; }
    .shot-video-adjustment-shell > header h2 { font-size: 20px; }
    .shot-video-adjustment-body { padding: 18px; }
    .shot-video-adjustment-reference-head { align-items: stretch; flex-direction: column; gap: 8px; }
    .shot-video-adjustment-add-reference { width: 100%; min-height: 40px; }
    .shot-video-adjustment-assets { grid-template-columns: 1fr; }
    .shot-video-adjustment-shell > footer { padding: 13px 18px 16px; }
    .shot-video-adjustment-shell > footer > div { flex-direction: column-reverse; }
    .shot-video-adjustment-shell > footer button { width: 100%; min-height: 44px; }
    .shot-video-notice { align-items: stretch; flex-direction: column; }
    .shot-video-notice .text-button { min-height: 40px; align-self: flex-start; }
    .final-workspace { gap: 13px; }
    .final-heading { padding: 16px; align-items: stretch; flex-direction: column; }
    .final-heading h2 { font-size: 26px; }
    .final-heading p:last-child { font-size: 11px; }
    .final-heading > .secondary-button { width: 100%; min-height: 44px; }
    .final-sequence-list { grid-template-columns: 1fr; }
    .final-video-preview.has-playable-video { height: min(62svh,480px); }
    .final-export-panel { padding: 14px; }
    .final-export-heading { align-items: stretch; flex-direction: column; }
    .final-export-heading h3 { font-size: 17px; }
    .final-export-heading > .primary-button,
    .final-export-heading > .secondary-button { width: 100%; min-height: 46px; }
    .final-export-footer { align-items: stretch; flex-direction: column; }
    .final-download-button { width: 100%; min-height: 46px; }
    .rough-cut-shell { grid-template-columns: 1fr; }
    .rough-cut-modebar { align-items: stretch; flex-direction: column; gap: 10px; }
    .rough-cut-view-switch { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .rough-cut-view-switch button { min-height: 42px; }
    .rough-cut-editor-panel { position: static; }
    .rough-cut-preview { min-height: 300px; max-height: 58svh; }
    .rough-cut-clip { width: 154px; min-width: 154px; }
    .rough-cut-field-grid { grid-template-columns: 1fr 1fr; }
    .rough-cut-audio-card { grid-template-columns: 1fr 1fr; }
    .rough-cut-audio-card strong,
    .rough-cut-audio-card .rough-cut-edit-actions { grid-column: 1/-1; }
    .rough-cut-subtitle-card { padding: 42px 11px 11px; grid-template-columns: 1fr 1fr; }
    .rough-cut-subtitle-index { top: 10px; left: 11px; }
    .rough-cut-subtitle-text { grid-column: 1/-1; }
    .rough-cut-subtitle-remove { grid-column: 1/-1; justify-self: start; }
    .rough-cut-footer { bottom: 6px; align-items: stretch; flex-direction: column; }
    .rough-cut-footer-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .rough-cut-footer-actions button,
    .rough-cut-footer-actions a { width: 100%; min-width: 0; min-height: 46px; }
    .rough-timeline-panel { padding: 12px; border-radius: 16px; }
    .rough-timeline-heading { align-items: stretch; flex-direction: column; }
    .rough-timeline-tools { display: flex; align-items: stretch; justify-content: flex-start; flex-wrap: wrap; }
    .rough-timeline-zoom { min-height: 42px; }
    .rough-timeline-zoom { width: 100%; }
    .rough-timeline-zoom input { min-width: 0; width: 100%; }
    .rough-timeline-tools .secondary-button { min-height: 42px; }
    .rough-timeline { grid-template-columns: 76px minmax(0,1fr); }
    .rough-timeline-browser { left: 76px; }
    .rough-timeline-browser-control { padding-right: 6px; padding-left: 6px; }
    .rough-timeline-label { padding: 0 7px; }
    .rough-timeline-label.is-audio span { display: none; }
    .rough-timeline-clip-body { padding-right: 5px; padding-left: 5px; }
    .rough-timeline-clip-number { width: 19px; height: 19px; }
    .rough-timeline-trim { width: 13px; opacity: .76; }
    .rough-timeline-subtitle-trim { width: 12px; opacity: .72; }
    .rough-cut-shell.rough-cut-unified { display: flex; flex-direction: column; gap: 12px; }
    .rough-cut-unified .rough-cut-program-panel { order: 1; padding: 12px; }
    .rough-cut-unified .rough-timeline-panel { order: 2; }
    .rough-cut-unified .rough-cut-inspector { order: 3; width: 100%; max-width: 100%; max-height: none; padding: 14px; align-self: stretch; overflow: visible; }
    .rough-cut-unified .rough-cut-preview { height: min(48svh,500px); min-height: 270px; max-height: none; }
    .rough-monitor-clip { max-width: 48%; }
    .rough-monitor-controls {
        min-height: 52px;
        grid-template-columns: 48px minmax(80px,1fr) auto;
        gap: 6px;
    }
    .rough-monitor-play { min-width: 44px; min-height: 44px; padding: 0 7px; font-size: 8px; }
    .rough-monitor-time { min-width: 73px; font-size: 7px; }
    .rough-cut-inspector-tabs button { min-height: 44px; }
    .rough-inspector-toolbar .secondary-button,
    .rough-inspector-card > .secondary-button { min-height: 44px; }
    .rough-subtitle-style-controls { grid-template-columns: 1fr; }
    .rough-subtitle-font-select { min-height: 44px; }
    .rough-subtitle-color-row { min-height: 44px; justify-content: space-between; }
    .rough-subtitle-swatch { width: 28px; height: 28px; flex-basis: 28px; }
    .rough-subtitle-custom-color { min-height: 40px; }
    button.rough-subtitle-canvas-handle { width: 26px; height: 26px; }
    .rough-subtitle-canvas-resize.is-nw { top: -18px; left: -18px; }
    .rough-subtitle-canvas-resize.is-ne { top: -18px; right: -18px; }
    .rough-subtitle-canvas-resize.is-se { right: -18px; bottom: -18px; }
    .rough-subtitle-canvas-resize.is-sw { bottom: -18px; left: -18px; }
    button.rough-subtitle-canvas-rotate { top: -54px; margin-left: -13px; }
    .rough-subtitle-canvas-rotate::after { top: 24px; left: 11px; height: 24px; }
    .rough-cut-unified .rough-cut-field-grid { grid-template-columns: 1fr 1fr; }
    .rough-cut-unified .rough-cut-edit-actions button { min-height: 44px; }
    .rough-cut-footer { position: static; bottom: auto; }
    .rough-cut-footer-copy { grid-template-columns: 8px minmax(0,1fr); }
    .rough-cut-footer-actions { grid-template-columns: 1fr 1fr; }
    .rough-cut-footer-actions .rough-cut-download-button { grid-column: 1/-1; }
    .rough-cut-export-preview > summary { min-height: 52px; }

    /* Keep Android's native video surface stationary while the editor moves. */
    body.workbench-open.rough-cut-mobile-workspace .app-main { overflow: hidden; }
    body.workbench-open.rough-cut-mobile-workspace .app-view--workbench {
        height: var(--rough-cut-visible-height,100svh);
        min-height: 0;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-topbar {
        position: relative;
        top: auto;
        min-height: 50px;
        padding: env(safe-area-inset-top) 10px 0;
        grid-template-columns: 40px minmax(0,1fr) 76px;
        gap: 5px;
        flex: 0 0 auto;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-back {
        width: 40px;
        min-height: 40px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-identity {
        min-width: 0;
        justify-content: center;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-identity h1 {
        width: 100%;
        margin: 0;
        font-size: 14px;
        line-height: 1.15;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-format { display: none; }
    body.workbench-open.rough-cut-mobile-workspace .workbench-save-status {
        min-height: 32px;
        padding: 0 5px;
        gap: 5px;
        font-size: 9px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-steps {
        position: relative;
        top: auto;
        min-height: 48px;
        padding: 4px 9px;
        margin-bottom: 0;
        flex: 0 0 auto;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-step {
        min-height: 38px;
        padding: 0 4px;
        gap: 4px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-step > span {
        width: 21px;
        height: 21px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-content {
        min-height: 0;
        padding: 0 2px;
        flex: 1 1 auto;
        overflow: hidden;
    }
    body.workbench-open.rough-cut-mobile-workspace #work-step-roughcut,
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-workspace,
    body.workbench-open.rough-cut-mobile-workspace #rough-cut-workspace,
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-shell.rough-cut-unified {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-workspace { gap: 0; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-workspace > .final-heading { display: none; }
    body.workbench-open.rough-cut-mobile-workspace #rough-cut-state:empty { display: none; }
    body.workbench-open.rough-cut-mobile-workspace #rough-cut-workspace { flex: 1 1 auto; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-shell.rough-cut-unified { gap: 8px; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-unified .rough-cut-program-panel {
        order: 1;
        padding: 8px;
        flex: 0 0 auto;
        border-radius: 14px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading {
        min-height: 28px;
        margin-bottom: 5px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading h3 { font-size: 13px; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading p { display: none; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-unified .rough-cut-preview {
        height: clamp(150px,24svh,230px);
        min-height: 150px;
    }
    /*
     * Xiaomi and UC may promote <video> into a native Android surface above
     * every DOM layer.  Frame-monitor mode therefore contains no video visual
     * at all: server-prepared JPEG frames are painted directly onto Canvas,
     * leaving Paiban subtitles and controls in the same composited surface.
     */
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-preview.is-frame-monitor .rough-monitor-canvas {
        display: block;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-preview.is-frame-monitor .rough-monitor-video {
        display: none !important;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-controls {
        min-height: 44px;
        margin-top: 4px;
        padding: 4px 5px;
        grid-template-columns: 44px minmax(0,1fr);
        gap: 8px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-play {
        width: 44px;
        min-width: 44px;
        min-height: 36px;
        padding: 0;
        display: grid;
        place-items: center;
        overflow: hidden;
        font-size: 0;
        border-radius: 10px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-play::before {
        content: '';
        width: 0;
        height: 0;
        margin-left: 2px;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-left: 9px solid #fff;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-play.is-playing::before {
        width: 9px;
        height: 12px;
        margin-left: 0;
        border: 0;
        background: linear-gradient(90deg,#fff 0 3px,transparent 3px 6px,#fff 6px 9px);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-play.is-loading::before {
        content: '•••';
        width: auto;
        height: auto;
        margin: 0;
        border: 0;
        color: #fff;
        font-size: 11px;
        letter-spacing: 2px;
        animation: loader-pulse 1s ease-in-out infinite;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-time {
        min-width: 0;
        justify-self: end;
        padding-right: 4px;
        font-size: 8px;
        text-align: right;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-progress { display: none; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll {
        order: 1;
        min-height: 0;
        padding: 0 2px calc(16px + env(safe-area-inset-bottom));
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
        scroll-padding-top: 12px;
        scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom) + var(--rough-cut-keyboard-inset, 0px));
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-cut-program-panel { order: 1; flex: 0 0 auto; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-timeline-panel { order: 2; flex: 0 0 auto; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-cut-inspector { order: 3; flex: 0 0 auto; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll.is-subtitle-editing > .rough-cut-inspector { order: 2; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll.is-subtitle-editing > .rough-timeline-panel { order: 3; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-cut-footer { order: 4; flex: 0 0 auto; }
    body.workbench-open.rough-cut-mobile-workspace.rough-cut-keyboard-open .rough-cut-unified .rough-cut-preview {
        height: clamp(96px,16svh,132px);
        min-height: 96px;
    }
    /* Mobile quick cut v45: shared desktop and mobile editing language. */
    body.workbench-open.rough-cut-mobile-workspace .workbench-topbar {
        position: relative;
        min-height: 42px;
        padding-top: env(safe-area-inset-top);
        grid-template-columns: 36px minmax(0,1fr) 68px;
        gap: 3px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-back {
        width: 36px;
        min-height: 36px;
        padding: 0;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-identity {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 8px);
        left: 50%;
        width: min(68vw,272px);
        min-width: 0;
        display: grid;
        justify-items: center;
        gap: 1px;
        line-height: 1;
        text-align: center;
        transform: translateX(-50%);
        pointer-events: none;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-identity h1 {
        order: 1;
        width: 100%;
        max-width: 100%;
        margin: 0;
        font-size: 12px;
        line-height: 1.05;
        text-align: center;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-format {
        order: 2;
        width: 100%;
        max-width: 100%;
        min-height: 11px;
        padding: 0;
        display: block;
        overflow: hidden;
        color: rgba(74,69,91,.54);
        border: 0;
        border-radius: 0;
        font-size: 6.5px;
        font-weight: 680;
        letter-spacing: .02em;
        line-height: 1;
        text-overflow: ellipsis;
        text-align: center;
        white-space: nowrap;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-save-status {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 7px);
        right: 8px;
        min-height: 28px;
        margin-left: 0;
        padding: 0 3px;
        font-size: 8px;
    }

    /* One compact mobile production header from story through delivery. */
    body.workbench-open .workbench-topbar {
        min-height: 50px;
        padding: env(safe-area-inset-top) 10px 0;
        grid-template-columns: 40px minmax(0,1fr) 76px;
        gap: 5px;
    }
    body.workbench-open .workbench-back {
        width: 40px;
        min-height: 40px;
    }
    body.workbench-open .workbench-identity {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 8px);
        left: 50%;
        width: min(68vw,272px);
        min-width: 0;
        display: grid;
        justify-items: center;
        gap: 1px;
        line-height: 1;
        text-align: center;
        transform: translateX(-50%);
        pointer-events: none;
    }
    body.workbench-open .workbench-identity h1 {
        order: 1;
        width: 100%;
        max-width: 100%;
        margin: 0;
        font-size: 12px;
        line-height: 1.05;
        text-align: center;
    }
    body.workbench-open .workbench-format {
        order: 2;
        width: 100%;
        max-width: 100%;
        min-height: 11px;
        padding: 0;
        display: block;
        overflow: hidden;
        color: rgba(74,69,91,.54);
        border: 0;
        border-radius: 0;
        font-size: 6.5px;
        font-weight: 680;
        letter-spacing: .02em;
        line-height: 1;
        text-overflow: ellipsis;
        text-align: center;
        white-space: nowrap;
    }
    body.workbench-open .workbench-save-status {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 7px);
        right: 8px;
        min-height: 28px;
        margin-left: 0;
        padding: 0 3px;
        gap: 5px;
        font-size: 8px;
    }
    body.workbench-open:not(.rough-cut-mobile-workspace) .workbench-steps {
        top: calc(50px + env(safe-area-inset-top));
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-editing-surface {
        display: block;
        overflow: hidden;
        flex: 0 0 auto;
        color: #fff;
        background: linear-gradient(165deg,#24202d 0%,#17151f 58%,#1d1928 100%);
        border: 1px solid rgba(178,182,223,.17);
        border-radius: 17px;
        box-shadow: 0 13px 30px rgba(30,25,45,.16);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-editing-surface > .rough-cut-program-panel,
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-editing-surface > .rough-timeline-panel {
        width: 100%;
        margin: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-editing-surface > .rough-cut-program-panel {
        padding: 8px 8px 7px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-editing-surface > .rough-timeline-panel {
        padding: 8px;
        border-top: 1px solid rgba(255,255,255,.075);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading {
        min-height: 23px;
        margin-bottom: 4px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading h3 {
        font-size: 11px;
        letter-spacing: -.015em;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-unified .rough-cut-preview,
    body.workbench-open.rough-cut-mobile-workspace.rough-cut-keyboard-open .rough-cut-unified .rough-cut-preview {
        height: clamp(300px,48svh,480px);
        min-height: 300px;
        border-radius: 11px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-monitor-controls { display: none; }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-heading {
        min-height: 0;
        margin-bottom: 7px;
        display: block;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-heading > div:first-child {
        min-width: 0;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools {
        min-width: 0;
        padding: 3px 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .secondary-button:hover:not(:disabled) {
        transform: none;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-playhead {
        width: 24px;
        margin-left: -12px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-playhead::before {
        left: 50%;
        width: 14px;
        height: 12px;
        border-radius: 3px 3px 7px 7px;
        transform: translateX(-50%);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-playhead::after {
        left: 50%;
        transform: translateX(-50%);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-playhead-time {
        top: 11px;
        left: 17px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-label.is-video,
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-video-track {
        height: 56px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools::-webkit-scrollbar { display: none; }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .secondary-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        flex: 0 0 auto;
        border-radius: 10px;
        font-size: 8px;
        font-weight: 780;
        line-height: 1.08;
        text-align: center;
        white-space: pre-line;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .rough-timeline-play-toggle {
        position: relative;
        width: 42px;
        min-width: 42px;
        padding: 0;
        display: grid;
        place-items: center;
        overflow: hidden;
        color: transparent;
        background: linear-gradient(145deg,var(--deep-blue),#6876bf);
        border-color: rgba(178,182,223,.42);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-play-toggle::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        margin: 0;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        border-left: 8px solid #fff;
        transform: translate(-42%,-50%);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-play-toggle.is-playing::before {
        width: 8px;
        height: 11px;
        margin: 0;
        border: 0;
        background: linear-gradient(90deg,#fff 0 3px,transparent 3px 5px,#fff 5px 8px);
        transform: translate(-50%,-50%);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-play-toggle.is-loading::before {
        width: 13px;
        height: 13px;
        margin: 0;
        border: 2px solid rgba(255,255,255,.28);
        border-top-color: #fff;
        border-radius: 50%;
        animation: roughTimelineSpin .7s linear infinite;
        transform: translate(-50%,-50%);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-current-time {
        min-width: max-content;
        padding: 0 5px;
        color: rgba(255,255,255,.54);
        font-size: 7px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .rough-timeline-settings-trigger {
        display: grid;
        background: linear-gradient(145deg,var(--soft-pink),var(--accent-dark));
        border-color: rgba(255,255,255,.52);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .rough-timeline-delete-trigger {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        align-self: center;
        display: grid;
        place-items: center;
        padding: 0;
        color: var(--accent-dark);
        background: rgba(201,59,138,.1);
        border-color: rgba(201,59,138,.28);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-tools .rough-timeline-delete-trigger:disabled {
        color: rgba(201,59,138,.35);
        background: rgba(201,59,138,.04);
        border-color: rgba(201,59,138,.1);
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-mobile-zoom {
        width: 100%;
        min-height: 34px;
        margin-top: 6px;
        padding: 0 9px;
        display: grid;
        grid-template-columns: auto minmax(0,1fr);
        gap: 8px;
        color: rgba(255,255,255,.5);
        background: rgba(255,255,255,.045);
        border: 1px solid rgba(255,255,255,.07);
        border-radius: 9px;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-timeline-mobile-zoom input {
        width: 100%;
        min-width: 0;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-cut-editing-surface { order: 1; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-mobile-editor-scroll > .rough-cut-footer { order: 2; }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-footer-actions {
        display: flex;
        justify-content: center;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-footer-actions .rough-cut-export-button {
        width: min(260px,100%);
        min-width: 0;
    }
    .rough-cut-inspector-dialog {
        width: calc(100vw - 16px);
        max-width: 560px;
        max-height: min(82svh,760px);
        margin: auto;
        overflow: hidden;
        color: var(--ink);
        background: #fffaff;
        border: 1px solid rgba(78,91,153,.18);
        border-radius: 20px;
        box-shadow: 0 26px 80px rgba(30,25,45,.3);
    }
    .rough-cut-inspector-dialog[open] { display: flex; flex-direction: column; }
    .rough-cut-inspector-dialog-heading {
        min-height: 58px;
        padding: 10px 12px 9px 15px;
        display: grid;
        grid-template-columns: minmax(0,1fr) 44px;
        grid-template-rows: auto auto;
        align-items: center;
        flex: 0 0 auto;
        border-bottom: 1px solid rgba(78,91,153,.12);
    }
    .rough-cut-inspector-dialog-heading > div { font-size: 15px; font-weight: 820; }
    .rough-cut-inspector-dialog-heading > span {
        grid-column: 1;
        overflow: hidden;
        color: var(--muted);
        font-size: 8px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .rough-cut-inspector-close {
        grid-column: 2;
        grid-row: 1/-1;
        width: 40px;
        height: 40px;
        position: relative;
        color: var(--ink);
        background: rgba(178,182,223,.14);
        border-radius: 12px;
    }
    .rough-cut-inspector-close::before,
    .rough-cut-inspector-close::after {
        content: '';
        position: absolute;
        top: 19px;
        left: 12px;
        width: 16px;
        height: 2px;
        background: currentColor;
        border-radius: 999px;
        transform: rotate(45deg);
    }
    .rough-cut-inspector-close::after { transform: rotate(-45deg); }
    .rough-cut-inspector-dialog .rough-cut-inspector {
        width: 100%;
        max-width: none;
        max-height: calc(min(82svh,760px) - 58px);
        padding: 14px;
        overflow-x: hidden;
        overflow-y: auto;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .rough-cut-inspector-dialog .rough-cut-inspector > .rough-cut-panel-heading,
    .rough-cut-inspector-dialog .rough-inspector-context { display: none; }
    .setting-grid { grid-template-columns: 1fr; gap: 11px; }
    .setting-filters { margin-left: -2px; margin-right: -2px; }
    .setting-card { display: grid; grid-template-columns: 122px minmax(0,1fr); gap: 10px; }
    .setting-card-preview { height: 100%; min-height: 142px; aspect-ratio: auto; }
    .setting-card-body { padding: 4px 2px 2px; }
    .setting-card-actions { grid-template-columns: 1fr; }
    .frame-shot-heading, .shot-reference-strip-head { align-items: stretch; flex-direction: column; }
    .frame-shot-actions { width: 100%; }
    .frame-shot-edit-button { min-height: 44px; flex: 1; }
    .frame-shot-delete-button { min-width: 64px; min-height: 44px; }
    .frame-shot-inline-editor-footer { align-items: stretch; flex-direction: column; }
    .frame-shot-inline-actions { width: 100%; margin-left: 0; }
    .frame-shot-inline-actions .primary-button, .frame-shot-inline-actions .secondary-button { min-height: 44px; flex: 1; }
    .shot-reference-strip .secondary-button { width: 100%; min-height: 44px; }
    .shot-reference-dialog { position: fixed; inset: 0; width: calc(100vw - 20px); height: calc(100dvh - 20px); max-width: 560px; max-height: 820px; margin: auto; border: 1px solid var(--line); border-radius: 19px; }
    .shot-reference-shell { width: 100%; height: 100%; min-height: 0; max-height: 100%; }
    .shot-reference-dialog .management-heading { padding: 14px 15px 13px; }
    .shot-reference-dialog .management-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .shot-reference-body { padding: 14px 12px 20px; }
    .shot-reference-list { grid-template-columns: 1fr; }
    .shot-reference-option { min-height: 72px; }
    .shot-reference-edit { min-width: 66px; min-height: 38px; padding: 0 11px; }
    .shot-reference-footer { padding: 10px 12px calc(11px + env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column; }
    .shot-reference-footer > .text-button { min-height: 40px; }
    .shot-reference-footer > div { display: grid; grid-template-columns: .72fr 1.28fr; }
    .shot-reference-footer .primary-button, .shot-reference-footer .secondary-button { width: 100%; min-height: 46px; }
    .setting-editor-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 20px); }
    .delete-work-item-dialog { width: calc(100vw - 24px); }
    .story-generation-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 20px); border-radius: 20px; }
    .story-generation-heading { padding: 19px 17px 15px; }
    .story-generation-heading h2 { font-size: 21px; }
    .story-generation-options { padding: 13px; }
    .story-generation-option { padding: 14px; grid-template-columns: 42px minmax(0,1fr); gap: 11px; }
    .story-generation-option-mark { width: 42px; height: 42px; border-radius: 13px; }
    .story-generation-option em { grid-column: 2; }
    .storyboard-preview-dialog { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
    .storyboard-preview-shell { width: 100%; height: 100svh; min-height: 0; max-height: none; }
    .storyboard-preview-heading { padding: calc(14px + env(safe-area-inset-top)) 15px 13px; }
    .storyboard-preview-heading h2 { font-size: 19px; }
    .storyboard-preview-heading p:last-child { max-width: 76vw; }
    .storyboard-preview-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .storyboard-preview-body { padding: 14px 12px 22px; }
    .storyboard-preview-footer { min-height: 0; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column; gap: 9px; }
    .storyboard-preview-actions { display: grid; grid-template-columns: .75fr 1.25fr; }
    .storyboard-preview-actions .primary-button, .storyboard-preview-actions .secondary-button { width: 100%; min-height: 46px; }
    .storyboard-draft-summary { padding: 13px 14px; }
    .storyboard-draft-scene { border-radius: 15px; }
    .storyboard-draft-scene-heading { padding: 12px 13px; }
    .storyboard-draft-scene-fields, .storyboard-draft-shot-fields { grid-template-columns: 1fr; gap: 12px; }
    .storyboard-draft-shot-fields .storyboard-draft-field:last-child { grid-column: auto; max-width: 150px; }
    .storyboard-draft-scene-fields { padding: 13px; }
    .storyboard-draft-shots { padding: 9px; }
    .storyboard-draft-shot { padding: 12px; }
    .storyboard-draft-field .workbench-input, .storyboard-draft-field .shot-duration-input { height: 48px; }
    .storyboard-draft-field .workbench-textarea { min-height: 92px; }
    .model-audition-entry { padding: 11px 13px; grid-template-columns: 40px minmax(0,1fr) 18px; }
    .model-audition-entry-mark { width: 40px; }
    .model-audition-dialog { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
    .model-audition-shell { width: 100%; height: 100svh; min-height: 0; max-height: none; }
    .model-audition-heading { padding: calc(14px + env(safe-area-inset-top)) 15px 12px; }
    .model-audition-heading h2 { font-size: 19px; }
    .model-audition-heading p:last-child { max-width: 74vw; }
    .model-audition-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .model-audition-tabs { padding: 8px 12px; }
    .model-audition-tab { min-width: 64px; min-height: 42px; }
    .model-audition-body { padding: 14px 12px 22px; }
    .model-audition-footer { min-height: 0; padding: 10px 12px calc(11px + env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column; gap: 8px; }
    .model-audition-actions { display: grid; grid-template-columns: .75fr 1.25fr; }
    .model-audition-actions .primary-button, .model-audition-actions .secondary-button { width: 100%; min-height: 46px; }
    .model-audition-state { padding: 30px 9px; }
    .model-audition-rules { grid-template-columns: 1fr; }
    .model-audition-score-row { grid-template-columns: 1fr; gap: 7px; }
    .model-audition-score-option span { min-height: 44px; }
    .model-audition-result-metrics { grid-template-columns: repeat(3,1fr); }
    .view-heading { align-items: center; margin-bottom: 25px; }
    .view-heading h1 { font-size: 34px; }
    .view-subtitle { display: none; }
    .view-heading .primary-button { min-height: 42px; padding: 0 14px; }
    .view-heading .primary-button svg { width: 18px; height: 18px; }
    .wallet-view-heading { align-items: center; }
    .wallet-refresh-button { min-height: 40px; padding: 0 12px; }
    .wallet-refresh-button span { display: none; }
    .wallet-balance-card { min-height: 0; padding: 25px 21px; border-radius: 20px; }
    .wallet-balance-copy strong { font-size: 42px; }
    .wallet-balance-details { grid-template-columns: 1fr; }
    .wallet-balance-details div { min-height: 70px; padding: 14px; flex-direction: row; align-items: center; }
    .wallet-section { padding: 19px 16px; border-radius: 17px; }
    .wallet-section-heading { align-items: flex-start; gap: 12px; }
    .wallet-membership-grid { grid-template-columns: 1fr; }
    .wallet-membership-card { min-height: 290px; }
    .wallet-package-grid { grid-template-columns: 1fr; }
    .wallet-package-card { min-height: 190px; }
    .wallet-history-grid { gap: 14px; }
    .credit-quote-dialog { width: calc(100vw - 20px); }
    .credit-quote-card { border-radius: 19px; }
    .credit-quote-heading { padding: 20px 18px 15px; }
    .credit-quote-heading h2 { font-size: 21px; }
    .credit-quote-body { padding: 17px 18px; }
    .credit-quote-actions { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
    .credits-view-heading { align-items: center; }
    .credits-admin-badge { min-height: 34px; padding: 0 10px; font-size: 8px; }
    .credits-admin-badge svg { width: 14px; height: 14px; }
    .credits-admin-shell { margin: 0 -4px; border-radius: 17px; }
    .credits-section-nav {
        padding: 7px;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .credits-section-nav::-webkit-scrollbar { display: none; }
    .credits-section-tab { min-width: 116px; min-height: 46px; padding: 0 10px; flex: 0 0 auto; font-size: 9px; }
    .credits-section-tab svg { width: 15px; height: 15px; }
    .credits-section-content, .credits-section-panel { min-height: 430px; }
    .credits-section-panel { padding: 24px 17px; }
    .credits-panel-heading { align-items: flex-start; gap: 12px; }
    .credits-panel-heading h2 { font-size: 23px; }
    .credits-panel-heading p:last-child { font-size: 10px; }
    .credits-retry-button { min-height: 36px; padding: 0 10px; }
    .credits-retry-button span { display: none; }
    .credits-overview-state { min-height: 250px; margin-top: 18px; padding: 20px; }
    .credits-overview-state--empty, .credits-overview-state--error { min-height: 0; }
    .credits-overview-metrics { grid-template-columns: 1fr; }
    .credits-overview-metric { min-height: 96px; }
    .credits-readiness-list { grid-template-columns: 1fr; }
    .credits-panel-actions { align-items: flex-end; flex-direction: column; gap: 6px; }
    .credits-membership-list { grid-template-columns: 1fr; }
    .credits-membership-card { padding: 16px; }
    .credits-membership-economics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .credits-membership-economics-metrics .credits-membership-metric:last-child { grid-column: 1 / -1; }
    .credits-feature-placeholder { min-height: 350px; padding: 28px 18px; }
    .card-grid { grid-template-columns: 1fr; gap: 14px; }
    .production-card { min-height: 244px; }
    .app-view--assets .view-heading { align-items: flex-end; }
    .asset-toolbar { margin-top: -5px; margin-bottom: 18px; flex-direction: column; gap: 9px; }
    .asset-filter-row--primary { align-items: flex-start; }
    .asset-filter-row--primary .asset-filter-label { padding-top: 14px; }
    .asset-usage-filters { padding-bottom: 2px; }
    .asset-filter-row--secondary { flex-wrap: wrap; }
    .asset-production-filter { flex: 1 1 180px; }
    .asset-select-shell { flex: 1; }
    .asset-select-shell select { width: 100%; }
    .asset-filter-divider { display: none; }
    .asset-toolbar-note { padding-left: 30px; }
    .asset-view-toggle { align-self: flex-end; padding: 0; border-left: 0; }
    .asset-filter { padding: 0 13px; }
    .asset-collection.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .asset-card { border-radius: 15px; }
    .asset-card-body { padding: 11px; gap: 10px; }
    .asset-card-copy h2 { font-size: 11px; }
    .asset-card-copy p { font-size: 8px; }
    .asset-card-actions { gap: 5px; }
    .asset-action { min-height: 31px; padding: 0 5px; gap: 4px; font-size: 8px; }
    button.asset-action { font-size: 8px; }
    .asset-action svg { width: 13px; height: 13px; }
    .asset-collection.is-list .asset-card { min-height: 101px; grid-template-columns: 112px minmax(0, 1fr); }
    .asset-collection.is-list .asset-preview-button { min-height: 81px; }
    .asset-collection.is-list .asset-card-body { padding: 5px 5px 5px 11px; gap: 10px; }
    .asset-collection.is-list .asset-card-actions { width: 68px; flex-basis: 68px; grid-template-columns: 1fr; }
    .asset-collection.is-list .asset-action { min-height: 29px; }
    .upload-panel { margin-top: -5px; padding: 13px; }
    .upload-list { grid-template-columns: 1fr; }
    .asset-drop-overlay { position: fixed; inset: 74px 12px calc(80px + env(safe-area-inset-bottom)); min-height: 0; }
    .asset-preview-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 20px); border-radius: 18px; }
    .asset-preview-shell { max-height: calc(100svh - 22px); }
    .asset-preview-heading { padding: 16px 17px 13px; }
    .asset-preview-heading h2 { max-width: 68vw; font-size: 15px; }
    .asset-preview-stage { min-height: 220px; }
    .asset-preview-large { max-height: calc(100svh - 190px); }
    .asset-preview-footer { padding: 11px 14px 14px; align-items: stretch; flex-direction: column; gap: 9px; }
    .asset-preview-footer > span { text-align: center; }
    .asset-preview-footer > div { display: grid; grid-template-columns: .7fr 1.3fr; }
    .asset-preview-footer > div.is-download-only { grid-template-columns: 1fr; }
    .asset-preview-footer .primary-button, .asset-preview-footer .secondary-button { width: 100%; }
    .coming-soon { min-height: calc(100svh - 220px); }
    .toast-region { right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); }
    .mobile-account-dialog[open] {
        width: calc(100vw - 28px);
        max-width: 370px;
        padding: 0;
        display: block;
        overflow: hidden;
        color: var(--ink);
        background: linear-gradient(165deg,rgba(255,252,255,.99),rgba(248,246,252,.99));
        border: 1px solid rgba(78,91,153,.12);
        border-radius: 25px;
        box-shadow: 0 24px 70px rgba(30,25,45,.24);
    }
    .mobile-account-dialog::backdrop { background: rgba(30,25,45,.58); backdrop-filter: blur(7px); }
    .mobile-account-card { padding: 22px 18px 15px; display: flex; flex-direction: column; align-items: stretch; text-align: left; }
    .mobile-account-profile { padding: 2px 4px 20px; display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 13px; }
    .mobile-account-profile .user-avatar { width: 52px; height: 52px; margin: 0; flex-basis: 52px; border-radius: 16px; box-shadow: 0 9px 24px rgba(78,91,153,.2); font-size: 17px; }
    .mobile-account-identity { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
    .mobile-account-identity strong { overflow: hidden; font-size: 17px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-account-identity span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-account-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 9px; }
    .mobile-account-action {
        width: 100%;
        min-height: 64px;
        padding: 9px 11px;
        display: grid;
        grid-template-columns: 38px minmax(0,1fr) 17px;
        align-items: center;
        gap: 11px;
        color: var(--ink-soft);
        background: rgba(255,255,255,.78);
        border: 1px solid rgba(78,91,153,.105);
        border-radius: 16px;
        box-shadow: 0 7px 20px rgba(64,57,92,.045);
        text-align: left;
        transition: transform .16s var(--ease),border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
    }
    .mobile-account-action:active { transform: scale(.985); }
    .mobile-account-action:focus-visible { outline: 0; border-color: rgba(78,91,153,.24); background: rgba(255,255,255,.96); box-shadow: 0 7px 20px rgba(64,57,92,.065); }
    .mobile-account-action-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(78,91,153,.09); border-radius: 12px; }
    .mobile-account-action-icon svg { width: 19px; height: 19px; stroke-width: 1.9; }
    .mobile-account-action-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
    .mobile-account-action-copy strong { font-size: 12px; line-height: 1.15; }
    .mobile-account-action-copy small { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-account-action-arrow { width: 16px; height: 16px; color: rgba(64,57,92,.32); stroke-width: 2; }
    .mobile-account-action.is-password .mobile-account-action-icon { color: #76508e; background: rgba(118,80,142,.09); }
    .mobile-account-action.is-admin .mobile-account-action-icon { color: var(--success); background: rgba(39,137,108,.09); }
    .mobile-account-action.is-danger { color: var(--danger); background: rgba(255,249,252,.82); border-color: rgba(165,54,90,.1); }
    .mobile-account-action.is-danger .mobile-account-action-icon { color: var(--danger); background: rgba(165,54,90,.075); }
    .mobile-account-action.is-danger .mobile-account-action-copy small { color: rgba(165,54,90,.56); }
    .mobile-account-card .mobile-account-close { min-height: 40px; margin: 11px auto 0; padding: 7px 18px; color: var(--muted); font-size: 11px; }
    .management-dialog { width: calc(100vw - 20px); max-height: calc(100svh - 20px); border-radius: 19px; }
    .management-shell { max-height: calc(100svh - 22px); }
    .management-heading { padding: 20px 18px 16px; }
    .management-heading h2 { font-size: 22px; }
    .management-heading p:last-child { max-width: 260px; }
    .management-toolbar { padding: 14px 18px; }
    .member-create-panel { margin: 0 18px 13px; padding: 15px; overflow: auto; }
    .member-form-grid { grid-template-columns: 1fr; }
    .members-loading, .members-message, .members-list { margin-left: 18px; margin-right: 18px; }
    .member-row { grid-template-columns: 38px minmax(0, 1fr); padding: 13px; }
    .member-avatar { width: 38px; height: 38px; }
    .member-actions { grid-column: 1 / -1; padding-left: 50px; }
    .member-inline-panel { align-items: stretch; flex-wrap: wrap; }
    .member-inline-panel .field, .member-inline-copy { flex: 1 0 100%; }
    .management-footer { padding: 13px 18px 16px; }
    .management-footer p { display: none; }
    .management-footer .secondary-button { width: 100%; }
    .setting-reference-picker-dialog { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
    .setting-reference-picker-shell { width: 100%; height: 100svh; min-height: 0; max-height: none; }
    .setting-reference-picker-heading { padding: calc(14px + env(safe-area-inset-top)) 15px 13px; }
    .setting-reference-picker-heading h2 { font-size: 19px; }
    .setting-reference-picker-heading p:last-child { max-width: 76vw; }
    .setting-reference-picker-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .setting-reference-picker-body { padding: 13px 12px 20px; }
    .setting-reference-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .setting-reference-picker-state { min-height: 55vh; }
    .setting-reference-picker-footer { padding: 10px 12px calc(11px + env(safe-area-inset-bottom)); }
    .setting-reference-picker-footer > div { width: 100%; display: grid; grid-template-columns: 1.18fr .82fr; }
    .setting-reference-picker-footer .primary-button, .setting-reference-picker-footer .secondary-button { width: 100%; min-height: 46px; }
    .setting-generation-dialog { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
    .setting-generation-shell { width: 100%; height: 100svh; min-height: 0; max-height: none; }
    .setting-generation-heading { padding: calc(14px + env(safe-area-inset-top)) 15px 13px; }
    .setting-generation-heading h2 { font-size: 19px; }
    .setting-generation-heading p:last-child { max-width: 76vw; }
    .setting-generation-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .setting-generation-body { padding: 13px 12px 20px; }
    .setting-generation-state { min-height: 55vh; }
    .setting-generation-setup { grid-template-columns: 1fr; gap: 11px; }
    .setting-generation-current { grid-column: 1; grid-template-columns: 1fr; }
    .setting-generation-current-preview { min-height: 220px; }
    .setting-generation-current-copy { padding: 5px 3px 4px; }
    .setting-generation-prompt-field, .setting-generation-reference-section, .setting-generation-controls { grid-column: 1; grid-row: auto; }
    .setting-generation-prompt-field textarea { min-height: 170px; }
    .setting-generation-controls { grid-template-columns: 1fr; gap: 14px; }
    .setting-generation-count { width: 100%; min-width: 0; }
    .setting-generation-count-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .setting-generation-reference-actions .secondary-button { min-height: 44px; }
    .setting-generation-candidates, .setting-generation-candidates[data-count="2"], .setting-generation-candidates[data-count="3"] { grid-template-columns: 1fr; }
    .setting-generation-candidates[data-count="1"] { max-width: none; }
    .setting-generation-results-heading { align-items: stretch; flex-direction: column; }
    .setting-generation-results-actions { justify-content: flex-start; }
    .setting-generation-progress { align-self: flex-start; }
    .setting-generation-history-heading { flex-direction: column; }
    .setting-generation-history-heading > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .setting-generation-history-heading .secondary-button { width: 100%; min-height: 42px; }
    .setting-generation-history-button { grid-template-columns: minmax(0,1fr) 18px; }
    .setting-generation-history-badges { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .setting-generation-history-arrow { grid-column: 2; grid-row: 1; }
    .setting-generation-candidate-actions .primary-button, .setting-generation-candidate-actions .secondary-button { min-height: 44px; }
    .setting-generation-footer { padding: 10px 12px calc(11px + env(safe-area-inset-bottom)); }
    .setting-generation-footer > div { width: 100%; display: grid; grid-template-columns: .8fr 1.2fr; }
    .setting-generation-footer .primary-button, .setting-generation-footer .secondary-button { width: 100%; min-height: 46px; }
}

@keyframes roughTimelineSpin {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to { transform: translate(-50%,-50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell::before,
    .auth-motion::before,
    .auth-motion-frame,
    .auth-motion-scan,
    .auth-motion-node { animation: none !important; }
}

@media (max-width: 420px) {
    .auth-pitch br { display: none; }
    .auth-card-heading h2 { font-size: 26px; }
    .view-heading .primary-button span { display: none; }
    .view-heading .primary-button { width: 42px; padding: 0; border-radius: 50%; }
    .workbench-stage .primary-button span { display: inline; }
    .workbench-stage-heading--with-action .primary-button span { display: none; }
    .workbench-stage-heading--with-action .primary-button { width: 42px; padding: 0; border-radius: 50%; }
    .workbench-save-status { max-width: 103px; }
    .workbench-save-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .workbench-stage-heading h2 { font-size: 28px; }
    .workbench-step strong { font-size: 10px; }
    .workbench-card-number { font-size: 11px; }
    .workbench-card-actions { width: 100%; margin-top: 7px; }
    .workbench-card-head { flex-wrap: wrap; }
    .shot-scene-title h3 { max-width: 178px; }
    .dialog-heading, .dialog-body { padding-left: 19px; padding-right: 19px; }
    .dialog-actions { padding-left: 19px; padding-right: 19px; }
    .creation-mode-picker { grid-template-columns: 1fr; }
    .creation-mode-picker label > span { min-height: 58px; }
    .work-source-panel { align-items: stretch; flex-direction: column; }
    .work-source-panel .secondary-button { width: 100%; }
    .asset-toolbar { padding: 9px; }
    .asset-filter-row { gap: 5px; }
    .asset-filter { padding: 0 10px; }
    .asset-filter--secondary { padding: 0 9px; }
    .asset-toolbar-note { padding-left: 27px; }
    .asset-kind-badge { bottom: 7px; left: 7px; }
    .asset-duration { right: 7px; bottom: 7px; }
    .asset-preview-fallback { width: 42px; height: 42px; border-radius: 13px; }
    .setting-reference-picker-list { grid-template-columns: 1fr; }
    .setting-reference-asset-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; }
    .setting-reference-asset-preview { grid-row: 1 / 3; height: 112px; aspect-ratio: auto; }
    .setting-reference-asset-copy { padding: 8px 2px 3px; align-self: end; }
    .setting-reference-asset-action { min-height: 38px; align-self: start; }
    .setting-card { grid-template-columns: 104px minmax(0,1fr); }
    .setting-card-actions.is-generation-needed { grid-template-columns: 1fr; }
    .setting-generation-reference-actions { grid-template-columns: 1fr; }
    .setting-generation-reference-selected { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Final mobile workbench geometry: identical across story, settings, frames, rough cut and delivery. */
@media (max-width: 760px) {
    body.workbench-open .workbench-topbar {
        position: sticky;
        top: 0;
        box-sizing: border-box;
        height: calc(42px + env(safe-area-inset-top));
        min-height: calc(42px + env(safe-area-inset-top));
        max-height: calc(42px + env(safe-area-inset-top));
        margin: 0 -14px;
        padding: env(safe-area-inset-top) 10px 0;
        grid-template-columns: 36px minmax(0,1fr) 70px;
        gap: 5px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-topbar {
        position: relative;
        top: auto;
        flex: 0 0 calc(42px + env(safe-area-inset-top));
    }
    body.workbench-open .workbench-back {
        width: 36px;
        min-height: 36px;
    }
    body.workbench-open .workbench-identity {
        top: calc(env(safe-area-inset-top) + 5px);
        left: 50%;
        width: min(68vw,272px);
        transform: translateX(-50%);
    }
    body.workbench-open .workbench-identity h1 {
        margin: 0;
        font-size: 12px;
        line-height: 1.05;
    }
    body.workbench-open .workbench-format {
        min-height: 11px;
        padding: 0;
        font-size: 6.5px;
        line-height: 1;
    }
    body.workbench-open .workbench-save-status {
        top: calc(env(safe-area-inset-top) + 4px);
        right: 10px;
        min-height: 26px;
        padding: 0 3px;
        font-size: 8px;
    }
    body.workbench-open .workbench-steps {
        top: calc(42px + env(safe-area-inset-top));
        box-sizing: border-box;
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        margin: 0 -14px;
        padding: 3px 9px;
    }
    body.workbench-open.rough-cut-mobile-workspace .workbench-steps {
        position: relative;
        top: auto;
        flex: 0 0 44px;
    }
    body.workbench-open .workbench-step {
        box-sizing: border-box;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        padding: 0 4px;
        gap: 4px;
    }
    body.workbench-open .workbench-step > span {
        width: 19px;
        height: 19px;
    }
    body.workbench-open .workbench-step.is-active.is-complete > span {
        font-size: 10px;
    }
    body.workbench-open .workbench-step.is-active.is-complete > span::before {
        display: none;
    }
    body.workbench-open:not(.rough-cut-mobile-workspace) .workbench-steps {
        margin-bottom: 0;
    }
    body.workbench-open:not(.rough-cut-mobile-workspace) .workbench-content {
        padding-top: 12px;
    }
    body.workbench-open #work-step-settings > .workbench-stage-heading--with-action {
        position: relative;
        padding-right: 52px;
    }
    body.workbench-open #work-step-settings > .workbench-stage-heading--with-action > div {
        min-width: 0;
    }
    body.workbench-open #work-step-settings > .workbench-stage-heading--with-action > .primary-button {
        position: absolute;
        z-index: 1;
        top: 18px;
        right: 0;
    }
    body.workbench-open.rough-cut-mobile-workspace .rough-cut-program-panel .rough-cut-panel-heading p.rough-cut-preview-eyebrow {
        margin: 0 0 3px;
        display: block;
        color: #ef5ba7;
        font-size: 8px;
        line-height: 1;
    }
    body.workbench-open .workbench-stage-heading h2,
    body.workbench-open .final-heading h2 {
        font-size: 28px;
        line-height: 1.12;
        letter-spacing: -.04em;
    }
}

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