.enhanced-select-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;border:0!important;opacity:0!important;clip-path:inset(50%)!important;pointer-events:none!important}
.polished-select{width:100%;min-width:0;min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid #303446;border-radius:10px;background:linear-gradient(150deg,#131724,#0c101a);color:#dbe0ed;text-align:left;font:inherit;font-size:13.5px;cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.025);transition:border-color .15s,background .15s}
.polished-select>span:first-child{overflow-wrap:anywhere}.choice-chevron{color:#9290ab;font-size:16px}.polished-select:hover{border-color:#544b70}.polished-select[aria-expanded="true"]{border-color:#8570ca;background:#191627;box-shadow:0 0 0 3px rgba(130,103,230,.09)}.polished-select:disabled{opacity:.45;cursor:not-allowed}.polished-select:focus-visible,.choice-option:focus-visible{outline:2px solid #a18ae8;outline-offset:2px}
.choice-menu{position:fixed;inset:auto;margin:0;padding:6px;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;border:1px solid #40394f;border-radius:12px;background:linear-gradient(145deg,#1c1d2a,#111520);color:#e0e3ed;box-shadow:0 18px 48px rgba(0,0,0,.5),inset 0 1px rgba(255,255,255,.045);scrollbar-width:thin;scrollbar-color:rgba(139,122,255,.45) transparent}
.choice-menu>p{margin:0;padding:10px;color:#afa0d1;font-size:12px}.choice-option{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:38px;padding:10px 12px;margin:2px 0;border:1px solid transparent;border-radius:8px;background:transparent;color:#c4cad9;text-align:left;font:inherit;font-size:13.5px;cursor:pointer;gap:16px}.choice-option:hover{background:#27263a;color:#fff}.choice-option[aria-pressed="true"]{background:linear-gradient(100deg,#312743,#232035);border-color:#594576;color:#eadfff}.choice-option[aria-pressed="true"]::after{content:'✓';color:#c4a3ff}.choice-option:disabled{opacity:.4;cursor:not-allowed}
dialog.polished-dialog,#taskDialog{padding:0;border:1px solid #464053;border-radius:18px;background:linear-gradient(145deg,#1b1c2a,#10131e);color:#e3e5ef;box-shadow:0 30px 100px rgba(0,0,0,.65),inset 0 1px rgba(255,255,255,.05)}dialog::backdrop{background:rgba(3,5,12,.72);backdrop-filter:blur(5px)}
.polished-dialog{width:min(420px,calc(100vw - 32px))}.polished-dialog form{padding:26px}.polished-dialog h2{margin:0 0 12px;font-size:19px;letter-spacing:.01em}.polished-dialog p{margin:0;color:#9da5b8;font-size:14px;line-height:1.8}.polished-dialog input{width:100%;margin-top:20px;padding:12px;border:1px solid #3d3d54;border-radius:10px;background:#0c101a;color:#e6e7f0;font:inherit;font-size:14px;outline:none}.polished-dialog input:focus{border-color:#9278d4}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:26px}.dialog-actions button{min-width:76px;padding:10px 16px;border:1px solid #414258;border-radius:9px;background:#222536;color:#c8cedd;font:inherit;font-size:13.5px;cursor:pointer}.dialog-actions .dialog-confirm{border-color:#8061c3;background:linear-gradient(120deg,#7856b6,#6657a8);color:white}.dialog-actions .is-danger{border-color:#a45269;background:linear-gradient(120deg,#963c58,#733b59)}.dialog-actions button:hover{filter:brightness(1.13)}.dialog-actions button:focus-visible{outline:2px solid #ac98e6;outline-offset:3px}
.filter-row>.polished-select{width:auto;min-width:120px}
@media(prefers-reduced-motion:reduce){.polished-select,.video-model-option,.video-model-chevron{transition:none}}
.polished-dialog{max-height:calc(100dvh - 32px);overflow:auto}

/* Native workbench tools: repair and voice clone. */
.tool-view{max-width:1420px;margin:0 auto;padding:18px 24px 40px}.tool-heading{margin:8px 0 24px}.tool-heading h1{font-size:29px;margin:4px 0 9px}.tool-heading p:last-child{color:var(--muted2);font-size:14px;line-height:1.6;margin:0}.tool-layout{display:grid;grid-template-columns:minmax(330px,.85fr) minmax(400px,1.15fr);align-items:start;gap:20px}.tool-layout>.panel{min-width:0;padding:24px}.tool-layout .panel-head{margin:0 0 18px}.tool-layout .panel-head h2{font-size:18px;margin:0}.tool-form .field-label{font-size:14px;margin:18px 0 8px}.tool-form input[type=file],.tool-form textarea,.tool-form input[type=text],.tool-form select{width:100%;min-width:0;border:1px solid var(--line2);border-radius:10px;background:var(--panel2);color:var(--text);font-size:14px}.tool-form input[type=file]{padding:13px;cursor:pointer}.tool-form input[type=file]::file-selector-button{border:1px solid #544d82;border-radius:7px;background:#272243;color:#eee6ff;padding:7px 11px;margin-right:12px;cursor:pointer}.tool-form textarea{min-height:112px;resize:vertical;line-height:1.6;padding:12px}.tool-form input[type=text],.tool-form select{height:42px;padding:0 11px}.tool-hint,.tool-counter{display:block;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.55}.tool-counter{text-align:right}.tool-form .required{color:var(--orange);font-size:13px;font-weight:500}.tool-file-preview{display:flex;align-items:center;gap:12px;min-width:0;margin-top:14px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel2)}.tool-file-preview img{width:70px;height:54px;border-radius:6px;object-fit:cover}.tool-file-preview span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted2);font-size:13.5px}.tool-options{border:0;padding:0;margin:20px 0}.tool-options legend{padding:0}.tool-tier-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.tool-tier{display:flex;gap:4px;flex-direction:column;align-items:center;justify-content:center;min-height:68px;border:1px solid var(--line2);border-radius:10px;background:var(--panel2);cursor:pointer;font-size:14px}.tool-tier:has(input:checked){border-color:var(--purple);background:rgba(128,105,255,.14);color:#e7dfff}.tool-tier:has(input:disabled){opacity:.45;cursor:not-allowed}.tool-tier input{position:absolute;opacity:0;pointer-events:none}.tool-tier strong{font-size:18px}.tool-tier small{color:var(--muted);font-size:12px}.tool-advanced{margin:20px 0;border:1px solid var(--line);border-radius:10px}.tool-advanced summary{cursor:pointer;padding:13px;color:var(--muted2);font-size:13.5px}.tool-advanced>div{padding:0 14px 15px}.tool-advanced input[type=range]{width:100%;accent-color:var(--purple)}.tool-advanced .field-label output{float:right;color:var(--text)}.tool-submit{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:22px;padding-top:18px;border-top:1px solid var(--line);color:var(--muted2);font-size:13.5px}.tool-submit strong{color:var(--text);font-size:19px}.tool-submit .primary-button{min-width:138px;min-height:43px;padding:8px 16px;font-weight:700}.tool-notice{min-height:18px;color:var(--muted);font-size:13px;line-height:1.5}.tool-notice.error{color:var(--red)}.tool-output{min-height:340px}.tool-output .empty-state{min-height:210px}.tool-result-meta{display:flex;justify-content:space-between;gap:12px;align-items:center;color:var(--muted2);font-size:13.5px;margin:10px 0 14px}.tool-result-meta strong{color:var(--text)}.tool-result-actions{display:flex;align-items:center;gap:12px;margin:14px 0}.tool-result-actions a{display:inline-block;text-decoration:none;padding:9px 13px;border:1px solid var(--line2);border-radius:8px;color:var(--text);font-size:13.5px}.tool-compare{position:relative;width:100%;overflow:hidden;border-radius:12px;border:1px solid var(--line2);background:#12151d}.tool-compare>img,.tool-compare-before img{display:block;width:100%;height:auto;max-height:560px;object-fit:contain}.tool-compare-before{position:absolute;inset:0;clip-path:inset(0 calc(100% - var(--compare, 50%)) 0 0)}.tool-compare-before img{height:100%;object-fit:contain;object-position:center}.tool-compare-line{position:absolute;top:0;bottom:0;left:var(--compare, 50%);border-left:2px solid #fff;transform:translateX(-1px);pointer-events:none}.tool-compare-labels{display:flex;justify-content:space-between;margin:8px 0;color:var(--muted);font-size:13px}.tool-compare-range{width:100%;accent-color:var(--purple)}.tool-output-image{max-width:100%;max-height:560px;border-radius:12px;object-fit:contain}.tool-audio-player{width:100%;min-height:54px;margin:8px 0}.tool-history{display:grid;gap:7px;margin-top:20px}.tool-history:empty{display:none}.tool-history>strong{font-size:13.5px;color:var(--muted2);margin-bottom:3px}.tool-history button{display:flex;justify-content:space-between;gap:8px;width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);text-align:left;font-size:13.5px;cursor:pointer}.tool-history button[aria-pressed=true]{border-color:var(--purple)}.tool-history button small{color:var(--muted)}.tool-view :is(input,textarea,select,button):focus-visible{outline:2px solid var(--purple);outline-offset:2px}
.tool-consent{display:flex;align-items:center;gap:9px;margin:15px 0 0;color:var(--muted2);font-size:13.5px;cursor:pointer}.tool-consent input{accent-color:var(--purple)}
#cloneEmotionSettings[hidden]{display:none}#cloneEmotionSettings input[type=range]{width:100%;accent-color:var(--purple)}#cloneEmotionStrengthValue{float:right;color:var(--text)}
@media(max-width:1050px){.tool-layout{grid-template-columns:1fr}.tool-view{padding:14px 18px 36px}.tool-output{min-height:260px}}@media(max-width:540px){.tool-view{padding:12px}.tool-layout>.panel{padding:16px}.tool-tier-list{gap:6px}.tool-submit{align-items:stretch;flex-direction:column}.tool-submit .primary-button{width:100%}}

/* The repair model uses the image studio layout without altering audio or video. */
#restoreView .restore-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#restoreView .studio-grid.two-column{align-items:stretch}
#restoreView .tool-form{display:flex;flex-direction:column}
#restoreView .tool-form>.panel-head{margin-bottom:6px}
#restoreView .restore-feature-group{display:flex;flex:1;min-height:290px;flex-direction:column}
#restoreView .restore-feature-stage{position:relative;display:grid;flex:1;min-height:260px;place-items:center;overflow:hidden;border:1px solid var(--line2);border-radius:12px;background:#080b12}
#restoreView #restoreFeaturePreview{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
#restoreView .restore-feature-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px;color:var(--muted2);text-align:center}
#restoreView .restore-feature-empty>span{font-size:28px;color:var(--purple)}#restoreView .restore-feature-empty small{color:var(--muted);font-size:13px}
#restoreView .restore-upload-group{margin:4px 0 0}
#restoreView .restore-upload-stage{position:relative;display:flex;height:68px;align-items:center;justify-content:center;overflow:hidden;margin-top:8px;border:1px solid transparent;border-radius:12px;background:#080b12;cursor:pointer}
#restoreView .restore-upload-stage:hover,#restoreView .restore-upload-stage:focus-within{border-color:var(--purple);outline:2px solid rgba(128,105,255,.35);outline-offset:2px}
#restoreView #restoreImage{position:absolute;inset:0;z-index:2;width:100%;height:100%;padding:0;border:0;opacity:0;cursor:pointer}
#restoreView .restore-upload-empty{display:flex;align-items:center;gap:9px;padding:9px;color:var(--muted2);pointer-events:none}
#restoreView .restore-upload-empty>span{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:rgba(128,105,255,.15);color:#a898ff;font-size:20px}
#restoreView .restore-upload-empty strong{font-size:13.5px}#restoreView .restore-upload-empty small{color:var(--muted);font-size:12px}
#restoreView #restoreInputBox{position:absolute;inset:0;display:flex;width:100%;height:100%;min-width:0;align-items:center;justify-content:center;gap:10px;margin:0;padding:6px;border:0;border-radius:0;background:#080b12;pointer-events:none}
#restoreView #restoreInputPreview{display:block;width:48px;height:48px;object-fit:cover;border-radius:6px}
#restoreView #restoreInputName{display:block;max-width:calc(100% - 70px);overflow:hidden;color:var(--muted2);font-size:13px;text-overflow:ellipsis;white-space:nowrap}
#restoreView .restore-warning{color:var(--orange);font-size:13.5px;margin-top:12px}
#restoreView .tool-tier:has(input:checked){color:var(--text)}
#restoreView .tool-options{margin:10px 0 8px}#restoreView .generation-footer{margin-top:auto}
#restoreView #restoreOutput .tool-compare,#restoreView #restoreOutput .restore-single-output{width:100%;height:clamp(360px,55vh,760px);background:#080b12}
#restoreView #restoreOutput .tool-compare>img,#restoreView #restoreOutput .tool-compare-before img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;object-position:center}
#restoreView #restoreOutput .restore-single-output{display:grid;place-items:center;overflow:hidden}#restoreView #restoreOutput .restore-single-output img{width:100%;height:100%;object-fit:contain}#restoreView #restoreOutput img.restore-single-output{display:block;object-fit:contain}
#restoreView #restoreOutput .tool-compare .tool-compare-range{position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize}
#restoreView #restoreOutput .tool-compare-line{z-index:1}#restoreView #restoreOutput .tool-compare-line::after{content:'↔';position:absolute;top:50%;left:0;display:grid;place-items:center;width:34px;height:34px;border:2px solid #fff;border-radius:50%;background:rgba(15,19,30,.85);box-shadow:0 2px 12px rgba(0,0,0,.5);color:#fff;font-size:18px;transform:translate(-50%,-50%)}
#restoreView #restoreOutput .tool-compare:focus-within{outline:2px solid var(--purple);outline-offset:3px}
#restoreView #restoreOutput .image-feature-empty>.empty-state{min-height:clamp(360px,55vh,760px)}
#restoreView #restoreHistory{margin-top:18px}#restoreView #restoreHistory h3{margin:0 0 10px;color:var(--text);font-size:13.5px}#restoreView #restoreHistory h3 small{color:var(--muted);font-size:12px;font-weight:400}
#restoreView #restoreHistory:empty{display:none}
@media(max-width:620px){#restoreView .restore-feature-group{min-height:260px}#restoreView .restore-feature-stage{min-height:220px}#restoreView .restore-upload-empty small{display:none}#restoreView #restoreOutput .tool-compare,#restoreView #restoreOutput .restore-single-output{height:clamp(270px,64vw,450px)}#restoreView #restoreOutput .image-feature-empty>.empty-state{min-height:clamp(270px,64vw,450px)}}
/* Audio / restore studio: result panel matches the settings panel height. */
.tool-layout{align-items:stretch}
.tool-layout>.tool-output{display:flex;flex-direction:column}
.tool-layout>.tool-output #audioCloneOutput,.tool-layout>.tool-output #restoreOutput{flex:1;min-height:0}
.tool-layout>.tool-output .tool-history{flex:1;min-height:0;overflow:auto;align-content:start}
.tool-output .tool-audio-player{border-radius:999px}
.tool-result-actions a:hover{border-color:var(--hover-line,#8b7aff);background:rgba(139,122,255,.14)}
@media(max-width:1050px){.tool-layout{align-items:start}}

/* Fixed studio pages (desktop): image, video and voice fill one screen; the page never
   scrolls, long content scrolls inside its own panel. Dropdown menus are position:fixed. */
@media (min-width: 1051px) and (min-height: 620px) {
  body:has(#createView.active:not(.canvas-generator-mode)),
  body:has(#audioCloneView.active) { height: 100dvh; overflow: hidden; }
  body:has(#createView.active:not(.canvas-generator-mode)) .workspace,
  body:has(#audioCloneView.active) .workspace { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; box-sizing: border-box; }
  #createView.active, #audioCloneView.active { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* Image + video share one two-column grid that fills the remaining height. */
  #createView.active > .studio-grid.two-column { flex: 1; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  #createView.active > .studio-grid > .panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #createView.active:not(.video-studio) .generator-panel > .prompt-editor { max-height: none; min-height: 140px; }
  #createView.active:not(.video-studio) .generator-panel .prompt-box textarea { min-height: 110px; }

  /* Video: settings on the left; the generation record feed fills the right column. */
  #createView.active.video-studio > .studio-grid.two-column { grid-template-rows: minmax(0, 1fr); }
  #createView.active.video-studio .generator-panel { grid-column: 1; grid-row: 1; overflow-y: auto; }
  #createView.active.video-studio .video-preview-panel { grid-column: 2; grid-row: 1; overflow: hidden; }
  #createView.active.video-studio .video-preview-stage { min-height: 0; }
  #createView.active.video-studio .video-preview-stage video { max-height: 100%; }
  #createView.active.video-studio .studio-grid > .results-panel { grid-column: 2; grid-row: 1; align-self: stretch; position: relative; top: auto; height: auto; min-height: 0; overflow: hidden; padding: 20px 22px; border: 1px solid #2e3440; border-radius: 22px; background: linear-gradient(145deg, #1b2029, #151920); box-shadow: 0 18px 40px #00000026; display: flex; flex-direction: column; }
  #createView.active.video-studio .studio-grid > .results-panel > #generationTasks { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  #createView.active.video-studio #generationTasks { grid-template-columns: 1fr; }
  #createView.active.video-studio #generationTasks > .empty-state { flex: 1; min-height: 0; }

  /* Voice: compact heading, both panels fill the height and scroll internally. */
  #audioCloneView.active { max-width: 1420px; width: 100%; margin: 0 auto; padding: 4px 24px 0; box-sizing: border-box; }
  #audioCloneView.active > .tool-heading { margin: 0 0 16px; }
  #audioCloneView.active > .tool-heading h1 { font-size: 24px; margin: 2px 0 6px; }
  #audioCloneView.active > .tool-layout { flex: 1; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  #audioCloneView.active > .tool-layout > .panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #audioCloneView.active > .tool-layout > #audioCloneForm { display: flex; flex-direction: column; }
  #audioCloneView.active > .tool-layout > #audioCloneForm #cloneText { flex: 1; min-height: 180px; resize: none; }
  #audioCloneView.active > .tool-layout > #audioCloneForm .tool-submit { margin-top: auto; }
}

/* Deep-gray studio surface shared by image and voice, matching the video panels. */
html:not([data-theme="light"]) #createView:not(.video-studio) > .studio-grid > .panel,
html:not([data-theme="light"]) #audioCloneView .tool-layout > .panel { border: 1px solid #2e3440; border-radius: 22px; background: linear-gradient(145deg, #1b2029, #151920); box-shadow: 0 18px 40px #00000026; }
html:not([data-theme="light"]) #createView:not(.video-studio) .generator-panel :is(.select-control, .polished-select),
html:not([data-theme="light"]) #audioCloneView .tool-form :is(select, textarea, input[type=file], input[type=text], .polished-select) { background: #11151c; border-color: #394351; }
html:not([data-theme="light"]) #createView:not(.video-studio) .prompt-box { border-color: #363d49; background: #11151c; border-radius: 15px; }
html:not([data-theme="light"]) #createView:not(.video-studio) .image-tier-options button,
html:not([data-theme="light"]) #createView:not(.video-studio) .compact-dropzone { background: #11151c; border-color: #394351; }
html:not([data-theme="light"]) #createView:not(.video-studio) .results-panel .image-featured,
html:not([data-theme="light"]) #createView:not(.video-studio) .results-panel .image-featured-info { background: #141a23; border-color: #303a49; }
html:not([data-theme="light"]) #audioCloneView .tool-output audio { color-scheme: dark; }

/* Voice: the submit row stays visible while the form scrolls. */
@media (min-width: 1051px) and (min-height: 620px) {
  #audioCloneView.active .tool-form > .tool-submit { position: sticky; bottom: -24px; z-index: 2; margin: 18px -24px -24px; padding: 16px 24px 20px; background: linear-gradient(180deg, rgba(21,25,32,.86), #161a21 32%); }
  html[data-theme="light"] #audioCloneView.active .tool-form > .tool-submit { background: linear-gradient(180deg, rgba(255,255,255,.86), #fff 32%); }
}

/* Image settings: every block keeps a clear gap; the footer never overlaps the prompt. */
#createView:not(.video-studio) .generator-panel > #referenceSections { margin-top: 20px; }
#createView:not(.video-studio) .generator-panel > #promptLabel { margin-top: 20px; }
#createView:not(.video-studio) .generator-panel > .generation-footer { position: static; margin: 18px 0 0; padding: 16px 0 0; background: transparent; backdrop-filter: none; border-top: 1px solid #2c3340; }
#createView:not(.video-studio) .image-ref-title { margin-bottom: 4px; }

@media (min-width: 1051px) and (min-height: 620px) {
  /* Video: two equal columns; the left settings card uses its full height. */
  #createView.active.video-studio > .studio-grid.two-column { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
  #createView.active.video-studio .generator-panel .prompt-editor { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; }
  #createView.active.video-studio .generator-panel .prompt-box { flex: 1; display: flex; flex-direction: column; margin-bottom: 18px; }
  #createView.active.video-studio .generator-panel #prompt { flex: 1; min-height: 140px; }
  #createView.active.video-studio .generator-panel > .generation-footer { margin-top: auto; }
  #createView.active.video-studio .generator-panel #videoControls { margin-bottom: 4px; }
}

/* Voice studio: decorated panels, custom player card and a wrapped download button. */
html:not([data-theme="light"]) #audioCloneView .tool-layout > .panel { position: relative; overflow-x: hidden; background: radial-gradient(120% 70% at 0% 0%, rgba(128,105,255,.10), transparent 55%), linear-gradient(145deg, #1b2029, #151920); }
html:not([data-theme="light"]) #audioCloneView .tool-layout > .tool-output { background: radial-gradient(90% 60% at 100% 0%, rgba(74,165,255,.10), transparent 60%), radial-gradient(80% 50% at 0% 100%, rgba(128,105,255,.08), transparent 60%), linear-gradient(145deg, #1b2029, #151920); }
#audioCloneView .tool-layout > .panel > .panel-head h2 { display: flex; align-items: center; gap: 10px; }
#audioCloneView .tool-layout > .panel > .panel-head h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(180deg, #9b87ff, #4aa5ff); }
#audioCloneOutput { display: flex; flex-direction: column; flex: 1; }
.voice-empty { flex: 1; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border:1px solid transparent; border-radius: 18px; background: radial-gradient(circle at 50% 40%, rgba(128,105,255,.10), transparent 60%); }
.voice-empty strong { color: #d5dae4; font-size: 15px; }
.voice-empty p { margin: 0; color: #7f8a9c; font-size: 13.5px; }
.voice-empty-wave { display: flex; align-items: center; gap: 4px; height: 56px; margin-bottom: 6px; }
.voice-empty-wave i { width: 4px; border-radius: 4px; background: linear-gradient(180deg, #9b87ff, #4aa5ff); opacity: .55; height: calc(14px + (var(--i) * 7 % 38) * 1px); animation: none; }
@keyframes voice-idle { 50% { transform: scaleY(.55); opacity: .3; } }
.voice-result-card { border: 1px solid #343c4b; border-radius: 18px; padding: 18px; background: linear-gradient(160deg, rgba(128,105,255,.10), rgba(74,165,255,.04) 60%, transparent), #141920; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 14px 30px rgba(0,0,0,.25); }
.voice-result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.voice-result-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.voice-result-head strong { color: #eef1f7; font-size: 15px; }
.voice-result-head small { color: #8390a3; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-result-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, rgba(128,105,255,.35), rgba(74,165,255,.2)); border: 1px solid rgba(155,135,255,.4); color: #e6e0ff; font-size: 18px; }
.voice-result-badge { flex: none; padding: 4px 10px; border-radius: 20px; background: rgba(55,214,155,.12); border: 1px solid rgba(55,214,155,.3); color: #5fe0ae; font-size: 13px; }
.voice-player { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border: 1px solid #2f3746; border-radius: 16px; background: #0f131a; }
.voice-play { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: linear-gradient(135deg, #8a6dff, #4f8dff); color: #fff; font-size: 15px; cursor: pointer; box-shadow: 0 6px 18px rgba(112,92,246,.4); transition: transform .15s ease, box-shadow .15s ease; }
.voice-play:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(112,92,246,.55); }
.voice-play > span { margin-left: 2px; line-height: 1; }
.voice-play.is-playing > span { margin-left: 0; font-size: 13px; letter-spacing: -1px; }
.voice-track { position: relative; flex: 1; height: 40px; cursor: pointer; outline: none; }
.voice-track:focus-visible { box-shadow: 0 0 0 2px rgba(139,122,255,.5); border-radius: 8px; }
.voice-wave { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 3px; background: #3a4353; }
.voice-wave-progress { clip-path: inset(0 calc(100% - var(--voice-progress, 0%)) 0 0); }
.voice-wave-progress i { background: linear-gradient(180deg, #a898ff, #58a8ff); }
.voice-time { flex: none; min-width: 78px; text-align: right; color: #aab4c4; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.voice-result-card audio { display: none; }
.voice-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.voice-download { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 12px; border: 1px solid rgba(155,135,255,.45); background: linear-gradient(135deg, rgba(128,105,255,.28), rgba(74,165,255,.18)); color: #f1eeff; font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 6px 18px rgba(80,70,200,.22); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.voice-download:hover { transform: translateY(-1px); border-color: rgba(175,160,255,.8); box-shadow: 0 10px 24px rgba(80,70,200,.35); }
.voice-download > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.14); font-size: 14px; }
html[data-theme="light"] .voice-result-card { background: #fff; border-color: #e1e4ee; }
html[data-theme="light"] .voice-player { background: #f5f6fb; border-color: #e1e4ee; }
html[data-theme="light"] .voice-result-head strong { color: #1f2430; }
html[data-theme="light"] .voice-download { color: #3b2fb0; }
@media (prefers-reduced-motion: reduce) { .voice-empty-wave i { animation: none; } }
@media (min-width: 1051px) and (min-height: 620px) {
  #createView.active.video-studio .generator-panel > #demoNotice { margin: 14px 0 14px; }
}

/* Task center: the page stays still; only the task list scrolls. */
@media (min-width: 1051px) and (min-height: 620px) {
  body:has(#tasksView.active) { height: 100dvh; overflow: hidden; }
  body:has(#tasksView.active) .workspace { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; box-sizing: border-box; }
  #tasksView.active { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  #tasksView.active > .task-page-head { flex: none; }
  #tasksView.active > .task-surface { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #tasksView.active .task-list { min-height: 100%; }
}
.task-entry .status-badge { min-height: 30px; padding: 6px 13px; font-size: 15px; font-weight: 650; line-height: 1; }
/* ===== 时间选择窗口：输入框 + 日历按钮 + 弹出面板 ===== */
.dt-field{position:relative;display:inline-flex;align-items:center;min-width:0;vertical-align:middle}
.dt-field>input.dt-input{width:100%;min-width:0;padding-right:40px;font-variant-numeric:tabular-nums;letter-spacing:.01em}
.dt-field>input.dt-input::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}
.dt-field>input.dt-input:focus-visible{outline:2px solid rgba(150,128,255,.55);outline-offset:1px}
.dt-trigger{position:absolute;right:5px;top:50%;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:8px;background:rgba(139,122,255,.14);color:#b8adff;cursor:pointer;transform:translateY(-50%);transition:background .15s,color .15s}
.dt-trigger svg{width:16px;height:16px}
.dt-trigger:hover,.dt-trigger[aria-expanded="true"]{background:linear-gradient(135deg,#8a6dff,#5d7bff);color:#fff}
.dt-trigger:focus-visible{outline:2px solid #b5a6ff;outline-offset:1px}
.dt-trigger:disabled{opacity:.4;cursor:not-allowed}
/* 各页面里的宽度，保证「2026/09/28 23:59:59」完整显示 */
.record-filters .dt-field>input.dt-input,.finance-toolbar .dt-field>input.dt-input{width:232px;max-width:none;padding-right:40px}
.task-date-form label{align-items:stretch}
.task-date-form .dt-field{display:flex;width:100%}
.task-date-form .dt-field>input.dt-input{width:100%;padding-right:40px}

.dt-panel{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:308px;max-width:calc(100vw - 16px);padding:14px;overflow:visible;border:1px solid #3d3656;border-radius:16px;background:linear-gradient(160deg,#1d1b2c 0%,#131725 55%,#10141e 100%);color:#e4e6ef;box-shadow:0 24px 60px rgba(0,0,0,.55),0 0 0 1px rgba(139,122,255,.08),inset 0 1px rgba(255,255,255,.05);font-size:14px}
.dt-panel [hidden]{display:none!important}
.dt-head{display:flex;align-items:center;gap:4px;margin-bottom:10px}
.dt-title{flex:1;text-align:center;color:#f1effa;font-size:16px;font-weight:700;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.dt-nav{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:9px;background:transparent;color:#a39bc9;font-size:17px;line-height:1;cursor:pointer}
.dt-nav:hover{background:rgba(139,122,255,.16);color:#fff}
.dt-nav:focus-visible{outline:2px solid #9680ff;outline-offset:1px}
.dt-week{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.06)}
.dt-week span{text-align:center;color:#7d7898;font-size:13.5px;font-weight:600}
.dt-week span:nth-child(n+6){color:#b192ff}
.dt-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px 0}
.dt-day{position:relative;height:36px;padding:0;border:0;border-radius:10px;background:transparent;color:#dcdff0;font:inherit;font-size:14px;font-variant-numeric:tabular-nums;cursor:pointer;transition:background .12s,color .12s}
.dt-day:hover{background:rgba(139,122,255,.18);color:#fff}
.dt-day:focus-visible{outline:2px solid #9680ff;outline-offset:-2px}
.dt-day.is-outside{color:#545a70}
.dt-day.is-today{color:#c4b8ff;font-weight:700}
.dt-day.is-today:after{content:'';position:absolute;left:50%;bottom:5px;width:4px;height:4px;border-radius:50%;background:#a898ff;transform:translateX(-50%)}
.dt-day.in-range{border-radius:0;background:rgba(125,109,240,.14)}
.dt-day.range-start{border-radius:10px 0 0 10px}
.dt-day.range-end{border-radius:0 10px 10px 0}
.dt-day.range-start.range-end{border-radius:10px}
.dt-day.is-selected{border-radius:10px;background:linear-gradient(135deg,#8a6dff,#5d7bff);color:#fff;font-weight:700;box-shadow:0 6px 16px rgba(112,92,246,.45)}
.dt-day.is-selected.is-today:after{background:#fff}
.dt-time{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;margin-top:12px;padding:10px 12px;border:1px solid rgba(255,255,255,.07);border-radius:12px;background:rgba(8,10,18,.55)}
.dt-time-label{color:#8e89ab;font-size:13.5px;font-weight:600}
.dt-clock{display:flex;align-items:center;gap:3px}
.dt-clock i{color:#6f6a8c;font-style:normal;font-weight:700}
.dt-clock-part{box-sizing:border-box;width:36px;height:32px;padding:0;border:1px solid #373150;border-radius:8px;background:#0c0f18;color:#f1effa;font:inherit;font-size:16px;font-weight:700;text-align:center;font-variant-numeric:tabular-nums}
.dt-clock-part:focus{outline:none;border-color:#8a6dff;box-shadow:0 0 0 3px rgba(138,109,255,.22)}
.dt-quick{display:flex;gap:4px;margin-left:auto}
.dt-quick button{height:26px;padding:0 8px;border:1px solid #332e48;border-radius:7px;background:transparent;color:#aaa3cf;font:inherit;font-size:13px;font-variant-numeric:tabular-nums;cursor:pointer}
.dt-quick button:hover{border-color:#7d6df0;color:#fff}
.dt-foot{display:flex;align-items:center;gap:6px;margin-top:12px}
.dt-link{height:32px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:#a39bc9;font:inherit;font-size:14px;cursor:pointer}
.dt-link:hover{background:rgba(139,122,255,.12);color:#fff}
.dt-link[data-dt-action="clear"]:hover{background:rgba(255,100,120,.12);color:#ff9aaa}
.dt-confirm{margin-left:auto;height:34px;padding:0 20px;border:0;border-radius:10px;background:linear-gradient(135deg,#8a6dff,#5d7bff);color:#fff;font:inherit;font-size:14px;font-weight:700;cursor:pointer;box-shadow:0 8px 20px rgba(112,92,246,.35)}
.dt-confirm:hover{filter:brightness(1.08)}
.dt-confirm:disabled{opacity:.4;box-shadow:none;cursor:not-allowed}
.dt-link:focus-visible,.dt-confirm:focus-visible,.dt-quick button:focus-visible{outline:2px solid #b5a6ff;outline-offset:1px}
html[data-theme="light"] .dt-trigger{background:rgba(119,100,221,.12);color:#6a55d8}
html[data-theme="light"] .dt-panel{border-color:#dcd7f3;background:linear-gradient(160deg,#ffffff,#f7f6fd);color:#1f2433;box-shadow:0 24px 60px rgba(40,30,90,.18)}
html[data-theme="light"] .dt-title{color:#1f2433}
html[data-theme="light"] .dt-week{border-bottom-color:#ebe8f7}
html[data-theme="light"] .dt-day{color:#2c3244}
html[data-theme="light"] .dt-day.is-outside{color:#b2b6c4}
html[data-theme="light"] .dt-day.is-today{color:#6a55d8}
html[data-theme="light"] .dt-day.in-range{background:rgba(119,100,221,.1)}
html[data-theme="light"] .dt-day.is-selected{color:#fff}
html[data-theme="light"] .dt-time{border-color:#ebe8f7;background:#f4f2fc}
html[data-theme="light"] .dt-clock-part{border-color:#d9d4f0;background:#fff;color:#1f2433}
html[data-theme="light"] .dt-quick button{border-color:#dcd7f3;color:#5b4fae}
html[data-theme="light"] .dt-link{color:#5b4fae}
/* 音频克隆：删除上传的音频、把新生成的语音放回左侧当参考 */
.voice-ref { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid #353d52; border-radius: 12px; background: #11151e; color: #d9dcea; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.voice-ref > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(139,122,255,.18); color: #c2b6ff; font-size: 14px; }
.voice-ref:hover { border-color: rgba(155,135,255,.6); background: rgba(128,105,255,.12); transform: translateY(-1px); }
.voice-ref:disabled, .voice-ref.is-busy { opacity: .6; cursor: progress; transform: none; }
.voice-remove { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #3a3346; border-radius: 9px; background: transparent; color: #a8a2bd; font-size: 18px; line-height: 1; cursor: pointer; }
.voice-remove:hover { border-color: rgba(255,120,140,.55); background: rgba(255,100,120,.12); color: #ff9aaa; }
.voice-ref:focus-visible, .voice-remove:focus-visible { outline: 2px solid #b5a6ff; outline-offset: 2px; }
html[data-theme="light"] .voice-ref { background: #fff; border-color: #dcd7f3; color: #3b2fb0; }
html[data-theme="light"] .voice-remove { border-color: #e1e4ee; color: #6b7185; }

/* Voice page (2026-09-29): same two-column studio layout as image/video; the shared
   "生成记录" panel is moved into this grid while the page is open. */
#audioCloneView .restore-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#audioCloneView .studio-grid.two-column{align-items:stretch}
#audioCloneView .voice-generator-panel{display:flex;flex-direction:column}
#audioCloneView .voice-generator-panel .field-label{margin:18px 0 8px}
#audioCloneView .voice-generator-panel>.panel-head+.field-label{margin-top:4px}
#audioCloneView .voice-upload-stage{position:relative;display:flex;height:68px;align-items:center;justify-content:center;overflow:hidden;border:1px solid transparent;border-radius:12px;background:#080b12;cursor:pointer}
#audioCloneView .voice-upload-stage:hover,#audioCloneView .voice-upload-stage:focus-within{border-color:var(--purple);outline:2px solid rgba(128,105,255,.35);outline-offset:2px}
#audioCloneView .voice-upload-stage input[type=file]{position:absolute;inset:0;z-index:2;width:100%;height:100%;padding:0;border:0;opacity:0;cursor:pointer}
#audioCloneView .voice-upload-empty{display:flex;align-items:center;gap:9px;padding:9px;color:var(--muted2);pointer-events:none}
#audioCloneView .voice-upload-empty>span{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:rgba(128,105,255,.15);color:#a898ff;font-size:20px}
#audioCloneView .voice-upload-empty strong{font-size:13.5px}#audioCloneView .voice-upload-empty small{color:var(--muted);font-size:12px}
#audioCloneView .voice-text-box{position:relative;display:flex;flex-direction:column;flex:1;min-height:150px}
#audioCloneView .voice-text-box textarea{flex:1;min-height:150px;padding:14px 14px 28px;resize:none;border-radius:15px}
#audioCloneView .voice-text-box .tool-counter{position:absolute;right:12px;bottom:9px;margin:0}
#audioCloneView .voice-generator-panel>.generation-footer{position:static;margin:18px 0 0;padding:16px 0 0;background:transparent;backdrop-filter:none;border-top:1px solid #2c3340}
#audioCloneView .voice-generator-panel>.tool-notice:empty{display:none}
#audioCloneView .results-panel{display:flex;flex-direction:column}
#audioCloneView .results-panel>:is(.panel-head,.result-count){flex:none}
#audioCloneView #generationTasks{flex:1;min-height:0;display:flex;flex-direction:column}
html:not([data-theme="light"]) #audioCloneView .studio-grid>.panel{border:1px solid #2e3440;border-radius:22px;background:linear-gradient(145deg,#1b2029,#151920);box-shadow:0 18px 40px #00000026}
html:not([data-theme="light"]) #audioCloneView .voice-generator-panel :is(select,textarea,.select-control,.polished-select){background:#11151c;border-color:#394351}
html[data-theme="light"] #audioCloneView .voice-upload-stage{background:#f7f8fc}
@media (min-width:1051px) and (min-height:620px){
  #audioCloneView.active{max-width:none;padding:0}
  #audioCloneView.active>.studio-grid.two-column{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
  #audioCloneView.active>.studio-grid>.panel{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  #audioCloneView.active>.studio-grid>.results-panel{overflow:hidden}
  #audioCloneView.active #generationTasks{overflow-y:auto}
}
/* Audio records in the feed use the custom voice player. */
#generationTasks .feed-voice{width:min(520px,100%)}
#generationTasks .feed-voice audio{display:none}
#generationTasks .feed-voice .voice-result-actions{justify-content:flex-start;margin-top:10px}
#generationTasks .feed-voice .voice-ref{height:32px;padding:0 12px;font-size:13px}
#audioCloneView .voice-generator-panel>.panel-head{margin-bottom:12px}

/* Image, video and voice pages share one column split (same as the image page). */
@media (min-width:1181px){
  #createView>.studio-grid.two-column,#createView.active.video-studio>.studio-grid.two-column,#audioCloneView>.studio-grid.two-column{grid-template-columns:minmax(350px,.92fr) minmax(460px,1.32fr);gap:18px}
}
@media (min-width:901px) and (max-width:1180px){
  #createView>.studio-grid.two-column,#createView.active.video-studio>.studio-grid.two-column,#audioCloneView>.studio-grid.two-column{grid-template-columns:minmax(320px,.9fr) minmax(430px,1.1fr);gap:18px}
}

/* Design layer (2026-09-29): serif display type for headings, geometric numerals,
   accent bars and soft glows. Fonts are self-hosted in /fonts (SIL OFL). */
:root{--font-display:"Smiley Sans","PingFang SC","Microsoft YaHei",sans-serif;--font-num:"Space Grotesk",Inter,"SF Pro Display",sans-serif}
.brand strong,.login-card h1,.task-page-head h1,.view h1:not(.restore-visually-hidden),.panel-head h2,dialog h2{font-family:var(--font-display);font-weight:400;letter-spacing:.02em}
.brand strong{font-size:22px;background:linear-gradient(92deg,#f1eeff 10%,#b9a8ff 55%,#7cc4ff);-webkit-background-clip:text;background-clip:text;color:transparent}
.brand span,.eyebrow,.nav-title{font-family:var(--font-num);letter-spacing:.18em;text-transform:uppercase}
.nav-title{font-size:11px;color:#5d6578}
.login-card h1{font-size:40px;letter-spacing:.03em}
.task-page-head h1{font-size:34px}
/* Panel titles get the same gradient accent bar on every studio page. */
:is(#createView,#audioCloneView,#settingsView) .panel>.panel-head h2{display:flex;align-items:center;gap:10px;font-size:22px}
:is(#createView,#audioCloneView,#settingsView) .panel>.panel-head h2::before{content:"";flex:none;width:4px;height:17px;border-radius:4px;background:linear-gradient(180deg,#9b87ff,#4aa5ff);box-shadow:0 0 12px rgba(139,122,255,.55)}
#createView.video-studio .generator-panel>.panel-head h2::before{display:none}
/* Numbers: points, prices, counters, timers and dates. */
#globalPoints,#globalTaskCount,#taskCount,#estimatedCost,#audioClonePrice,#restorePrice,.generation-footer strong,.task-timer,.tool-counter,.feed-tile-index,.voice-time,.record-date,.task-points,#durationValue,#cloneEmotionStrengthValue{font-family:var(--font-num);font-variant-numeric:tabular-nums}
.generation-footer strong{font-size:22px;letter-spacing:.01em}
#globalPoints{font-size:15px;background:linear-gradient(92deg,#fff,#c9bcff);-webkit-background-clip:text;background-clip:text;color:transparent}
.record-date{letter-spacing:.06em}
/* Soft light at the top edge of studio panels. */
html:not([data-theme="light"]) :is(#createView,#audioCloneView)>.studio-grid>.panel{position:relative;isolation:isolate}
html:not([data-theme="light"]) :is(#createView,#audioCloneView)>.studio-grid>.panel::after{content:"";position:absolute;inset:0 0 auto;height:1px;z-index:-1;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(155,135,255,.55) 30%,rgba(74,165,255,.45) 70%,transparent)}
html:not([data-theme="light"]) .workspace{background:radial-gradient(900px 420px at 85% -10%,rgba(90,110,255,.08),transparent 70%),radial-gradient(700px 380px at 10% 110%,rgba(139,122,255,.06),transparent 70%)}
/* Primary buttons: display type and a gentle sheen on hover. */
.primary-button strong,.login-button span:first-child{font-family:var(--font-display);font-weight:400;font-size:1.18em;letter-spacing:.03em}
.primary-button{position:relative;overflow:hidden}
.primary-button::after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 35%,rgba(255,255,255,.22) 50%,transparent 65%);transform:translateX(-120%);transition:transform .7s ease;pointer-events:none}
.primary-button:not(:disabled):hover::after{transform:translateX(120%)}
.feed-tabs button[aria-pressed="true"]{box-shadow:0 0 0 1px rgba(155,135,255,.25),0 6px 18px rgba(128,105,255,.22)}
@media(prefers-reduced-motion:reduce){.primary-button::after{transition:none}}

/* Settings: default generation settings card. */
.settings-defaults-hint{margin:6px 0 0;color:#8a93a6;font-size:13px}
.settings-defaults-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.settings-defaults-grid fieldset{min-width:0;margin:0;padding:16px 18px 18px;border:1px solid #2a303c;border-radius:16px;background:#171b23;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.settings-defaults-grid legend{padding:0 8px;color:#d9dcea;font-family:var(--font-display);font-size:17px}
.settings-defaults-grid label{display:flex;flex-direction:column;gap:7px;min-width:0;color:#9aa3b6;font-size:13px}
.settings-defaults-grid select{width:100%}
.settings-defaults-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:18px}
.settings-defaults-status{flex:1;margin:0;color:#8fa0bf;font-size:13px}
.settings-defaults-actions .subtle-button{height:42px;padding:0 16px;border-radius:13px}
.settings-defaults-actions .primary-button{height:42px;padding:0 22px;border-radius:13px}
html[data-theme="light"] .settings-defaults-grid fieldset{background:#f7f8fc;border-color:#e1e4ee}
html[data-theme="light"] .settings-defaults-grid legend{color:#262a3a}
@media(max-width:900px){.settings-defaults-grid{grid-template-columns:1fr}}
@media(max-width:520px){.settings-defaults-grid fieldset{grid-template-columns:1fr}.settings-defaults-actions{flex-wrap:wrap}}

/* Restore page (2026-09-29): identical studio layout; the shared "生成记录" feed sits on the right
   and the uploaded original previews inside the upload box. */
@media (min-width:1181px){#restoreView>.studio-grid.two-column{grid-template-columns:minmax(350px,.92fr) minmax(460px,1.32fr);gap:18px}}
@media (min-width:901px) and (max-width:1180px){#restoreView>.studio-grid.two-column{grid-template-columns:minmax(320px,.9fr) minmax(430px,1.1fr);gap:18px}}
#restoreView .restore-upload-row{display:flex;align-items:center;gap:14px}
#restoreView .restore-upload-row .restore-upload-stage{flex:none;width:96px;height:96px;margin-top:0}
#restoreView .restore-upload-row .restore-upload-empty{flex-direction:column;gap:6px;padding:6px;text-align:center}
#restoreView .restore-upload-row #restoreInputBox{padding:0}
#restoreView .restore-upload-row #restoreInputPreview{width:100%;height:100%;object-fit:cover;border-radius:0}
#restoreView .restore-upload-meta{display:flex;flex-direction:column;gap:4px;min-width:0}
#restoreView .restore-upload-meta strong{overflow:hidden;color:var(--text);font-size:14px;text-overflow:ellipsis;white-space:nowrap}
#restoreView .restore-upload-meta small{color:var(--muted);font-size:12px}
#restoreView .restore-compare-group{display:flex;flex:1;flex-direction:column;min-height:300px;margin-top:4px}
#restoreView .restore-compare-stage{position:relative;display:flex;flex:1;min-height:260px;overflow:hidden;border:1px solid var(--line2);border-radius:14px;background:#080b12}
#restoreView .restore-compare-stage>*{flex:1;min-width:0}
#restoreView .restore-compare-stage .image-feature-empty{display:flex}
#restoreView .restore-compare-stage .image-feature-empty>.empty-state{flex:1;min-height:0;border:0;background:transparent}
#restoreView .restore-compare-stage .image-featured{display:flex;flex-direction:column;min-height:0;border:0;background:transparent}
#restoreView #restoreOutput .tool-compare,#restoreView #restoreOutput .restore-single-output{flex:1;height:auto;min-height:240px}
#restoreView #restoreOutput .image-featured-info{flex:none}
#restoreView .results-panel{display:flex;flex-direction:column}
#restoreView .results-panel>:is(.panel-head,.result-count){flex:none}
#restoreView #generationTasks{flex:1;min-height:0;display:flex;flex-direction:column}
html:not([data-theme="light"]) #restoreView .studio-grid>.panel{border:1px solid #2e3440;border-radius:22px;background:linear-gradient(145deg,#1b2029,#151920);box-shadow:0 18px 40px #00000026}
html:not([data-theme="light"]) #restoreView .studio-grid>.panel{position:relative;isolation:isolate}
html:not([data-theme="light"]) #restoreView .studio-grid>.panel::after{content:"";position:absolute;inset:0 0 auto;height:1px;z-index:-1;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(155,135,255,.55) 30%,rgba(74,165,255,.45) 70%,transparent)}
#restoreView .panel>.panel-head h2{display:flex;align-items:center;gap:10px;font-size:22px}
#restoreView .panel>.panel-head h2::before{content:"";flex:none;width:4px;height:17px;border-radius:4px;background:linear-gradient(180deg,#9b87ff,#4aa5ff);box-shadow:0 0 12px rgba(139,122,255,.55)}
@media (min-width:1051px) and (min-height:620px){
  body:has(#restoreView.active){height:100dvh;overflow:hidden}
  body:has(#restoreView.active) .workspace{height:100dvh;overflow:hidden;display:flex;flex-direction:column;padding-bottom:20px;box-sizing:border-box}
  #restoreView.active{flex:1;min-height:0;display:flex;flex-direction:column}
  #restoreView.active>.studio-grid.two-column{flex:1;min-height:0;align-items:stretch;grid-template-rows:minmax(0,1fr)}
  #restoreView.active>.studio-grid>.panel{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  #restoreView.active>.studio-grid>.results-panel{overflow:hidden}
  #restoreView.active #generationTasks{overflow-y:auto}
}

/* Settings: default video model uses the same two-level picker as the video page. */
/* 2x2 like the image column: the picker is one cell; long names/billing truncate instead of widening it. */
.settings-defaults-grid .settings-video-model{grid-column:auto;min-width:0;display:flex;flex-direction:column}
.settings-defaults-grid .settings-video-model>.video-model-picker{min-width:0}
.settings-defaults-grid .settings-video-model summary{min-width:0;padding-top:0;padding-bottom:0}
.settings-defaults-grid .settings-video-model .video-model-selected{flex:1 1 auto}
.settings-defaults-grid .settings-video-model .video-model-selected strong{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.settings-defaults-grid .settings-video-model .video-model-selected small{display:none}
.settings-defaults-grid .settings-video-model .video-model-selected-meta{flex:0 1 auto;min-width:0}
.settings-defaults-grid .settings-video-model .video-model-selected-meta small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.settings-defaults-grid .settings-video-model>span{display:block;margin-bottom:7px;color:#9aa3b6;font-size:13px}
.settings-defaults-grid fieldset{align-content:start}
.settings-defaults-grid .settings-video-defaults{grid-template-columns:repeat(2,minmax(0,1fr))}
.settings-video-defaults .video-model-selected-meta{max-width:48%}
@media(max-width:520px){.settings-video-defaults .video-model-selected-meta small{display:none}}
/* Restore compare box: before/after labels float on the image; download lives in the record feed. */
#restoreView .restore-compare-stage .image-featured{position:relative}
#restoreView .restore-compare-stage .tool-compare-labels{position:absolute;top:10px;left:12px;right:12px;z-index:3;display:flex;justify-content:space-between;margin:0;pointer-events:none}
#restoreView .restore-compare-stage .tool-compare-labels span{padding:3px 10px;border-radius:999px;background:rgba(5,7,12,.72);color:#e6e8f0;font-size:12px}
#restoreView .restore-compare-stage .image-featured-info{display:none}
#restoreView #restoreOutput .tool-compare,#restoreView #restoreOutput .restore-single-output{min-height:0;height:100%}
#restoreView .generator-panel>.generation-footer{position:static;margin:18px 0 0;padding:16px 0 0;background:transparent;backdrop-filter:none;border-top:1px solid #2c3340}
#restoreView .restore-upload-meta{flex:1}
#restoreView #restoreInputName{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Compare box empty state: centred in the box (older rule forced a taller min-height). */
#restoreView #restoreOutput.restore-compare-stage .image-feature-empty{flex:1;display:flex;min-height:0}
#restoreView #restoreOutput.restore-compare-stage .image-feature-empty>.empty-state{flex:1;min-height:0;height:auto;justify-content:center}
.settings-defaults-grid .settings-video-model summary{height:46px;min-height:46px;box-sizing:border-box}

/* One 生成记录 panel: identical box on image, video, voice and restore pages (no shift when switching). */
@media (min-width:1051px) and (min-height:620px){
  #createView.active.video-studio .studio-grid>.results-panel{padding:20px 20px 18px}
  body:has(#createView.active:not(.canvas-generator-mode)) .workspace,#app:has(#createView.active:not(.video-studio))>.workspace{padding-bottom:20px}
}

/* Canvas on a fresh load: stays invisible (but laid out) until fully drawn, then fades in once. */
#canvasIntegratedView{transition:opacity .18s ease}
#canvasIntegratedView.canvas-revealing{opacity:0;transition:none}
@media(prefers-reduced-motion:reduce){#canvasIntegratedView{transition:none}}

/* Pending/failed audio in the generation feed: a player-shaped bar, not an image box. */
.feed-voice-pending{display:flex;align-items:center;gap:14px;width:min(520px,100%);padding:12px 16px 12px 12px;border:1px solid #2f3746;border-radius:16px;background:#0f131a}
.feed-voice-pending-icon{width:44px;height:44px;flex:none;display:grid;place-items:center;border-radius:50%;background:linear-gradient(135deg,rgba(138,109,255,.35),rgba(79,141,255,.35));color:#dcd6ff;font-size:17px}
.feed-voice-pending-body{flex:1;min-width:0;display:grid;gap:4px}
.feed-voice-pending-wave{display:flex;align-items:center;gap:2px;height:22px}
.feed-voice-pending-wave i{flex:1;min-width:2px;height:30%;border-radius:3px;background:#3a4353;animation:voice-pending 1.4s ease-in-out infinite;animation-delay:calc(var(--i) * -0.09s)}
.feed-voice-pending strong{color:#9fc6ff;font-size:13.5px}
.feed-voice-pending small{color:#7c8498;font-size:12px;overflow-wrap:anywhere}
.feed-voice-pending.is-failed{border-color:rgba(255,100,124,.35)}
.feed-voice-pending.is-failed .feed-voice-pending-icon{background:rgba(255,100,124,.18);color:#ff8b9c}
.feed-voice-pending.is-failed .feed-voice-pending-wave i{animation:none;background:#3a2a33}
.feed-voice-pending.is-failed strong{color:#ff8b9c}
@keyframes voice-pending{0%,100%{height:25%;background:#3a4353}50%{height:95%;background:#6f7ff0}}
@media(prefers-reduced-motion:reduce){.feed-voice-pending-wave i{animation:none;height:45%}}
html[data-theme="light"] .feed-voice-pending{background:#f5f6fb;border-color:#e1e4ee}
html[data-theme="light"] .feed-voice-pending strong{color:#3b2fb0}

#createView:not(.video-studio) .prompt-box textarea.mj-prompt{min-height:420px}
#prompt.mj-prompt::placeholder{font-size:12.5px;line-height:1.65}

/* Clear glass: translucent surfaces, no decorative light or reflected gradients.
   Keep content fully opaque and reserve live blur for small, temporary overlays. */
:root {
  --glass-surface: rgba(32,41,57,.32);
  --glass-popup: rgba(19,26,39,.8);
  --glass-inset: rgba(7,13,23,.2);
  --glass-border: rgba(205,219,242,.16);
  --glass-shadow: 0 10px 26px rgba(0,0,0,.12);
  --glass-solid: #151e2c;
  --glass-blur: blur(8px) saturate(105%);
  --panel: rgba(22,29,44,.4);
  --panel2: rgba(28,37,54,.32);
  --line: rgba(172,190,225,.14);
  --line2: rgba(172,190,225,.2);
  --muted: #9aa6bc;
}
html[data-theme="light"] {
  --glass-surface: rgba(255,255,255,.42);
  --glass-popup: rgba(247,250,255,.86);
  --glass-inset: rgba(238,244,252,.35);
  --glass-border: rgba(100,122,160,.2);
  --glass-shadow: 0 10px 26px rgba(40,67,108,.07);
  --glass-solid: #f1f5fc;
  --panel: rgba(247,250,255,.5);
  --panel2: rgba(237,244,255,.4);
  --line: rgba(100,122,160,.16);
  --line2: rgba(100,122,160,.23);
  --muted: #59677e;
}
html body { background: linear-gradient(135deg, #101a2a, #090d17 58%, #151326); }
html[data-theme="light"] body { background: linear-gradient(135deg, #e8eef7, #f1f4f9 58%, #eeebf6); }
body::before { background: none; }
html body :is(.sidebar, .topbar, .login-card, .panel, .stat-card) {
  background: var(--glass-surface) !important;
  border-color: var(--glass-border) !important;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html body .sidebar { border-radius: 0 22px 22px 0; }
html body .topbar { border: 1px solid var(--glass-border); border-radius: 20px; padding-inline: 20px; }
html body :is(.panel, .stat-card) { border-radius: 20px; }
html body :is(
  .sidebar-foot, .model-card, .asset-card, .canvas-card, .settings-card,
  .settings-simple-card, .settings-ledger-card, .settings-panel, .price-table-card,
  .result-card, .result-row, .generation-result, .task-entry-body,
  .channel-card, .price-card, .runninghub-product-card, .account-detail-panel,
  .channel-health-card, .provider-balance-card, .provider-account-auth,
  .workspace-session-card, .platform-create, .price-route, .price-table-tabs,
  .voice-result-card, .voice-player, .tool-tier, .tool-file-preview
) {
  background: var(--glass-surface) !important;
  border-color: var(--glass-border) !important;
  box-shadow: none;
}
/* Selection/focus remains visible, without a surrounding glow. */
html body :is(.model-card.selected, .model-card.active, .tool-tier:has(input:checked)) {
  border-color: #9985ff !important;
  box-shadow: inset 0 0 0 1px rgba(147,126,255,.35);
}
html body :is(dialog, dialog.polished-dialog, .choice-menu, .video-model-menu, .reference-mention-menu, .dt-panel) {
  background: var(--glass-popup) !important;
  border-color: var(--glass-border) !important;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
html body dialog::backdrop { background: rgba(3,7,16,.4); -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-theme="light"] body dialog::backdrop { background: rgba(51,68,96,.18); }
html body :is(.account-detail-header, .price-route header, .canvas-card-open) {
  background: transparent !important;
  border-color: var(--glass-border);
}
html body :is(.prompt-box, .voice-upload-stage, .restore-upload-stage) {
  background: var(--glass-inset) !important;
  border-color: var(--glass-border) !important;
  box-shadow: none;
}
html body :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([data-canvas-node-title] *),
html body :is(.polished-select, .select-control, .video-model-picker > summary, .settings-defaults-grid fieldset) {
  background-color: var(--glass-inset) !important;
  background-image: none !important;
  border-color: var(--glass-border);
}
html body :is(.choice-option:hover, .video-model-option:hover) { background: rgba(143,166,213,.12); }
/* Dense sticky headers protect readability when rows scroll underneath. */
html body :is(.table-wrap th, .price-table th) { background: var(--glass-solid); }
html body :is(.panel, .stat-card, .sidebar, .topbar, dialog, .choice-menu, .dt-panel) :focus-visible { outline-color: #aa97ff; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, html[data-theme="light"] { --glass-surface: var(--glass-solid); --glass-popup: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  :root, html[data-theme="light"] { --glass-surface: var(--glass-solid); --glass-popup: var(--glass-solid); --glass-blur: none; }
}

/* Navigation collapse lives in the sidebar footer, not on a protruding edge handle. */
html body #adminApp > .sidebar { overflow: hidden; }
.sidebar-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar-footer {
  flex: none;
  margin-top: 12px;
  padding: 12px 0 10px;
  border-top: 1px solid var(--glass-border);
}
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text, #c3cddd);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.sidebar-toggle svg { flex: none; width: 20px; height: 20px; pointer-events: none; }
.sidebar-toggle:hover { background: rgba(143,166,213,.1); color: #baa9ff; }
.sidebar-toggle:focus-visible { outline: 2px solid #aa97ff; outline-offset: -2px; }
#app.sidebar-collapsed, #adminApp.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
#app.sidebar-collapsed > .sidebar, #adminApp.sidebar-collapsed > .sidebar { display: none; }
#app.sidebar-collapsed > .workspace, #adminApp.sidebar-collapsed > .workspace { grid-column: 2; margin-left: 0; }
.app-shell > .sidebar-expand { display: none; }
.app-shell.sidebar-collapsed > .sidebar-expand {
  position: fixed;
  z-index: 60;
  bottom: 40px;
  left: 12px;
  display: flex;
  width: auto;
  border: 1px solid var(--glass-border);
  background: var(--glass-popup);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.sidebar-expand svg { transform: rotate(180deg); }
/* The host owns navigation while embedded; full-screen canvases retain their original controls. */
html[data-admin-embed] #app > .sidebar-expand,
body:is(.canvas-fullscreen, .canvas-integrated-project) #app > .sidebar-expand,
#adminApp.workspace-canvas-fullscreen > .sidebar-expand { display: none; }
@media (max-width: 800px) {
  #app .sidebar-collapse { justify-content: center; padding-inline: 0; }
  #app .sidebar-collapse span { display: none; }
}

/* Collapsed navigation stays as a clickable icon rail; it no longer disappears. */
.app-shell.sidebar-collapsed, #app.sidebar-collapsed, #adminApp.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}
.app-shell.sidebar-collapsed > .sidebar,
#app.sidebar-collapsed > .sidebar,
#adminApp.sidebar-collapsed > .sidebar {
  display: flex !important;
  width: 76px;
  min-width: 76px;
  padding-inline: 10px;
  overflow: hidden;
}
.app-shell.sidebar-collapsed > .workspace,
#app.sidebar-collapsed > .workspace,
#adminApp.sidebar-collapsed > .workspace { grid-column: 2; margin-left: 0; }
.app-shell.sidebar-collapsed .sidebar-content { overflow-x: hidden; overflow-y: auto; }
.app-shell.sidebar-collapsed .sidebar .brand { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .sidebar .brand > div:last-child,
.app-shell.sidebar-collapsed .sidebar .nav-title,
.app-shell.sidebar-collapsed .sidebar .nav-item > span,
.app-shell.sidebar-collapsed .sidebar .nav-item > b,
.app-shell.sidebar-collapsed .sidebar .nav-item > em,
.app-shell.sidebar-collapsed .sidebar .sidebar-foot > div:nth-child(2) { display: none; }
.app-shell.sidebar-collapsed .sidebar nav { width: 100%; }
.app-shell.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  gap: 0;
  width: 100%;
  padding-inline: 0;
  font-size: 0;
}
.app-shell.sidebar-collapsed .sidebar .nav-item svg,
.app-shell.sidebar-collapsed .sidebar .nav-symbol { width: 20px; height: 20px; flex: none; }
.app-shell.sidebar-collapsed #adminApp .admin-nav .nav-item,
#adminApp.sidebar-collapsed .admin-nav .nav-item { display: flex; align-items: center; }
#adminApp .admin-nav .nav-item { display: flex; align-items: center; gap: 11px; }
#adminApp .admin-nav .nav-item > span { flex: 1; }
#adminApp .admin-nav .nav-symbol { display: none; width: 18px; height: 18px; flex: none; }
#adminApp.sidebar-collapsed .admin-nav .nav-symbol { display: block; }
.app-shell.sidebar-collapsed .sidebar .sidebar-foot { justify-content: center; padding-inline: 8px; }
.app-shell.sidebar-collapsed .sidebar .sidebar-toggle { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .sidebar .sidebar-toggle span { display: none; }
.app-shell.sidebar-collapsed .sidebar .sidebar-toggle svg { transform: rotate(180deg); }
.app-shell.sidebar-collapsed > .sidebar-expand { display: none !important; }
body:is(.canvas-fullscreen, .canvas-integrated-project) #app > .sidebar,
#adminApp.workspace-canvas-fullscreen > .sidebar { display: none !important; }
@media (max-width: 700px) {
  .app-shell.sidebar-collapsed { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
  .app-shell.sidebar-collapsed > .sidebar { position: sticky; top: 0; height: 100vh; }
}

@media (max-width: 700px) {
  #adminApp .sidebar-content { flex: none; overflow: visible; }
}
