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

:root {
    --ink: #1e192d;
    --ink-soft: #352e46;
    --deep-blue: #4e5b99;
    --deep-blue-dark: #3e487c;
    --mist-blue: #b2b6df;
    --brand-pink: #e84fb7;
    --neon-pink: var(--brand-pink);
    --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;
    --credit-gradient: linear-gradient(132deg, var(--deep-blue) 0 24%, #6574c4 42%, #c93b8a 58%, #e16ad9 100%);
    --credit-gradient-hover: linear-gradient(132deg, #43508c 0 22%, #6b68b7 42%, #c93b8a 58%, #e16ad9 100%);
    --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); }

/* Paid AI actions share one unmistakable visual language. */
.credit-action-button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background: var(--credit-gradient);
    border-color: rgba(255,255,255,.34);
    box-shadow: 0 9px 22px rgba(78,91,153,.22), 0 4px 18px rgba(201,59,138,.18);
}
.credit-action-button:hover:not(:disabled) {
    color: #fff;
    background: var(--credit-gradient-hover);
    border-color: rgba(255,255,255,.44);
    filter: saturate(1.08);
    box-shadow: 0 12px 28px rgba(78,91,153,.26), 0 5px 22px rgba(201,59,138,.24);
}
.credit-action-button:focus-visible { outline: 3px solid rgba(225,106,217,.28); outline-offset: 2px; }
.credit-action-button:disabled { color: rgba(255,255,255,.76); filter: saturate(.7); opacity: .68; }
.credit-action-button span,
.credit-action-button strong,
.credit-action-button small,
.credit-action-button em { color: inherit; }
.shot-image-candidate-preview.is-retry.credit-action-button { color: #fff; }
.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-generation-eta {
    position: absolute;
    z-index: 7;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(240,237,249,.72);
    font-size: 9px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: .045em;
    text-shadow: 0 1px 12px rgba(7,6,14,.48);
}
.ai-generation-eta::before {
    content: '';
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 0 0 0 4px rgba(225,106,217,.08), 0 0 12px rgba(225,106,217,.62);
}
.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; }
}

/* Unified Director shot cards -------------------------------------------------
   One horizontal card per shot.  The existing generation receipts and panels
   stay intact; this layer gives all three generation paths one visual grammar. */
.frame-carousel-shell { position: relative; margin: 0 -18px; }
.continuous-shot-list--frames {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 18px 24px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.continuous-shot-list--frames::-webkit-scrollbar { display: none; }
.continuous-shot-list--frames > .frame-shot-card {
    flex: 0 0 calc(100% - 1px);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.frame-carousel-arrow {
    position: absolute;
    z-index: 7;
    top: min(42vh, 410px);
    width: 42px;
    height: 58px;
    display: grid;
    place-items: center;
    color: #e7e9ff;
    background: rgba(30,25,45,.88);
    border: 1px solid rgba(178,182,223,.32);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(30,25,45,.2);
    backdrop-filter: blur(14px);
    font: inherit;
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s var(--ease), opacity .18s ease, background .18s ease;
}
.frame-carousel-arrow:hover:not(:disabled) { transform: translateY(-2px); background: #30283b; }
.frame-carousel-arrow:disabled { opacity: .18; cursor: default; }
.frame-carousel-arrow.is-previous { left: -3px; transform: translateX(-50%); }
.frame-carousel-arrow.is-previous:hover:not(:disabled) { transform: translateX(-50%) translateY(-2px); }
.frame-carousel-arrow.is-next { right: -3px; transform: translateX(50%); }
.frame-carousel-arrow.is-next:hover:not(:disabled) { transform: translateX(50%) translateY(-2px); }
.frame-carousel-add {
    position: absolute;
    z-index: 6;
    right: 20px;
    bottom: 34px;
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #d9dcff;
    background: rgba(30,25,45,.88);
    border: 1px solid rgba(178,182,223,.28);
    border-radius: 999px;
    font: inherit;
    font-size: 10px;
    font-weight: 720;
    cursor: pointer;
    backdrop-filter: blur(12px);
}
.frame-carousel-add > span:first-child { font-size: 17px; line-height: 1; }
.frame-status-cell.is-current {
    color: #fff;
    background: linear-gradient(145deg, #4e5b99, #c93b8a);
    border-color: rgba(225,106,217,.45);
    box-shadow: 0 0 0 3px rgba(225,106,217,.13);
}

.frame-shot-card {
    --shot-dark: #211b2a;
    --shot-panel: #292230;
    --shot-panel-raised: #302838;
    --shot-line: #4e4558;
    --shot-copy: #f7f2fa;
    --shot-muted: #beb5c6;
    padding: 0;
    overflow: hidden;
    color: var(--shot-copy);
    background:
        radial-gradient(circle at 94% 7%, rgba(225,106,217,.09), transparent 25%),
        linear-gradient(145deg, #211b2a, #241d2d 66%, #1e192d);
    border: 1px solid rgba(178,182,223,.26);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(30,25,45,.17);
}
.frame-shot-card.is-targeted,
.frame-shot-card.is-current { border-color: rgba(178,182,223,.48); }
.frame-shot-heading { margin: 0; padding: 20px 22px 15px; border-bottom: 0; }
.frame-shot-copy strong { color: var(--shot-copy); font-size: 18px; font-weight: 650; }
.frame-shot-copy::before {
    content: '导演镜头';
    display: block;
    margin-bottom: 6px;
    color: #ef82c5;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .08em;
}
.frame-shot-copy > p { display: none; }
.frame-shot-actions .secondary-button,
.frame-shot-actions .text-button {
    color: #d9dcff;
    background: rgba(178,182,223,.08);
    border-color: rgba(178,182,223,.18);
}
.frame-shot-inline-editor { width: 100%; }
.frame-shot-inline-field > span,
.frame-shot-inline-hint { color: var(--shot-muted); }
.frame-shot-inline-field .workbench-input,
.frame-shot-inline-field .workbench-textarea {
    color: var(--shot-copy);
    background: var(--shot-panel);
    border-color: var(--shot-line);
}
.shot-reference-strip { margin: 0 22px 15px; padding: 0; background: transparent; border: 0; }
.shot-reference-strip .shot-reference-chip,
.shot-reference-strip button,
.shot-reference-strip a {
    color: #e8eaff;
    background: var(--shot-panel-raised);
    border-color: rgba(178,182,223,.22);
    border-radius: 999px;
}
.shot-image-comparison-panel,
.shot-video-panel { margin: 0; padding: 18px 22px 22px; border-top: 1px solid var(--shot-line); }
.frame-shot-card:not(.is-storyboard-route) .shot-image-comparison-panel { display: none; }
.frame-shot-card.is-storyboard-route .shot-image-comparison-panel { display: block; }
.shot-image-comparison-heading h4,
.shot-video-heading h4,
.shot-video-specs-heading strong,
.shot-version-history-heading strong { color: var(--shot-copy); }
.shot-image-comparison-heading p,
.shot-video-heading p,
.shot-video-specs-heading span,
.shot-video-specs > small,
.shot-video-prompt-field > small { color: var(--shot-muted); }
.shot-image-generation-field,
.shot-video-spec-field > span { color: var(--shot-muted); }
.shot-image-generation-field select,
.shot-video-spec-field select,
.shot-video-spec-value,
.shot-video-model-select {
    color: var(--shot-copy);
    background: var(--shot-panel-raised);
    border-color: var(--shot-line);
}
.shot-image-candidate,
.shot-version-history,
.shot-version-history-group,
.shot-video-specs,
.shot-video-prompt-field,
.shot-video-current-generate-action,
.shot-video-take {
    color: var(--shot-copy);
    background: var(--shot-panel);
    border-color: var(--shot-line);
}
.shot-image-candidate-heading strong,
.shot-image-candidate-status,
.shot-version-history-meta strong,
.shot-version-history-heading span,
.shot-video-current-generate-action p { color: var(--shot-muted); }
.shot-version-history-toggle {
    color: var(--shot-copy);
    background: linear-gradient(135deg, rgba(78,91,153,.19), rgba(225,106,217,.08));
    border-color: rgba(178,182,223,.2);
    box-shadow: none;
}
.shot-version-history-toggle-copy strong { color: var(--shot-copy); }
.shot-version-history-toggle-copy small { color: var(--shot-muted); }
.shot-version-history-icon { color: #d9dcff; background: rgba(78,91,153,.25); border-color: rgba(178,182,223,.2); }

.shot-video-reference-mode { margin-top: 14px; padding: 0; border: 0; }
.shot-video-reference-mode legend { margin-bottom: 9px; color: var(--shot-copy); font-size: 12px; font-weight: 760; }
.shot-video-reference-mode-options { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.shot-video-reference-option {
    min-height: 86px;
    align-items: flex-start;
    padding: 12px;
    color: var(--shot-copy);
    background: var(--shot-panel);
    border-color: var(--shot-line);
    border-radius: 13px;
}
.shot-video-reference-option.is-selected {
    background: #31354d;
    border-color: #b2b6df;
    box-shadow: inset 0 0 0 1px #b2b6df;
}
.shot-video-reference-option strong { color: var(--shot-copy); font-size: 12px; }
.shot-video-reference-option small { color: var(--shot-muted); font-size: 10px; line-height: 1.45; }
.shot-video-continuity {
    color: var(--shot-copy);
    background: var(--shot-panel-raised);
    border-color: var(--shot-line);
}
.shot-video-continuity-copy strong { color: var(--shot-copy); }
.shot-video-continuity-copy small { color: var(--shot-muted); }
.shot-video-prompt-field { margin-top: 14px; padding: 0; overflow: hidden; border: 1px solid #626a9d; border-radius: 16px; }
.shot-video-prompt-label-row { padding: 11px 13px 7px; }
.shot-video-prompt-label-row > span { color: var(--shot-copy); font-size: 13px; }
.shot-video-prompt-label-row > span::after {
    content: '分镜与视频共用，生成时自动适配';
    margin-left: 8px;
    color: var(--shot-muted);
    font-size: 10px;
    font-weight: 500;
}
.shot-video-enhance-button {
    min-height: 36px;
    padding: 0 12px;
    color: #d8dcff;
    background: rgba(78,91,153,.16);
    border: 1px solid rgba(178,182,223,.38);
    border-radius: 11px;
    font-weight: 720;
}
.shot-video-enhance-button::before { content: '✦'; margin-right: 6px; color: #eff0ff; }
.shot-video-prompt-input-shell { margin: 0 12px; }
.shot-video-prompt-field textarea {
    min-height: 120px;
    color: var(--shot-copy);
    caret-color: #fff;
    background: transparent;
    border-color: transparent;
    line-height: 1.72;
}
.shot-video-prompt-field > small { display: block; padding: 9px 13px 11px; border-top: 1px solid var(--shot-line); }
.shot-video-binding-feedback { padding: 0 13px 9px; }

.shot-keyframes-route {
    margin-top: 12px;
    padding: 14px;
    background: var(--shot-panel);
    border: 1px solid var(--shot-line);
    border-radius: 15px;
}
.shot-keyframes-route-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shot-keyframes-route-heading strong { display: block; color: var(--shot-copy); font-size: 12px; }
.shot-keyframes-route-heading small { display: block; margin-top: 4px; color: var(--shot-muted); font-size: 10px; }
.shot-keyframes-shared { display: flex; gap: 7px; }
.shot-keyframes-shared select {
    min-height: 38px;
    padding: 0 30px 0 10px;
    color: var(--shot-copy);
    background: var(--shot-panel-raised);
    border: 1px solid var(--shot-line);
    border-radius: 10px;
    font: inherit;
    font-size: 10px;
}
.shot-keyframe-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.shot-keyframe-card { min-width: 0; padding: 11px; background: #241e2c; border: 1px solid var(--shot-line); border-radius: 13px; }
.shot-keyframe-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.shot-keyframe-card-head strong { color: var(--shot-copy); font-size: 11px; }
.shot-keyframe-history-button { display: inline-flex; align-items: center; gap: 4px; padding: 3px; color: #cbd0fb; background: transparent; border: 0; font: inherit; font-size: 9px; cursor: pointer; }
.shot-keyframe-history-button:disabled { opacity: .38; cursor: default; }
.shot-keyframe-card > textarea,
.shot-keyframe-transition textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 10px;
    color: var(--shot-copy);
    background: var(--shot-panel-raised);
    border: 1px solid var(--shot-line);
    border-radius: 10px;
    font: inherit;
    font-size: 11px;
    line-height: 1.6;
}
.shot-keyframe-card > textarea::placeholder {
    color: rgba(183,176,195,.48);
    opacity: 1;
}
.shot-keyframe-generate-button {
    width: 100%;
    min-height: 39px;
    margin-top: 8px;
    color: #e8eaff;
    background: #34384f;
    border: 1px solid rgba(178,182,223,.38);
    border-radius: 10px;
    font: inherit;
    font-size: 10px;
    font-weight: 720;
    cursor: pointer;
}
.shot-keyframe-generate-button:disabled { opacity: .48; cursor: default; }
.shot-keyframe-candidates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 9px; }
.shot-keyframe-candidate { min-width: 0; overflow: hidden; padding: 4px; color: var(--shot-copy); background: var(--shot-panel-raised); border: 1px solid var(--shot-line); border-radius: 9px; font: inherit; cursor: pointer; }
.shot-keyframe-candidate.is-selected { border-color: #b2b6df; box-shadow: inset 0 0 0 2px rgba(178,182,223,.5); }
.shot-keyframe-candidate img { width: 100%; aspect-ratio: 16/10; display: block; object-fit: cover; border-radius: 6px; }
.shot-keyframe-candidate > span { min-height: 80px; display: grid; place-items: center; color: var(--shot-muted); font-size: 9px; }
.shot-keyframe-candidate small { display: block; padding: 5px 3px 2px; color: var(--shot-muted); font-size: 8px; }
.shot-keyframe-automatic { min-height: 138px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--shot-copy); background: var(--shot-panel-raised); border-radius: 10px; text-align: left; }
.shot-keyframe-automatic > span { width: 38px; height: 38px; display: grid; place-items: center; color: #d8dcff; background: #393d59; border-radius: 10px; }
.shot-keyframe-automatic strong { display: block; font-size: 10px; }
.shot-keyframe-automatic small { display: block; margin-top: 3px; color: var(--shot-muted); font-size: 9px; }
.shot-keyframe-history { margin-top: 8px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; color: var(--shot-muted); font-size: 9px; }
.shot-keyframe-history-item { overflow: hidden; padding: 3px; color: var(--shot-copy); background: var(--shot-panel-raised); border: 1px solid var(--shot-line); border-radius: 8px; font: inherit; cursor: pointer; }
.shot-keyframe-history-item img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 5px; }
.shot-keyframe-history-item span { display: block; padding: 4px 2px 2px; font-size: 8px; }
.shot-keyframe-error { margin: 8px 0 0; color: #f3a4c7; font-size: 9px; line-height: 1.5; }
.shot-keyframe-transition { display: grid; gap: 5px; margin-top: 12px; padding: 11px; background: #263a34; border: 1px solid #476257; border-radius: 12px; }
.shot-keyframe-transition strong { color: #a6dbc7; font-size: 11px; }
.shot-keyframe-transition small { color: var(--shot-muted); font-size: 9px; }
.shot-keyframe-transition textarea { min-height: 72px; background: #29322f; border-color: #476257; }

@media (max-width: 720px) {
    .frame-carousel-shell { margin: 0 -2px; }
    .continuous-shot-list--frames { gap: 10px; padding: 2px 2px 18px; touch-action: pan-x pan-y; }
    .frame-carousel-arrow { display: none; }
    .frame-carousel-add { right: 12px; bottom: 27px; min-height: 36px; }
    .frame-shot-card { border-radius: 18px; }
    .frame-shot-heading { padding: 17px 15px 12px; }
    .shot-reference-strip { margin: 0 15px 13px; }
    .shot-image-comparison-panel,
    .shot-video-panel { padding: 15px; }
    .shot-video-reference-mode-options { grid-template-columns: 1fr; }
    .shot-video-reference-option { min-height: 72px; }
    .shot-keyframes-route-heading { flex-direction: column; }
    .shot-keyframes-shared { width: 100%; display: grid; grid-template-columns: 1fr 84px; }
    .shot-keyframes-shared select { width: 100%; }
    .shot-keyframe-cards { grid-template-columns: 1fr; }
    .shot-video-prompt-label-row > span::after { display: block; margin: 4px 0 0; }
    .shot-video-enhance-button { min-height: 42px; }
}

/* Director shot cards v162 ---------------------------------------------------
   Strictly align the production surface with the approved unified-shot-card
   study.  This block intentionally sits after every legacy frame rule so the
   shot card reads as one coherent dark workspace instead of a dark wrapper
   around pale legacy panels. */
body.workbench-open .app-main { overflow-x: hidden; }
body.workbench-open {
    --director-bg: #211b2a;
    --director-panel: #292230;
    --director-raised: #302838;
    --director-line: #4e4558;
    --director-line-strong: #626a9d;
    --director-copy: #f7f2fa;
    --director-muted: #beb5c6;
}
body.workbench-open .workbench-stage--frames .workbench-stage-heading {
    margin-bottom: 13px;
}
body.workbench-open .workbench-stage--frames .workbench-stage-heading h2 {
    max-width: 760px;
    font-size: clamp(30px, 3.1vw, 44px);
    line-height: 1.06;
    letter-spacing: -.045em;
}
body.workbench-open .frame-status-overview {
    margin: 0 0 18px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: 14px;
    color: var(--director-copy);
    background:
        radial-gradient(circle at 94% 7%, rgba(225,106,217,.09), transparent 25%),
        linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border: 1px solid rgba(178,182,223,.26);
    border-radius: 15px;
    box-shadow: 0 14px 36px rgba(30,25,45,.14);
}
body.workbench-open .frame-status-overview::before { display: none; }
body.workbench-open .frame-status-heading-copy > span { color: #ff8dce; font-size: 8px; }
body.workbench-open .frame-status-heading-copy > strong { color: var(--director-copy); font-size: 12px; }
body.workbench-open .frame-status-total {
    color: #d8dcff;
    background: rgba(143,160,255,.13);
    border-color: rgba(178,182,223,.24);
}
body.workbench-open .frame-status-total small { color: var(--director-muted); }
body.workbench-open .frame-status-grid {
    width: 100%;
    min-height: 44px;
    margin-top: 0;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 3px;
    background: rgba(13,10,18,.28);
    border-color: rgba(178,182,223,.13);
    border-radius: 10px;
}
body.workbench-open .frame-status-cell {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    aspect-ratio: auto;
    border-radius: 9px;
    font-size: 8px;
}
body.workbench-open .frame-status-cell.is-pending {
    color: #7e3b68;
    background: #f6e8f1;
    border-color: rgba(201,59,138,.16);
}
body.workbench-open .frame-status-cell.is-complete {
    color: #fff;
    background: #4e5b99;
    border-color: #4e5b99;
}
body.workbench-open .frame-status-cell.is-current {
    color: #fff;
    background: linear-gradient(145deg,#4e5b99,#c93b8a);
    border-color: rgba(225,106,217,.46);
    box-shadow: 0 0 0 3px rgba(225,106,217,.12);
}

body.workbench-open .frame-carousel-shell { margin: 0; }
body.workbench-open .continuous-shot-list--frames {
    width: 100%;
    gap: 16px;
    padding: 4px 0 22px;
    overflow-x: auto;
    overflow-y: hidden;
}
body.workbench-open .continuous-shot-list--frames > .frame-shot-card {
    flex: 0 0 100%;
    width: 100%;
}
body.workbench-open .frame-carousel-arrow {
    top: min(41vh,390px);
    width: 38px;
    height: 52px;
    border-radius: 13px;
    font-size: 27px;
}
body.workbench-open .frame-carousel-arrow.is-previous { left: 1px; }
body.workbench-open .frame-carousel-arrow.is-next { right: 1px; }

body.workbench-open .frame-shot-card {
    overflow: hidden;
    color: var(--director-copy);
    background:
        radial-gradient(circle at 92% 4%,rgba(225,106,217,.10),transparent 24%),
        linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border: 1px solid rgba(178,182,223,.30);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(30,25,45,.18);
}
body.workbench-open .frame-shot-card.is-targeted,
body.workbench-open .frame-shot-card.is-current {
    color: var(--director-copy);
    background:
        radial-gradient(circle at 92% 4%,rgba(225,106,217,.10),transparent 24%),
        linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border-color: rgba(178,182,223,.52);
    box-shadow: 0 0 0 4px rgba(225,106,217,.08),0 18px 48px rgba(30,25,45,.18);
}
body.workbench-open .frame-shot-card .frame-shot-heading {
    min-height: 82px;
    padding: 19px 21px 13px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
body.workbench-open .frame-shot-copy { min-width: 0; }
body.workbench-open .frame-shot-copy::before {
    margin-bottom: 6px;
    color: #ef82c5;
    font-size: 9px;
    letter-spacing: .1em;
}
body.workbench-open .frame-shot-copy strong {
    display: block;
    overflow: hidden;
    color: var(--director-copy);
    font-size: 18px;
    font-weight: 620;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.workbench-open .frame-shot-actions {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 7px;
}
body.workbench-open .frame-shot-actions .secondary-button,
body.workbench-open .frame-shot-actions .text-button {
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 0 11px;
    color: #d9dcff;
    background: rgba(178,182,223,.075);
    border: 1px solid rgba(178,182,223,.16);
    border-radius: 10px;
    font-size: 9px;
}
body.workbench-open .frame-shot-actions .text-button { color: #c9c0cf; }

body.workbench-open .shot-reference-strip {
    margin: 0 21px 16px;
    padding: 12px 13px;
    color: var(--director-copy);
    background: #2a2333;
    border: 1px solid var(--director-line);
    border-radius: 14px;
}
body.workbench-open .shot-reference-strip.is-ready {
    background: linear-gradient(135deg,rgba(47,71,63,.72),rgba(42,35,51,.94));
    border-color: rgba(120,201,173,.25);
}
body.workbench-open .shot-reference-strip.is-blocked,
body.workbench-open .shot-reference-strip.is-outdated {
    background: linear-gradient(135deg,rgba(76,43,67,.64),rgba(42,35,51,.96));
    border-color: rgba(239,130,197,.22);
}
body.workbench-open .shot-reference-strip-head { margin: 0; }
body.workbench-open .shot-reference-strip-copy strong {
    color: var(--director-copy);
    font-size: 12px;
    font-weight: 620;
}
body.workbench-open .shot-reference-strip-copy span {
    margin-top: 3px;
    color: var(--director-muted);
    font-size: 9px;
    line-height: 1.5;
}
body.workbench-open .shot-reference-chips {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
body.workbench-open .shot-reference-chips:has(> .shot-reference-manage-chip:only-child) { margin-top: 9px; }
body.workbench-open .shot-reference-chip,
body.workbench-open .shot-reference-manage-chip {
    min-height: 32px;
    padding: 4px 9px;
    color: #e9eaff;
    background: var(--director-raised);
    border: 1px solid rgba(178,182,223,.21);
    border-radius: 999px;
    font-size: 9px;
}
body.workbench-open .shot-reference-manage-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d8dcff;
    background: rgba(78,91,153,.18);
    font-weight: 680;
}
body.workbench-open .shot-reference-manage-chip::before {
    content: '\2637';
    font-size: 11px;
}
body.workbench-open .shot-reference-chip small { color: var(--director-muted); }

body.workbench-open .frame-shot-card .shot-video-panel,
body.workbench-open .frame-shot-card .shot-image-comparison-panel {
    margin: 0;
    padding: 17px 21px 21px;
    color: var(--director-copy);
    background: transparent;
    border-top: 1px solid var(--director-line);
}
body.workbench-open .shot-video-heading {
    margin-bottom: 13px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
body.workbench-open .shot-video-heading h4 {
    color: var(--director-copy);
    font-size: 14px;
    font-weight: 620;
}
body.workbench-open .shot-video-heading p {
    max-width: 660px;
    margin-top: 4px;
    color: var(--director-muted);
    font-size: 10px;
    line-height: 1.55;
}

body.workbench-open .shot-video-prompt-field {
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--director-copy);
    background: var(--director-panel);
    border: 1px solid var(--director-line-strong);
    border-radius: 16px;
}
body.workbench-open .shot-video-prompt-label-row {
    min-height: 50px;
    padding: 10px 12px 7px 13px;
    align-items: center;
}
body.workbench-open .shot-video-prompt-label-row > span {
    color: var(--director-copy);
    font-size: 13px;
    font-weight: 620;
}
body.workbench-open .shot-video-prompt-label-row > span::after {
    content: '分镜与视频共用';
    margin-left: 7px;
    color: var(--director-muted);
    font-size: 9px;
    font-weight: 500;
}
body.workbench-open .shot-video-enhance-button {
    min-height: 38px;
    padding: 0 13px;
    color: #d8dcff;
    background: rgba(78,91,153,.15);
    border: 1px solid rgba(178,182,223,.34);
    border-radius: 11px;
    font-size: 10px;
    font-weight: 680;
}
body.workbench-open .shot-video-enhance-button::before {
    content: '\2726';
    margin-right: 6px;
    color: #f1f2ff;
}
body.workbench-open .shot-video-prompt-input-shell { margin: 0 12px; }
body.workbench-open .shot-video-prompt-field textarea,
body.workbench-open .shot-video-prompt-inline-highlight {
    min-height: 112px;
    padding: 8px 2px 11px;
    color: var(--director-copy);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.7;
}
body.workbench-open .shot-video-prompt-field textarea:focus {
    border: 0;
    outline: 0;
}
body.workbench-open .shot-video-prompt-input-shell.has-inline-bindings textarea { background: transparent; }
body.workbench-open .shot-video-prompt-input-shell::after {
    background: rgba(35,29,48,.98);
    box-shadow: 0 0 24px rgba(225,106,217,.12);
}
body.workbench-open .shot-video-prompt-field > small {
    padding: 9px 13px 10px;
    display: block;
    color: var(--director-muted);
    border-top: 1px solid var(--director-line);
    font-size: 9px;
}
body.workbench-open .shot-video-binding-feedback { padding: 0 13px 9px; }

body.workbench-open .shot-video-reference-mode { margin: 0 0 12px; }
body.workbench-open .shot-video-reference-mode legend {
    margin-bottom: 8px;
    color: var(--director-copy);
    font-size: 12px;
    font-weight: 620;
}
body.workbench-open .shot-video-reference-mode-options {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 9px;
}
body.workbench-open .shot-video-reference-option {
    min-width: 0;
    min-height: 84px;
    padding: 12px;
    align-items: flex-start;
    color: var(--director-copy);
    background: var(--director-panel);
    border: 1px solid var(--director-line);
    border-radius: 13px;
}
body.workbench-open .shot-video-reference-option input {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    accent-color: #b2b6df;
}
body.workbench-open .shot-video-reference-option strong {
    color: var(--director-copy);
    font-size: 12px;
    font-weight: 620;
}
body.workbench-open .shot-video-reference-option small {
    margin-top: 5px;
    color: var(--director-muted);
    font-size: 9px;
    line-height: 1.45;
}
body.workbench-open .shot-video-reference-option.is-selected {
    color: var(--director-copy);
    background: #31354d;
    border-color: #b2b6df;
    box-shadow: inset 0 0 0 1px #b2b6df;
}

body.workbench-open .shot-video-continuity {
    min-height: 60px;
    margin: 0 0 14px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    color: var(--director-copy);
    background: var(--director-panel);
    border: 1px solid var(--director-line);
    border-radius: 12px;
}
body.workbench-open .shot-video-continuity > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
body.workbench-open .shot-video-continuity-switch {
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    height: 24px;
    background: #554b5e;
    border-radius: 999px;
}
body.workbench-open .shot-video-continuity-switch::after {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
}
body.workbench-open .shot-video-continuity.is-on .shot-video-continuity-switch { background: #7580bd; }
body.workbench-open .shot-video-continuity.is-on .shot-video-continuity-switch::after { transform: translateX(18px); }
body.workbench-open .shot-video-continuity-copy { grid-column: 1; grid-row: 1; }
body.workbench-open .shot-video-continuity-copy strong {
    color: var(--director-copy);
    font-size: 11px;
    font-weight: 620;
}
body.workbench-open .shot-video-continuity-copy small {
    margin-top: 3px;
    color: var(--director-muted);
    font-size: 9px;
    line-height: 1.45;
}

body.workbench-open .shot-video-specs {
    margin-top: 0;
    padding: 13px;
    color: var(--director-copy);
    background: var(--director-panel);
    border: 1px solid var(--director-line);
    border-radius: 14px;
}
body.workbench-open .shot-video-specs-heading strong {
    color: var(--director-copy);
    font-size: 12px;
    font-weight: 620;
}
body.workbench-open .shot-video-specs-heading span,
body.workbench-open .shot-video-specs > small { color: var(--director-muted); }
body.workbench-open .shot-video-specs-grid { gap: 9px; }
body.workbench-open .shot-video-spec-field > span { color: var(--director-muted); }
body.workbench-open .shot-video-spec-field select,
body.workbench-open .shot-video-spec-value {
    color: var(--director-copy);
    background: var(--director-raised);
    border-color: var(--director-line);
}
body.workbench-open .shot-video-notice.is-guidance {
    color: #d8dcff;
    background: linear-gradient(135deg,rgba(78,91,153,.18),rgba(201,59,138,.08));
    border-color: rgba(178,182,223,.21);
}
body.workbench-open .shot-video-notice .text-button { color: #f0f1ff; }
body.workbench-open .shot-video-current-generate-action,
body.workbench-open .shot-version-history,
body.workbench-open .shot-video-take {
    color: var(--director-copy);
    background: var(--director-panel);
    border-color: var(--director-line);
}

@media (max-width: 720px) {
    body.workbench-open .app-view--workbench {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }
    body.workbench-open .workbench-steps { margin-bottom: 16px; }
    body.workbench-open .workbench-stage--frames .workbench-stage-heading {
        margin-bottom: 11px;
    }
    body.workbench-open .workbench-stage--frames .workbench-stage-heading h2 {
        font-size: 28px;
        line-height: 1.12;
    }
    body.workbench-open .frame-status-overview {
        margin-bottom: 14px;
        padding: 10px 11px;
        display: block;
        border-radius: 14px;
    }
    body.workbench-open .frame-status-total { min-height: 25px; }
    body.workbench-open .frame-status-grid {
        min-height: 42px;
        margin-top: 8px;
        padding: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }
    body.workbench-open .frame-status-grid::-webkit-scrollbar { display: none; }
    body.workbench-open .frame-status-cell {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
    body.workbench-open .frame-carousel-shell { width: 100%; margin: 0; }
    body.workbench-open .continuous-shot-list--frames {
        width: 100%;
        max-width: 100%;
        gap: 10px;
        padding: 3px 0 18px;
        touch-action: pan-x pan-y;
    }
    body.workbench-open .continuous-shot-list--frames > .frame-shot-card {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
    }
    body.workbench-open .frame-shot-card { border-radius: 18px; }
    body.workbench-open .frame-shot-card .frame-shot-heading {
        min-height: 0;
        padding: 16px 14px 12px;
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        gap: 12px;
    }
    body.workbench-open .frame-shot-copy strong { font-size: 16px; }
    body.workbench-open .frame-shot-actions { gap: 5px; }
    body.workbench-open .frame-shot-actions .secondary-button,
    body.workbench-open .frame-shot-actions .text-button {
        min-height: 40px;
        padding: 0 9px;
        font-size: 9px;
    }
    body.workbench-open .shot-reference-strip {
        margin: 0 14px 13px;
        padding: 11px;
        border-radius: 13px;
    }
    body.workbench-open .shot-reference-strip-copy strong { font-size: 11px; }
    body.workbench-open .shot-reference-chip,
    body.workbench-open .shot-reference-manage-chip { min-height: 36px; }
    body.workbench-open .frame-shot-card .shot-video-panel,
    body.workbench-open .frame-shot-card .shot-image-comparison-panel {
        padding: 15px 14px 16px;
    }
    body.workbench-open .shot-video-heading { margin-bottom: 12px; }
    body.workbench-open .shot-video-heading h4 { font-size: 13px; }
    body.workbench-open .shot-video-heading p { font-size: 9px; }
    body.workbench-open .shot-video-prompt-label-row {
        min-height: 52px;
        padding: 8px 8px 6px 11px;
    }
    body.workbench-open .shot-video-prompt-label-row > span { font-size: 12px; }
    body.workbench-open .shot-video-prompt-label-row > span::after {
        display: block;
        margin: 3px 0 0;
        font-size: 8px;
    }
    body.workbench-open .shot-video-enhance-button {
        min-height: 42px;
        padding: 0 10px;
        font-size: 9px;
    }
    body.workbench-open .shot-video-prompt-field textarea,
    body.workbench-open .shot-video-prompt-inline-highlight {
        min-height: 126px;
        font-size: 16px;
        line-height: 1.65;
    }
    body.workbench-open .shot-video-reference-mode-options { grid-template-columns: 1fr; }
    body.workbench-open .shot-video-reference-option {
        min-height: 70px;
        padding: 11px;
    }
    body.workbench-open .shot-video-reference-option strong { font-size: 12px; }
    body.workbench-open .shot-video-reference-option small { font-size: 9px; }
    body.workbench-open .shot-video-continuity { min-height: 66px; }
    body.workbench-open .shot-video-specs-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.workbench-open .shot-video-spec-field select,
    body.workbench-open .shot-video-spec-value {
        min-height: 44px;
        font-size: 12px;
    }
    body.workbench-open .shot-video-notice {
        align-items: stretch;
        flex-direction: column;
    }
    body.workbench-open .shot-video-notice .text-button {
        min-height: 40px;
        align-self: stretch;
        border: 1px solid rgba(178,182,223,.18);
        border-radius: 10px;
    }
    body.workbench-open .frame-carousel-add {
        position: static;
        width: max-content;
        min-height: 40px;
        margin: -4px 0 0 auto;
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .continuous-shot-list--frames { scroll-behavior: auto; }
    .frame-carousel-arrow { transition: 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-items: center;
    color: var(--muted);
    background:
        radial-gradient(circle at 50% 44%, rgba(178, 182, 223, .14), transparent 24%),
        var(--paper);
    font-size: 12px;
    font-weight: 650;
}
.app-loader__content {
    width: min(220px, 66vw);
    display: grid;
    justify-items: center;
    gap: 16px;
    opacity: 0;
    animation: app-loader-reveal .38s .32s var(--ease) forwards;
}
.app-loader__content p { margin: 0; color: var(--muted); letter-spacing: .035em; }
.brand-mark--loader {
    position: relative;
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 20px;
    animation: loader-pulse 1.7s ease-in-out infinite;
}
.brand-mark--loader::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(78, 91, 153, .12);
    border-radius: 25px;
    box-shadow: 0 12px 34px rgba(78, 91, 153, .09);
}
.brand-mark--loader img { width: 54px; height: 54px; }
.app-loader__progress {
    width: 72px;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(78, 91, 153, .12);
}
.app-loader__progress i {
    width: 44%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--deep-blue), var(--accent-dark), var(--accent));
    animation: app-loader-progress 1.35s var(--ease) infinite;
}
@keyframes app-loader-reveal { to { opacity: 1; } }
@keyframes app-loader-progress {
    0% { transform: translateX(-125%); }
    100% { transform: translateX(255%); }
}
@keyframes loader-pulse { 50% { transform: scale(.94); box-shadow: 0 6px 16px rgba(225, 106, 217, .18); } }

@media (prefers-reduced-motion: reduce) {
    .app-loader__content { opacity: 1; animation: none; }
    .brand-mark--loader, .app-loader__progress i { animation: none; }
    .app-loader__progress i { width: 100%; transform: none; opacity: .72; }
}

.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, .58);
    background: transparent;
    border: 0;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 650;
}
.install-button:hover { color: white; background: rgba(178, 182, 223, .08); }
.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; overflow: hidden; color: white; background: linear-gradient(145deg, var(--deep-blue), var(--ribbon-pink)); border-radius: 11px; font-size: 13px; font-weight: 850; }
.user-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.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: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.account-menu-user strong { font-size: 12px; }
.account-menu-identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-menu-identity > span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-identity > small { color: rgba(93,87,111,.55); font-size: 8px; }
.account-menu-avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; box-shadow: 0 7px 18px rgba(78,91,153,.18); }
.avatar-edit-wrap { position: relative; width: max-content; flex: none; }
.avatar-edit-button {
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 21px !important;
    min-width: 21px;
    height: 21px;
    min-height: 21px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg,#5968ad,#ce439d) !important;
    border: 2px solid var(--surface-strong) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 10px rgba(49,43,78,.24);
    transition: transform .16s var(--ease),box-shadow .16s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.avatar-edit-button:hover { transform: scale(1.08); box-shadow: 0 5px 13px rgba(49,43,78,.3); }
.avatar-edit-button:focus,
.avatar-edit-button:focus-visible,
.avatar-edit-button:active {
    outline: 0 !important;
    box-shadow: none !important;
}
.avatar-edit-button svg { width: 11px !important; height: 11px !important; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.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); }
.account-menu-version {
    margin: 7px 5px 1px;
    padding-top: 8px;
    display: block;
    color: rgba(93, 87, 111, .48);
    border-top: 1px solid rgba(78, 91, 153, .08);
    font-size: 8px;
    font-weight: 720;
    letter-spacing: .14em;
    text-align: center;
}

.mobile-install-button { display: none; }
.mobile-account-version {
    margin-top: 13px;
    color: rgba(93, 87, 111, .44);
    font-size: 9px;
    font-weight: 720;
    letter-spacing: .14em;
    text-align: center;
}

.install-guide-dialog[open] {
    width: min(430px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 0;
    display: block;
    overflow: auto;
    color: var(--ink);
    background: linear-gradient(155deg, rgba(255, 253, 255, .995), rgba(247, 245, 252, .995));
    border: 1px solid rgba(78, 91, 153, .13);
    border-radius: 24px;
    box-shadow: 0 28px 90px rgba(30, 25, 45, .28);
}
.install-guide-dialog::backdrop { background: rgba(30, 25, 45, .62); backdrop-filter: blur(8px); }
.install-guide-card { padding: 26px; }
.install-guide-heading { display: grid; grid-template-columns: 48px minmax(0, 1fr) 38px; align-items: start; gap: 13px; }
.install-guide-mark { width: 48px; height: 48px; display: grid; place-items: center; background: linear-gradient(145deg, var(--deep-blue), var(--ribbon-pink)); border-radius: 15px; box-shadow: 0 12px 28px rgba(78, 91, 153, .2); }
.install-guide-mark img { width: 31px; height: 31px; object-fit: contain; }
.install-guide-heading .eyebrow { margin: 1px 0 5px; font-size: 8px; }
.install-guide-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.install-guide-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.install-guide-heading .icon-button { width: 38px; height: 38px; }
.install-guide-steps { margin: 24px 0 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.install-guide-steps li { min-height: 58px; padding: 10px 13px; display: grid; grid-template-columns: 30px 28px minmax(0, 1fr); align-items: center; gap: 9px; color: var(--ink-soft); background: rgba(255, 255, 255, .76); border: 1px solid rgba(78, 91, 153, .1); border-radius: 15px; box-shadow: 0 5px 16px rgba(46, 40, 72, .035); }
.install-guide-step-number { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #5363aa, #48558f); border-radius: 10px; font-size: 10px; font-weight: 850; box-shadow: 0 6px 14px rgba(78, 91, 153, .16); }
.install-guide-step-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--deep-blue); background: rgba(78, 91, 153, .07); border-radius: 9px; }
.install-guide-step-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-guide-step-copy { margin: 0; font-size: 12px; font-weight: 720; line-height: 1.45; }
.install-guide-note { margin: 11px 3px 0; color: rgba(93, 87, 111, .62); font-size: 10px; line-height: 1.5; }
.install-guide-confirm { width: 100%; min-height: 46px; margin-top: 18px; }

.install-nudge {
    position: fixed;
    z-index: 80;
    left: 18px;
    bottom: 156px;
    width: 206px;
    padding: 13px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    color: white;
    background: linear-gradient(150deg, rgba(50, 44, 73, .985), rgba(39, 33, 58, .985));
    border: 1px solid rgba(178, 182, 223, .2);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(11, 8, 22, .28);
    animation: install-nudge-in .34s var(--ease) both;
}
.install-nudge::after { content: ''; position: absolute; left: 24px; bottom: -6px; width: 11px; height: 11px; background: #2a243e; border-right: 1px solid rgba(178, 182, 223, .18); border-bottom: 1px solid rgba(178, 182, 223, .18); transform: rotate(45deg); }
@keyframes install-nudge-in { from { opacity: 0; transform: translateY(7px) scale(.98); } }
.install-nudge-icon { width: 34px; height: 34px; display: grid; place-items: center; color: #ececff; background: rgba(178, 182, 223, .13); border-radius: 11px; }
.install-nudge-icon svg { width: 18px; height: 18px; }
.install-nudge-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.install-nudge-copy strong { font-size: 11px; }
.install-nudge-copy span { color: rgba(255, 255, 255, .57); font-size: 8px; line-height: 1.45; }
.install-nudge-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; }
.install-nudge-actions button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 9px; font-size: 8px; font-weight: 780; }
.install-nudge-actions button:first-child { color: white; background: linear-gradient(135deg, var(--deep-blue), var(--ribbon-pink)); }
.install-nudge-actions button:last-child { color: rgba(255, 255, 255, .5); background: transparent; }
.install-nudge-actions button:last-child:hover { color: white; background: rgba(255, 255, 255, .07); }

.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; }
.app-view--agent { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
.app-view--agent iframe { display: block; width: 100%; height: 100%; border: 0; background: #faf9f7; }
body.agent-view-open .app-main { overflow: hidden; }
.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: #f8f4fa;
    background:
        radial-gradient(circle at 100% 0, rgba(225, 106, 217, .11), transparent 34%),
        linear-gradient(145deg, #29243a 0%, #211d31 62%, #1b1828 100%);
    border: 1px solid rgba(178, 182, 223, .18);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(30, 25, 45, .14);
    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(178, 182, 223, .34); box-shadow: 0 24px 54px rgba(30, 25, 45, .22); }
.production-cover {
    position: relative;
    height: 136px;
    margin: -9px -9px 17px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    overflow: hidden;
    isolation: isolate;
    contain: paint;
    background: linear-gradient(135deg, #171522 0%, #28233a 68%, #332843 100%);
    border: 1px solid rgba(255, 255, 255, .08);
}
.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-cover-image { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 44%; filter: saturate(.94) contrast(1.02); transition: transform .45s var(--ease), filter .3s ease; }
.production-cover.is-default-cover .production-cover-image { object-position: center; filter: saturate(.92) contrast(1.04); }
.production-cover.has-image::before { z-index: 2; width: 100%; height: 52%; inset: auto 0 0; border-radius: 0; background: linear-gradient(180deg, transparent, rgba(30,25,45,.28)); filter: none; pointer-events: none; }
.production-cover.has-image::after { display: none; }
@media (hover: hover) and (pointer: fine) {
    .production-card:hover .production-cover-image { transform: scale(1.025); filter: saturate(1) contrast(1.03); }
}
/*
 * Honor's browser can reuse a stale viewport tile for a clipped <img> layer,
 * even without filters or transforms. At phone widths the cover is painted as
 * the card's own background instead, so there is no child image surface for
 * the compositor to substitute. Desktop keeps lazy <img> loading and hover.
 */
@media (max-width: 760px) {
    .production-cover {
        isolation: auto;
        contain: none;
    }
    .production-cover.has-image {
        background-color: #171522;
        background-image: var(--production-cover-source);
        background-repeat: no-repeat;
        background-position: center 44%;
        background-size: cover;
    }
    .production-cover.has-image.is-default-cover { background-position: center; }
    .production-cover.has-image .production-cover-image { display: none; }
}
.production-status {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    min-height: 20px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, .88);
    background: rgba(30, 25, 45, .54);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(30, 25, 45, .12);
    backdrop-filter: blur(10px);
    font-size: 8px;
    font-weight: 720;
    letter-spacing: .02em;
}
.production-status.is-preparing,
.production-status.is-finished {
    background: rgba(30, 25, 45, .64);
    border-color: rgba(178, 182, 223, .28);
}
.production-status.is-preparing::before,
.production-status.is-finished::before {
    content: '';
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border-radius: 50%;
}
.production-status.is-preparing::before {
    background: var(--ribbon-pink);
    box-shadow: 0 0 0 2px rgba(201, 59, 138, .14);
}
.production-status.is-finished::before {
    background: var(--deep-blue);
    box-shadow: 0 0 0 2px rgba(78, 91, 153, .18);
}
.production-card-title-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 8px; }
.production-card h2 { min-width: 0; margin: 0; overflow: hidden; color: #f8f4fa; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.3; }
.production-card-edit { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: rgba(233, 226, 239, .55); background: rgba(178, 182, 223, .08); border: 1px solid transparent; border-radius: 11px; transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s var(--ease); }
.production-card-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.production-card-edit:hover { color: #f8f4fa; background: rgba(178, 182, 223, .17); border-color: rgba(178, 182, 223, .18); transform: translateY(-1px); }
.production-card-edit:focus-visible { color: #f8f4fa; outline: 2px solid rgba(178, 182, 223, .52); outline-offset: 2px; }
.production-description { min-height: 36px; margin: 7px 0 15px; display: -webkit-box; overflow: hidden; color: rgba(233, 226, 239, .66); 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: rgba(233, 226, 239, .42); font-size: 9px; }
.production-card-actions { display: flex; align-items: center; gap: 5px; }
.production-delete { min-height: 32px; padding: 0 9px; color: rgba(233, 226, 239, .42); background: transparent; border: 1px solid transparent; border-radius: 9px; font-size: 10px; font-weight: 700; }
.production-delete:hover { color: #ff9dbb; background: rgba(201, 59, 138, .12); }
.production-open { min-height: 32px; padding: 0 11px; color: #fff; background: rgba(78, 91, 153, .92); border: 1px solid rgba(178, 182, 223, .18); border-radius: 9px; font-size: 10px; font-weight: 730; }
.production-open:hover { color: #fff; background: #5d6bb0; }

.production-card--skeleton { min-height: 260px; border-color: rgba(178,182,223,.10); background: linear-gradient(100deg, rgba(33,29,49,.94) 20%, rgba(58,50,78,.96) 38%, rgba(42,37,58,.94) 56%) #211d31; 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; }
.creation-coming-icon {
    position: relative;
    width: 78px;
    height: 78px;
    margin-bottom: 29px;
    color: white;
    background: linear-gradient(145deg, var(--deep-blue) 0%, #6f70b8 52%, var(--accent-dark) 100%);
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(78, 91, 153, .24), 0 7px 18px rgba(201, 59, 138, .16), inset 0 1px rgba(255, 255, 255, .32);
    transform: rotate(-3deg);
}
.creation-coming-icon::before {
    content: '';
    position: absolute;
    inset: -9px;
    z-index: -1;
    border: 1px solid rgba(78, 91, 153, .11);
    border-radius: 30px;
    transform: rotate(6deg);
}
.creation-coming-icon::after {
    content: '';
    position: absolute;
    right: -7px;
    top: -6px;
    width: 13px;
    height: 13px;
    background: var(--accent);
    border: 4px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 5px 14px rgba(201, 59, 138, .24);
}
.creation-coming-icon svg { width: 37px; height: 37px; stroke-width: 1.65; filter: drop-shadow(0 3px 6px rgba(30, 25, 45, .18)); }
.creation-coming-soon .eyebrow { margin-bottom: 14px; }
.creation-coming-soon h1 { font-weight: 820; }
.creation-coming-soon > p:not(.eyebrow) { max-width: 430px; }
.creation-image-entry { width: min(390px, 100%); margin: 22px auto 16px; padding: 13px 14px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; color: var(--ink); background: linear-gradient(135deg, rgba(178,182,223,.2), rgba(225,106,217,.09)), rgba(255,255,255,.8); border: 1px solid rgba(78,91,153,.18); border-radius: 16px; box-shadow: 0 16px 40px rgba(30,25,45,.07); text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.creation-image-entry:hover { transform: translateY(-2px); border-color: rgba(201,59,138,.34); box-shadow: 0 20px 44px rgba(30,25,45,.1); }
.creation-image-entry__icon { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--magenta)); border-radius: 11px; box-shadow: 0 9px 20px rgba(78,91,153,.2); }
.creation-image-entry__icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; }
.creation-image-entry > span:nth-child(2) { min-width: 0; }
.creation-image-entry small, .creation-image-entry strong, .creation-image-entry em { display: block; }
.creation-image-entry small { margin-bottom: 3px; color: var(--magenta); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.creation-image-entry strong { font-size: 12px; }
.creation-image-entry em { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.creation-image-entry__arrow { width: 17px; fill: none; stroke: var(--blue); stroke-width: 1.8; }

/* Creation desk preview ----------------------------------------------------
   The table is a fluid stage. Each physical object is its own focusable layer
   so it can move, explain state, and later open a dedicated lightweight tool. */
.app-view--creation {
    width: min(1360px, 100%);
    padding-top: clamp(28px, 4.5vh, 48px);
}
.creation-studio { width: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.app-view--creation .creation-view-heading { margin-bottom: 20px; flex: 0 0 auto; }
.app-view--creation .creation-view-heading h1 { display: none; }
.app-view--creation .creation-view-heading .eyebrow {
    margin: 0;
    padding-left: 10px;
    display: block;
    color: #2d283c;
    font-size: 19px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: none;
    border-left: 4px solid var(--brand-pink);
}
.creation-desk {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: min(700px, calc(100svh - 178px));
    min-height: 520px;
    overflow: hidden;
    background-color: var(--ink);
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(178,182,223,.1), transparent 46%),
        radial-gradient(circle at 28% 24%, rgba(78,91,153,.62), transparent 34%),
        radial-gradient(circle at 72% 72%, rgba(201,59,138,.38), transparent 38%),
        linear-gradient(145deg, #28223c 0%, #1e192d 48%, #171321 100%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(30,25,45,.25), inset 0 0 0 1px rgba(255,255,255,.035);
    image-rendering: pixelated;
}
.creation-desk-mat {
    position: absolute;
    inset: 13% 14%;
    z-index: 0;
}
.creation-desk-mat::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 4px, rgba(30,25,45,.018) 4px 8px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0 4px, transparent 4px 8px),
        linear-gradient(145deg, rgba(102,116,169,.6), rgba(72,75,119,.54));
    border: 1px solid rgba(214,218,250,.24);
    border-radius: 18px;
    box-shadow: none;
    filter: none;
    clip-path: none;
    pointer-events: none;
}
.creation-desk-mat::after {
    content: none;
}
.creation-desk::after {
    content: none;
}
.creation-desk-light { position: absolute; z-index: -1; width: 42%; aspect-ratio: 1; border-radius: 50%; filter: blur(70px); opacity: .18; pointer-events: none; }
.creation-desk-light--blue { left: -18%; top: -35%; background: #3278ff; }
.creation-desk-light--pink { right: -15%; bottom: -42%; background: #f224b8; }
.creation-desk-engraving {
    position: absolute;
    left: 50%;
    top: clamp(18px, 3.8%, 30px);
    z-index: 2;
    max-width: 68%;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #d84fba;
    opacity: .82;
    transform: translateX(-50%);
    pointer-events: none;
    user-select: none;
}
.creation-desk-engraving::before,
.creation-desk-engraving::after {
    content: '';
    width: clamp(34px, 4.5vw, 60px);
    height: 7px;
    flex: 0 0 auto;
    background:
        linear-gradient(#d84fba,#d84fba) center center / calc(100% - 12px) 1px no-repeat,
        linear-gradient(#d84fba,#d84fba) left center / 3px 3px no-repeat,
        linear-gradient(#d84fba,#d84fba) right center / 5px 5px no-repeat;
    opacity: .52;
}
.creation-desk-engraving::after { transform: scaleX(-1); }
.creation-desk-engraving-copy {
    display: inline-flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.creation-desk-engraving-fallback {
    font: 800 9px/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-shadow: none;
    white-space: nowrap;
}
.creation-desk-engraving-copy small {
    color: rgba(216,79,186,.74);
    font: 700 6px/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: .22em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: .72;
}
.creation-desk-engraving.is-cjk {
    opacity: .94;
}
.creation-desk-engraving.is-cjk .creation-desk-engraving-fallback {
    max-width: min(48vw, 360px);
    overflow: hidden;
    color: #d84fba;
    background: none;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .06em;
    text-overflow: ellipsis;
    text-transform: none;
    text-shadow: none;
}
.creation-desk-engraving canvas { display: none; height: 24px; width: auto; max-width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.creation-desk-engraving.is-rendered .creation-desk-engraving-fallback { display: none; }
.creation-desk-engraving.is-rendered canvas { display: block; }
.creation-desk-watermark {
    position: absolute;
    left: 50%;
    top: 48%;
    z-index: 1;
    width: clamp(224px, 28vw, 368px);
    display: grid;
    place-items: center;
    opacity: .16;
    filter: drop-shadow(0 0 20px rgba(178,182,223,.2));
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
}
.creation-desk-watermark::before {
    content: '';
    position: absolute;
    inset: -58% -20%;
    z-index: -1;
    background:
        repeating-linear-gradient(0deg, transparent 0 8px, rgba(178,182,223,.035) 8px 9px),
        radial-gradient(ellipse at center, rgba(178,182,223,.18), transparent 64%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 12%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, #000 12%, transparent 70%);
}
.creation-desk-watermark::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(178,182,223,.72) 28%, rgba(225,106,217,.76) 50%, rgba(178,182,223,.72) 72%, transparent);
    box-shadow: 0 0 10px rgba(225,106,217,.26);
}
.creation-desk-watermark img {
    width: 100%;
    height: auto;
    display: block;
}

.creation-desk-member-code {
    position: absolute;
    right: 4.6%;
    bottom: 2.4%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #d84fba;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    white-space: nowrap;
    opacity: .86;
    transform: rotate(-.6deg);
    pointer-events: none;
    user-select: none;
}
.creation-desk-member-code::before {
    content: '';
    width: clamp(22px, 3vw, 38px);
    height: 3px;
    background: repeating-linear-gradient(90deg, #d84fba 0 4px, transparent 4px 8px);
    opacity: .72;
}
.creation-desk-member-code span {
    color: rgba(216,79,186,.72);
    font: 800 9px/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: .2em;
    text-transform: uppercase;
}
.creation-desk-member-code strong {
    color: #d84fba;
    font: 900 clamp(14px, 1.45vw, 20px)/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: .16em;
    display: inline-flex;
    align-items: center;
    gap: .62em;
}
.creation-desk-member-code strong::before {
    content: '//';
    color: rgba(216,79,186,.46);
    font-size: .7em;
    line-height: 1;
    letter-spacing: .04em;
    transform: translateY(-.03em);
}

.creation-tool {
    --tool-rotation: 0deg;
    position: absolute;
    z-index: 3;
    padding: 0;
    display: block;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 0;
    filter: drop-shadow(0 12px 10px rgba(7,5,14,.27));
    transform: rotate(var(--tool-rotation));
    transform-origin: 50% 78%;
    transition: transform .24s var(--ease), filter .24s ease;
    -webkit-tap-highlight-color: transparent;
}
.creation-tool::before {
    content: none;
}
.creation-tool::after {
    content: '';
    position: absolute;
    z-index: -2;
    left: 2%;
    right: -4%;
    bottom: -4%;
    height: 38%;
    border-radius: 50%;
    background: rgba(78,91,153,.4);
    filter: blur(18px);
    opacity: .34;
    transform: scaleX(1.08);
    transition: opacity .24s ease, transform .24s var(--ease);
    pointer-events: none;
}
.creation-tool--script::after { background: rgba(178,182,223,.38); }
.creation-tool--recorder::after { background: rgba(78,91,153,.46); }
.creation-tool--mirror::after { background: rgba(225,106,217,.38); }
.creation-tool:hover { z-index: 5; filter: drop-shadow(0 18px 13px rgba(7,5,14,.38)); transform: translateY(-7px) rotate(calc(var(--tool-rotation) - 1deg)) scale(1.035); }
.creation-tool:hover::after,
.creation-tool.is-selected::after { opacity: .56; transform: scaleX(1.18) scaleY(1.08); }
.creation-tool:active { transform: translateY(1px) rotate(var(--tool-rotation)) scale(.94); }
.creation-tool:focus-visible { outline: 0; filter: drop-shadow(0 0 18px rgba(225,106,217,.72)) drop-shadow(0 16px 14px rgba(7,5,14,.42)); }
.creation-tool.is-selected { z-index: 6; filter: drop-shadow(0 18px 16px rgba(7,5,14,.42)); }
.creation-tool-object { position: relative; display: block; width: 100%; transform-origin: 50% 78%; }
.creation-tool-shadow { position: absolute; z-index: -1; left: 14%; right: 8%; bottom: 3%; height: 20%; background: #090611; opacity: .5; filter: blur(12px); transform: skewX(-12deg); }
.creation-tool-sprite { position: relative; z-index: 2; width: 100%; height: auto; display: block; user-select: none; pointer-events: none; image-rendering: pixelated; }
.creation-tool-effect { position: absolute; z-index: 4; display: block; pointer-events: none; opacity: 0; }
.creation-tool-popover {
    position: absolute;
    z-index: 7;
    width: 236px;
    box-sizing: border-box;
    padding: 14px;
    display: grid;
    gap: 0;
    text-align: left;
    color: #f8f6ff;
    background:
        radial-gradient(circle at 100% 0, rgba(225,106,217,.24), transparent 42%),
        linear-gradient(145deg, rgba(24,21,41,.97), rgba(38,43,75,.97));
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(9,7,20,.34);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(10px) scale(.98);
    transition: opacity .18s ease, transform .18s var(--ease);
    pointer-events: none;
}
.creation-tool-popover::before {
    content: '创作工具';
    color: #ec86da;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
}
.creation-tool-popover strong { display: block; margin-top: 8px; font-size: 17px; line-height: 1.35; }
.creation-tool-popover small { margin: 5px 0 12px; color: rgba(244,240,255,.74); font-size: 11px; font-weight: 640; line-height: 1.58; }
.creation-tool-popover em { display: inline-flex; align-items: center; gap: 8px; color: rgba(248,246,255,.86); font-size: 10px; font-style: normal; font-weight: 720; }
.creation-tool-popover em::before { content: ''; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #ed63c8; box-shadow: 0 0 0 4px rgba(237,99,200,.13), 0 0 12px rgba(237,99,200,.54); }
.creation-tool.is-available .creation-tool-popover em { color: #f08cdf; }
.creation-tool:hover .creation-tool-popover,
.creation-tool:focus-visible .creation-tool-popover,
.creation-tool.is-selected .creation-tool-popover { opacity: 1; transform: translateY(0) scale(1); }

.creation-tool--camera .creation-tool-popover { left: 88%; top: 3%; }
.creation-tool--script .creation-tool-popover { right: 88%; top: 10%; }
.creation-tool--recorder .creation-tool-popover { left: 88%; top: -12%; }
.creation-tool--mirror .creation-tool-popover { right: 88%; top: 6%; }

.creation-tool--camera { --tool-rotation: -6deg; left: 12%; top: 7%; width: clamp(113px, 11.1vw, 148px); }
.creation-tool--script { --tool-rotation: 2deg; right: 7%; top: 24%; width: clamp(125px, 12.15vw, 156px); }
.creation-tool--recorder { --tool-rotation: 5deg; left: 21%; top: 59%; width: clamp(82px, 7.8vw, 104px); }
.creation-tool--mirror { --tool-rotation: -2deg; right: 10%; top: 66%; width: clamp(126px, 12.4vw, 160px); }

.creation-tool--camera .creation-tool-effect { left: 59%; top: 23%; width: 34px; height: 34px; background: radial-gradient(circle, #fff 0 24%, #fff1b7 25% 43%, #E16AD9 44% 54%, transparent 55%); clip-path: polygon(50% 0, 62% 35%, 100% 50%, 62% 65%, 50% 100%, 38% 65%, 0 50%, 38% 35%); filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 18px rgba(225,106,217,.82)); }
.creation-tool--script .creation-tool-effect {
    display: none;
}
.creation-tool--recorder .creation-tool-effect {
    inset: 0;
    background: url('/static/media/creation-desk/tool-recorder-cutout-v1.png?v=1') center / 100% 100% no-repeat;
    clip-path: polygon(20% 61%, 54% 63%, 54% 73%, 18% 72%);
    filter: brightness(1.9) saturate(1.55) drop-shadow(0 0 7px rgba(225,106,217,.75));
    image-rendering: pixelated;
}
.creation-tool--mirror .creation-tool-effect {
    inset: 0;
    background: url('/static/media/creation-desk/tool-mirror-cutout-v1.png?v=1') center / 100% 100% no-repeat;
    filter: brightness(1.58) saturate(1.14) drop-shadow(0 0 7px rgba(255,248,220,.78)) drop-shadow(0 0 12px rgba(225,106,217,.5));
    -webkit-mask:
        radial-gradient(circle at 38% 18%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 35% 35%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 33% 52%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 70% 28%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 68% 45%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 65% 62%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%);
    mask:
        radial-gradient(circle at 38% 18%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 35% 35%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 33% 52%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 70% 28%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 68% 45%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%),
        radial-gradient(circle at 65% 62%, #000 0 3.5%, rgba(0,0,0,.72) 5%, transparent 8%);
    image-rendering: pixelated;
}
.creation-tool.is-activating .creation-tool-object { animation: creation-tool-press .42s var(--ease) both; }
.creation-tool--camera.is-activating .creation-tool-effect { animation: creation-camera-flash .4s steps(2,end) both; }
.creation-tool--script.is-activating .creation-tool-sprite { animation: creation-script-settle .48s steps(4,end) both; transform-origin: 50% 56%; }
.creation-tool--recorder.is-activating .creation-tool-effect { animation: creation-recorder-meter .52s steps(4,end) both; }
.creation-tool--mirror.is-activating .creation-tool-effect { animation: creation-mirror-lights .6s steps(3,end) both; }
@keyframes creation-tool-press { 0% { transform: translateY(0) scale(1); } 34% { transform: translateY(4px) scale(.94,.91); } 68% { transform: translateY(-3px) scale(1.025,1.04); } 100% { transform: translateY(0) scale(1); } }
@keyframes creation-camera-flash { 0%,100% { opacity: 0; transform: scale(.2) rotate(0); } 32%,60% { opacity: 1; transform: scale(1.18) rotate(45deg); } }
@keyframes creation-script-settle { 0%,100% { transform: rotate(0) scale(1); } 28% { transform: rotate(-2deg) scale(.985,1.015); } 58% { transform: rotate(1deg) scale(1.012,.99); } 78% { transform: rotate(-.5deg) scale(.998,1.004); } }
@keyframes creation-recorder-meter { 0%,100% { opacity: 0; } 18% { opacity: 1; } 38% { opacity: .34; } 58% { opacity: 1; } 78% { opacity: .5; } }
@keyframes creation-mirror-lights { 0%,100% { opacity: 0; } 22% { opacity: .46; } 48% { opacity: 1; } 68% { opacity: .62; } 82% { opacity: 1; } }

@media (max-width: 760px) {
    .app-view.app-view--creation {
        height: calc(100dvh - 134px);
        min-height: 0;
        padding: 8px 10px 0;
    }
    .app-view--creation .creation-studio { height: 100%; }
    .app-view--creation .creation-view-heading {
        min-height: 46px;
        margin-bottom: 13px;
        align-items: center;
    }
    .app-view--creation .creation-view-heading > div { min-width: 0; display: flex; align-items: center; }
    .creation-desk {
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
        border-width: 1px;
        border-radius: 22px;
        background-size: cover;
    }
    .creation-desk-mat {
        inset: clamp(38px, 9vw, 46px) clamp(28px, 7vw, 34px);
    }
    .creation-desk-engraving { top: 8px; min-height: 20px; gap: 7px; opacity: .86; }
    .creation-desk-engraving::before,
    .creation-desk-engraving::after { width: 26px; }
    .creation-desk-engraving-copy { gap: 3px; }
    .creation-desk-engraving-copy small { font-size: 5px; letter-spacing: .16em; }
    .creation-desk-engraving.is-cjk .creation-desk-engraving-fallback {
        max-width: 64vw;
        font-size: 14px;
        letter-spacing: .04em;
    }
    .creation-desk-engraving canvas { height: 20px; }
    .creation-desk-mat::before { border-radius: 14px; }
    .creation-desk-watermark { top: 46%; width: min(56vw, 218px); opacity: .13; }
    .creation-desk-watermark::after { bottom: -10px; }
    .creation-desk-member-code { right: 4.8%; bottom: 2%; gap: 6px; }
    .creation-desk-member-code::before { width: 18px; height: 2px; background-size: 7px 2px; }
    .creation-desk-member-code span { font-size: 6.5px; letter-spacing: .16em; }
    .creation-desk-member-code strong { font-size: clamp(9px, 2.8vw, 12px); letter-spacing: .13em; }
    .creation-tool-popover { width: 188px; padding: 12px; border-radius: 17px; }
    .creation-tool-popover::before { font-size: 8px; }
    .creation-tool-popover strong { margin-top: 6px; font-size: 14px; }
    .creation-tool-popover small { margin: 4px 0 10px; font-size: 9px; }
    .creation-tool-popover em { font-size: 8px; }
    .creation-tool--camera { width: clamp(100px, 29.1vw, 119px); }
    .creation-tool--script { width: clamp(102px, 30vw, 118px); }
    .creation-tool--recorder { width: clamp(70px, 20vw, 84px); }
    .creation-tool--mirror { width: clamp(104px, 31vw, 124px); }
    .creation-tool--camera .creation-tool-popover { left: 92%; top: -3%; }
    .creation-tool--script .creation-tool-popover { right: 90%; top: 2%; }
    .creation-tool--recorder .creation-tool-popover { left: 84%; top: -20%; }
    .creation-tool--mirror .creation-tool-popover { right: 92%; top: -2%; }
}

@media (max-width: 390px) {
    .creation-tool-popover { width: 178px; }
}

@media (prefers-reduced-motion: reduce) {
    .creation-tool,
    .creation-tool::before,
    .creation-tool::after,
    .creation-tool-popover { transition: none; }
    .creation-tool.is-activating .creation-tool-object,
    .creation-tool.is-activating .creation-tool-effect { animation: none; }
}

/* 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-token-reference { width: fit-content; max-width: 100%; margin-top: 7px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 9px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; }
.wallet-balance-token-reference > span { font-size: 9px; font-weight: 650; }
.wallet-balance-token-reference b { color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.wallet-balance-token-reference small { font-size: 8px; font-weight: 700; opacity: .68; }
.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(2, minmax(0,1fr)); gap: 12px; }
.wallet-balance-details div { min-height: 126px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: rgba(255,255,255,.085); border: 1px solid rgba(255,255,255,.12); border-radius: 17px; 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: auto 0 0; font-size: 17px; font-weight: 800; letter-spacing: -.025em; }
.wallet-balance-details div > span { color: rgba(255,255,255,.52); font-size: 8px; line-height: 1.4; }
.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-history-link { min-height: 34px; padding: 0 4px 0 10px; display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; color: var(--deep-blue); background: transparent; border: 0; border-radius: 10px; font: inherit; font-size: 9px; font-weight: 760; cursor: pointer; }
.wallet-history-link:hover { background: rgba(78,91,153,.08); }
.wallet-history-link:disabled { cursor: default; opacity: .38; }
.wallet-history-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.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-payment-status.is-ready { color: var(--deep-blue); background: rgba(178,182,223,.22); }
.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-redemption-section { overflow: hidden; }
.wallet-redemption-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.wallet-redemption-form input {
    min-width: 0;
    height: 46px;
    padding: 0 15px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    outline: none;
    font: inherit;
    font-size: 12px;
    font-weight: 680;
    letter-spacing: .05em;
    text-transform: uppercase;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.wallet-redemption-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(78,91,153,.12); }
.wallet-redemption-form button { min-width: 104px; min-height: 46px; }
.wallet-redemption-message { margin: 11px 0 0; color: #2f7a5a; font-size: 10px; font-weight: 720; }
.wallet-redemption-message.is-error { color: var(--warning); }
.wallet-redemption-note { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.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-order-action { min-height: 27px; margin: 1px -8px -5px 0; padding: 4px 8px; font-size: 8px; }
.wallet-record-delta.is-positive strong { color: var(--success); }
.wallet-record-delta.is-negative strong { color: var(--danger); }
.wallet-record--detailed { min-height: 82px; padding: 15px 2px; }
.wallet-record-metadata { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.wallet-record-metadata span { padding: 3px 6px; color: var(--muted); background: rgba(78,91,153,.07); border-radius: 999px; font-size: 7px; font-variant-numeric: tabular-nums; }
.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; }

.wallet-ledger-dialog { width: min(760px,calc(100vw - 32px)); max-width: none; max-height: min(82vh,780px); padding: 0; overflow: hidden; color: var(--ink); background: transparent; border: 0; }
.wallet-ledger-dialog::backdrop { background: rgba(22,18,34,.58); backdrop-filter: blur(7px); }
.wallet-ledger-dialog[open] { display: flex; }
.wallet-ledger-panel { width: 100%; max-height: min(82vh,780px); display: flex; flex-direction: column; 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); }
.wallet-ledger-dialog-heading { padding: 23px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.wallet-ledger-dialog-heading .eyebrow { margin-bottom: 7px; }
.wallet-ledger-dialog-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.wallet-ledger-dialog-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.wallet-ledger-dialog-body { min-height: 280px; padding: 10px 24px 22px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.wallet-ledger-history-list { display: flex; flex-direction: column; }
.wallet-ledger-history-state { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 10px; }
.wallet-ledger-history-state.is-error { flex-direction: column; }

/* 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%; }

/* Cash checkout stays a separate, explicit confirmation from AI Credits quotes. */
.payment-checkout-dialog { width: min(540px, calc(100vw - 28px)); max-width: none; padding: 0; overflow: visible; color: var(--ink); background: transparent; border: 0; }
.payment-checkout-dialog::backdrop { background: rgba(22,18,34,.6); backdrop-filter: blur(8px); }
.payment-checkout-card { overflow: hidden; background: var(--surface-strong); border: 1px solid rgba(255,255,255,.34); border-radius: 23px; box-shadow: 0 30px 96px rgba(18,14,29,.38); }
.payment-checkout-heading { padding: 24px 25px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.payment-checkout-heading .eyebrow { margin-bottom: 8px; }
.payment-checkout-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.payment-checkout-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.payment-checkout-body { padding: 22px 25px; }
.payment-checkout-summary { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(145deg, rgba(178,182,223,.2), rgba(225,106,217,.09)); border: 1px solid rgba(78,91,153,.12); border-radius: 17px; text-align: center; }
.payment-checkout-summary > span { color: var(--muted); font-size: 9px; font-weight: 720; }
.payment-checkout-summary > strong { font-size: 29px; letter-spacing: -.035em; }
.payment-checkout-summary > p { margin: 0; color: var(--accent-dark); font-size: 9px; font-weight: 750; }
.payment-checkout-details { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-checkout-details div { padding: 14px; background: var(--paper); border-radius: 12px; }
.payment-checkout-details dt { color: var(--muted); font-size: 8px; }
.payment-checkout-details dd { margin: 6px 0 0; font-size: 12px; font-weight: 780; }
.payment-checkout-channel-options { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.payment-channel-option { min-height: 44px; padding: 0 14px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 10px; font-weight: 760; cursor: pointer; }
.payment-channel-option.is-selected { color: var(--brand); background: rgba(178,182,223,.16); border-color: rgba(78,91,153,.48); box-shadow: 0 0 0 3px rgba(78,91,153,.07); }
.payment-channel-option:disabled { cursor: default; opacity: .76; }
.payment-checkout-qr { margin-top: 14px; padding: 16px; display: grid; grid-template-columns: 142px 1fr; align-items: center; gap: 18px; background: #fff; border: 1px solid rgba(78,91,153,.16); border-radius: 16px; }
.payment-checkout-qr[hidden] { display: none; }
.payment-checkout-qr img { display: block; width: 142px; height: 142px; object-fit: contain; image-rendering: crisp-edges; }
.payment-checkout-qr strong { color: var(--ink); font-size: 13px; }
.payment-checkout-qr p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.payment-checkout-error { margin-top: 13px; padding: 12px 13px; color: var(--danger); background: #fbeef3; border-radius: 11px; font-size: 9px; line-height: 1.55; }
.payment-checkout-note { margin: 14px 2px 0; color: var(--faint); font-size: 8px; line-height: 1.65; }
.payment-checkout-actions { padding: 15px 25px 22px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; }
.payment-checkout-actions .primary-button, .payment-checkout-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-complete-dialog {
    position: fixed;
    inset: 0;
    width: min(720px, calc(100vw - 48px));
    max-width: none;
    max-height: min(760px, calc(100dvh - 48px));
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 50% 34%, rgba(112, 125, 221, .24), transparent 29%),
        radial-gradient(circle at 78% 17%, rgba(225, 106, 217, .13), transparent 25%),
        linear-gradient(145deg, #171321 0%, #12101b 55%, #0d0b14 100%);
    border: 0;
    border-radius: 32px;
    box-shadow: 0 34px 100px rgba(9, 7, 16, .58), 0 0 0 1px rgba(198, 202, 255, .12);
    isolation: isolate;
}
.frames-complete-dialog::backdrop {
    background: rgba(12, 9, 18, .82);
    backdrop-filter: blur(14px) saturate(.8);
}
.frames-complete-dialog[open] { display: grid; place-items: center; }
.frames-complete-dialog::before,
.achievement-medal-rays {
    content: '';
    position: absolute;
    width: 920px;
    aspect-ratio: 1;
    left: 50%;
    top: 38%;
    z-index: -1;
    opacity: 0;
    background: repeating-conic-gradient(
        from -7deg,
        rgba(103, 119, 217, .12) 0 5deg,
        transparent 5deg 17deg,
        rgba(225, 106, 217, .08) 17deg 21deg,
        transparent 21deg 38deg
    );
    transform: translate(-50%, -50%) scale(.35) rotate(-12deg);
    mask-image: radial-gradient(circle, #000 0 20%, transparent 66%);
}
.frames-complete-dialog.is-playing::before,
.achievement-reveal.is-playing .achievement-medal-rays { animation: frames-bingo-rays 1.15s .08s cubic-bezier(.17,.84,.3,1) both; }
.frames-complete-flash {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    background: #f9f7ff;
}
.frames-complete-dialog.is-playing .frames-complete-flash { animation: frames-bingo-flash .48s ease-out both; }
.frames-complete-radiance {
    position: absolute;
    width: min(78vw, 560px);
    aspect-ratio: 1;
    left: 50%;
    top: 38%;
    z-index: -1;
    border-radius: 50%;
    opacity: 0;
    background: radial-gradient(circle, rgba(224, 132, 242, .34), rgba(92, 108, 206, .17) 34%, transparent 70%);
    filter: blur(10px);
    transform: translate(-50%, -50%) scale(.35);
}
.frames-complete-dialog.is-playing .frames-complete-radiance { animation: frames-bingo-radiance 1.25s .08s cubic-bezier(.17,.84,.3,1) both; }
.frames-complete-shockwave {
    position: absolute;
    width: 150px;
    aspect-ratio: 1;
    left: 50%;
    top: 36%;
    z-index: -1;
    border: 1px solid rgba(191, 198, 255, .58);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.25);
}
.frames-complete-dialog.is-playing .frames-complete-shockwave--one { animation: frames-bingo-wave 1.05s .15s ease-out both; }
.frames-complete-dialog.is-playing .frames-complete-shockwave--two { animation: frames-bingo-wave 1.15s .32s ease-out both; }
.frames-complete-streaks { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.frames-complete-streaks i {
    position: absolute;
    width: 3px;
    height: 62px;
    left: 50%;
    top: 38%;
    border-radius: 999px;
    opacity: 0;
    background: linear-gradient(to top, rgba(225,106,217,0), rgba(225,106,217,.92));
    transform-origin: 50% 0;
}
.frames-complete-streaks i:nth-child(1) { --ray-angle: 7deg; --ray-distance: 176px; }
.frames-complete-streaks i:nth-child(2) { --ray-angle: 51deg; --ray-distance: 196px; }
.frames-complete-streaks i:nth-child(3) { --ray-angle: 96deg; --ray-distance: 166px; }
.frames-complete-streaks i:nth-child(4) { --ray-angle: 142deg; --ray-distance: 190px; }
.frames-complete-streaks i:nth-child(5) { --ray-angle: 187deg; --ray-distance: 178px; }
.frames-complete-streaks i:nth-child(6) { --ray-angle: 231deg; --ray-distance: 202px; }
.frames-complete-streaks i:nth-child(7) { --ray-angle: 278deg; --ray-distance: 170px; }
.frames-complete-streaks i:nth-child(8) { --ray-angle: 324deg; --ray-distance: 194px; }
.frames-complete-dialog.is-playing .frames-complete-streaks i { animation: frames-bingo-streak .92s .2s cubic-bezier(.18,.8,.32,1) both; }
.frames-complete-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 8;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: rgba(239, 236, 248, .68);
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.frames-complete-close:hover { color: #fff; background: rgba(255,255,255,.1); transform: rotate(4deg); }
.frames-complete-close:focus-visible, .frames-complete-next:focus-visible { outline: 3px solid rgba(225,106,217,.62); outline-offset: 4px; }
.frames-complete-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.frames-complete-content {
    position: relative;
    z-index: 2;
    width: min(100%, 610px);
    min-height: min(680px, calc(100dvh - 48px));
    padding: 70px 48px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.frames-complete-mark {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    margin-bottom: 23px;
    opacity: 0;
    background: linear-gradient(145deg, #5a68b8, #8d62be 58%, #d552b2);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 31px;
    box-shadow: 0 20px 48px rgba(90, 104, 184, .3), 0 0 34px rgba(225,106,217,.18);
    transform: scale(.2) rotate(-14deg);
}
.frames-complete-dialog.is-playing .frames-complete-mark { animation: frames-bingo-mark .82s .16s cubic-bezier(.15,1.35,.38,1) both; }
.frames-complete-mark svg { width: 66px; height: 66px; overflow: visible; }
.frames-complete-mark path {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 58;
    stroke-dashoffset: 58;
}
.frames-complete-dialog.is-playing .frames-complete-mark path { animation: frames-bingo-check .45s .56s ease-out forwards; }
.frames-complete-kicker {
    margin: 0 0 9px;
    color: #dd83d8;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: 0;
}
.frames-complete-dialog.is-playing .frames-complete-kicker { animation: frames-bingo-copy-in .46s .44s ease-out both; }
.frames-complete-content h2 {
    margin: 0;
    color: transparent;
    background: linear-gradient(108deg, #ffffff 8%, #b9c2ff 44%, #ef8ce2 80%, #ffffff 108%);
    background-clip: text;
    -webkit-background-clip: text;
    font-size: clamp(58px, 10vw, 92px);
    line-height: .98;
    letter-spacing: -.07em;
    opacity: 0;
    filter: drop-shadow(0 8px 28px rgba(106,120,219,.24));
}
.frames-complete-dialog.is-playing .frames-complete-content h2 { animation: frames-bingo-title .62s .32s cubic-bezier(.16,1,.3,1) both; }
.frames-complete-content h3 {
    margin: 20px 0 0;
    font-size: clamp(23px, 4vw, 34px);
    line-height: 1.25;
    letter-spacing: -.045em;
    opacity: 0;
}
.frames-complete-dialog.is-playing .frames-complete-content h3 { animation: frames-bingo-copy-in .5s .58s ease-out both; }
.frames-complete-copy {
    max-width: 470px;
    margin: 15px 0 30px;
    color: rgba(225, 221, 234, .68);
    font-size: 14px;
    line-height: 1.75;
    opacity: 0;
}
.frames-complete-dialog.is-playing .frames-complete-copy { animation: frames-bingo-copy-in .5s .69s ease-out both; }
.frames-complete-next {
    width: min(100%, 400px);
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 24px;
    color: #fff;
    background: linear-gradient(100deg, #5362aa 0%, #6e69bd 53%, #a657ac 100%);
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(70, 76, 147, .34), inset 0 1px rgba(255,255,255,.22);
    font: inherit;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    opacity: 0;
    transform: translateY(18px);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.frames-complete-dialog.is-playing .frames-complete-next { animation: frames-bingo-cta .56s .82s cubic-bezier(.16,1,.3,1) both; }
.frames-complete-next:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 22px 48px rgba(70,76,147,.43), inset 0 1px rgba(255,255,255,.26); }
.frames-complete-next svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes frames-bingo-flash {
    0% { opacity: 0; }
    12% { opacity: .9; }
    100% { opacity: 0; }
}
@keyframes frames-bingo-rays {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(-12deg); }
    42% { opacity: .82; }
    100% { opacity: .3; transform: translate(-50%, -50%) scale(1) rotate(5deg); }
}
@keyframes frames-bingo-radiance {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
    45% { opacity: 1; }
    100% { opacity: .62; transform: translate(-50%, -50%) scale(1); }
}
@keyframes frames-bingo-wave {
    0% { opacity: .72; transform: translate(-50%, -50%) scale(.25); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.4); }
}
@keyframes frames-bingo-streak {
    0% { opacity: 0; transform: translate(-50%, -10%) rotate(var(--ray-angle)) translateY(15px) scaleY(.3); }
    28% { opacity: .82; }
    100% { opacity: 0; transform: translate(-50%, -10%) rotate(var(--ray-angle)) translateY(calc(-1 * var(--ray-distance))) scaleY(1); }
}
@keyframes frames-bingo-mark {
    0% { opacity: 0; transform: scale(.2) rotate(-14deg); }
    70% { opacity: 1; transform: scale(1.08) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes frames-bingo-check { to { stroke-dashoffset: 0; } }
@keyframes frames-bingo-title {
    0% { opacity: 0; transform: translateY(24px) scale(.76); letter-spacing: -.12em; }
    100% { opacity: 1; transform: translateY(0) scale(1); letter-spacing: -.07em; }
}
@keyframes frames-bingo-copy-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes frames-bingo-cta { to { opacity: 1; transform: translateY(0); } }

.tutorial-complete-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
}
/* Medal light belongs to the medal's layout box, not a viewport percentage. */
.tutorial-complete-dialog::before { content: none; }
.achievement-medal-stage > .achievement-medal-rays,
.achievement-medal-stage > .frames-complete-radiance { left: 50%; top: 50%; pointer-events: none; }
.tutorial-complete-content {
    width: min(100%, 720px);
    min-height: 100dvh;
    padding-top: max(52px, env(safe-area-inset-top));
    padding-bottom: max(34px, env(safe-area-inset-bottom));
}
.tutorial-complete-content h3 { margin-top: 14px; }
.tutorial-medal {
    width: min(100%, 360px);
    margin: 26px 0 2px;
    padding: 24px 24px 21px;
    display: grid;
    justify-items: center;
    color: #fff;
    background:
        radial-gradient(circle at 50% 0, rgba(241,142,227,.2), transparent 48%),
        linear-gradient(145deg, rgba(91,105,184,.26), rgba(31,25,46,.9));
    border: 1px solid rgba(217,220,255,.17);
    border-radius: 28px;
    box-shadow: 0 22px 62px rgba(4,3,12,.34), inset 0 1px rgba(255,255,255,.08);
}
.tutorial-complete-dialog.is-playing .tutorial-medal > :not(.achievement-medal-stage) {
    animation: frames-bingo-copy-in .45s 1.55s ease-out both;
}
.tutorial-medal-emblem {
    width: 132px;
    height: 132px;
    margin: -10px 0 8px;
    object-fit: contain;
    filter: drop-shadow(0 18px 24px rgba(8,5,14,.34)) drop-shadow(0 0 22px rgba(225,106,217,.16));
}
.tutorial-medal > span { color: #e58bdd; font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.tutorial-medal > strong { margin-top: 5px; font-size: 25px; letter-spacing: -.04em; }
.tutorial-medal > small { margin-top: 5px; color: rgba(229,225,238,.62); font-size: 12px; }
.tutorial-complete-dialog .frames-complete-copy { margin-top: 18px; margin-bottom: 24px; }
/* Shared achievement entrance: reuse the stage/token inside any .achievement-reveal. */
.achievement-medal-stage {
    --achievement-medal-size: clamp(144px, 22dvh, 192px);
    --achievement-medal-silhouette: url('/static/media/tutorial/first-film/first-call-medal-v2.png');
    position: relative;
    width: var(--achievement-medal-size);
    height: var(--achievement-medal-size);
    margin: -12px 0 12px;
    aspect-ratio: 1;
    flex: 0 0 auto;
    overflow: visible;
    isolation: isolate;
    pointer-events: none;
}
.achievement-medal-token { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.achievement-medal-token img { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; }
.achievement-medal-token .tutorial-medal-emblem { object-fit: contain; }
/* Orthographic coin flip: uniform scale conveys distance without the
   near-edge perspective stretching of the previous translateZ entrance. */
.achievement-medal-token > img { backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(1px); }
.achievement-medal-token > .achievement-medal-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg) translateZ(1px);
    /* Generated reverse is opaque. Reuse the front's real alpha silhouette:
       no checkerboard outside the coin and no outline jump between faces.
       Future medal pairs override --achievement-medal-silhouette together. */
    -webkit-mask-image: var(--achievement-medal-silhouette);
    mask-image: var(--achievement-medal-silhouette);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    mask-mode: alpha;
}
.achievement-medal-stage::before {
    content: '';
    position: absolute;
    inset: -22%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,236,190,.64), rgba(222,149,224,.24) 34%, transparent 68%);
    opacity: 0;
    z-index: -1;
}
.achievement-medal-token::after {
    content: '';
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    background: linear-gradient(115deg, transparent 30%, rgba(255,248,224,.82) 49%, transparent 67%);
    background-size: 300% 100%;
    background-position: 150% 0;
    mix-blend-mode: screen;
    opacity: 0;
    transform: translateZ(2px);
    backface-visibility: hidden;
}
.achievement-reveal.is-playing .achievement-medal-token {
    animation: achievement-medal-arrive 1.8s .12s cubic-bezier(.22,.55,.3,1) both;
}
/* Fade outside the preserve-3d token: opacity < 1 on the token flattens
   its children and can show the mirrored front during the first flip. */
.achievement-reveal.is-playing .achievement-medal-stage {
    animation: achievement-medal-fade 1.8s .12s cubic-bezier(.22,.55,.3,1) both;
}
.achievement-reveal.is-playing .achievement-medal-stage::before {
    animation: achievement-medal-glow .65s 1.72s ease-out both;
}
.achievement-reveal.is-playing .achievement-medal-token::after {
    animation: achievement-medal-sheen .65s 1.82s ease-out both;
}
.tutorial-complete-dialog .frames-complete-flash,
.tutorial-complete-dialog .frames-complete-shockwave,
.tutorial-complete-dialog .frames-complete-streaks { display: none; }
.tutorial-complete-dialog.is-playing .frames-complete-kicker,
.tutorial-complete-dialog.is-playing .frames-complete-content h2,
.tutorial-complete-dialog.is-playing .frames-complete-content h3 { animation-delay: 1.4s; }
.tutorial-complete-dialog.is-playing .frames-complete-copy { animation-delay: 1.65s; }
.tutorial-complete-dialog.is-playing .frames-complete-next { animation-delay: 1.85s; }
@keyframes achievement-medal-arrive {
    0% { transform: translateY(30px) rotateY(-720deg) scale(.08); }
    74% { transform: translateY(-4px) rotateY(-18deg) scale(1.06); }
    90% { transform: translateY(1px) rotateY(5deg) scale(.99); }
    100% { transform: translateY(0) rotateY(0) scale(1); }
}
@keyframes achievement-medal-fade {
    0% { opacity: 0; }
    16%, 100% { opacity: 1; }
}
@keyframes achievement-medal-glow {
    0% { opacity: 0; transform: scale(.7); }
    28% { opacity: .8; }
    100% { opacity: 0; transform: scale(1.25); }
}
@keyframes achievement-medal-sheen {
    0% { opacity: 0; background-position: 150% 0; }
    25% { opacity: .8; }
    100% { opacity: 0; background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .frames-complete-dialog::before,
    .achievement-medal-rays,
    .frames-complete-flash,
    .frames-complete-radiance,
    .frames-complete-shockwave,
    .frames-complete-streaks { display: none; }
    .frames-complete-dialog.is-playing .frames-complete-mark,
    .frames-complete-dialog.is-playing .frames-complete-kicker,
    .frames-complete-dialog.is-playing .frames-complete-content h2,
    .frames-complete-dialog.is-playing .frames-complete-content h3,
    .frames-complete-dialog.is-playing .frames-complete-copy,
    .frames-complete-dialog.is-playing .frames-complete-next,
    .frames-complete-dialog.is-playing .frames-complete-mark path,
    .tutorial-complete-dialog.is-playing .tutorial-medal {
        opacity: 1;
        transform: none;
        animation: none;
        stroke-dashoffset: 0;
    }
    .achievement-reveal.is-playing .achievement-medal-stage,
    .achievement-reveal.is-playing .achievement-medal-token,
    .tutorial-complete-dialog.is-playing .tutorial-medal > :not(.achievement-medal-stage) {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .achievement-medal-stage::before,
    .achievement-medal-token::after { display: none; }
}

.story-panes {
    width: min(100%, 320px);
    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 {
    width: 100%;
    min-height: 36px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    justify-content: center;
    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) auto;
    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-copy { min-width: 0; }
.story-breakdown-actions { display: flex; align-items: center; gap: 9px; }
.story-breakdown-actions .primary-button { min-width: 178px; min-height: 46px; }
.story-breakdown-actions .text-button {
    min-width: 112px;
    min-height: 46px;
    padding: 0 14px;
    color: var(--deep-blue);
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(78,91,153,.18);
    white-space: nowrap;
}
.story-breakdown-actions .text-button:hover:not(:disabled) { background: #fff; border-color: rgba(78,91,153,.32); }
.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); }
.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%; min-height: 104px; padding: 15px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 13px; color: var(--ink); text-align: left; background: rgba(255,255,255,.8); 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.is-coming-soon:disabled {
    opacity: 1;
    color: rgba(30,25,45,.58);
    background: rgba(250,249,253,.72);
    border-color: rgba(78,91,153,.11);
    box-shadow: none;
}
.story-generation-option.is-coming-soon .story-generation-option-mark {
    color: rgba(78,91,153,.48);
    background: rgba(178,182,223,.13);
}
.story-generation-option.is-coming-soon .story-generation-option-copy small {
    color: rgba(78,91,153,.72);
    background: rgba(178,182,223,.15);
}
.story-generation-option.is-coming-soon .story-generation-option-copy > span:last-child { color: rgba(105,99,119,.7); }
.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; }
.story-generation-option.credit-action-button {
    color: var(--ink);
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(248,244,252,.94));
    border-color: rgba(78,91,153,.18);
    box-shadow: 0 10px 24px rgba(78,91,153,.08);
}
.story-generation-option.credit-action-button:hover:not(:disabled) {
    color: var(--ink);
    background: #fff;
    border-color: rgba(201,59,138,.28);
    box-shadow: 0 14px 30px rgba(78,91,153,.12), 0 5px 20px rgba(201,59,138,.08);
}
.story-generation-option.credit-action-button .story-generation-option-mark {
    color: #fff;
    background: var(--credit-gradient);
    box-shadow: 0 7px 18px rgba(78,91,153,.18);
}
.story-generation-option.credit-action-button .story-generation-option-copy strong { color: var(--ink); }
.story-generation-option.credit-action-button .story-generation-option-copy small { color: var(--deep-blue); background: rgba(78,91,153,.09); }
.story-generation-option.credit-action-button .story-generation-option-copy > span:last-child { color: var(--muted); }
.story-generation-option.credit-action-button em {
    width: 104px;
    min-height: 36px;
    padding: 0 12px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--credit-gradient);
    border-radius: 11px;
    box-shadow: 0 7px 18px rgba(78,91,153,.15);
}
.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 {
    --story-shot-copy: #f7f2fa;
    --story-shot-muted: #beb5c6;
    --story-shot-panel: #292230;
    --story-shot-line: #4e4558;
    position: relative;
    padding: 17px 18px 18px;
    color: var(--story-shot-copy);
    background:
        radial-gradient(circle at 94% 7%, rgba(225,106,217,.09), transparent 25%),
        linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border: 1px solid rgba(178,182,223,.28);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(30,25,45,.16);
}
.shot-card .workbench-card-head {
    min-height: 48px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(178,182,223,.15);
}
.shot-card .workbench-card-number { min-width: 0; flex: 1 1 auto; gap: 12px; }
.shot-card .workbench-card-number > span {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    font-size: 12px;
    box-shadow: 0 6px 15px rgba(78,91,153,.16);
}
.shot-card-title-editor {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 1px;
}
.shot-card-title-editor > small {
    color: #ef82c5;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .08em;
}
.shot-card-title-input {
    width: 100%;
    height: 28px;
    min-width: 0;
    padding: 0;
    color: var(--story-shot-copy);
    background: transparent;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    font-size: 15px;
    font-weight: 780;
    line-height: 28px;
}
.shot-card-title-input::placeholder { color: rgba(190,181,198,.7); }
.shot-card-title-input:hover:not(:disabled) { background: rgba(178,182,223,.07); }
.shot-card-title-input:focus {
    padding: 0 7px;
    background: rgba(178,182,223,.1);
    outline: 2px solid rgba(178,182,223,.24);
    outline-offset: 1px;
}
.shot-card .workbench-card-actions { flex: 0 0 auto; }
.shot-card-delete-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #bdb5c6;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.shot-card-delete-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.shot-card-delete-button:hover:not(:disabled),
.shot-card-delete-button:focus-visible {
    color: var(--danger);
    background: rgba(201,59,138,.08);
    border-color: rgba(201,59,138,.14);
}
.shot-card-delete-button:disabled { cursor: default; opacity: .32; }
.shot-card .workbench-fields {
    margin-top: 15px;
    grid-template-columns: minmax(0, 1fr) 118px;
    align-items: start;
    gap: 15px;
}
.shot-card .workbench-field > span { color: var(--story-shot-muted); }
.shot-card .workbench-textarea,
.shot-card .shot-duration-input {
    color: var(--story-shot-copy);
    background: var(--story-shot-panel);
    border-color: var(--story-shot-line);
    box-shadow: none;
}
.shot-card .workbench-textarea::placeholder,
.shot-card .shot-duration-input::placeholder { color: rgba(190,181,198,.64); }
.shot-card .workbench-textarea:hover:not(:disabled),
.shot-card .shot-duration-input:hover:not(:disabled) { border-color: rgba(178,182,223,.46); }
.shot-card .workbench-textarea:focus,
.shot-card .shot-duration-input:focus {
    border-color: #7f89c8;
    outline: 3px solid rgba(127,137,200,.16);
}
.shot-card-prompt-field .workbench-textarea { min-height: 126px; }
.shot-card .shot-duration-unit { color: var(--story-shot-muted); }
.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: flex-end; 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-generation-controls { min-width: min(100%, 494px); display: grid; grid-template-columns: minmax(210px, 1.35fr) 94px auto; align-items: end; gap: 8px; flex: 0 0 auto; }
.shot-image-generation-field { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 720; }
.shot-image-generation-field > span { padding-left: 2px; }
.shot-image-generation-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 30px 0 11px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(78,91,153,.05);
    font: inherit;
    font-size: 10px;
    font-weight: 720;
}
.shot-image-generation-field select:hover:not(:disabled) { border-color: rgba(78,91,153,.34); }
.shot-image-generation-field select:focus-visible { outline: 3px solid rgba(78,91,153,.13); outline-offset: 2px; }
.shot-image-generation-field select:disabled { opacity: .62; cursor: not-allowed; }
.shot-image-generation-field--count select { text-align: center; }
.shot-image-generate-button { min-width: 164px; min-height: 38px; 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-version-history-toggle {
    width: 100%;
    min-height: 58px;
    margin: 14px 0 0;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 11px;
    color: var(--ink-soft);
    text-align: left;
    background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(178,182,223,.10), rgba(249,233,247,.34));
    border: 1px solid rgba(78,91,153,.16);
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(78,91,153,.055);
    font: inherit;
    transition: transform .18s var(--ease), border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.shot-version-history-toggle:hover { transform: translateY(-1px); border-color: rgba(78,91,153,.3); box-shadow: 0 11px 26px rgba(78,91,153,.09); }
.shot-version-history-toggle[aria-expanded="true"] { background: linear-gradient(135deg, rgba(178,182,223,.17), rgba(249,233,247,.54)); border-color: rgba(78,91,153,.25); box-shadow: none; }
.shot-version-history-toggle:focus-visible { outline: 3px solid rgba(78,91,153,.16); outline-offset: 2px; }
.shot-version-history-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--deep-blue); background: linear-gradient(145deg, rgba(178,182,223,.3), rgba(225,106,217,.13)); border: 1px solid rgba(78,91,153,.13); border-radius: 11px; }
.shot-version-history-icon::before { content: ''; width: 19px; height: 19px; display: block; 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='M3 12a9 9 0 1 0 3-6.7M3 4v5h5'/%3E%3Cpath d='M12 7v5l3 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7M3 4v5h5'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.shot-version-history-toggle-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shot-version-history-toggle-copy strong { color: var(--ink-soft); font-size: 12px; line-height: 1.35; font-weight: 780; }
.shot-version-history-toggle-copy small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.shot-version-history-chevron { color: var(--faint); font-size: 24px; line-height: 1; text-align: center; transform: rotate(90deg); transition: color .18s ease, transform .18s var(--ease); }
.shot-version-history-toggle:hover .shot-version-history-chevron { color: var(--deep-blue); }
.shot-version-history-toggle[aria-expanded="true"] .shot-version-history-chevron { color: var(--deep-blue); transform: rotate(-90deg); }
.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: 12px; }
.shot-version-history-heading span { color: var(--muted); font-size: 10px; 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: 10px; }
.shot-version-history-meta span { padding: 3px 6px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 9px; }
.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: 9px; font-weight: 720; }
.shot-version-history-candidate .text-button { min-height: 30px; padding: 3px 7px; font-size: 9px; }
.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: 10px; 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: 10px; }
.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(4, 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-field.is-model select { color: var(--deep-blue); background: linear-gradient(135deg, rgba(178,182,223,.22), rgba(225,106,217,.08), rgba(255,255,255,.9)); border-color: rgba(78,91,153,.24); font-weight: 760; }
.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-reference-mode { margin: 10px 0 0; padding: 0; border: 0; }
.shot-video-reference-mode legend { margin-bottom: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 760; }
.shot-video-reference-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.shot-video-reference-option { min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.shot-video-reference-option:hover { border-color: rgba(78,91,153,.34); }
.shot-video-reference-option.is-selected { border-color: rgba(78,91,153,.42); background: rgba(178,182,223,.14); box-shadow: 0 0 0 2px rgba(78,91,153,.05); }
.shot-video-reference-option input { width: 16px; height: 16px; accent-color: var(--deep-blue); }
.shot-video-reference-option > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shot-video-reference-option strong { color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.shot-video-reference-option small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.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: 36px;
    padding: 6px 13px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    background: linear-gradient(132deg,var(--deep-blue) 0 24%,#6574c4 42%,#c93b8a 58%,#e16ad9 100%);
    border: 1px solid rgba(255,255,255,.36);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(78,91,153,.22),0 0 0 1px rgba(78,91,153,.08);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .01em;
    transition: transform .18s ease,box-shadow .18s ease,filter .18s ease;
}
.shot-video-enhance-button::before { content: none; }
.shot-video-enhance-button.is-busy::before { content: none; }
.shot-video-enhance-button.is-busy > * { display: inline-grid; }
.shot-video-enhance-icon {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    display: inline-grid;
    place-items: center;
}
.shot-video-enhance-ring {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    border: 1.5px solid transparent;
    border-radius: 50%;
    transform-origin: 50% 50%;
}
.shot-video-enhance-spark {
    position: relative;
    display: block;
    color: #eff0ff;
    font-size: 11px;
    line-height: 1;
    transform: translateY(-.15px);
}
.shot-video-enhance-button.is-busy .shot-video-enhance-ring {
    border-color: rgba(255,255,255,.3);
    border-top-color: #fff;
    animation: spin .75s linear infinite;
}
.shot-video-enhance-button.is-busy .shot-video-enhance-spark { font-size: 8px; }
.shot-video-enhance-copy { display: inline-block; }
.shot-video-enhance-button:hover:not(:disabled) { transform: translateY(-1px); color: #fff; background: linear-gradient(132deg,#43508c 0 22%,#6b68b7 42%,#c93b8a 58%,#e16ad9 100%); filter: saturate(1.08); box-shadow: 0 11px 26px rgba(78,91,153,.28),0 0 18px rgba(225,106,217,.22); }
.shot-video-enhance-button:focus-visible { outline: 3px solid rgba(225,106,217,.24); outline-offset: 2px; }
.shot-video-enhance-button:disabled { color: rgba(255,255,255,.78); filter: saturate(.72); opacity: .74; }
.shot-video-prompt-input-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 1px;
    border-radius: 13px;
    /* Xiaomi Browser and some Android WebViews may inflate the editable
       textarea without inflating its coloured reading mirror. Lock both to
       the authored size while preserving normal page pinch zoom. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.shot-video-prompt-input-shell::before,
.shot-video-prompt-input-shell::after { content: ""; position: absolute; pointer-events: none; opacity: 0; }
.shot-video-prompt-input-shell::before {
    width: 160%;
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    z-index: -2;
    background: conic-gradient(from 0deg,transparent 0 48%,rgba(125,228,255,.92) 60%,rgba(178,182,223,.98) 72%,rgba(225,106,217,.98) 84%,transparent 96%);
    transform: translate(-50%,-50%);
}
.shot-video-prompt-input-shell::after { inset: 1px; z-index: -1; background: rgba(255,252,255,.98); border-radius: 11px; box-shadow: 0 0 24px rgba(225,106,217,.16); }
.shot-video-prompt-field.is-enhancing .shot-video-prompt-input-shell { box-shadow: 0 0 0 1px rgba(178,182,223,.2),0 0 26px rgba(78,91,153,.16); }
.shot-video-prompt-field.is-enhancing .shot-video-prompt-input-shell::before { opacity: 1; animation: shotPromptTraceRun 2.2s linear infinite; }
.shot-video-prompt-field.is-enhancing .shot-video-prompt-input-shell::after { opacity: 1; }
.shot-video-prompt-field.is-enhancing .shot-video-enhance-button { box-shadow: 0 0 0 1px rgba(255,255,255,.2),0 0 24px rgba(225,106,217,.34); }
.shot-video-prompt-field.is-tutorial-writing .shot-video-prompt-input-shell {
    box-shadow: 0 0 0 1px rgba(178,182,223,.24), 0 0 28px rgba(225,106,217,.2);
}
.shot-video-prompt-field.is-tutorial-writing .shot-video-prompt-input-shell::before {
    opacity: 1;
    animation: shotPromptTraceRun 2.2s linear infinite;
}
.shot-video-prompt-field.is-tutorial-writing .shot-video-prompt-input-shell::after { opacity: 1; }
.shot-video-prompt-field.is-ai-writing .shot-video-prompt-input-shell {
    box-shadow: 0 0 0 1px rgba(178,182,223,.28), 0 0 30px rgba(225,106,217,.22);
}
.shot-video-prompt-field.is-ai-writing .shot-video-prompt-input-shell::before {
    opacity: 1;
    animation: shotPromptTraceRun 1.8s linear infinite;
}
.shot-video-prompt-field.is-ai-writing .shot-video-prompt-input-shell::after { opacity: 1; }
.shot-video-prompt-field textarea.tutorial-shot-rework-writing[readonly] {
    color: var(--ink);
    border-color: transparent;
    outline: 0;
    cursor: default;
    text-shadow: 0 0 16px rgba(145,162,242,.24);
    animation: tutorialStoryInkGlow 1.25s ease-in-out infinite;
}
.shot-video-prompt-field textarea.ai-shot-prompt-writing[disabled] {
    color: var(--ink);
    border-color: transparent;
    outline: 0;
    cursor: default;
    text-shadow: 0 0 16px rgba(145,162,242,.24);
    animation: tutorialStoryInkGlow 1.25s ease-in-out infinite;
}
.shot-video-prompt-field textarea { position: relative; z-index: 1; width: 100%; min-height: 70px; padding: 11px 12px; display: block; 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-inline-highlight { position: absolute; left: 1px; top: 1px; z-index: 0; overflow: hidden; padding: 11px 12px; box-sizing: border-box; color: var(--ink); background: rgba(255,255,255,.76); border: 1px solid transparent; border-radius: 11px; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; pointer-events: none; font: inherit; font-size: 12px; line-height: 1.6; }
.shot-video-prompt-input-shell.has-inline-bindings textarea { color: transparent; caret-color: var(--ink); background: transparent; }
.shot-video-prompt-input-shell.has-inline-bindings textarea::selection { color: transparent; background: rgba(78,91,153,.18); }
.shot-video-prompt-inline-binding { color: var(--deep-blue); background: rgba(78,91,153,.12); border-radius: 4px; box-shadow: 0 0 0 2px rgba(78,91,153,.12); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.shot-video-prompt-inline-binding.is-location { color: #9c2f73; background: rgba(225,106,217,.12); box-shadow: 0 0 0 2px rgba(201,59,138,.10); }
.shot-video-prompt-inline-binding.is-prop { color: #76503e; background: rgba(184,139,106,.14); box-shadow: 0 0 0 2px rgba(155,104,70,.10); }
.shot-video-prompt-inline-binding.is-other { color: #655d75; background: rgba(178,182,223,.16); box-shadow: 0 0 0 2px rgba(178,182,223,.12); }
.shot-video-prompt-input-shell.is-composing .shot-video-prompt-inline-highlight { visibility: hidden; }
.shot-video-prompt-input-shell.is-composing textarea { color: var(--ink); background: rgba(255,255,255,.76); }
.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,.9); }
.shot-video-prompt-field.is-enhancing textarea { border-color: transparent; outline: 0; }
@media (forced-colors: active) {
    .shot-video-prompt-inline-highlight { display: none; }
    .shot-video-prompt-input-shell.has-inline-bindings textarea { color: CanvasText; background: Canvas; }
}
.shot-video-prompt-field small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.shot-video-binding-feedback { min-height: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.shot-video-binding-feedback[hidden] { display: none; }
.shot-video-binding-feedback-label { color: var(--muted); font-size: 8px; font-weight: 760; letter-spacing: .02em; }
.shot-video-binding-feedback-chips { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.shot-video-binding-chip { min-height: 25px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 5px; color: var(--deep-blue); background: rgba(78,91,153,.08); border: 1px solid rgba(78,91,153,.12); border-radius: 7px; font: inherit; font-size: 9px; font-weight: 790; line-height: 1; }
button.shot-video-binding-chip { cursor: pointer; }
.shot-video-binding-chip::after { content: ''; width: 4px; height: 4px; flex: 0 0 4px; background: var(--success); border-radius: 50%; }
.shot-video-binding-chip small { color: rgba(78,91,153,.72); font-size: 7px; font-weight: 760; }
.shot-video-binding-chip.is-location { color: #9c2f73; background: rgba(225,106,217,.09); border-color: rgba(201,59,138,.13); }
.shot-video-binding-chip.is-prop { color: #76503e; background: rgba(184,139,106,.10); border-color: rgba(155,104,70,.14); }
.shot-video-binding-chip.is-pending { color: var(--muted); background: rgba(178,182,223,.09); border-style: dashed; }
.shot-video-binding-chip.is-pending::after { display: none; }
.shot-video-binding-chip.is-ambiguous { color: var(--accent-dark); background: rgba(225,106,217,.09); border-color: rgba(201,59,138,.22); }
.shot-video-binding-chip.is-ambiguous::after { content: '›'; width: auto; height: auto; flex-basis: auto; color: var(--accent-dark); background: transparent; font-size: 12px; }
@keyframes shotPromptTraceRun {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to { transform: translate(-50%,-50%) rotate(360deg); }
}
.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-model { margin-top: 12px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: linear-gradient(135deg, rgba(178,182,223,.13), rgba(225,106,217,.055)); border: 1px solid rgba(78,91,153,.16); border-radius: 13px; }
.shot-video-adjustment-model > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shot-video-adjustment-model strong { color: var(--ink-soft); font-size: 11px; }
.shot-video-adjustment-model small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.shot-video-adjustment-model select { min-width: 150px; min-height: 38px; padding: 7px 30px 7px 11px; color: var(--deep-blue); background: rgba(255,255,255,.86); border: 1px solid rgba(78,91,153,.24); border-radius: 10px; font: inherit; font-size: 10px; font-weight: 760; }
.shot-video-adjustment-model select:focus { border-color: rgba(78,91,153,.5); 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-guidance { color: var(--deep-blue); background: linear-gradient(135deg,rgba(178,182,223,.16),rgba(249,233,247,.55)); border: 1px solid rgba(78,91,153,.18); }
.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;
}

/* Settings stage: one grid, one scale, one clear action hierarchy. */
.workbench-stage--settings {
    width: min(100%, 1240px);
    margin: 0 auto;
}
.settings-stage-heading { margin-bottom: 20px; }
.settings-stage-heading .eyebrow { margin-bottom: 9px; }
.settings-stage-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
.settings-stage-title-row h2 { font-size: clamp(30px,3vw,38px); }
.settings-stage-title-row > .primary-button {
    min-width: 136px;
    min-height: 46px;
    padding: 0 18px;
    flex: 0 0 auto;
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(78,91,153,.18);
}
.workbench-stage-heading.settings-stage-heading > p.settings-stage-intro {
    max-width: 760px;
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}
.workbench-stage--settings .setting-extraction-tool {
    display: grid;
    grid-template-columns: 46px minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(78,91,153,.055);
}
.workbench-stage--settings .setting-extraction-tool-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 14px;
    font-size: 19px;
}
.workbench-stage--settings .setting-extraction-tool-copy strong { margin-bottom: 4px; font-size: 15px; }
.workbench-stage--settings .setting-extraction-tool-copy p { max-width: 720px; font-size: 12px; line-height: 1.6; }
.workbench-stage--settings #extract-settings {
    min-width: 150px;
    min-height: 48px;
    padding: 6px 16px;
    place-content: center;
    border-radius: 13px;
    font-size: 12px;
    line-height: 1.15;
}
.workbench-stage--settings #extract-settings small { font-size: 9px; line-height: 1.15; }
.workbench-stage--settings #extract-settings.credit-action-button small { color: rgba(255,255,255,.8); }
.workbench-stage--settings .production-style-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: 17px 18px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(30,25,45,.035);
}
.workbench-stage--settings .production-style-card .setting-card-badge { margin-bottom: 7px; }
.workbench-stage--settings .production-style-card h3 { margin-bottom: 4px; font-size: 15px; }
.workbench-stage--settings .production-style-card p { font-size: 12px; line-height: 1.6; }
.workbench-stage--settings .production-style-tags { margin: 7px 0; gap: 6px; }
.workbench-stage--settings .production-style-tags span { padding: 4px 8px; font-size: 10px; }
.workbench-stage--settings .production-style-card > button {
    min-width: 104px;
    min-height: 42px;
    border-radius: 12px;
}
.workbench-stage--settings .settings-summary { margin: 0 0 12px; }
.workbench-stage--settings .setting-filters { margin-bottom: 14px; }

.management-dialog.setting-extraction-dialog {
    width: min(760px, calc(100vw - 32px));
}

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

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

.setting-extraction-dialog .setting-agent-state {
    min-height: 380px;
    padding: 26px;
    overflow: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 42%, rgba(225,106,217,.12), transparent 30%),
        radial-gradient(circle at 28% 18%, rgba(178,182,223,.22), transparent 32%),
        linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,244,250,.92));
    border: 1px solid rgba(78,91,153,.17);
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.76), 0 22px 70px rgba(78,91,153,.09);
}

.setting-agent-wait {
    width: min(100%, 480px);
    display: grid;
    justify-items: center;
    gap: 15px;
}

.setting-agent-orbit {
    position: relative;
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 42px;
    background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(178,182,223,.13));
    box-shadow: 0 20px 55px rgba(78,91,153,.16), inset 0 0 0 1px rgba(78,91,153,.12);
    isolation: isolate;
}

.setting-agent-halo,
.setting-agent-beam,
.setting-agent-node { position: absolute; pointer-events: none; }

.setting-agent-halo {
    inset: 11px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 18%, var(--deep-blue) 28%, var(--neon-pink) 47%, transparent 58% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    opacity: .78;
    animation: setting-agent-orbit 4.8s linear infinite;
}

.setting-agent-halo--inner {
    inset: 25px;
    opacity: .48;
    animation-duration: 3.4s;
    animation-direction: reverse;
}

.setting-agent-beam {
    z-index: -1;
    inset: -42% -20%;
    background: linear-gradient(90deg, transparent 38%, rgba(225,106,217,.12) 48%, rgba(78,91,153,.2) 52%, transparent 62%);
    transform: translateX(-52%) rotate(-18deg);
    animation: setting-agent-scan 3.8s var(--ease) infinite;
}

.setting-agent-core {
    position: relative;
    z-index: 2;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 12px 34px rgba(30,25,45,.12), inset 0 0 0 1px rgba(78,91,153,.12);
    animation: setting-agent-breathe 2.8s var(--ease) infinite;
}

.setting-agent-core img { width: 34px; height: 34px; }
.setting-agent-node { width: 8px; height: 8px; border-radius: 50%; background: var(--neon-pink); box-shadow: 0 0 0 5px rgba(225,106,217,.1), 0 0 20px rgba(225,106,217,.55); }
.setting-agent-node--one { top: 18px; right: 29px; animation: setting-agent-pulse 2.1s ease-in-out infinite; }
.setting-agent-node--two { right: 15px; bottom: 37px; background: var(--deep-blue); animation: setting-agent-pulse 2.1s .7s ease-in-out infinite; }
.setting-agent-node--three { left: 19px; bottom: 29px; width: 6px; height: 6px; animation: setting-agent-pulse 2.1s 1.4s ease-in-out infinite; }

.setting-agent-copy { display: grid; justify-items: center; gap: 5px; text-align: center; }
.setting-agent-kicker { color: var(--ribbon-pink); font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.setting-agent-copy strong { color: var(--ink); font-size: 20px; line-height: 1.25; letter-spacing: -.025em; }
.setting-agent-copy > span:last-child { min-height: 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.setting-agent-progress {
    width: min(100%, 340px);
    height: 4px;
    overflow: hidden;
    background: rgba(178,182,223,.28);
    border-radius: 99px;
}
.setting-agent-progress span {
    width: 42%;
    height: 100%;
    display: block;
    background: var(--credit-gradient);
    border-radius: inherit;
    animation: setting-agent-progress 2.6s ease-in-out infinite;
}
.setting-agent-stage-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: min(100%, 340px); }
.setting-agent-stage-list span { padding: 6px 8px; color: var(--faint); background: rgba(255,255,255,.58); border: 1px solid rgba(78,91,153,.09); border-radius: 9px; font-size: 9px; font-weight: 760; transition: color .35s ease, background .35s ease, border-color .35s ease; }
.setting-agent-stage-list span.is-complete { color: var(--deep-blue); background: rgba(178,182,223,.14); }
.setting-agent-stage-list span.is-active { color: #fff; background: var(--credit-gradient); border-color: transparent; box-shadow: 0 7px 18px rgba(201,59,138,.18); }

@keyframes setting-agent-orbit { to { transform: rotate(1turn); } }
@keyframes setting-agent-scan { 0%, 15% { transform: translateX(-58%) rotate(-18deg); } 72%, 100% { transform: translateX(58%) rotate(-18deg); } }
@keyframes setting-agent-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
@keyframes setting-agent-pulse { 0%, 100% { opacity: .45; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes setting-agent-progress { 0% { transform: translateX(-110%); } 58%, 100% { transform: translateX(245%); } }

.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) {
    .management-dialog.setting-extraction-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100svh - 20px);
    }

    .setting-extraction-shell {
        width: 100%;
        max-height: calc(100svh - 22px);
    }

    .setting-extraction-dialog .management-heading { padding: 18px 16px 15px; gap: 12px; }
    .setting-extraction-dialog .management-heading h2 { font-size: 21px; line-height: 1.18; }
    .setting-extraction-dialog .management-heading p:last-child { max-width: none; font-size: 10px; }
    .setting-extraction-body { min-height: 180px; padding: 14px; }
    .setting-extraction-dialog .settings-state { min-height: 210px; padding: 22px 14px; }
    .setting-extraction-dialog .setting-agent-state { min-height: 300px; padding: 22px 15px; border-radius: 18px; }
    .setting-agent-orbit { width: 112px; height: 112px; border-radius: 34px; }
    .setting-agent-core { width: 52px; height: 52px; border-radius: 16px; }
    .setting-agent-core img { width: 30px; height: 30px; }
    .setting-agent-copy strong { font-size: 18px; }
    .setting-extraction-dialog .management-footer { padding: 11px 14px calc(13px + env(safe-area-inset-bottom)); }
    .setting-extraction-dialog .management-footer > div { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .setting-extraction-dialog .management-footer .primary-button,
    .setting-extraction-dialog .management-footer .secondary-button { width: 100%; min-height: 44px; }
    .setting-extraction-dialog .management-footer .primary-button:only-child { grid-column: 1 / -1; }

    .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;
    }
}

@media (prefers-reduced-motion: reduce) {
    .setting-agent-halo,
    .setting-agent-beam,
    .setting-agent-core,
    .setting-agent-node,
    .setting-agent-progress span { animation: none !important; }
    .setting-agent-progress span { width: 64%; transform: none; }
}
.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; }
button.setting-card-preview { padding: 0; border: 0; cursor: zoom-in; }
button.setting-card-preview:focus-visible { outline: 3px solid rgba(225,106,217,.34); outline-offset: 3px; }
.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-preview-action { position: absolute; right: 9px; bottom: 9px; min-height: 24px; padding: 0 9px; display: inline-flex; align-items: center; color: #fff; background: rgba(78,91,153,.82); border: 1px solid rgba(255,255,255,.18); border-radius: 99px; font-size: 8px; font-weight: 780; box-shadow: 0 6px 18px rgba(30,25,45,.16); 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-voice { width: fit-content; min-height: 25px; margin: -3px 0 12px; padding: 0 9px; display: inline-flex; align-items: center; color: var(--deep-blue); background: linear-gradient(135deg, rgba(143,160,255,.16), rgba(225,106,217,.12)); border: 1px solid rgba(143,160,255,.22); border-radius: 99px; font-size: 8px; font-weight: 760; }
.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 { position: relative; 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: contain; }
.setting-generation-current-remove { position: absolute; top: 9px; right: 9px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: var(--ink); background: rgba(255,252,255,.94); border: 1px solid rgba(30,25,45,.16); border-radius: 50%; box-shadow: 0 5px 16px rgba(30,25,45,.12); font: 700 20px/1 system-ui,sans-serif; cursor: pointer; }
.setting-generation-current-remove:hover { color: var(--ribbon-pink); border-color: rgba(201,59,138,.34); }
.setting-generation-current-remove:focus-visible { outline: 3px solid rgba(78,91,153,.24); outline-offset: 2px; }
.setting-generation-current-remove:disabled { opacity: .55; cursor: wait; }
.setting-generation-current-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting-generation-current-actions .secondary-button { min-height: 38px; padding: 0 14px; font-size: 10px; }
.setting-generation-current-actions .is-reuse { color: var(--deep-blue); background: rgba(178,182,223,.18); border-color: rgba(78,91,153,.2); }
.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 > div { min-width: 0; flex: 1 1 auto; }
.setting-generation-current-title small { display: block; color: var(--deep-blue); font-size: 8px; font-weight: 780; }
.setting-generation-current-title input { width: min(100%, 360px); min-height: 45px; margin-top: 7px; padding: 0 11px; color: var(--ink); background: rgba(255,252,255,.78); border: 1px solid rgba(78,91,153,.18); border-radius: 10px; font: inherit; font-size: 18px; font-weight: 790; }
.setting-generation-current-title input:hover:not(:disabled) { border-color: rgba(78,91,153,.34); }
.setting-generation-current-title input:focus-visible { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; border-color: var(--deep-blue); }
.setting-generation-current-title input:disabled { color: var(--ink); opacity: .72; }
.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-voice, .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-voice { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(250px,.9fr); gap: 14px 18px; background: linear-gradient(145deg, rgba(178,182,223,.12), rgba(255,252,255,.9)); }
.setting-generation-voice[hidden] { display: none; }
.setting-generation-voice > .setting-generation-section-heading { grid-column: 1 / -1; }
.setting-generation-voice-description-field { margin: 0; }
.setting-generation-voice-description-field > span { font-size: 10px; font-weight: 780; }
.setting-generation-voice-description-field textarea { min-height: 118px; margin-top: 8px; padding: 12px 13px; line-height: 1.65; resize: vertical; }
.setting-generation-voice-sample { min-width: 0; padding: 12px; display: flex; flex-direction: column; justify-content: center; background: rgba(248,244,250,.62); border: 1px solid var(--line); border-radius: 12px; }
.setting-generation-voice-sample audio { width: 100%; height: 38px; }
.setting-generation-voice-sample > p { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.setting-generation-voice-sample > small { margin-top: 8px; color: var(--faint); font-size: 8px; }
.setting-generation-voice-sample-empty { min-height: 42px; display: flex; align-items: center; gap: 9px; color: var(--muted); }
.setting-generation-voice-sample-empty > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--deep-blue); background: rgba(178,182,223,.2); border-radius: 11px; font-size: 17px; }
.setting-generation-voice-sample-empty p { margin: 0; font-size: 9px; }
.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: contain; }
.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; }

/* Setting workspace: keep identity, visual generation, and voice as distinct jobs. */
.management-dialog.setting-generation-dialog { width: min(1040px, calc(100vw - 40px)); }
.setting-generation-shell { min-height: min(650px, calc(100vh - 34px)); }
.setting-generation-heading { padding: 21px 27px 17px; }
.setting-generation-heading h2 { font-size: 23px; }
.setting-generation-body { padding: 18px 22px 22px; }
.setting-generation-setup { display: block; }
.setting-generation-current { margin: 0; grid-template-columns: minmax(150px,.42fr) minmax(360px,1.58fr); gap: 18px; padding: 11px; border-radius: 18px; background: linear-gradient(135deg,rgba(178,182,223,.16),rgba(255,252,255,.98) 58%,rgba(225,106,217,.055)); }
.setting-generation-current-preview { min-height: 144px; }
.setting-generation-current-copy { padding: 5px 10px 5px 0; }
.setting-generation-current-title input { min-height: 42px; font-size: 17px; }
.setting-generation-current-copy > p { margin: 10px 0 13px; }
.setting-generation-tabs { margin: 14px 0 0; padding: 5px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; background: rgba(178,182,223,.13); border: 1px solid rgba(78,91,153,.12); border-radius: 15px; }
.setting-generation-tabs[hidden] { display: none; }
.setting-generation-tab { min-width: 0; min-height: 62px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--muted); text-align: left; background: transparent; border: 1px solid transparent; border-radius: 11px; cursor: pointer; transition: color .18s ease,background-color .18s ease,border-color .18s ease,box-shadow .18s ease; }
.setting-generation-tab:hover { color: var(--ink); background: rgba(255,252,255,.58); }
.setting-generation-tab.is-active { color: var(--deep-blue); background: rgba(255,252,255,.96); border-color: rgba(78,91,153,.16); box-shadow: 0 7px 20px rgba(78,91,153,.09); }
.setting-generation-tab:focus-visible { outline: 3px solid rgba(78,91,153,.2); outline-offset: 2px; }
.setting-generation-tab-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: var(--deep-blue); background: rgba(178,182,223,.21); border-radius: 10px; font-size: 16px; font-weight: 800; }
.setting-generation-tab.is-active .setting-generation-tab-icon { color: #fff; background: linear-gradient(135deg,var(--deep-blue),var(--ribbon-pink)); }
.setting-generation-tab > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.setting-generation-tab strong { color: inherit; font-size: 11px; }
.setting-generation-tab small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.setting-generation-visual-panel { margin-top: 12px; }
.setting-generation-visual-panel[hidden],.setting-generation-voice-panel[hidden] { display: none; }
.setting-generation-visual-workspace { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr); align-items: stretch; gap: 12px; }
.setting-generation-prompt-field,.setting-generation-reference-section { grid-column: auto; }
.setting-generation-prompt-field textarea { min-height: 194px; }
.setting-generation-reference-empty,.setting-generation-reference-selected { min-height: 108px; }
.setting-generation-generate-dock { margin-top: 12px; padding: 13px; display: grid; grid-template-columns: minmax(185px,.72fr) minmax(390px,1.45fr) auto; align-items: center; gap: 13px; background: linear-gradient(120deg,rgba(78,91,153,.1),rgba(225,106,217,.09)); border: 1px solid rgba(78,91,153,.14); border-radius: 16px; }
.setting-generation-generate-intro { min-width: 0; display: flex; align-items: center; gap: 9px; }
.setting-generation-generate-star { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; color: #fff; background: linear-gradient(135deg,var(--deep-blue),var(--ribbon-pink)); border-radius: 11px; font-size: 15px; box-shadow: 0 8px 18px rgba(201,59,138,.16); }
.setting-generation-generate-intro > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setting-generation-generate-intro strong { font-size: 11px; }
.setting-generation-generate-intro small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.setting-generation-generate-dock .setting-generation-controls { min-width: 0; padding: 0; display: grid; grid-column: auto; grid-template-columns: minmax(200px,1fr) auto; align-items: start; gap: 12px; background: transparent; border: 0; border-radius: 0; }
.setting-generation-generate-dock .setting-generation-model-field select { min-height: 40px; margin-top: 6px; }
.setting-generation-generate-dock .setting-generation-count-options { margin-top: 6px; grid-template-columns: repeat(3,42px); }
.setting-generation-generate-dock .setting-generation-count-options span { min-height: 40px; }
.setting-generation-generate-dock .setting-generation-count { min-width: 138px; }
.setting-generation-generate-action { align-self: end; }
.setting-generation-generate-action .primary-button { min-width: 124px; min-height: 40px; padding-inline: 16px; font-size: 10px; }
.setting-generation-voice-panel { margin-top: 12px; }
.setting-generation-voice { padding: 19px; grid-template-columns: minmax(0,1.05fr) minmax(300px,.95fr); gap: 15px 18px; border-radius: 17px; background: linear-gradient(140deg,rgba(178,182,223,.14),rgba(255,252,255,.97) 62%,rgba(225,106,217,.06)); }
.setting-generation-voice-description-field textarea { min-height: 148px; }
.setting-generation-voice-sample { min-height: 148px; padding: 15px; }
.setting-generation-dialog.is-setting-setup .setting-generation-footer-actions { justify-content: flex-end; }
.setting-generation-dialog.is-setting-setup .setting-generation-footer-actions .secondary-button { min-width: 130px; }

.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 { width: 100%; min-width: 0; flex: 1 1 auto; }
.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; }
.simple-shot-prompt-editor { min-width: 0; }
.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-heading.is-editing { align-items: stretch; }
.frame-shot-inline-editor { width: 100%; margin-top: 13px; padding: 17px; background: linear-gradient(145deg,rgba(178,182,223,.1),rgba(255,252,255,.94)); border: 1px solid rgba(78,91,153,.16); border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.frame-shot-inline-fields { display: grid; gap: 14px; }
.frame-shot-inline-field { min-width: 0; display: block; }
.frame-shot-inline-field > span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 790; }
.frame-shot-inline-field .workbench-input, .frame-shot-inline-field .workbench-textarea { width: 100%; background: rgba(255,255,255,.9); }
.frame-shot-inline-field.is-title .workbench-input { max-width: 680px; font-weight: 760; }
.frame-shot-inline-field.is-description .workbench-textarea { min-height: 190px; line-height: 1.75; }
.frame-shot-inline-editor-footer { min-height: 44px; margin-top: 13px; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(78,91,153,.1); }
.frame-shot-inline-feedback { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.frame-shot-inline-hint { color: var(--muted); font-size: 9px; line-height: 1.55; }
.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: 30px; padding: 3px 10px 3px 3px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 99px; font-size: 8px; font-weight: 720; }
.shot-reference-chip small { color: var(--muted); font-size: 7px; font-weight: 760; }
.shot-reference-chip::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; background: var(--success); border-radius: 50%; }
.shot-reference-chip.has-thumbnail::before { display: none; }
.shot-setting-thumbnail { width: 24px; height: 24px; flex: 0 0 24px; object-fit: cover; background: rgba(178,182,223,.16); border: 1px solid rgba(78,91,153,.12); border-radius: 50%; }
.shot-setting-thumbnail.is-placeholder { position: relative; }
.shot-setting-thumbnail.is-placeholder::before,
.shot-setting-thumbnail.is-placeholder::after { content: ''; position: absolute; left: 50%; background: rgba(78,91,153,.62); transform: translateX(-50%); }
.shot-setting-thumbnail.is-placeholder::before { top: 5px; width: 7px; height: 7px; border-radius: 50%; }
.shot-setting-thumbnail.is-placeholder::after { bottom: 4px; width: 12px; height: 7px; border-radius: 8px 8px 5px 5px; }
.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); }
.shot-reference-manage-chip { min-height: 30px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px; color: var(--deep-blue); background: rgba(78,91,153,.06); border: 1px dashed rgba(78,91,153,.25); border-radius: 99px; font: inherit; font-size: 8px; font-weight: 780; cursor: pointer; }
.shot-reference-manage-chip::before { content: '☷'; font-size: 10px; line-height: 1; }
.shot-reference-manage-chip:hover { color: #fff; background: var(--deep-blue); border-style: solid; }
.shot-reference-manage-chip:disabled { opacity: .46; cursor: not-allowed; }
.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-zoom input[type="range"] { touch-action: none; overscroll-behavior-x: none; }
.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-tutorial-playhead-destination::before { content: ''; position: absolute; top: -7px; bottom: -7px; left: var(--tutorial-playhead-target,22%); z-index: 9; width: 3px; background: #ff62b5; border-radius: 999px; box-shadow: 0 0 0 3px rgba(255,98,181,.18),0 0 14px rgba(255,98,181,.82); pointer-events: none; }
.rough-timeline-clip.is-tutorial-playhead-destination::after { content: attr(data-tutorial-target-label); position: absolute; top: -24px; left: var(--tutorial-playhead-target,22%); z-index: 9; padding: 3px 7px; color: #fff; background: #d73c92; border-radius: 999px; box-shadow: 0 4px 12px rgba(12,8,18,.3); font-size: 7px; font-weight: 850; white-space: nowrap; pointer-events: none; transform: translateX(-50%); }
.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.is-tutorial-awaiting-drag::before {
    animation: tutorialPlayheadLocate .72s ease-in-out infinite;
}
.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-playhead:has(.rough-timeline-playhead-handle)::before { display: none; }
.rough-timeline-playhead-handle { position: absolute; z-index: 2; top: 0; left: 50%; width: 44px; height: 30px; transform: translateX(-50%); touch-action: none; cursor: ew-resize; }
.rough-timeline-playhead-handle::before { content: ''; position: absolute; left: 50%; top: 2px; width: 14px; height: 14px; transform: translateX(-50%); border-radius: 50%; background: #ff62b5; box-shadow: 0 0 0 3px rgba(255,98,181,.16); }
.rough-timeline-playhead.is-tutorial-awaiting-drag .rough-timeline-playhead-handle::before { animation: tutorialPlayheadLocate .9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .rough-timeline-playhead.is-tutorial-awaiting-drag .rough-timeline-playhead-handle::before { animation: none; } }
@keyframes tutorialPlayheadLocate {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255,98,181,.18), 0 0 8px rgba(255,98,181,.55); }
    50% { box-shadow: 0 0 0 7px rgba(255,98,181,.16), 0 0 18px rgba(255,98,181,.9); }
}
.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-rendering-status {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255,255,255,.9);
    background:
        radial-gradient(circle at 50% 46%,rgba(78,91,153,.22),transparent 34%),
        rgba(9,8,13,.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}
.rough-monitor-rendering-status[hidden] { display: none; }
.rough-monitor-rendering-layout {
    width: 36px;
    display: grid;
    grid-template-columns: repeat(3,12px);
    grid-template-rows: 27px auto;
    align-items: center;
    justify-items: center;
    row-gap: 11px;
}
.rough-monitor-rendering-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    width: 36px;
    grid-template-columns: repeat(3,12px);
    justify-items: center;
    font-size: 12px;
    font-weight: 720;
    letter-spacing: 0;
    line-height: 1.2;
}
.rough-monitor-rendering-copy > span { display: block; width: 12px; }
.rough-monitor-rendering-spinner {
    width: 27px;
    height: 27px;
    box-sizing: border-box;
    display: block;
    flex: 0 0 27px;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    border: 2px solid rgba(178,182,223,.24);
    border-top-color: #b2b6df;
    border-right-color: #e16ad9;
    border-radius: 50%;
    animation: roughMonitorRenderingSpin .85s linear infinite;
}
.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-step-eyebrow {
    margin: 0 0 8px;
    color: #ef5ba7;
    font-size: 9px;
    font-weight: 840;
    letter-spacing: .14em;
    line-height: 1.1;
}
.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) {
    .shot-video-prompt-field.is-enhancing .shot-video-prompt-input-shell::before,
    .delivery-trace-glow,
    .delivery-trace-core,
    .delivery-processing-screen,
    .delivery-ready .final-video-preview,
    .delivery-progress li.is-active span { animation: none; }
    .shot-video-prompt-field.is-enhancing .shot-video-prompt-input-shell::before { background: linear-gradient(135deg,rgba(125,228,255,.9),rgba(178,182,223,.95),rgba(225,106,217,.95)); }
}
@media (max-width: 700px) {
    .delivery-step-eyebrow { margin-bottom: 6px; font-size: 8px; }
    .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%; }
}

/* Delivery master and quality enhancement: approved cinematic UI. */
.delivery-stage.is-ready { width: 100%; padding-top: 0; }
.delivery-cinema {
    width: 100%;
    position: relative;
    overflow: hidden;
    color: #fffaff;
    background:
        radial-gradient(circle at 72% -8%,rgba(225,106,217,.13),transparent 30%),
        radial-gradient(circle at 13% 55%,rgba(78,91,153,.12),transparent 34%),
        #100d15;
    border: 1px solid rgba(214,204,232,.14);
    border-radius: 26px;
    box-shadow: 0 28px 80px rgba(12,8,18,.35);
}
.delivery-cinema::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .08;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}
.delivery-cinema-head {
    min-height: 58px;
    padding: 14px 20px 12px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.delivery-cinema-heading-copy { min-width: 0; }
.delivery-cinema-head h3 {
    margin: 0;
    font-family: inherit;
    font-size: 17px;
    font-weight: 780;
    letter-spacing: -.01em;
}
.delivery-cinema-head p { margin: 4px 0 0; color: #a99eaf; font-size: 8px; }
.delivery-original-retained {
    padding: 7px 10px;
    color: #cbd2ff;
    background: rgba(112,128,230,.12);
    border-radius: 9px;
    font-size: 8px;
    white-space: nowrap;
}
.delivery-original-retained::before { content: "✓"; margin-right: 5px; }
.delivery-screening-room {
    margin: 0 20px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: #070609;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    box-shadow: inset 0 0 70px rgba(0,0,0,.9),0 20px 48px rgba(0,0,0,.26);
}
.delivery-master-bar {
    min-height: 40px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #c8becd;
    background: rgba(255,255,255,.035);
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: 8px;
}
.delivery-master-bar-copy { min-width: 0; }
.delivery-master-bar strong { color: #f7f0f7; font-size: 9px; font-weight: 700; }
.delivery-master-bar em { margin-left: 7px; color: #8f8497; font-style: normal; }
.delivery-cinema-download {
    min-height: 30px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d7dcff;
    background: transparent;
    border: 0;
    text-decoration: none;
    white-space: nowrap;
}
.delivery-cinema-download svg,
.delivery-complete-download svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.delivery-cinema-stage {
    min-height: min(72vh,720px);
    padding: 20px;
    position: relative;
    display: grid;
    place-items: center;
    background:
        linear-gradient(90deg,rgba(0,0,0,.74),transparent 28% 72%,rgba(0,0,0,.74)),
        radial-gradient(ellipse at 50% 104%,rgba(146,105,179,.2),transparent 43%),
        linear-gradient(180deg,#0b0910,#08070a);
}
.delivery-cinema-stage::before {
    content: "";
    width: 300px;
    height: 38px;
    position: absolute;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse,rgba(225,106,217,.22),transparent 68%);
    filter: blur(8px);
}
.delivery-film-frame.final-video-preview {
    width: min(760px,calc(100vw - 150px));
    height: auto;
    min-height: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
    aspect-ratio: var(--delivery-aspect,9/16);
    background: linear-gradient(150deg,#514b7c,#28284f 44%,#1f1825 76%);
    border: 1px solid rgba(255,255,255,.19);
    border-radius: 9px;
    box-shadow: 0 18px 44px rgba(0,0,0,.65),0 0 42px rgba(110,103,191,.11);
}
.delivery-film-frame.final-video-preview.is-portrait { width: min(360px,42vw); }
.delivery-film-frame.final-video-preview.is-square { width: min(540px,58vw); }
.delivery-film-frame .shot-video-play-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    background: rgba(25,19,34,.64);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.delivery-film-frame .shot-video-play-icon { width: 30px; height: 30px; flex: 0 0 30px; }
.delivery-film-frame .shot-video-play-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.delivery-film-frame video { width: 100%; height: 100%; object-fit: contain; }
.delivery-enhance-scan {
    height: 34%;
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    top: -34%;
    opacity: 0;
    pointer-events: none;
    will-change: transform,opacity;
}
.delivery-enhance-scan::before {
    content: "";
    position: absolute;
    inset: 0 -8%;
    background: linear-gradient(180deg,transparent,rgba(177,188,255,.04) 20%,rgba(225,106,217,.16) 64%,rgba(210,222,255,.34) 82%,transparent);
}
.delivery-enhance-scan::after {
    content: "";
    height: 1px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,#7383e8 0%,#aebaff 24%,#f394dc 52%,#dbe4ff 78%,#9cafff 100%);
    box-shadow: 0 0 8px rgba(174,186,255,.9),0 0 22px rgba(225,106,217,.48);
}
.delivery-enhance-frame-tag {
    position: absolute;
    z-index: 5;
    top: 9px;
    left: 9px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #eef0ff;
    background: rgba(18,14,25,.68);
    border: 1px solid rgba(197,203,255,.18);
    border-radius: 7px;
    font-size: 7px;
    letter-spacing: .04em;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .28s ease,transform .28s ease;
    backdrop-filter: blur(9px);
}
.delivery-enhance-frame-tag i { width: 5px; height: 5px; background: #bfc8ff; border-radius: 50%; box-shadow: 0 0 9px rgba(191,200,255,.78); }
.delivery-enhance-frame-tag b { font-weight: 500; }
.delivery-cinema.is-enhancing .delivery-film-frame { border-color: rgba(190,199,255,.5); box-shadow: 0 18px 44px rgba(0,0,0,.65),0 0 34px rgba(113,127,224,.22),0 0 48px rgba(225,106,217,.08); }
.delivery-cinema.is-enhancing .delivery-film-frame .shot-video-play-button { opacity: 0; pointer-events: none; }
.delivery-cinema.is-enhancing .delivery-enhance-scan { animation: deliveryDetailPass 2.7s linear infinite; }
.delivery-cinema.is-enhancing .delivery-enhance-frame-tag,
.delivery-cinema.is-enhance-complete .delivery-enhance-frame-tag { opacity: 1; transform: translateY(0); }
.delivery-cinema.is-enhance-complete .delivery-film-frame { filter: contrast(1.06) saturate(1.05); border-color: rgba(190,199,255,.5); box-shadow: 0 18px 44px rgba(0,0,0,.65),0 0 34px rgba(113,127,224,.17); }
.delivery-cinema.is-enhance-complete.is-viewing-original .delivery-film-frame { filter: none; border-color: rgba(255,255,255,.19); box-shadow: 0 18px 44px rgba(0,0,0,.65); }
.delivery-finish-dock {
    margin: 14px 20px 18px;
    padding: 12px;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(150px,.72fr) minmax(250px,1fr) minmax(130px,.58fr);
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(214,204,232,.13);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    backdrop-filter: blur(18px);
}
.delivery-dock-copy > strong { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.delivery-dock-copy > span { display: block; margin-top: 3px; color: #918697; font-size: 7px; }
.delivery-spark { font-size: 15px; line-height: 1; color: #d6d9ff; background: linear-gradient(135deg,#b8c2ff,#ec79d9); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.delivery-resolutions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.delivery-resolution-option {
    min-width: 0;
    min-height: 50px;
    padding: 6px 4px;
    color: #fffaff;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(196,184,224,.18);
    border-radius: 10px;
    cursor: pointer;
}
.delivery-resolution-option[aria-pressed="true"] { background: linear-gradient(145deg,rgba(112,128,230,.28),rgba(225,106,217,.14)); border-color: rgba(178,182,223,.78); box-shadow: inset 0 0 0 1px rgba(178,182,223,.17),0 8px 22px rgba(19,14,28,.16); }
.delivery-resolution-option:disabled { color: rgba(255,250,255,.42); background: rgba(255,255,255,.02); border-color: rgba(196,184,224,.1); cursor: not-allowed; opacity: .56; box-shadow: none; }
.delivery-resolution-option[aria-pressed="true"]:disabled { background: rgba(255,255,255,.035); border-color: rgba(196,184,224,.14); box-shadow: none; }
.delivery-resolution-option strong { display: block; font-size: 12px; }
.delivery-resolution-option small { display: block; margin-top: 3px; color: #b8aec3; font-size: 7px; }
.delivery-resolution-option em { display: inline-block; margin-left: 3px; color: #ff9bd8; font-size: 6px; font-style: normal; vertical-align: top; }
.delivery-enhance-start {
    min-height: 50px;
    padding: 0 12px;
    color: #fff;
    background: linear-gradient(110deg,#5d6cca,#935bbf 54%,#dc4daf);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 12px 28px rgba(185,62,156,.18);
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.delivery-enhance-start:disabled { cursor: not-allowed; opacity: .54; box-shadow: none; }
.delivery-process-dock { grid-column: 1/-1; display: grid; grid-template-columns: minmax(130px,.48fr) minmax(250px,1.2fr) auto; align-items: center; gap: 15px; }
.delivery-process-label strong { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.delivery-process-label strong::before { content: ""; width: 6px; height: 6px; background: #bfc8ff; border-radius: 50%; box-shadow: 0 0 10px rgba(191,200,255,.82); }
.delivery-process-label span,.delivery-process-meta { color: #918697; font-size: 7px; }
.delivery-process-label span { display: block; margin: 4px 0 0 13px; }
.delivery-process-track { height: 7px; position: relative; overflow: visible; background: rgba(255,255,255,.055); border-radius: 999px; box-shadow: inset 0 1px 2px rgba(0,0,0,.34),0 0 0 1px rgba(255,255,255,.025); }
.delivery-process-track::after { content: ""; position: absolute; inset: 1px 4px; z-index: 2; background: repeating-linear-gradient(90deg,transparent 0 20px,rgba(255,255,255,.09) 20px 21px); border-radius: inherit; pointer-events: none; }
.delivery-process-track i { height: 100%; position: relative; display: block; background: linear-gradient(90deg,#7383e8 0%,#a887ef 44%,#e16ad9 76%,#9cafff 100%); background-size: 180% 100%; border-radius: inherit; box-shadow: 0 0 12px rgba(225,106,217,.22); transition: width .55s ease; animation: deliveryProgressFlow 2.1s linear infinite; }
.delivery-process-track i::after { content: ""; width: 7px; height: 7px; position: absolute; right: -2px; top: 50%; transform: translateY(-50%); background: #eef0ff; border: 2px solid rgba(174,186,255,.78); border-radius: 50%; box-shadow: 0 0 0 4px rgba(174,186,255,.08),0 0 14px rgba(225,106,217,.66); }
.delivery-process-value { min-width: 38px; color: #eef0ff; font-size: 12px; text-align: right; }
.delivery-process-meta { grid-column: 2/4; text-align: right; }
.delivery-complete-dock { grid-column: 1/-1; display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: center; gap: 14px; }
.delivery-complete-copy { display: flex; align-items: center; gap: 8px; }
.delivery-complete-check { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; color: #aeb8ff; }
.delivery-complete-check svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.delivery-complete-copy strong { display: block; font-size: 11px; }
.delivery-complete-copy span { display: block; margin-top: 4px; color: #918697; font-size: 7px; }
.delivery-complete-actions { display: flex; align-items: center; gap: 5px; }
.delivery-complete-actions::before { content: ""; width: 1px; height: 20px; margin-right: 4px; background: rgba(214,204,232,.09); }
.delivery-complete-compare,.delivery-complete-download { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-size: 8px; text-decoration: none; }
.delivery-complete-compare { color: #aaa1af; background: transparent; border: 0; }
.delivery-complete-download { color: #dce1ff; background: rgba(121,135,224,.1); border: 1px solid rgba(167,177,240,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.delivery-cinema-note { margin: 10px 24px 18px; position: relative; z-index: 1; color: #827887; font-size: 7px; line-height: 1.5; text-align: right; }
.delivery-enhancement-error { margin: 10px 20px 18px; position: relative; z-index: 1; color: #ffb1d7; font-size: 8px; text-align: center; }
@keyframes deliveryDetailPass { 0% { transform: translateY(0); opacity: 0; } 7% { opacity: 1; } 93% { opacity: 1; } 100% { transform: translateY(394%); opacity: 0; } }
@keyframes deliveryProgressFlow { from { background-position: 100% 0; } to { background-position: -80% 0; } }

@media (prefers-reduced-motion: reduce) {
    .delivery-cinema.is-enhancing .delivery-enhance-scan { animation: none; transform: translateY(197%); opacity: .72; }
    .delivery-process-track i { animation: none; }
}
@media (max-width: 700px) {
    .delivery-stage.is-ready { padding-top: 0; }
    .delivery-cinema { border-radius: 19px; }
    .delivery-cinema-head { min-height: 50px; padding: 11px 13px 10px; align-items: center; gap: 10px; }
    .delivery-cinema-head h3 { font-size: 15px; }
    .delivery-cinema-head p { font-size: 7px; line-height: 1.45; }
    .delivery-original-retained { padding: 6px 7px; font-size: 7px; }
    .delivery-screening-room { margin: 0 12px; border-radius: 14px; }
    .delivery-master-bar { padding: 0 9px; }
    .delivery-master-bar-copy { overflow: hidden; }
    .delivery-master-bar strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .delivery-master-bar em { display: block; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; }
    .delivery-cinema-download span { display: none; }
    .delivery-cinema-stage { min-height: min(72svh,600px); padding: 12px 8px; }
    .delivery-film-frame.final-video-preview,
    .delivery-film-frame.final-video-preview.is-portrait { width: min(330px,calc(100vw - 52px)); }
    .delivery-film-frame.final-video-preview.is-square { width: min(330px,calc(100vw - 52px)); }
    .delivery-finish-dock { margin: 12px 12px 14px; padding: 12px; display: block; }
    .delivery-dock-copy { margin-bottom: 11px; }
    .delivery-enhance-start { width: 100%; margin-top: 10px; }
    .delivery-cinema-note { margin: 9px 14px 14px; text-align: center; }
    .delivery-process-dock { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; }
    .delivery-process-value { grid-column: 2; grid-row: 1; }
    .delivery-process-track { height: 3px; grid-column: 1/-1; grid-row: 2; }
    .delivery-process-track::after { display: none; }
    .delivery-process-track i::after { width: 5px; height: 5px; right: -1px; border-width: 1px; }
    .delivery-process-meta { grid-column: 1/-1; grid-row: 3; text-align: left; }
    .delivery-complete-dock { display: grid; grid-template-columns: 1fr; gap: 8px; }
    .delivery-complete-actions { justify-content: flex-end; }
    .delivery-complete-actions::before { display: none; }
    .delivery-complete-compare,.delivery-complete-download { width: auto; padding: 0 9px; }
}

.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; min-height: 76px; padding: 10px; display: block; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 12px; }
.shot-reference-option-main { min-width: 0; padding-right: 30px; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 9px; 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 { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; margin: 0; 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 { position: absolute; right: 7px; bottom: 7px; width: 30px; height: 30px; min-height: 0; padding: 0; display: grid; place-items: center; color: var(--deep-blue); background: rgba(78,91,153,.08); border: 1px solid rgba(78,91,153,.16); border-radius: 9px; box-shadow: none; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.shot-reference-edit svg { width: 15px; height: 15px; 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 { 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: 48px; height: 48px; 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 { width: min(100%, 390px); flex: 0 0 auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); 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; }
.agent-generation-state {
    --agent-loop-duration: 4.8s;
    --agent-loop-delay: 0s;
    --agent-scan-distance: 77px;
    position: relative;
    isolation: isolate;
    min-height: 100%;
    padding: 42px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(225,106,217,.22), transparent 32%),
        radial-gradient(circle at 82% 72%, rgba(78,91,153,.34), transparent 38%),
        linear-gradient(145deg, #171322 0%, #211a32 54%, #181526 100%);
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 22px 54px rgba(30,25,45,.14);
}
.agent-generation-state::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .42;
    background-image:
        linear-gradient(rgba(178,182,223,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(178,182,223,.08) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000, transparent 92%);
}
.agent-generation-state::after {
    content: '';
    position: absolute;
    inset: -45% -25%;
    z-index: -1;
    background: conic-gradient(from 180deg, transparent 0 34%, rgba(225,106,217,.12) 42%, transparent 52% 72%, rgba(78,91,153,.15) 82%, transparent 90%);
    animation: agent-field-turn var(--agent-loop-duration) linear var(--agent-loop-delay) infinite;
}
.agent-generation-visual {
    position: relative;
    width: 132px;
    height: 132px;
    margin-bottom: 20px;
    display: grid;
    place-items: center;
}
.agent-generation-field {
    position: absolute;
    inset: 12px;
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(78,91,153,.22), rgba(225,106,217,.1));
    border: 1px solid rgba(178,182,223,.2);
    box-shadow: 0 0 52px rgba(225,106,217,.18), inset 0 0 28px rgba(78,91,153,.2);
    transform: rotate(45deg);
}
.agent-generation-orbit {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(178,182,223,.26);
    border-radius: 50%;
}
.agent-generation-orbit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -4px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: #e16ad9;
    box-shadow: 0 0 14px #e16ad9;
}
.agent-generation-orbit.is-a { animation: agent-orbit var(--agent-loop-duration) linear var(--agent-loop-delay) infinite; }
.agent-generation-orbit.is-b { inset: 24px; border-color: rgba(92,108,191,.42); animation: agent-orbit-reverse var(--agent-loop-duration) linear var(--agent-loop-delay) infinite; }
.agent-generation-orbit.is-b::after { background: #b2b6df; box-shadow: 0 0 13px rgba(178,182,223,.9); }
.agent-generation-core {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5968ad 0 49%, #d74cba 51% 100%);
    box-shadow: 0 0 0 7px rgba(255,255,255,.04), 0 0 32px rgba(225,106,217,.34);
    animation: agent-core-breathe var(--agent-loop-duration) ease-in-out var(--agent-loop-delay) infinite;
}
.agent-generation-core::before,
.agent-generation-core::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 999px;
}
.agent-generation-core::before { width: 20px; height: 4px; left: 11px; top: 19px; }
.agent-generation-core::after { width: 4px; height: 20px; left: 19px; top: 11px; }
.agent-generation-scan {
    position: absolute;
    top: 27px;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #f08adf 22%, #fff 50%, #8fa0ee 78%, transparent);
    box-shadow: 0 0 14px rgba(225,106,217,.9);
    will-change: transform, opacity;
    animation: agent-scan var(--agent-loop-duration) ease-in-out var(--agent-loop-delay) infinite;
}
.agent-generation-kicker {
    color: #e777cf;
    font: 780 9px/1.2 'JetBrains Mono', monospace;
    letter-spacing: .15em;
}
.agent-generation-state h3 { margin: 9px 0 0; font-size: 22px; letter-spacing: -.025em; }
.agent-generation-state p { max-width: 540px; margin: 10px 0 17px; color: rgba(245,241,250,.68); font-size: 12px; line-height: 1.72; }
.agent-generation-status {
    min-height: 30px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.86);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(178,182,223,.18);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}
.agent-generation-status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e16ad9;
    box-shadow: 0 0 0 0 rgba(225,106,217,.48);
    animation: agent-status-pulse var(--agent-loop-duration) ease-out var(--agent-loop-delay) infinite;
}
.agent-generation-status strong { font-size: 10px; font-weight: 720; }
.agent-generation-state small { margin-top: 10px; color: rgba(245,241,250,.44); font-size: 9px; line-height: 1.5; }
@keyframes agent-field-turn { from { transform: rotate(0turn); } to { transform: rotate(1turn); } }
@keyframes agent-orbit { from { transform: rotate(0turn); } to { transform: rotate(1turn); } }
@keyframes agent-orbit-reverse { from { transform: rotate(0turn); } to { transform: rotate(-1turn); } }
@keyframes agent-core-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes agent-scan {
    0%,100% { transform: translate3d(0,0,0); opacity: 0; }
    12%,88% { opacity: .58; }
    50% { transform: translate3d(0,var(--agent-scan-distance),0); opacity: 1; }
}
@keyframes agent-status-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(225,106,217,.48); }
    42% { box-shadow: 0 0 0 7px rgba(225,106,217,0); }
    43%,72% { box-shadow: 0 0 0 0 rgba(225,106,217,0); }
}
.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-restart { min-width: 88px; min-height: 40px; padding: 0 13px; margin-left: auto; flex: 0 0 auto; border: 0; border-radius: 11px; cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.model-audition-result-label { align-self: center; color: var(--muted); font-size: 10px; font-weight: 720; }
.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; }
.edit-production-dialog .dialog-body { padding-top: 3px; }
.edit-production-dialog .field textarea { min-height: 118px; }
.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: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 9px; pointer-events: none; }
.toast-region > .toast { 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(0, 1fr) 118px; }
    .shot-card .workbench-field:last-child { grid-column: auto; max-width: none; }
    .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) {
    .setting-generation-current-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .setting-generation-current-actions .secondary-button { width: 100%; min-width: 0; padding-inline: 8px; }
    .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: 44px;
        height: 44px;
        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: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
    .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; }
    body.agent-view-open .mobile-topbar { display: none; }
    body.agent-view-open .app-main { height: var(--agent-shell-height, calc(100svh - 92px - env(safe-area-inset-bottom))); padding-top: 0; }
    body.agent-view-open .app-view--agent { height: 100%; min-height: 0; padding: 0; }
    .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-complete-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 26px;
    }
    .tutorial-complete-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    .frames-complete-content {
        min-height: calc(100dvh - 20px);
        padding: calc(54px + env(safe-area-inset-top)) 24px calc(30px + env(safe-area-inset-bottom));
    }
    .tutorial-complete-content { min-height: 100dvh; }
    .frames-complete-close { top: calc(12px + env(safe-area-inset-top)); right: 14px; }
    .frames-complete-mark { width: 88px; height: 88px; margin-bottom: 20px; border-radius: 27px; }
    .frames-complete-mark svg { width: 56px; height: 56px; }
    .frames-complete-content h2 { font-size: clamp(55px, 18vw, 76px); }
    .frames-complete-content h3 { margin-top: 18px; font-size: 25px; }
    .frames-complete-copy { margin: 14px 0 26px; font-size: 13px; }
    .frames-complete-next { min-height: 56px; border-radius: 17px; }
    .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: 14px 14px 15px; border-radius: 18px; }
    .shot-card .workbench-card-head {
        min-height: 48px;
        padding-bottom: 13px;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
    }
    .shot-card .workbench-card-number { gap: 10px; }
    .shot-card .workbench-card-number > span { width: 40px; height: 40px; flex-basis: 40px; }
    .shot-card-title-input { height: 27px; font-size: 16px; line-height: 27px; }
    .shot-card .workbench-card-actions { width: auto; margin: 0; flex-wrap: nowrap; }
    .shot-card-delete-button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
    .shot-card .workbench-fields { margin-top: 14px; gap: 14px; }
    .shot-card-prompt-field .workbench-textarea { min-height: 154px; font-size: 15px; line-height: 1.68; }
    .shot-card-duration-field { max-width: 150px; }
    .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-generation-controls { min-width: 0; width: 100%; grid-template-columns: minmax(0, 1fr) 92px; }
    .shot-image-generation-field select { min-height: 44px; font-size: 11px; }
    .shot-image-generate-button { width: 100%; min-height: 44px; }
    .shot-image-generation-controls .shot-image-generate-button { grid-column: 1 / -1; }
    .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-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: repeat(2, minmax(0, 1fr)); }
    .shot-video-reference-mode-options { 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-model { align-items: stretch; flex-direction: column; gap: 8px; }
    .shot-video-adjustment-model select { width: 100%; min-height: 44px; }
    .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 { padding: 13px; }
    .frame-shot-inline-field.is-title .workbench-input { max-width: none; }
    .frame-shot-inline-field.is-description .workbench-textarea { min-height: 160px; }
    .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-manage-chip { min-height: 30px; padding-inline: 10px; }
    .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: repeat(2,minmax(0,1fr)); gap: 8px; }
    .shot-reference-option { min-height: 76px; padding: 8px; }
    .shot-reference-option-main { padding-right: 25px; grid-template-columns: 42px minmax(0,1fr); gap: 7px; }
    .shot-reference-thumb { width: 42px; height: 42px; border-radius: 9px; }
    .shot-reference-option-copy strong { font-size: 10px; }
    .shot-reference-option-copy span { margin-top: 4px; font-size: 7px; }
    .shot-reference-option input { right: 6px; top: 6px; width: 17px; height: 17px; }
    .shot-reference-edit { right: 6px; bottom: 6px; width: 27px; height: 27px; border-radius: 8px; }
    .shot-reference-edit svg { width: 14px; height: 14px; }
    .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 { min-height: 96px; padding: 13px; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; }
    .story-generation-option-mark { width: 42px; height: 42px; border-radius: 13px; }
    .story-generation-option em { grid-column: 3; }
    .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; }
    .agent-generation-state { --agent-scan-distance: 65px; min-height: 100%; padding: 30px 16px; border-radius: 17px; }
    .agent-generation-visual { width: 112px; height: 112px; margin-bottom: 16px; }
    .agent-generation-state h3 { font-size: 20px; }
    .agent-generation-state p { max-width: 320px; margin-bottom: 15px; font-size: 11px; }
    .agent-generation-scan { top: 23px; }
    .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 { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .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; }
    .story-breakdown-panel { grid-template-columns: 42px minmax(0,1fr); padding: 15px; gap: 12px; }
    .story-breakdown-icon { width: 42px; height: 42px; }
    .story-breakdown-actions { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: 8px; }
    .story-breakdown-actions .primary-button,
    .story-breakdown-actions .text-button { width: 100%; min-width: 0; min-height: 46px; padding: 0 10px; }
    .story-breakdown-actions .text-button[hidden] + .primary-button { grid-column: 1 / -1; }
    .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-actions .secondary-button[hidden] + .primary-button { grid-column: 1 / -1; }
    .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: 82px; padding: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px 14px; }
    .wallet-balance-details dd { margin: 0; font-size: 14px; }
    .wallet-balance-details div > span { grid-column: 1 / -1; }
    .wallet-balance-token-reference { align-items: flex-start; flex-direction: column; gap: 2px; border-radius: 13px; }
    .wallet-section { padding: 19px 16px; border-radius: 17px; }
    .wallet-section-heading { align-items: flex-start; gap: 12px; }
    .wallet-history-link { min-height: 40px; margin: -5px -4px 0 0; }
    .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-redemption-form { grid-template-columns: 1fr; }
    .wallet-redemption-form button { width: 100%; }
    .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)); }
    .payment-checkout-dialog { width: calc(100vw - 20px); }
    .payment-checkout-card { border-radius: 19px; }
    .payment-checkout-heading { padding: 20px 18px 15px; }
    .payment-checkout-heading h2 { font-size: 21px; }
    .payment-checkout-body { padding: 17px 18px; }
    .payment-checkout-actions { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
    .payment-checkout-qr { grid-template-columns: 118px 1fr; gap: 13px; padding: 13px; }
    .payment-checkout-qr img { width: 118px; height: 118px; }
    .wallet-ledger-dialog { width: 100vw; height: 100svh; max-height: none; margin: 0; }
    .wallet-ledger-panel { height: 100svh; max-height: none; border: 0; border-radius: 0; }
    .wallet-ledger-dialog-heading { padding: calc(16px + env(safe-area-inset-top)) 15px 14px 17px; }
    .wallet-ledger-dialog-heading h2 { font-size: 21px; }
    .wallet-ledger-dialog-heading p:last-child { max-width: 76vw; }
    .wallet-ledger-dialog-heading .icon-button { width: 44px; height: 44px; flex: 0 0 44px; }
    .wallet-ledger-dialog-body { padding: 8px 16px calc(22px + env(safe-area-inset-bottom)); }
    .wallet-record--detailed { min-height: 90px; }
    .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: max(10px, env(safe-area-inset-right)); bottom: calc(10px + 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; }
    .management-dialog.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-voice, .setting-generation-controls { grid-column: 1; grid-row: auto; }
    .setting-generation-voice { grid-template-columns: 1fr; }
    .setting-generation-voice > .setting-generation-section-heading { grid-column: 1; }
    .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; }
    .setting-generation-current { margin: 0; padding: 10px; grid-template-columns: 104px minmax(0,1fr); gap: 11px; }
    .setting-generation-current-preview { min-height: 132px; }
    .setting-generation-current-copy { min-width: 0; padding: 2px 2px 2px 0; }
    .setting-generation-current-title { gap: 7px; }
    .setting-generation-current-title input { min-height: 40px; margin-top: 5px; font-size: 15px; }
    .setting-generation-current-copy > p { margin: 8px 0 10px; font-size: 8px; line-height: 1.5; }
    .setting-generation-current-actions { gap: 6px; }
    .setting-generation-current-actions .secondary-button { min-height: 36px; padding-inline: 6px; font-size: 8px; }
    .setting-generation-tabs { margin-top: 10px; padding: 4px; gap: 4px; border-radius: 13px; }
    .setting-generation-tab { min-height: 54px; padding: 8px 9px; gap: 7px; border-radius: 9px; }
    .setting-generation-tab-icon { width: 29px; height: 29px; flex-basis: 29px; border-radius: 9px; font-size: 13px; }
    .setting-generation-tab strong { font-size: 10px; }
    .setting-generation-tab small { font-size: 7px; }
    .setting-generation-visual-panel,.setting-generation-voice-panel { margin-top: 10px; }
    .setting-generation-visual-workspace { grid-template-columns: 1fr; gap: 10px; }
    .setting-generation-prompt-field,.setting-generation-reference-section { padding: 14px; }
    .setting-generation-prompt-field textarea { min-height: 150px; }
    .setting-generation-generate-dock { margin-top: 10px; padding: 13px; grid-template-columns: 1fr; gap: 12px; }
    .setting-generation-generate-dock .setting-generation-controls { grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
    .setting-generation-generate-dock .setting-generation-count { width: auto; min-width: 126px; }
    .setting-generation-generate-dock .setting-generation-count-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .setting-generation-generate-action { width: 100%; }
    .setting-generation-generate-action .primary-button { width: 100%; min-height: 46px; }
    .setting-generation-voice { padding: 15px; grid-template-columns: 1fr; gap: 12px; }
    .setting-generation-voice-description-field textarea { min-height: 128px; }
    .setting-generation-dialog.is-setting-setup .setting-generation-footer > div { grid-template-columns: 1fr; }
    .setting-generation-dialog.is-setting-setup .setting-generation-footer-actions .secondary-button { width: 100%; }
}

@keyframes roughTimelineSpin {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to { transform: translate(-50%,-50%) rotate(360deg); }
}
@keyframes roughMonitorRenderingSpin {
    from { transform: rotate(0deg); }
    to { transform: 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-card .workbench-card-head { flex-wrap: nowrap; }
    .shot-card .workbench-card-actions { width: auto; margin-top: 0; }
    .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: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .creation-mode-picker label { min-width: 0; }
    .creation-mode-picker label > span { min-height: 68px; height: 100%; box-sizing: border-box; padding: 10px; }
    .creation-mode-picker strong { font-size: 13px; line-height: 1.45; }
    .creation-mode-picker small { font-size: 11px; }
    .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) + 9px);
        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 {
        top: calc(42px + env(safe-area-inset-top));
        margin-bottom: 0;
    }
    body.workbench-open:not(.rough-cut-mobile-workspace) .workbench-content {
        padding-top: 12px;
    }
    body.workbench-open .workbench-stage--settings { width: 100%; }
    body.workbench-open .settings-stage-heading { margin-bottom: 14px; }
    body.workbench-open .settings-stage-heading .eyebrow { margin-bottom: 7px; }
    body.workbench-open .settings-stage-title-row { align-items: center; gap: 10px; }
    body.workbench-open .settings-stage-title-row h2 {
        min-width: 0;
        flex: 1;
        font-size: 27px;
        line-height: 1.12;
    }
    body.workbench-open .settings-stage-title-row > .primary-button {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 13px;
    }
    body.workbench-open .settings-stage-title-row > .primary-button span { display: none; }
    body.workbench-open .settings-stage-intro { margin-top: 9px; font-size: 12px; line-height: 1.65; }
    body.workbench-open .workbench-stage--settings .setting-extraction-tool {
        grid-template-columns: 40px minmax(0,1fr);
        gap: 11px;
        margin-bottom: 11px;
        padding: 13px;
        border-radius: 16px;
    }
    body.workbench-open .workbench-stage--settings .setting-extraction-tool-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 12px;
        font-size: 17px;
    }
    body.workbench-open .workbench-stage--settings .setting-extraction-tool-copy strong { font-size: 14px; }
    body.workbench-open .workbench-stage--settings .setting-extraction-tool-copy p { font-size: 11px; line-height: 1.55; }
    body.workbench-open .workbench-stage--settings #extract-settings {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 46px;
        margin-top: 1px;
        padding: 6px 14px;
        border-radius: 12px;
    }
    body.workbench-open .workbench-stage--settings .production-style-card {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 11px;
        padding: 14px;
        border-radius: 16px;
    }
    body.workbench-open .workbench-stage--settings .production-style-card h3 { font-size: 14px; }
    body.workbench-open .workbench-stage--settings .production-style-card p { font-size: 11px; line-height: 1.55; }
    body.workbench-open .workbench-stage--settings .production-style-card > button {
        width: 100%;
        min-height: 42px;
    }
    body.workbench-open .workbench-stage--settings .settings-summary {
        min-height: 42px;
        margin-bottom: 10px;
        padding: 9px 11px;
        font-size: 10px;
        border-radius: 12px;
    }
    body.workbench-open .workbench-stage--settings .setting-filters { margin-bottom: 12px; }
    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; }
}

/* Keep the approved dark-card surface authoritative over legacy frame rules. */
body .continuous-shot-list--frames {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
}
body .continuous-shot-list--frames > .frame-shot-card { flex: 0 0 calc(100% - 1px); }
body .frame-shot-card {
    padding: 0;
    overflow: hidden;
    color: #f7f2fa;
    background: radial-gradient(circle at 94% 7%, rgba(225,106,217,.09), transparent 25%), linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border-color: rgba(178,182,223,.26);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(30,25,45,.17);
}
body .frame-shot-card.is-targeted,
body .frame-shot-card.is-current {
    color: #f7f2fa;
    background: radial-gradient(circle at 94% 7%, rgba(225,106,217,.09), transparent 25%), linear-gradient(145deg,#211b2a,#241d2d 66%,#1e192d);
    border-color: rgba(178,182,223,.48);
    box-shadow: 0 0 0 4px rgba(225,106,217,.10), 0 18px 48px rgba(30,25,45,.17);
}
body .frame-shot-card .frame-shot-heading { padding: 20px 22px 15px; }
body .frame-shot-card .shot-image-comparison-panel,
body .frame-shot-card .shot-video-panel { margin: 0; padding: 18px 22px 22px; border-top-color: #4e4558; }
body .frame-shot-card:not(.is-storyboard-route) .shot-image-comparison-panel { display: none; }
body .frame-shot-card.is-storyboard-route .shot-image-comparison-panel { display: block; }
body .frame-shot-card .shot-video-reference-mode-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
body .frame-shot-card .shot-video-reference-option { color: #f7f2fa; background: #292230; border-color: #4e4558; }
body .frame-shot-card .shot-video-reference-option.is-selected { background: #31354d; border-color: #b2b6df; }
body .frame-shot-card .shot-video-reference-option strong { color: #f7f2fa; }
body .frame-shot-card .shot-video-reference-option small { color: #beb5c6; }
body .frame-shot-card .shot-video-prompt-field { padding: 0; background: #292230; border-color: #626a9d; }
body .frame-shot-card .shot-video-enhance-button { color: #d8dcff; background: rgba(78,91,153,.16); border: 1px solid rgba(178,182,223,.38); border-radius: 11px; }
@media (max-width: 720px) {
    body .continuous-shot-list--frames { gap: 10px; }
    body .frame-shot-card { border-radius: 18px; }
    body .frame-shot-card .frame-shot-heading { padding: 17px 15px 12px; }
    body .frame-shot-card .shot-image-comparison-panel,
    body .frame-shot-card .shot-video-panel { padding: 15px; }
    body .frame-shot-card .shot-video-reference-mode-options { grid-template-columns: 1fr; }
}

/* Director shot cards v163 --------------------------------------------------
   Final parity pass against unified-shot-card: direct-card choices, quiet
   icon actions, coherent dark descendants and deliberate touch dragging. */
body.workbench-open .frame-status-grid {
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 8px;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}
body.workbench-open .frame-status-grid::-webkit-scrollbar { display: none; }
body.workbench-open .frame-status-cell { flex: 0 0 34px; }

body.workbench-open .continuous-shot-list--frames {
    overflow-x: hidden;
    scroll-snap-type: none;
    scroll-behavior: smooth;
    touch-action: pan-y;
    cursor: default;
    overscroll-behavior-x: none;
}
body.workbench-open .continuous-shot-list--frames > .frame-shot-card {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.workbench-open .frame-shot-actions { position: relative; gap: 5px; }
body.workbench-open .frame-shot-actions .frame-shot-edit-button,
body.workbench-open .frame-shot-actions .frame-shot-delete-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #bdb5c6;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
}
body.workbench-open .frame-shot-actions .frame-shot-edit-button svg,
body.workbench-open .frame-shot-actions .frame-shot-delete-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.workbench-open .frame-shot-actions .frame-shot-edit-button:hover,
body.workbench-open .frame-shot-actions .frame-shot-edit-button:focus-visible {
    color: #e2def0;
    background: rgba(178,182,223,.09);
    border-color: rgba(178,182,223,.16);
}
body.workbench-open .frame-shot-actions .frame-shot-delete-button:hover,
body.workbench-open .frame-shot-actions .frame-shot-delete-button:focus-visible {
    color: #ffb1ce;
    background: rgba(201,59,138,.13);
    border-color: rgba(239,130,197,.24);
}
body.workbench-open .frame-shot-actions .frame-shot-delete-button:disabled { opacity: .32; }

body.workbench-open .frame-shot-inline-editor {
    margin-top: 12px;
    padding: 14px;
    color: #f7f2fa;
    background: #292230;
    border: 1px solid #50465a;
    border-radius: 15px;
    box-shadow: none;
}
body.workbench-open .frame-shot-inline-fields { gap: 12px; }
body.workbench-open .frame-shot-inline-field > span,
body.workbench-open .frame-shot-inline-hint {
    color: #beb5c6;
}
body.workbench-open .frame-shot-inline-field .workbench-input,
body.workbench-open .frame-shot-inline-field .workbench-textarea {
    color: #f7f2fa;
    background: #302838;
    border-color: #50465a;
    box-shadow: none;
}
body.workbench-open .frame-shot-inline-field .workbench-input:focus,
body.workbench-open .frame-shot-inline-field .workbench-textarea:focus {
    border-color: #b2b6df;
    outline: 3px solid rgba(178,182,223,.11);
}
body.workbench-open .frame-shot-inline-actions .secondary-button {
    color: #d8dcff;
    background: #302838;
    border-color: #50465a;
}
body.workbench-open .frame-shot-inline-actions .primary-button {
    background: linear-gradient(135deg,#4e5b99,#c93b8a);
    border-color: rgba(225,106,217,.32);
}

body.workbench-open .shot-video-prompt-label-row { gap: 12px; }
body.workbench-open .shot-video-enhance-button,
body.workbench-open .frame-shot-card .shot-video-enhance-button {
    min-height: 32px;
    padding: 4px 2px;
    color: #cbd0fb;
    background: transparent;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    font-size: 10px;
    font-weight: 620;
}
body.workbench-open .shot-video-enhance-button:hover,
body.workbench-open .shot-video-enhance-button:focus-visible {
    color: #eef0ff;
    background: rgba(178,182,223,.06);
}
body.workbench-open .shot-video-enhance-button { gap: 3px; }
body.workbench-open .shot-video-enhance-button::before { content: none; margin-right: 0; }
body.workbench-open .shot-video-prompt-field textarea,
body.workbench-open .shot-video-prompt-inline-highlight {
    box-sizing: border-box;
    width: 100%;
    min-height: 120px;
    padding: 8px 2px 11px;
    overflow-wrap: break-word;
    word-break: break-word;
    font: inherit;
    font-size: 13px;
    line-height: 1.72;
    letter-spacing: 0;
}
body.workbench-open .shot-video-prompt-input-shell.has-inline-bindings textarea {
    color: transparent;
    caret-color: #f7f2fa;
    background: transparent;
    -webkit-text-fill-color: transparent;
}
body.workbench-open .shot-video-prompt-input-shell.has-inline-bindings textarea::selection {
    color: transparent;
    background: rgba(178,182,223,.28);
    -webkit-text-fill-color: transparent;
}
body.workbench-open .shot-video-prompt-input-shell.is-composing textarea {
    color: #f7f2fa;
    background: transparent;
    -webkit-text-fill-color: #f7f2fa;
}
body.workbench-open .shot-video-prompt-inline-highlight {
    left: 0;
    top: 0;
    color: #f7f2fa;
    background: transparent;
}

body.workbench-open .shot-video-reference-mode legend {
    margin-bottom: 9px;
    font-size: 12px;
    font-weight: 620;
}
body.workbench-open .shot-video-reference-option {
    position: relative;
    min-height: 76px;
    padding: 12px;
    display: block;
    text-align: left;
    cursor: pointer;
}
body.workbench-open .shot-video-reference-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
body.workbench-open .shot-video-reference-option > span { display: block; }
body.workbench-open .shot-video-reference-option:focus-within {
    outline: 3px solid rgba(178,182,223,.13);
    outline-offset: 1px;
}
body.workbench-open .shot-video-reference-option.is-selected {
    background: #31354d;
    border-color: #b2b6df;
    box-shadow: inset 0 0 0 1px rgba(178,182,223,.72);
}
body.workbench-open .shot-video-route-recommended {
    margin-left: 6px;
    padding: 2px 6px;
    color: #f09bce;
    background: #4c2b43;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 500;
}

body.workbench-open .shot-video-specs,
body.workbench-open .shot-keyframes-route,
body.workbench-open .shot-image-comparison-panel,
body.workbench-open .shot-version-history,
body.workbench-open .shot-video-take {
    color: #f7f2fa;
    background: #292230;
    border-color: #4e4558;
    box-shadow: none;
}
body.workbench-open .shot-video-specs-grid { gap: 8px; }
body.workbench-open .shot-video-spec-field select,
body.workbench-open .shot-video-spec-value,
body.workbench-open .shot-image-generation-field select,
body.workbench-open .shot-keyframes-shared select {
    color: #f7f2fa;
    background-color: #302838;
    border-color: #50465a;
    box-shadow: none;
}
body.workbench-open .shot-video-spec-field select:focus,
body.workbench-open .shot-image-generation-field select:focus,
body.workbench-open .shot-keyframes-shared select:focus {
    border-color: #b2b6df;
    outline: 2px solid rgba(178,182,223,.12);
}
body.workbench-open .shot-image-comparison-heading h4,
body.workbench-open .shot-image-candidate-heading strong,
body.workbench-open .shot-video-take-heading strong,
body.workbench-open .shot-version-history-heading strong { color: #f7f2fa; }
body.workbench-open .shot-image-comparison-heading p,
body.workbench-open .shot-image-candidate-status,
body.workbench-open .shot-video-take-heading span,
body.workbench-open .shot-video-take-spec,
body.workbench-open .shot-version-history-heading span,
body.workbench-open .shot-version-history-meta { color: #beb5c6; }

body.workbench-open .shot-image-candidate,
body.workbench-open .shot-version-history-group,
body.workbench-open .shot-version-history-candidate {
    color: #f7f2fa;
    background: #241e2c;
    border-color: #51475a;
}
body.workbench-open .shot-image-candidate.is-selected,
body.workbench-open .shot-version-history-candidate.is-selected {
    border-color: #b2b6df;
    box-shadow: inset 0 0 0 1px #b2b6df;
}
body.workbench-open .shot-image-candidate-preview,
body.workbench-open .shot-version-history-preview {
    background: #1d1825;
}
body.workbench-open .shot-image-choice-button,
body.workbench-open .shot-video-select-button,
body.workbench-open .shot-keyframe-generate-button {
    color: #fff;
    background: linear-gradient(135deg,#6576d7 0%,#7b6cda 50%,#c44ca8 100%);
    border-color: rgba(178,190,255,.72);
    box-shadow: 0 8px 22px rgba(92,106,211,.24), inset 0 1px 0 rgba(255,255,255,.18);
}
body.workbench-open .shot-image-choice-button:hover:not(:disabled),
body.workbench-open .shot-video-select-button:hover:not(:disabled),
body.workbench-open .shot-keyframe-generate-button:hover:not(:disabled) {
    border-color: rgba(219,204,255,.92);
    box-shadow: 0 10px 26px rgba(108,93,218,.32), inset 0 1px 0 rgba(255,255,255,.24);
}
body.workbench-open .shot-image-generate-button,
body.workbench-open .shot-video-generate-button {
    color: #fff;
    background: linear-gradient(135deg,#4e5b99,#c93b8a);
    border-color: rgba(225,106,217,.34);
    box-shadow: 0 8px 22px rgba(201,59,138,.16);
}
body.workbench-open .shot-version-history-toggle {
    min-height: 54px;
    color: #f7f2fa;
    background: #2d2635;
    border-color: #50465a;
    box-shadow: none;
}
body.workbench-open .shot-version-history-toggle:hover {
    background: #322a3b;
    border-color: #626a9d;
}
body.workbench-open .shot-version-history-icon {
    color: #d9dcff;
    background: #393d59;
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .shot-video-take-spec {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 9px;
}
body.workbench-open .shot-video-take-spec span {
    padding: 4px 8px;
    color: #c8c0cf;
    background: #302838;
    border: 1px solid #50465a;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 620;
}
body.workbench-open .shot-video-adjust-button,
body.workbench-open .shot-video-take-actions .secondary-button {
    color: #d8dcff;
    background: #302838;
    border-color: #50465a;
}
body.workbench-open .shot-keyframe-history-button {
    color: #cbd0fb;
    background: transparent;
    border: 0;
}

body.workbench-open .frame-carousel-mobile-navigation { display: none; }

@media (max-width: 720px) {
    body.workbench-open .frame-status-overview {
        display: grid;
        grid-template-columns: auto minmax(0,1fr);
        align-items: center;
        gap: 8px;
    }
    body.workbench-open .frame-status-heading { min-width: 92px; }
    body.workbench-open .frame-status-grid {
        width: 100%;
        min-height: 42px;
        margin-top: 0;
        flex-wrap: nowrap;
    }
    body.workbench-open .frame-status-cell {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }
    body.workbench-open .continuous-shot-list--frames {
        gap: 12px;
        padding-bottom: 12px;
        touch-action: pan-y;
    }
    body.workbench-open .continuous-shot-list--frames > .frame-shot-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
    body.workbench-open .frame-shot-actions .frame-shot-edit-button,
    body.workbench-open .frame-shot-actions .frame-shot-delete-button {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }
    body.workbench-open .frame-shot-inline-editor { padding: 12px; }
    body.workbench-open .frame-shot-inline-field .workbench-textarea {
        min-height: 190px;
        font-size: 15px;
        line-height: 1.62;
    }
    body.workbench-open .shot-video-prompt-label-row > span::after {
        display: block;
        margin: 3px 0 0;
    }
    body.workbench-open .shot-video-enhance-button,
    body.workbench-open .frame-shot-card .shot-video-enhance-button {
        min-height: 40px;
        padding-inline: 6px;
        white-space: nowrap;
    }
    body.workbench-open .shot-video-prompt-field textarea,
    body.workbench-open .shot-video-prompt-inline-highlight {
        min-height: 132px;
        padding: 9px 2px calc(1.625em + 12px);
        font-size: 16px;
        line-height: 1.625;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    body.workbench-open .shot-video-prompt-field textarea {
        overflow-y: auto;
        scroll-padding-bottom: calc(1.625em + 12px);
        -webkit-overflow-scrolling: touch;
    }
    body.workbench-open .shot-video-reference-mode-options,
    body .frame-shot-card .shot-video-reference-mode-options {
        grid-template-columns: repeat(3,minmax(0,1fr));
        gap: 6px;
    }
    body.workbench-open .shot-video-reference-option {
        min-height: 58px;
        padding: 9px 6px;
        display: grid;
        place-items: center;
        text-align: center;
        border-radius: 11px;
    }
    body.workbench-open .shot-video-reference-option strong {
        font-size: 10px;
        line-height: 1.25;
        white-space: nowrap;
    }
    body.workbench-open .shot-video-reference-option small { display: none; }
    body.workbench-open .shot-video-route-recommended { display: none; }
    body.workbench-open .shot-video-continuity {
        min-height: 64px;
        padding: 10px 11px;
    }
    body.workbench-open .shot-video-continuity-copy small {
        font-size: 8px;
        line-height: 1.45;
    }
    body.workbench-open .shot-video-specs-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    body.workbench-open .shot-keyframe-cards { grid-template-columns: 1fr; }
    body.workbench-open .frame-carousel-mobile-navigation {
        margin: 2px 0 9px;
        padding: 8px 2px;
        display: grid;
        grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
        align-items: center;
        gap: 8px;
    }
    body.workbench-open .frame-carousel-mobile-button {
        min-height: 40px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #4e5b99;
        background: rgba(255,255,255,.74);
        border: 1px solid rgba(78,91,153,.14);
        border-radius: 11px;
        font: inherit;
        font-size: 9px;
        font-weight: 720;
    }
    body.workbench-open .frame-carousel-mobile-button.is-next { justify-content: flex-end; }
    body.workbench-open .frame-carousel-mobile-button:disabled { opacity: .34; }
    body.workbench-open .frame-carousel-mobile-status {
        color: #7b7482;
        font-size: 8px;
        white-space: nowrap;
    }
}

/* Director shot cards v164 --------------------------------------------------
   Visualize parity: keep route copy as a deliberate two-line hierarchy,
   tuck history into each result header, and make shot creation part of the
   persistent shot map instead of a floating card action. */
body.workbench-open .shot-video-reference-option > span > strong {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}
body.workbench-open .shot-video-reference-option > span > small {
    display: block;
    margin-top: 6px;
    line-height: 1.45;
}

body.workbench-open .frame-status-add {
    min-width: 58px;
    height: 34px;
    padding: 0 9px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #5966a2;
    background: transparent;
    border: 1px dashed rgba(78,91,153,.32);
    border-radius: 9px;
    font: inherit;
    cursor: pointer;
    scroll-snap-align: end;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
body.workbench-open .frame-status-add > span {
    font-size: 17px;
    font-weight: 450;
    line-height: 1;
}
body.workbench-open .frame-status-add > small {
    font-size: 8px;
    font-weight: 650;
}
body.workbench-open .frame-status-add:hover:not(:disabled),
body.workbench-open .frame-status-add:focus-visible {
    color: #fff;
    background: linear-gradient(145deg,#4e5b99,#c93b8a);
    border-color: transparent;
    outline: none;
}
body.workbench-open .frame-status-add:disabled { opacity: .38; cursor: default; }

body.workbench-open .shot-image-comparison-heading-copy { flex: 1 1 auto; }
body.workbench-open .shot-image-comparison-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
body.workbench-open .shot-image-comparison-title-row h4 { min-width: 0; }

body.workbench-open .shot-version-history-toggle.is-compact,
body.workbench-open .frame-shot-card .shot-version-history-toggle.is-compact {
    width: auto;
    min-width: 0;
    min-height: 28px;
    margin: 0;
    padding: 3px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    color: #cbd0fb;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 7px;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}
body.workbench-open .shot-version-history-toggle.is-compact:hover,
body.workbench-open .shot-version-history-toggle.is-compact:focus-visible,
body.workbench-open .shot-version-history-toggle.is-compact[aria-expanded="true"] {
    color: #eef0ff;
    background: rgba(178,182,223,.08);
    border: 0;
    box-shadow: none;
    outline: none;
    transform: none;
}
body.workbench-open .shot-version-history-toggle.is-compact .shot-version-history-icon {
    width: 14px;
    height: 14px;
    display: block;
    color: currentColor;
    background: currentColor;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -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='M3 12a9 9 0 1 0 3-6.7M3 4v5h5'/%3E%3Cpath d='M12 7v5l3 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7M3 4v5h5'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}
body.workbench-open .shot-version-history-toggle.is-compact .shot-version-history-icon::before { display: none; }
body.workbench-open .shot-version-history-label {
    color: inherit;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 9px;
    font-weight: 550;
    line-height: 1.2;
    white-space: nowrap;
}
body.workbench-open .shot-video-take-heading { justify-content: flex-start; }
body.workbench-open .shot-video-take-heading > strong { margin-right: auto; }
body.workbench-open .shot-video-take-heading > .shot-video-take-status {
    padding: 3px 7px;
    color: #beb5c6;
    background: #302838;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 650;
}
body.workbench-open .shot-video-take-heading .shot-version-history-toggle.is-compact > span {
    color: inherit;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}
body.workbench-open .shot-video-take-heading .shot-version-history-toggle.is-compact > .shot-version-history-icon {
    background-color: currentColor;
}

body.workbench-open .shot-image-generate-button,
body.workbench-open .shot-video-generate-button {
    min-height: 44px;
    padding-inline: 18px;
    color: #fff;
    background: linear-gradient(135deg,#4e5b99 0%,#666bb0 48%,#c93b8a 100%);
    border: 1px solid rgba(225,106,217,.32);
    border-radius: 12px;
    box-shadow: 0 9px 24px rgba(30,25,45,.22), 0 5px 18px rgba(201,59,138,.13);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .01em;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
body.workbench-open .shot-image-generate-button:hover:not(:disabled),
body.workbench-open .shot-video-generate-button:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(1.04);
    box-shadow: 0 12px 28px rgba(30,25,45,.25), 0 7px 21px rgba(201,59,138,.17);
}
body.workbench-open .shot-image-generate-button:active:not(:disabled),
body.workbench-open .shot-video-generate-button:active:not(:disabled) {
    transform: translateY(0) scale(.99);
}
body.workbench-open .shot-image-generate-button:focus-visible,
body.workbench-open .shot-video-generate-button:focus-visible {
    outline: 3px solid rgba(225,106,217,.22);
    outline-offset: 2px;
}

body.workbench-open .shot-keyframe-generate-button {
    min-height: 42px;
    color: #e9ebff;
    background: #34384f;
    border: 1px solid rgba(178,182,223,.3);
    border-radius: 11px;
    box-shadow: none;
    font-size: 10px;
    font-weight: 600;
    transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
}
body.workbench-open .shot-keyframe-generate-button:hover:not(:disabled) {
    transform: translateY(-1px);
    color: #fff;
    background: #414761;
    border-color: rgba(178,182,223,.5);
}
body.workbench-open .shot-keyframe-generate-button:active:not(:disabled) { transform: translateY(0) scale(.992); }
body.workbench-open .shot-keyframe-generate-button:focus-visible {
    outline: 3px solid rgba(178,182,223,.15);
    outline-offset: 2px;
}

body.workbench-open .shot-video-enhance-button.credit-action-button,
body.workbench-open .frame-shot-card .shot-video-enhance-button.credit-action-button {
    min-height: 30px;
    padding: 3px 2px;
    overflow: visible;
    color: #cbd0fb;
    background: transparent;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    filter: none;
    font-size: 10px;
    font-weight: 550;
}
body.workbench-open .shot-video-enhance-button.credit-action-button::before {
    content: none;
}
body.workbench-open .shot-video-enhance-button.credit-action-button:hover:not(:disabled),
body.workbench-open .shot-video-enhance-button.credit-action-button:focus-visible {
    transform: none;
    color: #fff;
    background: rgba(178,182,223,.07);
    border: 0;
    box-shadow: none;
    filter: none;
    outline: none;
}
body.workbench-open .shot-video-enhance-button.credit-action-button:active:not(:disabled) {
    color: #f0a7d4;
    background: rgba(201,59,138,.08);
}

body.workbench-open .workbench-stage--settings #extract-settings.credit-action-button {
    color: #fff;
    background: linear-gradient(135deg,#5867ad 0%,#836cc6 54%,#c64b9e 100%);
    border-color: rgba(207,211,255,.58);
    box-shadow: 0 9px 22px rgba(87,96,172,.22), inset 0 1px 0 rgba(255,255,255,.17);
}
body.workbench-open .workbench-stage--settings #extract-settings.credit-action-button:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg,#6373bd 0%,#9076d2 54%,#d057aa 100%);
    border-color: rgba(225,227,255,.78);
    box-shadow: 0 12px 28px rgba(104,92,189,.28), inset 0 1px 0 rgba(255,255,255,.22);
    filter: none;
}
body.workbench-open .workbench-stage--settings #extract-settings.credit-action-button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 5px 14px rgba(87,96,172,.2), inset 0 1px 0 rgba(255,255,255,.14);
}
body.workbench-open .workbench-stage--settings #extract-settings.credit-action-button:disabled {
    color: rgba(255,255,255,.72);
    background: linear-gradient(135deg,rgba(88,103,173,.54),rgba(198,75,158,.42));
    border-color: rgba(178,182,223,.28);
    box-shadow: none;
}

/* Keep mobile shot controls physically attached to the card they navigate. */
body.workbench-open .frame-card-mobile-navigation { display: none; }

/* Director shot cards v165: route descendants keep one shared gutter. */
body.workbench-open .frame-shot-card .shot-video-panel > .shot-image-comparison-panel {
    margin-inline: -21px;
    padding-inline: 21px;
}

@media (max-width: 720px) {
    body.workbench-open .frame-status-add { display: none; }
    body.workbench-open .frame-status-heading {
        min-width: 68px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 5px;
    }
    body.workbench-open .frame-status-heading-copy > span { display: none; }
    body.workbench-open .frame-status-heading-copy > strong {
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
    }
    body.workbench-open .frame-status-total {
        min-height: 22px;
        padding: 0 7px;
        gap: 4px;
    }
    body.workbench-open .frame-status-total strong { font-size: 8px; }
    body.workbench-open .frame-status-total small { font-size: 7px; }
    body.workbench-open .shot-image-comparison-title-row { justify-content: space-between; }
    body.workbench-open .shot-video-reference-option > span > small { display: none; }
    body.workbench-open .shot-version-history-label { font-size: 9px; }
    body.workbench-open .shot-image-generate-button,
    body.workbench-open .shot-video-generate-button { min-height: 46px; border-radius: 12px; }
    body.workbench-open .frame-card-mobile-navigation {
        margin: 0 14px;
        padding: 12px 0 14px;
        display: grid;
        grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
        align-items: center;
        gap: 8px;
        border-top: 1px solid rgba(178,182,223,.13);
    }
    body.workbench-open .frame-shot-card .shot-video-panel > .shot-image-comparison-panel {
        margin-inline: -15px;
        padding-inline: 15px;
    }
    body.workbench-open .frame-card-mobile-button {
        min-height: 38px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        color: #d8dcff;
        background: rgba(178,182,223,.07);
        border: 1px solid rgba(178,182,223,.18);
        border-radius: 10px;
        font: inherit;
        font-size: 9px;
        font-weight: 600;
        cursor: pointer;
    }
    body.workbench-open .frame-card-mobile-button.is-next { justify-content: flex-end; }
    body.workbench-open .frame-card-mobile-button:disabled {
        opacity: .28;
        cursor: default;
    }
    body.workbench-open .frame-card-add-button {
        width: 42px;
        min-width: 42px;
        height: 38px;
        padding: 0;
        display: grid;
        place-items: center;
        color: #d8dcff;
        background: transparent;
        border: 0;
        border-radius: 8px;
        box-shadow: none;
        font: inherit;
        cursor: pointer;
        transition: color .18s ease,background-color .18s ease,transform .18s ease;
    }
    body.workbench-open .frame-card-add-button > span { font-size: 27px; font-weight: 620; line-height: 1; }
    body.workbench-open .frame-card-add-button:hover:not(:disabled),
    body.workbench-open .frame-card-add-button:focus-visible {
        color: #fff;
        background: rgba(178,182,223,.09);
        transform: scale(1.05);
        outline: none;
        box-shadow: none;
    }
    body.workbench-open .frame-card-add-button:disabled { opacity: .35; cursor: default; }
}

/* Director shot cards v165: dark-surface semantic color system. */
body.workbench-open .shot-video-prompt-inline-binding {
    color: #9aa8ff;
    background: rgba(100,122,255,.18);
    box-shadow: 0 0 0 2px rgba(100,122,255,.18);
}
body.workbench-open .shot-video-prompt-inline-binding.is-location {
    color: #ff74c8;
    background: rgba(255,72,178,.17);
    box-shadow: 0 0 0 2px rgba(255,72,178,.16);
}
body.workbench-open .shot-video-prompt-inline-binding.is-prop {
    color: #ffad66;
    background: rgba(255,139,58,.17);
    box-shadow: 0 0 0 2px rgba(255,139,58,.15);
}
body.workbench-open .shot-video-prompt-inline-binding.is-other {
    color: #c99bff;
    background: rgba(172,103,255,.16);
    box-shadow: 0 0 0 2px rgba(172,103,255,.14);
}
body.workbench-open .shot-video-binding-chip,
body.workbench-open .shot-reference-chip.is-character {
    color: #a7b2ff;
    background: rgba(100,122,255,.13);
    border-color: rgba(133,150,255,.32);
}
body.workbench-open .shot-video-binding-chip.is-location,
body.workbench-open .shot-reference-chip.is-location {
    color: #ff83cf;
    background: rgba(255,72,178,.12);
    border-color: rgba(255,103,196,.31);
}
body.workbench-open .shot-video-binding-chip.is-prop,
body.workbench-open .shot-reference-chip.is-prop {
    color: #ffb46f;
    background: rgba(255,139,58,.12);
    border-color: rgba(255,165,91,.31);
}
body.workbench-open .shot-video-binding-chip.is-other,
body.workbench-open .shot-reference-chip.is-other,
body.workbench-open .shot-reference-chip.is-audio {
    color: #d2adff;
    background: rgba(172,103,255,.12);
    border-color: rgba(196,148,255,.28);
}
body.workbench-open .shot-video-binding-chip::after { background: #68c89a; }
body.workbench-open .shot-video-binding-chip small { color: currentColor; opacity: .76; }

body.workbench-open .shot-reference-strip.is-ready {
    background: linear-gradient(135deg,rgba(55,59,88,.72),#292230 62%);
    border-color: rgba(143,160,255,.40);
    box-shadow: inset 3px 0 0 #7f90ff;
}
body.workbench-open .shot-reference-strip.is-ready .shot-reference-strip-copy strong {
    color: #b5beff;
}
body.workbench-open .shot-reference-strip.is-blocked,
body.workbench-open .shot-reference-strip.is-outdated {
    background: linear-gradient(135deg,rgba(97,31,72,.86),rgba(42,35,51,.97));
    border-color: rgba(255,95,183,.46);
    box-shadow: inset 3px 0 0 #ff5fb7;
}
body.workbench-open .shot-reference-strip.is-blocked .shot-reference-strip-copy strong,
body.workbench-open .shot-reference-strip.is-outdated .shot-reference-strip-copy strong {
    color: #ff8dce;
}
body.workbench-open .frame-status-cell.is-complete {
    color: #fff;
    background: #7f90ff;
    border-color: #97a5ff;
}
body.workbench-open .frame-status-cell.is-pending {
    color: #fff;
    background: #ff5fb7;
    border-color: #ff7ac5;
}
body.workbench-open .frame-status-cell.is-current {
    color: #fff;
    background: linear-gradient(145deg,#6377e8,#c852b2);
    border-color: #d9dcff;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,.34),
        0 0 0 3px rgba(143,160,255,.30),
        0 0 15px rgba(225,106,217,.30);
    transform: translateY(-1px) scale(1.05);
}
body.workbench-open .workbench-save-status.is-saved { color: #8fd8b8; }
body.workbench-open .workbench-save-status.is-saved .save-status-dot {
    background: #68c89a;
    box-shadow: 0 0 0 3px rgba(104,200,154,.10),0 0 9px rgba(104,200,154,.18);
}
body.workbench-open .workbench-save-status.is-saving { color: #9aa8ff; }
body.workbench-open .workbench-save-status.is-saving .save-status-dot { background: #7f90ff; }
body.workbench-open .workbench-save-status.is-pending { color: #ffc36e; }
body.workbench-open .workbench-save-status.is-pending .save-status-dot { background: #ffad47; }
body.workbench-open .workbench-save-status.is-error { color: #ff7bac; }
body.workbench-open .workbench-save-status.is-error .save-status-dot { background: #ff5f98; }

/* Director shot cards v166: carry the same semantic palette through every
   equivalent state on the dark workbench. Colour communicates meaning:
   indigo = confirmed/current, pink = attention/outdated. */
body.workbench-open .setting-status {
    color: #ff8dce;
    background: rgba(255,72,178,.14);
    border: 1px solid rgba(255,103,196,.28);
}
body.workbench-open .setting-status.is-ready {
    color: #b5beff;
    background: rgba(100,122,255,.13);
    border-color: rgba(143,160,255,.32);
}
body.workbench-open .setting-reference-asset-card.is-current,
body.workbench-open .setting-generation-candidate.is-selected {
    border-color: rgba(143,160,255,.42);
    box-shadow: inset 0 0 0 1px rgba(143,160,255,.16),0 0 18px rgba(100,122,255,.07);
}
body.workbench-open .setting-reference-asset-card.is-current .setting-reference-asset-action,
body.workbench-open .setting-generation-candidate-selected {
    color: #b5beff;
    background: rgba(100,122,255,.13);
    border: 1px solid rgba(143,160,255,.28);
}

body.workbench-open .shot-reference-chip::before,
body.workbench-open .shot-video-binding-chip::after {
    background: #7f90ff;
}
body.workbench-open .shot-video-prompt-inline-binding.is-character[data-character-tone],
body.workbench-open .shot-video-binding-chip.is-character[data-character-tone],
body.workbench-open .shot-reference-chip.is-character[data-character-tone] {
    color: rgb(var(--character-tone-rgb));
    background: rgba(var(--character-tone-rgb),.13);
    border-color: rgba(var(--character-tone-rgb),.32);
}
body.workbench-open .shot-video-prompt-inline-binding.is-character[data-character-tone] {
    box-shadow: 0 0 0 2px rgba(var(--character-tone-rgb),.17);
}
body.workbench-open .shot-video-binding-chip.is-character[data-character-tone]::after,
body.workbench-open .shot-reference-chip.is-character[data-character-tone]::before {
    background: rgb(var(--character-tone-rgb));
}
body.workbench-open .shot-image-candidate.is-selected,
body.workbench-open .shot-version-history-candidate.is-selected {
    border-color: #8fa0ff;
    box-shadow: inset 0 0 0 1px rgba(143,160,255,.72),0 0 22px rgba(100,122,255,.10);
}
body.workbench-open .shot-image-candidate.is-selected .shot-image-candidate-result {
    color: #b5beff;
    background: rgba(100,122,255,.15);
}
body.workbench-open .shot-video-take.is-selected {
    background: linear-gradient(135deg,rgba(55,59,88,.72),#292230 62%);
    border-color: rgba(143,160,255,.40);
    box-shadow: inset 3px 0 0 #7f90ff;
}
body.workbench-open .shot-video-take.is-selected .shot-video-take-heading > .shot-video-take-status {
    color: #b5beff;
    background: rgba(100,122,255,.13);
}
body.workbench-open .shot-video-take.is-stale {
    background: linear-gradient(135deg,rgba(97,31,72,.68),#292230 58%);
    border-color: rgba(255,95,183,.38);
}
body.workbench-open .shot-video-take.is-stale .shot-video-take-heading > .shot-video-take-status {
    color: #ff8dce;
    background: rgba(255,72,178,.14);
}
body.workbench-open .shot-video-binding-chip.is-pending {
    color: #ff8dce;
    background: rgba(255,72,178,.10);
    border-color: rgba(255,103,196,.30);
}
body.workbench-open .shot-video-binding-chip.is-ambiguous {
    color: #ffd071;
    background: rgba(255,173,71,.12);
    border-color: rgba(255,195,110,.32);
}
body.workbench-open .shot-video-binding-chip.is-ambiguous::after { color: #ffd071; }
body.workbench-open .shot-reference-chip.is-outdated {
    color: #ff8dce;
    background: rgba(255,72,178,.12);
    border-color: rgba(255,103,196,.32);
}
body.workbench-open .shot-reference-chip.is-outdated::before {
    background: #ff5fb7;
    box-shadow: 0 0 0 3px rgba(255,95,183,.14);
}

body.workbench-open .shot-insert-dialog {
    width: min(520px,calc(100vw - 24px));
    max-width: 520px;
    padding: 0;
    overflow: hidden;
    color: #f7f2fa;
    background: transparent;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(10,8,15,.48);
}
body.workbench-open .shot-insert-dialog::backdrop {
    background: rgba(18,14,27,.68);
    backdrop-filter: blur(8px);
}
body.workbench-open .shot-insert-dialog-shell {
    overflow: hidden;
    background: linear-gradient(145deg,#292230,#211b29);
    border: 1px solid #51475a;
    border-radius: 20px;
}
body.workbench-open .shot-insert-dialog-shell > header {
    padding: 22px 24px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid rgba(178,182,223,.13);
}
body.workbench-open .shot-insert-dialog-shell > header > div { min-width: 0; }
body.workbench-open .shot-insert-dialog-shell > header span {
    color: #aeb8ff;
    font-size: 9px;
    font-weight: 720;
    letter-spacing: .12em;
}
body.workbench-open .shot-insert-dialog-shell > header h2 {
    margin: 7px 0 0;
    color: #fff;
    font-size: 21px;
    line-height: 1.3;
}
body.workbench-open .shot-insert-dialog-shell > header p {
    margin: 7px 0 0;
    color: #beb5c6;
    font-size: 10px;
    line-height: 1.55;
}
body.workbench-open .shot-insert-dialog .modal-close {
    width: 34px;
    height: 34px;
    min-height: 0;
    padding: 0;
    color: #d9d3df;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    font-size: 28px;
    font-weight: 760;
    line-height: 1;
}
body.workbench-open .shot-insert-dialog .modal-close:hover {
    color: #fff;
    background: transparent;
    transform: scale(1.08);
}
body.workbench-open .shot-insert-dialog-body { padding: 18px 24px 20px; }
body.workbench-open .shot-insert-dialog-context {
    margin: 0 0 11px;
    color: #d8dcff;
    font-size: 9px;
    font-weight: 650;
}
body.workbench-open .shot-insert-choices {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}
body.workbench-open .shot-insert-choice {
    min-width: 0;
    min-height: 66px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 30px minmax(0,1fr);
    align-items: center;
    gap: 11px;
    color: #f7f2fa;
    text-align: left;
    background: #302838;
    border: 1px solid #51475a;
    border-radius: 14px;
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease,border-color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
body.workbench-open .shot-insert-choice:hover,
body.workbench-open .shot-insert-choice:focus-visible {
    transform: translateY(-2px);
    background: #343044;
    border-color: rgba(143,160,255,.55);
    outline: none;
    box-shadow: 0 12px 28px rgba(10,8,15,.22);
}
body.workbench-open .shot-insert-choice-mark {
    color: #aeb8ff;
    font-size: 22px;
    line-height: 1;
    text-align: center;
}
body.workbench-open .shot-insert-choice > span:last-child { min-width: 0; }
body.workbench-open .shot-insert-choice strong { display: block; color: #fff; font-size: 11px; }

/* Director shot cards v172: native vertical page movement plus deliberate
   horizontal dragging inside the compact shot map. */
body.workbench-open .frame-status-grid {
    touch-action: pan-y;
    cursor: grab;
    scroll-behavior: auto;
}
body.workbench-open .frame-status-grid.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

/* Director shot cards v173: native momentum for the shot map, compact @
   reference picker, and a scene colour that cannot be confused with the
   per-character blue/pink/violet sequence. */
body.workbench-open .shot-video-prompt-field {
    position: relative;
    overflow: visible;
}
body.workbench-open .shot-video-mention-menu {
    position: absolute;
    z-index: 12;
    max-height: 220px;
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--director-muted);
    background: rgba(29,25,43,.97);
    border: 1px solid rgba(178,182,223,.28);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(7,5,13,.36),0 0 0 1px rgba(255,255,255,.025);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
body.workbench-open .shot-video-mention-menu[hidden] { display: none; }
body.workbench-open .shot-video-mention-menu::-webkit-scrollbar { display: none; }
body.workbench-open .shot-video-mention-option {
    --mention-tone-rgb: 172,103,255;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: rgb(var(--mention-tone-rgb));
    background: rgba(var(--mention-tone-rgb),.12);
    border: 1px solid rgba(var(--mention-tone-rgb),.28);
    border-radius: 999px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
body.workbench-open .shot-video-mention-option.is-character[data-character-tone] {
    --mention-tone-rgb: var(--character-tone-rgb);
}
body.workbench-open .shot-video-mention-option.is-location { --mention-tone-rgb: 88,212,193; }
body.workbench-open .shot-video-mention-option.is-prop { --mention-tone-rgb: 255,173,102; }
body.workbench-open .shot-video-mention-option:hover,
body.workbench-open .shot-video-mention-option:focus-visible,
body.workbench-open .shot-video-mention-option.is-active {
    background: rgba(var(--mention-tone-rgb),.20);
    border-color: rgba(var(--mention-tone-rgb),.50);
    outline: none;
}
body.workbench-open .shot-video-mention-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    background: rgb(var(--mention-tone-rgb));
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(var(--mention-tone-rgb),.34);
}
body.workbench-open .shot-video-mention-option strong { color: inherit; font-size: 10px; }
body.workbench-open .shot-video-mention-option small { margin-left: auto; color: rgba(235,233,244,.58); font-size: 8px; }
body.workbench-open .shot-video-mention-empty {
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.45;
}
body.workbench-open .shot-video-prompt-inline-binding.is-location {
    color: #63dcc8;
    background: rgba(88,212,193,.16);
    box-shadow: 0 0 0 2px rgba(88,212,193,.16);
}
body.workbench-open .shot-video-binding-chip.is-location,
body.workbench-open .shot-reference-chip.is-location {
    color: #6ce2cf;
    background: rgba(88,212,193,.12);
    border-color: rgba(88,212,193,.30);
}
body.workbench-open .shot-video-binding-chip.is-location::after,
body.workbench-open .shot-reference-chip.is-location::before {
    background: #58d4c1;
}

@media (max-width: 520px) {
    body.workbench-open .shot-insert-dialog { width: calc(100vw - 20px); border-radius: 18px; }
    body.workbench-open .shot-insert-dialog-shell { border-radius: 18px; }
    body.workbench-open .shot-insert-dialog-shell > header { padding: 19px 18px 15px; }
    body.workbench-open .shot-insert-dialog-shell > header h2 { font-size: 19px; }
    body.workbench-open .shot-insert-dialog-body { padding: 15px 18px 17px; }
    body.workbench-open .shot-insert-choices { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    body.workbench-open .shot-insert-choice { min-height: 60px; padding: 10px 9px; grid-template-columns: 22px minmax(0,1fr); gap: 6px; }
    body.workbench-open .shot-insert-choice-mark { font-size: 19px; }
    body.workbench-open .shot-insert-choice strong { font-size: 10px; white-space: nowrap; }
}

@media (max-width: 720px) {
    body.workbench-open .continuous-shot-list--frames {
        height: var(--frame-carousel-current-height,auto);
        min-height: 1px;
        padding-bottom: 0;
        overflow-y: hidden;
        transition: none;
    }
    body.workbench-open .shot-video-reference-option {
        min-height: 72px;
        padding: 9px 6px;
    }
    body.workbench-open .shot-video-reference-option > span > small {
        display: block;
        margin-top: 5px;
        font-size: 8px;
        font-weight: 560;
        line-height: 1.35;
        white-space: normal;
    }
}

/* Director shot cards v186: compact stage hierarchy and identical Safari
   geometry for native selects and read-only specification fields. */
body.workbench-open .frame-stage-heading {
    margin: 0;
}
body.workbench-open .frame-stage-heading > .rough-cut-preview-eyebrow {
    margin: 0 0 8px;
    color: #ef5ba7;
    font-size: 9px;
    font-weight: 840;
    letter-spacing: .14em;
    line-height: 1.1;
}
body.workbench-open .frame-stage-heading > .frame-status-overview {
    margin: 0 0 12px;
    padding: 10px 12px;
    gap: 11px;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(30,25,45,.12);
}
body.workbench-open .frame-stage-heading .frame-status-grid {
    min-height: 40px;
    padding: 4px;
}
body.workbench-open .frame-stage-heading .frame-status-cell {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
}
body.workbench-open .shot-video-spec-field select,
body.workbench-open .shot-video-spec-value {
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    margin: 0;
    padding: 0 11px;
    line-height: 1.2;
}
body.workbench-open .shot-video-spec-field select {
    display: block;
    padding-right: 32px;
    -webkit-appearance: none;
    appearance: none;
    background-color: #302838;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23c9c3d1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 12px 8px;
}
body.workbench-open .shot-video-spec-field.is-model select {
    background-color: #302838;
}

@media (max-width: 720px) {
    body.workbench-open:not(.rough-cut-mobile-workspace) .workbench-content {
        padding-top: 9px;
    }
    body.workbench-open .frame-stage-heading > .rough-cut-preview-eyebrow {
        margin-bottom: 6px;
        font-size: 8px;
    }
    body.workbench-open .frame-stage-heading > .frame-status-overview {
        margin-bottom: 9px;
        padding: 8px 9px;
        gap: 7px;
        border-radius: 13px;
    }
    body.workbench-open .frame-stage-heading .frame-status-heading {
        min-width: 64px;
        gap: 4px;
    }
    body.workbench-open .frame-stage-heading .frame-status-grid {
        min-height: 38px;
        padding: 3px;
    }
    body.workbench-open .frame-stage-heading .frame-status-cell {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }
    body.workbench-open .continuous-shot-list--frames {
        padding-top: 0;
    }
    body.workbench-open .shot-video-spec-field select,
    body.workbench-open .shot-video-spec-value {
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        font-size: 12px;
    }
}
/* --------------------------------------------------------------------------
   STEP 2 · WORLD
   The world UI is a presentation layer over the existing setting identities,
   immutable versions, assets, voice samples and shot bindings. No data fork.
   -------------------------------------------------------------------------- */
body.workbench-open .workbench-stage--settings {
    width: min(100%, 1320px);
    color: #f7f2fa;
}
body.workbench-open .world-surface {
    --world-panel: #211b2a;
    --world-panel-raised: #292230;
    --world-line: #4e4558;
    --world-copy: #f7f2fa;
    --world-muted: #b9b0c1;
    padding: clamp(22px, 3.2vw, 42px);
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 4%, rgba(208,83,174,.12), transparent 30%),
        radial-gradient(circle at 6% 96%, rgba(96,111,191,.13), transparent 34%),
        #191520;
    border: 1px solid rgba(178,182,223,.3);
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(30,25,45,.2), inset 0 1px 0 rgba(255,255,255,.04);
}
body.workbench-open .world-heading {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: end;
    gap: 22px;
}
body.workbench-open .world-heading .eyebrow {
    margin: 0 0 10px;
    color: #ed79c3;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .17em;
}
body.workbench-open .world-heading h2 {
    margin: 0;
    color: var(--world-copy);
    font-size: clamp(25px,2.3vw,32px);
    font-weight: 620;
    letter-spacing: -.04em;
}
body.workbench-open .world-heading .settings-stage-intro {
    margin: 9px 0 0;
    color: var(--world-muted);
    font-size: 15px;
    line-height: 1.55;
}
body.workbench-open .world-heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
body.workbench-open .world-heading-actions .primary-button,
body.workbench-open .world-heading-actions .world-agent-action {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 11px;
    font-size: 11px;
}
body.workbench-open .world-heading-actions .primary-button {
    color: #daddff;
    background: rgba(78,91,153,.18);
    border: 1px solid rgba(132,145,230,.42);
    box-shadow: none;
}
body.workbench-open .world-heading-actions .primary-button:hover {
    color: #fff;
    background: rgba(78,91,153,.34);
    border-color: rgba(154,168,255,.72);
}
body.workbench-open .world-heading-actions .world-agent-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dadcff;
    background: transparent;
    border-color: transparent;
}
body.workbench-open .world-heading-actions .world-agent-action strong { font-weight: 690; }
body.workbench-open .world-heading-actions .world-agent-action > span { color: #ed8bcc; font-size: 17px; }
body.workbench-open .world-guide { display: none; }
body.workbench-open .world-toolbar {
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid rgba(178,182,223,.22);
}
body.workbench-open .world-toolbar .setting-filters {
    min-width: 0;
    margin: 0;
    padding: 0;
    gap: 0;
    color: var(--world-muted);
    background: transparent;
    border: 0;
    border-radius: 0;
}
body.workbench-open .world-toolbar .setting-filter {
    position: relative;
    min-height: 52px;
    padding: 0 20px;
    color: #aaa2b5;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 680;
}
body.workbench-open .world-toolbar .setting-filter::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: -1px;
    left: 10px;
    height: 3px;
    background: transparent;
    border-radius: 99px 99px 0 0;
}
body.workbench-open .world-toolbar .setting-filter.is-active {
    color: #fff;
    background: transparent;
    box-shadow: none;
}
body.workbench-open .world-toolbar .setting-filter.is-active::after {
    background: linear-gradient(90deg,#7887e8,#ed67bd);
}
body.workbench-open .world-toolbar .setting-filter em {
    margin-left: 4px;
    color: #8f8799;
    font: inherit;
    font-size: .86em;
}
body.workbench-open .world-toolbar .settings-summary {
    margin: 0 4px 0 auto;
    padding: 0;
    flex: 0 0 auto;
    color: #c3a6e7;
    background: transparent;
    border: 0;
    font-size: 10px;
    line-height: 1.5;
    white-space: pre;
}
body.workbench-open .world-toolbar .settings-summary:empty { display: none; }
body.workbench-open .world-surface .settings-state,
body.workbench-open .world-surface .world-empty {
    min-height: 360px;
    margin-top: 18px;
    color: var(--world-muted);
    background: rgba(41,34,48,.58);
    border: 1px dashed rgba(178,182,223,.28);
    border-radius: 22px;
}
body.workbench-open .world-empty-symbols {
    position: relative;
    width: 150px;
    height: 72px;
    margin: 0 auto 4px;
}
body.workbench-open .world-empty-symbols span {
    position: absolute;
    top: 4px;
    width: 54px;
    height: 64px;
    display: grid;
    place-items: center;
    color: #c8c9f7;
    background: linear-gradient(155deg,rgba(54,47,65,.98),rgba(31,26,38,.98));
    border: 1px solid rgba(178,182,223,.3);
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(10,8,14,.24),inset 0 1px 0 rgba(255,255,255,.05);
    transform-origin: 50% 100%;
    transition: transform .28s var(--ease),border-color .28s var(--ease),box-shadow .28s var(--ease);
}
body.workbench-open .world-empty-symbols span svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.workbench-open .world-empty-symbols .is-character {
    left: 9px;
    z-index: 1;
    color: #aeb7ff;
    transform: translateY(7px) rotate(-9deg);
}
body.workbench-open .world-empty-symbols .is-location {
    left: 48px;
    z-index: 2;
    color: #ef80c7;
    transform: translateY(0);
}
body.workbench-open .world-empty-symbols .is-prop {
    left: 87px;
    z-index: 3;
    color: #e7c39b;
    transform: translateY(7px) rotate(9deg);
}
body.workbench-open .world-empty-symbols:hover .is-character {
    transform: translate(-3px,7px) rotate(-11deg);
}
body.workbench-open .world-empty-symbols:hover .is-prop {
    transform: translate(3px,7px) rotate(11deg);
}
body.workbench-open .world-empty h3 { color: var(--world-copy); font-size: 24px; font-weight: 600; }
body.workbench-open .world-empty p { max-width: 520px; color: var(--world-muted); }
body.workbench-open .world-empty-actions { margin-top: 8px; }
body.workbench-open .world-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px;
}
body.workbench-open .world-grid .setting-card {
    position: relative;
    min-width: 0;
    min-height: 220px;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(150px,.42fr) minmax(0,1fr);
    gap: 18px;
    color: var(--world-copy);
    background:
        radial-gradient(circle at 100% 0, rgba(213,63,157,.08), transparent 36%),
        linear-gradient(145deg,#25202d,#211b2a);
    border: 1px solid rgba(178,182,223,.27);
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(10,8,14,.18), inset 0 1px 0 rgba(255,255,255,.035);
    cursor: pointer;
    transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
body.workbench-open .world-grid .setting-card:hover {
    transform: translateY(-3px);
    border-color: rgba(178,182,223,.52);
    box-shadow: 0 18px 40px rgba(10,8,14,.28), inset 0 1px 0 rgba(255,255,255,.05);
}
body.workbench-open .world-grid .setting-card:focus-visible {
    outline: 3px solid rgba(139,152,241,.48);
    outline-offset: 3px;
}
body.workbench-open .world-grid .setting-card.is-generating {
    border-color: rgba(190,135,244,.44);
}
body.workbench-open .world-grid .setting-card.is-incomplete {
    border-color: rgba(224,105,183,.34);
}
body.workbench-open .world-grid .setting-card-preview {
    position: relative;
    width: 100%;
    min-height: 184px;
    aspect-ratio: auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #bab3c2;
    background: linear-gradient(145deg,#31354d,#6c4c82);
    border: 1px solid rgba(178,182,223,.28);
    border-radius: 18px;
}
body.workbench-open .world-grid .setting-card--location .setting-card-preview {
    background: linear-gradient(145deg,#244d5a,#4f6d67);
}
body.workbench-open .world-grid .setting-card--prop .setting-card-preview {
    background: linear-gradient(145deg,#665441,#967657);
}
body.workbench-open .world-grid .setting-card-preview img { object-fit: cover; }
body.workbench-open .world-grid .setting-card-placeholder {
    width: 58px;
    height: 58px;
    color: #e8e5f3;
    background: rgba(21,17,27,.28);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    font-size: 22px;
    backdrop-filter: blur(8px);
}
body.workbench-open .world-grid .setting-status {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 27px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e3e4ff;
    background: rgba(25,21,32,.72);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 99px;
    font-size: 9px;
    font-weight: 680;
    backdrop-filter: blur(10px);
}
body.workbench-open .world-grid .setting-status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}
body.workbench-open .world-grid .setting-status.is-ready { color: #9eacff; }
body.workbench-open .world-grid .setting-status.is-generating { color: #c9a1ff; }
body.workbench-open .world-grid .setting-status.is-incomplete { color: #f18bcf; }
body.workbench-open .setting-card-generation-orbit {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    color: #f0d8ff;
    background: radial-gradient(circle,rgba(226,116,203,.32),rgba(119,106,202,.12));
    border: 1px solid rgba(212,177,255,.28);
    border-radius: 50%;
    box-shadow: 0 0 38px rgba(208,83,174,.25);
    animation: worldGenerationBreathe 1.8s ease-in-out infinite;
}
body.workbench-open .setting-card-generation-label {
    position: absolute;
    bottom: 25px;
    color: #efe7f4;
    font-size: 12px;
    font-weight: 650;
}
@keyframes worldGenerationBreathe {
    0%,100% { transform: scale(.94); opacity: .74; }
    50% { transform: scale(1.07); opacity: 1; }
}
body.workbench-open .world-grid .setting-card-body {
    min-width: 0;
    padding: 9px 28px 7px 0;
    display: flex;
    flex-direction: column;
}
body.workbench-open .world-grid .setting-card-heading { display: block; }
body.workbench-open .world-grid .setting-card-heading h3 {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    overflow: hidden;
    color: var(--world-copy);
    font-size: 17px;
    font-weight: 650;
    white-space: nowrap;
}
body.workbench-open .world-grid .setting-card-heading h3 span { color: #9991a2; font-size: 12px; font-weight: 610; }
body.workbench-open .world-grid .setting-card-heading h3 i { color: #625a6a; font-style: normal; }
body.workbench-open .world-grid .setting-card-heading h3 strong { overflow: hidden; text-overflow: ellipsis; }
body.workbench-open .world-grid .setting-card-description {
    min-height: 0;
    margin: 16px 0 18px;
    overflow: hidden;
    color: var(--world-muted);
    font-size: 12px;
    line-height: 1.75;
    -webkit-line-clamp: 3;
}
body.workbench-open .world-grid .setting-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: #8f8798;
    font-size: 9px;
}
body.workbench-open .world-grid .setting-card.is-incomplete .setting-card-meta span:first-child { color: #ee91cf; }
body.workbench-open .world-grid .setting-delete-button {
    position: absolute;
    top: auto;
    right: 16px;
    bottom: 18px;
    z-index: 3;
    width: 32px;
    min-height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #8f8798;
    background: transparent;
    border: 0;
    border-radius: 9px;
    opacity: .72;
}
body.workbench-open .world-grid .setting-delete-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.workbench-open .world-grid .setting-delete-button:hover:not(:disabled) {
    color: #f18bcf;
    background: rgba(241,139,207,.1);
}
body.workbench-open .world-footer {
    margin-top: 26px;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(178,182,223,.18);
}
body.workbench-open .world-footer p { margin: 0; color: #8f8798; font-size: 10px; }
body.workbench-open .world-footer .primary-button { min-height: 45px; border-radius: 13px; }

/* World creation and management layers. */
body.workbench-open .setting-editor-dialog,
body.workbench-open .setting-extraction-dialog,
body.workbench-open .setting-reference-picker-dialog,
body.workbench-open .setting-generation-dialog {
    color: #f7f2fa;
    background: transparent;
}
body.workbench-open .setting-editor-dialog > form,
body.workbench-open .setting-extraction-shell,
body.workbench-open .setting-reference-picker-shell,
body.workbench-open .setting-generation-shell {
    color: #f7f2fa;
    background:
        radial-gradient(circle at 100% 0,rgba(210,74,161,.13),transparent 34%),
        #191520;
    border: 1px solid rgba(178,182,223,.3);
    box-shadow: 0 30px 90px rgba(8,6,11,.54);
}
body.workbench-open .setting-editor-dialog { width: min(700px,calc(100vw - 28px)); }
body.workbench-open .setting-editor-dialog .dialog-heading,
body.workbench-open .setting-editor-dialog .dialog-body,
body.workbench-open .setting-editor-dialog .dialog-actions { background: transparent; border-color: rgba(178,182,223,.18); }
body.workbench-open .setting-editor-dialog .dialog-heading h2 { color: #f7f2fa; font-size: 28px; }
body.workbench-open .setting-editor-dialog .dialog-copy { color: #aaa2b5; }
body.workbench-open .setting-editor-dialog .field > span { color: #dcd7e2; }
body.workbench-open .setting-editor-dialog input,
body.workbench-open .setting-editor-dialog textarea,
body.workbench-open .setting-editor-dialog select,
body.workbench-open .setting-generation-dialog input,
body.workbench-open .setting-generation-dialog textarea,
body.workbench-open .setting-generation-dialog select {
    color: #f7f2fa;
    background-color: #211b2a;
    border-color: #4e4558;
}
body.workbench-open .setting-editor-dialog textarea { min-height: 132px; }
body.workbench-open .setting-editor-dialog input::placeholder,
body.workbench-open .setting-editor-dialog textarea::placeholder,
body.workbench-open .setting-generation-dialog textarea::placeholder { color: #756d7e; }
body.workbench-open .setting-editor-dialog .secondary-button,
body.workbench-open .setting-generation-dialog .secondary-button,
body.workbench-open .setting-reference-picker-dialog .secondary-button {
    color: #dcd7e2;
    background: #292230;
    border-color: #4e4558;
}
body.workbench-open .setting-generation-heading h2,
body.workbench-open .setting-reference-picker-heading h2 { color: #f7f2fa; }
body.workbench-open .setting-generation-heading p,
body.workbench-open .setting-reference-picker-heading p { color: #aaa2b5; }
body.workbench-open .setting-generation-body,
body.workbench-open .setting-reference-picker-body { background: transparent; }
body.workbench-open .setting-generation-current,
body.workbench-open .setting-generation-prompt-field,
body.workbench-open .setting-generation-reference-section,
body.workbench-open .setting-generation-voice,
body.workbench-open .setting-generation-controls,
body.workbench-open .setting-generation-generate-dock {
    color: #f7f2fa;
    background: #211b2a;
    border-color: #4e4558;
}
body.workbench-open .setting-generation-current {
    background: linear-gradient(135deg,#292230,#211b2a 65%,rgba(94,55,91,.3));
}
body.workbench-open .setting-generation-current-preview,
body.workbench-open .setting-generation-reference-empty,
body.workbench-open .setting-generation-voice-sample,
body.workbench-open .setting-generation-state,
body.workbench-open .setting-generation-history-state,
body.workbench-open .setting-reference-picker-state {
    color: #aaa2b5;
    background: #241e2c;
    border-color: #4e4558;
}
body.workbench-open .setting-generation-current-title small,
body.workbench-open .setting-generation-section-heading span,
body.workbench-open .setting-generation-prompt-field small,
body.workbench-open .setting-generation-current-copy > p,
body.workbench-open .setting-generation-voice-sample > p { color: #aaa2b5; }
body.workbench-open .setting-generation-tabs {
    background: rgba(22,18,28,.7);
    border-color: rgba(178,182,223,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .setting-generation-tab { color: #aaa2b5; }
body.workbench-open .setting-generation-tab:hover { color: #f7f2fa; background: rgba(78,91,153,.18); }
body.workbench-open .setting-generation-tab.is-active {
    color: #f7f2fa;
    background: linear-gradient(135deg,rgba(78,91,153,.78),rgba(105,75,127,.58));
    border-color: rgba(151,161,229,.54);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(37,31,66,.2);
}
body.workbench-open .setting-generation-tab.is-active .setting-generation-tab-icon {
    color: #fff;
    background: rgba(255,255,255,.1);
}
body.workbench-open .setting-generation-generate-dock {
    background: linear-gradient(120deg,rgba(95,110,184,.2),rgba(210,67,157,.14));
}
body.workbench-open .setting-generation-count-options span {
    color: #c8c1ce;
    background: #292230;
    border-color: #4e4558;
}
body.workbench-open .setting-generation-count-options input:checked + span {
    color: #fff;
    background: #4e5b99;
    border-color: #8390da;
}
body.workbench-open .setting-generation-candidate,
body.workbench-open .setting-generation-history-button,
body.workbench-open .setting-reference-asset-card {
    color: #f7f2fa;
    background: #292230;
    border-color: #4e4558;
}
body.workbench-open .setting-generation-candidate-copy span,
body.workbench-open .setting-generation-history-main small { color: #aaa2b5; }
body.workbench-open .setting-generation-footer,
body.workbench-open .setting-reference-picker-footer,
body.workbench-open .setting-extraction-dialog .management-footer {
    color: #aaa2b5;
    background: #191520;
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .setting-reference-picker-list { align-items: stretch; }
body.workbench-open .setting-reference-asset-card { border-radius: 18px; }
body.workbench-open .setting-reference-asset-card img { aspect-ratio: 4/3; object-fit: cover; }

@media (max-width: 760px) {
    body.workbench-open .workbench-stage--settings { width: 100%; }
    body.workbench-open .world-surface {
        padding: 22px 14px 24px;
        border-radius: 20px;
    }
    body.workbench-open .world-heading {
        grid-template-columns: minmax(0,1fr) auto;
        align-items: start;
        gap: 12px;
    }
    body.workbench-open .world-heading h2 { font-size: 24px; }
    body.workbench-open .world-heading .settings-stage-intro { max-width: 230px; font-size: 12px; }
    body.workbench-open .world-heading-actions { gap: 4px; }
    body.workbench-open .world-heading-actions .world-agent-action {
        width: 42px;
        min-height: 42px;
        padding: 0;
        justify-content: center;
    }
    body.workbench-open .world-heading-actions .world-agent-action strong { display: none; }
    body.workbench-open .world-heading-actions .primary-button {
        min-width: 70px;
        min-height: 42px;
        padding: 0 12px;
    }
    body.workbench-open .world-toolbar {
        margin-top: 22px;
        display: block;
    }
    body.workbench-open .world-toolbar .setting-filters {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4,minmax(0,1fr));
    }
    body.workbench-open .world-toolbar .setting-filter {
        min-height: 48px;
        padding: 0 3px;
        font-size: 11px;
    }
    body.workbench-open .world-toolbar .setting-filter::after { right: 5px; left: 5px; }
    body.workbench-open .world-toolbar .settings-summary {
        min-height: 34px;
        padding: 10px 4px 0;
        text-align: right;
        font-size: 9px;
    }
    body.workbench-open .world-grid { grid-template-columns: 1fr; gap: 12px; }
    body.workbench-open .world-grid .setting-card {
        min-height: 168px;
        padding: 12px;
        grid-template-columns: 126px minmax(0,1fr);
        gap: 14px;
        border-radius: 19px;
    }
    body.workbench-open .world-grid .setting-card-preview { min-height: 144px; border-radius: 15px; }
    body.workbench-open .world-grid .setting-status { top: 8px; right: 8px; min-height: 24px; padding: 0 8px; font-size: 8px; }
    body.workbench-open .world-grid .setting-card-body { padding: 7px 24px 5px 0; }
    body.workbench-open .world-grid .setting-card-heading h3 { gap: 5px; font-size: 14px; }
    body.workbench-open .world-grid .setting-card-heading h3 span { font-size: 10px; }
    body.workbench-open .world-grid .setting-card-description { margin: 12px 0 11px; font-size: 10px; line-height: 1.65; -webkit-line-clamp: 3; }
    body.workbench-open .world-grid .setting-card-meta { gap: 5px 9px; font-size: 8px; }
    body.workbench-open .world-grid .setting-delete-button { top: 12px; right: 9px; width: 30px; min-height: 30px; }
    body.workbench-open .setting-card-generation-label { bottom: 16px; font-size: 10px; }
    body.workbench-open .world-footer { margin-top: 20px; padding-top: 15px; }
    body.workbench-open .world-footer p { display: none; }
    body.workbench-open .world-footer .primary-button { width: 100%; }
    body.workbench-open .setting-editor-dialog { width: calc(100vw - 16px); }
    body.workbench-open .setting-editor-dialog .dialog-heading,
    body.workbench-open .setting-editor-dialog .dialog-body,
    body.workbench-open .setting-editor-dialog .dialog-actions { padding-inline: 18px; }
    body.workbench-open .setting-generation-dialog,
    body.workbench-open .setting-reference-picker-dialog { width: calc(100vw - 12px); }
    body.workbench-open .setting-generation-current { grid-template-columns: 1fr; }
    body.workbench-open .setting-generation-current-preview { min-height: 230px; }
    body.workbench-open .setting-generation-visual-workspace { grid-template-columns: 1fr; }
    body.workbench-open .setting-generation-generate-dock { grid-template-columns: 1fr; }
    body.workbench-open .setting-generation-generate-dock .setting-generation-controls { grid-template-columns: 1fr; }
    body.workbench-open .setting-generation-count-options { grid-template-columns: repeat(3,1fr); }
    body.workbench-open .setting-reference-picker-list { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    body.workbench-open .setting-card-generation-orbit { animation: none; }
    body.workbench-open .world-grid .setting-card { transition: none; }
}

/* --------------------------------------------------------------------------
   WORLD v220 — exact production port of the accepted Visualize interaction.
   Detail and paid generation are deliberately separate layers.
   -------------------------------------------------------------------------- */
body.workbench-open .world-heading-actions .world-agent-action:not([hidden]) { display: inline-flex !important; }
body.workbench-open .world-heading-actions .primary-button { min-width: 82px; }
body.workbench-open .world-toolbar {
    margin-top: 26px;
    padding-bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0,auto) minmax(0,1fr) auto;
    align-items: center;
    border-bottom: 1px solid rgba(178,182,223,.18);
}
body.workbench-open .world-toolbar .setting-filters {
    display: flex;
    gap: 8px;
}
body.workbench-open .world-toolbar .setting-filter {
    min-height: 38px;
    padding: 0 15px;
    background: rgba(44,37,53,.76);
    border: 1px solid rgba(178,182,223,.1);
    border-radius: 12px;
}
body.workbench-open .world-toolbar .setting-filter::after { display: none; }
body.workbench-open .world-toolbar .setting-filter.is-active {
    background: #4e5b99;
    border-color: rgba(151,161,229,.58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 8px 20px rgba(35,42,82,.22);
}
body.workbench-open .world-grid {
    gap: 16px;
}
body.workbench-open .world-grid .setting-card {
    min-height: 166px;
    padding: 14px;
    grid-template-columns: 122px minmax(0,1fr);
    gap: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 96% 0,rgba(209,69,159,.12),transparent 36%),
        linear-gradient(145deg,#2b2433 0%,#211b2a 72%);
    border-color: rgba(178,182,223,.34);
    box-shadow: 0 18px 44px rgba(8,6,12,.28), inset 0 1px 0 rgba(255,255,255,.05);
}
body.workbench-open .world-grid .setting-card-preview {
    width: 122px;
    min-height: 136px;
    aspect-ratio: auto;
    border-radius: 17px;
}
body.workbench-open .world-grid .setting-card-body { padding: 7px 26px 5px 0; }
body.workbench-open .world-grid .setting-card-description {
    margin: 13px 0 12px;
    line-height: 1.65;
}
body.workbench-open .world-grid .setting-delete-button { top: auto; right: 12px; bottom: 12px; }
body.workbench-open .world-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
body.workbench-open .world-empty-actions .text-button { color: #c8c1ce; }

/* New world item: one visual choice, one name, one optional description. */
body.workbench-open .setting-kind-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
}
body.workbench-open .setting-kind-cards {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
}
body.workbench-open .setting-kind-card {
    min-height: 96px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    color: #aaa2b5;
    background: #292230;
    border: 1px solid #4e4558;
    border-radius: 18px;
}
body.workbench-open .setting-kind-card span { font-size: 24px; }
body.workbench-open .setting-kind-card strong { font-size: 15px; }
body.workbench-open .setting-kind-card.is-active {
    color: #fff;
    background: linear-gradient(145deg,#4b568f,#3b3454);
    border-color: #8b97df;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 10px 28px rgba(47,57,112,.24);
}
body.workbench-open .setting-create-emblem {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #e9dbf2;
    background: radial-gradient(circle at 50% 50%,rgba(208,83,174,.16),transparent 56%);
}
body.workbench-open .setting-create-emblem span { color: #ed79c3; font-size: 22px; }
body.workbench-open .setting-create-emblem strong { font-size: 13px; font-weight: 650; }

/* WORLD v222 — keep manual creation focused and compact. */
body.workbench-open .setting-editor-dialog input:focus,
body.workbench-open .setting-editor-dialog textarea:focus,
body.workbench-open .setting-editor-dialog select:focus {
    color: #f7f2fa;
    background: #211b2a;
    border-color: #8491e6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(132,145,230,.16);
}
body.workbench-open .setting-editor-dialog input:-webkit-autofill,
body.workbench-open .setting-editor-dialog input:-webkit-autofill:hover,
body.workbench-open .setting-editor-dialog input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f7f2fa;
    caret-color: #f7f2fa;
    -webkit-box-shadow: 0 0 0 1000px #211b2a inset,0 0 0 3px rgba(132,145,230,.16);
    transition: background-color 9999s ease-out 0s;
}
body.workbench-open .setting-create-emblem {
    width: fit-content;
    min-height: 0;
    margin: 0 auto;
    padding: 7px 13px;
    gap: 8px;
    border: 1px solid rgba(237,121,195,.16);
    border-radius: 999px;
    background: rgba(208,83,174,.08);
}
body.workbench-open .setting-create-emblem span { font-size: 17px; }
body.workbench-open .setting-create-emblem strong { font-size: 12px; }

/* Detail drawer: description first, visual second, voice beside visual. */
body.workbench-open .setting-generation-dialog.is-setting-detail {
    width: min(520px,100vw);
    height: 100svh;
    max-height: 100svh;
    margin: 0 0 0 auto;
    border-radius: 26px 0 0 26px;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-shell {
    height: 100%;
    border-radius: inherit;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading { padding: 28px 30px 20px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading .eyebrow { color: #ed79c3; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading h2 { font-size: 29px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading p:last-child { display: none; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-body { padding: 0 30px 30px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-setup {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-tabs { order: 0; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-visual-panel,
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-panel { order: 1; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current { order: 2; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-visual-workspace { display: block; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-reference-section,
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-generate-dock { display: none !important; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field {
    position: relative;
    padding: 18px;
    border-radius: 18px;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field::after {
    content: "✎";
    position: absolute;
    top: 16px;
    right: 18px;
    color: #b8bdf1;
    font-size: 17px;
    pointer-events: none;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field textarea {
    min-height: 112px;
    padding: 12px 0 0;
    background: transparent;
    border: 0;
    resize: vertical;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field small { display: none; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border-radius: 20px;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview {
    width: 100%;
    min-height: 250px;
    aspect-ratio: 4/3;
    border: 0;
    border-radius: 0;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-copy { padding: 18px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-title > div { flex: 1; }
body.workbench-open .setting-generation-dialog.is-setting-detail #setting-generation-current-name { font-size: 18px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-actions button { min-height: 43px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-footer { display: none; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice { padding: 18px; border-radius: 18px; }
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field textarea { min-height: 96px; }

/* Paid generation is a separate studio, never the first thing a card opens. */
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-current,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-tabs { display: none !important; }
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-setup { gap: 18px; }
body.workbench-open .setting-studio-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 2px 12px;
    border-bottom: 1px solid rgba(178,182,223,.18);
}
body.workbench-open .setting-studio-nav[hidden] { display: none !important; }
body.workbench-open .setting-studio-nav button {
    padding: 8px 0;
    color: #8f8798;
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 670;
}
body.workbench-open .setting-studio-nav button.is-active { color: #f7f2fa; }
body.workbench-open .setting-studio-nav button.is-active::after {
    content: "";
    height: 2px;
    margin-top: 9px;
    display: block;
    background: #8491e6;
    border-radius: 99px;
}

@media (max-width:760px) {
    body.workbench-open .world-heading { grid-template-columns: minmax(0,1fr) auto; }
    body.workbench-open .world-heading .settings-stage-intro { max-width: 215px; }
    body.workbench-open .world-toolbar { padding-bottom: 0; }
    body.workbench-open .world-toolbar .setting-filters { gap: 0; }
    body.workbench-open .world-toolbar .setting-filter {
        min-height: 46px;
        padding: 0 3px;
        background: transparent;
        border: 0;
        border-radius: 0;
    }
    body.workbench-open .world-toolbar .setting-filter.is-active { background: transparent; box-shadow: none; }
    body.workbench-open .world-toolbar .setting-filter::after {
        right: 6px;
        bottom: -1px;
        left: 6px;
        height: 3px;
        display: block;
    }
    body.workbench-open .world-toolbar .setting-filter.is-active::after { background: #8491e6; }
    body.workbench-open .world-grid .setting-card {
        min-height: 126px;
        padding: 10px;
        grid-template-columns: 78px minmax(0,1fr);
        gap: 12px;
        border-radius: 18px;
    }
    body.workbench-open .world-grid .setting-card-preview {
        width: 78px;
        min-height: 106px;
        border-radius: 14px;
    }
    body.workbench-open .world-grid .setting-card-body { padding: 5px 22px 3px 0; }
    body.workbench-open .world-grid .setting-card-description { margin: 8px 0 7px; -webkit-line-clamp: 2; }
    body.workbench-open .world-grid .setting-card-meta span:nth-child(2) { display: none; }
    body.workbench-open .world-grid .setting-delete-button { top: auto; right: 7px; bottom: 8px; }
    body.workbench-open .setting-card-generation-orbit { width: 42px; height: 42px; }
    body.workbench-open .setting-card-generation-label { bottom: 10px; }
    body.workbench-open .world-empty-actions { flex-direction: column; gap: 8px; }
    body.workbench-open .setting-kind-cards { gap: 7px; }
    body.workbench-open .setting-kind-card { min-height: 82px; padding: 12px; border-radius: 16px; }
    body.workbench-open .setting-editor-dialog {
        width: 100vw;
        max-width: none;
        max-height: 86svh;
        margin: auto 0 0;
        border-radius: 24px 24px 0 0;
    }
    body.workbench-open .setting-editor-dialog > form { border-radius: inherit; }
    body.workbench-open .setting-editor-dialog .dialog-actions { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    body.workbench-open .setting-generation-dialog.is-setting-detail {
        width: 100vw;
        height: min(86svh,760px);
        max-height: 86svh;
        margin: auto 0 0;
        border-radius: 24px 24px 0 0;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading { padding: 20px 20px 14px; }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-heading h2 { font-size: 24px; }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-body { padding: 0 20px calc(24px + env(safe-area-inset-bottom)); }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview { min-height: 210px; }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-actions { grid-template-columns: 1fr 1fr; }
}

/* WORLD v221 — detail/voice/history alignment with the accepted Visualize flow. */
body.workbench-open .world-empty #empty-create-world {
    color: #fff;
    background: linear-gradient(135deg,#676fc4 0%,#a94b9b 100%);
    border-color: rgba(185,151,225,.46);
    box-shadow: 0 14px 32px rgba(86,70,151,.28);
}
body.workbench-open .world-empty #empty-create-world:hover:not(:disabled) {
    background: linear-gradient(135deg,#7079d2 0%,#bb4fa6 100%);
}
body.workbench-open .world-footer { justify-content: space-between; }

/* The name already lives in the drawer heading; details only edit the description. */
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-title > div {
    display: none;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-title {
    justify-content: flex-end;
}

/* Voice is its own first-class panel. Never repeat the character image underneath it. */
body.workbench-open .setting-generation-dialog.is-setting-detail.is-voice-section .setting-generation-current {
    display: none !important;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-panel {
    width: 100%;
    min-width: 0;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    padding: 2px;
    background: transparent;
    border: 0;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice > .setting-generation-section-heading {
    margin-bottom: 14px;
    padding: 0 2px 14px;
    border-bottom: 1px solid rgba(178,182,223,.12);
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field > span {
    display: block;
    margin-bottom: 9px;
    color: #f7f2fa;
    font-size: 11px;
    font-weight: 760;
    line-height: 1.35;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 118px;
    box-sizing: border-box;
    padding: 13px 14px;
    color: #f4f0f8;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(178,182,223,.17);
    border-radius: 15px;
    line-height: 1.65;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-sample {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 17px;
    border-radius: 17px;
}

/* Studio tabs stay visible while switching between generation and history. */
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-studio-nav {
    margin: 0 0 24px;
    padding: 0 2px;
    gap: 26px;
}
body.workbench-open .setting-studio-nav button {
    position: relative;
    padding: 10px 1px 13px;
}
body.workbench-open .setting-studio-nav button::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: transparent;
    border-radius: 99px;
}
body.workbench-open .setting-studio-nav button.is-active::after {
    margin-top: 0;
    background: #8f9dff;
}

/* Controls are individual surfaces, not a black box inside the generation dock. */
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-controls {
    padding: 0 !important;
    color: inherit;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-model-field,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-count {
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

/* History follows the accepted compact version-row design. */
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-history {
    min-width: 0;
}
body.workbench-open .setting-generation-dialog.is-history-section .setting-generation-footer {
    display: none;
}
body.workbench-open .setting-generation-history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 12px;
}
body.workbench-open .setting-generation-history-heading h3 {
    color: #f4f0f8;
    font-size: 15px;
    font-weight: 690;
}
body.workbench-open .setting-generation-history-heading > span {
    color: #918a9a;
    font-size: 10px;
}
body.workbench-open .setting-generation-history-list {
    margin-top: 0;
    display: grid;
    gap: 9px;
}
body.workbench-open .setting-generation-history-button {
    min-height: 72px;
    padding: 14px;
    background: rgba(255,255,255,.035);
    border-color: rgba(178,182,223,.13);
    border-radius: 15px;
    box-shadow: none;
}
body.workbench-open .setting-generation-history-button:hover {
    transform: none;
    background: rgba(78,91,153,.1);
    border-color: rgba(143,157,255,.34);
    box-shadow: none;
}
body.workbench-open .setting-generation-history-main { gap: 4px; }
body.workbench-open .setting-generation-history-main strong { color: #e7e2eb; font-size: 12px; }
body.workbench-open .setting-generation-history-main small { color: #918a9a; font-size: 9px; }
body.workbench-open .setting-generation-history-badges em {
    padding: 0;
    color: #aaa2b8;
    background: transparent;
    border: 0;
    font-size: 9px;
}
body.workbench-open .setting-generation-history-badges em.is-current { color: #9aa8ff; }
body.workbench-open .setting-generation-history-badges em.is-stale { color: #8f8798; background: transparent; border: 0; }
body.workbench-open .setting-generation-history-actions {
    margin-top: 18px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(178,182,223,.12);
}
body.workbench-open .setting-generation-history-actions .text-button {
    color: #aaa2b8;
}
body.workbench-open .setting-generation-history-actions .primary-button {
    min-height: 42px;
    padding-inline: 18px;
}

@media (max-width:760px) {
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-sample {
        margin-top: 14px;
        padding: 14px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-studio-nav { margin-bottom: 18px; }
    body.workbench-open .setting-generation-history-button {
        min-height: 66px;
        grid-template-columns: minmax(0,1fr) auto 16px;
    }
    body.workbench-open .setting-generation-history-badges {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-end;
    }
    body.workbench-open .setting-generation-history-arrow { grid-column: auto; grid-row: auto; }
}

/* WORLD v223 — clear detail reading, contextual empty actions, and image zoom. */
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field {
    padding: 16px;
    gap: 10px;
    background: linear-gradient(145deg,rgba(43,36,51,.94),rgba(31,26,39,.96));
    border: 1px solid rgba(178,182,223,.24);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

/* WORLD v224 — world cards now mirror background generation state live. */
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field::after {
    content: none;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field > span {
    color: #f4eff7;
    font-size: 13px;
    font-weight: 720;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field textarea {
    min-height: 108px;
    max-height: 240px;
    margin-top: 0;
    padding: 13px 14px;
    color: #e9e3ed;
    background: rgba(12,10,16,.24);
    border: 1px solid rgba(178,182,223,.16);
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.7;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field textarea:focus {
    color: #f7f2fa;
    background: rgba(12,10,16,.34);
    border-color: rgba(132,145,230,.7);
    outline: none;
    box-shadow: 0 0 0 3px rgba(132,145,230,.13);
}

/* WORLD v230 — role and voice descriptions share one cinematic editor card. */
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice {
    padding: 0;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 16px;
    gap: 10px;
    background: linear-gradient(145deg,rgba(43,36,51,.94),rgba(31,26,39,.96));
    border: 1px solid rgba(178,182,223,.24);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field > span {
    margin: 0;
    color: #f4eff7;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.35;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field > span em {
    margin-left: 6px;
    color: #8f8799;
    font-size: 10px;
    font-style: normal;
    font-weight: 620;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field textarea {
    min-height: 108px;
    max-height: 240px;
    margin-top: 0;
    padding: 13px 14px;
    color: #e9e3ed;
    background: rgba(12,10,16,.24);
    border: 1px solid rgba(178,182,223,.16);
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.7;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field textarea:focus {
    color: #f7f2fa;
    background: rgba(12,10,16,.34);
    border-color: rgba(132,145,230,.7);
    outline: none;
    box-shadow: 0 0 0 3px rgba(132,145,230,.13);
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-sample {
    margin-top: 14px;
    padding: 16px;
    background: linear-gradient(145deg,rgba(43,36,51,.94),rgba(31,26,39,.96));
    border: 1px solid rgba(178,182,223,.24);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current.is-empty .setting-generation-current-copy {
    display: none;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview.is-empty {
    min-height: 250px;
    padding: 28px;
    align-content: center;
    gap: 17px;
    color: #aaa2b5;
    background:
        radial-gradient(circle at 50% 42%,rgba(121,91,177,.13),transparent 42%),
        #211b2a;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview.is-empty > span {
    font-size: 13px;
    font-weight: 680;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview .setting-generation-current-actions {
    width: min(100%,340px);
    margin: 0 auto;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current.is-empty .setting-generation-current-actions .is-reuse {
    color: #fff;
    background: linear-gradient(135deg,#5968b5,#b3499d);
    border-color: rgba(178,182,223,.32);
    box-shadow: 0 10px 24px rgba(73,58,132,.22);
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview img.is-zoomable {
    cursor: zoom-in;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview img.is-zoomable:focus-visible {
    outline: 3px solid rgba(154,168,255,.72);
    outline-offset: -5px;
}
body.workbench-open .setting-generation-history-actions {
    justify-content: flex-start;
}

@media (max-width:760px) {
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-prompt-field textarea {
        min-height: 116px;
        font-size: 14px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field {
        padding: 16px;
        border-radius: 17px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-description-field.setting-generation-prompt-field textarea {
        min-height: 116px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-voice-sample {
        margin-top: 10px;
        padding: 16px;
        border-radius: 17px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-preview.is-empty {
        min-height: 220px;
        padding: 22px 16px;
    }
}

/* 0.2.76 empty productions studio. Keep the regular productions heading for
   loading, errors and existing libraries; simplify it only for the true empty state. */
.app-view--productions {
    padding-top: clamp(36px, 6vh, 64px);
}

.app-view--productions .view-heading {
    margin-bottom: 24px;
}

.app-view--productions .view-heading h1 {
    display: none;
}

.app-view--productions.is-empty .view-heading .primary-button,
.app-view--productions.is-empty .view-subtitle {
    display: none;
}

.app-view--productions.is-empty .view-heading {
    margin-bottom: 18px;
    align-items: center;
}

.app-view--productions.is-empty .view-heading .eyebrow {
    margin: 0;
}

.empty-studio {
    position: relative;
    min-height: min(520px, 56vh);
    padding: clamp(30px, 5vw, 56px);
    display: grid;
    grid-template-columns: minmax(220px, .82fr) minmax(300px, 1.18fr);
    align-items: center;
    gap: clamp(28px, 5vw, 66px);
    overflow: hidden;
    text-align: left;
    background:
        radial-gradient(circle at 88% 8%, rgba(225, 106, 217, .18), transparent 34%),
        radial-gradient(circle at 8% 100%, rgba(78, 91, 153, .24), transparent 37%),
        linear-gradient(145deg, #29243a 0%, #211d31 58%, #1b1828 100%);
    border: 1px solid rgba(178, 182, 223, .20);
    border-radius: 26px;
    box-shadow: 0 24px 58px rgba(30, 25, 45, .20);
}

.empty-studio-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.empty-studio .empty-studio-kicker {
    max-width: none;
    margin: 0 0 15px;
    color: #e986df;
    font-size: 11px;
    font-weight: 820;
    line-height: 1.4;
    letter-spacing: .12em;
}

.empty-studio h2 {
    max-width: 8.8em;
    margin: 0;
    color: #f8f4fa;
    font-size: clamp(31px, 4vw, 46px);
    line-height: 1.14;
    letter-spacing: -.045em;
}

.empty-studio-copy > p:not(.empty-studio-kicker):not(.empty-studio-note) {
    max-width: 31em;
    margin: 17px 0 23px;
    color: rgba(233, 226, 239, .72);
    font-size: 13px;
    line-height: 1.75;
}

.empty-studio .primary-button {
    min-height: 46px;
    padding-inline: 20px;
}

.empty-studio .empty-studio-note {
    max-width: none;
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(233, 226, 239, .48);
    font-size: 10px;
    line-height: 1.5;
}

.empty-studio-note svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: #e986df;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-studio-art {
    position: relative;
    width: min(100%, 440px);
    margin-left: auto;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #17162a;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 22px;
    box-shadow: 0 24px 52px rgba(30, 25, 45, .19), 0 8px 18px rgba(78, 91, 153, .11);
}

.empty-studio-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width:760px) {
    .app-view--productions {
        padding-top: 14px;
    }

    .app-view--productions .view-heading {
        margin-bottom: 18px;
    }

    .app-view--productions.is-empty .view-heading {
        margin-bottom: 14px;
    }

    .empty-studio {
        min-height: 0;
        padding: 0 0 18px;
        grid-template-columns: 1fr;
        gap: 0;
        border-radius: 22px;
    }

    .empty-studio-art {
        order: -1;
        width: 100%;
        height: 216px;
        margin: 0;
        aspect-ratio: auto;
        border: 0;
        border-radius: 21px 21px 0 0;
        box-shadow: none;
    }

    .empty-studio-copy {
        padding: 22px 20px 0;
    }

    .empty-studio .empty-studio-kicker {
        margin-bottom: 12px;
        font-size: 10px;
    }

    .empty-studio h2 {
        max-width: none;
        font-size: 25px;
        line-height: 1.18;
    }

    .empty-studio-copy > p:not(.empty-studio-kicker):not(.empty-studio-note) {
        margin: 13px 0 18px;
        font-size: 12px;
        line-height: 1.68;
    }

    .empty-studio .primary-button {
        width: 100%;
        min-height: 46px;
    }

    .empty-studio .empty-studio-note {
        margin-top: 12px;
        justify-content: center;
        font-size: 10px;
    }
}

/* WORLD v225 — one cinematic card surface; type is expressed by restrained label color. */
body.workbench-open .world-grid {
    --world-card-preview-surface:
        radial-gradient(circle at 50% 34%,rgba(139,152,241,.16),transparent 46%),
        linear-gradient(145deg,#35384d 0%,#2a2737 54%,#211d29 100%);
}
body.workbench-open .world-grid .setting-card-preview,
body.workbench-open .world-grid .setting-card--character .setting-card-preview,
body.workbench-open .world-grid .setting-card--location .setting-card-preview,
body.workbench-open .world-grid .setting-card--prop .setting-card-preview {
    background: var(--world-card-preview-surface);
    border-color: rgba(166,174,224,.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
body.workbench-open .world-grid .setting-card--character .setting-card-heading h3 > span:first-child {
    color: #aab5ff;
}
body.workbench-open .world-grid .setting-card--location .setting-card-heading h3 > span:first-child {
    color: #72d5c8;
}
body.workbench-open .world-grid .setting-card--prop .setting-card-heading h3 > span:first-child {
    color: #efbf7f;
}
body.workbench-open .world-toolbar .settings-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}
body.workbench-open .world-toolbar .settings-summary > span { white-space: nowrap; }
body.workbench-open .world-toolbar .settings-summary .is-generating { color: #c9a1ff; }
body.workbench-open .world-toolbar .settings-summary .is-pending { color: #ef83c7; }
body.workbench-open .world-toolbar .settings-summary .is-complete { color: #8f8798; }

/* The world Agent reuses the cinematic storyboard generation language. */
body.workbench-open .setting-extraction-dialog .setting-agent-state {
    min-height: 430px;
    padding: 0;
    color: #f7f2fa;
    background: transparent;
    border: 0;
    border-radius: 20px;
    box-shadow: none;
}
body.workbench-open .setting-extraction-dialog .setting-extraction-agent {
    width: 100%;
    min-height: 430px;
    padding: 44px 24px;
}
body.workbench-open .setting-extraction-dialog .setting-extraction-agent h3 { color: #f7f2fa; }

/* Extracted world items stay compact and use the same dark card system as the world grid. */
body.workbench-open .setting-extraction-items { gap: 10px; }
body.workbench-open .setting-extraction-item {
    padding: 14px 15px;
    gap: 12px;
    color: #f7f2fa;
    background:
        radial-gradient(circle at 100% 0,rgba(211,73,162,.08),transparent 38%),
        linear-gradient(145deg,#2a2432,#211b2a);
    border: 1px solid rgba(178,182,223,.24);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 10px 26px rgba(8,6,12,.16);
}
body.workbench-open .setting-extraction-item.is-existing {
    opacity: .64;
    background: #211c28;
}
body.workbench-open .setting-extraction-item > input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #7180d5;
}
body.workbench-open .setting-extraction-item-meta {
    margin-bottom: 9px;
    color: #aaa2b5;
    font-size: 10px;
}
body.workbench-open .setting-extraction-item-meta strong { font-size: 12px; }
body.workbench-open .setting-extraction-item--character .setting-extraction-item-meta strong { color: #aab5ff; }
body.workbench-open .setting-extraction-item--location .setting-extraction-item-meta strong { color: #72d5c8; }
body.workbench-open .setting-extraction-item--prop .setting-extraction-item-meta strong { color: #efbf7f; }
body.workbench-open .setting-extraction-item-fields {
    grid-template-columns: minmax(150px,.38fr) minmax(0,1fr);
    gap: 10px;
}
body.workbench-open .setting-extraction-item-fields label:last-child { grid-column: auto; }
body.workbench-open .setting-extraction-item .field { gap: 6px; }
body.workbench-open .setting-extraction-item .field > span {
    color: #aaa2b5;
    font-size: 9px;
}
body.workbench-open .setting-extraction-item input,
body.workbench-open .setting-extraction-item textarea {
    min-height: 46px;
    padding: 11px 13px;
    color: #f4eff7;
    background: rgba(12,10,16,.26);
    border: 1px solid rgba(178,182,223,.18);
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.55;
}
body.workbench-open .setting-extraction-item textarea {
    height: 68px;
    min-height: 68px;
    resize: vertical;
}
body.workbench-open .setting-extraction-item input:focus,
body.workbench-open .setting-extraction-item textarea:focus {
    border-color: rgba(132,145,230,.68);
    outline: none;
    box-shadow: 0 0 0 3px rgba(132,145,230,.12);
}

@media (max-width:700px) {
    body.workbench-open .setting-extraction-dialog .setting-agent-state,
    body.workbench-open .setting-extraction-dialog .setting-extraction-agent { min-height: 360px; }
    body.workbench-open .setting-extraction-dialog .setting-extraction-agent { padding: 34px 18px; }
    body.workbench-open .setting-extraction-item { padding: 12px; gap: 9px; }
    body.workbench-open .setting-extraction-item-fields { grid-template-columns: 1fr; gap: 8px; }
    body.workbench-open .setting-extraction-item-fields label:last-child { grid-column: auto; }
    body.workbench-open .setting-extraction-item textarea { height: 76px; min-height: 76px; }
}

@media (max-width:760px) {
    body.workbench-open .world-toolbar {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: center;
        column-gap: 8px;
    }
    body.workbench-open .world-toolbar .setting-filters { min-width: 0; }
    body.workbench-open .world-toolbar .setting-filter {
        min-width: 0;
        font-size: 10px;
    }
    body.workbench-open .world-toolbar .settings-summary {
        min-height: 0;
        margin: 0;
        padding: 0;
        gap: 5px;
        font-size: 7.5px;
        line-height: 1.25;
        text-align: right;
    }
    body.workbench-open .world-footer {
        position: static;
        margin: 20px 0 0;
        padding: 15px 0 calc(2px + env(safe-area-inset-bottom));
        display: flex;
        justify-content: center;
        background: transparent !important;
        border-top-color: rgba(178,182,223,.16);
        box-shadow: none;
    }
    body.workbench-open .world-footer[hidden] { display: none !important; }
    body.workbench-open .world-surface { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* WORLD v226 — mobile studio/picker geometry and dark-surface legibility. */
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-prompt-field > span,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field > span,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-count legend {
    color: #f4eff7;
}
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field select {
    color: #f4eff7;
    background-color: #211b2a;
    border-color: #4e4558;
    color-scheme: dark;
}
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field select option {
    color: #f4eff7;
    background: #211b2a;
}
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-history-state strong {
    color: #f4eff7;
}
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-history-state > span {
    color: #aaa2b5;
}
body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-actions button {
    font-size: 11px;
    font-weight: 700;
}
body.workbench-open .setting-extraction-dialog .agent-generation-status,
body.workbench-open .setting-extraction-dialog .agent-generation-status strong {
    color: #dcd7e2;
}

@media (max-width:760px) {
    body.workbench-open .setting-generation-dialog.is-setting-studio,
    body.workbench-open .setting-reference-picker-dialog {
        width: 100vw;
        width: 100dvw;
        height: 100svh;
        height: 100dvh;
        max-width: none;
        max-height: none;
        margin: 0;
        inset: 0;
        border: 0;
        border-radius: 0;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-shell,
    body.workbench-open .setting-reference-picker-dialog .setting-reference-picker-shell {
        width: 100%;
        height: 100svh;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        border: 0;
        border-radius: 0;
        scrollbar-color: rgba(138, 129, 151, .78) #19151f;
        scrollbar-width: thin;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-shell::-webkit-scrollbar,
    body.workbench-open .setting-reference-picker-dialog .setting-reference-picker-shell::-webkit-scrollbar {
        width: 7px;
        height: 7px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-shell::-webkit-scrollbar-track,
    body.workbench-open .setting-reference-picker-dialog .setting-reference-picker-shell::-webkit-scrollbar-track {
        background: #19151f;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-shell::-webkit-scrollbar-thumb,
    body.workbench-open .setting-reference-picker-dialog .setting-reference-picker-shell::-webkit-scrollbar-thumb {
        background: rgba(138, 129, 151, .78);
        border: 2px solid #19151f;
        border-radius: 999px;
    }
    body.workbench-open .setting-reference-picker-heading .eyebrow {
        font-size: 10px;
    }
    body.workbench-open .setting-reference-picker-heading h2 {
        font-size: 21px;
        line-height: 1.28;
    }
    body.workbench-open .setting-reference-picker-heading p:last-child {
        max-width: calc(100vw - 72px);
        font-size: 10px;
        line-height: 1.6;
    }
    body.workbench-open .setting-reference-picker-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    body.workbench-open .setting-reference-asset-card {
        min-height: 126px;
        padding: 9px;
        display: grid;
        grid-template-columns: 116px minmax(0,1fr);
        grid-template-rows: minmax(0,1fr) auto;
        column-gap: 12px;
        border-radius: 16px;
    }
    body.workbench-open .setting-reference-asset-preview {
        grid-row: 1 / 3;
        width: 116px;
        height: 108px;
        aspect-ratio: auto;
        border-radius: 12px;
    }
    body.workbench-open .setting-reference-asset-copy {
        min-width: 0;
        padding: 6px 2px 5px;
        align-self: center;
        gap: 5px;
    }
    body.workbench-open .setting-reference-asset-copy strong {
        font-size: 13px;
        line-height: 1.45;
    }
    body.workbench-open .setting-reference-asset-copy > span,
    body.workbench-open .setting-reference-asset-copy small {
        font-size: 9px;
        line-height: 1.5;
    }
    body.workbench-open .setting-reference-asset-action {
        min-height: 36px;
        align-self: end;
        font-size: 10px;
    }
    body.workbench-open .setting-reference-picker-footer > div {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-controls {
        grid-template-columns: minmax(0,1fr) minmax(124px,.42fr);
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-prompt-field > span,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field > span,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-count legend {
        font-size: 11px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-history-state {
        min-height: 280px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-history-state strong {
        font-size: 15px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail .setting-generation-current-actions button {
        font-size: 11px;
    }
}

/* WORLD v233 — shot-reference management joins the cinematic workbench system. */
body.workbench-open .shot-reference-dialog {
    color: #f7f2fa;
    background: #191520;
    border: 1px solid rgba(178,182,223,.3);
    border-radius: 22px;
    box-shadow: 0 32px 96px rgba(8,6,11,.62);
}
body.workbench-open .shot-reference-dialog::backdrop {
    background: rgba(12,9,18,.68);
    backdrop-filter: blur(8px);
}
body.workbench-open .shot-reference-shell {
    color: #f7f2fa;
    background:
        radial-gradient(circle at 100% 0,rgba(210,74,161,.13),transparent 34%),
        #191520;
}
body.workbench-open .shot-reference-dialog .management-heading {
    padding: 24px 27px 19px;
    background: rgba(25,21,32,.96);
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .shot-reference-dialog .management-heading .eyebrow {
    color: #ed79c3;
    font-size: 10px;
    letter-spacing: .14em;
}
body.workbench-open .shot-reference-dialog .management-heading h2 {
    margin-top: 7px;
    color: #f7f2fa;
    font-size: 24px;
    line-height: 1.22;
    letter-spacing: -.025em;
}
body.workbench-open .shot-reference-dialog .management-heading p:last-child {
    max-width: 650px;
    margin-top: 8px;
    color: #aaa2b5;
    font-size: 10px;
    line-height: 1.6;
}
body.workbench-open .shot-reference-dialog .management-heading .icon-button {
    color: #dcd7e2;
    background: transparent;
    border-color: transparent;
}
body.workbench-open .shot-reference-dialog .management-heading .icon-button:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}
body.workbench-open .shot-reference-body {
    padding: 19px 23px 22px;
    background: transparent;
    scrollbar-color: rgba(138,129,151,.78) #19151f;
}
body.workbench-open .shot-reference-list { gap: 10px; }
body.workbench-open .shot-reference-option {
    min-height: 82px;
    padding: 11px;
    color: #f7f2fa;
    background: linear-gradient(145deg,rgba(43,36,51,.94),rgba(31,26,39,.96));
    border-color: rgba(178,182,223,.2);
    border-radius: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
body.workbench-open .shot-reference-option:hover {
    background: linear-gradient(145deg,rgba(47,40,58,.98),rgba(33,28,42,.98));
    border-color: rgba(132,145,230,.52);
    transform: translateY(-1px);
}
body.workbench-open .shot-reference-option:has(input:checked) {
    background: linear-gradient(145deg,rgba(72,79,126,.72),rgba(47,39,62,.96));
    border-color: rgba(154,168,255,.75);
    box-shadow: 0 0 0 2px rgba(105,116,173,.16), inset 0 1px 0 rgba(255,255,255,.05);
}
body.workbench-open .shot-reference-option.is-pending {
    background: rgba(41,34,48,.86);
    border-color: rgba(225,106,217,.32);
    border-style: dashed;
}
body.workbench-open .shot-reference-option input {
    color-scheme: dark;
    accent-color: #8491e6;
}
body.workbench-open .shot-reference-thumb {
    color: #c9cdfa;
    background: linear-gradient(145deg,#373046,#272230);
    border: 1px solid rgba(178,182,223,.18);
    border-radius: 11px;
}
body.workbench-open .shot-reference-thumb img { border-radius: 10px; }
body.workbench-open .shot-reference-option-copy strong {
    color: #f7f2fa;
    font-size: 12px;
}
body.workbench-open .shot-reference-option-copy span {
    color: #aaa2b5;
    font-size: 8.5px;
}
body.workbench-open .shot-reference-option[data-kind="character"] .shot-reference-option-copy span { color: #aeb8ff; }
body.workbench-open .shot-reference-option[data-kind="location"] .shot-reference-option-copy span { color: #69d8c4; }
body.workbench-open .shot-reference-option[data-kind="prop"] .shot-reference-option-copy span { color: #efbd79; }
body.workbench-open .shot-reference-edit {
    color: #c9cdfa;
    background: rgba(105,116,173,.15);
    border-color: rgba(132,145,230,.28);
}
body.workbench-open .shot-reference-edit:hover {
    color: #fff;
    background: #4e5b99;
    border-color: #8491e6;
}
body.workbench-open .shot-reference-option.is-pending .shot-reference-edit {
    color: #ef91d0;
    background: rgba(201,59,138,.12);
    border-color: rgba(225,106,217,.26);
}
body.workbench-open .shot-reference-video,
body.workbench-open .shot-continuity-option,
body.workbench-open .shot-no-reference-option,
body.workbench-open .shot-no-reference-reason-field {
    color: #f7f2fa;
    background: #211b2a;
    border-color: rgba(178,182,223,.2);
    border-radius: 15px;
}
body.workbench-open .shot-reference-video p,
body.workbench-open .shot-reference-video small,
body.workbench-open .shot-continuity-option small,
body.workbench-open .shot-no-reference-option small { color: #aaa2b5; }
body.workbench-open .shot-reference-video select,
body.workbench-open .shot-no-reference-reason-field input {
    color: #f7f2fa;
    color-scheme: dark;
    background: #17131d;
    border-color: rgba(178,182,223,.24);
}
body.workbench-open .shot-reference-empty {
    color: #aaa2b5;
    background: rgba(41,34,48,.72);
    border-color: rgba(178,182,223,.2);
}
body.workbench-open .shot-reference-footer {
    color: #aaa2b5;
    background: rgba(25,21,32,.97);
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .shot-reference-footer .text-button { color: #ed79c3; }
body.workbench-open .shot-reference-footer .secondary-button {
    color: #dcd7e2;
    background: #292230;
    border-color: #4e4558;
}
body.workbench-open .shot-reference-footer .primary-button {
    color: #fff;
    background: linear-gradient(135deg,#5d69ad,#ca3d96);
    border-color: rgba(255,255,255,.1);
}
body.workbench-open .setting-generation-reference-empty {
    min-height: 42px;
    margin-top: 10px;
    padding: 0 12px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #8f8798;
    background: rgba(36,30,44,.56);
    border-color: rgba(178,182,223,.16);
    border-radius: 11px;
}
body.workbench-open .setting-generation-reference-empty p { font-size: 9px; }
body.workbench-open .setting-generation-reference-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
}
body.workbench-open .setting-generation-reference-actions .secondary-button {
    min-height: 36px;
    color: #c9cdfa;
    background: rgba(78,91,153,.12);
    border-color: rgba(132,145,230,.25);
    border-radius: 10px;
    font-size: 10px;
}

@media (max-width: 760px) {
    body.workbench-open .shot-reference-dialog { border-radius: 20px; }
    body.workbench-open .shot-reference-dialog .management-heading { padding: 17px 16px 14px; }
    body.workbench-open .shot-reference-dialog .management-heading h2 { font-size: 21px; }
    body.workbench-open .shot-reference-dialog .management-heading p:last-child { font-size: 9px; }
    body.workbench-open .shot-reference-body { padding: 12px 12px 16px; }
    body.workbench-open .shot-reference-list { gap: 8px; }
    body.workbench-open .shot-reference-option { min-height: 74px; padding: 8px; border-radius: 13px; }
    body.workbench-open .shot-reference-option:hover { transform: none; }
    body.workbench-open .shot-reference-option-copy strong { font-size: 10.5px; }
    body.workbench-open .shot-reference-option-copy span { font-size: 7.5px; }
    body.workbench-open .shot-reference-footer { padding: 12px; }
    body.workbench-open .setting-generation-reference-actions {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 7px;
    }
    body.workbench-open .setting-generation-reference-actions .secondary-button {
        min-height: 36px;
        padding: 0 8px;
        font-size: 9px;
    }
    body.workbench-open .world-toolbar {
        grid-template-columns: minmax(0,1fr) auto auto;
        column-gap: 7px;
    }
    body.workbench-open .world-toolbar .world-heading-actions .primary-button {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 10px;
    }
    body.workbench-open .world-toolbar .world-heading-actions .primary-button span { display: none; }
    body.workbench-open .world-toolbar .world-heading-actions .primary-button svg { width: 15px; height: 15px; }
}

/* WORLD v234 — official setting artwork stays fully visible inside the detail stage. */
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview:not(.is-empty) > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #18131f;
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-actions .is-reuse {
    color: #fff;
    background: linear-gradient(135deg,#5968b5 0%,#8b57b8 54%,#c93b8a 100%);
    border-color: rgba(178,182,223,.36);
    box-shadow: 0 10px 24px rgba(89,73,154,.24);
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-actions .is-reuse:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* WORLD v235 — new world items start from the same visual axis as the filters. */
body.workbench-open .world-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* WORLD v236 — aligned creation action and one cinematic lifecycle surface. */
body.workbench-open .world-heading {
    display: block;
}
body.workbench-open .world-heading-copy { min-width: 0; }
body.workbench-open .world-heading-subline {
    margin-top: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
body.workbench-open .world-heading .world-heading-subline .settings-stage-intro {
    min-width: 0;
    margin: 0;
}
body.workbench-open .world-heading-subline .world-heading-actions {
    flex: 0 0 auto;
}
body.workbench-open .world-heading-subline .world-heading-actions .primary-button {
    min-width: 0;
    min-height: 30px;
    padding: 0 2px 0 8px;
    gap: 6px;
    color: #dedfff;
    background: transparent;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
}
body.workbench-open .world-heading-subline .world-heading-actions .primary-button:hover {
    color: #fff;
    background: transparent;
    border-color: transparent;
    transform: translateX(2px);
}
body.workbench-open .world-heading-subline .world-heading-actions .primary-button svg {
    width: 14px;
    height: 14px;
    stroke: #ed79c3;
}
body.workbench-open .world-toolbar { margin-top: 18px; }
body.workbench-open .world-toolbar .setting-filters { flex: 0 1 auto; }
body.workbench-open .world-toolbar .settings-summary { margin-left: auto; }

body.workbench-open .world-grid .setting-card-preview.is-placeholder {
    isolation: isolate;
    color: #aaa4b1;
    background:
        radial-gradient(circle at 50% 42%,rgba(118,128,193,.08),transparent 44%),
        linear-gradient(145deg,#1b1820 0%,#141218 100%);
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .world-grid .setting-card-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    color: rgba(231,226,238,.12);
    font: 720 12px/1 'JetBrains Mono',ui-monospace,monospace;
    letter-spacing: .26em;
    transform: translate(-50%,-50%);
    white-space: nowrap;
}
body.workbench-open .world-grid .setting-card-preview.is-generating-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at 50% 55%,rgba(198,86,177,.13),transparent 34%);
    animation: worldGenerationSurface 2.4s ease-in-out infinite;
    pointer-events: none;
}
body.workbench-open .world-grid .setting-card-preview.is-generating-preview .setting-card-watermark {
    opacity: .6;
}
body.workbench-open .setting-card-generation-label {
    position: absolute;
    right: 0;
    bottom: 28px;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #eee8f2;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .03em;
}
body.workbench-open .setting-card-generation-dots {
    width: 16px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
body.workbench-open .setting-card-generation-dots i {
    width: 3px;
    height: 3px;
    opacity: .2;
    background: #ef83c7;
    border-radius: 50%;
    animation: worldGenerationDot 1.2s ease-in-out infinite;
}
body.workbench-open .setting-card-generation-dots i:nth-child(2) { animation-delay: .18s; }
body.workbench-open .setting-card-generation-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes worldGenerationSurface {
    0%,100% { opacity: .42; }
    50% { opacity: 1; }
}
@keyframes worldGenerationDot {
    0%,60%,100% { opacity: .2; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-2px); }
}
body.workbench-open .setting-generation-results-actions {
    margin-left: auto;
    justify-content: flex-end;
}
body.workbench-open #show-setting-generation-history { order: 3; }
body.workbench-open #return-latest-setting-generation { order: 2; }
body.workbench-open #setting-generation-progress { order: 1; }

@media (max-width: 760px) {
    body.workbench-open .world-heading-subline { gap: 10px; }
    body.workbench-open .world-heading .world-heading-subline .settings-stage-intro {
        max-width: none;
        font-size: 11px;
    }
    body.workbench-open .world-heading-subline .world-heading-actions .primary-button {
        min-width: 0;
        min-height: 28px;
        padding: 0 1px 0 6px;
        font-size: 8.5px;
        border-radius: 0;
    }
    body.workbench-open .world-toolbar { margin-top: 13px; }
    body.workbench-open .setting-generation-results-actions {
        width: 100%;
        justify-content: flex-end;
    }
    body.workbench-open .world-grid .setting-card-watermark { font-size: 9px; }
    body.workbench-open .setting-card-generation-label { bottom: 14px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    body.workbench-open .world-grid .setting-card-preview.is-generating-preview::after,
    body.workbench-open .setting-card-generation-dots i { animation: none; }
    body.workbench-open .setting-card-generation-dots i { opacity: 1; }
}
body.workbench-open .world-toolbar .setting-filters { flex: 0 1 auto; }
body.workbench-open .world-toolbar .world-heading-actions { flex: 0 0 auto; }
body.workbench-open .world-toolbar .settings-summary { margin-left: auto; }
body.workbench-open .world-toolbar .world-heading-actions .primary-button {
    width: auto;
    min-width: 70px;
    min-height: 36px;
    padding: 0 11px;
    gap: 6px;
    color: #d7d9fb;
    background: transparent;
    border-color: rgba(178,182,223,.26);
    border-radius: 11px;
}
body.workbench-open .world-toolbar .world-heading-actions .primary-button:hover {
    color: #fff;
    background: rgba(201,59,138,.1);
    border-color: rgba(225,106,217,.46);
}
body.workbench-open .world-toolbar .world-heading-actions .primary-button svg {
    width: 14px;
    height: 14px;
    stroke: #ed79c3;
}
body.workbench-open .world-toolbar .world-heading-actions .primary-button span { display: inline; }

@media (max-width: 760px) {
    body.workbench-open .world-toolbar { display: flex; gap: 5px; }
    body.workbench-open .world-toolbar .setting-filters {
        min-width: 0;
        flex: 1 1 auto;
        gap: 2px;
    }
    body.workbench-open .world-toolbar .setting-filter {
        min-width: 0;
        min-height: 34px;
        padding: 0 7px;
        font-size: 9px;
        border-radius: 9px;
    }
    body.workbench-open .world-toolbar .world-heading-actions .primary-button {
        width: auto;
        min-width: 54px;
        min-height: 32px;
        padding: 0 7px;
        gap: 4px;
        font-size: 8.5px;
        border-radius: 9px;
    }
    body.workbench-open .world-toolbar .world-heading-actions .primary-button span { display: inline; }
    body.workbench-open .world-toolbar .settings-summary {
        max-width: 64px;
        font-size: 7px;
    }
}

/* WORLD v240 — compact creation switcher, paired result pills, and ergonomic empty-artwork actions. */
body.workbench-open .setting-editor-dialog .setting-kind-cards {
    width: 100%;
    max-width: 760px;
    padding: 5px;
    gap: 5px;
    background: rgba(22,18,28,.7);
    border: 1px solid rgba(178,182,223,.18);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .setting-editor-dialog .setting-kind-card {
    min-height: 54px;
    padding: 0 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    color: #9991a4;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
}
body.workbench-open .setting-editor-dialog .setting-kind-card span {
    width: 22px;
    color: #a9a1b4;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}
body.workbench-open .setting-editor-dialog .setting-kind-card span svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.workbench-open .setting-editor-dialog .setting-kind-card strong {
    font-size: 14px;
    font-weight: 690;
}
body.workbench-open .setting-editor-dialog .setting-kind-card.is-active {
    color: #f8f3fa;
    background: linear-gradient(135deg,rgba(78,91,153,.78),rgba(105,75,127,.58));
    border-color: rgba(151,161,229,.54);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(37,31,66,.2);
}
body.workbench-open .setting-editor-dialog .setting-kind-card.is-active span { color: #fff; }
body.workbench-open .setting-editor-dialog .setting-create-emblem { display: none !important; }

body.workbench-open .setting-generation-results-heading {
    display: block;
}
body.workbench-open .setting-generation-results-meta {
    width: 100%;
    min-width: 0;
    margin-top: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
}
body.workbench-open .setting-generation-results-heading
    .setting-generation-mode-summary {
    order: 0;
    min-height: 24px;
    margin: 0;
    padding: 0 9px;
    color: #aeb7f4;
    background: rgba(91,104,178,.2);
    border: 1px solid rgba(139,151,224,.14);
}
body.workbench-open .setting-generation-results-meta .setting-generation-progress {
    order: 1;
    min-height: 24px;
    padding: 0 9px;
    color: #aeb7f4;
    background: rgba(91,104,178,.2);
    border: 1px solid rgba(139,151,224,.14);
    border-radius: 99px;
    font-size: 8px;
    font-weight: 740;
}
body.workbench-open .setting-generation-results-meta .setting-generation-results-actions {
    order: 2;
    width: auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
}
body.workbench-open .setting-generation-results-meta
    .setting-generation-results-actions .text-button {
    min-height: 24px;
    padding: 0 3px;
    color: #aaa2b5;
    font-size: 9px;
}

body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview.is-empty {
    min-height: 270px;
    padding: 22px;
    display: block;
    background:
        radial-gradient(circle at 50% 42%,rgba(120,102,176,.11),transparent 38%),
        linear-gradient(145deg,#211c29 0%,#19151f 100%);
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview.is-empty::before {
    content: "PAIBAN";
    position: absolute;
    top: 46%;
    left: 50%;
    color: rgba(232,225,238,.07);
    font: 760 18px/1 'JetBrains Mono',ui-monospace,monospace;
    letter-spacing: .32em;
    transform: translate(-50%,-50%);
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview.is-empty > span {
    position: absolute;
    top: 20px;
    left: 22px;
    z-index: 1;
    color: #c9c2cf;
    font-size: 12px;
    font-weight: 660;
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview.is-empty .setting-generation-current-actions {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 2;
    width: auto;
    margin: 0;
    padding-top: 14px;
    display: grid;
    grid-template-columns: minmax(0,1.18fr) minmax(0,.82fr);
    gap: 9px;
    border-top: 1px solid rgba(178,182,223,.14);
}
body.workbench-open .setting-generation-dialog.is-setting-detail
    .setting-generation-current-preview.is-empty .setting-generation-current-actions button {
    min-height: 40px;
    padding: 0 13px;
    border-radius: 11px;
    font-size: 11px;
}

@media (max-width:760px) {
    body.workbench-open .setting-editor-dialog .setting-kind-cards {
        padding: 4px;
        gap: 3px;
        border-radius: 15px;
    }
    body.workbench-open .setting-editor-dialog .setting-kind-card {
        min-height: 48px;
        padding: 0 9px;
        justify-content: center;
        gap: 6px;
        border-radius: 10px;
    }
    body.workbench-open .setting-editor-dialog .setting-kind-card span {
        width: 17px;
        font-size: 15px;
    }
    body.workbench-open .setting-editor-dialog .setting-kind-card strong { font-size: 12px; }
    body.workbench-open .setting-generation-results-meta {
        margin-top: 9px;
        gap: 6px;
        flex-wrap: nowrap;
    }
    body.workbench-open .setting-generation-results-heading
        .setting-generation-mode-summary {
        min-height: 22px;
        padding: 0 7px;
        font-size: 7.5px;
    }
    body.workbench-open .setting-generation-results-meta .setting-generation-progress,
    body.workbench-open .setting-generation-results-meta
        .setting-generation-results-actions .text-button { font-size: 7.5px; }
    body.workbench-open .setting-generation-dialog.is-setting-detail
        .setting-generation-current-preview.is-empty {
        min-height: 226px;
        padding: 17px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail
        .setting-generation-current-preview.is-empty::before { font-size: 14px; }
    body.workbench-open .setting-generation-dialog.is-setting-detail
        .setting-generation-current-preview.is-empty > span {
        top: 16px;
        left: 17px;
        font-size: 11px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail
        .setting-generation-current-preview.is-empty .setting-generation-current-actions {
        right: 14px;
        bottom: 14px;
        left: 14px;
        padding-top: 11px;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 7px;
    }
    body.workbench-open .setting-generation-dialog.is-setting-detail
        .setting-generation-current-preview.is-empty .setting-generation-current-actions button {
        min-height: 38px;
        padding: 0 7px;
        font-size: 10px;
    }
    body.workbench-open .world-toolbar {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0,1fr) minmax(82px,92px);
        align-items: center;
        gap: 5px;
    }
    body.workbench-open .world-toolbar .setting-filters {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(4,minmax(0,1fr));
        gap: 1px;
    }
    body.workbench-open .world-toolbar .setting-filter {
        width: auto;
        min-width: 0;
        padding-inline: 3px;
    }
    body.workbench-open .world-toolbar .settings-summary {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
        justify-content: flex-end;
        gap: 4px;
        overflow: visible;
        font-size: 7px;
        letter-spacing: -.02em;
        white-space: nowrap;
    }
    body.workbench-open .world-toolbar .settings-summary > span {
        min-width: 0;
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* WORLD v241 — stage labels live above their cinematic cards and creation
   kinds use stable semantic icons instead of platform-dependent glyphs. */
body.workbench-open .workbench-stage-kicker {
    margin: 0 0 8px;
    color: #ef5ba7;
    font-size: 9px;
    font-weight: 840;
    letter-spacing: .14em;
    line-height: 1.1;
}
body.workbench-open .workbench-stage--settings > .world-step-eyebrow,
body.workbench-open #work-step-roughcut > .roughcut-step-eyebrow {
    width: 100%;
}
body.workbench-open .world-heading h2 {
    font-size: clamp(25px,2.3vw,32px);
}
body.workbench-open.rough-cut-mobile-workspace #work-step-roughcut {
    box-sizing: border-box;
    padding-top: 9px;
    display: flex;
    flex-direction: column;
}
body.workbench-open.rough-cut-mobile-workspace #work-step-roughcut > .roughcut-step-eyebrow {
    flex: 0 0 auto;
}
body.workbench-open.rough-cut-mobile-workspace #work-step-roughcut > .rough-cut-workspace {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
}

@media (max-width:760px) {
    body.workbench-open .workbench-stage-kicker {
        margin-bottom: 6px;
        font-size: 8px;
    }
    body.workbench-open .world-heading h2 { font-size: 24px; }
    body.workbench-open .setting-editor-dialog .setting-kind-card span svg {
        width: 17px;
        height: 17px;
    }
}

@media (prefers-reduced-motion:reduce) {
    body.workbench-open .world-empty-symbols span { transition: none; }
}

/* WORKBENCH v245 — empty stages share the cinematic card language instead of
   looking like pale error panels. */
.stage-empty-kicker {
    display: block;
    color: #df69b1;
    font-size: 8px;
    font-weight: 820;
    letter-spacing: .14em;
    line-height: 1.2;
}
body.workbench-open .frames-empty-state {
    position: relative;
    min-height: clamp(420px,61vh,660px);
    padding: clamp(52px,8vw,92px) 28px;
    overflow: hidden;
    color: #f7f3ff;
    background:
        radial-gradient(circle at 50% 36%,rgba(104,92,181,.18),transparent 32%),
        linear-gradient(145deg,#17131f 0%,#21172a 56%,#17131f 100%);
    border: 1px solid rgba(151,145,198,.34);
    border-radius: 30px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 28px 60px rgba(29,20,43,.17);
}
.frames-empty-storyboard {
    width: min(360px,78vw);
    height: 118px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.frames-empty-storyboard::before {
    content: "";
    position: absolute;
    right: 11%;
    left: 11%;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg,transparent,rgba(165,158,210,.42),transparent);
}
.frames-empty-storyboard span {
    width: 78px;
    height: 88px;
    position: relative;
    z-index: 1;
    background: rgba(43,35,56,.86);
    border: 1px solid rgba(168,160,209,.24);
    border-radius: 20px;
    box-shadow: 0 14px 30px rgba(8,5,15,.22);
}
.frames-empty-storyboard span:first-child {
    opacity: .58;
    transform: translateX(15px) rotate(-7deg) scale(.88);
}
.frames-empty-storyboard span:last-child {
    opacity: .58;
    transform: translateX(-15px) rotate(7deg) scale(.88);
}
.frames-empty-storyboard .is-focus {
    width: 96px;
    height: 108px;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg,rgba(79,91,153,.94),rgba(142,79,148,.88));
    border-color: rgba(151,162,255,.68);
    box-shadow: 0 20px 42px rgba(56,45,104,.38);
    font: 800 24px/1 var(--font-display,inherit);
}
.frames-empty-state h3 {
    margin: 12px 0 8px;
    color: #fff;
    font-size: clamp(28px,3vw,40px);
}
.frames-empty-state > p {
    margin: 0 0 26px;
    color: rgba(231,226,242,.66);
    font-size: 16px;
}
.frames-empty-state .primary-button {
    min-height: 52px;
    padding-inline: 24px;
    background: linear-gradient(135deg,#5363a5,#b6459b);
    border: 1px solid rgba(167,166,233,.52);
    box-shadow: 0 16px 34px rgba(71,54,128,.3);
}
.frames-empty-state .primary-button svg { width: 18px; height: 18px; }
body.workbench-open .rough-cut-empty-state {
    min-height: 400px;
    padding: clamp(28px,5vw,64px);
    gap: 26px;
    color: #f8f2fa;
    background:
        radial-gradient(circle at 50% 36%,rgba(91,104,178,.18),transparent 34%),
        radial-gradient(circle at 73% 68%,rgba(201,59,138,.09),transparent 34%),
        linear-gradient(145deg,#1d1824 0%,#131017 100%);
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 26px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 24px 70px rgba(24,18,31,.16);
}
body.workbench-open .rough-cut-empty-timeline {
    width: min(330px,76%);
    height: 74px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr .78fr 1.18fr;
    align-items: center;
    gap: 7px;
}
body.workbench-open .rough-cut-empty-timeline::before {
    content: "";
    position: absolute;
    right: -16px;
    left: -16px;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg,transparent,rgba(178,182,223,.28) 12%,rgba(225,106,217,.42) 50%,rgba(178,182,223,.28) 88%,transparent);
}
body.workbench-open .rough-cut-empty-timeline span {
    height: 54px;
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    color: rgba(222,223,255,.58);
    background: linear-gradient(145deg,rgba(80,88,144,.42),rgba(42,34,51,.92));
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 10px 25px rgba(7,5,10,.18);
    font: 760 9px/1 'JetBrains Mono',ui-monospace,monospace;
}
body.workbench-open .rough-cut-empty-timeline span:nth-child(2) { height: 64px; color: #ed82c4; }
body.workbench-open .rough-cut-empty-copy { text-align: center; }
body.workbench-open .rough-cut-empty-copy h3 {
    margin: 8px 0 7px;
    color: #f8f2fa;
    font-size: clamp(21px,2.3vw,28px);
    letter-spacing: -.02em;
}
body.workbench-open .rough-cut-empty-copy p {
    max-width: 480px;
    margin: 0;
    color: #aaa2b2;
    font-size: 11px;
    line-height: 1.7;
}

.delivery-empty.delivery-empty-state {
    min-height: 150px;
    padding: 26px 30px;
    color: #f8f2fa;
    background:
        radial-gradient(circle at 12% 50%,rgba(91,104,178,.19),transparent 27%),
        radial-gradient(circle at 88% 15%,rgba(201,59,138,.1),transparent 30%),
        linear-gradient(145deg,#1c1823 0%,#131017 100%);
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 24px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 22px 60px rgba(37,31,57,.13);
}
.delivery-empty-state .delivery-empty-mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    color: #cdd2ff;
    background: linear-gradient(145deg,rgba(84,96,165,.56),rgba(45,37,56,.96));
    border: 1px solid rgba(178,182,223,.27);
    border-radius: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05),0 12px 28px rgba(8,6,12,.2);
}
.delivery-empty-state .delivery-empty-mark svg { width: 21px; height: 21px; stroke-width: 1.65; }
.delivery-empty-state .delivery-empty-copy { display: flex; flex-direction: column; align-items: flex-start; }
.delivery-empty-state h3 {
    margin: 7px 0 4px;
    color: #f8f2fa;
    font-size: 21px;
    letter-spacing: -.02em;
}
.delivery-empty-state p { color: #aaa2b2; font-size: 10px; }

@media (max-width:700px) {
    body.workbench-open .frames-empty-state {
        min-height: 58vh;
        padding: 44px 20px 48px;
        border-radius: 24px;
    }
    .frames-empty-storyboard {
        width: min(280px,82vw);
        height: 98px;
        margin-bottom: 20px;
    }
    .frames-empty-storyboard span {
        width: 62px;
        height: 72px;
        border-radius: 17px;
    }
    .frames-empty-storyboard .is-focus {
        width: 80px;
        height: 92px;
        font-size: 21px;
    }
    .frames-empty-state h3 { font-size: 27px; }
    .frames-empty-state > p {
        max-width: 270px;
        font-size: 14px;
        line-height: 1.65;
    }
    body.workbench-open .rough-cut-empty-state {
        min-height: 310px;
        padding: 32px 18px;
        gap: 19px;
        border-radius: 20px;
    }
    body.workbench-open .rough-cut-empty-timeline { width: min(270px,82%); height: 62px; gap: 5px; }
    body.workbench-open .rough-cut-empty-timeline span { height: 46px; border-radius: 11px; }
    body.workbench-open .rough-cut-empty-timeline span:nth-child(2) { height: 54px; }
    body.workbench-open .rough-cut-empty-copy h3 { margin-top: 7px; font-size: 21px; }
    body.workbench-open .rough-cut-empty-copy p { font-size: 9.5px; }
    .delivery-empty.delivery-empty-state {
        min-height: 128px;
        padding: 20px;
        gap: 13px;
        border-radius: 19px;
    }
    .delivery-empty-state .delivery-empty-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
    }
    .delivery-empty-state h3 { margin-top: 6px; font-size: 17px; }
    .delivery-empty-state p { font-size: 9px; }
    .stage-empty-kicker { font-size: 7px; }
}

/* WORKBENCH v246 — Steps 3/4/5 use one centered cinematic waiting card. */
body.workbench-open .frames-empty-state,
body.workbench-open .rough-cut-empty-state,
.delivery-empty.delivery-empty-state {
    box-sizing: border-box;
    width: 100%;
    min-height: clamp(420px,61vh,660px);
    padding: clamp(48px,7vw,82px) 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #f8f2fa;
    text-align: center;
    background:
        radial-gradient(circle at 50% 34%,rgba(91,104,178,.19),transparent 31%),
        radial-gradient(circle at 72% 70%,rgba(201,59,138,.08),transparent 34%),
        linear-gradient(145deg,#1d1824 0%,#17131f 58%,#121016 100%);
    border: 1px solid rgba(178,182,223,.22);
    border-radius: 30px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04),0 28px 70px rgba(24,18,31,.17);
}
.delivery-stage.is-static.is-empty {
    min-height: 0;
    padding-top: 0;
    place-items: stretch;
}
body.workbench-open .rough-cut-empty-state { gap: 0; }
body.workbench-open .rough-cut-empty-timeline { margin-bottom: 25px; }
body.workbench-open .rough-cut-empty-copy,
.delivery-empty-state .delivery-empty-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
body.workbench-open .rough-cut-empty-copy h3,
.delivery-empty-state h3 {
    margin: 12px 0 8px;
    color: #fff;
    font-size: clamp(28px,3vw,40px);
    line-height: 1.15;
    letter-spacing: -.025em;
}
body.workbench-open .rough-cut-empty-copy p,
.delivery-empty-state p {
    max-width: 460px;
    margin: 0;
    color: rgba(231,226,242,.66);
    font-size: 16px;
    line-height: 1.65;
}
.delivery-empty-visual {
    width: min(350px,78vw);
    height: 130px;
    position: relative;
    display: grid;
    place-items: center;
    margin: 0 auto 24px;
}
.delivery-empty-visual::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 118px;
    border-radius: 50%;
    background: radial-gradient(circle,rgba(110,101,194,.2),transparent 68%);
    filter: blur(2px);
}
.delivery-empty-sheet {
    width: 146px;
    height: 82px;
    position: absolute;
    border: 1px solid rgba(178,182,223,.24);
    border-radius: 18px;
    background: linear-gradient(145deg,rgba(82,90,148,.42),rgba(37,30,46,.9));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 14px 30px rgba(7,5,10,.2);
}
.delivery-empty-sheet::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(211,212,241,.12);
    border-radius: 10px;
}
.delivery-empty-sheet.is-left { transform: translateX(-62px) rotate(-7deg) scale(.88); opacity: .54; }
.delivery-empty-sheet.is-right { transform: translateX(62px) rotate(7deg) scale(.88); opacity: .54; }
.delivery-empty-sheet.is-center {
    z-index: 1;
    border-color: rgba(166,164,230,.46);
    background: linear-gradient(145deg,rgba(77,91,153,.72),rgba(108,58,111,.72));
}
.delivery-empty-state .delivery-empty-mark {
    width: 54px;
    height: 54px;
    position: relative;
    z-index: 2;
    flex: 0 0 54px;
    color: #f4efff;
    background: rgba(25,20,33,.76);
    border: 1px solid rgba(198,194,239,.36);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.055),0 14px 32px rgba(8,6,12,.28);
}
.delivery-empty-state .delivery-empty-mark svg { width: 22px; height: 22px; }

@media (max-width:700px) {
    body.workbench-open .frames-empty-state,
    body.workbench-open .rough-cut-empty-state,
    .delivery-empty.delivery-empty-state {
        min-height: clamp(360px,58vh,520px);
        padding: 42px 20px 46px;
        border-radius: 24px;
    }
    body.workbench-open .rough-cut-empty-timeline { margin-bottom: 20px; }
    body.workbench-open .rough-cut-empty-copy h3,
    .delivery-empty-state h3 { font-size: 27px; }
    body.workbench-open .rough-cut-empty-copy p,
    .delivery-empty-state p {
        max-width: 280px;
        font-size: 14px;
    }
    .delivery-empty-visual {
        width: min(280px,82vw);
        height: 108px;
        margin-bottom: 20px;
    }
    .delivery-empty-sheet { width: 118px; height: 68px; border-radius: 15px; }
    .delivery-empty-sheet.is-left { transform: translateX(-48px) rotate(-7deg) scale(.88); }
    .delivery-empty-sheet.is-right { transform: translateX(48px) rotate(7deg) scale(.88); }
    .delivery-empty-state .delivery-empty-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
    }
}

/* WORKBENCH v247 — lighter delivery glyph and equal rough-cut stage cards. */
body.workbench-open .rough-cut-empty-timeline {
    grid-template-columns: repeat(3,minmax(0,1fr));
}
body.workbench-open .rough-cut-empty-timeline span,
body.workbench-open .rough-cut-empty-timeline span:nth-child(2) {
    width: 100%;
    height: 58px;
}
.delivery-empty-state .delivery-empty-mark,
.delivery-empty-state .delivery-empty-mark:hover,
.delivery-empty-state .delivery-empty-mark:focus-visible {
    width: auto;
    height: auto;
    min-width: 0;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding: 0;
    color: #f4efff;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 5px 12px rgba(8,6,12,.42));
}
.delivery-empty-state .delivery-empty-mark svg {
    width: 30px;
    height: 30px;
    stroke-width: 1.75;
}

@media (max-width:700px) {
    body.workbench-open .rough-cut-empty-timeline span,
    body.workbench-open .rough-cut-empty-timeline span:nth-child(2) {
        height: 50px;
    }
    .delivery-empty-state .delivery-empty-mark,
    .delivery-empty-state .delivery-empty-mark:hover,
    .delivery-empty-state .delivery-empty-mark:focus-visible {
        width: auto;
        height: auto;
        flex-basis: auto;
        border-radius: 0;
    }
    .delivery-empty-state .delivery-empty-mark svg {
        width: 27px;
        height: 27px;
    }
}

/* WORKBENCH v248 — full-page waiting rhythm shared by Steps 3/4/5. */
body.workbench-open .frames-empty-state,
body.workbench-open .rough-cut-empty-state,
.delivery-empty.delivery-empty-state {
    min-height: clamp(540px,72vh,780px);
    justify-content: center;
}

@media (max-width:700px) {
    body.workbench-open .frames-empty-state,
    body.workbench-open .rough-cut-empty-state,
    .delivery-empty.delivery-empty-state {
        min-height: clamp(500px,72svh,680px);
        justify-content: center;
    }
}

/* WORKBENCH v249 — one premium selection language across World and Shots. */
body.workbench-open .shot-video-reference-option {
    background: rgba(36,29,44,.86);
    border-color: rgba(178,182,223,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .shot-video-reference-option:hover {
    background: rgba(78,91,153,.18);
    border-color: rgba(151,161,229,.34);
}
body.workbench-open .shot-video-reference-option.is-selected,
body .frame-shot-card .shot-video-reference-option.is-selected {
    color: #f8f3fa;
    background: linear-gradient(135deg,rgba(78,91,153,.78),rgba(105,75,127,.58));
    border-color: rgba(151,161,229,.54);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(37,31,66,.2);
}
body.workbench-open .shot-video-reference-option.is-selected strong,
body.workbench-open .shot-video-reference-option.is-selected small,
body .frame-shot-card .shot-video-reference-option.is-selected strong,
body .frame-shot-card .shot-video-reference-option.is-selected small {
    color: #fff;
}

/* WORKBENCH v250 — cinematic Step 1 and one premium selector language. */
body.workbench-open .workbench-stage--story,
body.workbench-open .workbench-stage--story.is-wide {
    max-width: 1180px;
    margin: 0 auto;
}
body.workbench-open .story-step-eyebrow {
    margin: 0 0 12px 8px;
}
body.workbench-open .story-ritual-surface {
    position: relative;
    min-height: clamp(620px,72vh,900px);
    padding: clamp(26px,4vw,54px);
    overflow: hidden;
    color: #f8f3fa;
    background:
        radial-gradient(circle at 92% 7%,rgba(201,59,138,.16),transparent 29%),
        radial-gradient(circle at 6% 96%,rgba(78,91,153,.2),transparent 32%),
        linear-gradient(145deg,#17131d,#211827 58%,#17131f);
    border: 1px solid rgba(178,182,223,.26);
    border-radius: 30px;
    box-shadow: 0 26px 72px rgba(30,25,45,.2),inset 0 1px 0 rgba(255,255,255,.045);
}
body.workbench-open .story-ritual-surface::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: '';
    opacity: .28;
    background-image: radial-gradient(rgba(255,255,255,.18) .65px,transparent .65px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom,rgba(0,0,0,.5),transparent 42%);
}
body.workbench-open .story-ritual-surface > * { position: relative; z-index: 1; }
body.workbench-open .story-panes {
    width: max-content;
    min-height: 42px;
    margin: 0 0 clamp(42px,7vh,78px) auto;
    padding: 4px;
    gap: 3px;
    background: rgba(14,11,18,.54);
    border-color: rgba(178,182,223,.18);
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .story-pane-button {
    width: auto;
    min-width: 112px;
    min-height: 34px;
    padding: 0 15px;
    color: #aaa2b5;
    border: 1px solid transparent;
    border-radius: 9px;
}
body.workbench-open .story-pane-button:hover {
    color: #f7f2fa;
    background: rgba(78,91,153,.18);
}
body.workbench-open .story-pane-button.is-active {
    color: #fff;
    background: linear-gradient(135deg,rgba(78,91,153,.8),rgba(105,75,127,.62));
    border-color: rgba(151,161,229,.54);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 8px 20px rgba(37,31,66,.22);
}
body.workbench-open .story-pane-button em { background: rgba(255,255,255,.11); }
body.workbench-open .story-pane--opening {
    width: min(100%,900px);
    margin: 0 auto;
}
body.workbench-open .story-ritual-surface .workbench-stage-heading { margin-bottom: 26px; }
body.workbench-open .story-ritual-surface .workbench-stage-heading .eyebrow {
    margin-bottom: 10px;
    color: #e16ad9;
    font: 780 11px/1.2 'JetBrains Mono',monospace;
    letter-spacing: .18em;
}
body.workbench-open .story-ritual-surface .workbench-stage-heading h2 {
    color: #fff;
    font-family: 'Noto Serif SC','Songti SC',serif;
    font-size: clamp(34px,4.6vw,58px);
    font-weight: 620;
    letter-spacing: -.035em;
}
body.workbench-open .story-ritual-surface .workbench-stage-heading > p:last-child,
body.workbench-open .story-ritual-surface .workbench-stage-heading > div > p:last-child {
    color: #aaa2b5;
    font-size: 13px;
}
body.workbench-open .story-editor {
    min-height: 300px;
    padding: 24px;
    gap: 12px;
    background:
        radial-gradient(circle at 90% 10%,rgba(201,59,138,.075),transparent 34%),
        rgba(31,25,38,.82);
    border-color: rgba(178,182,223,.24);
    border-radius: 22px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 18px 44px rgba(8,6,12,.16);
}
body.workbench-open .story-editor > span { color: #f7f2fa; font-size: 13px; }
body.workbench-open .story-editor textarea {
    min-height: 218px;
    padding: 4px 0 0;
    color: #f7f2fa;
    caret-color: #e16ad9;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: clamp(16px,2vw,20px);
    line-height: 1.85;
}
body.workbench-open .story-editor textarea:focus {
    border: 0;
    box-shadow: none;
}
body.workbench-open .story-editor textarea::placeholder { color: #766f7e; }
body.workbench-open .story-editor small {
    padding-top: 12px;
    color: #817988;
    border-top: 1px solid rgba(178,182,223,.13);
}
body.workbench-open .story-breakdown-panel {
    margin-top: 16px;
    padding: 17px 18px;
    color: #f7f2fa;
    background: linear-gradient(120deg,rgba(78,91,153,.15),rgba(201,59,138,.08));
    border-color: rgba(151,161,229,.27);
    border-radius: 18px;
}
body.workbench-open .story-breakdown-icon {
    color: #f3c8eb;
    background: rgba(255,255,255,.055);
    border-color: rgba(178,182,223,.17);
}
body.workbench-open .story-breakdown-panel p { color: #aaa2b5; }
body.workbench-open .story-breakdown-panel.is-ready,
body.workbench-open .story-breakdown-panel.is-warning,
body.workbench-open .story-breakdown-panel.is-protected,
body.workbench-open .story-breakdown-panel.is-unavailable {
    background: linear-gradient(120deg,rgba(78,91,153,.15),rgba(201,59,138,.08));
    border-color: rgba(151,161,229,.27);
}
body.workbench-open .story-breakdown-actions .primary-button {
    min-width: 160px;
    background: linear-gradient(120deg,#5e6dbc,#d2439d);
    box-shadow: 0 12px 28px rgba(86,78,159,.22);
}
body.workbench-open .story-breakdown-actions .text-button {
    color: #c9c2d0;
    background: transparent;
    border-color: rgba(178,182,223,.18);
}
body.workbench-open .story-manual-button { color: #aaa2b5; }
body.workbench-open .story-manual-button:hover { color: #fff; }
body.workbench-open .story-draft-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
body.workbench-open .story-draft-summary {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: #c8c1ce !important;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(178,182,223,.15);
    border-radius: 999px;
    font: 700 10px/1.2 'JetBrains Mono',monospace !important;
    white-space: nowrap;
}
body.workbench-open .story-ritual-surface .shot-scene-groups,
body.workbench-open .story-ritual-surface .shot-scene-group {
    background: transparent;
}
body.workbench-open .story-ritual-surface .shot-scene-group {
    border-color: rgba(178,182,223,.18);
    box-shadow: none;
}
body.workbench-open .story-ritual-surface .shot-scene-heading {
    background: rgba(255,255,255,.035);
    border-color: rgba(178,182,223,.14);
}
body.workbench-open .story-ritual-surface .shot-scene-title h3 { color: #f7f2fa; }
body.workbench-open .story-ritual-surface .shot-scene-title p { color: #aaa2b5; }
body.workbench-open .shot-insert { min-height: 42px; }
body.workbench-open .shot-insert-line { background: linear-gradient(90deg,transparent,rgba(178,182,223,.2)); }
body.workbench-open .shot-insert-line:last-child { background: linear-gradient(90deg,rgba(178,182,223,.2),transparent); }
body.workbench-open .shot-insert-button {
    min-height: 26px;
    padding: 0 4px;
    color: #aaa2b5;
    background: transparent;
    border: 0;
    box-shadow: none;
}
body.workbench-open .shot-insert-plus {
    color: #c9cffa;
    background: transparent;
    font-size: 21px;
    font-weight: 400;
}
body.workbench-open .shot-insert-copy { display: none; }
body.workbench-open .shot-insert-button:hover:not(:disabled),
body.workbench-open .shot-insert-button:focus-visible {
    color: #fff;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: scale(1.08);
}
body.workbench-open .story-draft-save-note { color: #817988; font-size: 10px; }
body.workbench-open .story-ritual-surface .workbench-empty {
    color: #f7f2fa;
    background: rgba(31,25,38,.68);
    border-color: rgba(178,182,223,.23);
}
body.workbench-open .story-ritual-surface .workbench-empty p { color: #aaa2b5; }

/* Match the richer new-world-item selection surface in World and Shots. */
body.workbench-open .setting-generation-tabs,
body.workbench-open .shot-video-reference-mode-options {
    isolation: isolate;
}
body.workbench-open .setting-generation-tab,
body.workbench-open .shot-video-reference-option {
    color: #aaa2b5;
    background: linear-gradient(145deg,rgba(42,34,50,.9),rgba(32,27,41,.94));
    border: 1px solid rgba(178,182,223,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .setting-generation-tab:hover,
body.workbench-open .shot-video-reference-option:hover {
    color: #f7f2fa;
    background: linear-gradient(145deg,rgba(78,91,153,.25),rgba(51,39,61,.92));
    border-color: rgba(151,161,229,.34);
}
body.workbench-open .setting-generation-tab.is-active,
body.workbench-open .shot-video-reference-option.is-selected,
body .frame-shot-card .shot-video-reference-option.is-selected {
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%,rgba(225,106,217,.14),transparent 30%),
        linear-gradient(135deg,rgba(78,91,153,.86),rgba(105,75,127,.68));
    border-color: rgba(151,161,229,.66);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 10px 24px rgba(37,31,66,.24);
}
body.workbench-open .setting-generation-tab.is-active .setting-generation-tab-icon {
    color: #fff;
    background: rgba(255,255,255,.1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
body.workbench-open .shot-video-reference-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

@media (max-width:700px) {
    body.workbench-open .story-step-eyebrow { margin: 0 0 9px 3px; }
    body.workbench-open .story-ritual-surface {
        min-height: calc(100svh - 260px);
        padding: 21px 16px 26px;
        border-radius: 22px;
    }
    body.workbench-open .story-panes {
        width: 100%;
        margin: 0 0 34px;
    }
    body.workbench-open .story-pane-button { min-width: 0; padding: 0 10px; }
    body.workbench-open .story-ritual-surface .workbench-stage-heading { margin-bottom: 20px; }
    body.workbench-open .story-ritual-surface .workbench-stage-heading h2 { font-size: 38px; }
    body.workbench-open .story-ritual-surface .workbench-stage-heading > p:last-child,
    body.workbench-open .story-ritual-surface .workbench-stage-heading > div > p:last-child { font-size: 11px; line-height: 1.65; }
    body.workbench-open .story-editor { min-height: 292px; padding: 19px 17px; border-radius: 18px; }
    body.workbench-open .story-editor textarea { min-height: 208px; font-size: 16px; }
    body.workbench-open .story-editor small { gap: 10px; font-size: 9px; }
    body.workbench-open .story-breakdown-panel {
        padding: 15px;
        grid-template-columns: 36px minmax(0,1fr);
        gap: 10px;
    }
    body.workbench-open .story-breakdown-icon { width: 36px; height: 36px; border-radius: 11px; }
    body.workbench-open .story-breakdown-icon svg { width: 19px; height: 19px; }
    body.workbench-open .story-breakdown-panel strong { font-size: 12px; }
    body.workbench-open .story-breakdown-panel p { font-size: 9px; }
    body.workbench-open .story-breakdown-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    body.workbench-open .story-breakdown-actions .primary-button { min-width: 150px; min-height: 42px; }
    body.workbench-open .workbench-stage-actions--story { margin-top: 14px; }
    body.workbench-open .story-draft-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    body.workbench-open .story-draft-summary { align-self: flex-start; margin: 0 !important; }
    body.workbench-open .story-ritual-surface .shots-list { padding: 8px; }
    body.workbench-open .story-draft-save-note { max-width: 45%; line-height: 1.5; }
    body.workbench-open .story-ritual-surface #shots-next-actions { align-items: center; }
    body.workbench-open .setting-generation-tab,
    body.workbench-open .shot-video-reference-option { border-radius: 12px; }
}

/* WORKBENCH v251 — Step 1 follows the approved one-way ritual:
   story input -> agent expansion -> editable shot draft. */
body.workbench-open .workbench-stage--story,
body.workbench-open .workbench-stage--story.is-wide {
    width: min(100%,1320px);
    max-width: 1320px;
}
body.workbench-open .story-ritual-surface {
    min-height: clamp(610px,72vh,860px);
    padding: clamp(30px,4vw,52px);
}
body.workbench-open .story-pane--opening {
    width: min(100%,940px);
}
body.workbench-open .story-ritual-surface .workbench-stage-heading h2 {
    margin: 0;
    font-family: inherit;
    font-size: clamp(25px,2.3vw,32px);
    font-weight: 620;
    line-height: 1.18;
    letter-spacing: -.04em;
}
body.workbench-open .story-ritual-surface .workbench-stage-heading .eyebrow {
    margin-bottom: 10px;
}
body.workbench-open .story-ritual-surface .workbench-stage-heading > p:last-child,
body.workbench-open .story-ritual-surface .workbench-stage-heading > div > p:last-child {
    margin-top: 9px;
    font-size: 15px;
    line-height: 1.55;
}
body.workbench-open .story-editor {
    min-height: 320px;
    margin-top: 30px;
    padding: 24px 24px 20px;
}
body.workbench-open .story-editor > label {
    color: #cdd2ff;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .035em;
}
body.workbench-open .story-editor textarea {
    min-height: 205px;
}
body.workbench-open .story-editor-footer {
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(178,182,223,.13);
}
body.workbench-open .story-editor-footer small {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
    border: 0;
}
body.workbench-open .story-editor-footer .primary-button {
    min-width: 158px;
    min-height: 44px;
    flex: 0 0 auto;
    gap: 8px;
    color: #fff;
    background: linear-gradient(120deg,#5d6dbc,#d2439d);
    border: 1px solid rgba(183,181,244,.36);
    box-shadow: 0 12px 28px rgba(86,78,159,.22);
}
body.workbench-open .story-breakdown-panel--status {
    margin-top: 14px;
    padding: 13px 15px;
    grid-template-columns: 34px minmax(0,1fr) auto;
    border-radius: 15px;
}
body.workbench-open .story-breakdown-panel--status:not(.is-ready):not(.is-working):not(.is-warning):not(.is-protected):not(.is-unavailable) {
    display: none;
}
body.workbench-open .story-breakdown-panel--status .story-breakdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}
body.workbench-open .story-breakdown-panel--status .story-breakdown-actions {
    justify-content: flex-end;
}
body.workbench-open .story-expansion-path {
    width: min(100%,720px);
    margin: 32px auto 0;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    align-items: center;
    gap: 12px;
    color: #8e8798;
    font-size: 10px;
}
body.workbench-open .story-expansion-path span {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
body.workbench-open .story-expansion-path i {
    width: 6px;
    height: 6px;
    display: block;
    background: #7180cc;
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(113,128,204,.7);
}
body.workbench-open .story-expansion-path b {
    height: 1px;
    background: linear-gradient(90deg,rgba(178,182,223,.12),rgba(225,106,217,.5),rgba(178,182,223,.12));
}
body.workbench-open .workbench-stage-actions--story {
    margin-top: 10px;
    justify-content: center;
}
body.workbench-open .story-manual-button {
    padding: 8px 12px;
    font-size: 10px;
}
body.workbench-open .story-ritual-surface.is-draft {
    padding-top: clamp(34px,4vw,52px);
}
body.workbench-open .story-draft-heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
body.workbench-open .story-source-edit {
    min-height: 32px;
    padding: 0 4px;
    color: #b2b6df;
    background: transparent;
    border: 0;
    font-size: 10px;
    font-weight: 720;
    cursor: pointer;
}
body.workbench-open .story-source-edit:hover { color: #fff; }
body.workbench-open .story-ritual-surface.is-draft .continuous-shot-list {
    gap: 0;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card {
    padding: 16px 18px;
    background: linear-gradient(145deg,rgba(42,34,50,.88),rgba(29,24,36,.94));
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 14px 30px rgba(7,5,10,.12);
}
body.workbench-open .story-ritual-surface.is-draft .workbench-card-head {
    margin-bottom: 12px;
}
body.workbench-open .story-ritual-surface.is-draft .workbench-card-number > span:first-child {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg,#4e5b99,#75548a);
    border: 1px solid rgba(178,182,223,.34);
    border-radius: 13px;
    font: 780 11px/1 'JetBrains Mono',monospace;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor small {
    color: #e16ad9;
    font-size: 8px;
    letter-spacing: .08em;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-title-input {
    min-height: 32px;
    padding: 0;
    color: #f8f3fa;
    background: transparent;
    border: 0;
    font-size: 14px;
    font-weight: 720;
    box-shadow: none;
}
body.workbench-open .story-ritual-surface.is-draft .workbench-fields {
    display: grid;
    grid-template-columns: minmax(0,1fr) 118px;
    align-items: end;
    gap: 14px;
}
body.workbench-open .story-ritual-surface.is-draft .workbench-field > span {
    color: #827a8d;
    font-size: 8px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea {
    min-height: 66px;
    padding: 12px 14px;
    color: #c9c1cf;
    background: rgba(12,10,15,.22);
    border-color: rgba(178,182,223,.13);
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.6;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-wrap {
    min-height: 44px;
    background: rgba(12,10,15,.22);
    border-color: rgba(178,182,223,.13);
    border-radius: 12px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-delete-button {
    color: #8f8799;
}
body.workbench-open .story-inline-loading {
    min-height: clamp(500px,64vh,720px);
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
}
body.workbench-open .story-inline-loading[hidden] { display: none; }
body.workbench-open .story-ritual-surface.is-loading > .story-pane { display: none; }
body.workbench-open .story-inline-loading h2 {
    margin: 26px 0 8px;
    color: #f8f3fa;
    font-size: 24px;
}
body.workbench-open .story-inline-loading p {
    margin: 0;
    color: #958d9f;
    font-size: 11px;
}
body.workbench-open .story-agent-visual {
    width: 150px;
    height: 150px;
    position: relative;
    display: grid;
    place-items: center;
}
body.workbench-open .story-agent-field {
    position: absolute;
    inset: 8px;
    background: radial-gradient(circle,rgba(225,106,217,.16),transparent 62%);
    border-radius: 50%;
    animation: story-agent-breathe 2.4s ease-in-out infinite;
}
body.workbench-open .story-agent-orbit {
    width: 108px;
    height: 108px;
    position: absolute;
    border: 1px solid rgba(178,182,223,.3);
    border-top-color: #e16ad9;
    border-radius: 50%;
    animation: story-agent-spin 3s linear infinite;
}
body.workbench-open .story-agent-orbit.is-secondary {
    width: 82px;
    height: 82px;
    border-top-color: #8290df;
    animation-direction: reverse;
    animation-duration: 2.2s;
}
body.workbench-open .story-agent-core {
    width: 48px;
    height: 48px;
    position: relative;
    display: block;
    background: linear-gradient(145deg,#5363a5,#b9469b);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 15px;
    box-shadow: 0 0 34px rgba(225,106,217,.24);
}
body.workbench-open .story-agent-core::before,
body.workbench-open .story-agent-core::after {
    position: absolute;
    left: 50%;
    top: 50%;
    content: '';
    background: #fff;
    border-radius: 99px;
    transform: translate(-50%,-50%);
}
body.workbench-open .story-agent-core::before { width: 18px; height: 3px; }
body.workbench-open .story-agent-core::after { width: 3px; height: 18px; }
body.workbench-open .story-agent-scan {
    width: 120px;
    height: 1px;
    position: absolute;
    background: linear-gradient(90deg,transparent,#e16ad9,transparent);
    box-shadow: 0 0 16px rgba(225,106,217,.55);
    animation: story-agent-scan 2s ease-in-out infinite;
}
@keyframes story-agent-spin { to { transform: rotate(360deg); } }
@keyframes story-agent-breathe { 50% { opacity: .5; transform: scale(.9); } }
@keyframes story-agent-scan { 0%,100% { transform: translateY(-48px); opacity: .25; } 50% { transform: translateY(48px); opacity: 1; } }

@media (max-width:700px) {
    body.workbench-open .story-ritual-surface {
        min-height: calc(100svh - 250px);
        padding: 25px 17px 28px;
    }
    body.workbench-open .story-ritual-surface .workbench-stage-heading h2 { font-size: 24px; }
    body.workbench-open .story-ritual-surface .workbench-stage-heading > p:last-child,
    body.workbench-open .story-ritual-surface .workbench-stage-heading > div > p:last-child { font-size: 11px; }
    body.workbench-open .story-editor {
        min-height: 330px;
        margin-top: 24px;
        padding: 19px 17px 16px;
    }
    body.workbench-open .story-editor textarea { min-height: 222px; }
    body.workbench-open .story-editor-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }
    body.workbench-open .story-editor-footer small { width: 100%; }
    body.workbench-open .story-editor-footer .primary-button { width: 100%; }
    body.workbench-open .story-expansion-path {
        margin-top: 24px;
        grid-template-columns: repeat(3,minmax(0,1fr));
        gap: 6px;
    }
    body.workbench-open .story-expansion-path b { display: none; }
    body.workbench-open .story-expansion-path span { justify-content: center; font-size: 8px; }
    body.workbench-open .story-breakdown-panel--status {
        grid-template-columns: 30px minmax(0,1fr);
        gap: 9px;
    }
    body.workbench-open .story-breakdown-panel--status .story-breakdown-actions {
        grid-column: 1 / -1;
    }
    body.workbench-open .story-draft-heading-actions {
        width: 100%;
        justify-content: space-between;
    }
    body.workbench-open .story-ritual-surface.is-draft .workbench-fields {
        grid-template-columns: 1fr;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card {
        padding: 14px;
        border-radius: 16px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea { min-height: 92px; }
    body.workbench-open .story-inline-loading { min-height: calc(100svh - 310px); }
}

@media (prefers-reduced-motion:reduce) {
    body.workbench-open .story-agent-field,
    body.workbench-open .story-agent-orbit,
    body.workbench-open .story-agent-scan { animation: none; }
}

/* WORKBENCH v252: inline storyboard adoption and compact draft cards */
body.workbench-open .story-ritual-surface.is-draft #shots-next-actions {
    width: 100%;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 16px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    position: static;
    background: transparent !important;
    border-top: 1px solid rgba(178,182,223,.13);
    box-shadow: none;
}
body.workbench-open .story-ritual-surface.is-draft #shots-next-actions[hidden] { display: none; }
body.workbench-open .story-ritual-surface.is-draft #shots-next-actions .story-draft-save-note {
    max-width: none;
    margin: 0;
    justify-self: start;
    color: #81798a;
    font-size: 9px;
    line-height: 1.55;
}
body.workbench-open .story-ritual-surface.is-draft #shots-next-actions .primary-button {
    width: auto;
    min-width: 116px;
    min-height: 42px;
    padding: 0 18px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card {
    padding: 18px 20px 20px;
}
body.workbench-open .story-ritual-surface.is-draft .workbench-card-head {
    min-height: 48px;
    margin-bottom: 0;
    padding-bottom: 14px;
    align-items: flex-end;
    border-bottom: 1px solid rgba(178,182,223,.12);
}
body.workbench-open .story-ritual-surface.is-draft .workbench-card-number {
    min-width: 0;
    align-items: center;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor { min-width: 0; }
body.workbench-open .story-ritual-surface.is-draft .workbench-card-actions {
    margin: 0;
    align-items: flex-end;
    gap: 10px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field {
    width: 104px;
    max-width: 104px;
    margin: 0;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field > span {
    margin: 0 0 5px;
    display: block;
    color: #827a8d;
    font-size: 8px;
    line-height: 1;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-wrap {
    min-height: 38px;
    height: 38px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-input {
    height: 36px;
    font-size: 13px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-delete-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
}
body.workbench-open .story-ritual-surface.is-draft .workbench-fields {
    display: block;
    margin-top: 14px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea {
    min-height: 100px;
}

@media (max-width:700px) {
    body.workbench-open .story-ritual-surface.is-draft .shot-card {
        padding: 14px 14px 16px;
    }
    body.workbench-open .story-ritual-surface.is-draft .workbench-card-head {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: start;
        gap: 10px;
    }
    body.workbench-open .story-ritual-surface.is-draft .workbench-card-number {
        align-items: center;
    }
    body.workbench-open .story-ritual-surface.is-draft .workbench-card-actions {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 2px;
        justify-content: flex-end;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field {
        width: 112px;
        max-width: 112px;
        margin-right: auto;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea {
        min-height: 120px;
    }
    body.workbench-open .story-ritual-surface.is-draft #shots-next-actions {
        margin: 16px 0 0;
        padding: 14px 0 max(2px, env(safe-area-inset-bottom));
        grid-template-columns: minmax(0,1fr) auto;
        align-items: end;
        gap: 12px;
    }
    body.workbench-open .story-ritual-surface.is-draft #shots-next-actions .story-draft-save-note {
        font-size: 8px;
    }
    body.workbench-open .story-ritual-surface.is-draft #shots-next-actions .primary-button {
        min-width: 96px;
        min-height: 40px;
        padding: 0 14px;
    }
}

/* v252 segmented controls: one rail, one active capsule */
body.workbench-open .setting-generation-tabs,
body.workbench-open .shot-video-reference-mode-options,
body .frame-shot-card .shot-video-reference-mode-options {
    padding: 5px;
    gap: 4px;
    isolation: isolate;
    background: linear-gradient(145deg,rgba(30,25,39,.96),rgba(42,33,50,.9));
    border: 1px solid rgba(178,182,223,.2);
    border-radius: 17px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 12px 28px rgba(8,6,12,.14);
}
body.workbench-open .setting-generation-tab,
body.workbench-open .shot-video-reference-option,
body .frame-shot-card .shot-video-reference-option {
    min-width: 0;
    color: #aaa2b5;
    background: transparent;
    border: 0;
    box-shadow: none;
}
body.workbench-open .setting-generation-tab:hover,
body.workbench-open .shot-video-reference-option:hover,
body .frame-shot-card .shot-video-reference-option:hover {
    color: #f7f2fa;
    background: rgba(178,182,223,.07);
    border: 0;
    box-shadow: none;
}
body.workbench-open .setting-generation-tab.is-active,
body.workbench-open .shot-video-reference-option.is-selected,
body .frame-shot-card .shot-video-reference-option.is-selected {
    color: #fff;
    background:
        radial-gradient(circle at 88% 8%,rgba(225,106,217,.15),transparent 32%),
        linear-gradient(135deg,rgba(78,91,153,.9),rgba(101,76,126,.8));
    border: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 8px 20px rgba(22,18,35,.3);
}
body.workbench-open .shot-video-reference-mode-options,
body .frame-shot-card .shot-video-reference-mode-options {
    grid-template-columns: repeat(3,minmax(0,1fr));
}
body.workbench-open .shot-video-reference-option,
body .frame-shot-card .shot-video-reference-option {
    min-height: 76px;
    padding: 11px 12px;
    border-radius: 12px;
}
body.workbench-open .setting-generation-tab { border-radius: 12px; }
body.workbench-open .story-ritual-surface.is-draft .story-draft-heading { margin-bottom: 14px; }
body.workbench-open .story-ritual-surface.is-draft .continuous-shot-list > .shot-insert:first-child {
    min-height: 32px;
    margin-top: -3px;
}

@media (max-width:700px) {
    body.workbench-open .setting-generation-tabs,
    body.workbench-open .shot-video-reference-mode-options,
    body .frame-shot-card .shot-video-reference-mode-options {
        padding: 4px;
        gap: 3px;
        border-radius: 14px;
    }
    body.workbench-open .shot-video-reference-mode-options,
    body .frame-shot-card .shot-video-reference-mode-options {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }
    body.workbench-open .shot-video-reference-option,
    body .frame-shot-card .shot-video-reference-option {
        min-height: 68px;
        padding: 9px 7px;
        border-radius: 10px;
    }
    body.workbench-open .shot-video-reference-option strong,
    body .frame-shot-card .shot-video-reference-option strong { font-size: 9px; }
    body.workbench-open .shot-video-reference-option small,
    body .frame-shot-card .shot-video-reference-option small {
        font-size: 7px;
        line-height: 1.35;
    }
    body.workbench-open .story-ritual-surface.is-draft .story-draft-heading { margin-bottom: 10px; }
    body.workbench-open .story-ritual-surface.is-draft .continuous-shot-list > .shot-insert:first-child {
        min-height: 28px;
        margin-top: -4px;
    }
}

/* WORKBENCH v258: square shot badge, corner delete action, and clean ready state */
body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-head {
    padding-right: 44px;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-number > span:first-child {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 42px;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}
body.workbench-open .story-ritual-surface.is-draft .shot-card-delete-button {
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
}

/* WORKBENCH v259: one 42px desktop baseline for badge, title, and duration */
@media (min-width:701px) {
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-head,
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-number,
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-actions {
        align-items: flex-start;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field {
        display: grid;
        grid-template-rows: 10px 32px;
        align-content: start;
        row-gap: 0;
        height: 42px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor > small,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field > span {
        min-height: 0;
        height: 10px;
        margin: 0;
        display: flex;
        align-items: flex-start;
        line-height: 10px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-input {
        min-height: 32px;
        height: 32px;
        padding: 8px 0 0;
        line-height: 24px;
        box-sizing: border-box;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-wrap {
        min-height: 32px;
        height: 32px;
        border-radius: 10px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-input {
        height: 30px;
        line-height: 30px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-unit {
        top: 50%;
        line-height: 1;
        transform: translateY(-50%);
    }
}

/* WORKBENCH v253: clean mobile story actions and desktop-like shot composition */
@media (max-width:700px) {
    body.workbench-open .story-ritual-surface:not(.is-draft) .workbench-stage-actions--story {
        position: static;
        z-index: auto;
        margin: 8px 0 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    body.workbench-open .story-ritual-surface:not(.is-draft) .workbench-stage-actions--story .story-manual-button {
        width: auto;
        min-height: 34px;
        padding: 5px 10px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-head {
        grid-template-columns: minmax(0,1fr) auto;
        align-items: start;
        gap: 8px;
        padding-right: 34px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-number {
        width: 100%;
        min-width: 0;
        align-items: flex-end;
        gap: 8px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-number > span:first-child {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        max-width: 46px;
        max-height: 46px;
        flex: 0 0 46px;
        aspect-ratio: 1 / 1;
        box-sizing: border-box;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field {
        display: grid;
        grid-template-rows: 10px 32px;
        align-content: start;
        row-gap: 4px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-input {
        width: 100%;
        min-width: 0;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-input {
        min-height: 32px;
        height: 32px;
        padding: 8px 0 0;
        line-height: 24px;
        box-sizing: border-box;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-actions {
        grid-column: auto;
        width: auto;
        min-width: 0;
        margin: 0;
        align-items: end;
        justify-content: flex-end;
        gap: 4px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field {
        width: 70px;
        max-width: 70px;
        min-width: 70px;
        margin: 0;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field > span,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-title-editor > small {
        min-height: 0;
        height: 10px;
        margin: 0;
        display: flex;
        align-items: center;
        line-height: 10px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-wrap {
        min-height: 32px;
        height: 32px;
        border-radius: 10px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-input {
        height: 30px;
        padding: 0 22px 0 10px;
        line-height: 30px;
        text-align: left;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-duration-field .shot-duration-unit {
        right: 7px;
        top: 50%;
        line-height: 1;
        transform: translateY(-50%);
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-delete-button {
        width: 30px;
        min-width: 30px;
        height: 32px;
        min-height: 32px;
        top: 9px;
        right: 9px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-fields,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field,
    body.workbench-open .story-ritual-surface.is-draft .simple-shot-prompt-editor,
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea {
        width: 100%;
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea {
        resize: none;
        scrollbar-width: thin;
        scrollbar-color: rgba(157,164,222,.62) transparent;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea::-webkit-scrollbar {
        width: 5px;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea::-webkit-scrollbar-track {
        background: transparent;
    }
    body.workbench-open .story-ritual-surface.is-draft .shot-card-prompt-field textarea::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg,rgba(130,144,223,.72),rgba(199,95,181,.62));
        border-radius: 99px;
    }
    .mobile-install-button {
        width: 30px;
        height: 30px;
        margin-left: auto;
        margin-right: 7px;
        padding: 0;
        display: grid;
        place-items: center;
        color: var(--deep-blue-dark);
        background: linear-gradient(135deg,rgba(238,240,250,.96),rgba(255,247,252,.94));
        border: 0;
        border-radius: 999px;
        box-shadow: inset 0 0 0 1px rgba(78,91,153,.09),0 5px 15px rgba(78,91,153,.07);
    }
    .mobile-install-button svg { width: 15px; height: 15px; stroke-width: 1.8; }
    .mobile-install-button + .mobile-credit-balance { margin-left: 0; }
    .mobile-account-button { margin-left: 7px; }
    .install-guide-dialog[open] {
        width: calc(100vw - 20px);
        max-width: 390px;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top));
        margin: auto auto 10px;
        border-radius: 23px;
    }
    .install-guide-card { padding: 21px 18px calc(18px + env(safe-area-inset-bottom)); }
    .install-guide-heading { grid-template-columns: 45px minmax(0, 1fr) 36px; gap: 11px; }
    .install-guide-mark { width: 45px; height: 45px; border-radius: 14px; }
    .install-guide-heading h2 { font-size: 20px; }
    .install-guide-heading p:last-child { font-size: 10px; }
    .install-guide-steps { margin-top: 19px; }
    .install-guide-steps li { min-height: 52px; padding: 9px 10px; grid-template-columns: 29px 27px minmax(0, 1fr); gap: 8px; }
    .install-guide-step-number { width: 29px; height: 29px; }
    .install-guide-step-icon { width: 27px; height: 27px; }
    .install-guide-step-copy { font-size: 11px; }
    .install-nudge {
        left: auto;
        right: 12px;
        top: calc(70px + env(safe-area-inset-top));
        bottom: auto;
        width: min(236px, calc(100vw - 24px));
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .install-nudge::after { display: none; }
}

/* PAIBAN v263: place the Story edit action against the full card edge. */
body.workbench-open .story-draft-heading {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
        "copy summary"
        "subline subline";
    align-items: end;
    gap: 12px 24px;
}
body.workbench-open .story-draft-heading-copy {
    grid-area: copy;
    min-width: 0;
}
body.workbench-open .story-draft-heading-actions {
    grid-area: summary;
    width: auto;
    align-self: end;
    justify-content: flex-end;
}
body.workbench-open .story-draft-subline {
    grid-area: subline;
    margin-top: 0;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 5px 10px;
}
body.workbench-open .story-draft-subline p {
    margin: 0 !important;
    color: #aaa2b5;
    font-size: 11px !important;
    line-height: 1.55;
}
body.workbench-open .story-draft-subline .story-source-edit {
    min-height: 0;
    margin-left: auto;
    padding: 0;
    color: #cdd2ff;
    font-size: 10px;
    line-height: 1.55;
    text-decoration: none;
    white-space: nowrap;
}
body.workbench-open .story-draft-subline .story-source-edit:hover,
body.workbench-open .story-draft-subline .story-source-edit:focus-visible {
    color: #fff;
    text-decoration: none;
}
body.workbench-open .story-ritual-surface.is-draft #shots-next-actions .primary-button {
    justify-content: center;
    text-align: center;
}

/* Keep the delete action in the shot header flow so it shares the title/duration baseline. */
body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-head { padding-right: 0; }
body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-actions { align-items: flex-end; }
body.workbench-open .story-ritual-surface.is-draft .shot-card-delete-button {
    width: 30px;
    min-width: 30px;
    height: 32px;
    min-height: 32px;
    margin: 0;
    position: static;
    inset: auto;
    z-index: auto;
    align-self: flex-end;
}

@media (max-width:700px) {
    .mobile-topbar .brand-lockup {
        flex: 0 0 auto;
        margin-right: auto;
    }
    .mobile-credit-balance {
        margin-left: 7px;
        flex: 0 1 auto;
    }
    .mobile-install-button {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        flex: 0 0 30px;
        margin-left: auto;
        margin-right: 0;
    }
    .mobile-install-button + .mobile-credit-balance { margin-left: 7px; }
    .mobile-account-button { margin-left: 7px; }
    body.workbench-open .story-draft-heading {
        grid-template-columns: minmax(0,1fr);
        grid-template-areas:
            "copy"
            "subline"
            "summary";
        gap: 9px;
    }
    body.workbench-open .story-draft-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }
    body.workbench-open .story-draft-subline { gap: 4px 8px; }
    body.workbench-open .story-ritual-surface.is-draft .shot-card .workbench-card-head { padding-right: 0; }
}

/* PAIBAN v266: iOS home-screen mode owns one fixed viewport. The app-main is
   the only vertical scroller, so system rubber-banding cannot hide its headers. */
@media (max-width:760px) {
    html.is-standalone,
    html.is-standalone body {
        width: 100%;
        height: 100%;
        min-height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }
    html.is-standalone body.app-page {
        position: fixed;
        inset: 0;
        height: 100%;
        min-height: 100%;
    }
    html.is-standalone .app-shell {
        height: 100%;
        min-height: 100%;
    }
    html.is-standalone .app-main {
        height: calc(100% - 70px - env(safe-area-inset-bottom));
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
    html.is-standalone body.workbench-open .app-main {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
    }
    html.is-standalone .mobile-topbar {
        height: calc(64px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    html.is-standalone .app-main {
        padding-top: calc(64px + env(safe-area-inset-top));
    }
    html.is-standalone body.workbench-open .app-main {
        padding-top: 0;
    }
    html.is-standalone body.workbench-open .app-view--workbench {
        min-height: 100%;
    }
    html.is-standalone body.workbench-open .workbench-topbar {
        top: 0;
    }
}

/* Local avatar editor: the account surface owns the edit affordance, while a
   focused circular crop keeps the interaction familiar on desktop and mobile. */
.avatar-editor-dialog[open] {
    width: min(500px,calc(100vw - 36px));
    max-width: 500px;
    padding: 0;
    display: block;
    overflow: hidden;
    color: #f8f4ff;
    background:
        radial-gradient(circle at 88% 4%,rgba(210,66,158,.17),transparent 31%),
        linear-gradient(155deg,#191624 0%,#21192b 100%);
    border: 1px solid rgba(181,173,232,.28);
    border-radius: 28px;
    box-shadow: 0 34px 95px rgba(18,14,28,.5);
}
.avatar-editor-dialog::backdrop { background: rgba(25,20,36,.7); backdrop-filter: blur(10px); }
.avatar-editor-card { margin: 0; }
.avatar-editor-heading { padding: 27px 29px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(181,173,232,.12); }
.avatar-editor-heading .eyebrow { margin: 0 0 8px; color: #f16bb8; font-size: 10px; letter-spacing: .18em; }
.avatar-editor-heading h2 { margin: 0; color: #fff; font-size: 25px; line-height: 1.12; }
.avatar-editor-heading p:not(.eyebrow) { margin: 8px 0 0; color: rgba(226,219,238,.64); font-size: 12px; line-height: 1.55; }
.avatar-editor-heading .icon-button { flex: 0 0 auto; color: rgba(245,240,255,.78); background: transparent; border-color: transparent; }
.avatar-editor-heading .icon-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.avatar-editor-body { padding: 24px 29px 18px; display: flex; flex-direction: column; align-items: center; }
.avatar-crop-stage {
    position: relative;
    width: min(300px,70vw);
    aspect-ratio: 1;
    overflow: hidden;
    background: #100e17;
    border: 1px solid rgba(194,183,244,.3);
    border-radius: 50%;
    box-shadow: 0 18px 55px rgba(7,5,12,.42),0 0 0 10px rgba(100,91,164,.08);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.avatar-crop-stage.is-dragging { cursor: grabbing; }
.avatar-crop-stage canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.avatar-crop-ring { position: absolute; inset: 0; border: 2px solid rgba(237,225,255,.74); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); pointer-events: none; }
.avatar-zoom-control { width: min(320px,76vw); margin-top: 24px; display: grid; grid-template-columns: 18px minmax(0,1fr) 21px; align-items: center; gap: 11px; color: rgba(226,219,238,.62); }
.avatar-zoom-control svg { width: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.avatar-zoom-control input { width: 100%; height: 3px; margin: 0; accent-color: #bd61ce; }
.avatar-editor-body .form-error { width: 100%; margin: 14px 0 0; text-align: center; }
.avatar-editor-actions { padding: 17px 29px 25px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid rgba(181,173,232,.1); }
.avatar-editor-actions .secondary-button { color: rgba(244,239,255,.82); background: rgba(255,255,255,.035); border-color: rgba(194,183,244,.22); }
.avatar-editor-actions .primary-button { color: #fff; background: linear-gradient(105deg,#6876ca,#d640a5); border-color: transparent; box-shadow: 0 12px 30px rgba(177,56,147,.2); }

@media (max-width:760px) {
    .mobile-account-profile { grid-template-columns: 58px minmax(0,1fr); }
    .mobile-account-profile .avatar-edit-wrap { width: 52px; }
    .mobile-account-identity small { color: rgba(93,87,111,.55); font-size: 9px; }
    .mobile-account-profile .avatar-edit-button { right: -4px; bottom: -4px; width: 22px !important; min-width: 22px; height: 22px; min-height: 22px !important; border-color: #fbf9fd !important; }
    .avatar-editor-dialog[open] { width: calc(100vw - 24px); max-width: none; border-radius: 24px; }
    .avatar-editor-heading { padding: 22px 20px 16px; }
    .avatar-editor-heading h2 { font-size: 22px; }
    .avatar-editor-heading p:not(.eyebrow) { max-width: 265px; font-size: 11px; }
    .avatar-editor-body { padding: 22px 20px 16px; }
    .avatar-crop-stage { width: min(292px,74vw); }
    .avatar-editor-actions { padding: 15px 20px calc(18px + env(safe-area-inset-bottom)); }
    .avatar-editor-actions > button { flex: 1 1 0; min-height: 47px; }
}

@media (prefers-reduced-motion:reduce) {
    .avatar-edit-button { transition: none; }
}

/* 0.2.72 — Keep native generation controls stable in WebKit. Safari and
   WeChat otherwise compress select/count controls to their intrinsic height. */
.shot-image-generation-field,
.setting-generation-model-field,
.setting-generation-count {
    min-width: 0;
}

/* 0.2.73 — One control system for image and video generation. iOS WebKit
   otherwise derives different intrinsic heights and font weights for native
   selects, which makes model, count and video-spec controls look unrelated. */
.shot-video-spec-field,
.shot-image-generation-field,
.setting-generation-model-field,
.setting-generation-count {
    min-width: 0;
}

@media (max-width:760px) {
    body.workbench-open .shot-video-spec-field > span,
    body.workbench-open .shot-image-generation-field > span,
    body.workbench-open .setting-generation-dialog .setting-generation-model-field > span,
    body.workbench-open .setting-generation-dialog .setting-generation-count legend {
        color: rgba(228,220,239,.68) !important;
        font-size: 12px !important;
        font-weight: 650 !important;
        line-height: 1.3 !important;
        letter-spacing: 0 !important;
    }

    body.workbench-open .shot-video-spec-field select,
    body.workbench-open .shot-video-spec-value,
    body.workbench-open .shot-image-generation-field select,
    body.workbench-open .setting-generation-dialog .setting-generation-model-field select {
        box-sizing: border-box;
        width: 100%;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin-top: 7px !important;
        padding: 0 42px 0 16px !important;
        font-family: inherit !important;
        font-size: 16px !important;
        font-weight: 650 !important;
        line-height: 1.25 !important;
        letter-spacing: 0 !important;
        text-align: left;
        white-space: nowrap;
    }

    body.workbench-open .shot-video-spec-value {
        display: flex;
        align-items: center;
        padding-right: 16px !important;
    }

    body.workbench-open .setting-generation-dialog .setting-generation-count-options {
        margin-top: 7px;
        align-items: stretch;
    }

    body.workbench-open .setting-generation-dialog .setting-generation-count-options label,
    body.workbench-open .setting-generation-dialog .setting-generation-count-options span {
        box-sizing: border-box;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
    }

    body.workbench-open .setting-generation-dialog .setting-generation-count-options span {
        display: grid;
        place-items: center;
        padding: 0 !important;
        font-family: inherit !important;
        font-size: 16px !important;
        font-weight: 650 !important;
        line-height: 1 !important;
    }

    body.workbench-open .shot-image-generate-button,
    body.workbench-open .setting-generation-dialog .setting-generation-create-button {
        min-height: 48px;
        font-size: 15px;
        font-weight: 700;
    }

    /* Mobile Safari and WeChat zoom the page when focused editable controls
       render below 16px. Keep pinch zoom available and only normalize fields. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    textarea {
        font-size: 16px !important;
    }
}

.shot-image-generation-field select,
.setting-generation-model-field select,
body.workbench-open .shot-image-generation-field select,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field select,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-model-field select {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    line-height: 1.2;
    padding-top: 0;
    padding-bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%23cfc8dd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

.setting-generation-count-options label {
    display: block;
    min-height: 44px;
}

.setting-generation-count-options span,
.setting-generation-generate-dock .setting-generation-count-options span,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-count-options span,
body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-count-options span {
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
}

.shot-image-generate-button {
    min-height: 44px;
}

/* iOS WebKit zooms a page when an editable control is below 16px. Keep
   browser/user zoom available, but prevent focus from changing page scale. */
html {
    -webkit-text-size-adjust: 100%;
}

@media (max-width:760px) {
    @supports (-webkit-touch-callout: none) {
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
        textarea {
            font-size: 16px !important;
        }
    }
}

/* 0.2.75 mobile correction. Native selects and count capsules are not text
   editors, so they can stay compact without triggering Safari input zoom. */
@media (max-width:760px) {
    body.workbench-open .shot-video-spec-field select,
    body.workbench-open .shot-video-spec-value,
    body.workbench-open .shot-image-generation-field select,
    body.workbench-open .setting-generation-dialog .setting-generation-model-field select,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-model-field select,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-model-field select {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        font-size: 13px !important;
        font-weight: 650 !important;
        line-height: 1.25 !important;
    }

    body.workbench-open .setting-generation-dialog .setting-generation-count-options label,
    body.workbench-open .setting-generation-dialog .setting-generation-count-options span,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-count-options span,
    body.workbench-open .setting-generation-dialog.is-setting-studio .setting-generation-generate-dock .setting-generation-count-options span {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        font-size: 13px !important;
        font-weight: 650 !important;
        line-height: 1 !important;
    }
}

/* 0.2.80 mobile library headings. The visible action is intentionally just a
   red cue and text; the semantic button keeps a full touch target. */
.view-heading-action-dot {
    display: none;
}

.app-view--assets .view-heading h1 {
    display: none;
}

@media (max-width:760px) {
    .app-view--productions,
    .app-view--assets {
        padding-top: 8px;
    }

    .app-view--productions .view-heading,
    .app-view--assets .view-heading {
        min-height: 46px;
        margin-bottom: 13px;
        align-items: center;
        gap: 16px;
    }

    .app-view--productions .view-heading > div,
    .app-view--assets .view-heading > div {
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .app-view--productions .view-heading .eyebrow,
    .app-view--assets .view-heading .eyebrow {
        margin: 0;
        padding-left: 10px;
        display: block;
        color: #2d283c;
        font-size: 19px;
        font-weight: 760;
        line-height: 1.2;
        letter-spacing: .02em;
        text-transform: none;
        border-left: 4px solid var(--brand-pink);
    }

    .view-heading .view-heading-action {
        width: auto;
        min-width: 0;
        min-height: 44px;
        padding: 0 7px;
        flex: 0 0 auto;
        gap: 8px;
        color: #4e5b99;
        background: transparent;
        border: 0;
        border-radius: 10px;
        box-shadow: none;
        font-size: 13px;
        font-weight: 720;
        letter-spacing: .02em;
    }

    .view-heading .view-heading-action:hover:not(:disabled),
    .view-heading .view-heading-action:active:not(:disabled) {
        color: #3f4d8c;
        background: rgba(78, 91, 153, .06);
        border: 0;
        box-shadow: none;
        transform: none;
    }

    .view-heading .view-heading-action svg {
        display: none;
    }

    .view-heading .view-heading-action > span:not(.view-heading-action-dot) {
        display: inline;
    }

    .view-heading .view-heading-action > .view-heading-action-dot {
        width: 8px;
        height: 8px;
        display: block;
        flex: 0 0 8px;
        background: var(--brand-pink);
        border-radius: 50%;
        box-shadow: 0 0 0 4px rgba(232, 79, 183, .10);
    }

    .app-view--productions.is-empty .view-heading {
        margin-bottom: 13px;
    }
}

@media (max-width:420px) {
    .view-heading .view-heading-action {
        width: auto;
        padding: 0 7px;
        border-radius: 10px;
    }

    .view-heading .view-heading-action > span:not(.view-heading-action-dot) {
        display: inline;
    }
}

/* 0.2.86 compact material-library upload actions. */
.mobile-brand-on-dark { display: none; }

.app-view--assets .asset-empty .primary-button,
.app-view--assets .asset-filter-empty .primary-button {
    width: auto;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    box-shadow: 0 7px 17px rgba(78,91,153,.16);
    font-size: 12px;
}

.app-view--assets .asset-filter-more {
    position: relative;
    width: 40px;
    padding: 0;
    flex: 0 0 40px;
}
.app-view--assets .asset-filter-more.has-active-filters::after {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
}
.app-view--assets .asset-advanced-filters {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.app-view--assets .asset-advanced-filters[hidden] { display: none; }
.app-view--assets .asset-advanced-filters .asset-filter-row--primary { min-width: 0; flex: 1; }
.app-view--assets .asset-advanced-filters .asset-filter-row--secondary { flex: 0 0 auto; }

@media (max-width:760px) {
    body.assets-view-open .mobile-topbar {
        background: rgba(23,20,32,.94);
        border-bottom-color: rgba(255,255,255,.08);
        box-shadow: 0 8px 26px rgba(5,4,10,.18);
    }
    body.assets-view-open .mobile-topbar .mobile-brand-on-light { display: none; }
    body.assets-view-open .mobile-topbar .mobile-brand-on-dark { display: block; }
    body.assets-view-open .mobile-credit-balance {
        color: #e7e4f4;
        background: rgba(42,36,56,.9);
        border-color: rgba(178,182,223,.16);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 5px 16px rgba(0,0,0,.18);
    }
    body.assets-view-open .mobile-credit-balance::before {
        background: linear-gradient(145deg,#b2b6df,#e16ad9);
        box-shadow: 0 0 0 3px rgba(225,106,217,.08);
    }
    body.assets-view-open .mobile-install-button {
        color: #d9dcf5;
        background: rgba(42,36,56,.9);
        box-shadow: inset 0 0 0 1px rgba(178,182,223,.13), 0 5px 16px rgba(0,0,0,.18);
    }
    body.assets-view-open .mobile-account-button {
        background: rgba(42,36,56,.88);
        border-color: rgba(178,182,223,.16);
        box-shadow: 0 5px 16px rgba(0,0,0,.2);
    }
    body.assets-view-open .mobile-account-button .user-avatar {
        box-shadow: 0 0 0 1px rgba(255,255,255,.1);
    }
    .app-view--assets .asset-advanced-filters {
        padding: 10px 11px;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
    .app-view--assets .asset-advanced-filters .asset-filter-row--primary,
    .app-view--assets .asset-advanced-filters .asset-filter-row--secondary { width: 100%; }
    .app-view--assets .asset-advanced-filters .asset-filter-row--primary { align-items: center; }
}

/* 0.2.87 keep the alternate mobile logo out of light-header layout. */
.mobile-topbar .mobile-brand-on-dark { display: none; }
body.assets-view-open .mobile-topbar .mobile-brand-on-light { display: none; }
body.assets-view-open .mobile-topbar .mobile-brand-on-dark { display: block; }

/* 0.2.88 material deletion entry and dedicated empty-state proportions. */
.app-view--assets .asset-card-actions {
    grid-template-columns: minmax(0,1fr) 40px 40px;
}
.app-view--assets .asset-card-actions.is-protected {
    grid-template-columns: minmax(0,1fr) 40px;
}
.app-view--assets .asset-action-delete-icon {
    width: 40px;
    padding: 0;
    justify-self: end;
    color: rgba(239,189,204,.66);
}
.app-view--assets .asset-action-delete-icon:hover {
    color: #ffc4d7;
    background: rgba(165,54,90,.18);
}
.app-view--assets .asset-action-delete-icon svg { width: 15px; height: 15px; }
.app-view--assets .asset-collection.is-list .asset-card-actions {
    width: 196px;
    flex-basis: 196px;
    grid-template-columns: minmax(0,1fr) 38px 38px;
}
.app-view--assets .asset-collection.is-list .asset-card-actions.is-protected {
    width: 150px;
    flex-basis: 150px;
    grid-template-columns: minmax(0,1fr) 38px;
}

.app-view--assets .asset-empty {
    min-height: clamp(320px, 44vh, 430px);
    padding: 38px 18px 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: visible;
    text-align: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.app-view--assets .asset-empty-visual {
    width: 138px;
    height: 102px;
    margin: 0 0 12px;
    transform: scale(.84);
    transform-origin: center bottom;
}
.app-view--assets .asset-empty h2 {
    max-width: none;
    margin: 11px 0 7px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.025em;
}
.app-view--assets .asset-empty p {
    max-width: 360px;
    margin: 0 0 18px;
    font-size: 11px;
    line-height: 1.65;
}

@media (max-width:760px) {
    .app-view--assets .asset-card-actions {
        grid-template-columns: minmax(0,1fr) 34px 34px;
        gap: 5px;
    }
    .app-view--assets .asset-card-actions.is-protected {
        grid-template-columns: minmax(0,1fr) 34px;
    }
    .app-view--assets .asset-action-delete-icon { width: 34px; }
    .app-view--assets .asset-collection.is-list .asset-card-actions,
    .app-view--assets .asset-collection.is-list .asset-card-actions.is-protected {
        width: 70px;
        flex-basis: 70px;
        grid-template-columns: 1fr;
    }
    .app-view--assets .asset-action-delete-icon { width: 100%; }
    .app-view--assets .asset-empty {
        min-height: min(350px, 42vh);
        padding: 26px 14px 32px;
    }
    .app-view--assets .asset-empty-visual {
        width: 116px;
        height: 86px;
        margin-bottom: 8px;
        transform: scale(.72);
    }
    .app-view--assets .asset-empty h2 {
        margin: 8px 0 6px;
        font-size: 20px;
    }
    .app-view--assets .asset-empty p {
        max-width: 270px;
        margin-bottom: 16px;
        font-size: 10px;
        line-height: 1.6;
    }
}

/* 0.2.81 library headings across desktop, PWA and mobile. */
.app-view--productions .view-heading .eyebrow,
.app-view--assets .view-heading .eyebrow {
    margin: 0;
    padding-left: 10px;
    display: block;
    color: #2d283c;
    font-size: 19px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: none;
    border-left: 4px solid var(--brand-pink);
}

.view-heading .view-heading-action {
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 7px;
    flex: 0 0 auto;
    gap: 8px;
    color: #4e5b99;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 720;
    letter-spacing: .02em;
}

.view-heading .view-heading-action:hover:not(:disabled),
.view-heading .view-heading-action:active:not(:disabled) {
    color: #3f4d8c;
    background: rgba(78, 91, 153, .06);
    border: 0;
    box-shadow: none;
    transform: none;
}

.view-heading .view-heading-action svg {
    display: none;
}

.view-heading .view-heading-action > span:not(.view-heading-action-dot) {
    display: inline;
}

.view-heading .view-heading-action > .view-heading-action-dot {
    width: 8px;
    height: 8px;
    display: block;
    flex: 0 0 8px;
    background: var(--brand-pink);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(232, 79, 183, .10);
}

/* 0.2.82 wallet heading follows the same library-title system. */
.app-view--wallet .view-heading h1 {
    display: none;
}

.app-view--wallet .view-heading .eyebrow {
    margin: 0;
    padding-left: 10px;
    display: block;
    color: #2d283c;
    font-size: 19px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: none;
    border-left: 4px solid var(--brand-pink);
}

@media (max-width:760px) {
    .app-view--wallet {
        padding-top: 8px;
    }

    .app-view--wallet .view-heading {
        min-height: 46px;
        margin-bottom: 13px;
        align-items: center;
        gap: 16px;
    }

    .app-view--wallet .view-heading > div {
        min-width: 0;
        display: flex;
        align-items: center;
    }
}

/* 0.2.83 material library cloud-space summary and cinematic asset actions. */
.asset-storage-card {
    --asset-storage-start: #b2b6df;
    --asset-storage-end: #d7d9ec;
    --asset-storage-card: radial-gradient(circle at 88% 10%, rgba(178,182,223,.18), transparent 38%), linear-gradient(135deg, #282533, #555a74);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 19px 21px 17px;
    color: #fff;
    background: var(--asset-storage-card);
    border: 0;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(30,25,45,.17);
}
.asset-storage-card.is-tier-monthly {
    --asset-storage-start: #b2b6df;
    --asset-storage-end: #d5c5ef;
    --asset-storage-card: radial-gradient(circle at 88% 10%, rgba(178,182,223,.28), transparent 38%), linear-gradient(135deg, #282238, #4e5b99 78%, #665d9d);
}
.asset-storage-card.is-tier-quarterly {
    --asset-storage-start: #f08bdc;
    --asset-storage-end: #fff0fa;
    --asset-storage-card: radial-gradient(circle at 88% 10%, rgba(225,106,217,.25), transparent 38%), linear-gradient(135deg, #282238, #4e5b99 72%, #6f5391);
}
.asset-storage-card.is-tier-yearly {
    --asset-storage-start: #d3b4ef;
    --asset-storage-end: #ef9ed5;
    --asset-storage-card: radial-gradient(circle at 88% 10%, rgba(201,59,138,.3), transparent 38%), linear-gradient(135deg, #282238, #705caa 70%, #8e4d87);
}
.asset-storage-card::after {
    content: '';
    position: absolute;
    right: -72px;
    bottom: -110px;
    width: 205px;
    height: 205px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 50%;
}
.asset-storage-card > * { position: relative; z-index: 1; }
.asset-storage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.asset-storage-title { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.74); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.asset-storage-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.asset-storage-capacity { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.asset-storage-capacity strong { color: #fff; font-size: 19px; font-weight: 780; letter-spacing: -.025em; white-space: nowrap; }
.asset-storage-capacity strong small { color: rgba(255,255,255,.58); font-size: 11px; font-weight: 620; letter-spacing: 0; }
.asset-storage-tier { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.76); font-size: 9px; font-weight: 720; white-space: nowrap; }
.asset-storage-tier::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--asset-storage-start); box-shadow: 0 0 9px color-mix(in srgb, var(--asset-storage-end) 55%, transparent); }
.asset-storage-track { height: 7px; margin-top: 13px; overflow: hidden; background: rgba(255,255,255,.13); border-radius: 999px; }
.asset-storage-track > span { min-width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--asset-storage-start), var(--asset-storage-end)); border-radius: inherit; box-shadow: 0 0 14px color-mix(in srgb, var(--asset-storage-end) 35%, transparent); transition: width .25s ease; }
.asset-storage-meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 15px; color: rgba(255,255,255,.66); font-size: 9px; }
.asset-storage-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.asset-storage-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--asset-storage-start); }
.asset-storage-meta i.is-video { background: var(--asset-storage-end); }
.asset-storage-meta i.is-audio { background: color-mix(in srgb, var(--asset-storage-start) 62%, var(--asset-storage-end)); }
.asset-storage-meta b { font: inherit; font-weight: 650; }
.asset-storage-note { margin-left: auto; }

.asset-card {
    color: #f8f4fb;
    background: linear-gradient(145deg, #211d31, #1b1828);
    border-color: rgba(178,182,223,.16);
    box-shadow: 0 7px 22px rgba(30,25,45,.09);
}
.asset-card--skeleton { 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%; border-color: transparent; }
.asset-card:not(.asset-card--skeleton):hover { border-color: rgba(225,106,217,.24); box-shadow: 0 17px 42px rgba(30,25,45,.18); }
.asset-card-copy h2 { color: #f8f4fb; }
.asset-card-copy p, .asset-date, .asset-project-name { color: rgba(231,224,239,.58); }
.asset-card .asset-semantic-badge { color: #c9cdec; background: rgba(78,91,153,.22); }
.asset-card .asset-semantic-badge.is-setting-reference { color: #edaddf; background: rgba(225,106,217,.14); }
.asset-card .asset-semantic-badge.is-setting-candidate { color: #efbd91; background: rgba(231,169,94,.14); }
.asset-card .asset-semantic-badge.is-shot-result { color: #bcc5f0; background: rgba(78,91,153,.25); }
.asset-card .asset-semantic-badge.is-unclassified { color: rgba(235,228,241,.62); background: rgba(255,255,255,.07); }
.asset-card-actions { grid-template-columns: minmax(0,1fr) 40px; }
.asset-action {
    color: rgba(248,244,251,.8);
    background: rgba(255,255,255,.045);
    border: 0;
}
.asset-action:hover { color: #fff; background: rgba(178,182,223,.14); border-color: transparent; }
.asset-action-download-icon { width: 40px; padding: 0; justify-self: end; }
.asset-action-download-icon svg { width: 16px; height: 16px; }
.asset-collection.is-list .asset-card-actions { width: 150px; flex-basis: 150px; grid-template-columns: minmax(0,1fr) 38px; }
.asset-collection.is-list .asset-action-download-icon { width: 38px; }

@media (max-width:760px) {
    .asset-storage-card { margin-bottom: 16px; padding: 15px 14px 14px; border-radius: 17px; }
    .asset-storage-card::after { right: -58px; bottom: -86px; width: 158px; height: 158px; border-color: rgba(255,255,255,.045); }
    .asset-storage-title { font-size: 11px; }
    .asset-storage-capacity { gap: 7px; }
    .asset-storage-capacity strong { font-size: 16px; }
    .asset-storage-capacity strong small { font-size: 9px; }
    .asset-storage-track { height: 6px; margin-top: 11px; }
    .asset-storage-meta { gap: 6px 10px; font-size: 8px; }
    .asset-storage-note { width: 100%; margin-left: 0; }
    .asset-card-actions { grid-template-columns: minmax(0,1fr) 34px; }
    .asset-action-download-icon { width: 34px; }
    .asset-collection.is-list .asset-card-actions { width: 70px; flex-basis: 70px; grid-template-columns: 1fr; }
    .asset-collection.is-list .asset-action-download-icon { width: 100%; }
}

/* 0.2.84 material library visualize alignment and upload completion lifecycle. */
body.assets-view-open .app-main {
    background:
        radial-gradient(circle at 94% 2%, rgba(78,91,153,.14), transparent 30%),
        #171420;
}
.app-view--assets { color: #f8f4fb; }
.app-view--assets .view-heading .eyebrow { color: #f8f4fb; }
.app-view--assets .view-subtitle { color: #b8afc1; }
.app-view--assets .asset-storage-card { margin-bottom: 0; }

.asset-toolbar {
    min-height: 0;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
}
.asset-search {
    min-width: 0;
    min-height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #91879c;
    background: #211c2d;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.asset-search:focus-within {
    border-color: rgba(178,182,223,.42);
    box-shadow: 0 0 0 3px rgba(78,91,153,.12);
}
.asset-search svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}
.asset-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: #f8f4fb;
    background: transparent;
    border: 0;
    outline: 0;
    font: 650 12px/1.2 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
.asset-search input::placeholder { color: #91879c; opacity: 1; }
.asset-search input::-webkit-search-cancel-button { filter: invert(.72); }

.asset-toolbar-primary { min-width: 0; display: flex; align-items: center; gap: 10px; }
.asset-format-filters { min-width: 0; display: flex; align-items: center; gap: 5px; }
.asset-toolbar .asset-filter {
    min-height: 40px;
    padding: 0 13px;
    color: #b8afc1;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    font-size: 11px;
    font-weight: 720;
}
.asset-toolbar .asset-filter:hover { color: #f8f4fb; background: rgba(255,255,255,.055); }
.asset-toolbar .asset-filter.is-active { color: #bfc5ef; background: #303958; box-shadow: none; }
.asset-filter-more { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.asset-filter-more svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
}
.asset-filter-more.has-active-filters::after {
    content: '';
    width: 5px;
    height: 5px;
    margin-left: -2px;
    background: #e16ad9;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(225,106,217,.55);
}
.asset-sort { position: relative; display: block; }
.asset-sort--desktop { margin-left: auto; }
.asset-sort select {
    min-width: 116px;
    min-height: 40px;
    padding: 0 34px 0 13px;
    color: #c4bdcc;
    background: #211c2d;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    outline: 0;
    appearance: none;
    font: 690 10px/1 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
.asset-sort select:focus { border-color: rgba(178,182,223,.42); box-shadow: 0 0 0 3px rgba(78,91,153,.12); }
.asset-sort svg {
    position: absolute;
    right: 11px;
    top: 50%;
    width: 15px;
    height: 15px;
    color: #b8afc1;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transform: translateY(-50%);
}
.asset-advanced-filters {
    padding: 13px 14px;
    display: grid;
    gap: 9px;
    color: #b8afc1;
    background: #211c2d;
    border: 0;
    border-radius: 14px;
}
.asset-advanced-filters[hidden] { display: none; }
.asset-advanced-filters .asset-filter-row { gap: 10px; }
.asset-advanced-filters .asset-filter-label { color: #91879c; }
.asset-advanced-filters .asset-filter--secondary.is-active { color: #bfc5ef; background: #303958; }
.asset-advanced-filters .asset-usage-divider,
.asset-advanced-filters .asset-filter-divider { background: rgba(255,255,255,.1); }
.asset-advanced-filters .asset-select-shell select {
    color: #ded8e4;
    background: #2a2438;
    border-color: transparent;
}
.asset-advanced-filters .asset-select-shell select:hover { color: #fff; background: #332c43; }
.asset-advanced-filters .asset-select-shell svg { color: #91879c; }
.asset-advanced-filters .asset-view-toggle { border-left-color: rgba(255,255,255,.1); }
.asset-advanced-filters .asset-view-button { color: #a79eaf; }
.asset-advanced-filters .asset-view-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.asset-advanced-filters .asset-view-button.is-active { color: #bfc5ef; background: #303958; }
.asset-toolbar-note { color: #91879c; }

.asset-result-head {
    min-height: 24px;
    margin: 20px 2px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #b8afc1;
    font-size: 10px;
    font-weight: 650;
}
.asset-result-sort-label { margin-left: auto; color: #b8afc1; }
.asset-sort--mobile { display: none; }

.asset-card,
.asset-card--skeleton,
.asset-card:not(.asset-card--skeleton):hover {
    border: 0;
    border-color: transparent;
}
.asset-card { box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.asset-card:not(.asset-card--skeleton):hover { box-shadow: 0 18px 42px rgba(0,0,0,.24); }
.asset-card--skeleton { background: linear-gradient(100deg, #211c2d 20%, #2a2438 38%, #211c2d 56%); background-size: 220% 100%; }
.app-view--assets .asset-empty,
.app-view--assets .content-state {
    color: #f8f4fb;
    background: #211c2d;
    border: 0;
    box-shadow: none;
}
.app-view--assets .asset-empty p,
.app-view--assets .content-state p { color: #91879c; }

.app-view--assets .upload-panel {
    margin: 16px 0 0;
    color: #f8f4fb;
    background: #211c2d;
    border: 0;
    box-shadow: none;
}
.app-view--assets .upload-panel-heading span,
.app-view--assets .upload-copy > span { color: #91879c; }
.app-view--assets .upload-panel-heading .text-button { color: #bfc5ef; }
.app-view--assets .upload-row { color: #f8f4fb; background: #2a2438; border: 0; }
.app-view--assets .upload-row.is-error { color: #f8f4fb; background: rgba(165,54,90,.2); }

@media (max-width:760px) {
    body.assets-view-open .app-main {
        background:
            radial-gradient(circle at 105% 0%, rgba(78,91,153,.16), transparent 32%),
            #171420;
    }
    .app-view--assets .asset-storage-card { margin-bottom: 0; }
    .asset-toolbar { margin-top: 12px; gap: 9px; }
    .asset-search { min-height: 44px; padding: 0 12px; }
    .asset-search input { font-size: 11px; }
    .asset-toolbar-primary { gap: 4px; }
    .asset-format-filters { flex: 1; gap: 1px; overflow-x: auto; scrollbar-width: none; }
    .asset-format-filters::-webkit-scrollbar { display: none; }
    .asset-toolbar .asset-filter { min-height: 39px; padding: 0 10px; flex: 0 0 auto; font-size: 10px; }
    .asset-filter-more { gap: 5px; }
    .asset-filter-more svg { width: 15px; height: 15px; }
    .asset-sort--desktop { display: none; }
    .asset-result-sort-label { display: none; }
    .asset-sort--mobile { display: block; margin-left: auto; }
    .asset-sort--mobile select {
        min-width: 88px;
        min-height: 32px;
        padding: 0 22px 0 0;
        background: transparent;
        border: 0;
        font-size: 9px;
        text-align: right;
    }
    .asset-sort--mobile svg { right: 0; width: 14px; height: 14px; }
    .asset-result-head { margin: 14px 2px 9px; }
    .asset-advanced-filters { padding: 11px 12px; gap: 8px; }
    .asset-advanced-filters .asset-filter-row { align-items: flex-start; }
    .asset-advanced-filters .asset-usage-filters { flex-wrap: nowrap; }
    .asset-advanced-filters .asset-select-shell select { width: min(210px, 55vw); }
    .asset-card,
    .asset-card--skeleton,
    .asset-card:not(.asset-card--skeleton):hover { border: 0; }
    .app-view--assets .upload-panel { margin-top: 12px; }
}

/* 0.2.85 material library seamless empty states. */
.app-view--assets .asset-empty,
.app-view--assets .asset-filter-empty,
.app-view--assets .content-state {
    background: transparent;
}

.app-view--assets #open-asset-picker {
    min-height: 40px;
    padding: 0 15px;
    gap: 7px;
    border-radius: 11px;
    box-shadow: 0 8px 19px rgba(78,91,153,.18);
    font-size: 11px;
}
.app-view--assets #open-asset-picker svg { width: 16px; height: 16px; }

@media (max-width:420px) {
    .app-view--assets #open-asset-picker {
        width: 38px;
        min-height: 38px;
        padding: 0;
    }
}
/* Guided practice uses the real workbench.  These styles only add an entry,
   a coachmark and a focus ring; no production component is duplicated. */
.tutorial-entry {
    width: 100%;
    margin: 0 0 24px;
    padding: 18px 20px;
    border: 0;
    border-radius: 22px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    color: #f8f6ff;
    text-align: left;
    background:
        radial-gradient(circle at 82% 20%, rgba(225, 106, 217, .28), transparent 34%),
        linear-gradient(135deg, #1c1930 0%, #303963 58%, #533461 100%);
    box-shadow: 0 18px 44px rgba(39, 31, 73, .18);
    cursor: pointer;
    overflow: hidden;
}
.tutorial-entry:hover { transform: translateY(-1px); }
.tutorial-entry:focus-visible { outline: 3px solid rgba(225, 106, 217, .42); outline-offset: 3px; }
.tutorial-entry-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: rgba(246,244,255,.94);
    background: transparent;
    border: 0;
    box-shadow: none;
}
.tutorial-entry-mark svg { width: 31px; height: 31px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tutorial-entry-mark circle { fill: var(--brand-pink); stroke: none; filter: drop-shadow(0 0 6px rgba(232,79,183,.52)); }
.tutorial-entry-mark .tutorial-entry-spark { fill: #91a2f2; stroke: none; }
.tutorial-entry-copy { min-width: 0; display: grid; gap: 3px; font-style: normal; }
.tutorial-entry-copy small { color: var(--brand-pink); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.tutorial-entry-copy strong { font-size: 18px; line-height: 1.35; }
.tutorial-entry-copy em { color: rgba(244, 240, 255, .68); font-size: 13px; font-style: normal; }
.tutorial-entry-action { white-space: nowrap; font-size: 14px; font-weight: 750; }
.tutorial-entry-action b {
    display: inline-block;
    margin-left: 8px;
    color: var(--brand-pink);
    font-size: 18px;
    will-change: transform, opacity;
    animation: tutorialEntryArrowCue 1.85s cubic-bezier(.22,.7,.28,1) infinite;
}
.tutorial-entry:hover .tutorial-entry-action b,
.tutorial-entry:focus-visible .tutorial-entry-action b {
    animation-duration: 1.05s;
}

@keyframes tutorialEntryArrowCue {
    0%, 20%, 100% { opacity: .72; transform: translateX(0); }
    45% { opacity: 1; transform: translateX(7px); }
    62% { opacity: .92; transform: translateX(3px); }
}

#tutorial-safe-area {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    visibility: hidden;
    pointer-events: none;
}
.tutorial-guide {
    position: fixed;
    z-index: 285;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(344px, calc(100vw - 36px));
    box-sizing: border-box;
    padding: 16px;
    color: #272234;
    border: 1px solid rgba(78,91,153,.2);
    border-radius: 22px;
    background: #faf7f2;
    box-shadow: 0 18px 52px rgba(9,7,20,.28), 0 2px 6px rgba(9,7,20,.08);
    /* The hand supplies the motion cue. Moving the coachmark itself can
       cross the control it is teaching while the layout scrolls. */
    transition: none;
}
.tutorial-guide[hidden] { display: none; }
.tutorial-guide.is-settling { visibility: hidden; pointer-events: none; }
.tutorial-guide-actions[hidden], .tutorial-guide > p[hidden], .tutorial-guide-target-hint[hidden] { display: none; }
.tutorial-guide.is-positioned { right: auto; bottom: auto; }
.tutorial-guide.is-operation-guide {
    width: min(390px, calc(100vw - 28px));
    padding: 15px 17px;
}
.tutorial-guide.is-operation-guide > strong { margin-top: 7px; font-size: 17px; }
.tutorial-guide.is-operation-guide > p { margin: 5px 0 9px; font-size: 14px; line-height: 1.55; }
.tutorial-guide.is-dialog-layer { position: absolute; }
.rough-cut-inspector-dialog > .tutorial-guide.is-roughcut-inline {
    position: relative;
    z-index: 14;
    inset: auto;
    width: auto;
    margin: 0 14px 14px;
    padding: 12px 14px;
    flex: 0 0 auto;
    border-radius: 17px;
}
.rough-cut-inspector-dialog:has(> .tutorial-guide.is-roughcut-inline:not([hidden])) > .rough-cut-inspector {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
}
.rough-cut-inspector-dialog > .tutorial-guide.is-roughcut-inline > strong { margin-top: 7px; font-size: 16px; }
.rough-cut-inspector-dialog > .tutorial-guide.is-roughcut-inline > p { margin: 4px 0 9px; font-size: 14px; line-height: 1.55; }
.tutorial-guide.is-docked-top { top: max(82px, calc(env(safe-area-inset-top) + 12px)); bottom: auto; }
.tutorial-guide.is-entering { animation: tutorialGuideFade .16s ease-out both; }
@keyframes tutorialGuideFade { from { opacity: 0; } to { opacity: 1; } }
.tutorial-guide-progress { display: grid; grid-template-columns: auto minmax(20px, 1fr) auto auto; align-items: center; gap: 8px; }
.tutorial-guide-progress:has(.tutorial-guide-target-hint[hidden]) { grid-template-columns: auto 1fr auto; }
.tutorial-guide-progress > span { color: #963675; font-size: 12px; font-weight: 750; }
.tutorial-guide-progress > i { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(78,91,153,.12); }
.tutorial-guide-progress > i b { display: block; height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, #7187e8, #e16ad9); transition: width .3s ease; }
.tutorial-guide-progress > button { width: 44px; height: 44px; margin: -7px -7px -7px 0; padding: 0; border: 0; color: #716879; background: transparent; font-size: 23px; cursor: pointer; }
.tutorial-guide > strong { display: block; margin-top: 10px; font-size: 19px; line-height: 1.35; }
.tutorial-guide > p { margin: 6px 0 13px; color: #61596b; font-size: 14px; line-height: 1.65; }
.tutorial-guide-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.tutorial-guide-target-hint {
    min-height: 20px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(78,91,153,.07);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #4e5b99;
    font-size: 10px;
    font-weight: 600;
}
.tutorial-guide-progress > .tutorial-guide-target-hint { color: #716879; font-size: 10px; font-weight: 600; }
.tutorial-guide-target-hint > i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #b25c9a;
    box-shadow: 0 0 0 4px rgba(178,92,154,.1);
    animation: tutorialGuideHintPulse 1.2s ease-in-out infinite;
}
.tutorial-guide-actions .primary-button { min-height: 42px; padding: 0 17px; border-radius: 14px; }
.tutorial-guide-actions .text-button { color: #61596b; }
.tutorial-guide button:focus-visible { outline: 2px solid #f4a5e8; outline-offset: 3px; }
.tutorial-guide-pointer {
    position: fixed;
    z-index: 287;
    width: 38.4px;
    height: 48px;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 3px 3px rgba(24,21,41,.23));
}
.tutorial-guide-pointer.is-dialog-layer { position: absolute; }
.tutorial-guide-pointer[hidden] { display: none; }
.tutorial-guide-gesture { position: relative; width: 100%; height: 100%; }
.tutorial-guide-hand { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; animation: tutorialHandTap 2.2s ease-in-out infinite; }
.tutorial-guide-hand--grab { display: none; }
.tutorial-guide-tap {
    position: absolute;
    left: 16px;
    top: 4px;
    width: 20px;
    height: 20px;
    border: 1.2px solid rgba(225,106,217,.72);
    border-radius: 50%;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(225,106,217,.15);
    animation: tutorialHandRipple 2.2s ease-out infinite;
}
.tutorial-guide-tap::after { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(225,106,217,.65); border-radius: 50%; }
.tutorial-guide-pointer.is-flipped .tutorial-guide-gesture { transform: scaleY(-1); }
.tutorial-guide-pointer[data-mode="drag"] .tutorial-guide-hand--point,
.tutorial-guide-pointer[data-mode="drag"] .tutorial-guide-tap { display: none; }
.tutorial-guide-pointer[data-mode="drag"] .tutorial-guide-hand--grab { display: block; }
.tutorial-guide-pointer[data-mode="drag"] .tutorial-guide-hand--grab { animation-name: tutorialHandDrag; }
@keyframes tutorialHandTap { 0%, 65%, 100% { transform: translateY(8px); } 35% { transform: translateY(0); } }
@keyframes tutorialHandRipple { 0%, 24% { opacity: 0; transform: translate(-50%,-50%) scale(.55); } 35% { opacity: .85; } 72%, 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.2); } }
@keyframes tutorialHandDrag { 0%, 15%, 100% { transform: translateX(-7px); } 55%, 70% { transform: translateX(9px); } }
@media (prefers-reduced-motion: reduce) {
    .tutorial-guide-hand, .tutorial-guide-tap { animation: none; }
    .tutorial-guide-tap { opacity: .55; transform: translate(-50%,-50%) scale(.8); }
}
.tutorial-guide-resume {
    position: fixed;
    z-index: 286;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 0 15px 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #f7f4ff;
    background: rgba(27,24,47,.94);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    box-shadow: 0 16px 44px rgba(9,7,20,.3);
    backdrop-filter: blur(16px);
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
}
.tutorial-guide-resume[hidden] { display: none; }
.tutorial-guide-resume > span { width: 9px; height: 9px; border-radius: 50%; background: #ed63c8; box-shadow: 0 0 0 5px rgba(237,99,200,.12), 0 0 14px rgba(237,99,200,.5); }
.tutorial-guide-resume > strong { font: inherit; font-weight: inherit; }
.tutorial-guide-resume.is-setting-result-ready {
    border-color: rgba(237,99,200,.44);
    box-shadow: 0 16px 44px rgba(9,7,20,.3), 0 0 0 4px rgba(225,106,217,.1);
}
.tutorial-guide-target-ring {
    position: fixed;
    z-index: 15;
    box-sizing: border-box;
    pointer-events: none;
    border: 3px solid #ef70c8;
    border-radius: 20px;
    box-shadow:
        inset 0 0 0 1px rgba(255,244,253,.92),
        0 0 0 2px rgba(43,22,52,.78),
        0 0 0 7px rgba(239,112,200,.2),
        0 0 24px rgba(239,112,200,.32);
    /* Contrasting inner edge and outer keyline work on light and dark panels.
       Keep geometry still: only the hand carries the movement. */
    animation: none;
}
.tutorial-guide-target-ring.is-dialog-layer { position: absolute; }
.tutorial-guide-target-ring[hidden] { display: none; }
.tutorial-guide-target-ring.is-waiting { display: none; }
.tutorial-guide-target-ring::before {
    display: none;
}
.tutorial-guide-target-ring > span {
    display: none;
    position: absolute;
    right: -11px;
    top: -11px;
    width: 19px;
    height: 19px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #ffd4f5 0 18%, #f05fca 22% 58%, #b93d9e 100%);
    box-shadow:
        0 0 0 6px rgba(237,99,200,.27),
        0 0 0 10px rgba(225,106,217,.1),
        0 0 27px rgba(237,99,200,1);
    animation: tutorialTargetDot 1.1s ease-in-out infinite;
}
.tutorial-course-field[readonly] {
    color: inherit;
    background-image: linear-gradient(90deg, rgba(113,135,232,.055), rgba(225,106,217,.055));
    border-color: rgba(113,135,232,.2) !important;
    cursor: default;
}
body.workbench-open .story-editor.is-tutorial-story-awaiting,
body.workbench-open .story-editor.is-tutorial-story-writing {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
body.workbench-open .story-editor.is-tutorial-story-awaiting > *,
body.workbench-open .story-editor.is-tutorial-story-writing > * {
    position: relative;
    z-index: 1;
}
body.workbench-open .story-editor.is-tutorial-story-awaiting::before,
body.workbench-open .story-editor.is-tutorial-story-writing::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -55% -35%;
    pointer-events: none;
    background:
        radial-gradient(circle at 35% 45%, rgba(113,135,232,.2), transparent 24%),
        radial-gradient(circle at 67% 52%, rgba(225,106,217,.19), transparent 23%);
    filter: blur(22px);
}
body.workbench-open .story-editor.is-tutorial-story-awaiting::after,
body.workbench-open .story-editor.is-tutorial-story-writing::after {
    content: "✦";
    position: absolute;
    z-index: 2;
    right: 28px;
    top: 72px;
    pointer-events: none;
    color: var(--brand-pink);
    font-size: 18px;
    text-shadow:
        -24px 30px 0 rgba(145,162,242,.6),
        14px 58px 0 rgba(241,139,222,.38),
        0 0 18px rgba(225,106,217,.75);
    animation: tutorialStorySparkle 1.8s ease-in-out infinite;
}
body.workbench-open .story-editor textarea.tutorial-story-awaiting[readonly] {
    cursor: pointer;
}
body.workbench-open .story-editor textarea.tutorial-story-awaiting::placeholder {
    color: rgba(211,203,224,.72);
}
body.workbench-open .story-editor textarea.tutorial-story-writing[readonly] {
    color: #fff;
    text-shadow: 0 0 18px rgba(145,162,242,.26);
    cursor: default;
    animation: tutorialStoryInkGlow 1.25s ease-in-out infinite;
}
.tutorial-focus {
    position: relative;
    z-index: 2;
    scroll-margin: 24px 16px;
    filter: brightness(1.035);
}
.rough-timeline-playhead.tutorial-focus {
    position: absolute;
}
.rough-timeline-playhead-handle.tutorial-focus { position: absolute; }
.tutorial-locked {
    opacity: .46;
    filter: saturate(.55);
}
.tutorial-locked small::after {
    content: " · 后续教程开放";
    color: #b779ad;
}
.tutorial-unavailable {
    cursor: not-allowed;
}
.setting-generation-dialog .tutorial-unavailable {
    opacity: .46;
    filter: saturate(.5);
}
.shot-reference-option.is-tutorial-missing {
    border-color: rgba(103,122,219,.78);
    box-shadow: 0 0 0 3px rgba(103,122,219,.14);
}
.shot-reference-option.is-tutorial-extra {
    border-color: rgba(218,78,138,.8);
    box-shadow: 0 0 0 3px rgba(218,78,138,.14);
}
.workbench-step.tutorial-unavailable {
    opacity: .46;
    filter: saturate(.45);
}
body.workbench-open .world-grid .setting-card.is-tutorial-locked {
    opacity: .42;
    filter: saturate(.52);
    cursor: not-allowed;
    transform: none;
}
body.workbench-open .world-grid .setting-card.is-tutorial-locked:hover {
    transform: none;
    border-color: rgba(178,182,223,.2);
    box-shadow: 0 8px 22px rgba(10,8,14,.12), inset 0 1px 0 rgba(255,255,255,.025);
}
body.workbench-open .world-grid .setting-card.is-tutorial-current {
    border-color: rgba(224,105,183,.5);
}
.setting-generation-current-actions .is-tutorial-primary-action {
    box-shadow: 0 10px 28px rgba(225,106,217,.2);
}
@keyframes tutorialGuideArrive {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes tutorialTargetBreathe {
    0%, 100% { border-color: #f05fca; box-shadow: 0 0 0 7px rgba(225,106,217,.18), 0 0 0 10px rgba(113,135,232,.08), 0 0 32px rgba(225,106,217,.42); }
    50% { border-color: #a9b6ff; box-shadow: 0 0 0 10px rgba(113,135,232,.2), 0 0 0 13px rgba(225,106,217,.1), 0 0 46px rgba(225,106,217,.62); }
}
@keyframes tutorialTargetDot {
    0%, 100% { filter: brightness(1); transform: scale(.9); }
    50% { filter: brightness(1.2); transform: scale(1.2); }
}
@keyframes tutorialGuideHintPulse {
    0%, 100% { opacity: .68; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1.16); }
}
@keyframes tutorialStorySparkle {
    0%, 100% { opacity: .38; transform: translate3d(0, 4px, 0) rotate(-8deg) scale(.82); }
    45% { opacity: 1; transform: translate3d(-10px, -5px, 0) rotate(5deg) scale(1.12); }
}
@keyframes tutorialStoryInkGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(145,162,242,.16); }
    50% { text-shadow: 0 0 22px rgba(225,106,217,.3); }
}
.tutorial-restart-entry { display: block; margin: -6px 0 22px auto; min-height: 44px; }
@media (max-width: 700px) {
    body.tutorial-story-opening.workbench-open .story-editor { min-height: 0; margin-top: 14px; padding: 14px; }
    body.tutorial-story-opening.workbench-open .story-editor textarea { min-height: 100px; height: 100px; }
    body.tutorial-story-opening #story-pane-story .workbench-stage-heading { scroll-margin-top: 12px; }
    .tutorial-guide.is-story-opening { padding: 12px 14px; }
    .tutorial-guide.is-story-opening > strong { font-size: 16px; }
    .tutorial-guide.is-story-opening > p { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
    .tutorial-guide.is-operation-guide > strong { font-size: 16px; margin-top: 5px; }
    .tutorial-guide.is-operation-guide > p { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
    .tutorial-entry { margin-bottom: 18px; padding: 14px; gap: 12px; border-radius: 18px; }
    .tutorial-entry-mark { width: 40px; height: 40px; }
    .tutorial-entry-copy strong { font-size: 15px; }
    .tutorial-entry-copy em { display: none; }
    .tutorial-entry-action { font-size: 13px; }
    .tutorial-guide { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: min(330px, calc(100vw - 24px)); padding: 14px; border-radius: 19px; }
    .tutorial-guide.is-operation-guide { width: min(310px, calc(100vw - 24px)); padding: 12px 14px; }
    .tutorial-guide.is-docked-top { top: max(72px, calc(env(safe-area-inset-top) + 10px)); bottom: auto; }
    .tutorial-guide > strong { font-size: 18px; }
    .tutorial-guide-resume { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .tutorial-guide-hand,
    .tutorial-guide,
    .tutorial-guide-target-ring,
    .tutorial-guide-target-ring > span,
    .tutorial-guide-target-hint > i,
    .tutorial-entry-action b,
    .story-editor.is-tutorial-story-awaiting::after,
    .story-editor.is-tutorial-story-writing::after,
    .story-editor textarea.tutorial-story-writing,
    .shot-video-prompt-field.is-tutorial-writing .shot-video-prompt-input-shell::before,
    .shot-video-prompt-field.is-ai-writing .shot-video-prompt-input-shell::before,
    .shot-video-prompt-field textarea.tutorial-shot-rework-writing,
    .shot-video-prompt-field textarea.ai-shot-prompt-writing { animation: none !important; transition: none !important; }
}

/* 0.3.1 user center: achievements belong to identity, not the Credits ledger. */
.user-center-dialog[open] {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    display: block;
    overflow: hidden;
    color: var(--ink);
    background: #fbf9fd;
    border: 1px solid rgba(78,91,153,.14);
    border-radius: 27px;
    box-shadow: 0 30px 90px rgba(28,23,43,.28);
}
.user-center-dialog::backdrop { background: rgba(24,20,36,.62); backdrop-filter: blur(10px); }
.user-center-shell { max-height: calc(100dvh - 34px); overflow: auto; }
.user-center-heading { padding: 25px 28px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; background: linear-gradient(150deg,#fffafd,#f4f2fa); border-bottom: 1px solid rgba(78,91,153,.1); }
.user-center-heading .eyebrow { margin: 0 0 6px; color: #c843a2; font-size: 9px; letter-spacing: .16em; }
.user-center-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.user-center-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.user-center-heading .icon-button { flex: 0 0 auto; }
.user-center-body { padding: 22px 28px 28px; display: grid; gap: 24px; }
.user-center-profile { min-height: 116px; padding: 20px 22px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 17px; color: #fff; background: radial-gradient(circle at 84% -10%,rgba(225,106,217,.22),transparent 37%),linear-gradient(135deg,#1b1729,#292b4d 66%,#3b2947); border-radius: 21px; box-shadow: 0 15px 38px rgba(34,28,58,.16); }
.user-center-avatar { width: 72px; height: 72px; flex-basis: 72px; border: 2px solid rgba(255,255,255,.28); border-radius: 22px; box-shadow: 0 12px 28px rgba(10,8,20,.22); font-size: 24px; }
.user-center-identity { min-width: 0; display: grid; gap: 4px; }
.user-center-identity > span { color: #e58bdd; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.user-center-identity > strong { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.user-center-identity > small { overflow: hidden; color: rgba(232,228,241,.62); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-center-avatar-edit { min-height: 38px; padding: 0 14px; color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); white-space: nowrap; }
.user-center-avatar-edit:hover { background: rgba(255,255,255,.14); }
.user-center-achievements { display: grid; gap: 14px; }
.user-center-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.user-center-section-heading h3 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.user-center-section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.user-center-section-heading > span { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; color: #6b5f88; background: rgba(178,182,223,.2); border-radius: 999px; font-size: 9px; font-weight: 760; white-space: nowrap; }
.user-center-achievement-empty { min-height: 112px; padding: 22px; display: flex; align-items: center; gap: 15px; color: var(--ink-soft); background: rgba(78,91,153,.045); border-radius: 19px; }
.user-center-achievement-empty > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: #be58ac; background: rgba(225,106,217,.1); border-radius: 15px; font-size: 23px; }
.user-center-achievement-empty strong { font-size: 13px; }
.user-center-achievement-empty p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.user-center-achievement-card { position: relative; min-height: 156px; padding: 22px 24px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 20px; overflow: hidden; color: #fff; background: radial-gradient(circle at 15% 30%,rgba(225,106,217,.22),transparent 30%),radial-gradient(circle at 88% 0,rgba(126,140,225,.25),transparent 32%),linear-gradient(135deg,#171426 0%,#282d51 60%,#412b4c 100%); border-radius: 22px; box-shadow: 0 18px 45px rgba(36,28,67,.17); }
.user-center-achievement-card::after { content: ''; position: absolute; width: 260px; aspect-ratio: 1; right: -105px; top: -140px; border-radius: 50%; background: radial-gradient(circle,rgba(255,255,255,.1),transparent 66%); pointer-events: none; }
.user-center-achievement-emblem { position: relative; z-index: 1; width: 92px; height: 92px; display: grid; place-items: center; background: linear-gradient(145deg,#6675cb,#9868c9 56%,#e16ad9); border: 2px solid rgba(255,255,255,.28); border-radius: 50%; box-shadow: 0 0 0 7px rgba(145,162,242,.1),0 16px 38px rgba(94,69,161,.32),0 0 28px rgba(225,106,217,.2); }
.user-center-achievement-emblem svg { width: 68px; height: 68px; }
.user-center-achievement-emblem circle { fill: rgba(15,12,25,.22); stroke: rgba(255,255,255,.34); stroke-width: 2; }
.user-center-achievement-emblem path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.user-center-achievement-copy { position: relative; z-index: 1; min-width: 0; display: grid; gap: 5px; }
.user-center-achievement-copy > span { color: #e58bdd; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.user-center-achievement-copy > strong { font-size: clamp(22px,3vw,30px); letter-spacing: -.04em; }
.user-center-achievement-copy > p { margin: 1px 0 0; color: rgba(232,228,241,.66); font-size: 11px; line-height: 1.6; }
.user-center-achievement-unlocked { position: relative; z-index: 1; min-height: 32px; padding: 0 12px; display: inline-flex; align-items: center; color: #f6d8f1; background: rgba(225,106,217,.15); border-radius: 999px; font-size: 9px; font-weight: 780; white-space: nowrap; }
.user-center-achievement-actions { position: relative; z-index: 1; display: grid; justify-items: end; gap: 9px; }
.user-center-achievement-replay { min-height: 36px; padding: 0 14px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 10px; font-weight: 760; white-space: nowrap; cursor: pointer; transition: transform .16s ease,background .16s ease,border-color .16s ease; }
.user-center-achievement-replay:hover { transform: translateY(-1px); background: rgba(225,106,217,.2); border-color: rgba(241,166,232,.48); }
.user-center-achievement-replay:focus-visible { outline: 3px solid rgba(225,106,217,.38); outline-offset: 3px; }
@media (max-width: 760px) {
    .user-center-dialog[open] { width: calc(100vw - 20px); max-height: calc(100svh - 20px); border-radius: 22px; }
    .user-center-shell { max-height: calc(100svh - 22px); }
    .user-center-heading { padding: 20px 18px 16px; }
    .user-center-heading h2 { font-size: 22px; }
    .user-center-body { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); gap: 20px; }
    .user-center-profile { min-height: 0; padding: 17px 15px; grid-template-columns: auto minmax(0,1fr); gap: 13px; border-radius: 18px; }
    .user-center-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; font-size: 20px; }
    .user-center-identity > strong { font-size: 18px; }
    .user-center-avatar-edit { grid-column: 1 / -1; width: 100%; min-height: 42px; }
    .user-center-section-heading { gap: 10px; }
    .user-center-section-heading h3 { font-size: 17px; }
    .user-center-section-heading p { max-width: 220px; line-height: 1.45; }
    .user-center-achievement-card { min-height: 0; padding: 18px 16px; grid-template-columns: auto minmax(0,1fr); gap: 15px; border-radius: 18px; }
    .user-center-achievement-emblem { width: 72px; height: 72px; box-shadow: 0 0 0 5px rgba(145,162,242,.1),0 12px 28px rgba(94,69,161,.28); }
    .user-center-achievement-emblem svg { width: 54px; height: 54px; }
    .user-center-achievement-copy > strong { font-size: 21px; }
    .user-center-achievement-copy > p { font-size: 9px; }
    .user-center-achievement-actions { grid-column: 2; justify-items: start; margin-top: -4px; }
    .user-center-achievement-unlocked { min-height: 26px; padding: 0 9px; }
}

/* 0.3.08 user center: a calm white identity space with compact, circular medals. */
.user-center-dialog[open] {
    width: min(640px, calc(100vw - 32px));
    color: var(--ink);
    background: #fff;
    border-color: rgba(78,91,153,.12);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(28,23,43,.22);
}
.user-center-heading { padding: 26px 30px 20px; background: #fff; border-bottom-color: rgba(78,91,153,.08); }
.user-center-heading h2 { font-size: 26px; }
.user-center-body { padding: 24px 30px 32px; gap: 28px; background: #fff; }
.user-center-profile {
    min-height: 200px;
    padding: 10px 20px 24px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 14px;
    color: var(--ink);
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}
.user-center-avatar-stage { position: relative; width: 132px; height: 132px; }
.user-center-avatar {
    width: 132px;
    height: 132px;
    flex-basis: 132px;
    border: 5px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(78,91,153,.12),0 20px 42px rgba(64,52,87,.16);
    font-size: 40px;
}
.user-center-avatar-edit {
    position: absolute;
    right: -2px;
    bottom: 4px;
    width: 38px;
    height: 38px;
    min-height: 0;
    padding: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg,#5f70bd,#b154a6);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(78,91,153,.28);
    cursor: pointer;
    transition: transform .18s ease,box-shadow .18s ease;
}
.user-center-avatar-edit svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-center-avatar-edit:hover { transform: translateY(-2px) scale(1.04); background: linear-gradient(145deg,#5f70bd,#b154a6); box-shadow: 0 11px 25px rgba(78,91,153,.34); }
.user-center-avatar-edit:focus-visible { outline: 3px solid rgba(225,106,217,.34); outline-offset: 3px; }
.user-center-identity { min-width: 0; width: 100%; display: grid; justify-items: center; gap: 5px; text-align: center; }
.user-center-identity > strong { max-width: 100%; overflow: hidden; color: #272238; font-size: 24px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.user-center-identity > small { max-width: 100%; overflow: hidden; color: #857d92; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-center-achievements { padding-top: 24px; gap: 18px; border-top: 1px solid rgba(78,91,153,.1); }
.user-center-section-heading h3 { font-size: 20px; }
.user-center-section-heading p { font-size: 11px; }
.user-center-section-heading > span { min-height: 30px; padding: 0 11px; color: #6b5f88; background: #f1eff7; font-size: 10px; }
.user-center-achievement-empty { min-height: 110px; background: #f8f7fb; border-radius: 20px; }
.user-center-achievement-card { min-height: 144px; padding: 4px 0 0; display: grid; grid-template-columns: 1fr; justify-items: center; gap: 12px; overflow: visible; color: var(--ink); background: #fff; border-radius: 0; box-shadow: none; }
.user-center-achievement-card[hidden] { display: none; }
.user-center-achievement-card::after { content: none; }
.user-center-achievement-medal { width: 124px; height: 124px; aspect-ratio: 1; padding: 0; display: grid; place-items: center; background: transparent; border: 0; border-radius: 50%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.user-center-achievement-medal img { width: 118px; height: 118px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 14px 17px rgba(85,53,26,.22)); }
.user-center-achievement-medal.is-dragging { cursor: grabbing; }
.user-center-achievement-medal .achievement-medal-stage { --achievement-medal-size: 118px; display: block; margin: 0; perspective: 1000px; isolation: auto; transform-style: preserve-3d; }
.user-center-achievement-medal .achievement-medal-token { display: block; transform: rotateX(-6deg) rotateY(0deg); }
.user-center-achievement-medal .achievement-medal-token { --medal-depth: 7px; }
.user-center-achievement-medal .achievement-medal-token::after { display: none; }
.achievement-reveal .achievement-medal-token { --medal-depth: 9px; }
.achievement-reveal .achievement-medal-token::after { display: none; }
.achievement-reveal.is-medal-interactive .achievement-medal-token { animation: none; }
.achievement-reveal.is-medal-interactive .achievement-medal-stage { pointer-events: auto; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.achievement-reveal.is-medal-interactive .achievement-medal-stage.is-dragging { cursor: grabbing; }
.achievement-reveal.is-medal-interactive .achievement-medal-stage:focus-visible { outline: 2px solid #e39acf; outline-offset: 8px; border-radius: 50%; }
.medal-award-sheen { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,248,224,.82) 49%, transparent 67%); background-size: 300% 100%; background-position: 150% 0; opacity: 0; }
.achievement-reveal.is-playing .medal-award-sheen { animation: achievement-medal-sheen .65s 1.82s ease-out both; }
@media (prefers-reduced-motion: reduce) { .achievement-reveal.is-playing .medal-award-sheen { display: none; animation: none; } }
.collection-medal-face {
    position: absolute; inset: 0;
    display: block;
    transform: translateZ(calc(var(--medal-depth) / 2));
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    /* Each face is a flat lit surface. Never blend/flatten the parent 3D token. */
    clip-path: circle(43.3% at 50% 49.3%);
}
.collection-medal-face--back { transform: rotateY(180deg) translateZ(calc(var(--medal-depth) / 2)); }
.collection-medal-face > img { width: 100%; height: 100%; margin: 0; filter: none; transform: none; }
.collection-medal-face::before, .collection-medal-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.collection-medal-face::before { z-index: 1; background: #14131f; opacity: var(--face-shade, .04); }
.collection-medal-face::after { z-index: 2; background: radial-gradient(ellipse at var(--light-x, 34%) 24%, rgba(255,247,222,.95), rgba(255,247,222,.3) 30%, transparent 66%); opacity: var(--face-glint, .1); }
.collection-medal-metal-light {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: conic-gradient(from var(--metal-light-angle, -46deg) at 50% 49.3%, #fffbea, #ffe3a7 10deg, transparent 44deg, transparent 310deg, #ffe3a7 350deg, #fffbea);
    -webkit-mask-image: radial-gradient(circle closest-side at 50% 49.3%, transparent 74%, #000 76%, #000 86%, transparent 88%);
    mask-image: radial-gradient(circle closest-side at 50% 49.3%, transparent 74%, #000 76%, #000 86%, transparent 88%);
    opacity: var(--metal-glint, .12);
}
.user-center-achievement-medal .achievement-medal-token > .tutorial-medal-emblem { transform: translateZ(calc(var(--medal-depth) / 2)); }
.user-center-achievement-medal .achievement-medal-token > .achievement-medal-back { transform: rotateY(180deg) translateZ(calc(var(--medal-depth) / 2)); }
.achievement-medal-rim-facet {
    position: absolute;
    left: 50%; top: 49.3%;
    /* Match the opaque gold edge of the accepted image, not its soft shadow. */
    width: calc(var(--achievement-medal-size) * .043);
    height: var(--medal-depth);
    background: linear-gradient(to bottom, var(--rim-shadow, #96703c) 0%, var(--rim-crest, #f4dfb6) 12%, var(--rim-tone) 29%, var(--rim-tone) 72%, var(--rim-crest, #eed3a0) 89%, var(--rim-shadow, #936b39) 100%);
    transform: translate(-50%, -50%) rotateZ(var(--rim-angle)) translateY(calc(var(--achievement-medal-size) * -.429)) rotateX(90deg);
}
.user-center-achievement-medal .achievement-medal-token > img { width: 100%; height: 100%; }
.user-center-medal-hint { color: #8a8296; font-size: 10px; letter-spacing: .02em; }
.user-center-achievement-medal:focus-visible { outline: 3px solid rgba(225,106,217,.34); outline-offset: 5px; }
.user-center-achievement-details { width: min(100%, 420px); padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; color: var(--ink); background: #f8f7fb; border: 1px solid rgba(78,91,153,.08); border-radius: 20px; animation: userCenterAchievementReveal .22s ease both; }
.user-center-achievement-details[hidden] { display: none; }
.user-center-achievement-copy { min-width: 0; display: grid; gap: 5px; }
.user-center-achievement-copy > span { color: #b54b9c; font-size: 9px; }
.user-center-achievement-copy > p { color: #746c80; }
.user-center-achievement-unlocked { min-height: 28px; padding: 0 10px; color: #9b476e; background: #f6eaf2; }
.user-center-achievement-actions { display: grid; justify-items: end; gap: 9px; }
.user-center-achievement-replay { color: #4e5b99; background: #fff; border-color: rgba(78,91,153,.2); }
.user-center-achievement-replay:hover { color: #9b3f87; background: #fffafd; border-color: rgba(225,106,217,.42); }
@keyframes userCenterAchievementReveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
    .user-center-dialog[open] { border-radius: 22px; }
    .user-center-heading { padding: 20px 18px 16px; }
    .user-center-heading h2 { font-size: 22px; }
    .user-center-body { padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); gap: 22px; }
    .user-center-profile { min-height: 184px; padding: 8px 12px 20px; gap: 12px; }
    .user-center-avatar-stage { width: 112px; height: 112px; }
    .user-center-avatar { width: 112px; height: 112px; flex-basis: 112px; border-radius: 50%; font-size: 34px; }
    .user-center-avatar-edit { right: -2px; bottom: 2px; width: 36px; height: 36px; min-height: 0; }
    .user-center-identity > strong { font-size: 21px; }
    .user-center-section-heading h3 { font-size: 17px; }
    .user-center-section-heading p { max-width: 220px; line-height: 1.45; }
    .user-center-achievement-card { min-height: 128px; padding-top: 0; grid-template-columns: 1fr; gap: 8px; border-radius: 0; }
    .user-center-achievement-medal { width: 104px; height: 104px; }
    .user-center-achievement-medal img { width: 98px; height: 98px; }
    .user-center-achievement-medal .achievement-medal-stage { --achievement-medal-size: 98px; }
    .user-center-achievement-details { padding: 16px; grid-template-columns: 1fr; gap: 13px; border-radius: 18px; }
    .user-center-achievement-copy > strong { font-size: 21px; }
    .user-center-achievement-copy > p { font-size: 10px; }
    .user-center-achievement-actions { grid-template-columns: auto 1fr; align-items: center; justify-items: start; }
}

/* A saved visual direction is quiet context, not a second creation card. */
body.workbench-open .workbench-stage--settings #production-style-card {
    display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:12px; margin:4px 0 8px; padding:0;
    min-height:36px; background:transparent; border:0; border-radius:0; box-shadow:none;
}
body.workbench-open #production-style-card > div { display:flex; align-items:center; gap:9px; min-width:0; flex:1; }
body.workbench-open #production-style-card .setting-card-badge { flex:none; padding:0; margin:0; background:none; border:0; color:var(--world-muted,#b9b0c1); font-size:12px; font-weight:400; }
body.workbench-open #production-style-card h3,body.workbench-open #production-style-description { display:none; }
body.workbench-open #production-style-tags { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0; color:#bdc5e6; font-size:12px; line-height:1.5; }
body.workbench-open #production-style-tags span { display:inline; background:none; border:0; border-radius:0; padding:0; margin:0; font-size:inherit; font-weight:500; color:inherit; }
body.workbench-open #production-style-tags span + span::before { content:' · '; color:var(--world-muted,#b9b0c1); }
body.workbench-open #production-style-card > button { flex:none; width:auto; min-width:44px; min-height:36px; padding:6px 0 6px 8px; background:none; border:0; border-radius:6px; box-shadow:none; color:var(--world-muted,#b9b0c1); font-size:12px; font-weight:400; }
body.workbench-open #production-style-card > button:hover { color:#bdc5e6; }

/* Slow text sheen for active work; no flashing or movement of the layout. */
@keyframes pb-working-sheen { from { background-position:180% 0; } to { background-position:-80% 0; } }
.pb-text-working { --pb-sheen-base:#747c96; --pb-sheen-light:#b7c2ff; color:var(--pb-sheen-base); }
@supports ((background-clip:text) or (-webkit-background-clip:text)) {
    .pb-text-working { background-image:linear-gradient(105deg,var(--pb-sheen-base) 34%,var(--pb-sheen-light) 50%,var(--pb-sheen-base) 66%); background-size:240% 100%; background-clip:text; -webkit-background-clip:text; color:transparent; -webkit-text-fill-color:transparent; animation:pb-working-sheen 2.8s linear infinite; }
}
@media (prefers-reduced-motion:reduce) { .pb-text-working { animation:none; background:none; color:var(--pb-sheen-base); -webkit-text-fill-color:currentColor; } }

/* World extraction keeps character voice separate from visual description. */
.setting-extraction-item-fields label.setting-extraction-voice:last-child,
body.workbench-open .setting-extraction-item-fields label.setting-extraction-voice:last-child { grid-column: 1 / -1; }

/* Keep the existing-world action compact and readable on small screens. */
body.workbench-open .world-heading-actions #extract-settings {
    width: auto; min-width: 0; min-height: 38px; padding: 0 10px;
    margin: 0; gap: 6px; white-space: nowrap;
}
body.workbench-open .world-heading-actions #extract-settings strong { display: inline; }

/* World generation remains one primary action; re-organizing is a quiet utility. */
.world-reorganize-action { margin-inline-start: auto; padding: 6px 0; border: 0; background: none; color: var(--text-muted, #9995aa); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.world-reorganize-action:hover { color: var(--text-primary, #dedbec); }
.world-reorganize-action:disabled { opacity: .45; cursor: default; }
.world-batch-quote-summary { margin: 0 0 18px; font-size: 14px; line-height: 1.7; color: var(--text-secondary, #9995aa); max-height: 160px; overflow-y: auto; overflow-wrap: anywhere; }

/* Music Lab: pixel turntable, shared desk lighting, one deliberate needle-drop. */
.creation-tool--turntable { --tool-rotation:-3deg;left:12%;top:53%;width:clamp(162px,15vw,200px); }
.creation-tool--turntable .creation-tool-popover {left:86%;top:-15%;}
.creation-turntable-arm {position:absolute;inset:0;z-index:5;width:100%;height:100%;pointer-events:none;image-rendering:pixelated;clip-path:polygon(73.7% 37%,77% 37%,77% 42%,73% 48%,70% 54%,69% 58%,66% 64%,60.2% 63%,60.2% 58%,66% 53%,70% 44%);transform-origin:75.1% 39%;transform:rotate(-7deg);transition:transform .5s steps(7,end);}
.creation-turntable-disc {position:absolute;z-index:3;left:26%;top:28%;width:39%;height:32%;border-radius:50%;overflow:hidden;transform:rotate(4deg);pointer-events:none;mix-blend-mode:screen;}
.creation-turntable-disc>span {position:absolute;left:0;top:-12%;width:100%;height:124%;border-radius:50%;background:conic-gradient(from 30deg,transparent 0 32%,#b0a1dc52 35%,transparent 38% 80%,#87bcef40 84%,transparent 90%);animation:creation-vinyl-turn 2.7s linear infinite;animation-play-state:paused;opacity:.65;}
.creation-turntable-light {position:absolute;z-index:6;left:22.6%;top:65.8%;width:1.6%;height:2%;background:#ff8bdd;opacity:.35;box-shadow:0 0 7px 2px #e16ad966;pointer-events:none;transition:opacity .3s;}
.creation-tool--turntable:hover .creation-turntable-light,.creation-tool--turntable:focus-visible .creation-turntable-light {opacity:1;}
.creation-tool--turntable.is-activating .creation-turntable-arm {transform:rotate(13deg);}
.creation-tool--turntable.is-activating .creation-turntable-disc>span {animation-play-state:running;opacity:1;}
.creation-tool--turntable.is-activating .creation-turntable-light {opacity:1;box-shadow:0 0 9px 3px #e16ad9aa;}
.creation-tool--turntable.is-activating .creation-tool-object {animation-duration:.92s;}
@keyframes creation-vinyl-turn {to{transform:rotate(360deg);}}
@media(max-width:740px){.creation-tool--turntable{left:9%;top:52%;width:clamp(130px,37vw,157px);}.creation-tool--turntable .creation-tool-popover{left:72%;top:-31%;width:min(195px,48vw);}}
@media(prefers-reduced-motion:reduce){.creation-turntable-arm{transition:none}.creation-turntable-disc>span{animation:none}.creation-tool--turntable.is-activating .creation-tool-object{animation:none}}
