/* Shared product typography and interaction layer. All assets are local. */
@font-face{font-family:Geist;src:url('/fonts/Geist-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
:root{--ui-font:Geist,'Studio Sans','Microsoft YaHei',sans-serif;--ui-ease:cubic-bezier(.22,1,.36,1)}
body,button,input,select,textarea,.filter-popover,.voice-avatar .avatar-initial{font-family:var(--ui-font);font-synthesis:none;letter-spacing:0}
body{font-size:14px;line-height:1.55;color:#263330}
button,input,select{font-size:13px}
button,.btn{font-weight:500;line-height:1.4}
.btn{transition:background-color .16s,border-color .16s,color .16s,box-shadow .16s;box-shadow:none}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.primary{box-shadow:0 1px 2px #183d2414,inset 0 1px 0 #ffffff16}
.btn.primary:hover:not(:disabled){box-shadow:0 3px 9px #234a3920}
button:focus-visible,.btn:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #77a99a;outline-offset:3px}
.ui-icon{display:inline-block;vertical-align:middle;flex-shrink:0}
#locale{display:inline-flex;align-items:center;gap:8px;min-height:34px;padding:7px 11px;border-radius:9px;font-size:12px}
#locale .ui-icon{width:16px;height:16px;color:#55786c}
.brand{font-size:21px;letter-spacing:-.5px;font-weight:650;display:flex;align-items:center;gap:10px}
.brand .ui-icon{width:25px;height:25px;color:#326e66}
.nav button{font-size:13px;min-height:41px;gap:11px;font-weight:450;border-radius:9px;transition:background-color .16s,color .16s}
.nav button>span:first-child{display:inline-flex;align-items:center;justify-content:center;width:20px}
.nav button.active{font-weight:600;box-shadow:inset 0 0 0 1px #326e6610}
.toolbar #breadcrumb{font-size:13px;color:#5d6d66}
.account-footer{padding-top:17px}.quota-caption{font-size:12px}.quota-figures b{font-size:18px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.5px}.account-identity b{font-size:12px}.account-identity small{font-size:10px}.logout-icon{width:29px;height:29px;display:grid;place-items:center;border-radius:7px}.logout-icon .ui-icon{width:16px;height:16px}
.page-head h1{font-size:23px;letter-spacing:-.6px;font-weight:600}.page-head h2{font-size:18px;font-weight:600}
.tts-parameters .setting-field>span:first-child,.parameter-caption{font-size:13px;font-weight:500;color:#43564c}
.voice-setting strong{font-size:14px;font-weight:550;line-height:1.5}.voice-setting small{font-size:12px;line-height:1.5}.voice-setting .btn{min-height:32px;font-size:12px;border-radius:8px}
.script-card textarea,.dialogue-editor textarea{font-size:16px;line-height:1.85;font-weight:400;color:#263330;caret-color:#326e66}
.script-card textarea::placeholder,.dialogue-editor textarea::placeholder{color:#9aa59f}
.filter-trigger{font-size:13px;min-height:41px}.filter-option{font-size:13px;min-height:40px}.filter-option:hover .filter-choice-icon{color:#326e66}.filter-chevron{transition:transform .18s var(--ui-ease)}
.library-controls .filters label{font-size:11px;color:#73837a}.voice-card-title h3{font-size:13px;font-weight:550;line-height:1.5}.voice-card p{font-size:12px;line-height:1.6}.voice-card{transition:border-color .16s,box-shadow .16s;background:#fff}.voice-card:hover{box-shadow:0 3px 12px #1f463508}
.dialogue-speaker{transition:border-color .16s,background-color .16s}.speaker-summary-name{font-size:13px}.speaker-speed-label{font-size:12px}.billing-badge{font-size:11px;line-height:1.5}
input[type=range].snap-speed,#dialogueDelay{appearance:none;height:5px;min-height:5px;padding:0;border:0;border-radius:99px;background:linear-gradient(to right,#326e66 var(--range-fill,50%),#e6ece8 var(--range-fill,50%));outline:none;margin:16px 0;touch-action:pan-y}
input[type=range].snap-speed::-webkit-slider-thumb,#dialogueDelay::-webkit-slider-thumb{appearance:none;width:17px;height:17px;background:#fff;border:2px solid #326e66;border-radius:50%;box-shadow:0 1px 4px #244a3726;transition:box-shadow .15s,transform .15s}
input[type=range].snap-speed:hover::-webkit-slider-thumb,#dialogueDelay:hover::-webkit-slider-thumb{box-shadow:0 0 0 5px #326e6612}
input[type=range].snap-speed:active::-webkit-slider-thumb,#dialogueDelay:active::-webkit-slider-thumb{transform:scale(1.1);box-shadow:0 0 0 7px #326e6615}
input[type=range].snap-speed::-moz-range-thumb,#dialogueDelay::-moz-range-thumb{width:14px;height:14px;background:#fff;border:2px solid #326e66;border-radius:50%}
.speed-snap-tools{font-size:10px}.speed-snap-tools button{font-size:11px}.auth-card h1{font-size:29px;letter-spacing:-.8px;font-weight:650}.auth-card input{min-height:45px;background:#fbfcfb}.auth-card form{gap:13px}.auth-card .tabs{margin-block:24px 18px}
.generation-dock .result-caption strong{font-size:13px}.result-downloads{font-size:12px}.result-play{transition:background-color .16s,box-shadow .16s}.result-play:hover{background:#285c55;box-shadow:0 0 0 4px #326e6612}
.dialogue-parameters .setting-field #dialogueDelay{height:5px;min-height:5px;padding:0;border:0;border-radius:99px;background:linear-gradient(to right,#326e66 var(--range-fill,0%),#e6ece8 var(--range-fill,0%))}
#notice{font-family:var(--ui-font);font-size:13px;transition:opacity .18s,transform .18s}
.price,.credit-number{font-variant-numeric:tabular-nums;letter-spacing:-1px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:0s!important;animation-duration:0s!important}}

/* ---- Round 2: type floor, tabular figures, icon controls, entrance motion ---- */
:root{--ui-font:Geist,'Studio Sans','PingFang SC','Microsoft YaHei',system-ui,sans-serif}
body,button,input,select,textarea,.filter-popover{font-family:var(--ui-font);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}

/* Supporting copy had drifted down to 9–10px, which reads as cramped rather than quiet. */
.editor-count small{font-size:12px}
.editor-count #ttsEstimate{font-size:11px}
.editor-footer-left{font-size:12px}
.speed-snap-tools,.speed-snap-tools button{font-size:11px}
.result-caption span,.result-caption small,.generation-note{font-size:11px}
.quota-caption b,.account-identity small{font-size:11px}
.voice-tags,.billing-badge,.dialogue-panel-heading>span{font-size:11px}
.pagination small{font-size:11px}

/* Counters, timers and prices keep a fixed digit width so they stop jittering. */
#charCount,#dialogueCount,#resultCurrent,#resultDuration,#quotaPercent,.quota-figures{font-variant-numeric:tabular-nums}

/* Icon-only controls keep one 16px optical size and one hover treatment. */
.import-icon,.download-icon{display:grid;place-items:center;color:#5f7a6d}
.import-icon:hover{background:#edf3ef;color:#326e66}
.balance-ring{display:inline-flex;align-items:center;color:#7c9a8b}
.balance-ring .ui-icon{width:16px;height:16px}
.import-icon .ui-icon{width:16px;height:16px}

/* Entrance motion lives in CSS, so dialogs still feel alive if Motion is blocked. */
dialog.dialog[open]{animation:dialogIn .18s var(--ui-ease)}
.filter-popover:popover-open{animation:popoverIn .12s linear}
@keyframes dialogIn{from{opacity:0;transform:translateY(8px) scale(.996)}to{opacity:1;transform:none}}
@keyframes popoverIn{from{opacity:0}to{opacity:1}}

/* ---- Round 2b: buttons with icons, auth card, card grid, mobile rail ---- */
/* Icon + label buttons need one alignment rule; the plain-text buttons are unaffected. */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.btn .ui-icon{flex:none}

/* Sign-in card: one segmented control, jade primary, tighter vertical rhythm. */
.auth-card{padding:30px;border:1px solid #e6ece8;border-radius:18px;box-shadow:0 20px 55px -38px #1d3b2c33}
.auth-card .auth-tools{margin-bottom:12px}
.auth-card h1{font-size:27px;font-weight:650;letter-spacing:-.5px}
.auth-card>p{font-size:13px;color:#7b8781;margin:6px 0 0}
.auth-card .tabs{display:grid;grid-auto-flow:column;gap:4px;padding:4px;background:#f1f5f2;border-radius:999px;margin:22px 0 18px}
.auth-card .tabs .btn{border:0;background:transparent;box-shadow:none;color:#5d6c65;font-size:13px;font-weight:500;min-height:34px;padding:7px 18px;border-radius:999px}
.auth-card .tabs .btn.active{background:#fff;color:#254d43;font-weight:600;box-shadow:0 1px 2px #1d3b2c1a}
.auth-card form{gap:11px}
.auth-card input{min-height:44px;border-color:#e2e9e4;background:#fbfdfb}
.auth-card form button[type=submit]{min-height:44px;margin-top:4px}
.auth-card .form-error:empty{display:none}

/* Voice cards: the repeated solid CTA overwhelmed the grid, so it reads as an outline until hover. */
.voice-card{border-color:#e6ece8}
.voice-card p{color:#5b6862}
.voice-tags{color:#6f7d75}
.voice-actions [data-use]{background:#fff;border:1px solid #cfe0d6;color:#2f6a58;box-shadow:none;font-weight:500}
.voice-actions [data-use]:hover{background:#2f6a58;border-color:#2f6a58;color:#fff}
.voice-actions .filter-icon-action{color:#7b8b81}
.voice-actions .filter-icon-action:hover{background:#eef4ef;color:#326e66}
.library-controls .filters label{color:#6d7b73;font-weight:500}

/* Speaker disclosure chevron follows the same icon set as the rest of the shell. */
.speaker-chevron{display:inline-flex;align-items:center;color:#8a978f;transition:transform .18s var(--ui-ease)}
.speaker-chevron .ui-icon{width:15px;height:15px}

/* ---- Waveform scrubber + generation bars (ported from ElevenLabs UI, MIT) ---- */
:root{--wave-muted:rgba(18,48,41,.30);--wave-played:#2f9d7e;--wave-played-2:#5fe0bd;--wave-head:#0f3a30}
.result-timeline .wave-native{display:none!important}
.wave-host{position:relative;flex:1 1 auto;min-width:70px;height:34px;cursor:pointer;touch-action:none;border-radius:8px}
.wave-host:focus-visible{outline:2px solid #77a99a;outline-offset:4px}
.wave-canvas{display:block;width:100%;height:100%}
.bar-visualizer{display:inline-flex;align-items:center;justify-content:center;gap:3px;width:34px;height:26px;flex:none}
.bar-visualizer i{display:block;width:3px;height:35%;border-radius:2px;background:var(--wave-played);animation:barPulse 1.1s ease-in-out infinite}
.bar-visualizer i:nth-child(2){animation-delay:.14s}
.bar-visualizer i:nth-child(3){animation-delay:.28s}
.bar-visualizer i:nth-child(4){animation-delay:.42s}
.bar-visualizer i:nth-child(5){animation-delay:.56s}
@keyframes barPulse{0%,100%{height:26%}50%{height:92%}}
@media(prefers-reduced-motion:reduce){.bar-visualizer i{animation:none;height:55%}}

/* Theme switch in the toolbar / auth card. */
.toolbar-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.theme-toggle{min-height:32px;padding:6px 11px;border-radius:999px;font-size:12px;gap:6px;background:#fff;border:1px solid #e7e7e9;color:#5d6f67}
.theme-toggle:hover{background:#f2f7f4;color:#326e66;border-color:#d5e4db}
.theme-toggle .ui-icon{width:15px;height:15px}
@media(max-width:900px){.theme-toggle span{display:none}.theme-toggle{padding:6px 8px}}

/* Under 640px the sidebar becomes an icon rail instead of squeezing labels into two lines. */
@media(max-width:640px){
  .studio{grid-template-columns:60px minmax(0,1fr)}
  .brand{justify-content:center;font-size:0;padding:0 0 20px;gap:0}
  .brand .ui-icon{width:23px;height:23px}
  .nav button{justify-content:center;gap:0;padding:13px 0}
  .nav button>span:last-child{display:none}
  .nav button>span:first-child{width:auto}
  .account-footer{padding:12px 0 0}
  .quota-caption,.quota-track,.quota-figures,.account-identity{display:none}
  .account-profile{justify-content:center;border:0;padding-top:10px;gap:0}
  .content{padding:16px}
  .editor-footer{padding:14px}
  /* Dock: two rows so the waveform keeps a usable width next to the controls. */
  .generation-dock{flex-wrap:wrap;gap:10px 12px;padding:12px 14px}
  .generation-dock .result-play{order:1}
  .generation-dock .result-downloads{order:2;margin-left:auto;flex-direction:row;gap:8px;font-size:11px}
  .generation-dock .result-downloads a{padding:5px 9px}
  .generation-dock .result-main{order:3;flex:1 1 100%}
  .generation-dock .generation-note{display:none}
  .wave-host{height:30px}
}

/* ---- Round 4: one type scale (11/12/13/14/16/18/21, weights 400/500/600) ---- */
.brand{font-weight:600}
.nav button{font-weight:400}
.nav button.active{font-weight:600}
.page-head h1,.page-head h2,.dialog>.page-head h2{font-weight:600}
.voice-setting strong{font-weight:500}
.voice-card-title h3,.voice-card h3{font-weight:500}
.dialogue-panel-heading h3{font-size:13px;font-weight:500}
.auth-card h1{font-weight:600}
#resultCurrent,#resultDuration,#dialogueEstimate,#ttsEstimate,.dialogue-editor-footer #dialogueEstimate{font-size:11px}
.subtle,.dialogue-parameters>.subtle{font-size:11px}
.dialogue-parameters .check-label{font-size:12px}

/* ---- Switch: replaces the bare checkbox for 导出字幕 ---- */
.check-label{position:relative;display:flex;align-items:center;gap:9px;font-size:12px;color:#43564c;cursor:pointer;padding-bottom:6px}
.check-label .ui-switch-input{position:absolute;left:0;top:50%;width:34px;height:20px;margin:0;transform:translateY(-50%);opacity:0;cursor:pointer}
.check-label .ui-switch{position:relative;display:inline-block;flex:none;width:34px;height:20px;border-radius:999px;background:#dfe7e2;box-shadow:inset 0 0 0 1px #d2ddd6;transition:background .18s var(--ui-ease),box-shadow .18s var(--ui-ease)}
.check-label .ui-switch::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #16352a26;transition:transform .2s var(--ui-ease)}
.check-label .ui-switch-input:checked + .ui-switch{background:#326e66;box-shadow:inset 0 0 0 1px #2b6159}
.check-label .ui-switch-input:checked + .ui-switch::after{transform:translateX(14px)}
.check-label .ui-switch-input:focus-visible + .ui-switch{outline:2px solid #77a99a;outline-offset:3px}
.check-label .ui-switch-input:disabled + .ui-switch{opacity:.45;cursor:not-allowed}
.check-label:has(.ui-switch-input:checked) .billing-badge{background:#e4f1ea;border-color:#cfe4d8;color:#376a55}
html[data-theme="dark"] .check-label{color:#b3c2bb}
html[data-theme="dark"] .check-label .ui-switch{background:rgba(255,255,255,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)}
html[data-theme="dark"] .check-label .ui-switch::after{background:#e9f1ec}
html[data-theme="dark"] .check-label .ui-switch-input:checked + .ui-switch{background:#4e9d82;box-shadow:inset 0 0 0 1px rgba(143,224,193,.35)}
html[data-theme="dark"] .check-label:has(.ui-switch-input:checked) .billing-badge{background:rgba(111,208,172,.18);border-color:rgba(111,208,172,.3);color:#9fe4c8}

/* Headings never exceed the 600 step. */
h1,h2,h3,h4,h5,h6{font-weight:600}

/* Keep the credit badge next to its label instead of pinning it to the panel edge. */
html .dialogue-parameters .check-label .billing-badge{margin-left:0}
html .check-label .billing-badge{margin-left:0}

/* ---- Sidebar collapse ---- */
.toolbar-left{display:flex;align-items:center;gap:10px;min-width:0}
.toolbar-left #breadcrumb{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-toggle{width:30px;height:30px;min-height:30px;padding:0;display:grid;place-items:center;flex:none;border-radius:8px;background:transparent;border:1px solid transparent;color:#6d7b73}
.sidebar-toggle:hover{background:#eef4ef;color:#326e66;border-color:#dbe9e1}
.sidebar-toggle .ui-icon{width:16px;height:16px}
html[data-sidebar="collapsed"] .studio{grid-template-columns:64px minmax(0,1fr)}
html[data-sidebar="collapsed"] .brand{justify-content:center;gap:0;padding:0 0 20px}
html[data-sidebar="collapsed"] .brand .ui-icon{width:22px;height:22px}
html[data-sidebar="collapsed"] .nav button{justify-content:center;gap:0;padding:12px 0}
html[data-sidebar="collapsed"] .nav button>span:last-child{display:none}
html[data-sidebar="collapsed"] .nav button>span:first-child{width:auto}
html[data-sidebar="collapsed"] .account-identity,
html[data-sidebar="collapsed"] .quota-caption,
html[data-sidebar="collapsed"] .quota-track,
html[data-sidebar="collapsed"] .quota-figures{display:none}
html[data-sidebar="collapsed"] .account-profile{justify-content:center;border:0;padding-top:10px;gap:6px}
html[data-sidebar="collapsed"] .account-footer{padding:12px 0 0}
html[data-theme="dark"] .sidebar-toggle{color:#9fb0a8}
html[data-theme="dark"] .sidebar-toggle:hover{background:rgba(255,255,255,.08);color:#a9e5cc;border-color:rgba(255,255,255,.10)}
@media(max-width:640px){.sidebar-toggle{display:none}}

/* ---- Round 5: press feedback + a real collapse transition ---- */
/* Text buttons press down 1px (no scaling: labels must stay crisp);
   round icon buttons take a small squash, which reads fine on a circle. */
.btn,.filter-trigger,.filter-option,.nav button,.result-downloads a{transition:background-color .16s var(--ui-ease),border-color .16s var(--ui-ease),color .16s var(--ui-ease),box-shadow .16s var(--ui-ease),transform .09s var(--ui-ease)}
.btn:active:not(:disabled){transform:translateY(1px)}
.result-play,.sidebar-toggle,.filter-icon-action,.logout-icon,.import-icon,.download-icon{transition:background-color .16s var(--ui-ease),border-color .16s var(--ui-ease),color .16s var(--ui-ease),box-shadow .16s var(--ui-ease),transform .09s var(--ui-ease)}
.result-play:active,.sidebar-toggle:active,.filter-icon-action:active,.logout-icon:active,.import-icon:active,.download-icon:active{transform:scale(.93)}
.result-play:hover{box-shadow:0 0 0 5px #326e6614}

/* Collapse: the grid column animates while labels fade out, so text is gone
   before the rail gets narrow (no mid-animation clipping). */
.studio{transition:grid-template-columns .22s cubic-bezier(.4,0,.2,1)}
.sidebar{overflow-x:hidden}
.brand-name,.nav button>span:last-child,.account-identity,.quota-caption,.quota-track,.quota-figures{transition:opacity .12s var(--ui-ease),max-width .24s var(--ui-ease),max-height .24s var(--ui-ease)}
.brand-name,.nav button>span:last-child{display:inline-block;max-width:220px;overflow:hidden;white-space:nowrap;vertical-align:middle}
html[data-sidebar="collapsed"] .brand-name,html[data-sidebar="collapsed"] .nav button>span:last-child{max-width:0;opacity:0}
html[data-sidebar="collapsed"] .account-identity{display:block;max-width:0;opacity:0;overflow:hidden}
html[data-sidebar="collapsed"] .quota-caption,html[data-sidebar="collapsed"] .quota-track,html[data-sidebar="collapsed"] .quota-figures{display:block;max-height:0;opacity:0;overflow:hidden;margin:0;padding:0}
html[data-sidebar="collapsed"] .quota-caption{display:flex}


/* The mobile rail hides labels outright (the desktop fade rules above must not re-show them). */
@media(max-width:640px){.nav button>span:last-child,.brand-name{display:none}}

.btn.primary:active:not(:disabled){filter:brightness(.96)}

/* Play/Pause: solid glyphs need a touch more size and a calmer hover halo. */
.result-play .ui-icon{width:20px;height:20px}
.result-play{transition:background-color .16s var(--ui-ease),box-shadow .18s var(--ui-ease),transform .09s var(--ui-ease)}
.result-play:hover{box-shadow:none}
.result-play:focus-visible{outline:2px solid #77a99a;outline-offset:3px}
html[data-theme="dark"] .result-play:hover{box-shadow:none}

/* ---- Editor footer: upload only, one clean row ---- */
.import-label{font-size:12px;line-height:1;color:#5f7a6d;cursor:pointer;user-select:none}
.import-label:hover{color:#326e66;text-decoration:underline;text-underline-offset:3px}
.editor-footer{align-items:center}
.editor-footer-left{gap:7px}
.editor-footer-right{gap:12px}
.editor-count{display:block;text-align:right;margin-right:2px}
.editor-count small{font-size:12px}
/* The dock keeps its soft shadow but no hairline, so the canvas reads as one surface. */
.generation-dock{border-top:0}
html[data-theme="dark"] .generation-dock{border-top:0}
html[data-theme="dark"] .import-label{color:#9fb0a8}
html[data-theme="dark"] .import-label:hover{color:#a9e5cc}

/* ---- Focus + upload control ---- */
/* The writing canvas is large; a 2px ring around it reads as a stray line at the
   bottom edge. The caret is the focus indicator there. */
.script-card textarea:focus-visible,.dialogue-editor textarea:focus-visible{outline:none}
.import-button{display:inline-flex;align-items:center;gap:8px;padding:7px 12px;border:1px solid #e3ebe6;border-radius:9px;background:#fff;color:#4f6b5f;font-size:12px;cursor:pointer;transition:background-color .15s var(--ui-ease),color .15s var(--ui-ease),border-color .15s var(--ui-ease),box-shadow .15s var(--ui-ease)}
.import-button:hover{background:#f3f8f4;border-color:#cfe0d6;color:#326e66}
.import-button .import-label{color:inherit;font-size:12px}
.import-glyph{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex:none}
.import-glyph .ui-icon{width:16px;height:16px}
html[data-theme="dark"] .import-button{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.12);color:#c2d3ca}
html[data-theme="dark"] .import-button:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.18);color:#a9e5cc}

/* The toolbar styles every .btn with a white fill + hairline; the icon-only
   sidebar toggle should stay borderless until hovered. */
.toolbar .sidebar-toggle,.toolbar .btn.sidebar-toggle{background:transparent;border:0;box-shadow:none;color:#5d6f67}
.toolbar .btn.sidebar-toggle:hover{background:#eaf2ec;color:#326e66}
.toolbar .btn.sidebar-toggle:active{transform:scale(.93)}
html[data-theme="dark"] .toolbar .sidebar-toggle,html[data-theme="dark"] .toolbar .btn.sidebar-toggle{background:transparent;border:0;color:#9fb0a8}
html[data-theme="dark"] .toolbar .btn.sidebar-toggle:hover{background:rgba(255,255,255,.08);color:#a9e5cc}

/* ---- Voice library: skeleton while loading, staggered cards on arrival ---- */
.voice-skeleton{position:relative;overflow:hidden;background:#fbfcfb;border-color:#e9efeb;box-shadow:none;pointer-events:none}
.voice-skeleton::after{content:'';position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.85),transparent);animation:skShimmer 1.15s ease-in-out infinite}
.sk-row{display:flex;align-items:center;gap:9px;margin-bottom:15px}
.sk-avatar{width:30px;height:30px;border-radius:50%;background:#e7eee9;flex:none}
.sk-line{display:block;height:9px;border-radius:6px;background:#eaf0ec;margin-bottom:10px}
.sk-tags{margin-top:auto}
@keyframes skShimmer{to{transform:translateX(100%)}}
.voice-grid .voice-card{animation:cardIn .26s var(--ui-ease) both}
@keyframes cardIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
html[data-theme="dark"] .voice-skeleton{background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.07)}
html[data-theme="dark"] .sk-avatar,html[data-theme="dark"] .sk-line{background:rgba(255,255,255,.09)}
html[data-theme="dark"] .voice-skeleton::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.10),transparent)}

/* Infinite-scroll sentinel */
.voice-more{display:flex;align-items:center;justify-content:center;min-height:26px;padding:10px 0 16px;font-size:11px;color:#8a9792}
html[data-theme="dark"] .voice-more{color:#8fa198}

/* ---- Voice avatar: richer fallback so unmapped voices still look designed ---- */
.voice-avatar{font-size:12px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.voice-avatar::after{content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;z-index:2;background:radial-gradient(120% 120% at 26% 16%,rgba(255,255,255,.28),rgba(255,255,255,0) 56%)}
.avatar-initial{font-size:12px;font-weight:600;letter-spacing:.01em;text-shadow:0 1px 2px rgba(0,0,0,.28)}
.voice-avatar.avatar-tone-0{background:radial-gradient(circle at 28% 18%,#b6d6c5,#4b7d66 58%,#22403a)}
.voice-avatar.avatar-tone-1{background:radial-gradient(circle at 28% 18%,#cfc6da,#7f7f9b 58%,#3c4459)}
.voice-avatar.avatar-tone-2{background:radial-gradient(circle at 28% 18%,#e8dcc4,#a89377 58%,#5b5c50)}
.voice-avatar.avatar-tone-3{background:radial-gradient(circle at 28% 18%,#cfe0e5,#719da2 58%,#3a6165)}
.voice-avatar.avatar-tone-4{background:radial-gradient(circle at 28% 18%,#e3cfc7,#a9827e 58%,#634f58)}

/* Orb avatars: the gradient is inline, these rules only add depth. */
.voice-avatar.avatar-orb{background-color:#21403a}
.voice-avatar.avatar-orb::after{content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;z-index:2;background:none}

/* Canvas-painted orbs: the bitmap carries the texture, CSS only frames it. */
.voice-avatar.avatar-orb{background-size:cover;background-position:center;background-color:#16211d;box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)}
.voice-avatar.avatar-orb::after{content:none}

/* Breadcrumb now holds only the section name and sits on the same baseline as the toggle. */
.toolbar-left{gap:8px}
.toolbar-left #breadcrumb{display:inline-flex;align-items:center;height:16px;font-size:13px;line-height:1;color:#4f635a;transform:translateY(1px)}
html[data-theme="dark"] .toolbar-left #breadcrumb{color:#b9c9c1}

/* ---- Voice picker: one-row field, like a settings list ---- */
.voice-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.voice-head .parameter-caption{margin:0}
.voice-recommend{display:inline-flex;align-items:center;gap:5px;padding:0;border:0;background:none;color:#3c6f5f;font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.voice-recommend:hover{color:#27564a}
.voice-recommend .ui-icon{width:13px;height:13px}
.voice-row{display:flex;align-items:center;gap:10px;width:100%;padding:9px 12px;margin-bottom:20px;border:1px solid #e3ebe6;border-radius:12px;background:#fff;cursor:pointer;text-align:left;transition:border-color .15s var(--ui-ease),background-color .15s var(--ui-ease)}
.voice-row:hover{border-color:#cfe0d6;background:#fbfdfb}
.voice-row:focus-visible{outline:2px solid #77a99a;outline-offset:2px}
.voice-row .selected-avatar{float:none;margin:0;display:flex;align-items:center;flex:none}
.voice-row .voice-avatar{width:34px;height:34px}
.voice-row-main{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.voice-row-main strong{font-size:13px;font-weight:500;color:#1f332c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.voice-row-main small{font-size:11px;color:#7d8d85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.voice-row-main small:empty{display:none}
.voice-row-play{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;border:1px solid #e3ebe6;background:#fff;color:#2f6a58;cursor:pointer;transition:background-color .15s var(--ui-ease),border-color .15s var(--ui-ease)}
.voice-row-play:hover{background:#eef5f1;border-color:#cfe0d6}
.voice-row-play .ui-icon{width:14px;height:14px}
.voice-row-arrow{display:inline-flex;color:#9aa8a0;flex:none}
html[data-theme="dark"] .voice-recommend{color:#8fd6bb}
html[data-theme="dark"] .voice-row{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.10)}
html[data-theme="dark"] .voice-row:hover{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.16)}
html[data-theme="dark"] .voice-row-main strong{color:#e9f1ec}
html[data-theme="dark"] .voice-row-main small{color:#93a49c}
html[data-theme="dark"] .voice-row-play{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:#9fe4c8}
html[data-theme="dark"] .voice-row-arrow{color:#7d8f86}

/* ---- History cards ---- */
.history-list{display:grid;gap:14px}
.history-card{background:#fff;border:1px solid #e6ece8;border-radius:16px;padding:16px 16px 12px;transition:border-color .16s var(--ui-ease),box-shadow .16s var(--ui-ease)}
.history-card:hover{border-color:#cfe0d6;box-shadow:0 6px 22px -18px #1d3b2c40}
.history-text{margin:0 0 12px;font-size:13.5px;line-height:1.75;color:#22312c;display:-webkit-box;-webkit-line-clamp:7;-webkit-box-orient:vertical;overflow:hidden}
.history-foot{display:flex;align-items:center;gap:7px;min-width:0}
.history-orb{width:16px;height:16px;flex:none;border-radius:50%;background-size:cover;background-position:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
.history-voice{font-size:11px;color:#7d8d85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.history-sep{font-size:11px;color:#b3bdb7}
.history-time{font-size:11px;color:#9aa8a0;white-space:nowrap}
.history-actions{display:flex;align-items:center;gap:2px;margin-left:auto;flex:none}
.history-act{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#5d6f67;cursor:pointer;text-decoration:none;transition:background-color .15s var(--ui-ease),color .15s var(--ui-ease)}
.history-act:hover{background:#eef4ef;color:#2f6a58}
.history-act .ui-icon{width:15px;height:15px}
.history-state{font-size:11px;color:#9aa8a0}
.history-card audio{display:none}
/* settings panel keeps the compact variant */
#latestTask .history-card{border-radius:14px;padding:13px 13px 10px}
#latestTask .history-text{font-size:13px;-webkit-line-clamp:6}
html[data-theme="dark"] .history-card{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.09)}
html[data-theme="dark"] .history-card:hover{border-color:rgba(255,255,255,.16);box-shadow:none}
html[data-theme="dark"] .history-text{color:#dfeae4}
html[data-theme="dark"] .history-voice{color:#93a49c}
html[data-theme="dark"] .history-time,html[data-theme="dark"] .history-state{color:#7f9188}
html[data-theme="dark"] .history-act{color:#9fb0a8}
html[data-theme="dark"] .history-act:hover{background:rgba(255,255,255,.08);color:#a9e5cc}

/* ---- Settings tabs: animated underline + panel fade ---- */
.settings-tabs{position:relative}
.settings-tabs button{position:relative;transition:color .18s var(--ui-ease)}
.settings-tabs button::after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:2px;background:#518672;transform:scaleX(0);transform-origin:right;transition:transform .24s var(--ui-ease)}
.settings-tabs button.active::after{transform:scaleX(1);transform-origin:left}
[data-settings-panel]{animation:settingsPanelIn .2s var(--ui-ease)}
@keyframes settingsPanelIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
html[data-theme="dark"] .settings-tabs button::after{background:#7fd3b4}

/* ---- Range: thumb always centred on the track ---- */
input[type=range].snap-speed,#dialogueDelay{height:18px;min-height:18px;padding:0;border:0;border-radius:0;background:none;background-image:linear-gradient(to right,#326e66 var(--range-fill,50%),#e6ece8 var(--range-fill,50%));background-size:100% 5px;background-position:center;background-repeat:no-repeat;margin:12px 0}
input[type=range].snap-speed::-webkit-slider-thumb,#dialogueDelay::-webkit-slider-thumb{margin:0}
html[data-theme="dark"] input[type=range].snap-speed,html[data-theme="dark"] #dialogueDelay{background-image:linear-gradient(to right,#4e9d82 var(--range-fill,50%),rgba(255,255,255,.12) var(--range-fill,50%))}
.dialogue-parameters .setting-field #dialogueDelay{height:18px;min-height:18px;background-size:100% 5px;background-position:center;background-repeat:no-repeat}

/* History page reads better at a column width */
.history-list{max-width:940px}

/* ---- Advanced TTS settings ---- */
.tts-advanced{display:grid;gap:14px;margin:18px 0 20px;padding-top:16px;border-top:1px solid var(--line2)}
.tts-advanced .setting-field{gap:7px}
.tts-advanced .setting-field>span{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#43564c}
.tts-advanced .setting-field>span b{font-size:11px;font-weight:500;color:#7d8d85;font-variant-numeric:tabular-nums}
.tts-advanced select{height:34px;padding:6px 10px;font-size:12px;border-radius:9px;background:#fbfdfb;border-color:#e3ebe6}
.tts-advanced input[type=range]{margin:4px 0}
html[data-theme="dark"] .tts-advanced{border-top-color:rgba(255,255,255,.08)}
html[data-theme="dark"] .tts-advanced .setting-field>span{color:#b3c2bb}
html[data-theme="dark"] .tts-advanced .setting-field>span b{color:#93a49c}
html[data-theme="dark"] .tts-advanced select{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.10);color:#e6f0ea}

/* Compact the advanced block: paired selects, tighter sliders */
.tts-advanced{gap:12px}
.tts-advanced .setting-field:nth-last-child(-n+2){grid-column:span 1}
.tts-advanced{grid-template-columns:1fr 1fr}
.tts-advanced .setting-field:first-child,.tts-advanced .setting-field:nth-child(2),.tts-advanced .setting-field:nth-child(3),.tts-advanced .setting-field:nth-child(4){grid-column:1 / -1}

/* ---- Tooltip ---- */
.ui-tooltip{position:fixed;z-index:9999;pointer-events:none;max-width:280px;padding:7px 10px;border-radius:9px;background:#1c2a25;color:#f2f8f5;font-family:var(--ui-font);font-size:12px;font-weight:400;line-height:1.45;letter-spacing:.01em;text-align:center;white-space:normal;box-shadow:0 10px 26px -14px rgba(8,22,17,.7),0 2px 6px -4px rgba(8,22,17,.45);opacity:0;transform:translateY(3px) scale(.97);transition:opacity .12s linear,transform .16s var(--ui-ease)}
.ui-tooltip[popover]{margin:0;border:0;inset:auto;overflow:visible}
.ui-tooltip[data-show]{opacity:1;transform:none}
.ui-tooltip::after{content:'';position:absolute;left:50%;bottom:-3px;width:7px;height:7px;margin-left:-3.5px;background:inherit;transform:rotate(45deg);border-radius:1px}
.ui-tooltip[data-placement="bottom"]::after{bottom:auto;top:-3px}
html[data-theme="dark"] .ui-tooltip{background:#e8f1ec;color:#15211d;box-shadow:0 12px 30px -16px rgba(0,0,0,.8),0 2px 6px -4px rgba(0,0,0,.6)}
@media(prefers-reduced-motion:reduce){.ui-tooltip{transition:none}}

/* ---- Range: custom-drawn track + thumb (exact alignment in every engine) ---- */
.range-host{position:relative;display:flex;align-items:center;height:18px;margin:12px 0}
.range-track{position:absolute;left:0;right:0;height:5px;border-radius:99px;background:#e6ece8;overflow:hidden}
.range-track i{display:block;height:100%;border-radius:inherit;background:#326e66;transition:width .06s linear}
.range-thumb{position:absolute;top:50%;width:17px;height:17px;margin-left:-8.5px;transform:translateY(-50%);border-radius:50%;background:#fff;border:2px solid #326e66;box-shadow:0 1px 4px #244a3726;pointer-events:none;transition:box-shadow .15s var(--ui-ease),transform .12s var(--ui-ease);z-index:1}
.range-host:hover .range-thumb{box-shadow:0 0 0 5px #326e6612}
.range-host:active .range-thumb{box-shadow:0 0 0 7px #326e6615}
.range-host:focus-within .range-thumb{box-shadow:0 0 0 3px #77a99a66}
.range-host input[type=range]{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:default;z-index:2;appearance:none}
.range-host input[type=range]::-webkit-slider-thumb{appearance:none;width:17px;height:17px;border:0;cursor:default}
.range-host input[type=range]::-moz-range-thumb{width:17px;height:17px;border:0;cursor:default}
.range-host{cursor:default;user-select:none}
.range-host input[type=range]:focus-visible{outline:none}
html[data-theme="dark"] .range-track{background:rgba(255,255,255,.12)}
html[data-theme="dark"] .range-track i{background:#4e9d82}
html[data-theme="dark"] .range-thumb{background:#0f1615;border-color:#7fd3b4;box-shadow:0 1px 4px rgba(0,0,0,.5)}
html[data-theme="dark"] .range-host:hover .range-thumb{box-shadow:0 0 0 5px rgba(143,224,193,.16)}

/* ---- Model cards ---- */
.model-field{gap:8px}
.model-list{display:grid;gap:8px}
.model-card{display:grid;gap:6px;width:100%;padding:11px 12px;border:1px solid #e3ebe6;border-radius:12px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s var(--ui-ease),background-color .15s var(--ui-ease)}
.model-card:hover{border-color:#cfe0d6;background:#fbfdfb}
.model-card.is-active{border-color:#326e66;background:#f4faf7;box-shadow:inset 0 0 0 1px #326e6622}
.model-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.model-card-head b{font-size:13px;font-weight:600;color:#1f332c}
.model-card.is-active .model-card-head .ui-icon{color:#326e66}
.model-desc{font-size:11.5px;line-height:1.6;color:#7d8d85;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.model-chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px}
.model-chip{padding:2px 8px;border-radius:999px;background:#f1f4f1;font-size:10.5px;color:#5d6f67;white-space:nowrap}
.model-more{justify-self:start;margin-top:2px;padding:0;border:0;background:none;color:#3c6f5f;font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.model-more:hover{color:#27564a}
html[data-theme="dark"] .model-card{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.09)}
html[data-theme="dark"] .model-card:hover{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.16)}
html[data-theme="dark"] .model-card.is-active{background:rgba(111,208,172,.12);border-color:rgba(111,208,172,.45)}
html[data-theme="dark"] .model-card-head b{color:#e9f1ec}
html[data-theme="dark"] .model-desc{color:#93a49c}
html[data-theme="dark"] .model-chip{background:rgba(255,255,255,.08);color:#b3c2bb}
html[data-theme="dark"] .model-more{color:#8fd6bb}

/* the settings panel styles every <b> as a small value label; model titles need to win */
.tts-parameters .model-card .model-card-head b{font-size:13px;font-weight:600;color:#1f332c}
html[data-theme="dark"] .tts-parameters .model-card .model-card-head b{color:#e9f1ec}

/* ---- Settings panel: compact stack ---- */
.settings-stack{display:grid;gap:16px;margin-top:18px}
.settings-stack .setting-field{gap:6px}
.settings-stack .setting-field>span{font-size:12px;color:#43564c;font-weight:500}
.slider-field .slider-captions{display:flex;justify-content:space-between;font-size:10.5px;color:#9aa8a0;margin-top:-2px}
.slider-field .slider-captions small{font-weight:400}
.model-field{position:relative}
.model-row{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;border:1px solid #e3ebe6;border-radius:12px;background:#fff;cursor:pointer;text-align:left;transition:border-color .15s var(--ui-ease),background-color .15s var(--ui-ease)}
.model-row:hover{border-color:#cfe0d6;background:#fbfdfb}
.model-row.is-open{border-color:#326e66;background:#f6fbf8}
.model-badge{display:inline-grid;place-items:center;min-width:26px;height:20px;padding:0 6px;border-radius:999px;border:1px solid #d7e4db;background:#f2f7f3;font-size:10px;color:#4a6b5c;letter-spacing:.02em;flex:none}
.model-badge:empty{display:none}
.model-row-name{flex:1;min-width:0;font-size:12.5px;color:#1f332c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.model-row-arrow{display:inline-flex;color:#95a39b;transition:transform .18s var(--ui-ease)}
.model-row.is-open .model-row-arrow{transform:rotate(180deg)}
.model-menu{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:40;padding:5px;border:1px solid #e3ebe6;border-radius:12px;background:#fff;box-shadow:0 18px 40px -22px rgba(20,45,35,.45);display:grid;gap:2px;max-height:280px;overflow:auto}
.model-menu[hidden]{display:none}
.model-item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 9px;border:0;border-radius:8px;background:transparent;color:#31413a;font-size:12.5px;text-align:left;cursor:pointer}
.model-item:hover{background:#f1f6f2}
.model-item.is-active{background:#eaf3ee;color:#245846}
.model-item-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.model-load{justify-content:center;color:#3c6f5f;font-size:12px}
.settings-reset{display:flex;justify-content:flex-end}
.settings-reset button{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:none;color:#6b7b73;font-size:12px;cursor:pointer}
.settings-reset button:hover{color:#326e66}
.settings-reset .ui-icon{width:14px;height:14px}
html[data-theme="dark"] .settings-stack .setting-field>span{color:#b3c2bb}
html[data-theme="dark"] .model-row{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.10)}
html[data-theme="dark"] .model-row:hover{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .model-row.is-open{border-color:rgba(111,208,172,.5);background:rgba(111,208,172,.10)}
html[data-theme="dark"] .model-badge{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.12);color:#b3c2bb}
html[data-theme="dark"] .model-row-name{color:#e6f0ea}
html[data-theme="dark"] .model-menu{background:#141d1a;border-color:rgba(255,255,255,.10);box-shadow:0 24px 60px -30px #000}
html[data-theme="dark"] .model-item{color:#c8d8d0}
html[data-theme="dark"] .model-item:hover{background:rgba(255,255,255,.06)}
html[data-theme="dark"] .model-item.is-active{background:rgba(111,208,172,.14);color:#a9e5cc}
html[data-theme="dark"] .settings-reset button{color:#93a49c}

/* tighten the settings stack */
.settings-stack{gap:14px}
.slider-field{gap:3px}
.slider-field .slider-captions{margin-top:2px;margin-bottom:2px}
.range-host{margin:6px 0}
.settings-stack .setting-field>span{line-height:1.4}

/* ---- Model drawer (slides over the settings panel) ---- */
.tts-parameters{position:relative}
.tts-parameters.drawer-open{overflow:hidden}
.model-drawer{position:absolute;inset:0;z-index:60;display:flex;flex-direction:column;background:#fff;border-radius:0;transform:translateX(-100%);opacity:0;transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .18s linear;will-change:transform}
.model-drawer[hidden]{display:none}
.model-drawer.is-open{transform:none;opacity:1}
.model-drawer-head{flex:none;display:flex;align-items:center;gap:10px;padding:16px 18px 10px}
.model-drawer-head h3{margin:0;font-size:15px;font-weight:600;color:#1f332c}
.model-back{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;background:transparent;color:#3c5148;cursor:pointer}
.model-back:hover{background:#eef4ef}
.model-drawer-body{flex:1;min-height:0;overflow-y:auto;padding:6px 18px 22px;display:grid;gap:10px;align-content:start}
.model-card{display:grid;gap:6px;width:100%;padding:12px 13px;border:1px solid #e3ebe6;border-radius:14px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s var(--ui-ease),background-color .15s var(--ui-ease)}
.model-card:hover{border-color:#cfe0d6;background:#fbfdfb}
.model-card.is-active{border-color:#1f332c;box-shadow:inset 0 0 0 1px #1f332c}
.model-card-head{display:flex;align-items:center;gap:8px}
.model-card-head b{font-size:13.5px;font-weight:600;color:#1f332c}
.model-tag{padding:2px 7px;border-radius:999px;background:#f1f2f0;color:#6b6f73;font-size:10.5px;white-space:nowrap}
.model-tag[hidden]{display:none}
.model-check{margin-left:auto;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#1f332c;color:#fff}
.model-check .ui-icon{width:12px;height:12px}
.model-desc{font-size:12px;line-height:1.65;color:#7d8d85;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.model-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.model-chip{padding:3px 9px;border-radius:999px;background:#f1f2f0;font-size:11px;color:#4f5a60;white-space:nowrap}
.model-load{justify-self:center;margin-top:4px;padding:8px 0;border:0;background:none;color:#3c6f5f;font-size:12px;cursor:pointer}
html[data-theme="dark"] .model-drawer{background:#0f1715}
html[data-theme="dark"] .model-drawer-head h3{color:#e9f1ec}
html[data-theme="dark"] .model-back{color:#b3c2bb}
html[data-theme="dark"] .model-back:hover{background:rgba(255,255,255,.08)}
html[data-theme="dark"] .model-card{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.09)}
html[data-theme="dark"] .model-card:hover{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .model-card.is-active{border-color:#8fd6bb;box-shadow:inset 0 0 0 1px #8fd6bb}
html[data-theme="dark"] .model-card-head b{color:#e9f1ec}
html[data-theme="dark"] .model-tag{background:rgba(255,255,255,.08);color:#b3c2bb}
html[data-theme="dark"] .model-desc{color:#93a49c}
html[data-theme="dark"] .model-chip{background:rgba(255,255,255,.08);color:#b9c9c1}
html[data-theme="dark"] .model-check{background:#8fd6bb;color:#0f1715}

.model-drawer .model-card-head{justify-content:flex-start}
.model-drawer .model-card-head b{flex:none}

/* Slider value bubble (only while dragging) */
.range-bubble{position:absolute;bottom:calc(100% + 4px);transform:translateX(-50%);padding:4px 8px;border-radius:7px;background:#1c2a25;color:#fff;font-family:var(--ui-font);font-size:11px;font-weight:500;line-height:1.1;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .12s linear;z-index:3;font-variant-numeric:tabular-nums}
.range-bubble[data-show]{opacity:1}
html[data-theme="dark"] .range-bubble{background:#e8f1ec;color:#15211d}

/* ---- tighter settings stack ---- */
.settings-stack{gap:11px;margin-top:14px}
.slider-field{gap:2px}
.slider-field .slider-captions{margin:0 0 1px}
.range-host{margin:4px 0}
.settings-stack .check-label{padding-bottom:2px}
.settings-reset{margin-top:-2px}

/* ---- smoother entrances ---- */
dialog.dialog[open]{animation:dialogIn .24s cubic-bezier(.22,1,.36,1)}
@keyframes dialogIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
dialog.dialog::backdrop{animation:backdropIn .2s ease-out}
@keyframes backdropIn{from{opacity:0}to{opacity:1}}
.model-drawer{transition:transform .26s cubic-bezier(.22,1,.36,1),opacity .2s ease-out;box-shadow:22px 0 40px -34px rgba(10,25,20,.6)}
.model-drawer-body>*{animation:drawerCardIn .28s cubic-bezier(.22,1,.36,1) both}
.model-drawer-body>*:nth-child(2){animation-delay:.02s}
.model-drawer-body>*:nth-child(3){animation-delay:.04s}
.model-drawer-body>*:nth-child(4){animation-delay:.06s}
.model-drawer-body>*:nth-child(5){animation-delay:.08s}
@keyframes drawerCardIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
[data-tooltip]{cursor:help}

/* the panel field rule was overriding the slider gap */
.settings-stack .slider-field{gap:2px}
.settings-stack .slider-field>span{line-height:1.3}
.range-host{margin:2px 0 0}

/* ---- compact enough to fit without scrolling ---- */
.label-text{display:inline-block;width:max-content;cursor:help}
.settings-stack{gap:9px;margin-top:12px}
.settings-stack .setting-field{gap:4px}
.settings-stack .slider-field{gap:1px}
.settings-stack .setting-field>span{font-size:12px;line-height:1.25}
.slider-field .slider-captions{font-size:10px;margin:0}
.range-host{margin:2px 0 0;height:16px}
.range-track{height:4px}
.range-thumb{width:15px;height:15px;margin-left:-7.5px;border-width:2px}
.settings-stack select{height:30px;padding:4px 9px;font-size:12px;border-radius:8px}
.model-row{padding:7px 10px}
.voice-row{padding:7px 10px;margin-bottom:10px}
.voice-row .voice-avatar{width:30px;height:30px}
.settings-stack .check-label{padding-bottom:0;font-size:12px}
.switch,.ui-switch{transform:scale(.92);transform-origin:left center}
.settings-reset{margin-top:0}
.settings-reset button{font-size:11.5px}
.sample-note{display:none}

/* ---- fit the whole panel without scrolling ---- */
.settings-stack{gap:8px;margin-top:10px}
.settings-stack .setting-field{gap:2px}
.slider-field .slider-captions{font-size:9.5px;line-height:1.15;margin:0}
.settings-stack .slider-field>span{line-height:1.15}
.range-host{height:14px;margin:1px 0 0}
.settings-stack select{height:32px;min-height:32px;padding:0 10px;font-size:12px;line-height:30px}
.model-field{gap:3px}
.model-row{padding:6px 10px}
.model-row-name{font-size:12px}
.voice-row{padding:6px 10px;margin-bottom:8px}
.voice-head{margin-bottom:8px}
.settings-stack .check-label{min-height:24px;padding-bottom:0;font-size:12px;gap:8px}
.settings-stack .check-label .ui-switch{width:30px;height:18px}
.settings-stack .check-label .ui-switch::after{width:14px;height:14px;transform:translateX(0)}
.settings-stack .check-label .ui-switch-input:checked + .ui-switch::after{transform:translateX(12px)}
.settings-reset button{font-size:11.5px}
.settings-stack .subtle{display:none}

/* studio.css adds 24px bottom padding to every field and 16px to check rows */
.tts-parameters .settings-stack .setting-field{padding-bottom:0}
.tts-parameters .settings-stack .check-label{padding-top:0}
.tts-parameters .settings-stack .model-field{padding-bottom:0}

/* relax again now that the panel fits */
.settings-stack{gap:12px;margin-top:12px}
.range-host{height:16px;margin:3px 0 0}
.slider-field .slider-captions{font-size:10px;line-height:1.3}
.settings-stack .check-label{min-height:28px}
.settings-stack .subtle{display:block;font-size:10.5px;line-height:1.5;margin:2px 0 0}
.settings-stack .check-label .ui-switch{width:32px;height:19px}
.settings-stack .check-label .ui-switch::after{width:15px;height:15px}
.settings-stack .check-label .ui-switch-input:checked + .ui-switch::after{transform:translateX(13px)}

/* ---- restore the visual size that looked better, keep the fit ---- */
.settings-stack{gap:11px;margin-top:12px}
.settings-stack .setting-field{gap:5px}
.settings-stack .slider-field{gap:3px}
.settings-stack .setting-field>span{font-size:12.5px;line-height:1.35}
.slider-field .slider-captions{font-size:10.5px;line-height:1.35}
.range-host{height:18px;margin:5px 0 0}
.range-track{height:5px}
.range-thumb{width:17px;height:17px;margin-left:-8.5px;border-width:2px}
.settings-stack select{height:34px;min-height:34px;padding:0 11px;font-size:12.5px;border-radius:10px;line-height:32px}
.model-row{padding:8px 11px}
.model-row-name{font-size:12.5px}
.voice-row{padding:9px 12px;margin-bottom:10px}
.voice-row .voice-avatar{width:34px;height:34px}
.voice-head{margin-bottom:9px}
.settings-stack .check-label{min-height:32px;font-size:12.5px;gap:9px}
.settings-stack .check-label .ui-switch{width:34px;height:20px}
.settings-stack .check-label .ui-switch::after{width:16px;height:16px}
.settings-stack .check-label .ui-switch-input:checked + .ui-switch::after{transform:translateX(14px)}
.settings-stack .subtle{font-size:10.5px;margin-top:1px}

/* reclaim the last few pixels from spacing, not from control sizes */
.settings-stack{gap:9px;margin-top:10px}
.range-host{margin:3px 0 0}
.voice-head{margin-bottom:6px}
.model-row{padding:7px 11px}
.settings-stack .check-label{min-height:30px}
.settings-stack .subtle{display:none}
.settings-stack .slider-field{gap:2px}
.settings-reset{margin-top:-2px}

/* ---- Chinese subtitle row ---- */
.subtitle-zh{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:28px;margin-top:2px}
.subtitle-zh .label-text{font-size:12.5px;color:#43564c}
.subtitle-zh-actions{display:inline-flex;gap:6px;flex:none}
.subtle-btn{min-height:28px;padding:0 10px;font-size:11.5px;border-radius:8px}
html[data-theme="dark"] .subtitle-zh .label-text{color:#b3c2bb}

/* reclaim room for the new row */
.settings-stack{gap:8px}
.range-host{margin:2px 0 0}
.settings-stack .check-label{min-height:28px}
.subtitle-zh{min-height:26px}
.settings-reset{margin-top:-4px}

.settings-stack{gap:7px}

/* ---- silence trim row ---- */
.trim-row{display:flex;align-items:center;gap:8px;min-height:30px}
.trim-row .label-text{font-size:12.5px;color:#43564c;white-space:nowrap}
.trim-row select{height:30px;min-height:30px;flex:1;padding:0 8px;font-size:12px;border-radius:8px;background:#fbfdfb}
.trim-gap{display:inline-flex;align-items:center;gap:3px;flex:none}
.trim-gap[hidden]{display:none}
.trim-gap input{width:52px;height:30px;padding:0 6px;font-size:12px;border-radius:8px;text-align:right}
.trim-gap small{font-size:10.5px;color:#8c9a93}
html[data-theme="dark"] .trim-row .label-text{color:#b3c2bb}
html[data-theme="dark"] .trim-row select{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.10);color:#e6f0ea}
html[data-theme="dark"] .trim-gap input{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.10);color:#e6f0ea}

/* make room for the trim row */
.settings-stack{gap:5px;margin-top:8px}
.range-host{margin:1px 0 0}
.settings-stack .setting-field>span{line-height:1.25}
.voice-head{margin-bottom:4px}
.voice-row{margin-bottom:8px}
.settings-stack .check-label{min-height:26px}
.trim-row{min-height:27px}
.settings-reset{margin-top:-6px}

/* counter turns red past the model limit */
.editor-count small.is-over{color:#c2452d;font-weight:500}
html[data-theme="dark"] .editor-count small.is-over{color:#ff8f70}

/* hint state: informational amber, hard block only past 200k */
.editor-count small.is-hint{color:#a8761f}
html[data-theme="dark"] .editor-count small.is-hint{color:#e2b466}

.count-help{display:inline-grid;place-items:center;width:14px;height:14px;margin-left:5px;border-radius:50%;border:1px solid #c3d0c8;color:#7d8d85;font-size:9.5px;line-height:1;cursor:help;vertical-align:1px}
.count-help:hover{border-color:#326e66;color:#326e66}
html[data-theme="dark"] .count-help{border-color:rgba(255,255,255,.2);color:#93a49c}

.settings-stack{gap:4px}
#translateLangField{margin-top:-2px}

.settings-stack{gap:3px}
.check-label#translateSubs,.settings-stack .check-label{min-height:25px}

/* [hidden] must win over the field display rules */
.settings-stack .setting-field[hidden],.settings-stack [hidden]{display:none !important}

/* ---- Auth / login screen ---- */
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:40px 24px;background:radial-gradient(1200px 600px at 20% 0%,#eef6f1 0%,#f7faf8 45%,#ffffff 100%)}
.auth-shell{display:grid;grid-template-columns:1fr 400px;gap:56px;align-items:center;width:100%;max-width:1040px}
.auth-aside{max-width:460px}
.auth-brand{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:600;color:#1f332c;letter-spacing:.01em}
.auth-mark{width:22px;height:22px;border-radius:7px;background:linear-gradient(140deg,#4f9d80,#2b6a5c)}
.auth-headline{margin:18px 0 10px;font-size:30px;line-height:1.28;font-weight:600;color:#17271f;letter-spacing:-.01em}
.auth-lede{margin:0 0 18px;font-size:13.5px;line-height:1.7;color:#6d7d75;max-width:420px}
.auth-points{list-style:none;margin:0 0 24px;padding:0;display:grid;gap:9px}
.auth-points li{position:relative;padding-left:20px;font-size:13px;color:#41544b;line-height:1.5}
.auth-points li::before{content:'';position:absolute;left:2px;top:7px;width:6px;height:6px;border-radius:50%;background:#3f8a71}
.auth-gift{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:14px;background:linear-gradient(120deg,#eaf6f0,#f4fbf7);border:1px solid #d6e9df}
.auth-gift-badge{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#fff;font-size:17px;box-shadow:0 2px 8px -4px #2c5c4a55}
.auth-gift b{display:block;font-size:13.5px;font-weight:600;color:#20503f}
.auth-gift small{display:block;margin-top:2px;font-size:11.5px;color:#6d8479}
.auth-card{width:100%;padding:26px 24px 24px}
.auth-card h1{font-size:19px;margin:6px 0 4px}
.auth-card .tabs{margin:16px 0 14px}
.auth-card form{display:grid;gap:10px}
.auth-code{gap:8px}
.auth-code input{flex:1}
.auth-code .btn{white-space:nowrap}
.auth-gift-line{margin:2px 0 0;font-size:11.5px;color:#3f8a71;text-align:center}
.auth-tools{display:flex;justify-content:flex-end}
@media(max-width:880px){
  .auth-shell{grid-template-columns:1fr;gap:28px;max-width:420px}
  .auth-aside{display:none}
  .auth-wrap{padding:28px 18px}
}
html[data-theme="dark"] .auth-wrap{background:radial-gradient(1200px 600px at 20% 0%,#13201b 0%,#0f1715 45%,#0d1412 100%)}
html[data-theme="dark"] .auth-brand,html[data-theme="dark"] .auth-headline{color:#e9f1ec}
html[data-theme="dark"] .auth-lede,html[data-theme="dark"] .auth-points li{color:#9fb0a8}
html[data-theme="dark"] .auth-gift{background:rgba(111,208,172,.08);border-color:rgba(111,208,172,.22)}
html[data-theme="dark"] .auth-gift b{color:#a9e5cc}
html[data-theme="dark"] .auth-gift small{color:#8fa49b}
html[data-theme="dark"] .auth-gift-badge{background:rgba(255,255,255,.08)}

/* ---- split auth screen ---- */
.auth-split{display:grid;grid-template-columns:minmax(380px,46%) 1fr;min-height:100vh;background:#fff}
.auth-visual{position:relative;overflow:hidden;background:radial-gradient(120% 90% at 15% 0%,#16211d 0%,#0b1110 55%,#080c0b 100%);color:#eaf1ed;display:flex;flex-direction:column;padding:26px 30px 30px}
.auth-orbs{position:absolute;inset:0;width:100%;height:100%;opacity:.92}
.auth-top{position:relative;z-index:2;display:flex;align-items:center;gap:9px;font-size:13px;font-weight:600;letter-spacing:.02em}
.auth-mark{width:20px;height:20px;border-radius:6px;background:linear-gradient(140deg,#5fbf9a,#2b6a5c)}
.auth-visual-label{position:relative;z-index:2;margin:auto 0 0;text-align:center;font-size:12px;color:rgba(234,241,237,.72);letter-spacing:.04em}
.auth-visual-copy{position:relative;z-index:2;margin-top:auto;padding-top:26px}
.auth-visual-copy h1{margin:0 0 10px;font-size:40px;line-height:1.2;font-weight:600;letter-spacing:-.01em}
.auth-visual-copy p{margin:0 0 14px;font-size:12.5px;color:rgba(234,241,237,.62)}
.auth-visual-copy small{font-size:10.5px;color:rgba(234,241,237,.4)}
.auth-form-side{display:grid;place-items:center;background:#fff;padding:40px 32px}
.auth-panel{width:100%;max-width:372px;opacity:0;transform:translateY(10px)}
.auth-panel.is-in{animation:authPanelIn .34s cubic-bezier(.22,1,.36,1) forwards}
@keyframes authPanelIn{to{opacity:1;transform:none}}
.auth-panel h2{margin:0 0 6px;font-size:26px;font-weight:600;color:#16211d;letter-spacing:-.01em}
.auth-sub{margin:0 0 18px;font-size:12.5px;color:#7b8a82}
.auth-field{display:grid;gap:6px;margin-bottom:12px}
.auth-field>span:first-child{font-size:12px;color:#4d5f56;display:flex;align-items:baseline;gap:6px}
.auth-field>span small{font-size:10.5px;color:#9aa8a0}
.auth-field input{height:40px;width:100%;padding:0 12px;border:1px solid #e1e8e4;border-radius:10px;background:#fcfdfc;font-size:13px;color:#16211d}
.auth-field input:focus{border-color:#326e66;outline:none;background:#fff}
.auth-pw,.auth-code{position:relative;display:flex;gap:8px}
.auth-pw input{padding-right:38px}
.auth-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:#8c9a93;cursor:pointer}
.auth-eye:hover{background:#f1f4f1;color:#326e66}
.auth-code input{flex:1}
.auth-code .btn{height:40px;white-space:nowrap;border-radius:10px}
.auth-submit{width:100%;height:42px;margin-top:6px;border-radius:10px}
.auth-gift-line{margin:8px 0 0;font-size:11.5px;color:#3f8a71;text-align:center}
.auth-points{display:flex;flex-wrap:wrap;gap:6px;margin:20px 0 0;padding-top:16px;border-top:1px solid #eef2ef}
.auth-points span{padding:3px 8px;border-radius:999px;background:#f4f7f5;font-size:10.5px;color:#5d6f67}
.auth-switch{margin:18px 0 0;font-size:12px;color:#7b8a82;text-align:center}
.auth-switch button{padding:0;border:0;background:none;color:#2f6d5c;font-size:12px;font-weight:500;cursor:pointer}
.auth-switch button:hover{text-decoration:underline;text-underline-offset:3px}
.auth-tools{display:flex;justify-content:flex-end;margin-bottom:6px}
@media(max-width:880px){
  .auth-split{grid-template-columns:1fr}
  .auth-visual{min-height:220px;padding:20px}
  .auth-visual-copy h1{font-size:26px}
  .auth-visual-label{display:none}
  .auth-form-side{padding:26px 20px 40px}
}
html[data-theme="dark"] .auth-split{background:#0d1412}
html[data-theme="dark"] .auth-form-side{background:#0d1412}
html[data-theme="dark"] .auth-panel h2{color:#e9f1ec}
html[data-theme="dark"] .auth-sub,html[data-theme="dark"] .auth-field>span:first-child{color:#9fb0a8}
html[data-theme="dark"] .auth-field input{background:#131c18;border-color:rgba(255,255,255,.10);color:#e6f0ea}
html[data-theme="dark"] .auth-points span{background:rgba(255,255,255,.06);color:#b3c2bb}
html[data-theme="dark"] .auth-points{border-top-color:rgba(255,255,255,.08)}
html[data-theme="dark"] .auth-switch{color:#93a49c}
html[data-theme="dark"] .auth-switch button{color:#8fd6bb}

/* reverted light auth layout: points list inside the brand column */
.auth-points-list{list-style:none;margin:0 0 22px;padding:0;display:grid;gap:8px}
.auth-points-list li{position:relative;padding-left:18px;font-size:12.5px;line-height:1.5;color:#41544b}
.auth-points-list li::before{content:'';position:absolute;left:2px;top:6px;width:5px;height:5px;border-radius:50%;background:#3f8a71}
.auth-card form{display:grid;gap:11px}
.auth-card .tabs{margin:14px 0 12px}
.auth-field{display:grid;gap:5px}
.auth-field>span:first-child{font-size:12px;color:#4d5f56;display:flex;align-items:baseline;gap:6px}
.auth-field>span small{font-size:10.5px;color:#9aa8a0}
.auth-field input{height:38px;width:100%;padding:0 12px;border:1px solid #e1e8e4;border-radius:10px;background:#fcfdfc;font-size:13px;color:#16211d}
.auth-field input:focus{border-color:#326e66;outline:none;background:#fff}
.auth-pw,.auth-code{position:relative;display:flex;gap:8px}
.auth-pw input{padding-right:38px}
.auth-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:26px;height:26px;border:0;border-radius:7px;background:transparent;color:#8c9a93;cursor:pointer}
.auth-eye:hover{background:#f1f4f1;color:#326e66}
.auth-code input{flex:1}
.auth-code .btn{height:38px;white-space:nowrap;border-radius:10px}
html[data-theme="dark"] .auth-points-list li{color:#9fb0a8}
html[data-theme="dark"] .auth-field input{background:#131c18;border-color:rgba(255,255,255,.10);color:#e6f0ea}
html[data-theme="dark"] .auth-field>span:first-child{color:#9fb0a8}

/* ---- premium motion: masked headline, hairline signal, gift sheen ---- */
.auth-headline{display:block}
.auth-headline .line{display:block;overflow:hidden}
.auth-headline .line i{display:block;font-style:normal}
@media(prefers-reduced-motion:no-preference){.auth-headline .line i{transform:translateY(112%);opacity:0}}
.is-in .auth-headline .line i,.auth-aside .auth-headline .line i{animation:lineRise 1.05s cubic-bezier(.16,1,.3,1) forwards}
.auth-headline .line:nth-child(1) i{animation-delay:.05s}
.auth-headline .line:nth-child(2) i{animation-delay:.16s}
@keyframes lineRise{to{transform:none;opacity:1}}

.auth-signal{margin:14px 0 18px;height:26px;animation:fadeUp .9s cubic-bezier(.16,1,.3,1) .3s forwards}
.auth-signal svg{width:100%;height:100%;overflow:visible}
@media(prefers-reduced-motion:no-preference){.auth-signal{opacity:0}}
.auth-signal path{fill:none;stroke:#5aa88d;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:900;stroke-dashoffset:900;animation:signalDraw 2.2s cubic-bezier(.16,1,.3,1) .35s forwards,signalPulse 4.5s ease-in-out 2.6s infinite}
@keyframes signalDraw{to{stroke-dashoffset:0}}
@keyframes signalPulse{0%,100%{opacity:.55}50%{opacity:.95}}
@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){.auth-card .auth-field,.auth-card .tabs,.auth-card .auth-gift-line{opacity:0}}

.auth-aside{position:relative}
.auth-gift{position:relative;overflow:hidden}
.auth-sheen{position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 34%,rgba(255,255,255,.65) 48%,rgba(255,255,255,.15) 56%,transparent 66%);transform:translateX(-130%);animation:sheenSweep 9s ease-in-out 2.4s infinite}
@keyframes sheenSweep{0%,68%{transform:translateX(-130%)}84%,100%{transform:translateX(130%)}}

/* staggered entrance for the form card */
.auth-card{animation:cardIn .8s cubic-bezier(.16,1,.3,1) .12s forwards}
@keyframes cardIn{to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){.auth-card{opacity:0;transform:translateY(12px)}}
.auth-card .auth-field,.auth-card .tabs,.auth-card .auth-gift-line{animation:fadeUp .7s cubic-bezier(.16,1,.3,1) forwards}
.auth-card .tabs{animation-delay:.2s}
.auth-card .auth-field:nth-of-type(1){animation-delay:.26s}
.auth-card .auth-field:nth-of-type(2){animation-delay:.32s}
.auth-card .auth-field:nth-of-type(3){animation-delay:.38s}
.auth-card .auth-field:nth-of-type(4){animation-delay:.44s}

/* Auth mode morph: keep shared controls, slide one selection pill, and animate
   layout height without stretching any text or replaying the left-side intro. */
.auth-card.auth-motion-ready{position:relative;animation:none!important;opacity:1;transform:none}
.auth-card.auth-motion-ready .auth-field,.auth-card.auth-motion-ready .tabs,.auth-card.auth-motion-ready .auth-gift-line{animation:none!important;opacity:1;transform:none}
.auth-card.auth-motion-ready .tabs{position:relative;isolation:isolate}
.auth-card.auth-motion-ready .tabs [data-auth]{position:relative;z-index:1;background:transparent!important;border-color:transparent;box-shadow:none;transition:color .25s ease}
.auth-card.auth-motion-ready .auth-tab-pill{position:absolute;z-index:0;pointer-events:none;border-radius:inherit;background:var(--accent);box-shadow:0 2px 5px rgba(35,40,30,.08)}
.auth-card.auth-motion-ready .tabs [data-auth].active{color:#fafbf8}
html[data-theme="warm"] .auth-card.auth-motion-ready .auth-tab-pill{background:#35332e}
html[data-theme="dark"] .auth-card.auth-motion-ready .auth-tab-pill{background:#426c5b}
.auth-exit-field{user-select:none}
@media(prefers-reduced-motion:reduce){.auth-card.auth-motion-ready .tabs [data-auth]{transition:none}}

@media(prefers-reduced-motion:reduce){
  .auth-headline .line i,.auth-signal,.auth-sheen,.auth-card,.auth-card .auth-field,.auth-card .tabs{animation:none!important;opacity:1!important;transform:none!important}
}

/* the old tint was #eef6f1→#fff, effectively invisible; make it read as a wash */
.auth-wrap{background:
  radial-gradient(1100px 720px at 6% -14%, #d9ece2 0%, rgba(217,236,226,0) 62%),
  radial-gradient(900px 620px at 102% 108%, #e4f2ea 0%, rgba(228,242,234,0) 58%),
  linear-gradient(180deg,#f7fbf9 0%,#ffffff 100%)}
html[data-theme="dark"] .auth-wrap{background:
  radial-gradient(1100px 720px at 6% -14%, #16241f 0%, rgba(22,36,31,0) 62%),
  radial-gradient(900px 620px at 102% 108%, #131f1a 0%, rgba(19,31,26,0) 58%),
  linear-gradient(180deg,#0b1210 0%,#0d1412 100%)}

/* a touch stronger so it reads on ordinary monitors */
.auth-wrap{background:
  radial-gradient(1100px 720px at 4% -16%, #cfe7db 0%, rgba(207,231,219,0) 64%),
  radial-gradient(900px 620px at 104% 110%, #dbeee5 0%, rgba(219,238,229,0) 60%),
  linear-gradient(180deg,#f5faf7 0%,#ffffff 100%)}

/* one step deeper */
.auth-wrap{background:
  radial-gradient(1100px 720px at 4% -16%, #bfdfcf 0%, rgba(191,223,207,0) 66%),
  radial-gradient(900px 620px at 104% 110%, #cfe8dd 0%, rgba(207,232,221,0) 62%),
  linear-gradient(180deg,#f2f9f5 0%,#ffffff 100%)}

/* two steps deeper */
.auth-wrap{background:
  radial-gradient(1100px 760px at 2% -18%, #a9d3bf 0%, rgba(169,211,191,0) 68%),
  radial-gradient(900px 640px at 106% 112%, #b5dccb 0%, rgba(181,220,203,0) 64%),
  linear-gradient(180deg,#e9f4ee 0%,#ffffff 100%)}

/* ---- continuous waveform ---- */
.auth-signal{position:relative;margin:14px 0 18px;height:26px;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 10%,#000 90%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 10%,#000 90%,transparent 100%)}
.signal-track{display:flex;width:200%;height:100%;animation:signalScroll 18s linear infinite}
.signal-track svg{width:50%;height:26px;flex:none;overflow:visible}
.signal-track path{fill:none;stroke:#5aa88d;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
@keyframes signalScroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media(prefers-reduced-motion:reduce){.signal-track{animation:none}}
html[data-theme="dark"] .signal-track path{stroke:#6fc9a7}

/* bars read as audio, not an ECG */
.signal-track path{stroke-width:1.4;stroke-linecap:round;opacity:.85}

/* motion follows the user: the wave is still until the form is touched */
.signal-track{animation-play-state:paused;opacity:.42;transition:opacity .5s ease}
.auth-aside.is-live .signal-track{animation-play-state:running;opacity:.9}
@media(prefers-reduced-motion:reduce){.signal-track{opacity:.6}}

.auth-aside.is-busy .signal-track{animation-duration:6s;opacity:1}

/* ---- brand logo ---- */
.brand-logo{display:block;flex:none;border-radius:7px;box-shadow:0 1px 2px rgba(24,58,46,.18)}
.brand{gap:9px}
.brand-name{font-size:14px;font-weight:600;letter-spacing:.01em}
.auth-brand{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:600;color:#1f332c;letter-spacing:.01em}

/* brand pinned to the page corner */
.auth-wrap{position:relative}
.auth-brand{position:absolute;left:30px;top:26px;z-index:3}
@media(max-width:880px){.auth-brand{left:20px;top:18px}}

/* the card sits on a green wash — pure white reads as a cut-out */
.auth-card{
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(250,253,251,.82));
  -webkit-backdrop-filter:blur(18px) saturate(115%);
  backdrop-filter:blur(18px) saturate(115%);
  border:1px solid rgba(255,255,255,.85);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 32px 64px -44px rgba(17,46,35,.42),
    0 2px 10px -6px rgba(17,46,35,.18);
  border-radius:18px;
}
html[data-theme="dark"] .auth-card{
  background:linear-gradient(180deg,rgba(22,32,28,.92),rgba(16,24,21,.86));
  border-color:rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 32px 64px -44px rgba(0,0,0,.8);
}

/* chinese name sits beside the wordmark */
.auth-brand{align-items:baseline;gap:8px}
.brand-cn{font-style:normal;font-size:11px;font-weight:500;color:#7d8d85;letter-spacing:.12em;padding-left:8px;border-left:1px solid #cfe0d6;line-height:1}
html[data-theme="dark"] .brand-cn{color:#93a49c;border-left-color:rgba(255,255,255,.14)}

.brand-cn-sm{font-size:10px;letter-spacing:.14em;padding-left:7px}
html[data-sidebar="collapsed"] .brand-cn{display:none}

/* brand: logo and wordmark vertically centred, no stray divider */
.brand{align-items:center;gap:9px;height:28px}
.brand .brand-name{display:inline-flex;align-items:center;line-height:1;font-size:14px;font-weight:600;letter-spacing:.01em}
.auth-brand{align-items:center;gap:10px;height:28px}
.auth-brand>span{display:inline-flex;align-items:center;line-height:1;font-size:14.5px;font-weight:600;color:#1f332c;letter-spacing:.01em}
html[data-theme="dark"] .auth-brand>span{color:#e9f1ec}

/* plan cards: credits, characters, playtime */
.plan-credits{margin:2px 0 0;font-size:13px;color:#31413a;font-weight:500}
.plan-est{margin:2px 0 10px;font-size:11px;color:#8c9a93;line-height:1.5}
.plan-note{margin:14px 0 0;font-size:10.5px;color:#9aa8a0}
html[data-theme="dark"] .plan-credits{color:#dfeae4}
html[data-theme="dark"] .plan-est,html[data-theme="dark"] .plan-note{color:#8fa49b}

/* ---- clone upload ---- */
.upload-zone{display:grid;place-items:center;gap:6px;padding:30px 20px;text-align:center}
.upload-zone .upload-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;border:1px solid #dbe6df;color:#4f6b5f;margin-bottom:2px}
.upload-zone b{font-size:13px;font-weight:600;color:#1f332c}
.upload-zone span{font-size:11.5px;color:#8c9a93}
.upload-zone small{font-size:11px;color:#a3b0a9}
.upload-actions{display:flex;gap:8px;justify-content:center;margin:12px 0 4px}
.upload-actions .btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border-radius:999px}
.upload-actions .btn.is-recording{background:#c2452d;color:#fff;border-color:#c2452d}
.clone-tips{margin-top:16px}
.clone-tips h3{margin:0 0 8px;font-size:12.5px}
.clone-tips ul{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:6px}
.clone-tips li{position:relative;padding-left:20px;font-size:12px;color:#5d6f67;line-height:1.5}
.clone-tips li::before{content:'💡';position:absolute;left:0;top:0;font-size:11px}
html[data-theme="dark"] .upload-zone b{color:#e9f1ec}
html[data-theme="dark"] .clone-tips li{color:#9fb0a8}
html[data-theme="dark"] .upload-zone .upload-icon{border-color:rgba(255,255,255,.12);color:#b3c2bb}

/* clone page: one screen */
.upload-zone{padding:20px 18px;gap:4px}
.upload-zone .upload-icon{width:32px;height:32px}
.upload-actions{margin:10px 0 2px}
.clone-tips{margin-top:12px;padding:14px 16px}
.clone-tips h3{margin-bottom:6px}
.clone-tips ul{gap:3px;margin-bottom:6px}
.clone-submit{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.clone-submit input{flex:1;height:40px;min-width:0}
.clone-submit .btn{height:40px;white-space:nowrap;padding:0 16px}

.clone-submit{margin-bottom:10px}
.clone-submit input{height:40px}

/* CJK glyphs were clipped by the ellipsis box */
.brand .brand-name{overflow:visible;max-width:none;width:auto;padding-right:2px;white-space:nowrap}
html[data-sidebar="collapsed"] .brand .brand-name{max-width:0;overflow:hidden;opacity:0;padding-right:0}

/* ---- engine switch ---- */
.engine-switch{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:12.5px;font-weight:500;color:#1f332c;cursor:pointer;margin-left:10px}
.engine-switch:hover{border-color:#cfe0d6;background:#fbfdfb}
.engine-icon{width:16px;height:16px;flex:none;object-fit:contain;display:block}
html[data-theme="dark"] .engine-switch{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.12);color:#e6f0ea}
html[data-theme="dark"] .engine-icon{filter:invert(1) brightness(1.6)}
.engine-menu{position:fixed;z-index:999;width:220px;padding:5px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 40px -24px rgba(18,45,35,.45)}
.engine-item{display:flex;align-items:center;gap:9px;width:100%;padding:8px 9px;border:0;border-radius:8px;background:transparent;font-size:12.5px;color:#31413a;cursor:pointer;text-align:left}
.engine-item:hover{background:#f3f7f4}
.engine-item.is-active{background:#eaf3ee;color:#245846}
.engine-item .ui-icon{margin-left:auto}
html[data-theme="dark"] .engine-menu{background:#141d1a;border-color:rgba(255,255,255,.10)}
html[data-theme="dark"] .engine-item{color:#c8d8d0}
html[data-theme="dark"] .engine-item:hover{background:rgba(255,255,255,.06)}
html[data-theme="dark"] .engine-item.is-active{background:rgba(111,208,172,.14);color:#a9e5cc}

/* engine row inside the settings panel */
.engine-row{display:flex;align-items:center;gap:8px;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--line2);font-size:12px;color:#41544b}
.engine-row span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.engine-row-switch{flex:none;padding:0;border:0;background:none;color:#2f6d5c;font-size:11.5px;cursor:pointer}
.engine-row-switch:hover{text-decoration:underline;text-underline-offset:3px}
.engine-param-note{margin:2px 0 0;font-size:10.5px;line-height:1.55;color:#8c9a93}
html[data-theme="dark"] .engine-row{color:#b3c2bb;border-bottom-color:rgba(255,255,255,.08)}
html[data-theme="dark"] .engine-row-switch{color:#8fd6bb}

.engine-switch[hidden]{display:none}

/* hidden filter dimensions must actually disappear */
.filters label[hidden]{display:none!important}

.lib-hint{margin:-6px 0 14px;font-size:11px;line-height:1.6;color:#8c9a93}
html[data-theme="dark"] .lib-hint{color:#8fa49b}

/* keep every filter on one line */
.filters{gap:8px!important;margin-bottom:10px}
.filters select,.filters input{font-size:11.5px;padding:0 8px}
.filters label{font-size:10.5px}

/* preview button states */
[data-preview].is-loading{position:relative;color:transparent!important}
[data-preview].is-loading svg{opacity:0}
[data-preview].is-loading::after{content:'';position:absolute;inset:50% auto auto 50%;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;border:1.5px solid rgba(47,109,92,.25);border-top-color:#2f6d5c;animation:previewSpin .7s linear infinite}
@keyframes previewSpin{to{transform:rotate(360deg)}}
[data-preview].is-playing{color:#2f6d5c}

#voiceResults{transition:opacity .12s linear}
#voiceResults.is-swapping{opacity:0}

.voice-avatar.avatar-orb{background:linear-gradient(160deg,#eef4f1,#dfeae4)}

/* card footer: flag on the left, actions beside it, Use pushed right */
.voice-actions{display:flex;align-items:center;gap:8px;justify-content:flex-start}
.voice-actions .btn.primary{margin-left:auto}
.voice-lang{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:7px;background:#f4f7f5;font-size:14px;line-height:1;cursor:help}

.voice-lang em{font-style:normal;font-size:10px;color:#5d6f67;margin-left:1px}

.flag{width:18px;height:13px;object-fit:cover;border-radius:2px;display:inline-block;vertical-align:-2px}
.voice-lang{width:auto;min-width:26px;padding:0 5px;gap:2px;display:inline-flex;align-items:center}

/* tighter flag chip */
.voice-lang{background:transparent!important;padding:0!important;min-width:0!important;width:auto!important;height:18px!important;gap:3px!important;border-radius:0!important}
.voice-lang .flag{width:16px;height:12px}
.voice-lang em{font-size:10px;color:#7d8d85}

/* the breadcrumb now carries the page title */
#breadcrumb{font-size:14px;font-weight:600;color:#1f332c;letter-spacing:-.01em}
html[data-theme="dark"] #breadcrumb{color:#e9f1ec}

/* ---- motion pass ---- */
@keyframes pageIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.page.page-in{animation:pageIn .18s cubic-bezier(.22,1,.36,1) both}
.nav button{transition:background-color .16s var(--ui-ease),color .16s var(--ui-ease)}
.voice-card{transition:transform .16s var(--ui-ease),box-shadow .16s var(--ui-ease),border-color .16s var(--ui-ease)}
.voice-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px -18px rgba(23,58,45,.45);border-color:#cfe0d6}
@keyframes waveIn{from{opacity:0;transform:scaleX(.4);transform-origin:left center}to{opacity:1;transform:none}}
#generationDock canvas,.result-downloads{animation:waveIn .4s cubic-bezier(.22,1,.36,1)}
@media(prefers-reduced-motion:reduce){.page.page-in,.voice-card:hover,#generationDock canvas,.result-downloads{animation:none!important;transform:none!important}}

/* help affordance fixes */
[data-tooltip]{cursor:pointer}
.count-help{font-style:normal!important;font-family:var(--ui-font);line-height:1}

/* brand mark palette (cool by default, warm when the warm theme is on) */
:root{--brand-bg:#2f6d5c;--brand-fg:#f6fbf9}
html[data-theme="warm"]{--brand-bg:#b5651d;--brand-fg:#fff6ec}

/* theme switch pill: keep the surface + baseline across all three themes */
.theme-toggle{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 13px;border-radius:999px;border:1px solid #e3ebe6;background:#fff;color:#31413a;font-size:12.5px;line-height:1;cursor:pointer}
.theme-toggle svg{flex:none;display:block;width:16px;height:16px}
.theme-toggle:hover{background:#fbfdfb;border-color:#cfe0d6}
html[data-theme="dark"] .theme-toggle{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:#e6f0ea}
html[data-theme="dark"] .theme-toggle:hover{background:rgba(255,255,255,.1)}
html[data-theme="warm"] .theme-toggle{background:#fffaf3;border-color:#eeddcb;color:#5a4433}
html[data-theme="warm"] .theme-toggle:hover{background:#fff6ea;border-color:#e3c9ad}
