/* BAIZHI Studio: shared creator, desktop navigation and mobile sheets. */
body.studio-layout:not(.auth-mode) {
  --studio-bg: #0d1115;
  --studio-panel: #171d23;
  --studio-line: #303a40;
  --studio-muted: #a1adb5;
  background: var(--studio-bg);
  background-attachment: scroll;
  color: #eef2f4;
}
.studio-layout:not(.auth-mode) .ambient,
.studio-layout:not(.auth-mode) .login-fx { display: none; }
.studio-layout:not(.auth-mode) .shell { width: calc(100% - 112px); max-width: 1480px; margin: 0 auto 0 112px; padding: 26px 40px 48px; }
.studio-layout:not(.auth-mode) .topbar { margin-bottom: 32px; align-items: center; gap: 16px; }
.studio-layout:not(.auth-mode) .topbar .eyebrow { display: none; }
.studio-layout:not(.auth-mode) .topbar h1 { font-size: 24px; line-height: 1.2; letter-spacing: .04em; }
.studio-layout:not(.auth-mode) .default-brand { font-size: inherit; background: none; color: #eef2f4; -webkit-text-fill-color: currentColor; filter: none; text-shadow: none; }
.studio-layout:not(.auth-mode) .app-brand-shell { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.studio-layout:not(.auth-mode) .app-brand-shell::before,
.studio-layout:not(.auth-mode) .app-brand-shell::after { display: none; }
.studio-layout:not(.auth-mode) .default-brand::before,
.studio-layout:not(.auth-mode) .default-brand::after { display: none; }
.studio-layout:not(.auth-mode) .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.studio-layout:not(.auth-mode) .status-pill { min-height: 40px; font-size: 12px; border-color: var(--studio-line); background: var(--studio-panel); box-shadow: none; }
.studio-layout:not(.auth-mode) #mobileNav:not(.hidden) { position: fixed; z-index: 24; left: 16px; top: 125px; bottom: auto; width: 80px; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 8px 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; backdrop-filter: none; }
.studio-layout:not(.auth-mode) .mobile-nav-indicator,
.studio-layout:not(.auth-mode) .mobile-nav::after { display: none; }
.studio-layout:not(.auth-mode) .mobile-nav-item { min-height: 66px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 10px 5px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--studio-muted); }
.studio-layout:not(.auth-mode) .mobile-nav-item span { font-size: 12px; font-weight: 500; }
.studio-layout:not(.auth-mode) .mobile-nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.studio-layout:not(.auth-mode) .mobile-nav-item.active { background: #d8ff4f12; color: var(--accent); border-color: #d8ff4f20; }
.studio-layout:not(.auth-mode) .mobile-nav-item.active::before { display: none; }
.studio-layout:not(.auth-mode) .mobile-nav-item.active svg { filter: none; transform: none; }
.studio-layout #generatorForm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 980px; margin: 0 auto; }
.studio-layout .studio-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 16px 2px 26px; }
.studio-intro p { color: var(--studio-muted); font-size: 11px; letter-spacing: .12em; margin: 0 0 8px; }
.studio-intro h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -.02em; }
.studio-intro > span { color: var(--studio-muted); font-size: 12px; padding-bottom: 4px; }
.studio-layout .studio-composer { width: 100%; padding: 22px; background: var(--studio-panel); border: 1px solid var(--studio-line); border-radius: 18px; position: relative; min-width: 0; }
.studio-mode-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.studio-mode-tabs button { min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; color: #aeb9c1; background: transparent; font-size: 14px; font-weight: 500; transition: color .12s, border-color .12s; }
.studio-mode-tabs button[aria-pressed="true"] { color: #17200b; background: var(--accent); }
.studio-mode-tabs button:disabled { opacity: .5; }
.studio-layout .studio-composer .card { border: 0; padding: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; animation: none; }
.studio-layout .studio-composer .hero-card { position: static; }
.studio-layout .studio-composer .hero-card .card-heading { margin-bottom: 10px; }
.studio-layout .studio-composer .hero-card h2 { font-size: 12px; color: var(--studio-muted); font-weight: 400; }
.studio-layout .studio-composer #workflowName { display: none; }
.studio-layout .studio-composer textarea { background: transparent; border: 0; box-shadow: none; color: #eef2f4; padding: 0; width: 100%; resize: vertical; min-height: 140px; max-height: 380px; font-size: 16px; line-height: 1.8; border-radius: 3px; }
.studio-layout .studio-composer textarea::placeholder { color: #8d9aa5; opacity: 1; }
.studio-layout .studio-composer .prompt-actions { margin: 8px 0 14px; }
.studio-layout .studio-composer .prompt-actions .counter,
.studio-layout .studio-composer .prompt-actions .text-button { font-size: 12px; min-height: 36px; }
.studio-layout .studio-composer .prompt-tools { gap: 12px; }
.studio-layout #imageEditPanel { gap: 12px; }
.studio-layout #imageEditPanel > .card-heading,
.studio-layout #videoPanel { display: none; }
.studio-layout #imageEditPanel > label > span { color: var(--studio-muted); font-size: 12px; }
.studio-layout .image-edit-upload-heading,
.studio-layout .reference-video-heading { margin-top: 8px; flex-wrap: wrap; gap: 8px; }
.studio-layout .image-edit-upload-heading small,
.studio-layout .reference-video-heading small,
.studio-layout .image-edit-upload-limit,
.studio-layout .reference-upload-limit { font-size: 11px; line-height: 1.65; }
.studio-layout .image-edit-upload-heading > span,
.studio-layout .reference-video-heading > span { display: none; }
.studio-layout .image-edit-upload-heading b,
.studio-layout .reference-video-heading b { font-size: 12px; font-weight: 500; }
.studio-layout .edit-upload-zone,
.studio-layout .reference-upload-zone { min-height: 98px; border-radius: 10px; border-color: #52604b; background: #d8ff4f04; }
.studio-layout .edit-upload-zone > span,
.studio-layout .reference-upload-zone > span { gap: 6px; padding: 12px 6px; }
.studio-layout .edit-upload-zone b,
.studio-layout .reference-upload-zone b { font-size: 12px; font-weight: 500; }
.studio-layout .edit-upload-zone small,
.studio-layout .reference-upload-zone small { font-size: 11px; line-height: 1.4; }
.studio-layout .edit-upload-zone img,
.studio-layout .reference-upload-zone img { height: 140px; }
.studio-layout .edit-upload-zone.has-image { min-height: 140px; }
.studio-layout .image-slot-remove { min-width: 44px; min-height: 36px; font-size: 11px; top: 5px; right: 5px; padding: 6px 8px; }
.studio-layout .edit-upload-zone:focus-within,
.studio-layout .reference-upload-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.studio-layout #referenceVideoPanel { margin: 18px 0; }
.studio-layout .studio-video-mode { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; font-size: 12px; color: var(--studio-muted); }
.studio-video-mode select { min-height: 42px; width: auto; max-width: 100%; padding: 8px 12px; background: #171d23; border: 1px solid #303a40; border-radius: 8px; color: #eef2f4; font-size: 13px; }
.studio-layout .studio-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.studio-layout .studio-toolbar > button { min-height: 40px; padding: 8px 12px; font-size: 12px; white-space: nowrap; border-radius: 8px; }
.studio-layout .studio-toolbar > .text-button { color: #bcc7ce; border: 1px solid transparent; background: transparent; }
.studio-layout #studioModelSlot { min-width: 0; max-width: 100%; }
.studio-layout .workflow-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.studio-layout .workflow-field { display: block; min-width: 0; width: 180px; max-width: 230px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.studio-layout .workflow-field > span { display: none; }
.studio-layout .glass-picker-trigger { min-height: 40px; padding: 9px 12px; font-size: 12px; border: 1px solid var(--studio-line); border-radius: 8px; background: #171d23; box-shadow: none; }
.studio-layout .glass-picker-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-layout .glass-picker-menu { background: #1b232b; border-color: #3c4852; box-shadow: 0 16px 45px #0008; backdrop-filter: none; }
.studio-layout .glass-picker-option { min-height: 42px; font-size: 13px; }
.studio-layout .workflow-switch-status { font-size: 12px; }
.studio-layout .studio-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--studio-line); }
.studio-layout #studioSubmitMeta { min-width: 0; display: grid; gap: 4px; }
.studio-layout #studioSubmitMeta small { color: var(--studio-muted); font-size: 11px; }
.studio-layout #studioEstimate { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.studio-layout #studioSubmitSlot { flex: 0 0 auto; }
.studio-layout .action-dock { min-height: 0; width: auto; position: static; pointer-events: auto; animation: none; }
.studio-layout .generate-button,
.studio-layout .action-dock.is-floating .generate-button { position: static; width: auto; min-width: 112px; min-height: 46px; display: flex; align-items: center; gap: 16px; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--accent); color: #17200b; box-shadow: none; transform: none; }
.studio-layout .generate-button .button-icon,
.studio-layout .generate-button small { display: none; }
.studio-layout .generate-button .button-copy b { font-size: 14px; }
.studio-layout .generate-button .arrow { font-size: 19px; }
.studio-layout .generate-button:disabled { opacity: .48; }
.studio-layout .generate-button::before,
.studio-layout .generate-button::after { display: none; }
.studio-layout .generate-button.insufficient-credits { background: #5c4630; color: #ffe2bb; }
.studio-layout:not(.auth-mode) .connection-notice,
.studio-layout:not(.auth-mode) .job-card,
.studio-layout:not(.auth-mode) .results,
.studio-layout:not(.auth-mode) .history-section,
.studio-layout .studio-result-empty { max-width: 980px; margin: 24px auto 0; }
.studio-layout .job-card { border-radius: 12px; box-shadow: none; background: #1a2528; padding: 16px; }
.studio-layout .job-status p { font-size: 14px; }
.studio-layout .job-status span { font-size: 12px; line-height: 1.6; }
.studio-layout .results-heading h2,
.studio-layout .studio-result-empty h2 { font-size: 16px; font-weight: 500; margin: 0 0 12px; }
.studio-layout .studio-result-empty > div { min-height: 155px; display: grid; align-content: center; justify-items: center; gap: 9px; padding: 24px; text-align: center; border: 1px dashed var(--studio-line); border-radius: 14px; color: var(--studio-muted); font-size: 14px; }
.studio-layout .studio-result-empty small { font-size: 12px; }
.studio-layout .history-section { padding-top: 6px; }
.studio-layout .history-section .results-heading h2 { margin-bottom: 4px; }
.studio-layout .history-section .history-quick-count { font-size: 12px; }
.studio-layout #clearHistoryButton { display: none; }
.studio-layout #historyList { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.studio-layout .history-item { padding: 0; background: transparent; border: 0; border-radius: 10px; overflow: hidden; }
.studio-layout .history-item-open { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 0; width: 100%; }
.studio-layout .history-thumb { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.studio-layout .history-copy { padding: 0 3px 10px; }
.studio-layout .history-copy b { font-size: 12px; line-height: 1.6; }
.studio-layout .history-copy small { font-size: 11px; }
.studio-layout .history-quick-actions > button { min-height: 44px; font-size: 12px; }
.studio-layout:not(.auth-mode) footer { display: none; }
.studio-layout .studio-panel-dialog { position: fixed; inset: auto; margin: 0; padding: 18px 20px 16px; width: min(540px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); color: #eef2f4; background: #171d23; border: 1px solid #3b464e; border-radius: 16px; box-shadow: 0 24px 80px #0008; overflow: hidden; }
.studio-layout .studio-panel-dialog[open] { display: flex; flex-direction: column; }
.studio-layout .studio-panel-dialog:not([open]) { display: none; }
.studio-layout .studio-panel-dialog::backdrop { background: #0007; }
.studio-layout.studio-panel-open { overflow: hidden; }
.studio-layout .studio-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex: 0 0 auto; padding-bottom: 12px; }
.studio-panel-heading h2 { margin: 0; font-size: 16px; font-weight: 500; }
.studio-layout .studio-panel-heading button { min-width: 44px; min-height: 44px; font-size: 12px; }
.studio-panel-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px 3px 6px; }
.studio-panel-handle { display: none; }
.studio-panel-footer { flex: 0 0 auto; padding-top: 14px; }
.studio-layout .studio-panel-footer button { width: 100%; min-height: 44px; font-size: 14px; border-radius: 10px; background: var(--accent); color: #17200b; border: 0; box-shadow: none; }
.studio-layout .studio-panel-dialog .card,
.studio-layout .studio-panel-dialog .settings-block,
.studio-layout .studio-panel-dialog .prompt-translator { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; margin: 0; }
.studio-layout .studio-panel-dialog .card { animation: none; }
.studio-layout .studio-panel-dialog .card-heading { margin: 0 0 14px; }
.studio-layout .studio-panel-dialog .card-heading h2 { font-size: 13px; }
.studio-layout .studio-panel-dialog .quick-card > .card-heading { display: none; }
.studio-layout .studio-panel-dialog .preset-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.studio-layout .studio-panel-dialog .preset { min-width: 0; min-height: 88px; padding: 10px 4px; border-radius: 9px; background: #202830; border-color: transparent; box-shadow: none; }
.studio-layout .studio-panel-dialog .preset span { font-size: 12px; }
.studio-layout .studio-panel-dialog .preset small { font-size: 11px; color: #a1adb5; overflow-wrap: anywhere; }
.studio-layout .studio-panel-dialog .preset.active { background: #d8ff4f14; border-color: #d8ff4f55; }
.studio-layout .studio-panel-dialog .output-summary { padding: 13px 0; margin: 12px 0; border: 0; border-radius: 0; background: transparent; }
.studio-layout .studio-panel-dialog .output-symbol,
.studio-layout .studio-panel-dialog #advancedShortcut { display: none; }
.studio-layout .studio-panel-dialog .output-copy small,
.studio-layout .studio-panel-dialog .output-copy em { font-size: 12px; }
.studio-layout .studio-panel-dialog .output-copy b { font-size: 16px; }
.studio-layout .studio-panel-dialog .advanced-heading { padding: 12px 0; min-height: 48px; }
.studio-layout .studio-panel-dialog .advanced-heading h2 { font-size: 13px; }
.studio-layout .studio-panel-dialog .advanced-heading small { font-size: 11px; line-height: 1.5; }
.studio-layout .studio-panel-dialog .advanced-content { padding: 4px 0 10px; }
.studio-layout .studio-panel-dialog .block-heading h3 { font-size: 13px; }
.studio-layout .studio-panel-dialog .block-heading > span { font-size: 11px; line-height: 1.5; }
.studio-layout .studio-panel-dialog label { min-width: 0; font-size: 12px; }
.studio-layout .studio-panel-dialog input:not([type=checkbox]),
.studio-layout .studio-panel-dialog select { min-height: 44px; font-size: 16px; background: #10171d; }
.studio-layout .studio-panel-dialog textarea { font-size: 16px; background: #10171d; min-height: 90px; }
.studio-layout .studio-panel-dialog label > span,
.studio-layout .studio-panel-dialog .switch-row b { font-size: 12px; }
.studio-layout .studio-panel-dialog .switch-row small { font-size: 11px; line-height: 1.6; }
.studio-layout .studio-panel-dialog .switch-row { padding: 14px 0; min-height: 52px; }
.studio-layout .studio-panel-dialog .switch-list { gap: 4px; }
.studio-layout .studio-panel-dialog .segmented button { min-height: 44px; font-size: 13px; }
.studio-layout .studio-panel-dialog .divided-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid #303a40; }
.studio-layout .studio-panel-dialog #promptTranslatorPanel > summary { display: none; }
.studio-layout .studio-panel-dialog .prompt-translator-body { padding: 0; }
.studio-layout .studio-panel-dialog .prompt-translator-body { border: 0; }
.studio-layout #studioEditParameters label { display: grid; gap: 9px; margin-bottom: 16px; }
.studio-layout #studioEditRefine label:not(.hidden) { display: grid; gap: 9px; }
.studio-layout #studioEditRefine .switch-row { display: flex!important; }
.studio-layout #studioEditParameters:not(.hidden) ~ * { margin-top: 16px; }
.studio-layout .studio-panel-dialog #adminStepDebugPanel { margin-top: 18px; border-top: 1px solid #303a40; padding-top: 16px; }
.studio-layout .studio-panel-dialog .admin-step-debug-heading { flex-wrap: wrap; }
.studio-layout .studio-panel-dialog .admin-step-debug-controls { grid-template-columns: 1fr; }
.studio-layout .studio-panel-dialog .admin-step-debug-controls label { grid-template-columns: minmax(0,1fr) minmax(120px,.8fr); }
.studio-layout .studio-panel-dialog .admin-step-debug-controls small { font-size: 11px; }
.studio-layout .studio-panel-dialog .anatomy-lora-option { background: #202830; border-radius: 10px; }
.studio-layout .studio-panel-dialog .anatomy-lora-option b { font-size: 12px; }
.studio-layout .studio-panel-dialog .anatomy-lora-option small { font-size: 11px; }
.studio-layout.video-mode .studio-panel-dialog #videoAnatomyPanel { display: grid; }
.studio-layout.video-mode #studioRefinePanel > .settings-block { display: none; }
.studio-layout.image-edit-mode #studioRefinePanel > .settings-block { display: none; }
.studio-layout .studio-panel-dialog .image-edit-feature-switch { min-height: 54px; }
.studio-layout .studio-panel-dialog .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.studio-layout .studio-panel-dialog .field-grid label::after { font-size: 10px; }
.studio-layout .studio-panel-dialog .field-grid label > span { padding-right: 38px; }
.studio-layout #generatorForm > #videoPanel { display: none; }
@media (min-width: 1600px) {
  .studio-layout:not(.auth-mode) .shell { margin-left: auto; }
}
@media (max-width: 900px) and (min-width: 620px) {
  .studio-layout:not(.auth-mode) .shell { width: calc(100% - 96px); margin-left: 96px; padding: 24px; }
  .studio-layout:not(.auth-mode) #mobileNav:not(.hidden) { width: 70px; left: 10px; }
  .studio-layout .studio-intro > span { display: none; }
}
@media (max-width: 619px) {
  .studio-layout.keyboard-open #mobileNav { visibility: hidden; pointer-events: none; }
  .studio-layout:not(.auth-mode) .shell { width: 100%; margin: 0; padding: max(16px, env(safe-area-inset-top)) 12px calc(106px + env(safe-area-inset-bottom)); }
  .studio-layout:not(.auth-mode) .topbar { display: flex; justify-content: space-between; margin-bottom: 24px; gap: 8px; padding-bottom: 0; }
  .studio-layout:not(.auth-mode) .topbar h1 { font-size: 20px; }
  .studio-layout:not(.auth-mode) .topbar-actions { display: flex; gap: 6px; }
  .studio-layout:not(.auth-mode) #accountButton:not(.hidden) { display: flex!important; }
  .studio-layout:not(.auth-mode) .status-pill { min-height: 36px; padding: 7px 9px; font-size: 11px; }
  .studio-layout:not(.auth-mode) #historyButton,
  .studio-layout:not(.auth-mode) #logoutButton,
  .studio-layout:not(.auth-mode) #connectionButton { display: none; }
  .studio-layout:not(.auth-mode) #mobileNav:not(.hidden) { left: 50%; top: auto; bottom: max(9px,env(safe-area-inset-bottom)); width: min(430px,calc(100vw - 18px)); min-height: 74px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; padding: 6px; border: 1px solid rgba(242,248,246,.24); border-radius: 31px; background: linear-gradient(145deg,rgba(37,45,49,.88),rgba(9,14,18,.9)); box-shadow: 0 20px 58px rgba(0,0,0,.52),inset 0 1px 0 rgba(255,255,255,.18); transform: translateX(-50%) translateZ(0); -webkit-backdrop-filter: blur(28px) saturate(165%); backdrop-filter: blur(28px) saturate(165%); }
  .studio-layout:not(.auth-mode) .mobile-nav-indicator,
  .studio-layout:not(.auth-mode) .mobile-nav::after { display: block; }
  .studio-layout:not(.auth-mode) .mobile-nav-item { min-height: 60px; border: 0; padding: 5px 3px; gap: 3px; border-radius: 25px; }
  .studio-layout:not(.auth-mode) .mobile-nav-item span { font-size: 10px; font-weight: 750; }
  .studio-layout:not(.auth-mode) .mobile-nav-item.active { border: 0; background: transparent; }
  .studio-layout .studio-intro { margin: 0 3px 16px; }
  .studio-layout .studio-intro p { display: none; }
  .studio-layout .studio-intro h2 { font-size: 22px; }
  .studio-layout .studio-intro > span { display: none; }
  .studio-layout .studio-composer { padding: 12px; border-radius: 16px; }
  .studio-layout .studio-mode-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin-bottom: 18px; }
  .studio-layout .studio-mode-tabs button { padding: 9px 3px; min-height: 44px; font-size: 13px; border-radius: 9px; }
  .studio-layout .studio-composer textarea { min-height: 130px; max-height: 300px; }
  .studio-layout .studio-composer .prompt-actions { margin: 4px 0; }
  .studio-layout .studio-composer .prompt-actions .text-button { min-height: 44px; font-size: 11px; }
  .studio-layout .studio-composer .prompt-tools { gap: 9px; }
  .studio-layout .studio-toolbar { gap: 6px; }
  .studio-layout .studio-toolbar > button { min-height: 44px; font-size: 12px; padding: 8px 9px; }
  .studio-layout #studioPresetsButton { order: -2; }
  .studio-layout #studioTranslationButton { order: -1; }
  .studio-layout #studioModelSlot { flex: 1 1 calc(100% - 138px); }
  .studio-layout .workflow-controls { gap: 6px; }
  .studio-layout .workflow-field { width: auto; flex: 1 1 100%; max-width: 100%; }
  .studio-layout .workflow-controls:has(.model-field:not(.hidden)) .workflow-field { flex-basis: 100%; }
  .studio-layout .glass-picker-trigger { min-height: 44px; font-size: 12px; padding: 10px; }
  .studio-layout .glass-picker-menu { left: 0; right: auto; width: min(360px,calc(100vw - 56px)); }
  .studio-layout .studio-submit-row { gap: 8px; margin-top: 12px; padding-top: 12px; }
  .studio-layout #studioSubmitMeta small { display: none; }
  .studio-layout #studioEstimate { font-size: 11px; }
  .studio-layout .generate-button { min-width: 91px; min-height: 46px; padding: 10px 14px; gap: 10px; }
  .studio-layout .image-edit-upload-grid,
  .studio-layout .reference-upload-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .studio-layout .edit-upload-zone,
  .studio-layout .reference-upload-zone { min-height: 92px; }
  .studio-layout .edit-upload-zone b,
  .studio-layout .reference-upload-zone b { font-size: 11px; }
  .studio-layout .edit-upload-zone img,
  .studio-layout .reference-upload-zone img { height: 106px; }
  .studio-layout .edit-upload-zone.has-image { min-height: 106px; }
  .studio-layout .image-edit-upload-footer,
  .studio-layout .reference-upload-footer { flex-wrap: wrap; gap: 5px; align-items: start; }
  .studio-layout .image-edit-upload-footer button,
  .studio-layout .reference-upload-footer button { min-height: 44px; font-size: 11px; }
  .studio-layout .studio-result-empty > div { min-height: 130px; font-size: 13px; padding: 20px 14px; }
  .studio-layout .studio-result-empty small { font-size: 11px; }
  .studio-layout:not(.auth-mode) .job-card,
  .studio-layout:not(.auth-mode) .results,
  .studio-layout:not(.auth-mode) .history-section,
  .studio-layout .studio-result-empty { margin-top: 20px; }
  .studio-layout .studio-panel-dialog { top: auto!important; left: 0!important; bottom: var(--studio-viewport-bottom, 0px); width: 100%; max-height: calc(var(--studio-viewport-height, 100dvh) - 16px); padding: 10px 16px max(16px,env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0; }
  .studio-layout .studio-panel-handle { display: block; flex: 0 0 4px; height: 4px; width: 32px; border-radius: 4px; margin: 0 auto 6px; background: #48535b; }
  .studio-layout .studio-panel-heading { padding-bottom: 8px; }
  .studio-layout .studio-panel-dialog .preset-grid { gap: 6px; }
  .studio-layout .studio-panel-dialog .preset { min-height: 82px; padding: 8px 2px; }
  .studio-layout .studio-panel-dialog .preset small { font-size: 11px; }
  .studio-layout .studio-panel-dialog .admin-step-debug-controls label { grid-template-columns: 1fr; }
  .studio-layout .studio-panel-dialog .output-copy em { white-space: normal; }
  .studio-layout .history-batch-actions { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .studio-layout #historyList { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
}

/* The player owns clipping so native video layers cannot cover card corners. */
.video-player { width: 100%; min-width: 0; overflow: hidden; border-radius: 22px 22px 0 0; background: #080d11; isolation: isolate; }
.video-player-stage { display: grid; place-items: center; position: relative; min-height: 150px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: inherit; clip-path: inset(0 round 22px 22px 0 0); background: #080d11; }
.result-item .video-player video, .viewer-content .video-player video { display: block; width: 100%; height: 100%; max-height: 72dvh; object-fit: contain; border-radius: inherit; }
.video-player-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid #ffffff0c; color: #a6b3bb; background: #141c23; }
.video-player-status { min-width: 0; font-size: 11px; line-height: 1.5; }
.video-compat-button { flex: 0 0 auto; min-height: 36px; padding: 7px 12px; border: 1px solid #d8ff4f38; border-radius: 999px; color: var(--accent); background: #d8ff4f0b; font: inherit; font-size: 12px; cursor: pointer; }
.video-compat-button:disabled { cursor: progress; opacity: .65; }
.viewer-content > .video-player { max-width: 960px; margin: auto; border-radius: 16px; }
.viewer-content > .video-player .video-player-stage { border-radius: 16px 16px 0 0; clip-path: inset(0 round 16px 16px 0 0); }
.viewer-content > .video-player .video-player-stage { aspect-ratio: auto!important; height: max(140px,calc(100dvh - 200px)); min-height: 0; }
.viewer-content > .video-player video { max-height: 100%; }
.studio-layout .result-item { border-radius: 24px; isolation: isolate; }
.studio-layout .result-item:has(.video-player) { transform: none; animation: none; }
/* Complete the workbench surfaces using the existing dark/green tokens. */
.studio-layout .result-item { background: var(--studio-panel); border-color: var(--studio-line); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .result-meta { min-height: 52px; gap: 12px; font-size: 12px; }
.studio-layout .result-links { flex-wrap: wrap; justify-content: flex-end; }
.studio-layout .result-links a, .studio-layout .result-links button { min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
.studio-layout .results-heading .chip { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.studio-layout .result-actions button { min-height: 40px; font-size: 12px; }
.studio-layout .history-item-open { cursor: pointer; }
.studio-layout .history-copy { padding-bottom: 4px; }
.studio-layout .history-item-delete { width: auto; min-height: 44px; margin: 4px 3px 10px; padding: 8px 13px; border-radius: 999px; font-size: 11px; }
@media (max-width: 619px) {
  .studio-layout:not(.auth-mode) .topbar { margin-bottom: 16px; }
  .studio-layout .studio-intro { margin-bottom: 14px; }
  .studio-layout .studio-intro h2 { font-size: 20px; }
  .studio-layout .studio-mode-tabs { margin-bottom: 16px; }
  .studio-layout .studio-composer textarea { height: 144px; min-height: 120px; max-height: 280px; line-height: 1.65; }
  .studio-layout .studio-composer .prompt-actions { margin-bottom: 0; }
  .studio-layout .studio-toolbar { gap: 7px; margin-top: 12px; }
  .studio-layout #studioModelSlot { flex: 1 1 100%; order: 0; }
  .studio-layout .workflow-controls { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; }
  .studio-layout .workflow-controls:has(.model-field:not(.hidden)) { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
  .studio-layout .workflow-field { width: 100%; max-width: none; }
  .studio-layout .workflow-switch-status { grid-column: 1 / -1; }
  .studio-layout .studio-toolbar > button { flex: 1 1 0; min-width: 0; order: 1; padding: 8px 3px; font-size: 11px; }
  .studio-layout #studioParametersButton { flex-grow: 1.2; }
  .studio-layout #studioRefineButton { flex-grow: .6; }
  .studio-layout #studioPresetsButton, .studio-layout #studioTranslationButton { order: 1; }
  .studio-layout .studio-submit-row { margin-top: 10px; padding-top: 10px; }
  .studio-layout .result-meta { padding: 8px 12px; }
  .studio-layout .result-name { max-width: 55%; font-size: 11px; }
  .studio-layout .result-actions { margin-bottom: 10px; gap: 6px; }
  .studio-layout .result-actions button { font-size: 11px; }
  .studio-layout .results-heading h2 { margin-bottom: 8px; }
}
@media (prefers-reduced-transparency: reduce) {
  .studio-layout:not(.auth-mode) #mobileNav:not(.hidden) { background: #151e24; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-layout button,
  .studio-layout .studio-composer,
  .studio-layout .studio-panel-dialog { animation: none!important; transition: none!important; }
}

/* Official Qwen 2511 edit: tab badge, inline sample-mode switch, sheet controls. */
.studio-mode-tabs .studio-mode-badge { margin-left: 6px; padding: 1px 5px; border: 1px solid currentColor; border-radius: 5px; font-size: 10px; line-height: 1.4; opacity: .7; vertical-align: 1px; }
.official-edit-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 12px 0 2px; border-top: 1px solid var(--studio-line, #303a40); }
.official-edit-mode-copy { display: grid; gap: 3px; min-width: 0; }
.official-edit-mode-copy b { font-size: 12px; font-weight: 500; color: #eef2f4; }
.official-edit-mode-copy small { font-size: 11px; line-height: 1.5; color: var(--studio-muted, #a1adb5); }
.official-edit-segments { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--studio-line, #303a40); border-radius: 12px; background: #10171d; max-width: 100%; }
.official-edit-segments button { min-height: 36px; padding: 6px 14px; border: 0; border-radius: 8px; color: #aeb9c1; background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: none; transition: color .12s, background-color .12s; }
.official-edit-segments button:hover { color: #eef2f4; }
.official-edit-segments button[aria-checked="true"] { color: #17200b; background: var(--accent); }
.official-edit-segments button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.official-edit-parameters { display: grid; gap: 4px; margin-top: 8px; }
.studio-layout #studioEditParameters .official-edit-parameters .switch-row { display: flex; }
.official-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 6px; }
.official-edit-parameters > label:not(.switch-row) { display: grid; gap: 6px; }
#repairThresholdField > span { display: grid; gap: 3px; }
#repairThresholdField small,
.official-edit-parameters > label:not(.switch-row) small { display: block; font-size: 11px; line-height: 1.5; color: var(--studio-muted, #a1adb5); font-weight: 400; }
.official-repair-detector { display: grid; gap: 10px; padding: 4px 0 14px; border-bottom: 1px solid var(--studio-line, #303a40); }
.official-repair-detector .official-edit-segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.official-repair-detector .official-edit-segments button { padding: 6px 4px; }
.official-option-note { margin: 0 0 4px; padding: 9px 12px; border-radius: 10px; background: #d8ff4f12; color: #dfe9c4; font-size: 12px; line-height: 1.5; }
.official-edit-loras { display: grid; gap: 2px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--studio-line, #303a40); }
.official-edit-loras-heading { display: grid; gap: 3px; }
.official-edit-loras-heading b { font-size: 12px; font-weight: 500; }
.official-edit-loras-heading small { font-size: 11px; color: var(--studio-muted, #a1adb5); }
.pricing-form .pricing-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 4px 0 0; padding: 12px; border: 1px solid #303a40; border-radius: 13px; min-width: 0; }
.pricing-form .pricing-group legend { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 0 6px; color: #eef2f4; font-size: 12px; font-weight: 500; }
.pricing-form .pricing-group legend small { color: #9da7b4; font-size: 11px; font-weight: 400; }
@media (max-width: 619px) {
  .official-edit-mode { align-items: stretch; }
  .official-edit-segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; }
  .official-edit-segments button { padding: 6px 4px; font-size: 12px; }
  .pricing-form .pricing-group { grid-template-columns: 1fr; }
  .studio-mode-tabs .studio-mode-badge { display: none; }
}
@media (max-width: 900px) and (min-width: 620px) {
  .pricing-form .pricing-group { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Layout pass: one content column for every page, side-by-side create view on wide screens,
   and the history / tools / account pages moved onto the same flat studio surfaces. */
body.studio-layout:not(.auth-mode) { --studio-content: 1280px; --studio-field: #10171d; --studio-hover: #1d252c; }
.studio-layout:not(.auth-mode) .shell { max-width: var(--studio-content); }
.studio-layout #generatorForm { max-width: none; }
.studio-layout:not(.auth-mode) .connection-notice,
.studio-layout:not(.auth-mode) .job-card,
.studio-layout:not(.auth-mode) .results,
.studio-layout:not(.auth-mode) .history-section,
.studio-layout .studio-result-empty { max-width: none; margin-left: 0; margin-right: 0; }
.studio-layout .studio-intro { margin-top: 0; }
.studio-layout .studio-composer .prompt-actions { align-items: center; }
.studio-layout .studio-composer .prompt-actions .counter { color: var(--studio-muted); }

@media (min-width: 1280px) {
  body.studio-layout:not(.auth-mode):not(.history-page-open):not(.private-space-page-open):not(.tools-page-open):not(.account-page-open) .shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    grid-template-rows: auto auto auto auto auto auto auto 1fr;
    column-gap: 32px;
    align-items: start;
  }
  /* Unwrap the form so its intro can sit above both columns and the composer
     lines up with the result column. Its .hidden state still wins (!important). */
  .studio-layout:not(.auth-mode) .shell > #generatorForm { display: contents; }
  .studio-layout:not(.auth-mode) .shell > .topbar { grid-column: 1 / -1; grid-row: 1; }
  .studio-layout:not(.auth-mode) .shell > .connection-notice { grid-column: 1 / -1; grid-row: 2; margin: 0 0 20px; }
  .studio-layout:not(.auth-mode) #generatorForm > .studio-intro { grid-column: 1 / -1; grid-row: 3; }
  .studio-layout:not(.auth-mode) #generatorForm > .studio-composer { grid-column: 1; grid-row: 4 / span 5; }
  .studio-layout:not(.auth-mode) .shell > #jobCard { grid-column: 2; grid-row: 4; margin: 0 0 16px; }
  .studio-layout:not(.auth-mode) .shell > #resultSection { grid-column: 2; grid-row: 5; margin: 0 0 24px; }
  .studio-layout:not(.auth-mode) .shell > #studioResultEmpty { grid-column: 2; grid-row: 6; margin: 0 0 24px; }
  .studio-layout:not(.auth-mode) .shell > #historySection { grid-column: 2; grid-row: 7; margin: 0; padding-top: 0; }
  .studio-layout .studio-result-empty { display: grid; }
  .studio-layout .studio-result-empty.hidden { display: none; }
  .studio-layout .studio-result-empty h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .studio-layout:not(.auth-mode) .shell > #resultSection .results-heading h2 { font-size: 15px; }
  .studio-layout .studio-result-empty > div { min-height: 360px; border-radius: 18px; background: #12181d; }
  .studio-layout #historyList { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .studio-layout:not(.auth-mode) .shell > #resultSection .result-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Secondary pages: headings */
.studio-layout:not(.auth-mode) .account-page-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 0 2px; margin-bottom: 10px; align-items: end; }
.studio-layout:not(.auth-mode) #historyBackButton,
.studio-layout:not(.auth-mode) #accountBackButton,
.studio-layout:not(.auth-mode) .tools-page-heading > .chip { display: none; }
.studio-layout:not(.auth-mode) .private-space-page .account-page-heading { grid-template-columns: auto minmax(0, 1fr) auto; }
.studio-layout:not(.auth-mode) .account-page-heading small,
.studio-layout:not(.auth-mode) .admin-title-row small { color: var(--studio-muted); font-family: inherit; font-size: 11px; font-weight: 400; line-height: 1.2; letter-spacing: .12em; }
.studio-layout:not(.auth-mode) .account-page-heading h2,
.studio-layout:not(.auth-mode) .admin-title-row h2 { margin: 8px 0 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -.02em; }
.studio-layout:not(.auth-mode) .admin-title-row { padding: 28px 2px 4px; }
.studio-layout:not(.auth-mode) .admin-title-row h2 { font-size: 22px; }
.studio-layout:not(.auth-mode) .page-intro { color: var(--studio-muted); font-size: 13px; line-height: 1.7; }
.studio-layout:not(.auth-mode) .tools-page-intro { margin: -4px 0 6px; }

/* Secondary pages: surfaces */
.studio-layout:not(.auth-mode) .history-page,
.studio-layout:not(.auth-mode) .tools-view,
.studio-layout:not(.auth-mode) .account-view { gap: 16px; animation-duration: .22s; }
.studio-layout:not(.auth-mode) .history-page .card,
.studio-layout:not(.auth-mode) .account-view .card,
.studio-layout:not(.auth-mode) .admin-stat,
.studio-layout:not(.auth-mode) .tool-entry { background: var(--studio-panel); border: 1px solid var(--studio-line); border-radius: 16px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout:not(.auth-mode) .history-page .card,
.studio-layout:not(.auth-mode) .account-view .card:not(.account-collapsible) { padding: 22px; }
.studio-layout:not(.auth-mode) .account-view .card::before,
.studio-layout:not(.auth-mode) .account-view .card::after,
.studio-layout:not(.auth-mode) .history-page .card::before,
.studio-layout:not(.auth-mode) .history-page .card::after { display: none; }
.studio-layout:not(.auth-mode) .account-grid { gap: 16px; }
.studio-layout:not(.auth-mode) .account-section-heading { margin-bottom: 18px; }
.studio-layout:not(.auth-mode) .account-section-heading h2 { font-size: 16px; font-weight: 500; }
.studio-layout:not(.auth-mode) .account-section-heading small,
.studio-layout:not(.auth-mode) .account-ledger-summary small,
.studio-layout:not(.auth-mode) .admin-operations-summary small { color: var(--studio-muted); font-size: 12px; }
.studio-layout:not(.auth-mode) .account-ledger-summary b,
.studio-layout:not(.auth-mode) .admin-operations-summary b { font-size: 16px; font-weight: 500; }
.studio-layout:not(.auth-mode) .account-collapsible[open] .account-ledger-summary { background: transparent; border-bottom-color: var(--studio-line); }
.studio-layout:not(.auth-mode) .account-empty { color: var(--studio-muted); font-size: 13px; }

/* Secondary pages: controls */
.studio-layout:not(.auth-mode) .account-form { gap: 14px; }
.studio-layout:not(.auth-mode) .account-form label,
.studio-layout:not(.auth-mode) .admin-form-grid label { gap: 8px; color: var(--studio-muted); font-size: 12px; }
.studio-layout:not(.auth-mode) .account-view input:not([type=checkbox]):not([type=radio]):not([type=file]),
.studio-layout:not(.auth-mode) .account-view select { height: 44px; padding: 0 13px; border: 1px solid var(--studio-line); border-radius: 10px; background: var(--studio-field); color: #eef2f4; font-size: 14px; box-shadow: none; }
.studio-layout:not(.auth-mode) .account-view input:focus { border-color: #d8ff4f80; outline: none; }
.studio-layout:not(.auth-mode) .account-view .secondary-button { min-height: 44px; border: 1px solid #d8ff4f40; border-radius: 10px; background: #d8ff4f12; color: var(--accent); font-size: 14px; font-weight: 600; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout:not(.auth-mode) .account-view .secondary-button::before,
.studio-layout:not(.auth-mode) .account-view .secondary-button::after { display: none; }
.studio-layout:not(.auth-mode) .history-page .outline-button,
.studio-layout:not(.auth-mode) .account-view .admin-mini-button,
.studio-layout:not(.auth-mode) .account-page-heading .chip,
.studio-layout:not(.auth-mode) .admin-title-row .chip,
.studio-layout:not(.auth-mode) #privateSpaceBackButton { min-height: 38px; padding: 7px 14px; border: 1px solid var(--studio-line); border-radius: 10px; background: var(--studio-panel); color: #dfe6ea; font-size: 12px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout:not(.auth-mode) .history-page-actions { gap: 8px; align-items: center; }
.studio-layout:not(.auth-mode) .history-page-actions .text-button { min-height: 38px; color: var(--studio-muted); font-size: 12px; }

/* Account details */
.studio-layout:not(.auth-mode) .profile-avatar { width: 72px; height: 72px; border-radius: 18px; border-color: #d8ff4f40; background: #d8ff4f10; }
.studio-layout:not(.auth-mode) .profile-avatar::before { display: none; }
.studio-layout:not(.auth-mode) .profile-avatar i { font-size: 11px; }
.studio-layout:not(.auth-mode) .profile-copy small { color: var(--studio-muted); font-size: 12px; }
.studio-layout:not(.auth-mode) .profile-copy p { color: var(--studio-muted); font-size: 13px; }
.studio-layout:not(.auth-mode) .credit-balance-card { min-height: 84px; margin: 20px 0; padding: 16px 18px; border: 1px solid #d8ff4f2e; border-radius: 12px; background: #d8ff4f0a; box-shadow: none; }
.studio-layout:not(.auth-mode) .credit-balance-card::before,
.studio-layout:not(.auth-mode) .credit-balance-card::after { display: none; }
.studio-layout:not(.auth-mode) .credit-balance-card small { color: var(--studio-muted); font-size: 12px; }
.studio-layout:not(.auth-mode) .credit-balance-card b { font-size: 30px; }
.studio-layout:not(.auth-mode) .credit-balance-card i { font-size: 24px; filter: none; opacity: .8; }
.studio-layout:not(.auth-mode) .security-details summary { font-size: 13px; }
.studio-layout:not(.auth-mode) .admin-overview { gap: 12px; }
.studio-layout:not(.auth-mode) .admin-stat { padding: 16px; border-radius: 12px; }
.studio-layout:not(.auth-mode) .admin-stat small { font-size: 12px; color: var(--studio-muted); }
.studio-layout:not(.auth-mode) .admin-stat b { margin-top: 10px; font-size: 24px; }

/* Tools */
.studio-layout:not(.auth-mode) .tools-grid { gap: 14px; }
.studio-layout:not(.auth-mode) .tool-entry { min-height: 104px; padding: 18px 20px; gap: 16px; color: #eef2f4; transition: border-color .15s, background-color .15s; }
.studio-layout:not(.auth-mode) .tool-entry::before,
.studio-layout:not(.auth-mode) .tool-entry::after { display: none; }
.studio-layout:not(.auth-mode) .tool-entry-icon { width: 44px; height: 44px; border-radius: 12px; border-color: #d8ff4f30; background: #d8ff4f0d; font-size: 18px; }
.studio-layout:not(.auth-mode) .tool-entry > span:nth-child(2) { gap: 6px; }
.studio-layout:not(.auth-mode) .tool-entry b { font-size: 15px; font-weight: 500; }
.studio-layout:not(.auth-mode) .tool-entry small { color: var(--studio-muted); font-size: 12px; }
.studio-layout:not(.auth-mode) .tool-entry > i { color: var(--studio-muted); transition: color .15s, transform .15s; }

/* History library */
.studio-layout:not(.auth-mode) .history-library-card { gap: 18px; }
.studio-layout:not(.auth-mode) .history-library-item { border: 1px solid var(--studio-line); border-radius: 12px; background: #131a20; box-shadow: none; }
.studio-layout:not(.auth-mode) .history-library-copy { padding: 10px 12px 12px; }
.studio-layout:not(.auth-mode) .history-library-copy b { font-size: 12px; font-weight: 500; }
.studio-layout:not(.auth-mode) .history-library-copy small { color: var(--studio-muted); font-size: 11px; }
.studio-layout:not(.auth-mode) .history-library-actions button { font-size: 12px; }
.studio-layout:not(.auth-mode) #historyPageEmpty,
.studio-layout:not(.auth-mode) #privateSpaceEmpty { min-height: 220px; display: grid; place-items: center; margin: 0; border: 0; background: transparent; }
.studio-layout:not(.auth-mode) #historyPageEmpty.hidden,
.studio-layout:not(.auth-mode) #privateSpaceEmpty.hidden { display: none; }
@media (min-width: 1100px) {
  .studio-layout:not(.auth-mode) .history-library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}

@media (hover: hover) {
  .studio-layout:not(.auth-mode) .tool-entry:hover { border-color: #d8ff4f55; background: var(--studio-hover); transform: none; }
  .studio-layout:not(.auth-mode) .tool-entry:hover > i { color: var(--accent); transform: translateX(2px); }
  .studio-layout:not(.auth-mode) .mobile-nav-item:not(.active):hover { color: #eef2f4; background: #ffffff08; }
  .studio-layout:not(.auth-mode) .history-page .outline-button:hover,
  .studio-layout:not(.auth-mode) .account-view .admin-mini-button:hover { border-color: #4a5760; background: var(--studio-hover); transform: none; }
}

@media (max-width: 619px) {
  .studio-layout:not(.auth-mode) .account-page-heading { margin-bottom: 4px; }
  .studio-layout:not(.auth-mode) .account-page-heading small { display: none; }
  .studio-layout:not(.auth-mode) .account-page-heading h2 { margin-top: 0; font-size: 20px; }
  .studio-layout:not(.auth-mode) .private-space-page .account-page-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .studio-layout:not(.auth-mode) .history-page .card,
  .studio-layout:not(.auth-mode) .account-view .card:not(.account-collapsible) { padding: 16px; }
  .studio-layout:not(.auth-mode) .account-view input:not([type=checkbox]):not([type=radio]):not([type=file]),
  .studio-layout:not(.auth-mode) .account-view select { font-size: 16px; }
  .studio-layout:not(.auth-mode) .tool-entry { min-height: 84px; padding: 14px 16px; }
  .studio-layout:not(.auth-mode) .admin-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .studio-layout:not(.auth-mode) .admin-stat b { font-size: 20px; }
  .studio-layout:not(.auth-mode) .history-library-grid { gap: 10px; }
}

/* Result and works cards: contained media, actions under the image, quiet per-item controls. */
.studio-layout:not(.auth-mode) #resultSection { display: flex; flex-direction: column; }
.studio-layout:not(.auth-mode) #resultSection.hidden { display: none; }
.studio-layout .results-heading { align-items: center; margin-bottom: 12px; padding: 0 2px; }
.studio-layout .results-heading h2 { margin: 0; }
.studio-layout .results-heading .chip,
.studio-layout .history-quick-count { padding: 4px 9px; border: 1px solid var(--studio-line); border-radius: 999px; background: transparent; color: var(--studio-muted); font-size: 11px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout #resultSection .result-actions { order: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.studio-layout .result-actions button,
.studio-layout .history-quick-actions .outline-button,
.studio-layout .history-page-button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--studio-line); border-radius: 10px; background: var(--studio-panel); color: #dfe6ea; font-size: 12px; font-weight: 500; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .result-actions .accent-outline { border-color: #d8ff4f40; background: #d8ff4f12; color: var(--accent); }
.studio-layout .result-grid { gap: 12px; }
.studio-layout .result-item { border-radius: 16px; animation: none; }
.studio-layout .result-media-button { display: grid; place-items: center; background: #0a0f13; }
.studio-layout .result-media-button img { width: auto; max-width: 100%; height: auto; max-height: min(64vh, 620px); object-fit: contain; }
.studio-layout .result-item .video-player { border-radius: 16px 16px 0 0; }
.studio-layout .result-item .video-player-stage { clip-path: inset(0 round 16px 16px 0 0); }
.studio-layout .result-meta { min-height: 52px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--studio-line); color: var(--studio-muted); }
.studio-layout .result-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-layout .result-links a.download-link { min-height: 34px; padding: 6px 12px; border: 1px solid #d8ff4f40; border-radius: 9px; background: #d8ff4f12; font-size: 12px; font-weight: 600; }
.studio-layout .result-view-button { min-height: 34px; padding: 6px 12px; border: 1px solid var(--studio-line); border-radius: 9px; background: transparent; color: #dfe6ea; font-size: 12px; }

/* Recent works on the create page */
.studio-layout .history-quick-actions { gap: 6px; }
.studio-layout .history-quick-actions .text-button { min-height: 36px; padding: 6px 8px; color: var(--studio-muted); font-size: 12px; }
.studio-layout .history-quick-actions .outline-button { min-height: 36px; padding: 6px 12px; }
.studio-layout .history-item { position: relative; border: 0; border-radius: 12px; background: transparent; box-shadow: none; transform: none; }
.studio-layout .history-item-open { gap: 8px; border-radius: 12px; background: transparent; }
.studio-layout .history-thumb { border: 1px solid var(--studio-line); border-radius: 12px; background: #0a0f13; transition: border-color .15s, filter .15s; }
.studio-layout .history-copy { display: grid; gap: 3px; min-width: 0; padding: 0 2px 4px; }
.studio-layout .history-copy b,
.studio-layout .history-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-layout .history-copy b { font-weight: 500; }
.studio-layout .history-copy small { color: var(--studio-muted); }
.studio-layout .history-item-delete { position: absolute; z-index: 2; top: 6px; right: 6px; width: auto; min-height: 30px; margin: 0; padding: 4px 10px; border: 0; border-radius: 8px; background: #0d1115d9; color: #ffb3bb; font-size: 11px; }
.studio-layout .history-pagination { gap: 6px; padding-top: 12px; }
.studio-layout .history-page-button { min-width: 36px; min-height: 36px; height: auto; padding: 0 10px; }
.studio-layout .history-page-button.active { border-color: var(--accent); background: var(--accent); color: #17200b; font-weight: 600; box-shadow: none; }
.studio-layout .history-page-button:disabled { opacity: .4; }
@media (min-width: 1280px) {
  .studio-layout #historyList { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
}

/* Works page: grid sits on the page, the empty state gets its own box. */
.studio-layout:not(.auth-mode) .history-page .history-library-card { padding: 0; border: 0; background: transparent; }
.studio-layout:not(.auth-mode) #historyPageEmpty,
.studio-layout:not(.auth-mode) #privateSpaceEmpty { border: 1px dashed var(--studio-line); border-radius: 16px; background: #12181d; }
.studio-layout:not(.auth-mode) .private-space-page .page-intro { padding: 12px 14px; border-radius: 12px; background: var(--studio-panel); }
.studio-layout:not(.auth-mode) .history-library-item { transition: border-color .15s; }
.studio-layout:not(.auth-mode) .history-library-image { aspect-ratio: 4 / 5; background: #0a0f13; }
.studio-layout:not(.auth-mode) .history-library-copy b { font-size: 13px; }
.studio-layout:not(.auth-mode) .history-library-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-layout .history-item-menu::before { width: 34px; height: 28px; border: 0; border-radius: 8px; background: #0d1115cc; box-shadow: none; color: #eef2f4; }
.studio-layout .history-library-item.is-selected { border-color: var(--accent); }
.studio-layout .history-batch-actions { gap: 8px; padding: 10px 12px; border: 1px solid var(--studio-line); border-radius: 14px; background: #1b232b; box-shadow: 0 16px 40px #0009; }
.studio-layout .history-batch-actions > span { color: #eef2f4; font-size: 12px; font-weight: 500; }
.studio-layout .history-batch-actions button { min-height: 36px; padding: 6px 12px; font-size: 12px; }
.studio-layout .history-batch-actions .outline-button { border: 1px solid var(--studio-line); border-radius: 9px; background: var(--studio-panel); color: #dfe6ea; box-shadow: none; }
.studio-layout .history-batch-actions .history-delete-button { color: #ffb3bb; border-color: #ff6d7a55; }

@media (hover: hover) {
  .studio-layout .history-item-delete,
  .studio-layout .history-item-menu { opacity: 0; transition: opacity .15s; }
  .studio-layout .history-item:hover .history-item-delete,
  .studio-layout .history-item:focus-within .history-item-delete,
  .studio-layout .history-library-item:hover .history-item-menu,
  .studio-layout .history-library-item:focus-within .history-item-menu { opacity: 1; }
  .studio-layout .history-item:hover { transform: none; box-shadow: none; }
  .studio-layout .history-item:hover .history-thumb { border-color: #5a6770; filter: brightness(1.06); }
  .studio-layout:not(.auth-mode) .history-library-item:hover { border-color: #4a5760; }
  .studio-layout .result-actions button:hover,
  .studio-layout .history-page-button:not(.active):not(:disabled):hover { border-color: #4a5760; background: var(--studio-hover, #1d252c); transform: none; }
  .studio-layout .result-item:hover { transform: none; box-shadow: none; }
}

@media (max-width: 619px) {
  .studio-layout .result-media-button img { max-height: 62vh; }
  .studio-layout #resultSection .result-actions { margin-top: 10px; }
  .studio-layout .result-actions button { min-height: 44px; }
  .studio-layout .history-item-delete { top: 5px; right: 5px; min-height: 28px; padding: 3px 8px; }
  .studio-layout .history-page-button { min-width: 44px; min-height: 44px; }
  .studio-layout:not(.auth-mode) .history-library-copy { padding: 8px 10px 10px; }
  .studio-layout:not(.auth-mode) .history-library-copy b { font-size: 12px; }
}

/* Login: keep the glass card and entry motion, tighten hierarchy and make every line readable. */
.auth-card .card-heading { justify-content: center; margin-bottom: 6px; text-align: center; }
.auth-card .card-heading > div { justify-content: center; }
.auth-card .card-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.auth-card .auth-copy { display: block; margin: 0 0 8px; color: #9aa5b1; font-size: 13px; line-height: 1.6; text-align: center; }
.auth-card .auth-mark { margin-bottom: 18px; }
.auth-row { gap: 12px; }
.auth-row input#username,
.auth-row .password-field input { height: 52px; border-radius: 14px; }
.auth-row .password-visibility-button { min-width: 52px; height: 38px; border-radius: 10px; font-size: 12px; }
.auth-notice { border-radius: 12px; font-size: 12px; }
.auth-notice summary span { font-size: 13px; }
.auth-notice summary { padding: 0 14px; }
.auth-notice summary small { margin-left: auto; font-size: 11px; }
.auth-notice ul { gap: 8px; }
.auth-consent { align-items: flex-start; gap: 10px; padding: 2px 2px 4px; font-size: 12px; line-height: 1.6; }
.auth-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.auth-row #loginButton { min-height: 52px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--accent); color: #17200b; font-size: 16px; font-weight: 700; letter-spacing: .08em; box-shadow: 0 10px 30px rgba(216,255,79,.16); }
.auth-row #loginButton::before,
.auth-row #loginButton::after { display: none; }
.auth-row #loginButton:disabled { opacity: .62; box-shadow: none; }
.auth-card .field-error { font-size: 12px; text-align: center; }
.auth-card .field-error:empty { min-height: 0; margin: 0; }
.auth-mode footer { color: #66717d; font-size: 10px; letter-spacing: .18em; }
@media (hover: hover) {
  .auth-row #loginButton:not(:disabled):hover { background: #e2ff76; transform: translateY(-1px); }
}
@media (max-width: 619px) {
  .auth-card .card-heading h2 { font-size: 20px; }
  .auth-card .auth-mark { margin-bottom: 14px; }
}

/* Settings sheets, dialogs, viewer and toasts on the flat studio surfaces. */
html { scrollbar-color: #2e3840 #0d1115; }
.studio-layout textarea,
.studio-layout .studio-panel-scroll,
.studio-layout .glass-picker-options { scrollbar-width: thin; scrollbar-color: #3a464f transparent; }
.studio-layout textarea::-webkit-scrollbar,
.studio-layout .studio-panel-scroll::-webkit-scrollbar,
.studio-layout .glass-picker-options::-webkit-scrollbar { width: 8px; }
.studio-layout textarea::-webkit-scrollbar-thumb,
.studio-layout .studio-panel-scroll::-webkit-scrollbar-thumb,
.studio-layout .glass-picker-options::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #3a464f padding-box; }
.studio-layout textarea::-webkit-scrollbar-button,
.studio-layout .studio-panel-scroll::-webkit-scrollbar-button { display: none; }

/* Sheet: fields */
.studio-layout .studio-panel-heading h2 { font-size: 17px; font-weight: 600; }
.studio-layout .studio-panel-heading button { color: var(--studio-muted); }
.studio-layout .studio-panel-dialog small { font-size: 11px; }
.studio-layout .studio-panel-dialog input:not([type=checkbox]):not([type=radio]):not([type=range]),
.studio-layout .studio-panel-dialog select,
.studio-layout .studio-panel-dialog textarea { border: 1px solid var(--studio-line); border-radius: 10px; background: #10171d; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .studio-panel-dialog input:focus,
.studio-layout .studio-panel-dialog textarea:focus,
.studio-layout .studio-panel-dialog select:focus { border-color: #d8ff4f80; outline: none; }
.studio-layout .studio-panel-dialog label > span,
.studio-layout .studio-panel-dialog .prompt-translator-body label { color: var(--studio-muted); font-size: 12px; }
.studio-layout .studio-panel-dialog .block-heading { align-items: baseline; margin-bottom: 12px; }
.studio-layout .studio-panel-dialog .block-heading h3 { font-size: 14px; font-weight: 600; }
.studio-layout .studio-panel-dialog .block-heading > span { color: var(--studio-muted); }
.studio-layout #studioRefinePanel > .settings-block:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.studio-layout #studioRefinePanel > .settings-block:first-of-type .block-heading h3 { display: none; }

/* Sheet: size presets */
.studio-layout .studio-panel-dialog .preset { display: grid; grid-template-rows: 24px auto auto; justify-items: center; align-content: center; gap: 4px; background: #1e262d; border: 1px solid transparent; border-radius: 10px; transition: border-color .15s, background-color .15s; }
.studio-layout .studio-panel-dialog .preset .ratio { align-self: center; }
.studio-layout .studio-panel-dialog .preset span { font-size: 13px; font-weight: 600; }
.studio-layout .studio-panel-dialog .preset.active { border-color: #d8ff4f80; background: #d8ff4f14; }
.studio-layout .studio-panel-dialog .preset.active span { color: var(--accent); }
.studio-layout .studio-panel-dialog .output-summary { border-top: 1px solid var(--studio-line); border-bottom: 1px solid var(--studio-line); }
.studio-layout .studio-panel-dialog .advanced-card,
.studio-layout .studio-panel-dialog .advanced-card[open] .advanced-heading { background: transparent; }
.studio-layout .studio-panel-dialog .advanced-heading h2 { font-size: 14px; }
.studio-layout .studio-panel-dialog .advanced-heading small { font-size: 12px; color: var(--studio-muted); }

/* Sheet: segmented controls and tabs */
.studio-layout .studio-panel-dialog .segmented { padding: 4px; border: 1px solid var(--studio-line); border-radius: 12px; background: #10171d; box-shadow: none; }
.studio-layout .studio-panel-dialog .segmented button { border: 0; border-radius: 8px; color: #aeb9c1; font-size: 13px; font-weight: 500; box-shadow: none; }
.studio-layout .studio-panel-dialog .segmented button.active { background: var(--accent); color: #17200b; font-weight: 600; }
.studio-layout .studio-panel-dialog .segmented button:disabled { opacity: .45; }
.studio-layout .studio-panel-dialog .segmented button.active:disabled { opacity: .7; }

/* Sheet: prompt presets */

/* Sheet: translator */
.studio-layout .studio-panel-dialog .prompt-translator-body { gap: 10px; }
.studio-layout .studio-panel-dialog .prompt-translator-body textarea { min-height: 120px; padding: 12px 13px; font-size: 15px; line-height: 1.6; }
.studio-layout .studio-panel-dialog .prompt-translator-meta,
.studio-layout .studio-panel-dialog .prompt-translator-status-row { font-size: 12px; color: var(--studio-muted); }
.studio-layout .studio-panel-dialog .prompt-translator-meta .text-button,
.studio-layout .studio-panel-dialog .prompt-translator-actions .text-button { min-height: 36px; font-size: 12px; color: #c8d2d8; }
.studio-layout .studio-panel-dialog .prompt-translate-button { min-height: 46px; border: 1px solid #d8ff4f40; border-radius: 10px; background: #d8ff4f12; color: var(--accent); font-size: 14px; font-weight: 600; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .studio-panel-dialog .prompt-translate-button:disabled { opacity: .5; }

/* Composer: toolbar wraps cleanly at tablet widths, flat upload actions */
@media (min-width: 620px) and (max-width: 900px) {
  .studio-layout #studioModelSlot { flex: 1 1 100%; }
  .studio-layout .workflow-controls .workflow-field { flex: 1 1 0; width: auto; max-width: none; }
}
.studio-layout .image-edit-upload-footer .outline-button,
.studio-layout .reference-upload-footer .outline-button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--studio-line); border-radius: 9px; background: var(--studio-panel); color: #dfe6ea; font-size: 12px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .edit-upload-zone,
.studio-layout .reference-upload-zone { transition: border-color .15s, background-color .15s; }

/* Generation progress */
.studio-layout .job-card { border: 1px solid #2f4a3a; background: #152025; }
.studio-layout #jobElapsed { color: var(--studio-muted); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.studio-layout .stop-button { min-height: 36px; padding: 6px 14px; border: 1px solid #ff6d7a55; border-radius: 9px; background: #ff6d7a14; color: #ffb3bb; font-size: 12px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .progress-track { height: 4px; }

/* Dialogs */
.studio-layout .private-space-dialog,
.studio-layout .history-confirm-dialog,
.studio-layout .history-item-action-dialog { padding: 22px; border: 1px solid #3b464e; border-radius: 16px; background: #171d23; color: #eef2f4; box-shadow: 0 24px 80px #0009; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .private-space-dialog::before,
.studio-layout .private-space-dialog::after,
.studio-layout .history-confirm-dialog::before,
.studio-layout .history-confirm-dialog::after,
.studio-layout .history-item-action-dialog::before,
.studio-layout .history-item-action-dialog::after { display: none; }
.studio-layout .private-space-dialog::backdrop,
.studio-layout .history-confirm-dialog::backdrop,
.studio-layout .history-item-action-dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.studio-layout .private-dialog-heading h2,
.studio-layout .history-confirm-copy h2,
.studio-layout .history-item-action-heading h2 { margin: 6px 0 0; font-size: 18px; font-weight: 600; }
.studio-layout .private-dialog-heading p,
.studio-layout .history-confirm-copy p { margin-top: 6px; color: var(--studio-muted); font-size: 13px; line-height: 1.6; }
.studio-layout .history-confirm-copy small,
.studio-layout .history-item-action-heading small { color: var(--studio-muted); font-family: inherit; font-size: 11px; font-weight: 400; line-height: 1.2; letter-spacing: .1em; }
.studio-layout .history-confirm-mark { border-radius: 10px; background: #ff6d7a1a; box-shadow: none; }
.studio-layout .private-space-dialog label > span { color: var(--studio-muted); font-size: 12px; }
.studio-layout .private-space-dialog input { height: 46px; border: 1px solid var(--studio-line); border-radius: 10px; background: #10171d; box-shadow: none; font-size: 16px; letter-spacing: .3em; }
.studio-layout .private-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.studio-layout .private-dialog-actions button,
.studio-layout .history-confirm-actions button,
.studio-layout .history-item-action-buttons button { min-height: 44px; padding: 0 14px; border: 1px solid var(--studio-line); border-radius: 10px; background: #1e262d; color: #e6ecef; font-size: 14px; font-weight: 500; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .private-dialog-actions .secondary-button { border-color: var(--accent); background: var(--accent); color: #17200b; font-weight: 600; }
.studio-layout .history-confirm-actions .danger-confirm { border-color: #d24c5c; background: #d24c5c; color: #fff; font-weight: 600; }
.studio-layout .history-item-action-buttons { gap: 8px; }
.studio-layout .history-item-action-buttons .secondary-button { border-color: #d8ff4f40; background: #d8ff4f12; color: var(--accent); }
.studio-layout .history-item-action-buttons .history-delete-button { border-color: #ff6d7a55; color: #ffb3bb; }
.studio-layout .history-item-action-buttons .text-button { border-color: transparent; background: transparent; color: var(--studio-muted); }

/* Viewer and toast */
.studio-layout .viewer-close { top: max(16px, env(safe-area-inset-top)); right: 24px; width: 44px; height: 44px; border: 1px solid #3b464e; background: #171d23e6; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .viewer-zoom-controls { border: 1px solid #3b464e; border-radius: 14px; background: #171d23ee; box-shadow: 0 12px 40px #0008; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .viewer-zoom-controls button { min-height: 36px; padding: 0 10px; border-color: var(--studio-line); background: #1e262d; font-size: 13px; }
.studio-layout .viewer-zoom-controls output { font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.studio-layout .viewer-download { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid #d8ff4f40; border-radius: 10px; background: #171d23ee; font-size: 13px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.studio-layout .toast { padding: 11px 16px; border: 1px solid #3b464e; border-radius: 12px; background: #1b232b; color: #eef2f4; font-size: 13px; box-shadow: 0 12px 36px #0008; -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (hover: hover) {
  .studio-layout .studio-panel-dialog .preset:not(.active):hover { border-color: #4a5760; transform: none; }
  .studio-layout .private-dialog-actions .outline-button:hover,
  .studio-layout .history-confirm-actions .outline-button:hover,
  .studio-layout .history-item-action-buttons .outline-button:not(.history-delete-button):hover { border-color: #4a5760; background: #232c34; transform: none; }
  .studio-layout .edit-upload-zone:hover,
  .studio-layout .reference-upload-zone:hover { border-color: #d8ff4f80; background: #d8ff4f08; }
}
@media (max-width: 619px) {
  .studio-layout .viewer-close { right: 14px; }
  .studio-layout .studio-panel-dialog .prompt-translator-body textarea { min-height: 104px; }
  .studio-layout #jobElapsed { font-size: 12px; }
}
.studio-layout .studio-panel-dialog .preset-empty { color: var(--studio-muted); font-size: 12px; }
@media (max-width: 619px) {
}
.site-notice { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; z-index: 90; display: flex; align-items: flex-start; gap: 10px; width: min(640px, calc(100vw - 32px)); padding: 10px 12px 10px 16px; border: 1px solid #d8ff4f55; border-radius: 12px; background: #141a12f2; color: #eef6dc; font-size: 13px; line-height: 1.55; transform: translateX(-50%); box-shadow: 0 12px 36px #0008; }
.site-notice.warning { border-color: #ffb54d80; background: #2a1c0cf2; color: #ffe2b8; }
.site-notice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.site-notice-close { flex: none; width: 26px; height: 26px; border: 0; border-radius: 8px; background: #ffffff14; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.redeem-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin: 0 0 14px; }
.redeem-form input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.redeem-form input::placeholder { letter-spacing: .04em; }
.redeem-form .secondary-button { min-width: 84px; margin-top: 0; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 4px 0 10px; padding: 4px; border: 1px solid #ffffff14; border-radius: 13px; background: #0007; }
.auth-tabs button, .security-tabs button { min-height: 36px; border: 0; border-radius: 10px; background: transparent; color: #9aa5b1; font-size: 13px; cursor: pointer; }
.auth-tabs button[aria-selected="true"], .security-tabs button[aria-selected="true"] { background: #d8ff4f1f; color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 1px #d8ff4f40; }
.auth-row .auth-submit { min-height: 52px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--accent); color: #17200b; font-size: 16px; font-weight: 700; letter-spacing: .06em; }
.auth-row .auth-submit::before, .auth-row .auth-submit::after { display: none; }
.auth-row .auth-submit:disabled { opacity: .62; }
.auth-email-form input:not([type="checkbox"]) { height: 46px; border-radius: 13px; }
.auth-field-hint { margin: -4px 2px 0; color: #9aa5b1; font-size: 12px; line-height: 1.5; text-align: left; }
.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.auth-code-row .outline-button { min-width: 108px; min-height: 46px; border-radius: 13px; white-space: nowrap; }
.account-form .auth-code-row .outline-button { min-height: 44px; border-radius: 13px; }
.auth-challenge { display: grid; gap: 6px; margin: -4px 2px 0; }
.auth-challenge > small { color: #9aa5b1; font-size: 12px; line-height: 1.4; text-align: left; }
.auth-challenge[data-state="passed"] > small { color: var(--accent); }
.auth-challenge[data-state="error"] > small { color: #ff8b95; }
.auth-challenge > div:empty { display: none; }
.auth-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.auth-card[data-auth-mode="register"] .auth-row, .auth-card[data-auth-mode="forgot"] .auth-row { gap: 10px; }
@media (max-width: 380px) { .auth-pair { grid-template-columns: 1fr; } }
.security-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line, #ffffff14); border-radius: 13px; background: #0005; }
.security-tabs .hidden { display: none; }
.security-hint { margin: 0; color: #9aa5b1; font-size: 12px; line-height: 1.6; }
.auth-links { display: flex; justify-content: flex-end; margin: -4px 2px -2px; }
.auth-text-link { padding: 2px 0; border: 0; background: none; color: #9aa5b1; font-size: 12px; cursor: pointer; }
.auth-text-link:hover, .auth-text-link:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
#forgotForm .auth-links { justify-content: center; margin-top: 2px; }

/* Account: recharge notes and the fixed redeem-code tiers (same list as the admin console). */
.recharge-info { display: grid; gap: 12px; margin: 0 0 20px; }
.recharge-info .recharge-hint { display: grid; gap: 8px; margin: 0; padding: 12px 14px; list-style: none; border: 1px solid #d8ff4f26; border-radius: 12px; background: #d8ff4f0a; color: #cfd8c7; font-size: 12px; line-height: 1.5; }
.recharge-info .recharge-hint li { display: flex; align-items: center; gap: 9px; }
.recharge-info .recharge-hint i { width: 18px; height: 18px; font-size: 10px; }
.recharge-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.recharge-tiers li { display: grid; justify-items: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--studio-line, #303a40); border-radius: 10px; background: #10171d; text-align: center; }
.recharge-tiers b { color: #eef2f4; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recharge-tiers small { color: var(--studio-muted, #a1adb5); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Account: the profile and security cards share one row height; the private-space key row sits at the bottom. */
@media (min-width: 620px) {
  .studio-layout:not(.auth-mode) .account-grid > .account-profile-card,
  .studio-layout:not(.auth-mode) .account-grid > .account-security-card { align-self: stretch; display: flex; flex-direction: column; }
  .studio-layout:not(.auth-mode) .account-security-card > form { margin-bottom: 20px; }
  .studio-layout:not(.auth-mode) .account-security-card > .security-details { margin-top: auto; }
}

/* Account: online top-up through the owner's collection codes (pay.js). */
.pay-panel { display: grid; gap: 12px; margin: 0 0 20px; padding: 14px; border: 1px solid #d8ff4f2e; border-radius: 14px; background: #d8ff4f08; }
.pay-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pay-panel-head b { color: #eef2f4; font-size: 15px; font-weight: 600; }
.pay-panel-head small { color: var(--studio-muted, #a1adb5); font-size: 12px; }
.pay-panel.pay-offline .pay-panel-head small { color: #ffb3bb; }
.pay-channels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.pay-channel { min-height: 40px; border: 1px solid var(--studio-line, #303a40); border-radius: 10px; background: #10171d; color: #cfd8dd; font-size: 14px; font-weight: 500; }
.pay-channel[aria-checked="true"] { border-color: var(--accent); color: var(--accent); background: #d8ff4f12; }
.pay-tiers li { padding: 0; border: 0; background: none; }
.pay-tiers button { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--studio-line, #303a40); border-radius: 10px; background: #10171d; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-tiers button:hover:not(:disabled), .pay-tiers button:focus-visible { border-color: var(--accent); background: #d8ff4f10; }
.pay-tiers button:disabled { cursor: not-allowed; opacity: .5; }
.pay-tiers button { position: relative; }
.pay-tiers .pay-tier-bonus { position: absolute; top: -8px; right: -4px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #17200b; font-size: 10px; font-weight: 700; line-height: 16px; white-space: nowrap; }
.pay-tiers .pay-tier-gift { color: var(--accent); font-size: 11px; }
.pay-tiers button:has(.pay-tier-bonus) { border-color: #d8ff4f40; }
.pay-resume { min-height: 40px; border-radius: 10px; font-size: 13px; }
.pay-tips { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pay-tips li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--studio-line, #303a40); border-radius: 10px; background: #10171d; color: #cfd8dd; font-size: 12px; line-height: 1.5; }
.pay-tips b { flex: none; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 18px; }
.pay-tip-bonus { border-color: #d8ff4f33 !important; }
.pay-tip-bonus b { background: #d8ff4f1f; color: var(--accent); }
.pay-tip-warn { border-color: #ffd28a33 !important; }
.pay-tip-warn b { background: #ffd28a1f; color: #ffd28a; }
.pay-dialog[data-channel="afdian"] .pay-qr-only { display: none !important; }
.pay-dialog[data-channel="afdian"] .pay-dialog-head h2 { color: #c4a7ff; }
.pay-afdian { display: grid; gap: 10px; width: 100%; }
.pay-afdian-go { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; border: 1px solid #946ce6; background: #946ce6; color: #fff; font-size: 16px; font-weight: 600; text-decoration: none; }
.pay-afdian-go:hover, .pay-afdian-go:focus-visible { background: #a47ff0; }
.pay-afdian-claim { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.pay-afdian-claim span { flex-basis: 100%; color: var(--studio-muted, #a1adb5); font-size: 12px; }
.pay-afdian-claim input { flex: 1 1 160px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--studio-line, #303a40); border-radius: 10px; background: #10171d; color: #eef2f4; font-variant-numeric: tabular-nums; }
.pay-afdian-claim button { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.pay-tip-help b { background: #7fb8ff1f; color: #7fb8ff; }
.pay-tip-help a { color: #7fb8ff; text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }

.studio-layout .pay-dialog, .pay-dialog { width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 22px 20px 20px; border-color: #3b464e; text-align: center; }
.pay-dialog-head small { color: var(--studio-muted, #a1adb5); font-size: 11px; letter-spacing: .1em; }
.pay-dialog-head h2 { margin: 6px 0 14px; font-size: 18px; font-weight: 600; }
.pay-dialog[data-channel="wechat"] .pay-dialog-head h2 { color: #7ee0a0; }
.pay-dialog[data-channel="alipay"] .pay-dialog-head h2 { color: #7fb8ff; }
.pay-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--studio-muted, #a1adb5); font-size: 22px; line-height: 1; cursor: pointer; }
.pay-close:hover { background: #ffffff10; color: #eef2f4; }
.pay-waiting { display: grid; justify-items: center; gap: 8px; }
.pay-qr { width: min(240px, 70vw); aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #fff; padding: 8px; }
.pay-qr-dim { opacity: .25; filter: grayscale(1); }
.pay-qr-save { color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.pay-amount-label { margin: 6px 0 0; color: #cfd8dd; font-size: 13px; }
.pay-amount-label b { color: #ffd28a; }
.pay-amount { display: grid; justify-items: center; gap: 0; min-width: 180px; padding: 8px 18px; border: 1px solid #d8ff4f55; border-radius: 12px; background: #d8ff4f10; color: var(--accent); font-size: 18px; cursor: pointer; }
.pay-amount > span { display: flex; align-items: baseline; gap: 2px; font-size: 20px; font-weight: 600; }
.pay-amount b { font-size: 36px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pay-amount small { color: var(--studio-muted, #a1adb5); font-size: 11px; }
.pay-note { margin: 0; color: var(--studio-muted, #a1adb5); font-size: 12px; line-height: 1.5; }
.pay-steps { margin: 4px 0 0; padding: 10px 12px 10px 30px; border-radius: 10px; background: #10171d; color: #cfd8dd; font-size: 12px; line-height: 1.6; text-align: left; }
.pay-status-line { margin: 2px 0 0; color: #eef2f4; font-size: 13px; line-height: 1.5; }
.pay-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 0; color: var(--studio-muted, #a1adb5); font-size: 12px; font-variant-numeric: tabular-nums; }
.pay-meta b { color: #cfd8dd; font-weight: 500; user-select: all; }
.pay-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.pay-actions button { min-height: 44px; border-radius: 10px; font-size: 14px; }
.pay-actions .hidden + button { grid-column: 1 / -1; }
.pay-actions .secondary-button { border: 1px solid var(--accent); background: var(--accent); color: #17200b; font-weight: 600; }
.pay-actions .secondary-button:disabled { opacity: .55; }
.pay-actions .outline-button { border: 1px solid var(--studio-line, #303a40); background: #1e262d; color: #e6ecef; }
.pay-done { display: grid; justify-items: center; gap: 8px; padding: 18px 0 4px; }
.pay-done-mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: #d8ff4f1f; color: var(--accent); font-size: 28px; font-weight: 700; }
.pay-done h3 { margin: 4px 0 0; font-size: 18px; }
.pay-done p { margin: 0 0 8px; color: #cfd8dd; font-size: 14px; }
.pay-done .secondary-button { min-width: 160px; min-height: 44px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #17200b; font-weight: 600; }

/* UI audit fixes (2026-11-04): tap targets, small text, duplicate login title. */
.security-details > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; }
.security-details > summary span { float: none; margin-left: auto; font-size: 12px; }
.security-subheading small { font-size: 12px; }
.mini-avatar { font-size: 11px; }
.mini-credits { font-size: 12px; font-variant-numeric: tabular-nums; }
.auth-code-row .outline-button,
.account-form .auth-code-row .outline-button { min-height: 46px; padding: 0 14px; border: 1px solid #ffffff1f; border-radius: 12px; background: #ffffff0d; color: #e6ecef; font-size: 13px; font-weight: 500; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.account-form .auth-code-row .outline-button { min-height: 44px; border-radius: 10px; }
.auth-code-row .outline-button:disabled { opacity: .55; }
/* The login/register tabs already name the current view, so the heading above them is dropped. */
.auth-card:has(#authTabs:not(.hidden)) > .card-heading { display: none; }
.auth-card .auth-copy { text-wrap: balance; }
@media (hover: hover) {
  .auth-code-row .outline-button:not(:disabled):hover { border-color: #ffffff38; background: #ffffff17; transform: none; }
}
@media (max-width: 619px) {
  .mini-credits { max-width: 56px; }
  .mobile-account-logout { min-height: 36px; padding: 0 14px; border: 1px solid #ff6d7a55; border-radius: 10px; background: #ff6d7a14; color: #ffb3bb; font-size: 12px; }
}
.redeem-form input::placeholder { font-family: Inter, "Microsoft YaHei", sans-serif; letter-spacing: 0; text-transform: none; }
.security-details > summary::before { content: "▸"; color: var(--studio-muted, #a1adb5); transition: transform .15s; }
.security-details[open] > summary::before { transform: rotate(90deg); }
/* 首充加赠: a warmer badge than the promotion's, and the banner says 首充. */
.pay-tiers .pay-tier-bonus.pay-tier-first { background: #ffb54d; color: #2a1600; }
.pay-tiers button:has(.pay-tier-first) { border-color: #ffb54d80; }
.pay-tip-bonus.pay-promo-first b { background: #ffb54d; color: #2a1600; }
.pay-tip-bonus.pay-promo-first { border-color: #ffb54d55 !important; }
/* ===== 2026-11-25: notice bar in the page flow, notice popup, create-page promo strip ===== */
/* On phones the bar sits in the page instead of floating over the logo and balance;
   wide screens keep the floating bar, which has room in the middle of the header. */
.site-notice { align-items: center; width: min(460px, calc(100vw - 32px)); }
@media (max-width: 760px) {
  .site-notice { position: relative; top: auto; left: auto; transform: none; z-index: 5; width: calc(100vw - 32px); margin: max(10px, env(safe-area-inset-top)) auto 0; box-shadow: none; }
}
.site-notice > .site-notice-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.site-notice-copy b { margin-right: 6px; }
.site-notice-action { flex: none; padding: 4px 10px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }

.notice-dialog { width: min(420px, calc(100vw - 32px)); max-height: min(86vh, 640px); padding: 22px 20px 16px; border: 1px solid #ffffff1f; border-radius: 18px; background: #161b20; color: #eef2f5; overflow: auto; }
.notice-dialog::backdrop { background: #000a; }
.notice-dialog[open] { display: grid; gap: 12px; }
.notice-dialog-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: #ffffff14; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.notice-dialog-head { display: flex; align-items: center; gap: 8px; padding-right: 36px; }
.notice-dialog-head h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.notice-dialog-tag { flex: none; padding: 2px 8px; border-radius: 6px; background: #d8ff4f22; color: var(--accent, #d8ff4f); font-size: 12px; font-weight: 700; }
.notice-dialog-tag[data-tag="event"], .notice-dialog.warning .notice-dialog-tag { background: #ffb54d26; color: #ffb54d; }
.notice-dialog-tag[data-tag="important"] { background: #ff6d7a26; color: #ff9aa4; }
.notice-dialog-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.notice-dialog-text { margin: 0; color: #b8c2ca; font-size: 14px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.notice-dialog-action { min-height: 46px; border: 0; border-radius: 12px; background: var(--accent, #d8ff4f); color: #17200b; font-size: 15px; font-weight: 800; cursor: pointer; }
.notice-dialog-dismiss { justify-self: center; padding: 4px 8px; border: 0; background: transparent; color: #8a96a0; font-size: 13px; cursor: pointer; }
@media (max-width: 720px) {
  /* A bottom sheet on phones, within thumb reach. */
  .notice-dialog { width: 100%; max-width: 100%; margin: auto 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-bottom: 0; }
}

.promo-slot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 9px 8px 9px 12px; border: 1px solid #ffb54d66; border-radius: 14px; background: #ffb54d14; color: #ffe2b8; }
.promo-slot[data-tone="info"] { border-color: #6fb6ff66; background: #6fb6ff14; color: #cfe6ff; }
.promo-slot[data-tone="warn"] { border-color: #ff9a6d66; background: #ff9a6d14; color: #ffd9c8; }
.promo-slot[data-tone="member"], .promo-slot[data-tone="custom"] { border-color: #d8ff4f55; background: #d8ff4f12; color: #eef6dc; }
.promo-slot-icon { flex: none; font-size: 18px; line-height: 1; }
.promo-slot-main { display: grid; flex: 1; min-width: 0; gap: 2px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.promo-slot-main b { overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.promo-slot-main small { overflow: hidden; font-size: 12px; line-height: 1.3; opacity: .78; text-overflow: ellipsis; white-space: nowrap; }
.promo-slot-action { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: currentColor; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.promo-slot-action { color: inherit; background: #ffffff1f; }
.promo-slot[data-tone="gift"] .promo-slot-action { background: #ffb54d; color: #2a1600; }
.promo-slot[data-tone="info"] .promo-slot-action { background: #6fb6ff; color: #04213d; }
.promo-slot[data-tone="warn"] .promo-slot-action { background: #ff9a6d; color: #2e0f02; }
.promo-slot[data-tone="member"] .promo-slot-action, .promo-slot[data-tone="custom"] .promo-slot-action { background: var(--accent, #d8ff4f); color: #17200b; }
.promo-slot-close { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 16px; line-height: 1; opacity: .7; cursor: pointer; }
.first-topup-badge { margin-left: 4px; padding: 1px 5px; border-radius: 5px; background: #ffb54d; color: #2a1600; font-size: 10px; font-style: normal; font-weight: 800; line-height: 1.4; }
html.ui-v2 .v2-member-notice.v2-member-afdian-tip { background: #ffb54d14; color: #ffd9a3; }

/* Qwen-Image 2.1 controls */
.qwen21-mode-panel { display: grid; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--studio-line, #ffffff1a); border-radius: 14px; background: #141a20; }
.qwen21-mode-panel.hidden { display: none; }
.qwen21-mode-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.qwen21-mode-row.hidden { display: none; }
.qwen21-cfg-control { display: grid; grid-template-columns: minmax(110px, 1fr) 68px auto; align-items: center; gap: 8px; flex: 1 1 220px; max-width: 320px; }
.qwen21-cfg-control input[type="range"] { width: 100%; accent-color: var(--accent, #d8ff4f); }
.qwen21-cfg-control input[type="number"] { min-height: 34px; padding: 4px 8px; border: 1px solid #ffffff20; border-radius: 8px; background: #0e1318; color: #eef2f5; font-size: 13px; text-align: center; }
.qwen21-debug-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 8px; border-top: 1px solid #ffffff12; }
.qwen21-debug-fields.hidden { display: none; }
.qwen21-debug-fields label { display: grid; gap: 4px; font-size: 12px; color: #b8c2ca; }
.qwen21-debug-fields input[type="number"] { min-height: 38px; padding: 6px 10px; border: 1px solid #ffffff20; border-radius: 10px; background: #0e1318; color: #eef2f5; font-size: 14px; }
.qwen21-turbo-switch { grid-column: 1 / -1; }
.qwen21-neg-hint { margin: 0; padding: 6px 10px; border-radius: 8px; background: #ffffff0a; color: #9aa6b2; font-size: 12px; line-height: 1.45; }
.qwen21-neg-hint.hidden { display: none; }
.qwen21-enhance-panel { display: grid; gap: 16px; }
.qwen21-enhance-panel.hidden { display: none; }
.qwen21-section { display: grid; gap: 10px; }
.qwen21-lora-list { display: grid; gap: 10px; }
.qwen21-lora-item { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid #ffffff14; border-radius: 12px; background: #141a20; }
.qwen21-lora-item .switch-row { padding: 0; border: 0; background: transparent; }
.qwen21-lora-strength { display: grid; grid-template-columns: auto 1fr 72px auto; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid #ffffff10; font-size: 12px; color: #b8c2ca; }
.qwen21-lora-strength.hidden { display: none; }
.qwen21-lora-strength input[type="range"] { width: 100%; accent-color: var(--accent, #d8ff4f); }
.qwen21-lora-strength input[type="number"] { min-height: 34px; padding: 4px 8px; border: 1px solid #ffffff20; border-radius: 8px; background: #0e1318; color: #eef2f5; font-size: 13px; text-align: center; }
.qwen21-lora-reset { min-height: 30px; padding: 2px 8px; border: 1px solid #ffffff20; border-radius: 8px; background: transparent; color: #9aa6b2; font-size: 11px; cursor: pointer; }
.qwen21-neg-muted { opacity: 0.65; }
.qwen21-beta-banner { margin: 0; padding: 8px 11px; border-radius: 10px; border: 1px solid #ffb54d66; background: #ffb54d18; color: #ffd996; font-size: 12px; line-height: 1.5; }
.qwen21-beta-banner.hidden { display: none; }
.generate-button.is-beta-locked { opacity: 0.72; }

/* Custom popup & selector polish (eliminate browser-native select menus and keep toasts in top-layer) */
#toast[popover] { position: fixed; inset: auto; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; overflow: visible; }
.studio-mode-segments { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--studio-line, #303a40); border-radius: 12px; background: #10161c; }
.studio-mode-segments [role="radio"] { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #aeb9c1; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease; }
.studio-mode-segments [role="radio"]:hover:not(:disabled) { color: #eef2f4; background: #ffffff0c; }
.studio-mode-segments [role="radio"][aria-checked="true"] { background: #d8ff4f1f; border-color: #d8ff4f66; color: #eaff9e; font-weight: 600; }
.studio-mode-segments [role="radio"]:disabled { opacity: .48; cursor: not-allowed; }
.studio-beta-tag { padding: 1px 6px; border-radius: 999px; background: #ffb54d26; border: 1px solid #ffb54d55; color: #ffd68c; font-style: normal; font-size: 10px; font-weight: 600; line-height: 1.45; }

.studio-layout .studio-select-enhanced { position: relative; }
.studio-layout .studio-select-enhanced > select { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.studio-layout .video-model-field.studio-select-enhanced::after { display: none !important; }
.studio-select-picker { position: relative; width: 100%; min-width: 0; }
.studio-select-trigger { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid #303a40; border-radius: 10px; background: #10171d; color: #eef2f4; font-size: 13px; text-align: left; cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.studio-select-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-select-trigger > i { flex: 0 0 auto; width: 7px; height: 7px; margin: -3px 2px 0 4px; border-right: 1.5px solid #c5d1d9; border-bottom: 1.5px solid #c5d1d9; transform: rotate(45deg); transition: transform .15s ease; }
.studio-select-picker.is-open .studio-select-trigger { border-color: #d8ff4f88; background: #131c22; }
.studio-select-picker.is-open .studio-select-trigger > i { margin-top: 3px; transform: rotate(225deg); }
.studio-select-trigger:disabled { opacity: .48; cursor: not-allowed; }
.studio-select-menu { position: relative; z-index: 60; margin-top: 6px; display: grid; gap: 4px; padding: 6px; border: 1px solid #3c4852; border-radius: 12px; background: #1b232b; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.studio-select-menu.hidden { display: none; }
.studio-select-option { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #d6e0e6; font-size: 13px; text-align: left; cursor: pointer; }
.studio-select-option:hover:not(:disabled) { background: #ffffff0e; color: #ffffff; }
.studio-select-option.is-selected { background: #d8ff4f1c; border-color: #d8ff4f44; color: #ecffc0; font-weight: 600; }
.studio-select-option small { color: var(--accent, #d8ff4f); font-size: 12px; font-weight: 700; }
@media (max-width: 619px) {
  .studio-mode-segments [role="radio"] { min-height: 40px; padding: 7px 11px; font-size: 12px; }
}

/* 2026-11-26: Qwen 2.1 tabs sit next to 图片生成 / 图片编辑 / 视频生成. */
.studio-mode-tabs { gap: 6px; }
.studio-mode-tabs button { padding: 9px 14px; white-space: nowrap; }
.studio-mode-tabs .studio-mode-badge { margin-left: 4px; padding: 0 4px; font-style: normal; font-size: 10px; color: #f2b544; border-color: rgba(242,181,68,.55); opacity: 1; }
.studio-mode-tabs button[aria-pressed="true"] .studio-mode-badge { color: #17200b; border-color: rgba(23,32,11,.45); }
@media (max-width: 619px) {
  /* Beats the ui-v2 single-row rule: 3 columns, 2 rows on phones. */
  .studio-layout .studio-composer .studio-mode-tabs,
  html.ui-v2 .studio-layout .studio-composer .studio-mode-tabs { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-columns: auto; gap: 4px; margin-bottom: 12px; }
  .studio-layout .studio-composer .studio-mode-tabs button,
  html.ui-v2 .studio-layout .studio-composer .studio-mode-tabs button { min-height: 34px; padding: 5px 2px; font-size: 12px; border-radius: 8px; }
  .studio-layout .studio-composer .studio-mode-tabs .studio-mode-badge { display: inline-block; margin-left: 2px; padding: 0 2px; font-size: 9px; line-height: 1.3; border-radius: 4px; vertical-align: 1px; }
}

/* 2026-11-26: with no model picker (Qwen 2.1 text/reference), the 参数 button
   takes its own row on phones so 提示词预设 / 中英翻译 / 增强 are not squeezed. */
@media (max-width: 619px) {
  html.ui-v2 .studio-layout .studio-toolbar:has(#studioModelSlot.hidden):has(#studioPresetsButton:not(.hidden)) > #studioParametersButton { flex-basis: 100%; }
  .studio-layout .studio-toolbar:has(#studioModelSlot.hidden):has(#studioPresetsButton:not(.hidden)) > #studioParametersButton { flex-basis: 100%; }
}

/* Qwen 2.1 enhancement note under a LoRA name (e.g. the fusion LoRA) */
.qwen21-lora-item .qwen21-lora-detail { display: block; margin-top: 2px; color: #9aa6b0; font-size: 12px; font-weight: 400; line-height: 1.4; }
