/* Reusable primitives and responsive Pixso compositions. Values live in design-tokens.css. */
.ui-brand { text-decoration: none; color: var(--color-text); gap: var(--space-3); }
.ui-brand .brand-mark { display: grid; place-items: center; background: transparent; border-radius: 0; box-shadow: none; }
.ui-brand .brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.ui-brand .brand-sub { display: block; margin-top: 3px; color: var(--color-muted); font-size: 9px; letter-spacing: .16em; }
.ui-button { justify-content: center; gap: var(--space-2); border-radius: var(--radius-sm); transition: background var(--motion-fast), transform var(--motion-fast); }
.ui-button.primary { background: var(--gradient-action); border-color: transparent; color: var(--color-on-accent); box-shadow: var(--shadow-button); }
.ui-button.primary:hover:not(:disabled) { background: var(--gradient-action); filter: brightness(1.08); }
.ui-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ui-button--ghost { background: transparent; border-color: transparent; }
:is(.ui-button, .nav-link, .settings-trigger, .composer-tools button):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.ui-field .field { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-field); color: var(--color-text); }
.ui-field .field:focus { border-color: var(--color-accent) !important; box-shadow: var(--focus-ring); }
.ui-field .field-label { color: var(--color-text); }
.ui-field .field::placeholder { color: var(--color-muted); }

.login-screen { min-height: 100dvh; display: flex; flex-direction: column; color: var(--color-text); background-color: var(--color-bg); background-image: radial-gradient(ellipse at 8% 0, var(--color-glow), transparent 44%), linear-gradient(var(--color-grid) 1px, transparent 1px), linear-gradient(90deg, var(--color-grid) 1px, transparent 1px); background-size: auto, 80px 80px, 80px 80px; }
.login-header { min-height: 86px; width: 100%; max-width: 1440px; margin: 0 auto; padding: var(--space-5) clamp(24px, 4.4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.login-screen .login-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .85fr); align-items: center; gap: clamp(32px, 5vw, 80px); flex: 1; min-height: 0; width: min(1440px, 100%); margin: 0 auto; padding: var(--space-7) clamp(24px, 4.4vw, 64px); background: transparent; }
.login-screen .login-visual { display: flex; flex-direction: column; justify-content: flex-start; gap: var(--space-6); min-height: 0; padding: 0; color: var(--color-text); border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.login-screen .login-visual::before, .login-screen .login-visual::after { content: none; }
.login-eyebrow { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-2); padding: 7px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-accent); font-size: var(--font-size-caption); background: var(--color-surface); }
.login-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); }
.login-screen .visual-copy { max-width: 660px; margin: 0; }
.login-screen .visual-copy h1 { margin: 0 0 var(--space-5); color: var(--color-text); font-size: clamp(32px, 3.8vw, 52px); font-weight: 600; line-height: 1.3; letter-spacing: -.045em; }
.login-screen .visual-copy h1 span { color: var(--color-accent); }
.login-screen .visual-copy p { max-width: 560px; margin: 0; color: var(--color-muted); font-size: 14px; line-height: 1.8; }
.login-features { display: grid; gap: var(--space-5); }
.login-feature { display: flex; gap: var(--space-3); align-items: flex-start; }
.login-feature > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface)); color: var(--color-accent); }
.login-feature h2 { margin: 0 0 5px; font-size: var(--font-size-body); font-weight: 600; }
.login-feature p { margin: 0; color: var(--color-muted); font-size: 12px; line-height: 1.7; }
.login-screen .visual-note { color: var(--color-muted); font-size: var(--font-size-caption); }
.login-screen .login-panel { min-width: 0; width: 100%; padding: var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-panel); }
.login-screen .login-box { width: 100%; max-width: 440px; }
.login-form-heading { margin-bottom: var(--space-6); }
.login-screen .login-box h2 { margin: var(--space-3) 0 var(--space-2); color: var(--color-text); font-size: 23px; line-height: 1.5; letter-spacing: -.03em; }
.login-screen .login-box .intro { margin: 0; color: var(--color-muted); font-size: 12px; line-height: 1.8; }
.login-screen .form-group { margin-bottom: var(--space-5); }
.login-screen .login-submit { display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; height: 48px; min-height: 48px; margin: var(--space-2) 0 0; padding: 0 var(--space-5); border-radius: var(--radius-md); font-size: 14px; font-weight: 600; line-height: 1.4; }
.login-screen .login-submit > .icon { order: 1; flex: 0 0 18px; width: 18px; height: 18px; }
.login-screen .login-submit > span { flex: 0 1 auto; min-width: 0; font: inherit; text-align: center; }
.login-screen .login-footnote { margin: var(--space-5) 0 0; color: var(--color-muted); line-height: 1.8; font-size: var(--font-size-caption); }
.login-screen .error-banner { margin: 0 0 var(--space-5); background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface)); color: var(--color-danger); }
.login-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); width: min(1440px, 100%); padding: var(--space-5) clamp(24px, 4.4vw, 64px); margin: 0 auto; font-size: var(--font-size-caption); color: var(--color-muted); }

