/* Workspace clarity pass: one primary task per mode, secondary controls on demand. */
a.mode-button-icon, a.mobile-service-action { text-decoration: none; }
#music-view[hidden] { display:none !important; }
.creative-composer {
    top: auto;
    height: auto;
    grid-template-columns: minmax(0,1fr) auto 48px;
    grid-template-rows: auto auto auto;
}
.creative-composer__tools { justify-content: space-between; }
.creative-mode-label { display: none !important; }
.creative-generation-cost { position:relative; align-self:end; }
.creative-generation-price { display: inline-flex; min-width: 66px; height: 48px; align-items: center; justify-content:center; gap:7px; padding:0 4px; border:0; border-radius:12px; background:transparent; color:var(--text-main); font-size:13px; font-weight:900; white-space:nowrap; cursor:pointer; }
.creative-generation-price b { color:#ffbb45; font-size:14px; font-weight:900; }
.creative-generation-price .creative-credit-hex { width:21px; height:21px; }
.creative-generation-price:hover,.creative-generation-price[aria-expanded="true"] { background:color-mix(in srgb,var(--primary) 9%,transparent); }
.creative-generation-price:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.creative-generation-price__chevron { color:var(--text-secondary); font-size:8px; transition:transform .16s ease; }
.creative-generation-price[aria-expanded="true"] .creative-generation-price__chevron { transform:rotate(180deg); }
.creative-generation-cost-details { position:absolute; z-index:80; right:0; bottom:calc(100% + 10px); display:grid; width:min(340px,calc(100vw - 24px)); overflow:hidden; border:1px solid color-mix(in srgb,var(--border-color) 72%,#fff 28%); border-radius:18px; background:linear-gradient(145deg,#17181b 0%,#0d0e10 72%); color:var(--text-main); box-shadow:0 30px 85px rgba(0,0,0,.72),inset 0 1px 0 rgba(255,255,255,.035); }
.creative-generation-cost-details[hidden] { display:none; }
.creative-generation-cost-details__head { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:10px; padding:14px 15px 12px; border-bottom:1px solid color-mix(in srgb,var(--border-color) 78%,transparent); background:rgba(255,255,255,.018); }
.creative-generation-cost-details__head>span:last-child { display:grid; gap:2px; }
.creative-generation-cost-details__head strong { font-size:.84rem; }
.creative-generation-cost-details__head small,.creative-generation-cost-details__row small,.creative-generation-cost-details__total small { color:var(--text-secondary); font-size:.63rem; font-weight:500; }
.creative-generation-cost-details__row,.creative-generation-cost-details__total { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:10px; min-height:58px; padding:10px 15px; font-size:.74rem; }
.creative-generation-cost-details__row+.creative-generation-cost-details__row { border-top:1px solid color-mix(in srgb,var(--border-color) 54%,transparent); }
.creative-generation-cost-details__copy { display:grid; min-width:0; gap:2px; }
.creative-generation-cost-details__copy b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.creative-generation-cost-details__copy em { color:inherit; font-size:.65rem; font-style:normal; }
.creative-generation-cost-details__icon { display:grid !important; width:36px; height:36px; place-items:center; border:1px solid var(--border-color); border-radius:11px; background:#191a1e; color:var(--text-secondary); }
.creative-generation-cost-icon { width:19px; height:19px; }
.creative-generation-cost-details__row strong { font-variant-numeric:tabular-nums; white-space:nowrap; }
.creative-generation-cost-details__row.is-discount b,.creative-generation-cost-details__row.is-discount strong { color:#65d792; }
.creative-generation-cost-details__row.is-pro .creative-generation-cost-details__icon { border-color:color-mix(in srgb,#ffbb45 44%,var(--border-color)); background:color-mix(in srgb,#ffbb45 9%,#151619); color:#ffbb45; }
.creative-generation-cost-details__row.is-patch .creative-generation-cost-details__icon { border-color:color-mix(in srgb,#65d792 42%,var(--border-color)); background:color-mix(in srgb,#65d792 8%,#151619); color:#65d792; }
.creative-generation-cost-details__row.is-muted { color:var(--text-secondary); }
.creative-generation-cost-details__total { margin-top:2px; border-top:1px solid color-mix(in srgb,var(--primary) 36%,var(--border-color)); background:linear-gradient(90deg,color-mix(in srgb,var(--primary) 13%,#101113),#101113); }
.creative-generation-cost-details__total .creative-generation-cost-details__icon { border-color:color-mix(in srgb,var(--primary) 50%,var(--border-color)); background:color-mix(in srgb,var(--primary) 10%,#151619); color:var(--primary); }
.creative-generation-cost-details__total>strong { display:inline-flex; align-items:center; gap:6px; color:#ffbb45; font-size:1rem; font-variant-numeric:tabular-nums; }
.creative-generation-cost-details__total .creative-credit-hex { width:18px; height:18px; }
.creative-generation-cost-details__empty { padding:14px 15px; color:var(--text-secondary); font-size:.74rem; }
.creative-parameter-chips { display:flex; min-width:0; flex:1 1 auto; flex-wrap:nowrap; gap:6px; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--primary) 44%,transparent) transparent; }
.creative-parameter-chips::-webkit-scrollbar,.creative-native-reference-tray::-webkit-scrollbar,.creative-selected-tags::-webkit-scrollbar { height:4px; }
.creative-parameter-chips::-webkit-scrollbar-thumb,.creative-native-reference-tray::-webkit-scrollbar-thumb,.creative-selected-tags::-webkit-scrollbar-thumb { border-radius:99px; background:color-mix(in srgb,var(--primary) 44%,transparent); }
.creative-parameter-chips > button { display:inline-flex; min-width:max-content; max-width:250px; min-height:34px; flex:0 0 auto; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-main); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.creative-parameter-chips > button b { overflow:hidden; font-weight:800; text-overflow:ellipsis; }
.creative-parameter-chips > button:hover { border-color:color-mix(in srgb,var(--primary) 55%,var(--border-color)); background:var(--primary-glow); }
.creative-parameter-chips > button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.creative-parameter-chips > button i { margin-left:2px; color:var(--primary); font-size:8px; }
.creative-parameter-chips small { color: var(--text-secondary); font-size: 9px; }
.creative-parameter-chips > button:is([data-settings-target$="-provider"],[data-settings-target$="-model"]) > .fa-chevron-down { display:none; }
.creative-parameter-chips > button:is([data-settings-target$="-provider"],[data-settings-target$="-model"]) { padding-inline:9px; }
.creative-parameter-chips > .creative-parameter-chip--icon { position:relative; width:38px; min-width:38px; max-width:38px; justify-content:center; padding:0; gap:0; }
.creative-parameter-chip--icon > .fa-chevron-down { display:none; }
.creative-parameter-chip__symbol { margin:0 !important; color:var(--text-main) !important; font-size:14px !important; }
.creative-parameter-chip__ratio { display:block; flex:none; border:1.5px solid currentColor; border-radius:3px; color:var(--text-main); }
.creative-parameter-chip__count { position:absolute; top:2px; right:2px; display:grid; min-width:13px; height:13px; place-items:center; padding:0 3px; border-radius:99px; background:var(--primary); color:#15110a; font-size:8px; font-weight:900; }
.creative-parameter-chip__mobile-symbol { display:none; }
.creative-model-chip__icon { display:block; width:18px; height:18px; flex:0 0 18px; object-fit:contain; opacity:.92; }
.creative-composer > .creative-context-bar { position: static; grid-column: 1/-1; display: flex; min-height: 0; overflow-x: auto; }
.creative-composer > .creative-context-bar[hidden] { display: none; }
.creative-composer > .creative-context-bar > span { grid-template-columns: 48px auto 28px; min-height: 58px; }
.creative-composer > .creative-context-bar img { width: 48px; height: 48px; border-radius: 10px; }

/* The left rail is intentionally static: brand, vertical wordmark and profile only. */
#left-panel-toggle { display: none !important; }
.controls-panel { overflow: hidden !important; }
.controls-panel > :is(#profile-stats-view,#text-chat-sidebar-view,#controls-container) { display: none !important; }
.shell-vertical-name { flex: 1 1 auto; display: grid; place-items: center; color: var(--primary); font-family:'Bowler',sans-serif; font-size: 13px; font-weight: 500; letter-spacing: .24em; writing-mode: vertical-rl; transform: rotate(180deg); user-select: none; }

/* Full settings use a centered modal; the prompt and submit stay in the chat. */

@media (min-width: 992px) {
    /* Never infer visibility from an inline style containing the word "flex". */
    body:not(.app-mode-text) .controls-panel > #text-chat-sidebar-view,
    body:not(.app-mode-pose_studio) .controls-panel #pose-scene-sidebar-view {
        display: none !important;
    }

    body.app-mode-studio .controls-panel > #controls-container,
    body.app-mode-video .controls-panel > #controls-container,
    body.app-mode-music_gallery .controls-panel > #controls-container,
    body.app-mode-music_cover .controls-panel > #controls-container {
        display: none !important;
    }
    body.left-panel-expanded.app-mode-studio .controls-panel > #controls-container,
    body.left-panel-expanded.app-mode-video .controls-panel > #controls-container,
    body.left-panel-expanded.app-mode-music_gallery .controls-panel > #controls-container,
    body.left-panel-expanded.app-mode-music_cover .controls-panel > #controls-container {
        display: flex !important;
    }

    /* Prompt and primary action live only in the central chat composer. */
    body.creative-chat-active .controls-panel :is(#prompt-input, #video-prompt-group, #music-lyrics-vocal, #cover-prompt-input),
    body.creative-chat-active .controls-panel :is(#generate-button, #generate-video-button, #generate-music-button, #generate-cover-button),
    body.creative-chat-active .controls-panel :is(#generate-video-button, #generate-music-button, #generate-cover-button) {
        display: none !important;
    }
    body.creative-chat-active .controls-panel :is(#generate-video-button, #generate-music-button, #generate-cover-button) + * { margin-top: 0 !important; }

    body.app-mode-pose_studio .generation-space { min-width: 0; }
}

.pose-scene-sidebar-view { min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 16px; padding: 8px 2px; }
.pose-scene-sidebar-view__head { display: grid; gap: 4px; padding: 8px; }
.pose-scene-sidebar-view__head small { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.pose-scene-sidebar-view__head strong { color: var(--text-main); font-size: 22px; }
.pose-scene-sidebar-view > p { margin: -8px 8px 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.pose-scene-sidebar-view nav { display: grid; gap: 8px; }
.pose-scene-sidebar-view nav button { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 10px; min-height: 62px; padding: 9px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-input); color: var(--text-secondary); text-align: left; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.pose-scene-sidebar-view nav button > i { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: var(--bg-card); }
.pose-scene-sidebar-view nav button span { display: grid; min-width: 0; }
.pose-scene-sidebar-view nav button strong { color: var(--text-main); font-size: 13px; }
.pose-scene-sidebar-view nav button small { margin-top: 2px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pose-scene-sidebar-view nav button:is(:hover,.active) { border-color: color-mix(in srgb,var(--primary) 55%,var(--border-color)); background: var(--primary-glow); color: var(--primary); }
.pose-scene-sidebar-view__tip { display: flex; gap: 10px; margin-top: auto; padding: 12px; border: 1px solid var(--border-color); border-radius: 14px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.pose-scene-sidebar-view__tip i { color: var(--primary); }

/* Community authors are content filters, not generation controls. */
body.app-mode-community .generation-space { overflow: hidden; }
body.app-mode-community #community-gallery-grid { flex: 1 1 auto; min-height: 0; width: min(100%,1280px); margin-inline: auto; overflow-y: auto; }

/* Songwriter keeps its complete legacy workflow in the central area. */

/* Brand-led welcome without a decorative emoji tile. */
.creative-welcome__mark.creative-welcome__logo { position:relative; width:74px; height:74px; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; }
.creative-welcome__logo img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.creative-welcome h1 { margin-top:6px; font-family:'Bowler',sans-serif !important; font-size:clamp(1.55rem,3vw,2.45rem) !important; font-weight:500 !important; letter-spacing:.015em; }
.creative-composer:focus-within { border-color:var(--border-color) !important; outline:0 !important; box-shadow:0 24px 70px rgba(0,0,0,.36) !important; }
.creative-composer > textarea:is(:focus,:focus-visible) { border:0 !important; outline:0 !important; box-shadow:none !important; }

/* References belong to the composer and never open the settings dialog. */
.creative-composer__tools { min-width:0; }
.creative-native-reference-tray { display:flex; flex:1 1 auto; min-width:0; gap:7px; padding-bottom:3px; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--primary) 44%,transparent) transparent; }
.creative-native-reference-tray[hidden] { display:none !important; }
.creative-native-reference-tray > span { position:relative; flex:0 0 42px; width:42px; height:42px; overflow:hidden; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-card); }
.creative-native-reference-tray :is(img,video) { display:block; width:100%; height:100%; object-fit:cover; }
.creative-native-reference-tray small { position:absolute; right:3px; bottom:3px; display:grid; width:15px; height:15px; place-items:center; border-radius:5px; background:rgba(0,0,0,.72); color:#fff; font-size:8px; }
.creative-native-reference-tray .remove-attachment { position:absolute; top:2px; right:2px; display:grid; width:24px; height:24px; place-items:center; padding:0; border:1px solid rgba(255,255,255,.16); border-radius:7px; background:rgba(0,0,0,.84); color:#fff; font-size:13px; line-height:1; }
.creative-native-reference-tray .spinner-border { position:absolute; inset:13px; width:16px; height:16px; color:var(--primary); }
.creative-native-reference-tray > .cover-audio-reference { display:flex; align-items:center; gap:9px; flex-basis:min(280px,100%); width:min(280px,100%); height:48px; padding:5px 34px 5px 10px; }
.cover-audio-reference > i { flex:none; color:var(--primary); font-size:18px; }
.cover-audio-reference > span { min-width:0; }
.cover-audio-reference strong,.cover-audio-reference small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cover-audio-reference strong { color:var(--text-main); font-size:12px; font-weight:600; }
.creative-native-reference-tray .cover-audio-reference small { position:static; width:auto; height:auto; background:none; color:var(--text-secondary); font-size:10px; }
.creative-selected-tags { grid-column:1/-1; display:flex; min-width:0; flex-wrap:nowrap; gap:8px; padding:1px 7px 4px; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--primary) 44%,transparent) transparent; }
.creative-selected-tags[hidden] { display:none !important; }
.creative-selected-tags > span { display:inline-flex; min-width:max-content; min-height:34px; flex:0 0 auto; align-items:center; gap:9px; padding:0 8px 0 11px; border:1px solid rgba(255,187,69,.48); border-radius:7px; background:rgba(132,94,13,.28); color:#ded7c8; font-size:12px; }
.creative-selected-tags b { font-weight:650; }
.creative-selected-tags button { display:grid; width:22px; height:22px; place-items:center; padding:0; border:0; border-radius:6px; background:transparent; color:#aaa49a; font-size:10px; }
.creative-selected-tags button:hover { background:rgba(255,187,69,.12); color:#fff; }
.creative-selected-tags button:focus-visible { outline:2px solid var(--primary); outline-offset:1px; }

/* Gallery cards keep their media ratio and scroll as complete rows. */
.creative-library-grid { min-height:0; align-content:start; grid-auto-rows:max-content; overscroll-behavior:contain; }
.creative-library-grid .creative-asset { align-self:start; min-height:max-content; }
.creative-library-grid .creative-asset > :is(img,video) { display:block; width:100%; height:auto !important; min-height:0; aspect-ratio:1/1; object-fit:cover; }
.creative-library-grid .creative-asset > video { aspect-ratio:16/10; }
.creative-library-grid .creative-asset figcaption { height:auto !important; min-height:46px; }

/* Creative header: mode, familiar balance and one contextual model guide. */
.desktop-workspace-header { display:none; }
.creative-chat-header { display:grid !important; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
.creative-chat-header__start { gap:14px; }
.creative-mode-heading { display:flex !important; align-items:center; gap:7px; font-family:'Bowler',sans-serif; color:var(--text-main); }
.creative-mode-heading span { color:var(--primary); font-size:20px; }
.creative-mode-heading strong { font-size:14px !important; letter-spacing:.08em; }
.creative-header-balance { display:inline-flex; min-height:38px; align-items:center; gap:7px; padding:0 6px; border:0; border-radius:0; background:transparent; color:#ffbb45; font-size:20px; line-height:1; font-weight:900; letter-spacing:-.02em; cursor:pointer; }
.creative-credit-hex { width:23px; height:23px; overflow:visible; fill:rgba(24,178,255,.1); stroke:#19b7ff; stroke-width:2.1; stroke-linejoin:round; filter:drop-shadow(0 0 4px rgba(25,183,255,.9)); animation:creative-balance-glow 2s ease-in-out infinite; }
.creative-header-balance:hover .creative-credit-hex { fill:rgba(24,178,255,.2); }
@keyframes creative-balance-glow { 50% { filter:drop-shadow(0 0 7px rgba(25,183,255,1)); } }
.creative-model-guide { min-height:38px; padding:0 13px; border:1px solid var(--border-color); border-radius:11px; background:var(--bg-input); color:var(--text-secondary); font-size:11px; font-weight:800; }
.creative-model-guide:hover { border-color:color-mix(in srgb,var(--primary) 45%,var(--border-color)); color:var(--primary); }
.creative-composer__meta { min-width:0; align-items:center; overflow:hidden; }
.creative-model-guide--composer { display:inline-grid; width:36px; min-width:36px; min-height:32px; place-items:center; flex:0 0 36px; margin-left:auto; padding:0; border-radius:9px; }
.creative-model-guide--composer > i { margin:0; font-size:15px; line-height:1; }
.creative-parameter-fields__empty { margin:0; color:var(--text-secondary); font-size:.76rem; line-height:1.5; }
.creative-studio-settings { display:grid; gap:12px; max-height:min(430px,56dvh); padding:12px; overflow-y:auto; color:var(--text-main); }
.creative-studio-settings__group { display:grid; gap:7px; }
.creative-studio-settings__group > strong { color:var(--text-secondary); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.creative-studio-settings__options { display:flex; flex-wrap:wrap; gap:6px; }
.creative-studio-settings__options > button { display:inline-flex; min-height:40px; align-items:center; gap:7px; padding:8px 11px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-secondary); font-size:12px; text-align:left; }
.creative-studio-settings__options > button:hover { border-color:color-mix(in srgb,var(--primary) 48%,var(--border-color)); color:var(--text-main); }
.creative-studio-settings__options > button.is-active { border-color:rgba(255,187,69,.78); background:linear-gradient(135deg,rgba(151,104,9,.7),rgba(92,65,8,.62)); color:#fff4d5; }
.creative-studio-settings__options > button.is-subscription-locked { cursor:not-allowed; opacity:.62; }
.creative-studio-settings__options > button i { color:var(--primary); }
.creative-studio-settings__options > button > span:not(.creative-ratio-choice__preview) { flex:1; min-width:0; }
.creative-studio-settings__options .creative-ratio-choice__preview { width:32px; height:32px; flex:0 0 32px; }
.creative-studio-settings__options .creative-ratio-choice__preview i { max-width:27px; max-height:27px; }
.creative-studio-settings__options > button.is-active .creative-ratio-choice__preview i { color:var(--primary) !important; }
.creative-studio-settings__group > .creative-parameter-fields { max-height:none; padding:0; overflow:visible; }
.creative-studio-settings__guide { display:grid; min-height:48px; grid-template-columns:24px minmax(0,1fr) 16px; align-items:center; gap:9px; padding:8px 11px; border:1px solid var(--border-color); border-radius:11px; background:var(--bg-input); color:var(--text-secondary); text-align:left; }
.creative-studio-settings__guide > i:first-child { color:var(--primary); font-size:15px; }
.creative-studio-settings__guide > i:last-child { justify-self:end; font-size:10px; }
.creative-studio-settings__guide span { display:grid; gap:2px; }
.creative-studio-settings__guide b { color:var(--text-main); font-size:12px; }
.creative-studio-settings__guide small { color:var(--text-secondary); font-size:10px; }
.creative-chat-header__actions { justify-self:end; }
/* Inline parameter popover replaces the old settings modal. */
.creative-parameter-menu { position:absolute; z-index:90; isolation:isolate; right:8px; bottom:calc(100% + 8px); left:8px; max-height:min(360px,48dvh); overflow:hidden; border:1px solid rgba(255,187,69,.52); border-radius:16px; background:var(--bg-panel,#151515); box-shadow:0 24px 70px rgba(0,0,0,.78); backdrop-filter:none; }
.creative-parameter-menu[data-key="studio-settings"] { display:flex; max-height:min(620px,calc(100dvh - 180px)); flex-direction:column; }
.creative-parameter-menu[data-key="studio-settings"] .creative-parameter-menu__head { flex:0 0 auto; }
.creative-parameter-menu[data-key="studio-settings"] .creative-studio-settings { min-height:0; max-height:none; flex:1 1 auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.creative-parameter-menu::before { content:""; position:absolute; z-index:-1; inset:0; background:#151515; }
.creative-parameter-menu[hidden] { display:none !important; }
#creative-native-controls[hidden] { display:none !important; }
.creative-parameter-fields { display:grid; gap:8px; max-height:min(290px,calc(48dvh - 54px)); padding:12px; overflow-y:auto; font-size:12px; color:var(--text-main); }
.creative-parameter-fields > label { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.creative-parameter-fields > label > small { color:var(--text-muted); font-size:10px; font-weight:500; font-variant-numeric:tabular-nums; }
.creative-parameter-fields > :is(textarea,input,select) { width:100%; min-height:44px; padding:10px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-main); font:inherit; }
.creative-parameter-fields > textarea { resize:vertical; }
#creative-parameter-menu .creative-parameter-fields :is(textarea,input):focus-visible { outline:0 !important; border-color:color-mix(in srgb,var(--text-secondary) 42%,var(--border-color)) !important; box-shadow:0 0 0 1px rgba(255,255,255,.07) !important; }
.creative-parameter-fields__toggle { display:flex; align-items:center; gap:10px; min-height:44px; cursor:pointer; }
.creative-parameter-fields__toggle input { width:18px; height:18px; flex-shrink:0; accent-color:var(--primary); }
.creative-parameter-menu__head { display:flex; align-items:center; justify-content:space-between; padding:11px 13px; border-bottom:1px solid var(--border-color); }
.creative-parameter-menu__head > div { display:grid; min-width:0; gap:2px; }
.creative-parameter-menu__head strong { font-size:12px; }
.creative-parameter-menu__head small { color:var(--text-secondary); font-size:10px; font-weight:500; line-height:1.35; }
.creative-parameter-menu__head button { display:grid; width:30px; height:30px; place-items:center; border:0; border-radius:8px; background:var(--bg-input); color:var(--text-secondary); }
.creative-parameter-menu__list { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:6px; max-height:300px; padding:9px; overflow-y:auto; }
.creative-parameter-menu__list > button { display:flex; min-height:42px; align-items:center; justify-content:space-between; gap:8px; padding:8px 11px; border:1px solid transparent; border-radius:10px; background:var(--bg-input); color:var(--text-secondary); font-size:12px; text-align:left; }
.creative-parameter-menu__list > button:hover { border-color:color-mix(in srgb,var(--primary) 48%,var(--border-color)); background:#211d15; color:var(--text-main); }
.creative-parameter-menu__list > button.is-active { border-color:rgba(255,187,69,.78); background:linear-gradient(135deg,rgba(151,104,9,.7),rgba(92,65,8,.62)); color:#fff4d5; box-shadow:inset 0 0 0 1px rgba(255,187,69,.1); }
.creative-parameter-menu__list > button.is-subscription-locked { cursor:not-allowed; opacity:.62; }
.creative-parameter-menu__list > button.is-subscription-locked:hover { border-color:transparent; background:var(--bg-input); color:var(--text-secondary); }
.creative-parameter-menu__list > button.is-subscription-locked small { margin-left:auto; color:var(--text-muted); font-size:10px; }
.creative-parameter-menu__list > button i { color:var(--primary); }
.creative-parameter-menu__list--models { grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
.creative-parameter-menu__list--models > button { min-height:50px; justify-content:flex-start; }
.creative-parameter-menu__list--models > button > i { margin-left:auto; }
.creative-parameter-menu[data-key="tts-voice"] .creative-parameter-menu__list { grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
.creative-voice-choice { display:flex; gap:4px; min-width:0; }
.creative-voice-choice > button { min-height:42px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-secondary); }
.creative-voice-choice > button:first-child { flex:1; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 11px; text-align:left; }
.creative-voice-choice > button:last-child { flex:0 0 42px; color:var(--primary); }
.creative-voice-choice > button:is(:hover,:focus-visible), .creative-voice-choice > button.is-active { border-color:var(--primary); color:var(--text-main); }
.creative-model-choice__icon { display:grid; width:32px; height:32px; flex:0 0 32px; place-items:center; border:1px solid var(--border-color); border-radius:9px; background:rgba(255,255,255,.025); }
.creative-model-choice__icon img { display:block; width:18px; height:18px; object-fit:contain; opacity:.72; filter:grayscale(1); }
.creative-parameter-menu__list--models > button:is(:hover,.is-active) .creative-model-choice__icon img { opacity:1; }
.creative-parameter-menu__list--ratios { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:8px; }
.creative-parameter-menu__list > .creative-ratio-choice { position:relative; min-height:58px; justify-content:flex-start; gap:11px; padding:8px 38px 8px 10px; cursor:pointer; }
.creative-ratio-choice__preview { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border:1px solid var(--border-color); border-radius:9px; background:rgba(255,255,255,.025); }
.creative-ratio-choice__preview i { display:block; max-width:28px; max-height:28px; border:1.5px solid currentColor; border-radius:2px; background:rgba(255,255,255,.035); color:var(--text-secondary) !important; }
.creative-ratio-choice__copy { display:grid; min-width:0; gap:2px; }
.creative-ratio-choice__copy strong { color:var(--text-main); font-size:12px; line-height:1.2; }
.creative-ratio-choice__copy small { overflow:hidden; color:var(--text-secondary); font-size:10px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.creative-ratio-choice__check { position:absolute; right:12px; color:var(--primary); }
.creative-ratio-choice.is-active .creative-ratio-choice__preview { border-color:var(--primary); background:rgba(255,187,69,.1); box-shadow:0 0 18px rgba(255,187,69,.12); }
.creative-ratio-choice.is-active .creative-ratio-choice__preview i { color:var(--primary) !important; }
.creative-ratio-choice:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }

/* Compact, content-led generation conversation. */
.creative-message--user .creative-message__surface { background:color-mix(in srgb,var(--bg-panel) 98%,#000 2%); }
.creative-message-prompt { overflow-wrap:anywhere; }
.creative-message-prompt.is-collapsed { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:6; overflow:hidden; }
.creative-message-expand { display:block; min-height:44px; padding:8px 0; border:0; background:transparent; color:var(--primary); font:inherit; font-size:12px; font-weight:600; text-align:left; cursor:pointer; }
.creative-message-expand[hidden] { display:none; }
.creative-message-expand:hover { text-decoration:underline; }
.creative-message-expand:focus-visible { outline:2px solid var(--primary); outline-offset:2px; border-radius:4px; }
.creative-message__surface:has(> .creative-message-expand:not([hidden]):last-child) { padding-bottom:0; }
.creative-message-actions--outside { margin-top:8px; gap:8px; }
.creative-message-actions--outside button { width:36px; height:36px; border:1px solid var(--border-color); border-radius:9px; background:var(--bg-input); opacity:1; cursor:pointer; }
@media(max-width:991px) { .creative-message-actions--outside button { width:44px; height:44px; } }
.creative-message--assistant .creative-message__avatar { border-color:var(--border-color); color:var(--text-secondary); }
.creative-message--assistant .creative-message__surface { border-color:color-mix(in srgb,var(--border-color) 92%,#657184 8%); background:color-mix(in srgb,var(--bg-panel) 92%,#08090b 8%); color:var(--text-main); box-shadow:0 10px 30px rgba(0,0,0,.14); }
.creative-message--assistant .tc-markdown-body { color:var(--text-main); }
.creative-message--assistant.is-pending .creative-message__surface { width:fit-content; max-width:100%; padding:0; overflow:visible; border:0; background:transparent; box-shadow:none; }
.creative-message-references { display:flex; max-width:100%; flex-wrap:wrap; justify-content:flex-end; gap:7px; margin:0 0 10px; }
.creative-message-references > span { display:block; width:52px; height:52px; overflow:hidden; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); }
.creative-message-references img { display:block; width:100%; height:100%; object-fit:cover; }
.creative-generation-placeholder { position:relative; display:grid; width:min(100%,var(--creative-pending-width,300px)); height:auto; max-height:300px; aspect-ratio:var(--creative-pending-ratio,1/1); place-content:center; place-items:center; gap:14px; overflow:hidden; border:1px solid color-mix(in srgb,var(--primary) 28%,var(--border-color)); border-radius:15px; background:radial-gradient(circle at 50% 38%,rgba(var(--primary-rgb),.09),transparent 44%),color-mix(in srgb,var(--bg-card) 94%,#000 6%); box-shadow:inset 0 1px 0 rgba(255,255,255,.025); }
.creative-generation-placeholder::before { content:""; position:absolute; inset:-35%; background:linear-gradient(105deg,transparent 38%,rgba(var(--primary-rgb),.055) 50%,transparent 62%); animation:creativePendingSweep 2.8s ease-in-out infinite; pointer-events:none; }
.creative-generation-placeholder__logo { position:relative; width:58px; height:58px; }
.creative-generation-placeholder__logo img { position:absolute; inset:7px; width:44px; height:44px; object-fit:contain; }
.creative-generation-placeholder__logo img:first-child { animation:creativePlaceholderSpin 2s linear infinite; }
.creative-generation-placeholder__copy { position:relative; display:grid; justify-items:center; gap:3px; padding-inline:14px; text-align:center; }
.creative-generation-placeholder__copy strong { color:var(--text-main); font-size:12px; font-weight:700; }
.creative-generation-placeholder__copy small { color:var(--text-secondary); font-size:10px; line-height:1.35; }
@keyframes creativePendingSweep { 0%,18% { transform:translateX(-34%); opacity:0; } 42%,62% { opacity:1; } 82%,100% { transform:translateX(34%); opacity:0; } }
.creative-message--assistant.is-pending .creative-message__body { width:fit-content; max-width:100%; }
.creative-message--assistant.is-pending .creative-message__surface { width:fit-content; max-width:100%; }
.creative-music-pending { display:grid; width:min(760px,calc(100vw - 150px)); gap:10px; }
.creative-music-pending__head { display:grid; gap:2px; margin-bottom:2px; }
.creative-music-pending__head strong { color:var(--text-main); font-size:12px; }
.creative-music-pending__head small { color:var(--text-secondary); font-size:10px; }
.creative-music-pending__track { position:relative; display:grid; min-height:116px; grid-template-columns:116px minmax(0,1fr); align-items:center; overflow:hidden; padding:0; border:1px solid var(--border-color); border-radius:15px; background:var(--surface-panel); }
.creative-music-pending__track::after { position:absolute; inset:0; background:linear-gradient(105deg,transparent 30%,rgba(var(--primary-rgb),.07) 48%,transparent 66%); content:""; animation:creativePendingSweep 2.2s ease-in-out infinite; transform:translateX(-70%); }
.creative-music-pending__cover { width:116px; height:116px; background:color-mix(in srgb,var(--surface-control) 90%,var(--primary) 10%); }
.creative-music-pending__content { display:grid; min-width:0; gap:12px; padding:15px 16px; }
.creative-music-pending__content > i { display:block; width:42%; height:7px; border-radius:999px; background:var(--surface-control-hover); }
.creative-music-pending__content > i:nth-child(2) { width:25%; height:5px; opacity:.65; }
.creative-music-pending__content > span { display:flex; height:30px; align-items:center; gap:4px; }
.creative-music-pending__content b { width:3px; height:calc(var(--bar) * 1px); border-radius:999px; background:color-mix(in srgb,var(--primary) 32%,var(--text-muted)); opacity:.58; }
@media(max-width:520px){.creative-music-pending{width:calc(100vw - 62px)}.creative-music-pending__track{min-height:92px;grid-template-columns:92px minmax(0,1fr)}.creative-music-pending__cover{width:92px;height:92px}.creative-music-pending__content{gap:9px;padding:10px}.creative-music-pending__content > span{height:24px;gap:3px}}
@media(prefers-reduced-motion:reduce){.creative-music-pending__track::after{animation:none}}
.creative-message.has-assets .creative-message__body { width:fit-content; max-width:100%; }
.creative-message.has-assets .creative-message__surface { width:fit-content; max-width:100%; padding:0; overflow:visible; border:0; background:transparent; box-shadow:none; }
.creative-message.has-assets .creative-message-assets { margin-top:0; }
.creative-message-assets--single { display:block; }
.creative-message-assets--single .creative-asset { width:min(100%,var(--creative-asset-preview-width,368px)); }
.creative-message.has-assets .creative-message-assets:not(.creative-message-assets--single) { grid-template-columns:repeat(2,max-content); justify-content:start; align-items:start; }
.creative-message.has-assets .creative-asset { border-color:color-mix(in srgb,var(--border-color) 82%,#fff 18%); background:var(--bg-card); box-shadow:0 18px 44px rgba(0,0,0,.28); }
.creative-asset-open { display:block; width:100%; aspect-ratio:var(--creative-asset-ratio,1/1); padding:0; overflow:hidden; border:0; background:transparent; cursor:zoom-in; }
.creative-message.has-assets .creative-asset-open { width:var(--creative-asset-preview-width,368px); max-width:100%; height:var(--creative-asset-preview-height,368px); }
.creative-asset-open > img { display:block; width:100%; height:100%; aspect-ratio:var(--creative-asset-ratio,1/1); object-fit:cover; background:transparent; }
.creative-asset-open:focus-visible { outline:3px solid var(--primary); outline-offset:-3px; }
.creative-message.has-assets .creative-asset figcaption { position:absolute; z-index:4; right:10px; bottom:10px; left:10px; justify-content:flex-start; width:max-content; max-width:calc(100% - 20px); min-height:0; padding:5px; border:1px solid rgba(255,255,255,.13); border-radius:12px; background:rgba(10,10,12,.78); box-shadow:0 10px 28px rgba(0,0,0,.34); backdrop-filter:blur(14px); }
.creative-message.has-assets .creative-asset figcaption > div { margin:0; }
.creative-message.has-assets .creative-asset figcaption :is(button,a,.creative-asset-model-mark) { width:32px; height:32px; border:1px solid transparent; border-radius:9px; background:rgba(255,255,255,.055); color:rgba(255,255,255,.76); opacity:1; }
.creative-message.has-assets .creative-asset figcaption :is(button,a):is(:hover,:focus-visible) { border-color:rgba(var(--primary-rgb),.58); background:rgba(var(--primary-rgb),.13); color:var(--primary); }
.creative-asset-model-mark { display:grid; flex:0 0 auto; place-items:center; color:var(--text-secondary); }
.creative-asset-model-mark__icon { display:block; width:19px; height:19px; object-fit:contain; }
.creative-asset-model-mark.is-photoshoot { border-color:transparent; background:transparent; }
.creative-asset-model-mark.is-photoshoot .creative-asset-model-mark__icon { width:21px; height:21px; }
.creative-asset-community { position:relative; display:grid!important; place-items:center; padding:0!important; color:var(--primary) !important; }
.creative-asset-community__mark { display:block; font:500 1rem/1 Bowler,sans-serif; transform:translate(1px,1px); }
.creative-asset-community > i { position:absolute; right:2px; bottom:2px; display:grid; width:12px; height:12px; place-items:center; border-radius:50%; background:var(--bg-card); font-family:"Font Awesome 6 Free"; font-size:.43rem; }
.creative-asset-community.is-pending { color:var(--text-secondary) !important; }
.creative-asset-community.is-approved { color:var(--success,#5bd89b) !important; }
.creative-asset-community.is-rejected { color:#ff7b82 !important; }
.creative-asset-community:disabled { cursor:default; opacity:.72; }
.creative-asset-community.is-loading > span { opacity:.35; }
.creative-asset-community.is-loading::after { content:""; position:absolute; width:13px; height:13px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:creative-asset-spin .7s linear infinite; }
@keyframes creative-asset-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce){.creative-asset-community.is-loading::after{animation-duration:1.8s}.creative-generation-placeholder::before{animation:none}}
@media(max-width:991px) {
    .creative-asset figcaption > div { display:flex; min-width:0; flex-wrap:wrap; gap:2px; }
    .creative-library-view .creative-gallery-card figcaption { padding:5px 4px; }
    .creative-library-view .creative-gallery-card figcaption :is(button,a,.creative-asset-model-mark),.creative-message.has-assets .creative-asset figcaption :is(button,a,.creative-asset-model-mark) { width:28px; min-width:0; height:32px; flex:0 1 28px; padding:0; font-size:13px; }
}
.creative-history-actions { display:flex; align-items:center; gap:7px; }

/* Chat history is contextual; the media library is a separate full page. */
.creative-history-fab { position:absolute; z-index:32; top:12px; right:12px; display:flex; min-height:44px; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--border-color); border-radius:12px; background:var(--surface-control); color:var(--text-secondary); font-size:12px; cursor:pointer; box-shadow:0 12px 30px rgba(0,0,0,.22); }
:is(.creative-history-fab,.studio-references-toggle):is(:hover,:focus-visible) { border-color:color-mix(in srgb,var(--primary) 58%,var(--border-color)); color:var(--primary); }
:is(.creative-history-fab,.studio-references-toggle):focus-visible { outline:3px solid color-mix(in srgb,var(--primary) 68%,#fff); outline-offset:2px; }
.creative-library-view { width:100%; height:100%; min-height:0; grid-template-columns:72px minmax(0,1fr); overflow:hidden; background:transparent; }
.creative-library-rail { display:flex; min-height:0; flex-direction:column; align-items:center; gap:10px; padding:16px 11px; border-right:1px solid var(--border-color); background:color-mix(in srgb,var(--bg-panel) 92%,transparent); }
.creative-library-rail--flush { padding:0; border:0; background:transparent; }
.creative-library-rail--horizontal { flex-direction:row; justify-content:center; gap:9px; padding:0; border:0; background:transparent; }
.creative-library-rail--horizontal button span { display:none; }
.creative-library-rail--icon-only button span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.creative-library-rail__group { display:grid; gap:8px; }
.creative-library-rail__divider { width:32px; height:1px; margin:2px 0; background:var(--border-color); }
.creative-library-rail button { display:grid; width:48px; height:48px; place-items:center; padding:0; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-input); color:var(--text-secondary); font-size:16px; cursor:pointer; }
.creative-library-rail button:is(:hover,:focus-visible) { border-color:color-mix(in srgb,var(--primary) 55%,var(--border-color)); color:var(--text-main); }
.creative-library-rail button.active { border-color:var(--primary); background:var(--primary-glow); color:var(--primary); box-shadow:0 0 18px rgba(255,187,69,.1); }
.creative-library-rail button:focus-visible { outline:3px solid color-mix(in srgb,var(--primary) 68%,#fff); outline-offset:2px; }
.creative-library-view > .creative-library-grid { position:relative; display:grid; min-height:0; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); align-content:start; gap:14px; padding:18px; overflow-y:auto; }
.creative-library-view > .creative-library-grid > .workshop-loader { position:absolute; inset:0; width:auto; min-height:0; }
.creative-library-view > .creative-library-grid > .creative-empty-mini:only-child { position:absolute; inset:0; display:grid; place-items:center; text-align:center; }
:is(.creative-library-view,.production-view) .creative-gallery-card { container-name:creative-gallery-card; container-type:inline-size; width:100%; border-radius:15px; background:var(--bg-card); }
:is(.creative-library-view,.production-view) .creative-gallery-card .creative-asset-open { aspect-ratio:1/1; }
:is(.creative-library-view,.production-view) .creative-gallery-card .creative-asset-open > img { aspect-ratio:1/1; object-fit:cover; }
.creative-library-video-open { position:relative; display:block; width:100%; aspect-ratio:1/1; padding:0; overflow:hidden; border:0; background:#050506; cursor:zoom-in; }
.creative-library-video-open > .creative-library-video { display:block; width:100%; height:100% !important; aspect-ratio:1/1 !important; object-fit:cover !important; pointer-events:none; }
.creative-message.has-assets .creative-library-video-open { width:var(--creative-asset-preview-width,368px); max-width:100%; height:var(--creative-asset-preview-height,368px); aspect-ratio:var(--creative-asset-ratio,1/1); }
.creative-message.has-assets .creative-library-video-open > .creative-library-video { aspect-ratio:var(--creative-asset-ratio,1/1) !important; object-fit:contain !important; }
.creative-library-video-open > span { position:absolute; inset:50% auto auto 50%; display:grid; width:46px; height:46px; place-items:center; border:1px solid rgba(255,255,255,.2); border-radius:50%; background:rgba(8,8,10,.7); color:#fff; transform:translate(-50%,-50%); backdrop-filter:blur(8px); }
.creative-library-video-open > span i { margin-left:3px; }
.creative-library-video-open:is(:hover,:focus-visible) > span { border-color:var(--primary); color:var(--primary); }
.creative-library-video-open:focus-visible { outline:3px solid var(--primary); outline-offset:-3px; }
.creative-audio-card { display:grid; min-width:0; background:var(--bg-card); }
.creative-audio-card__cover { position:relative; width:100%; aspect-ratio:1/1; overflow:hidden; background:var(--bg-input); }
.creative-audio-card__cover > img { display:block; width:100%; height:100%; object-fit:cover; }
.creative-audio-toggle { position:relative; display:grid; flex:0 0 auto; width:48px; height:48px; margin:0; padding:0; place-items:center; appearance:none; -webkit-appearance:none; border:1px solid rgba(255,255,255,.24); border-radius:50%; background:rgba(12,12,14,.88); color:#fff; box-shadow:0 8px 26px rgba(0,0,0,.55); cursor:pointer; touch-action:manipulation; user-select:none; -webkit-tap-highlight-color:transparent; }
.creative-audio-toggle::before { content:""; position:absolute; inset:-6px; border-radius:50%; }
.creative-audio-toggle__icon { display:block; width:0; height:0; margin-left:4px; border-top:8px solid transparent; border-bottom:8px solid transparent; border-left:13px solid currentColor; pointer-events:none; }
.creative-audio-toggle[aria-pressed="true"] { border-color:var(--primary); color:var(--primary); }
.creative-audio-toggle[aria-pressed="true"] .creative-audio-toggle__icon { width:12px; height:16px; margin:0; border:0; background:linear-gradient(90deg,currentColor 0 4px,transparent 4px 8px,currentColor 8px 12px); }
.creative-audio-toggle.is-loading { border-color:color-mix(in srgb,var(--primary) 62%,var(--border-color)); background:color-mix(in srgb,var(--surface-control) 78%,var(--primary) 22%); color:var(--primary); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 12%,transparent),0 0 18px color-mix(in srgb,var(--primary) 18%,transparent); }
.creative-audio-toggle.is-loading .creative-audio-toggle__icon { position:relative; width:5px; height:5px; margin:0; border:0; border-radius:50%; background:currentColor; box-shadow:0 0 8px color-mix(in srgb,var(--primary) 64%,transparent); animation:creative-audio-loading-wave .9s ease-in-out infinite; }
.creative-audio-toggle.is-loading .creative-audio-toggle__icon::before,.creative-audio-toggle.is-loading .creative-audio-toggle__icon::after { position:absolute; top:0; width:5px; height:5px; border-radius:50%; background:currentColor; box-shadow:0 0 8px color-mix(in srgb,var(--primary) 64%,transparent); content:""; animation:creative-audio-loading-wave .9s ease-in-out infinite; }
.creative-audio-toggle.is-loading .creative-audio-toggle__icon::before { left:-9px; animation-delay:-.18s; }
.creative-audio-toggle.is-loading .creative-audio-toggle__icon::after { right:-9px; animation-delay:.18s; }
.creative-audio-toggle:focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
@keyframes creative-audio-loading-wave { 0%,100% { opacity:.35; transform:translateY(2px) scale(.76); } 50% { opacity:1; transform:translateY(-2px) scale(1); } }
@media(prefers-reduced-motion:reduce){.creative-audio-toggle.is-loading .creative-audio-toggle__icon,.creative-audio-toggle.is-loading .creative-audio-toggle__icon::before,.creative-audio-toggle.is-loading .creative-audio-toggle__icon::after{animation:none;opacity:.8;transform:none}}
.creative-audio-card__footer { position:absolute; z-index:2; right:0; bottom:0; left:0; display:grid; gap:7px; padding:44px 12px 11px; background:linear-gradient(180deg,transparent,rgba(7,7,9,.88) 62%,rgba(7,7,9,.97)); }
.creative-audio-card__title { overflow:hidden; color:#fff; font-size:.8rem; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 2px 8px #000; }
.creative-audio-card__timeline { display:grid; grid-template-columns:40px 28px minmax(0,1fr) 28px; align-items:center; gap:7px; }
.creative-audio-toggle--timeline { z-index:3; width:40px; height:40px; border-color:rgba(255,255,255,.3); background:rgba(12,12,14,.92); box-shadow:0 5px 18px rgba(0,0,0,.48); }
.creative-audio-card__timeline time { color:rgba(255,255,255,.72); font-size:.55rem; font-variant-numeric:tabular-nums; letter-spacing:.01em; }
.creative-audio-card__timeline time:last-child { text-align:right; }
.creative-message.has-assets .creative-message-assets:has(.creative-audio-card--message) { display:grid; width:min(760px,calc(100vw - 150px)); grid-template-columns:1fr; gap:10px; }
.creative-message.has-assets .creative-gallery-track:has(.creative-audio-card--message) { width:100%; border-radius:15px; overflow:hidden; }
.creative-audio-card--message { display:grid; min-height:116px; grid-template-columns:116px minmax(0,1fr); background:linear-gradient(135deg,color-mix(in srgb,var(--bg-card) 97%,#fff 3%),var(--bg-card)); }
.creative-audio-card--message .creative-audio-card__cover { width:116px; height:116px; aspect-ratio:1; }
.creative-audio-card__player { display:grid; min-width:0; align-content:center; gap:17px; padding:15px 16px; }
.creative-audio-card__player > div:first-child { display:grid; min-width:0; gap:4px; }
.creative-audio-card__player strong { overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
.creative-audio-card__player small { color:var(--text-muted); font-size:10px; text-transform:uppercase; }
.creative-track-controls { display:grid; grid-template-columns:38px 34px minmax(70px,1fr) 38px; align-items:center; gap:8px; }
.creative-track-controls .creative-audio-toggle { width:38px; height:38px; border-color:var(--border-color); background:var(--surface-control); box-shadow:none; }
.creative-track-controls time { color:var(--text-muted); font-size:9px; font-variant-numeric:tabular-nums; letter-spacing:.02em; }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"] { --track-progress:0%; width:100%; min-width:0; height:20px; margin:0; appearance:none; -webkit-appearance:none; border:0; outline:0; background:transparent; cursor:pointer; }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]::-webkit-slider-runnable-track { height:5px; border:1px solid rgba(255,255,255,.12); border-radius:99px; background:linear-gradient(90deg,var(--primary) 0 var(--track-progress),rgba(255,255,255,.16) var(--track-progress) 100%); box-shadow:inset 0 1px 2px rgba(0,0,0,.5); }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]::-webkit-slider-thumb { width:15px; height:15px; margin-top:-6px; appearance:none; -webkit-appearance:none; border:2px solid #171719; border-radius:50%; background:var(--primary); box-shadow:0 0 0 2px rgba(255,187,69,.18),0 3px 9px rgba(0,0,0,.55); transition:box-shadow .16s ease,transform .16s ease; }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]::-moz-range-track { height:5px; border:1px solid rgba(255,255,255,.12); border-radius:99px; background:rgba(255,255,255,.16); box-shadow:inset 0 1px 2px rgba(0,0,0,.5); }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]::-moz-range-progress { height:5px; border-radius:99px; background:var(--primary); }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]::-moz-range-thumb { width:12px; height:12px; border:2px solid #171719; border-radius:50%; background:var(--primary); box-shadow:0 0 0 2px rgba(255,187,69,.18),0 3px 9px rgba(0,0,0,.55); }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]:is(:hover,:focus-visible)::-webkit-slider-thumb { box-shadow:0 0 0 4px rgba(255,187,69,.22),0 3px 10px rgba(0,0,0,.6); transform:scale(1.06); }
:is(.creative-audio-card__timeline,.creative-track-controls) input[type="range"]:focus-visible::-moz-range-thumb { outline:3px solid rgba(255,187,69,.24); outline-offset:2px; }
.creative-message .creative-gallery-track:has(.creative-audio-card--message) figcaption { top:8px; right:8px; bottom:auto; left:auto; }
.creative-audio-message-actions { display:flex; align-items:center; gap:5px; }
.creative-audio-message-actions__icons { display:flex; align-items:center; gap:5px; }
.creative-audio-message-actions > .creative-gallery-actions { display:none; }
@media(max-width:991px) {
    .creative-audio-card--message .creative-audio-card__player > div:first-child { padding-right:44px; }
    .creative-audio-message-actions > :is(.creative-asset-model-mark,.creative-audio-message-actions__icons) { display:none; }
    .creative-audio-message-actions > .creative-gallery-actions { display:flex; }
}
.creative-confirm[data-tone="track"] #creative-confirm-message { white-space:pre-wrap; max-height:55dvh; overflow:auto; }
.creative-gallery-card__model { position:absolute; z-index:2; top:8px; left:8px; display:inline-flex; max-width:calc(100% - 16px); min-height:30px; align-items:center; gap:7px; padding:3px 9px 3px 5px; overflow:hidden; border:1px solid rgba(255,255,255,.14); border-radius:8px; background:rgba(20,20,22,.84); color:#fff; font-size:.66rem; font-weight:850; letter-spacing:.035em; text-transform:uppercase; white-space:nowrap; backdrop-filter:blur(8px); }
.creative-gallery-card__model > span { overflow:hidden; text-overflow:ellipsis; }
.creative-gallery-card__model-icon { width:20px; height:20px; flex:0 0 20px; object-fit:contain; }
.creative-gallery-track .creative-gallery-card__model { max-width:calc(100% - 60px); }
.creative-gallery-card__community-status { position:absolute; z-index:2; top:44px; left:8px; display:inline-flex; min-height:26px; align-items:center; gap:6px; padding:0 8px; border:1px solid var(--border-color); border-radius:7px; background:rgba(20,20,22,.9); color:var(--text-main); font-size:.62rem; font-weight:800; letter-spacing:.025em; text-transform:uppercase; backdrop-filter:blur(8px); }
.creative-gallery-card__community-status.is-pending { color:var(--text-secondary); }
.creative-gallery-card__community-status.is-rejected { border-color:color-mix(in srgb,#ef4444 42%,var(--border-color)); background:color-mix(in srgb,#ef4444 12%,rgba(20,20,22,.94)); color:#ff8b91; }
:is(.creative-library-view,.production-view) .creative-gallery-card figcaption { position:absolute; z-index:4; right:8px; bottom:8px; left:auto; width:40px; min-height:40px; justify-content:center; padding:2px; border:1px solid rgba(255,255,255,.12); border-radius:11px; background:rgba(10,10,12,.82); box-shadow:0 10px 28px rgba(0,0,0,.34); backdrop-filter:blur(14px); }
.creative-library-view .creative-gallery-track figcaption { top:8px; bottom:auto; }
:is(.creative-library-view,.production-view) .creative-gallery-card figcaption > div { margin-left:auto; }
:is(.creative-library-view,.production-view) .creative-gallery-card figcaption :is(button,a,.creative-asset-model-mark) { width:36px; height:36px; border-radius:9px; background:rgba(255,255,255,.045); }
.creative-gallery-actions,.creative-asset-overflow { display:grid; place-items:center; margin:0 !important; }
.creative-library-view .creative-gallery-card .creative-asset-action-list { display:none; }
.creative-asset-overflow > .creative-asset-more { display:grid; width:36px; height:36px; place-items:center; border:0; border-radius:9px; background:rgba(255,255,255,.045); color:var(--text-secondary); cursor:pointer; }
.creative-asset-overflow > .creative-asset-more:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.creative-asset-overflow > .creative-asset-action-list { display:none; }
.creative-asset-action-label { display:block; min-width:0; flex:1; text-align:left; font:inherit; line-height:1.35; }
.creative-asset-actions-sheet[hidden] { display:none; }
body.creative-asset-actions-open { overflow:hidden; }
.creative-asset-actions-sheet { position:fixed; z-index:2400; inset:0; display:grid; place-items:center; padding:18px; }
.creative-asset-actions-sheet__backdrop { position:absolute; inset:0; border:0; background:rgba(2,2,3,.74); backdrop-filter:blur(7px); }
.creative-asset-actions-sheet__panel { position:relative; display:grid; width:min(360px,calc(100vw - 28px)); max-height:min(680px,calc(100dvh - 36px)); overflow:hidden; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-panel); box-shadow:0 30px 90px rgba(0,0,0,.7); }
.creative-asset-actions-sheet__panel header { display:flex; min-height:54px; align-items:center; justify-content:space-between; padding:6px 8px 6px 16px; border-bottom:1px solid var(--border-color); }
.creative-asset-actions-sheet__panel header strong { font-size:.86rem; }
.creative-asset-actions-sheet__panel header button { display:grid; width:40px; height:40px; place-items:center; border:0; border-radius:10px; background:var(--bg-input); color:var(--text-secondary); }
.creative-asset-actions-sheet .creative-asset-action-list { display:grid; gap:5px; overflow:auto; padding:8px; }
.creative-asset-actions-sheet .creative-asset-action-list > :is(button,a) { display:flex; width:100%; min-height:44px; align-items:center; gap:12px; padding:8px 11px; border:1px solid transparent; border-radius:11px; background:var(--bg-input); color:var(--text-main); font-size:.76rem; text-align:left; text-decoration:none; }
.creative-asset-actions-sheet .creative-asset-action-list > .creative-asset-community { display:flex !important; place-items:initial; justify-content:flex-start; padding:8px 11px !important; color:var(--text-main) !important; }
.creative-asset-actions-sheet .creative-asset-community__mark { position:static; display:grid; width:20px; height:20px; flex:0 0 20px; place-items:center; color:var(--text-secondary); font-size:.72rem; }
.creative-asset-actions-sheet .creative-asset-community > i { position:static; order:3; width:20px; height:20px; flex:0 0 20px; margin:0; background:transparent; font-size:.65rem; }
.creative-asset-actions-sheet .creative-asset-action-list > :is(button,a) > :first-child { display:grid; width:20px; flex:0 0 20px; place-items:center; color:var(--text-secondary); }
.creative-asset-actions-sheet .creative-asset-action-list > :is(button,a):is(:hover,:focus-visible) { border-color:color-mix(in srgb,var(--primary) 55%,var(--border-color)); color:var(--primary); outline:0; }
@container creative-gallery-card (min-width:250px) {
    .creative-library-view .creative-gallery-card figcaption { width:max-content; min-height:46px; justify-content:flex-end; padding:5px; }
    .creative-library-view .creative-gallery-track figcaption { top:auto; bottom:8px; }
    .creative-library-view .creative-gallery-track .creative-audio-card__footer { padding-bottom:58px; }
    .creative-library-view .creative-gallery-card .creative-gallery-actions,
    .creative-library-view .creative-gallery-card .creative-asset-overflow,
    .creative-library-view .creative-gallery-card .creative-asset-action-list { display:flex; align-items:center; gap:5px; }
    .creative-library-view .creative-gallery-card .creative-asset-action-list { gap:3px; }
    .creative-library-view .creative-gallery-card .creative-asset-more { display:none; }
    .creative-library-view .creative-gallery-card .creative-asset-action-list > :is(button,a) { display:grid; width:35px; height:36px; flex:0 0 35px; place-items:center; padding:0; border:0; }
    .creative-library-view .creative-gallery-card .creative-asset-action-label { display:none; }
}
@media(max-width:620px){.creative-asset-actions-sheet{align-items:end;padding:10px 10px max(10px,env(safe-area-inset-bottom))}.creative-asset-actions-sheet__panel{width:100%;max-height:min(72dvh,620px);border-radius:18px}.creative-asset-actions-sheet .creative-asset-action-list> :is(button,a){min-height:48px;font-size:.8rem}}
.creative-video-modal { width:fit-content; min-width:min(360px,calc(100vw - 48px)); max-width:min(1140px,calc(100vw - 48px)); height:fit-content; max-height:calc(100dvh - 48px); margin:auto; padding:0; border:0; border-radius:18px; background:transparent; color:var(--text-main); }
.creative-video-modal::backdrop { background:rgba(0,0,0,.82); backdrop-filter:blur(8px); }
.creative-video-modal__panel { display:grid; width:100%; height:auto; min-height:0; grid-template-rows:auto minmax(0,1fr); overflow:hidden; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-panel); box-shadow:0 30px 100px rgba(0,0,0,.62); }
.creative-video-modal__panel header { display:flex; min-height:58px; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px 8px 18px; border-bottom:1px solid var(--border-color); }
.creative-video-modal__panel header strong { min-width:0; max-width:min(60ch,calc(100vw - 140px)); overflow:hidden; font-size:.84rem; text-overflow:ellipsis; white-space:nowrap; }
.creative-video-modal__panel header button { display:grid; width:42px; height:42px; flex:0 0 42px; place-items:center; border:1px solid var(--border-color); border-radius:11px; background:var(--bg-input); color:var(--text-secondary); }
.creative-video-modal__stage { position:relative; display:flex; min-width:0; min-height:0; align-items:center; justify-content:center; overflow:hidden; padding:12px; background:#050506; }
.creative-video-modal__stage video { display:block; width:auto; max-width:min(1114px,calc(100vw - 74px)); height:auto; max-height:min(70dvh,calc(100dvh - 190px)); object-fit:contain; background:#000; }
.creative-video-modal__stage audio { display:block; width:min(520px,calc(100vw - 74px)); margin:48px 18px; }
.creative-video-modal__stage [hidden] { display:none; }
.creative-video-modal__status { position:absolute; inset:50% auto auto 50%; z-index:1; display:none; width:min(340px,calc(100% - 48px)); margin:0; color:var(--text-secondary); font-size:.8rem; line-height:1.5; text-align:center; transform:translate(-50%,-50%); }
.creative-video-modal.is-loading .creative-video-modal__status,
.creative-video-modal.has-error .creative-video-modal__status { display:block; }
.creative-video-modal.is-loading .creative-video-modal__stage :is(video,audio),
.creative-video-modal.has-error .creative-video-modal__stage :is(video,audio) { visibility:hidden; }
.creative-video-modal.is-loading .creative-video-modal__status::before { display:block; width:30px; height:30px; margin:0 auto 13px; border:3px solid color-mix(in srgb,var(--primary) 22%,transparent); border-top-color:var(--primary); border-radius:50%; animation:creativeMediaSpin .75s linear infinite; content:""; }
@keyframes creativeMediaSpin { to { transform:rotate(360deg); } }
.creative-video-modal__panel :is(button,a):is(:hover,:focus-visible) { border-color:var(--primary); color:var(--primary); }
.creative-video-modal__panel :is(button,a):focus-visible { outline:3px solid color-mix(in srgb,var(--primary) 68%,#fff); outline-offset:2px; }
.creative-track-info { width:min(680px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); margin:auto; padding:0; border:0; border-radius:20px; background:transparent; color:var(--text-main); }
.creative-track-info::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(8px); }
.creative-track-info__panel { overflow:hidden; border:1px solid var(--border-color); border-radius:20px; background:linear-gradient(145deg,color-mix(in srgb,var(--bg-panel) 97%,#fff 3%),var(--bg-panel)); box-shadow:0 30px 90px rgba(0,0,0,.64); }
.creative-track-info header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; border-bottom:1px solid var(--border-color); }
.creative-track-info__identity { display:flex; min-width:0; align-items:center; gap:11px; }
.creative-track-info__identity>img { width:36px; height:36px; flex:0 0 36px; object-fit:contain; filter:grayscale(1); opacity:.76; }
.creative-track-download .creative-track-info__identity>i { display:grid; width:36px; height:36px; flex:0 0 36px; place-items:center; border-radius:10px; background:color-mix(in srgb,var(--primary) 14%,var(--bg-input)); color:var(--primary); }
.creative-track-info__identity>span { display:grid; min-width:0; gap:2px; }
.creative-track-info__identity small { color:var(--text-muted); font-size:9px; font-weight:800; letter-spacing:.14em; }
.creative-track-info__identity strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.creative-track-info header>button { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:1px solid var(--border-color); border-radius:11px; background:var(--bg-input); color:var(--text-secondary); }
.creative-track-info section { display:grid; gap:10px; max-height:calc(100dvh - 130px); padding:14px; overflow-y:auto; }
.creative-track-info__block { overflow:hidden; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-input); }
.creative-track-info__block>div { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 10px 9px 14px; border-bottom:1px solid var(--border-color); }
.creative-track-info__block>div>span { color:var(--text-secondary); font-size:11px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.creative-track-info__block button { display:inline-flex; min-height:36px; align-items:center; gap:7px; padding:0 10px; border:1px solid var(--border-color); border-radius:9px; background:var(--surface-control); color:var(--text-secondary); font-size:11px; }
.creative-track-info__block button:hover { border-color:color-mix(in srgb,var(--primary) 46%,var(--border-color)); color:var(--text-main); }
.creative-track-info__block p { margin:0; padding:14px; color:var(--text-main); font-size:13px; line-height:1.65; white-space:pre-wrap; }
.creative-track-download__form { display:grid; gap:15px; max-height:calc(100dvh - 100px); padding:18px; overflow-y:auto; }
.creative-track-download__form>label { display:grid; gap:7px; color:var(--text-secondary); font-size:12px; font-weight:700; }
.creative-track-download__form>label>input[type="text"] { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--border-color); border-radius:var(--radius-control); background:var(--bg-input); color:var(--text-main); font:inherit; font-size:14px; }
.creative-track-download__form>label>input:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.creative-track-download__form>label.creative-track-download__saved-cover { display:flex; min-height:44px; align-items:center; gap:9px; }
.creative-track-download__saved-cover[hidden] { display:none; }
.creative-track-download__saved-cover input { width:18px; height:18px; margin:0; accent-color:var(--primary); }
.creative-track-download__form>p { margin:0; color:var(--text-muted); font-size:12px; line-height:1.5; }
.creative-track-download__cover { display:flex; align-items:center; gap:16px; }
.creative-track-download__cover>img { width:104px; height:104px; flex:0 0 104px; border:1px solid var(--border-color); border-radius:12px; object-fit:cover; }
.creative-track-download__upload { position:relative; display:inline-flex; min-height:44px; align-items:center; gap:9px; padding:10px 13px; overflow:hidden; border:1px solid var(--border-color); border-radius:var(--radius-control); background:var(--surface-control); color:var(--text-main); cursor:pointer; font-size:12px; }
.creative-track-download__upload:focus-within { outline:2px solid var(--primary); outline-offset:2px; }
.creative-track-download__upload input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.creative-track-download__actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:4px; }
.creative-track-download__actions>a { color:var(--text-secondary); font-size:12px; text-decoration:underline; }
.creative-track-download__actions>button { min-height:44px; }
.creative-parameter-fields :is(input,textarea):focus,
#music-cover-container :is(input,textarea,select):focus,
.music-lyrics-drawer :is(input,textarea,select):focus { outline:0; border-color:var(--border-color); box-shadow:none; }
@media(max-width:520px) {
    .creative-message.has-assets .creative-message-assets:has(.creative-audio-card--message) { width:calc(100vw - 62px); }
    .creative-audio-card--message { min-height:92px; grid-template-columns:92px minmax(0,1fr); }
    .creative-audio-card--message .creative-audio-card__cover { width:92px; height:92px; }
    .creative-audio-card__player { gap:10px; padding:10px; }
    .creative-track-controls { grid-template-columns:34px minmax(60px,1fr); }
    .creative-track-controls time { display:none; }
    .creative-audio-card__footer { gap:6px; padding:40px 9px 9px; }
    .creative-audio-card__timeline { grid-template-columns:40px minmax(0,1fr); gap:9px; }
    .creative-audio-card__timeline time { display:none; }
    .creative-track-info { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
    .creative-track-info section { max-height:calc(100dvh - 98px); padding:9px; }
    .creative-track-info__block>div { align-items:stretch; flex-direction:column; }
    .creative-track-info__block button { min-height:42px; justify-content:center; }
    .creative-track-download__form { padding:14px; }
    .creative-track-download__cover { align-items:flex-start; }
    .creative-track-download__cover>img { width:84px; height:84px; flex-basis:84px; }
    .creative-track-download__actions { align-items:stretch; flex-direction:column-reverse; }
    .creative-track-download__actions>a { min-height:44px; display:grid; place-items:center; }
}

/* Right rail utilities use the shared footer controls. */
.controls-panel #auth-status-container .user-credits { display:none !important; }
#collective-menu-promo.collective-menu-promo { display:none !important; }
#panel-footer-icons.modes-panel-footer { display:grid !important; grid-template-columns:repeat(2,48px); grid-auto-rows:48px; justify-content:center; gap:8px; }
#panel-footer-icons .mode-button-icon { width:48px !important; min-width:48px !important; height:48px !important; min-height:48px !important; margin:0 !important; border-radius:12px !important; }

/* Full-width content modes use the same central canvas as the shop. */
body.app-mode-profile #profile-view,
body.app-mode-radio #radio-view,
body.app-mode-shop #shop-view,
body.app-mode-profile #profile-view:not(.has-profile-hub) { padding:clamp(14px,1.6vw,24px) !important; }
body.app-mode-profile #profile-view.has-profile-hub { padding:0 !important; }
body.app-mode-profile #profile-view .profile-layout { width:100% !important; max-width:none !important; margin:0 !important; }
body.app-mode-profile #profile-view .profile-row-actions { grid-template-columns:repeat(auto-fit,minmax(130px,1fr)) !important; gap:8px !important; }
body.app-mode-profile #profile-view .profile-row-actions .action-btn { min-height:66px !important; padding:9px !important; grid-template-columns:34px minmax(0,1fr) !important; }
body.app-mode-profile #profile-view .profile-row-actions .action-btn .ico { width:34px !important; height:34px !important; border-radius:10px !important; }

/* Community: authors are a vertical filter rail beside the full gallery. */
body.is-logged-in:not(.app-mode-pose_studio) .generation-space {
    background-color: var(--bg-main);
    background-image: var(--app-canvas-background);
    background-size: var(--app-canvas-size);
    background-attachment: fixed;
}
body.is-logged-in:not(.app-mode-pose_studio) .creative-chat-workspace {
    background: transparent;
}

.generation-space > .site-system-strip {
    display: grid;
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    flex: 0 0 auto;
    grid-template-columns: 44px minmax(0,1fr) 44px;
    align-items: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: radial-gradient(ellipse at 0 50%,rgba(250,191,60,.24),transparent 42%),radial-gradient(ellipse at 100% 50%,rgba(250,191,60,.16),transparent 42%),linear-gradient(90deg,#100d07 0%,#211806 50%,#100d07 100%);
    box-shadow: none;
    color: var(--text-main);
    font-size: .78rem;
    line-height: 1.35;
}
.site-system-strip::before { content:""; grid-column:1; }
.site-system-strip::after {
    content:"";
    position:absolute;
    inset:0;
    z-index:0;
    pointer-events:none;
    background-image:
        radial-gradient(circle,rgba(250,191,60,.52) 0 1px,transparent 1.5px),
        repeating-linear-gradient(60deg,transparent 0 25px,rgba(250,191,60,.17) 26px,transparent 27px 52px),
        repeating-linear-gradient(120deg,transparent 0 25px,rgba(250,191,60,.17) 26px,transparent 27px 52px);
    background-size:42px 22px,104px 104px,104px 104px;
    mask-image:linear-gradient(90deg,#000 0%,transparent 34%,transparent 66%,#000 100%);
}
.generation-space > .site-system-strip[hidden] { display: none; }
.site-system-strip__content { position:relative; z-index:1; grid-column:2; display:flex; min-width:0; align-items:center; justify-content:center; gap:9px; text-align:center; transition:opacity 160ms ease,transform 160ms ease; }
.site-system-strip__content > i { flex:0 0 auto; color:var(--primary); }
.site-system-strip__badge { flex: 0 0 auto; color: var(--primary); font-size: .66rem; letter-spacing: .04em; }
.site-system-strip__badge[hidden] { display: none; }
.site-system-strip__message { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-system-strip__action { flex:0 0 auto; min-height:28px; padding:4px 11px; border:0; border-radius:var(--radius-control); background:var(--primary); color:#111; font-family:inherit; font-size:.72rem; font-weight:700; line-height:1.1; cursor:pointer; }
.site-system-strip__action[hidden] { display:none; }
.site-system-strip__action:hover { filter:brightness(1.12); }
.site-system-strip__action:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.site-system-strip__close { position:relative; z-index:1; grid-column:3; display:grid; width:44px; height:44px; place-items:center; justify-self:end; padding:0; border:0; border-radius:var(--radius-control); background:transparent; color:var(--text-secondary); cursor:pointer; }
.site-system-strip__close:hover { background:rgba(255,255,255,.08); color:var(--text-main); }
.site-system-strip__close:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.site-system-strip.is-leaving .site-system-strip__content { opacity:0; transform:translateY(-10px); }
.site-system-strip.is-entering .site-system-strip__content { animation:site-system-message-enter 320ms cubic-bezier(.2,.8,.2,1) both; }
.site-system-strip.is-dismissing { opacity:0; transform:translateY(-8px); transition:opacity 160ms ease,transform 160ms ease; }
@keyframes site-system-message-enter { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.site-system-strip[data-level="critical"] .site-system-strip__content > i,
.site-system-strip[data-level="critical"] .site-system-strip__badge { color: var(--color-danger); }
@media (prefers-reduced-motion:reduce) { .site-system-strip__content,.site-system-strip.is-dismissing { transition:none; } .site-system-strip.is-entering .site-system-strip__content { animation:none; } }
@media (max-width:600px) {
    .site-system-strip__content { gap:5px; font-size:.7rem; }
    .site-system-strip__badge { font-size:.59rem; }
    .site-system-strip__action { max-width:98px; padding:4px 7px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.65rem; }
    .site-system-strip__content:has(.site-system-strip__action:not([hidden])) { display:grid; grid-template-columns:auto auto minmax(0,1fr); grid-template-rows:20px 28px; column-gap:5px; row-gap:0; }
    .site-system-strip__content:has(.site-system-strip__action:not([hidden])) .site-system-strip__action { grid-column:1/-1; justify-self:center; max-width:160px; }
}

@media (min-width:992px) {
    .desktop-workspace-header { position:relative; z-index:150; display:flex; width:100%; min-width:0; min-height:66px; flex:0 0 66px; align-items:center; gap:8px; padding:9px 12px; border:1px solid var(--border-color); border-radius:16px; background:linear-gradient(180deg,#111 0%,#0a0a0a 100%); box-shadow:0 10px 32px rgba(0,0,0,.34); isolation:isolate; }
    .desktop-workspace-brand { display:inline-flex; min-width:0; min-height:46px; align-items:center; gap:10px; padding:0 8px 0 2px; border:0; background:transparent; color:var(--primary); font-family:'Bowler',sans-serif; font-size:14px; letter-spacing:.09em; white-space:nowrap; cursor:pointer; }
    .desktop-workspace-brand .shell-brand-mark { width:38px; height:38px; flex:0 0 38px; }
    .desktop-workspace-brand:hover { color:#ffd36d; }
    .desktop-creative-actions { display:flex; flex:0 0 auto; gap:7px; }
    body:not(.creative-chat-active) .desktop-creative-actions { display:none; }
    .desktop-mode-picker,.desktop-spaces-picker { position:relative; flex:0 0 auto; }
    .desktop-spaces-picker { margin-left:auto; }
    .desktop-spaces-toggle { display:inline-flex; min-height:44px; align-items:center; gap:9px; padding:0 12px; border:1px solid var(--border-color); border-radius:var(--radius-control); background:var(--surface-control); color:var(--text-secondary); font-family:'Bowler',sans-serif; font-size:10px; letter-spacing:.045em; cursor:pointer; transition:border-color var(--motion-fast),background-color var(--motion-fast),color var(--motion-fast); }
    .desktop-spaces-toggle > svg { width:21px; height:21px; overflow:visible; fill:none; stroke:var(--primary); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
    .desktop-spaces-toggle > i:last-child { margin-left:1px; color:var(--text-muted); font-size:8px; transition:transform var(--motion-fast); }
    .desktop-spaces-toggle:is(:hover,[aria-expanded="true"]) { border-color:color-mix(in srgb,var(--primary) 42%,var(--border-color)); background:var(--surface-control-hover); color:var(--text-main); }
    .desktop-spaces-toggle[aria-expanded="true"] > i:last-child { transform:rotate(180deg); }
    .desktop-modes-menu[hidden] { display:none !important; }
    .desktop-modes-menu { position:absolute; top:calc(100% + 10px); left:50%; z-index:170; display:grid; width:min(360px,calc(100vw - 24px)); grid-template-columns:1fr; gap:3px; padding:8px; overflow:hidden; border:1px solid color-mix(in srgb,var(--primary) 34%,var(--border-color)); border-radius:var(--radius-panel); background:var(--surface-panel); box-shadow:var(--shadow-panel); backdrop-filter:var(--glass-blur); transform:translateX(-50%); }
    .desktop-modes-menu :is(.mode-group,.studio-submenu) { display:contents !important; }
    .desktop-modes-menu .mode-button { position:relative; display:grid !important; min-width:0; min-height:54px; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:10px; margin:0 !important; padding:8px 10px !important; border:1px solid transparent; border-radius:var(--radius-control); background:transparent; color:var(--text-secondary); text-align:left; }
    .desktop-modes-menu .mode-button > img { display:block; width:34px; height:34px; justify-self:center; border-radius:50%; object-fit:cover; }
    .desktop-modes-menu .mode-button span { font-family:'Bowler',sans-serif; font-size:10px; font-weight:500; line-height:1.2; letter-spacing:.035em; }
    .desktop-modes-menu .mode-button:is(:hover,.active) { border-color:var(--border-color); background:var(--surface-control-hover); color:var(--text-main); }
    .desktop-modes-menu .mode-group > .mode-button:is([data-mode="studio"],[data-mode="video"],[data-mode="music_gallery"],[data-mode="text"]) { display:none !important; }
    .desktop-service-nav { position:absolute; top:50%; left:50%; display:flex; min-width:0; align-items:center; justify-content:center; gap:5px; transform:translate(-50%,-50%); }
    .desktop-primary-mode { position:relative; display:grid; width:48px; min-width:48px; height:48px; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; cursor:pointer; isolation:isolate; transition:transform var(--motion-fast); }
    .desktop-primary-mode::before { content:""; position:absolute; z-index:-1; inset:2px; border:1px solid transparent; border-radius:50%; background:transparent; pointer-events:none; transition:border-color var(--motion-normal),box-shadow var(--motion-normal); }
    .desktop-primary-mode > img { display:block; width:44px; height:44px; border-radius:50%; object-fit:cover; transition:transform var(--motion-normal),filter var(--motion-normal); }
    .desktop-primary-mode > i { color:var(--primary); font-size:19px; }
    .desktop-primary-mode:hover { transform:translateY(-1px); }
    .desktop-primary-mode:hover::before { border-color:color-mix(in srgb,var(--primary) 68%,transparent); }
    .desktop-primary-mode:hover > img { transform:scale(1.06); filter:drop-shadow(0 0 4px rgba(var(--primary-rgb),.34)); }
    .desktop-primary-mode:is(.active,[aria-expanded="true"])::before { inset:0; border:2px solid var(--primary); box-shadow:0 0 10px rgba(var(--primary-rgb),.5); }
    .desktop-primary-mode:is(.active,[aria-expanded="true"]) > img { transform:scale(1.03); }
    .desktop-mode-picker { display:grid; place-items:center; }
    .desktop-spaces-menu[hidden] { display:none !important; }
    .desktop-spaces-menu { position:absolute; z-index:175; top:calc(100% + 10px); right:0; display:grid; width:min(360px,calc(100vw - 24px)); gap:3px; padding:8px; overflow:hidden; border:1px solid color-mix(in srgb,var(--primary) 34%,var(--border-color)); border-radius:var(--radius-panel); background:var(--surface-panel); box-shadow:var(--shadow-panel); backdrop-filter:var(--glass-blur); }
    .desktop-spaces-menu button { display:grid; min-height:54px; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:10px; margin:0; padding:8px 10px; border:1px solid transparent; border-radius:var(--radius-control); background:transparent; color:var(--text-secondary); text-align:left; cursor:pointer; }
    .desktop-spaces-menu button > :first-child { display:grid; width:36px; height:36px; place-items:center; color:var(--primary); }
    .desktop-spaces-menu button > span:last-child { display:block; min-width:0; }
    .desktop-spaces-menu strong { color:inherit; font-family:'Bowler',sans-serif; font-size:10px; font-weight:500; line-height:1.2; letter-spacing:.035em; }
    .desktop-spaces-menu small { display:none; }
    .desktop-spaces-menu button:is(:hover,.active) { border-color:var(--border-color); background:var(--surface-control-hover); color:var(--text-main); }
    .desktop-spaces-menu__mark { font-family:'Bowler',sans-serif; font-size:17px; }
    .desktop-workspace-header :is(.desktop-primary-mode,.desktop-spaces-toggle):focus-visible,.desktop-spaces-menu button:focus-visible { outline:0; box-shadow:var(--focus-ring); }
    .desktop-profile-avatar { display:grid; width:46px; min-width:46px; height:46px; place-items:center; padding:2px; overflow:hidden; border:1px solid color-mix(in srgb,var(--primary) 62%,var(--border-color)); border-radius:50%; background:var(--bg-input); cursor:pointer; }
    .desktop-profile-avatar img { display:block; width:100%; height:100%; max-width:none; border-radius:50%; object-fit:cover; }
    .desktop-profile-avatar:hover { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-glow); }
    @media (max-width:1280px) {
        .desktop-spaces-toggle span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
        .desktop-spaces-toggle { width:44px; justify-content:center; padding:0; }
        .desktop-spaces-toggle > i:last-child { display:none; }
    }
    body.is-logged-in :is(.controls-panel,.modes-panel), :is(#left-panel-toggle,#right-panel-toggle) { display:none !important; }

    body.creative-chat-active .creative-chat-workspace { display:block !important; }
    body.creative-chat-active .creative-message-feed { width:100%; height:100%; padding-right:clamp(18px,3vw,46px); padding-left:clamp(18px,3vw,46px); }
    body.creative-chat-active .creative-history-drawer,body.app-mode-production #production-projects-drawer { position:absolute; z-index:38; top:10px; right:10px; bottom:10px; left:auto; display:flex; height:auto; visibility:hidden; transform:translateX(calc(100% + 18px)); }
    body.creative-chat-active .creative-history-drawer.is-open,body.app-mode-production #production-projects-drawer.is-open { visibility:visible; transform:translateX(0); }
    body.creative-chat-active .creative-composer { right:max(12px,calc((100% - 940px)/2)); left:max(12px,calc((100% - 940px)/2)); }

    body.app-mode-community .generation-space { display:grid !important; grid-template-columns:72px minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr); width:100%; }
    body.app-mode-community #desktop-workspace-header { grid-column:1/-1; grid-row:1; }
    body.app-mode-community #challenge-announcement-slot { grid-column:1/-1; grid-row:2; }
    body.app-mode-community #community-gallery-grid { grid-column:2; grid-row:3; width:100% !important; max-width:none !important; height:100%; margin:0; padding:18px; }
    body.app-mode-community #challenge-announcement-slot:empty { display:none; }
    body.app-mode-community .generation-space:has(> .site-system-strip:not([hidden])) { grid-template-rows:auto auto auto minmax(0,1fr); }
    body.app-mode-community .generation-space > .site-system-strip:not([hidden]) { grid-column:1/-1; grid-row:1; }
    body.app-mode-community .generation-space:has(> .site-system-strip:not([hidden])) #desktop-workspace-header { grid-row:2; }
    body.app-mode-community .generation-space:has(> .site-system-strip:not([hidden])) #challenge-announcement-slot { grid-row:3; }
    body.app-mode-community .generation-space:has(> .site-system-strip:not([hidden])) #community-gallery-grid,
    body.app-mode-community .generation-space:has(> .site-system-strip:not([hidden])) #community-filters-container:not(:empty) { grid-row:4; }
}

@media (prefers-reduced-motion:reduce) {
    .desktop-primary-mode,.desktop-primary-mode::before,.desktop-primary-mode > img { transition:none !important; }
}

@media (max-width: 991px) {
    body.creative-chat-active,body.app-mode-production { --workspace-drawer-top:calc(var(--mobile-header-height) + 8px); }
    .desktop-workspace-header { display:none !important; }
    body.is-logged-in.app-mode-profile #profile-view:has(.profile-hub) {
        padding: 0 0 max(12px, env(safe-area-inset-bottom)) !important;
        scroll-padding-top: 0;
    }
    body.is-logged-in.app-mode-events #events-view {
        padding: 0 0 max(12px, env(safe-area-inset-bottom)) !important;
        scroll-padding-top: 0;
    }
    body.app-mode-community #community-gallery-grid { width: 100%; }
    .creative-composer { --composer-action-size:36px; gap:6px; padding:8px; border-radius:16px; }
    .creative-composer > textarea { min-height:36px; max-height:120px; padding:7px 4px; font-size:16px; line-height:1.4; }
    .creative-composer > textarea::placeholder { font-size:13px; }
    .creative-composer .creative-submit { width:36px; min-width:36px; height:36px; min-height:36px; padding:0; border-radius:11px; font-size:15px; }
    .creative-composer .creative-generation-cost { width:62px; min-width:62px; max-width:62px; }
    .creative-composer .creative-generation-price { width:62px; height:36px; min-width:62px; max-width:62px; gap:3px; padding:0 3px; overflow:hidden; }
    .creative-generation-price b { font-size:12px; }
    .creative-composer .creative-generation-price__chevron { display:none; }
    .creative-composer .creative-composer-counters { padding:0 2px; font-size:10px; }
    .creative-composer__tools { gap:5px; padding-top:3px; }
    .creative-parameter-chips { gap:4px; }
    .creative-parameter-chips > button { min-height:32px; padding:5px 7px; gap:4px; font-size:11px; }
    .creative-parameter-chips > button > small { display:none; }
    body.app-mode-video #creative-model-guide { min-width:30px; width:30px; min-height:32px; overflow:hidden; padding:0; font-size:0; justify-content:center; }
    body.app-mode-video #creative-model-guide i { font-size:12px; }
    body:is(.app-mode-video,.app-mode-studio) .video-composer-gear { width:32px; min-width:32px; margin-left:0; }
    body.app-mode-video .video-rich-prompt { min-height:36px; max-height:120px; padding:7px 4px; font-size:16px; line-height:1.4; }
    body.app-mode-video .video-rich-prompt:empty:before { font-size:13px; }
    body.creative-chat-active :is(#creative-history-drawer,#studio-references-panel),body.app-mode-production #production-projects-drawer { position:fixed; }
    body.creative-chat-active #creative-history-drawer,body.app-mode-production #production-projects-drawer { right:8px; left:auto; transform:translateX(calc(100% + 16px)); }
    body.creative-chat-active #creative-history-drawer.is-open,body.app-mode-production #production-projects-drawer.is-open { transform:translateX(0); }
    .studio-references-toggle { width:40px; min-width:40px; padding:0; justify-content:center; }
    .studio-references-toggle span { display:none; }
    :is(.studio-references-toggle,.creative-history-fab) { background:var(--surface-control); }
    .creative-generation-price { min-width: 58px; padding-inline: 7px; }
    .creative-chat-header { grid-template-columns:minmax(0,1fr) auto !important; }
    body.app-mode-studio #creative-model-guide { display:grid; width:32px; min-width:32px; min-height:32px; padding:0; font-size:12px; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips { overflow:hidden; scrollbar-width:none; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button { min-width:0; max-width:none; flex:1 1 0; justify-content:center; padding-inline:5px; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button:is([data-settings-target="studio-provider"],[data-settings-target="studio-model"]),
    body.app-mode-video .creative-parameter-chips > button:is([data-settings-target="video-provider"],[data-settings-target="video-model"]) { width:auto; min-width:0; max-width:118px; flex:0 1 auto; padding-inline:8px; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > .video-composer-gear { width:32px; min-width:32px !important; flex:0 0 32px; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint) .creative-parameter-chips > .creative-parameter-chip--icon { width:32px; min-width:32px; max-width:32px; flex:0 0 32px; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target$="-provider"] { width:32px; min-width:32px; max-width:32px; flex:0 0 32px; padding:0; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target$="-provider"] > b { display:none; }
    body:is(.app-mode-music_gallery,.app-mode-music_cover) .creative-parameter-chips { overflow:hidden; scrollbar-width:none; }
    body:is(.app-mode-music_gallery,.app-mode-music_cover) .creative-parameter-chips > button { width:32px; min-width:32px; max-width:32px; flex:0 0 32px; justify-content:center; padding:0; }
    body:is(.app-mode-music_gallery,.app-mode-music_cover) .creative-parameter-chips > button :is(small,b,.fa-chevron-down) { display:none; }
    body:is(.app-mode-music_gallery,.app-mode-music_cover) .creative-parameter-chip__mobile-symbol { display:block; margin:0; color:var(--text-main); font-size:13px; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button > b { min-width:0; overflow:hidden; text-overflow:ellipsis; }
    body:not(.app-mode-studio):not(.app-mode-video) .creative-model-guide { display:none; }
    .creative-mode-heading strong { font-size:11px !important; }
    .creative-header-balance { padding-inline:4px; font-size:16px; }
    .creative-credit-hex { width:20px; height:20px; }
    .creative-parameter-menu { position:fixed; right:8px; bottom:max(8px,env(safe-area-inset-bottom)); left:8px; max-height:64dvh; }
    .creative-parameter-menu[data-key="studio-settings"] { max-height:min(78dvh,calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
    .creative-parameter-menu__list--ratios { grid-template-columns:1fr; }
    body:is(.app-mode-studio,.app-mode-inpaint) #creative-model-guide { display:none; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button:not([data-settings-target="studio-provider"]):not([data-settings-target="studio-tags"]):not(.video-composer-gear) { display:none; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target="studio-provider"] { width:36px; min-width:36px; max-width:36px; flex:0 0 36px; justify-content:center; padding:0; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target="studio-provider"] > b { display:none; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target="studio-provider"] > .creative-model-chip__icon { display:block; }
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > button[data-settings-target="studio-tags"],
    body:is(.app-mode-studio,.app-mode-inpaint) .creative-parameter-chips > .video-composer-gear { width:36px; min-width:36px !important; max-width:36px; flex:0 0 36px; }
    .creative-studio-settings { max-height:calc(64dvh - 55px); padding:10px; }
    .creative-studio-settings__options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .creative-studio-settings__options > button { min-width:0; min-height:44px; justify-content:space-between; }
    .creative-history-fab { top:8px; right:8px; width:44px; padding:0; justify-content:center; }
    .creative-history-fab span { display:none; }
    .creative-chat-workspace .creative-message-feed { padding-top:68px; }
    .creative-library-view { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
    .creative-library-rail { flex-direction:row; justify-content:center; gap:9px; padding:8px; border-right:0; border-bottom:1px solid var(--border-color); }
    .creative-library-rail--flush { padding:0; border:0; background:transparent; }
    .creative-library-rail__group { display:flex; gap:7px; }
    .creative-library-rail__divider { width:1px; height:32px; margin:8px 1px; }
    .creative-library-view > .creative-library-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; padding:10px; }
    .creative-video-modal { min-width:0; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border-radius:16px; }
    .creative-video-modal__panel { border-radius:16px; }
    .creative-video-modal__stage video { max-width:calc(100vw - 50px); max-height:calc(100dvh - 170px); }
    .creative-message.has-assets .creative-message-assets:not(.creative-message-assets--single) { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .pose-scene-sidebar-view nav button { transition: none; }
    .creative-video-modal.is-loading .creative-video-modal__status::before { animation:none; }
}

/* References occupy their own row; the attachment action belongs to the prompt row. */
.creative-composer { grid-template-columns:var(--composer-action-size,48px) minmax(0,1fr) auto var(--composer-action-size,48px); grid-template-rows:auto auto auto auto; }
.creative-composer .creative-composer__tools { display:contents; }
.creative-composer .creative-native-reference-tray { grid-column:1/-1; grid-row:1; min-height:48px; padding:2px 4px 4px; }
.creative-composer .creative-composer__tools > .creative-icon-btn { grid-column:1; grid-row:2; align-self:end; width:var(--composer-action-size,48px); min-width:var(--composer-action-size,48px); height:var(--composer-action-size,48px); min-height:var(--composer-action-size,48px); border-radius:14px; }
.creative-composer > textarea { grid-column:2; grid-row:2; }
body.app-mode-music_gallery .creative-chat-workspace .creative-composer > textarea { grid-column:1 / 3; }
.creative-composer .creative-generation-cost { grid-column:3; grid-row:2; }
.creative-composer .creative-submit { grid-column:4; grid-row:2; }
body.app-mode-text .creative-composer { grid-template-columns:var(--composer-action-size,48px) var(--composer-action-size,48px) minmax(0,1fr) auto var(--composer-action-size,48px); }
body.app-mode-text .creative-composer .creative-composer__tools > #creative-attach { grid-column:1; }
body.app-mode-text .creative-composer .creative-composer__tools > .creative-voice-input { grid-column:2; grid-row:2; }
body.app-mode-text .creative-composer > textarea { grid-column:3; }
body.app-mode-text .creative-composer .creative-generation-cost { grid-column:4; }
body.app-mode-text .creative-composer .creative-submit { grid-column:5; }
body.app-mode-text .creative-composer .creative-submit.is-stop { border-color:color-mix(in srgb,var(--bs-danger,#dc3545) 58%,var(--border-color)); background:color-mix(in srgb,var(--bs-danger,#dc3545) 18%,var(--surface-control)); color:#ff7c85; }
body.app-mode-text .creative-composer > textarea { min-height:64px; }
.creative-voice-input.is-listening { border-color:var(--primary) !important; background:var(--primary-glow) !important; color:var(--primary) !important; box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 16%,transparent); }
.creative-composer .creative-selected-tags { grid-column:1/-1; grid-row:4; }
.creative-composer .creative-composer__meta { grid-column:1/-1; grid-row:5; }
.creative-chat-workspace .creative-composer.is-reference-drop-target { border-color:var(--primary) !important; box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 22%,transparent),0 24px 70px rgba(0,0,0,.42) !important; }
.creative-chat-workspace .creative-composer.is-reference-drop-target::after { content:"Отпустите изображение — оно станет референсом"; position:absolute; z-index:50; inset:6px; display:grid; place-items:center; padding:18px; border:1px solid color-mix(in srgb,var(--primary) 70%,transparent); border-radius:15px; background:color-mix(in srgb,var(--bg-panel) 92%,transparent); color:var(--text-main); font-size:.78rem; font-weight:800; text-align:center; pointer-events:none; backdrop-filter:blur(10px); }
.creative-native-reference-tray .remove-attachment:focus-visible { outline:2px solid #fff; outline-offset:2px; }

/* Mobile creative composer: one compact surface. The prompt grows only when
   it has content; settings share the action rail instead of taking a new row. */
@media (max-width: 991px) {
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer {
        --composer-action-size:44px;
        grid-template-columns:44px minmax(0,1fr) auto 44px;
        grid-template-rows:auto auto auto auto auto;
        gap:4px 6px;
        padding:7px;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer > textarea {
        grid-column:1 / -1;
        grid-row:2;
        min-height:52px;
        max-height:min(28dvh,160px);
        padding:8px 6px;
        border:0;
        border-radius:0;
        background:transparent;
        overflow-y:auto;
        scrollbar-width:thin;
    }
    body.app-mode-music_gallery .creative-chat-workspace .creative-composer > textarea { grid-column:1 / -1; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer > textarea:focus {
        box-shadow:none !important;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-composer__tools > .creative-icon-btn {
        grid-column:1;
        grid-row:3;
        width:44px;
        min-width:44px;
        height:44px;
        min-height:44px;
        align-self:center;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-generation-cost {
        grid-column:3;
        grid-row:3;
        align-self:center;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-generation-price {
        height:44px;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-submit {
        grid-column:4;
        grid-row:3;
        width:44px;
        min-width:44px;
        height:44px;
        min-height:44px;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-composer__meta {
        grid-column:2;
        grid-row:3;
        min-width:0;
        height:44px;
        padding:0;
        gap:4px;
        justify-content:flex-start;
        overflow:hidden;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-parameter-chips {
        min-width:0;
        height:36px;
        align-items:center;
        overflow-x:auto;
        overflow-y:hidden;
        scrollbar-width:none;
    }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-parameter-chips::-webkit-scrollbar { display:none; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-composer-counters { grid-row:4; }
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover) .creative-composer .creative-selected-tags { grid-row:5; }
    body.app-mode-music_gallery .creative-composer .creative-composer__meta { grid-column:1 / 3; }
}

@media (max-width: 991px) {
    body.app-mode-text .creative-composer {
        --composer-action-size:44px;
        grid-template-columns:44px 44px minmax(0,1fr) auto 44px;
        grid-template-rows:auto auto auto auto auto;
        gap:4px 8px;
        padding:7px;
    }
    body.app-mode-text .creative-composer > textarea {
        grid-column:1 / -1;
        grid-row:2;
        min-height:72px;
        max-height:min(28dvh,160px);
        padding:9px 6px;
        overflow-y:auto;
    }
    body.app-mode-text .creative-composer .creative-composer__tools > .creative-icon-btn {
        grid-row:3;
        align-self:center;
        width:44px;
        min-width:44px;
        height:44px;
        min-height:44px;
    }
    body.app-mode-text .creative-composer .creative-composer__tools > #creative-attach { grid-column:1; }
    body.app-mode-text .creative-composer .creative-composer__tools > .creative-voice-input { grid-column:2; }
    body.app-mode-text .creative-composer .creative-generation-cost { grid-column:4; grid-row:3; align-self:center; width:90px; min-width:90px; max-width:90px; }
    body.app-mode-text .creative-composer .creative-generation-price { justify-content:flex-end; width:90px; min-width:90px; max-width:90px; height:44px; gap:4px; padding:0 5px; overflow:hidden; }
    body.app-mode-text .creative-composer .creative-generation-price b { min-width:0; overflow:hidden; text-overflow:ellipsis; }
    body.app-mode-text .creative-composer .creative-submit { grid-column:5; grid-row:3; width:44px; min-width:44px; height:44px; min-height:44px; }
    body.app-mode-text .creative-composer .creative-composer-counters { grid-row:4; }
    body.app-mode-text .creative-composer .creative-composer__meta { grid-column:1 / -1; grid-row:5; }
}

@media (max-width: 991px) and (orientation: landscape) and (max-height: 560px) {
    body:is(.app-mode-studio,.app-mode-video,.app-mode-inpaint,.app-mode-photoshoot,.app-mode-music_gallery,.app-mode-music_cover,.app-mode-text) .creative-composer > textarea {
        min-height:44px;
        max-height:24dvh;
    }
}

/* The 3D editor already has scene tools; the outer left rail is redundant. */
body.app-mode-pose_studio .controls-panel,
body.app-mode-pose_studio #left-panel-toggle { display:none !important; }
body.app-mode-pose_studio .main-container { --app-left-rail-width:0px; }

/* Keep the pending frame equal to the image viewport of the completed card. */
.creative-generation-placeholder {
    width:var(--creative-pending-width,368px); max-width:100%;
    height:var(--creative-pending-height,368px); max-height:none;
    flex:none; aspect-ratio:auto;
}
.creative-message--assistant.is-pending .creative-message__body,
.creative-message--assistant.is-pending .creative-message__surface { min-width:0; }

.creative-composer-counters {
    grid-column:1/-1; grid-row:3; display:flex; justify-content:space-between; align-items:baseline; gap:4px 12px;
    padding:2px 4px 0; color:var(--text-secondary); font-size:12px; line-height:1.5;
}
#creative-prompt-count { margin-left:auto; text-align:right; }
.creative-chat-workspace .creative-submit:disabled { cursor:not-allowed; }
.creative-composer-counters[hidden] { display:none; }
.creative-composer-counters .is-over-limit { color:var(--bs-danger,#dc3545); font-weight:700; }
#creative-validation-message { color:var(--bs-danger,#dc3545); font-weight:700; }
#creative-validation-message[hidden] { display:none; }

/* A compact subscription mark stays next to the account on both headers. */
#desktop-profile-avatar,#mobile-profile-avatar { position:relative; overflow:visible; }
#desktop-profile-avatar img,#mobile-profile-avatar img { border-radius:50%; }
.shell-pro-badge {
    position:absolute; z-index:1; bottom:-4px; left:50%; transform:translateX(-50%);
    display:block; padding:2px 5px; border:1px solid var(--bg-main); border-radius:6px;
    background:var(--primary); color:var(--text-on-accent,#17120a);
    font-size:10px; line-height:1.2; font-weight:900; letter-spacing:.05em;
}
.shell-pro-badge[hidden] { display:none; }

/* Projects provide context; chats have a distinct primary creation action. */
/* Both side panels share one surface and controls; only their content differs. */
body.creative-chat-active :is(#creative-history-drawer,#studio-references-panel),body.app-mode-inpaint :is(#inpControls,#inpaint-actions-drawer),body.app-mode-production #production-projects-drawer { top:var(--workspace-drawer-top,10px); bottom:10px; width:min(340px,calc(100vw - 24px)); min-height:0; padding:18px; border:1px solid var(--border-color); border-radius:16px; background:var(--bg-main); box-shadow:0 18px 50px rgba(0,0,0,.34); }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) .creative-drawer__head { display:flex; flex:none; align-items:center; justify-content:space-between; gap:12px; margin:0 0 20px; }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) h2 { margin:0; color:var(--text-main); font-size:17px; line-height:1.3; font-weight:800; }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) .creative-drawer-close { display:flex; flex:0 0 auto; align-items:center; justify-content:center; gap:7px; width:auto; min-width:88px; min-height:40px; padding:0 9px; border:1px solid var(--border-color); border-radius:12px; background:var(--surface-control); color:var(--text-secondary); font-size:12px; }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer) .creative-drawer-close i { font-size:10px; }
.creative-project-section { padding:0 0 18px; border-bottom:1px solid var(--border-color); }
.creative-project-create { display:flex; align-items:center; gap:8px; min-height:44px; margin:6px 0 -6px; padding:0 8px; border:0; border-radius:10px; background:transparent; color:var(--text-secondary); font-size:12px; font-weight:600; }
.creative-chat-section-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:4px 8px; margin:18px 0 12px; }
.creative-chat-section-head h3 { margin:0; font-size:13px; color:var(--text-main); font-weight:700; }
.creative-chat-section-head small { color:var(--text-secondary); font-size:11px; }
.creative-new-chat-button { display:flex; flex:0 0 auto; align-items:center; justify-content:center; gap:9px; min-height:44px; padding:10px 14px; margin:0 0 14px; border:1px solid color-mix(in srgb,var(--primary) 50%,var(--border-color)); border-radius:12px; background:var(--bg-input); color:var(--text-main); font-size:13px; font-weight:700; }
.creative-new-chat-button i { color:var(--primary); }
#creative-history-drawer .creative-chat-list { display:flex; flex-direction:column; gap:7px; flex:1; overflow-y:auto; }
#creative-history-drawer .creative-chat-row { flex:none; grid-template-columns:minmax(0,1fr) 44px; }
#creative-history-drawer .creative-chat-row>[data-chat-open] { grid-template-columns:18px minmax(0,1fr); column-gap:9px; row-gap:4px; padding:12px 8px 12px 12px; }
#creative-history-drawer .creative-chat-row__icon { grid-row:1/3; align-self:center; color:var(--text-secondary); font-size:15px; }
#creative-history-drawer .creative-chat-row span { font-size:13px; line-height:1.4; }
#creative-history-drawer .creative-chat-row small { grid-column:2; margin:0; font-size:11px; }
#creative-history-drawer .creative-chat-row.active { border-color:color-mix(in srgb,var(--primary) 40%,var(--border-color)); background:color-mix(in srgb,var(--bg-input) 94%,var(--primary) 6%); }
#creative-history-drawer .creative-chat-row.active .creative-chat-row__icon { color:var(--primary); }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) button:hover { color:var(--primary); }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
:is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer) select:focus-visible { outline:0; border-color:color-mix(in srgb,var(--text-secondary) 42%,var(--border-color)); box-shadow:0 0 0 1px rgba(255,255,255,.07); }
@media(max-width:420px) { :is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) .creative-drawer__head { gap:6px; } :is(#creative-history-drawer,#studio-references-panel,#inpControls,#inpaint-actions-drawer,#production-projects-drawer) h2 { font-size:16px; } }