/* Both creation screens use the same composer DOM and dimensions. */
.studio-composer { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; min-width: 0; }
.studio-composer .composer-topline { margin: 0; }
.studio-composer .studio-settings { margin: 0; align-items: stretch; gap: var(--space-2); }
.studio-composer .ui-select { min-width: 0; border-radius: var(--radius-sm); }
.studio-composer .ui-select .setting-copy { min-width: 0; width: 100%; }
.studio-composer .settings-trigger { width: 100%; min-width: 0; }
.studio-composer .settings-trigger-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-composer .composer-submit-row { padding-top: var(--space-2); }
.studio-composer .composer-help { margin: 0; padding: 0; color: var(--color-muted); }
.studio-composer .composer-help p { margin: 0; font-size: 9px; line-height: 1.5; }
.studio-composer .image-composer-note, .studio-composer .image-api-status:not(.is-error) { display: none; }
.studio-composer .image-api-status.is-error { color: var(--color-danger); }
.studio-kicker { display: block; margin-bottom: var(--space-2); color: var(--color-accent-2); }
/* Explicitly bridge older feature selectors to the shared theme. */
:root[data-theme] .app-shell.app-shell--topnav { background-color: var(--color-bg); }
:root[data-theme] .app-shell--topnav :is(.main-area, .page-content):has(.video-studio--stacked),
:root[data-theme] .app-shell--topnav :is(.main-area, .page-content):has(.image-workspace--stacked) { background-color: transparent; color: var(--color-text); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-feed-heading { background: linear-gradient(var(--color-bg) 78%, transparent); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-composer { background: transparent; color: var(--color-text); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane,
:root[data-theme] .app-shell--topnav .image-workspace--stacked .image-composer { border-color: var(--color-border); background: var(--color-surface); color: var(--color-text); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-result-detail { border-color: var(--color-border); background: var(--color-surface); }
:root[data-theme] .app-shell--topnav .image-workspace--stacked .image-output { border-color: transparent; background: transparent; }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-result-detail .video-result-stage,
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-result-player { background: var(--color-media-bg); }
:root[data-theme] .app-shell--topnav .studio-composer .ui-select,
:root[data-theme] .app-shell--topnav .studio-composer .video-duration-compact { border-color: var(--color-border); background: var(--color-raised); color: var(--color-text); }
:root[data-theme] .app-shell--topnav .studio-composer :is(.settings-trigger, .video-duration-compact output) { color: var(--color-text); }
:root[data-theme] .app-shell--topnav .studio-composer :is(.setting-copy small, .video-duration-compact small, .char-count, .composer-help p) { color: var(--color-muted); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane .video-settings-grid .setting-select { border-color: var(--color-border); background: var(--color-raised); color: var(--color-text); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane .video-settings-grid .settings-trigger { color: var(--color-text); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane .video-settings-grid .setting-copy small { color: var(--color-muted); }
:root[data-theme] .app-shell--topnav .studio-composer .prompt-editor { border-color: var(--color-border); background: var(--color-field); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 8%, transparent); }
:root[data-theme] .app-shell--topnav .studio-composer .prompt-editor:focus-within { border-color: var(--color-accent); box-shadow: var(--focus-ring); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane .mention-field:has(.video-prompt) .prompt-editor { border-color: var(--color-border); background: var(--color-field); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 8%, transparent); }
:root[data-theme] .app-shell--topnav .video-studio--stacked .video-create-pane .mention-field:has(.video-prompt) .prompt-editor:focus-within { border-color: var(--color-accent); box-shadow: var(--focus-ring); }
:root[data-theme] .app-shell--topnav .studio-composer .prompt-reference { background: var(--color-selected); color: var(--color-accent); }
:root[data-theme] .app-shell--topnav .studio-composer .write-prompt { color: var(--color-accent); }
:root[data-theme] .shared-reference-upload-button,
:root[data-theme] .creative-reference-item { border-color: var(--color-border); background: var(--color-raised); color: var(--color-text); }
:root[data-theme] .shared-reference-upload-button:hover,
:root[data-theme] .creative-reference-actions button:hover { border-color: var(--color-accent); background: var(--color-hover); color: var(--color-accent); }
:root[data-theme] :is(.shared-reference-plus, .shared-reference-mini-icon, .creative-reference-preview, .creative-reference-audio-icon, .creative-reference-file-icon) { background: var(--color-selected); color: var(--color-accent); }
:root[data-theme] :is(.shared-reference-expand, .creative-reference-name, .creative-reference-empty, .shared-reference-upload-button > small) { color: var(--color-muted); }
:root[data-theme] .shared-reference-mini { border-color: var(--color-border); background: var(--color-raised); }
:root[data-theme] .shared-reference-mini-count { background: var(--color-accent); color: var(--color-on-accent); }
:root[data-theme] .creative-reference-actions button { border-color: var(--color-border); background: var(--color-surface); color: var(--color-muted); }
:root[data-theme] .app-shell--topnav .video-studio--stacked :is(.video-download, .video-tail-frame) { border-color: var(--color-border); background: var(--color-raised); color: var(--color-text); }
:root[data-theme] .task-log-button { border-color: var(--color-border); background: var(--color-raised); color: var(--color-muted); }
:root[data-theme] .task-log-button:hover { border-color: var(--color-accent); background: var(--color-hover); color: var(--color-accent); }
:root[data-theme] .task-log-dialog { border-color: var(--color-border); background: var(--color-surface); color: var(--color-text); }
:root[data-theme] .task-log-dialog > header,
:root[data-theme] .task-log-content details { border-color: var(--color-border); }
:root[data-theme] .task-log-content summary,
:root[data-theme] .task-log-toolbar [role=tablist] { background: var(--color-field); }
:root[data-theme] .task-log-toolbar [aria-selected=true] { background: var(--color-selected); color: var(--color-accent); }
:root[data-theme] .task-log-content pre { color: var(--color-text); }
.video-studio--stacked .video-create-pane, .image-workspace--stacked .image-composer { z-index: var(--z-composer); border-radius: var(--radius-lg); }
.video-studio--stacked .video-composer, .image-workspace--stacked .image-composer { font-family: var(--font-sans); }
.video-studio--stacked .composer-submit-row .generate-button,
.image-workspace--stacked .composer-submit-row .generate-button { background: var(--gradient-creative) !important; color: var(--color-on-creative) !important; box-shadow: var(--shadow-button) !important; }
.video-studio--stacked .composer-submit-row .generate-button:disabled,
.image-workspace--stacked .composer-submit-row .generate-button:disabled { background: var(--color-raised) !important; color: var(--color-muted) !important; box-shadow: none !important; }
.video-studio--stacked .composer-submit-row .generation-action.is-counting,
.image-workspace--stacked .composer-submit-row .generation-action.is-counting { border-color: var(--color-border); background: var(--color-raised); box-shadow: none; }
.video-studio--stacked .composer-submit-row .generation-cancel,
.image-workspace--stacked .composer-submit-row .generation-cancel { border-color: var(--color-border); background: var(--color-surface); color: var(--color-text); }
.video-studio--stacked .composer-submit-row .generation-action.is-counting .generate-button,
.image-workspace--stacked .composer-submit-row .generation-action.is-counting .generate-button { background: var(--gradient-creative) !important; color: var(--color-on-creative) !important; }
.settings-dropdown { z-index: var(--z-popover); border-radius: var(--radius-md); }
:root[data-theme] .settings-dropdown,
:root[data-theme] .settings-panel-header,
:root[data-theme] .shared-reference-dialog { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
:root[data-theme] .settings-choice { background: var(--color-raised); color: var(--color-text); border-color: var(--color-border); }
:root[data-theme] .settings-choice.is-selected { background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface)); color: var(--color-accent); border-color: var(--color-accent); }
:root[data-theme] .settings-choice-check { color: var(--color-accent); }
.creative-reference-shelf.is-expanded.ui-floating-shelf { position: fixed; inset: auto; z-index: var(--z-popover); margin: 0; max-height: 122px; border-radius: var(--radius-md); box-shadow: var(--shadow-panel); }
:root[data-theme] .creative-reference-shelf.is-expanded.ui-floating-shelf { border-color: var(--color-border); background: var(--color-surface); color: var(--color-text); }
:root[data-theme] .creative-reference-shelf.is-expanded.ui-floating-shelf header { border-color: var(--color-border); color: var(--color-muted); }
:root[data-theme] .creative-reference-shelf.is-expanded.ui-floating-shelf header button { color: var(--color-muted); }
.credit-dialog-backdrop, .project-dialog-backdrop, .image-preview-backdrop, .workspace-menu-backdrop { z-index: var(--z-modal); }

/* Responsive cards replace the export's per-node coordinates. */
.video-studio--stacked .video-result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; gap: var(--space-4); }
.video-studio--stacked .video-result-detail { position: relative; min-width: 0; padding: var(--space-3); gap: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: none; }
.video-studio--stacked .video-result-stage { order: -1; width: 100%; height: 180px; min-height: 180px; aspect-ratio: auto; border-radius: var(--radius-sm); }
.video-studio--stacked .video-result-heading { align-items: flex-start; gap: var(--space-2); }
.video-studio--stacked .video-result-title h2 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
.video-studio--stacked .video-result-heading p { font-size: 9px; line-height: 1.6; }
.video-studio--stacked .video-result-state { flex: 0 0 auto; max-width: 96px; }
.video-studio--stacked .video-result-state .video-timing-summary { font-size: 8px; }
.video-studio--stacked .video-result-footer { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); }
.video-studio--stacked .video-result-footer > p { margin: 0; min-height: 30px; }
.video-studio--stacked .video-download-group { align-items: stretch; }
.video-studio--stacked .video-download { justify-content: center; }
.video-open-preview { position: absolute; z-index: 3; top: var(--space-2); left: var(--space-2); display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgb(255 255 255 / 20%); border-radius: var(--radius-sm); background: rgb(7 11 20 / 70%); color: var(--color-on-accent); }
.video-open-preview:hover { background: var(--color-accent); }
.video-card-enhancement { border-top: 1px solid var(--color-border); padding-top: var(--space-2); }
.video-card-enhancement > summary { display: flex; align-items: center; justify-content: space-between; color: var(--color-muted); font-size: 10px; cursor: pointer; list-style: none; }
.video-card-enhancement > summary::-webkit-details-marker { display: none; }
.video-card-enhancement .video-super-resolution { margin-top: var(--space-3); }
.video-card-enhancement .video-super-resolution > header { flex-wrap: wrap; }
.video-card-enhancement .video-super-resolution .btn { max-width: 100%; white-space: normal; height: auto; min-height: 35px; }
.video-studio--stacked .video-result-processing { padding: var(--space-3); }
.video-studio--stacked .video-result-processing p { font-size: 10px; }
.video-studio--stacked .video-result-error { max-height: 100%; overflow: auto; }

@media (max-width: 1000px) {
 .login-screen .login-page { grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); gap: var(--space-6); }
 .login-screen .visual-copy h1 { font-size: 36px; }
 .login-feature p { font-size: 11px; }
}
@media (max-width: 760px) {
 .login-header { min-height: 72px; padding: var(--space-4) var(--space-5); }
 .login-header .brand-sub { display: none; }
 .login-header .theme-toggle button { padding: 6px; }
 .login-header .theme-toggle button span { display: none; }
 .login-screen .login-page { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-6); padding: var(--space-5); }
 .login-screen .login-visual { display: flex; gap: var(--space-4); }
 .login-screen .visual-copy h1 { font-size: 30px; margin-bottom: var(--space-3); }
 .login-screen .visual-copy p { font-size: 12px; }
 .login-features, .login-screen .visual-note { display: none; }
 .login-screen .login-panel { min-height: 0; padding: var(--space-5); border-radius: var(--radius-lg); }
 .login-screen .login-box h2 { font-size: 20px; }
 .login-screen .login-submit { padding: 0 var(--space-4); }
 .login-footer { padding: var(--space-5); font-size: 10px; }
 .video-studio--stacked .video-result-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
 .ui-button, .studio-composer * { transition-duration: 0s; }
}
