:root{
  --bg:#ffffff; --text:#111111; --text-2:#6b7280; --text-3:#6b7280;
  --placeholder:#6b7280; --border:#e5e7eb; --border-2:#e5e7eb;
  --hover:#f5f5f5; --callout:#f4f4f5; --black:#000000;
}
*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  font-weight:400; font-size:15px; line-height:1.5; color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased; overflow-x:hidden; opacity:1; transition:opacity .18s ease;
}
html.i18n-loading body{ opacity:0; }
.layout{ display:flex; height:100vh; height:100dvh; overflow:hidden; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.app{ display:flex; flex-direction:column; height:100%; flex:1; min-width:0; }
/* ---------- SIDEBAR ---------- */
.sidebar{ width:256px; flex:none; border-right:1px solid var(--border); background:#fbfbfb;
  display:flex; flex-direction:column; overflow:hidden; transition:width .2s ease; }
.sidebar.collapsed{ width:68px; }
.sb-scroll{ flex:1; overflow-y:auto; padding:8px 12px; }
.sb-scroll::-webkit-scrollbar{ width:8px; }
.sb-scroll::-webkit-scrollbar-thumb{ background:#e0e0e0; border-radius:8px; border:2px solid #fbfbfb; }
.sb-logo{ display:flex; align-items:center; gap:9px; padding:18px 16px 12px; font-size:19px;
  font-weight:800; letter-spacing:-.03em; white-space:nowrap; }
.sb-logo .brand-badge{ flex:none; width:30px; height:30px; display:grid; place-items:center;
  padding:4px; border-radius:9px; background:linear-gradient(160deg,#fff,#fff4f3);
  border:1px solid rgba(254,101,93,.16); box-shadow:0 2px 7px rgba(254,101,93,.18);
  transition:transform .18s, box-shadow .18s; }
.sb-logo .brand-logo{ width:100%; height:100%; display:block; transition:transform .18s; }
.sb-logo .brand-name{ color:var(--text); }
.sb-logo .brand-acc{ background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  -webkit-background-clip:text; background-clip:text; color:transparent; }
a.sb-logo{ color:inherit; text-decoration:none; cursor:pointer; }
a.sb-logo:hover .brand-badge{ transform:translateY(-1px); box-shadow:0 6px 14px rgba(254,101,93,.30); }
a.sb-logo:hover .brand-logo{ transform:rotate(-4deg); }
.sidebar.collapsed .sb-logo{ justify-content:center; padding:18px 0 12px; }
.sidebar.collapsed .sb-logo .brand-name{ display:none; }
.workspace{ display:flex; align-items:center; gap:10px; margin:0 12px 10px; padding:8px 10px;
  border-radius:11px; border:1px solid var(--border-2); background:#fff; cursor:pointer; white-space:nowrap; }
.workspace:hover{ background:var(--hover); }
.ws-dot{ width:18px; height:18px; border-radius:50%; flex:none;
  background:radial-gradient(circle at 40% 35%,#fed35d,#f97316); }
.ws-name{ font-size:15px; font-weight:600; flex:1; overflow:hidden; text-overflow:ellipsis; }
.ws-chev{ color:var(--text-3); flex:none; }
.sidebar.collapsed .workspace{ justify-content:center; padding:8px; }
.sidebar.collapsed .ws-name,.sidebar.collapsed .ws-chev{ display:none; }
.s-item{ display:flex; align-items:center; gap:13px; height:42px; padding:0 12px; border-radius:11px;
  color:var(--text); text-decoration:none; cursor:pointer; white-space:nowrap; position:relative;
  font-size:15px; font-weight:500; letter-spacing:-.01em;
  width:100%; text-align:left; background:none; border:none; font-family:inherit; }
.s-item:hover{ background:var(--hover); }
.s-item.active{ background:#ededed; font-weight:600; }
.s-ico{ flex:none; display:flex; align-items:center; justify-content:center; width:22px; height:22px; color:var(--text-2); }
.s-item.active .s-ico{ color:var(--text); }
.s-label{ flex:1; overflow:hidden; text-overflow:ellipsis; }
/* Grouped nav sections (Product / Playground) + "Soon" badges */
.sb-group{ font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-3);
  padding:0 12px; margin:16px 0 4px; }
.s-badge{ margin-left:auto; flex:none; font-size:10px; font-weight:700; padding:2px 7px; border-radius:999px;
  background:#f1e9ff; color:#fe655d; letter-spacing:.02em; }
/* Not-yet-shipped tools (e.g. Voice Changer "Soon") are visibly de-emphasized
   so the nav's real, actionable tools stand out and users don't feel teased. */
.s-item[data-action="soon"]{ opacity:.5; }
.s-item[data-action="soon"]:hover{ opacity:.7; background:none; }
.s-section{ font-size:13px; font-weight:600; color:var(--text-3); padding:16px 12px 6px; white-space:nowrap; }
.sidebar.collapsed .s-item{ justify-content:center; padding:0; gap:0; }
.sidebar.collapsed .s-label,.sidebar.collapsed .s-section,.sidebar.collapsed .sb-group,.sidebar.collapsed .s-badge{ display:none; }
.sb-bottom{ flex:none; padding:10px 12px 14px; border-top:1px solid var(--border); }
.invite-card{ border:1px solid var(--border-2); border-radius:14px; background:#fff; padding:14px; margin-bottom:10px; }
.invite-card .ic-top{ display:flex; align-items:center; justify-content:center; width:30px; height:30px;
  border-radius:9px; background:#f3f4f6; color:var(--text); margin-bottom:10px; }
.invite-card h4{ font-size:15px; font-weight:600; margin-bottom:5px; }
.invite-card p{ font-size:13px; line-height:1.45; color:var(--text-2); }
.sidebar.collapsed .invite-card{ display:none; }
.sidebar.collapsed .dev-label{ display:none; }
.sb-foot{ font-size:12px; color:var(--text-3); text-align:center; padding:10px 4px 2px; white-space:nowrap; }

.sb-foot a{ color:var(--text-2); text-decoration:none; font-weight:600; }
.sb-foot a:hover{ color:var(--text); text-decoration:underline; }
.sidebar.collapsed .sb-foot{ display:none; }

/* saydi.ai promo card (sidebar) */
.promo-card{ display:block; text-decoration:none; color:var(--text); border:1px solid var(--border-2);
  border-radius:16px; padding:14px; margin-bottom:10px; background:linear-gradient(135deg,#fff7ed,#eef2ff);
  transition:box-shadow .15s, transform .15s; }
.promo-card:hover{ box-shadow:0 6px 20px #4f46e51f; transform:translateY(-1px); }
.promo-top{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.promo-mark{ font-size:18px; line-height:1; }
.promo-logo{ display:block; flex:none; }
.promo-name{ font-size:15px; font-weight:700; letter-spacing:-.01em; }
.promo-body{ font-size:13px; line-height:1.45; color:var(--text-2); margin-bottom:10px; }
.promo-cta{ display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:700; color:var(--accent, #4f46e5); }
.sidebar.collapsed .promo-card{ display:none; }
/* Ko-fi "support" link in the sidebar (always-available, low-key). */
.sb-support{ display:flex; align-items:center; justify-content:center; gap:7px; margin:0 0 8px;
  padding:8px 10px; text-decoration:none; font-size:12.5px; font-weight:600;
  color:var(--muted,#6b7280); border:1px dashed var(--border-2,#e5e7eb); border-radius:10px;
  transition:color .15s, border-color .15s, background .15s; }
.sb-support:hover{ color:var(--text,#111827); border-color:#fe655d; background:#fe655d14; }
.sb-support-emoji{ font-size:15px; line-height:1; }
.sidebar.collapsed .sb-support{ display:none; }
/* Ko-fi tip nudge: small, dismissible card shown bottom-right after value. */
.tip-nudge{ position:fixed; right:18px; bottom:18px; z-index:70; width:min(330px, calc(100vw - 36px));
  display:flex; align-items:flex-start; gap:11px; padding:15px 34px 14px 15px;
  background:var(--surface,#fff); color:var(--text,#111827);
  border:1px solid var(--border-2,#e5e7eb); border-radius:14px; box-shadow:0 14px 40px rgba(0,0,0,.18);
  opacity:0; transform:translateY(14px) scale(.98); pointer-events:none;
  transition:opacity .22s ease, transform .22s ease; }
.tip-nudge.show{ opacity:1; transform:none; pointer-events:auto; }
.tip-nudge[hidden]{ display:none; }
.tip-emoji{ font-size:24px; line-height:1.1; flex:none; }
.tip-main{ display:flex; flex-direction:column; gap:3px; }
.tip-main strong{ font-size:13.5px; }
.tip-main > span{ font-size:12.5px; line-height:1.45; color:var(--muted,#6b7280); }
.tip-actions{ display:flex; align-items:center; gap:10px; margin-top:11px; }
.tip-cta{ display:inline-flex; align-items:center; text-decoration:none; font-size:12.5px; font-weight:700;
  color:#fff; background:#fe655d; padding:8px 13px; border-radius:9px; transition:filter .15s; }
.tip-cta:hover{ filter:brightness(1.06); }
.tip-later{ background:none; border:0; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--muted,#6b7280); padding:6px 4px; }
.tip-later:hover{ color:var(--text,#111827); }
.tip-close{ position:absolute; top:8px; right:8px; background:none; border:0; cursor:pointer; color:var(--muted,#9ca3af); padding:4px; line-height:0; border-radius:6px; }
.tip-close:hover{ color:var(--text,#111827); background:var(--border-2,#f0f0f2); }

/* get started chips */
.gs-chips{ display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.gs-chip{ display:inline-flex; align-items:center; gap:9px; height:42px; padding:0 16px; border-radius:11px;
  border:1px solid var(--border-2); background:#fff; font-size:15px; font-weight:500; color:var(--text);
  cursor:pointer; font-family:inherit; }
.gs-chip:hover{ background:var(--hover); }
.gs-chip svg{ color:var(--text-2); }

/* ---------- TOP BAR ---------- */
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; height:64px; padding:0 22px; flex:none; }
.topbar-left{ display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0; }
.icon-btn{ display:flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:9px;
  border:none; background:none; cursor:pointer; color:var(--text); flex:none; }
.icon-btn:hover{ background:var(--hover); }
.topbar-title{ font-size:17px; font-weight:600; letter-spacing:-.01em;
  min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-right{ display:flex; align-items:center; gap:8px; flex:none; }
.pill-btn{ display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 16px; border-radius:12px;
  border:1px solid var(--border-2); background:#fff; font-size:15px; font-weight:500; color:var(--text);
  cursor:pointer; font-family:inherit; }
.pill-btn:hover{ background:var(--hover); }
.lang-picker{ display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 10px 0 12px;
  border-radius:12px; border:1px solid var(--border-2); background:#fff; color:var(--text); cursor:pointer; }
.lang-picker:hover{ background:var(--hover); }
.lang-picker svg{ color:var(--text-2); flex:none; }
.lang-picker select{ border:none; background:none; font-family:inherit; font-size:15px; font-weight:500;
  color:var(--text); cursor:pointer; outline:none; padding-right:2px; }
.icon-pill{ width:42px; height:40px; border-radius:12px; border:1px solid var(--border-2); background:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }
.icon-pill:hover{ background:var(--hover); }
.bell{ position:relative; }
.bell::after{ content:""; position:absolute; top:7px; right:9px; width:7px; height:7px; border-radius:50%;
  background:#3b82f6; border:1.5px solid #fff; }
.bell.read::after{ display:none; }

/* Notifications dropdown */
.notif-wrap{ position:relative; display:inline-flex; }
.notif-panel{ position:absolute; top:46px; right:0; width:340px; max-width:90vw; background:#fff;
  border:1px solid var(--border-2); border-radius:16px; box-shadow:0 16px 50px rgba(0,0,0,.16);
  display:none; z-index:80; overflow:hidden; }
.notif-panel.show{ display:block; }
.notif-head{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
  border-bottom:1px solid var(--border); font-size:15px; font-weight:700; letter-spacing:-.01em; }
.notif-read{ border:none; background:none; cursor:pointer; font-family:inherit; font-size:13px;
  font-weight:600; color:var(--text-2); padding:0; }
.notif-read:hover{ color:var(--text); }
.notif-list{ max-height:60vh; overflow-y:auto; }
.notif-item{ display:flex; gap:12px; padding:13px 16px; border-bottom:1px solid var(--border);
  text-decoration:none; color:var(--text); cursor:pointer; }
.notif-item:last-child{ border-bottom:none; }
.notif-item:hover{ background:var(--hover); }
.notif-ico{ flex:none; width:34px; height:34px; border-radius:10px; display:flex; align-items:center;
  justify-content:center; font-size:18px; background:#f4f4f5; }
.notif-t{ font-size:14px; font-weight:600; letter-spacing:-.01em; }
.notif-b{ font-size:13px; color:var(--text-2); line-height:1.45; margin-top:2px; }
.notif-time{ font-size:12px; color:var(--text-3); margin-top:4px; }
.avatar-top{ width:40px; height:40px; border-radius:50%; margin-left:4px;
  background:conic-gradient(from 210deg,#f59e0b,#ef4444,#8b5cf6,#3b82f6,#f59e0b); padding:2px; cursor:pointer; }
.avatar-top .ph{ width:100%; height:100%; border-radius:50%; display:block;
  background:radial-gradient(circle at 42% 36%,#caa97f,#7a5230); }
.avatar-top svg{ width:100%; height:100%; border-radius:50%; display:block; }
.avatar-top:hover{ transform:scale(1.06); transition:transform .15s; }

/* ---------- MAIN ---------- */
.main{ display:grid; grid-template-columns:1fr auto; grid-template-rows:1fr auto; flex:1; min-height:0; }
.editor{ grid-column:1; grid-row:1; min-width:0; display:flex; flex-direction:column; overflow-y:auto; }
/* Fluid so the editor column never gets crushed between ~820-1440px. */
.settings{ grid-column:2; grid-row:1; width:clamp(320px, 28vw, 480px); border-left:1px solid var(--border); overflow-y:auto; padding:30px 40px 60px; }
.editor-footer{ grid-column:1 / -1; grid-row:2; }
/* Trust strip — quick reassurance (free / no sign-up / no watermark). Shown on
   mobile at the very top of the page where the studio otherwise led with knobs
   and no marketing signal. */
.trust-strip{ display:none; align-items:center; flex-wrap:wrap; gap:8px 14px; margin:0 0 20px;
  padding:11px 14px; border:1px solid #fde0dd; border-radius:12px; background:#fff6f5; }
.trust-item{ display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600;
  letter-spacing:-.01em; color:#c8324a; white-space:nowrap; }
.trust-item svg{ color:#fc3e57; flex:none; }
.editor-scroll{ flex:1; overflow-y:auto; padding:34px 40px 60px; }
.editor-inner{ max-width:1080px; margin:0 auto; }
.onboard{ max-width:1080px; margin:0 auto 18px; display:flex; align-items:center; gap:14px;
  padding:13px 16px; border-radius:14px; border:1px solid #ffd9c2;
  background:linear-gradient(135deg,#fff7ed,#eef2ff); font-size:14px; color:var(--text); }
.onboard-text{ flex:1; line-height:1.5; }
.onboard-try{ flex:none; display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 14px;
  border-radius:10px; border:none; background:var(--accent,#fe655d); color:#fff; font-size:13px; font-weight:700;
  cursor:pointer; font-family:inherit; }
.onboard-try:hover{ filter:brightness(.96); }
.onboard-ok{ flex:none; height:34px; padding:0 14px; border-radius:10px; border:1px solid var(--border-2);
  background:#fff; color:var(--text); font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.onboard-ok:hover{ background:var(--hover); }

/* Result card: the clear "here's your audio" surface after Generate. */
.result-card{ max-width:1080px; margin:0 auto 20px; display:flex; align-items:center; gap:14px;
  padding:14px 16px; border-radius:16px; border:1px solid #d7f0dd;
  background:linear-gradient(135deg,#f0fdf4,#eef4ff); }
.rc-av{ width:40px; height:40px; min-width:40px; border-radius:50%; flex:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25), 0 1px 4px rgba(0,0,0,.16); }
.rc-info{ display:flex; flex-direction:column; min-width:0; flex:1; }
.rc-title{ font-size:15px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:7px; }
.rc-title::before{ content:"✓"; display:inline-grid; place-items:center; width:19px; height:19px; border-radius:50%;
  background:#16a34a; color:#fff; font-size:12px; font-weight:800; }
.rc-name{ font-size:13px; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rc-play{ flex:none; width:38px; height:38px; border-radius:50%; border:none; cursor:pointer;
  background:var(--black); color:#fff; display:inline-flex; align-items:center; justify-content:center; }
.rc-play:hover{ background:#262626; }
.rc-btn{ flex:none; display:inline-flex; align-items:center; gap:7px; height:40px; padding:0 15px; border-radius:11px;
  font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; border:1px solid var(--border-2); background:#fff; color:var(--text); }
.rc-btn:hover{ background:var(--hover); }
.rc-download{ background:var(--accent,#fe655d); color:#fff; border-color:transparent; }
.rc-download:hover{ filter:brightness(.96); background:var(--accent,#fe655d); }
.rc-actions{ display:flex; align-items:center; gap:8px; flex:none; }
@media (max-width:600px){
  .result-card{ flex-wrap:wrap; }
  .rc-info{ order:-1; flex-basis:100%; }
  .rc-actions{ width:100%; }
  .rc-actions .rc-btn{ flex:1; justify-content:center; }
}
.editor-footer{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 40px 18px; border-top:1px solid var(--border); }
.credits{ display:flex; align-items:center; gap:14px; font-size:14px; color:var(--text-2); min-width:0; flex:1 1 auto; }
#footHint{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stat-line{ display:inline-flex; flex-direction:column; align-items:flex-start; gap:1px; line-height:1.2; padding-left:22px; position:relative; flex:none; }
.stat-line::before{ content:"💛"; font-size:13px; position:absolute; left:0; top:2px; }
.stat-line .stat-num{ font-size:18px; font-weight:800; color:var(--text); letter-spacing:-.02em; }
.stat-line .stat-label{ font-size:12px; font-weight:400; color:var(--text-3); }
/* Second social-proof figure (characters synthesized) sits beside the audio
   count and reuses .stat-line, so only the leading icon differs. */
.stat-line-chars::before{ content:"✍️"; }
.credits-divider{ width:1px; height:28px; background:var(--border); flex:none; }
.char-count{ display:inline-flex; align-items:baseline; gap:5px; white-space:nowrap; }
.char-count .cc-num{ font-size:16px; font-weight:700; color:var(--text); letter-spacing:-.01em; }
.char-count .cc-label{ font-size:14px; font-weight:400; color:var(--text-2); }
.spinner{ width:22px; height:22px; border-radius:50%; border:2px solid #e5e7eb; border-top-color:#9ca3af;
  animation:spin 1.1s linear infinite; flex:none; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.ef-right{ display:flex; align-items:center; gap:22px; flex:none; }
.ef-right.over-limit .char-count .cc-num{ color:#dc2626; }
.ef-right.over-limit .generate-btn{ opacity:.5; pointer-events:none; }
/* Compact saydi.ai promo in the editor footer (measurable via data-promo). */
.ef-promo{ display:inline-flex; align-items:center; gap:7px; flex:none; text-decoration:none;
  font-size:12.5px; font-weight:600; line-height:1; color:var(--muted,#6b7280);
  padding:6px 11px; border:1px solid var(--border-2,#e5e7eb); border-radius:999px;
  transition:color .15s, border-color .15s, background .15s; white-space:nowrap; }
.ef-promo:hover{ color:var(--text,#111827); border-color:#fe655d; background:#fe655d14; }
.ef-promo img{ border-radius:4px; display:block; }
.ef-promo svg{ opacity:.7; }
@media (max-width: 560px){ .ef-promo{ display:none; } }
.char-count{ font-size:14px; color:var(--text-2); white-space:nowrap; }
/* Primary brand action — owns the one coral colour so it's always the star.
   Download (in the playbar) is solid black so the two never compete. */
.generate-btn{ height:48px; padding:0 26px; border-radius:12px; border:none;
  background:linear-gradient(135deg,#fe655d,#fc3e57);
  color:#fff; font-size:15px; font-weight:700; cursor:pointer; font-family:inherit; letter-spacing:-.01em;
  display:inline-flex; align-items:center; gap:10px; flex:none; white-space:nowrap;
  box-shadow:0 4px 14px rgba(252,62,87,.30); transition:filter .12s, box-shadow .12s, transform .12s; }
.generate-btn:hover{ filter:brightness(1.04); box-shadow:0 6px 18px rgba(252,62,87,.42); }
.generate-btn:active{ transform:translateY(1px); }
.generate-btn:disabled{ opacity:.65; cursor:default; }
.btn-spin{ display:inline-block; width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff; animation:spin .8s linear infinite; vertical-align:middle; }

/* ---------- PLAYBACK / PREVIEW BAR ---------- */
.playbar{ flex:none; border-top:1px solid var(--border); display:none;
  grid-template-columns:1fr auto 1fr;
  grid-template-areas:"left center right" "prog prog prog";
  align-items:center; padding:12px 28px 14px; column-gap:24px; row-gap:10px; background:#fff; }
.playbar.show{ display:grid; }
.pb-left{ grid-area:left; display:flex; align-items:center; gap:12px; min-width:0; }
.pb-left .av{ width:30px; height:30px; border-radius:50%; flex:none;
  background:radial-gradient(circle at 40% 35%,#3a3a3a,#111); }
.pb-left .nm{ font-size:15px; font-weight:600; letter-spacing:-.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pb-edit{ width:28px; height:28px; color:var(--text-3); }
.pb-center{ grid-area:center; display:flex; align-items:center; gap:22px; justify-content:center; }
.skip-btn{ position:relative; width:36px; height:36px; border-radius:9px; }
.skip-btn .num{ display:none; }
.play-main{ width:54px; height:54px; border-radius:50%; background:var(--black); border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:#fff; }
.play-main:hover{ background:#262626; }
.pb-right{ grid-area:right; display:flex; align-items:center; gap:10px; justify-content:flex-end; }
/* Prominent, labelled download button — the payoff action in the player.
   Solid black (not coral) so it reads as a clear button without competing with
   the coral Generate CTA or clashing with the chat/translate accents. */
.pb-dl{ display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 20px;
  border:none; border-radius:12px; cursor:pointer; font-family:inherit; font-size:15px; font-weight:700;
  letter-spacing:-.01em; color:#fff; background:var(--black); white-space:nowrap; flex:none;
  box-shadow:0 4px 14px rgba(0,0,0,.20); transition:transform .12s, box-shadow .12s, background .12s; }
.pb-dl svg{ flex:none; }
.pb-dl:hover{ background:#262626; box-shadow:0 6px 18px rgba(0,0,0,.26); }
.pb-dl:active{ transform:translateY(1px); box-shadow:0 3px 10px rgba(0,0,0,.20); }
.pb-dl:focus-visible{ outline:2px solid #111; outline-offset:2px; }
.pb-dl-label{ line-height:1; }
/* Lift the live-chat bubble above the playbar when it's showing (same custom
   props Crisp's dashboard offset writes). Mobile gets a bigger lift below. */
body.has-playbar .crisp-client{ --crisp-customization-default-button-vertical:120px!important; }
.pb-progress{ grid-area:prog; display:flex; align-items:center; gap:14px; min-width:0; }
.pb-time{ font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; flex:none; }
.track{ flex:1; height:5px; border-radius:5px; background:#e5e7eb; position:relative; cursor:pointer; }
.track-fill{ position:absolute; left:0; top:0; bottom:0; width:0%; background:var(--black); border-radius:5px; }
.track-knob{ position:absolute; top:50%; left:0%; transform:translate(-50%,-50%); width:13px; height:13px;
  border-radius:50%; background:#000; border:2px solid #fff; box-shadow:0 0 0 1px #00000014; }
/* Waveform progress bar */
.waveform{ flex:1; height:34px; display:flex; align-items:center; gap:2px; cursor:pointer; overflow:hidden; }
.wbar{ flex:1 1 0; min-width:2px; border-radius:2px; background:#d1d5db; transition:background-color .1s;
  align-self:center; }
.wbar.on{ background:var(--black); }

/* ---------- SPEAKER BLOCKS ---------- */
.speaker-block{ padding-bottom:26px; margin-bottom:26px; border-bottom:1px solid var(--border); }
.speaker-block:last-of-type{ border-bottom:none; }
.speaker-head{ display:flex; align-items:center; gap:10px; }
.speaker-chip{ display:inline-flex; align-items:center; gap:10px; height:42px; padding:0 14px 0 10px;
  border-radius:12px; border:1px solid var(--border-2); background:#fff; cursor:pointer; font-size:15px;
  font-weight:600; letter-spacing:-.01em; color:var(--text); font-family:inherit; }
.speaker-chip:hover{ background:var(--hover); }
.speaker-chip .sp-av{ width:26px; height:26px; border-radius:50%; flex:none;
  background:radial-gradient(circle at 40% 35%,#3a3a3a,#111); }
.speaker-chip .sp-chev{ display:flex; color:var(--text-3); margin-left:2px; }
.speaker-del{ display:flex; align-items:center; justify-content:center; width:38px; height:38px;
  border-radius:10px; border:none; background:none; cursor:pointer; color:var(--text-3); }
.speaker-del:hover{ background:#fdecec; color:#e11d48; }
.speaker-textwrap{ position:relative; margin-top:18px; min-height:68px ; }
.speaker-text{ font-size:20px; line-height:1.8; letter-spacing:-.005em; color:var(--text);
  outline:none; min-height:34px; }
.ph-overlay{ position:absolute; top:0; left:0; right:0; pointer-events:none; color:var(--placeholder);
  font-size:20px; line-height:1.55; letter-spacing:-.005em; }
.tag-chip{ display:inline-flex; align-items:center; padding:1px 10px; margin:0 2px; border:1px solid var(--border-2);
  border-radius:8px; color:var(--text-3); font-size:17px; background:#fff; }
/* Icon variant: the placeholder points at the 😊 toolbar button, so it shows
   that button's own glyph instead of a bracketed tag name. */
.tag-chip-ico{ padding:2px 7px; vertical-align:-4px; }
.tag-chip-ico svg{ display:block; }
.add-speaker-row{ display:flex; align-items:center; gap:22px; margin:14px 0 30px; }
.add-speaker-row .ln{ flex:1; height:1px; background:var(--border); }
/* flex:none + nowrap: as flex children these buttons would otherwise shrink
   below their label and wrap it — one character per line in CJK, where there are
   no spaces to break on. The .ln hairlines absorb the spare width instead. */
.add-speaker{ display:inline-flex; align-items:center; gap:10px; height:42px; padding:0 20px; border:none;
  background:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600; color:var(--text); border-radius:10px;
  flex:none; white-space:nowrap; }
.add-speaker:hover{ background:var(--hover); }

/* ---------- PER-SPEAKER TOOL ROW ---------- */
/* A subtle row of formatting icons under each speaker's text. Faded until the
   block is hovered or its text is focused, so it stays out of the way. */
.blk-tools{ display:flex; align-items:center; gap:1px; margin:5px 2px 0; height:28px;
  opacity:0; transform:translateY(-2px); transition:opacity .15s ease, transform .15s ease;
  pointer-events:none; }
.speaker-block .speaker-content:hover .blk-tools,
.speaker-block:focus-within .blk-tools{ opacity:1; transform:none; pointer-events:auto; }
.blk-tool{ display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px;
  border:none; background:none; border-radius:7px; cursor:pointer; color:var(--text-3);
  transition:background .12s ease, color .12s ease; }
.blk-tool:hover:not(:disabled){ background:var(--hover); color:var(--text); }
.blk-tool:active:not(:disabled){ background:var(--border); }
.blk-tool:disabled{ color:var(--border-2); cursor:default; }
.blk-tool[aria-expanded="true"]{ background:var(--hover); color:var(--text); }
.blk-div{ width:1px; height:15px; background:var(--border); margin:0 5px; flex:none; }

/* ---------- INSERT PAUSE PICKER (shared, floating) ---------- */
.pause-menu{ position:fixed; z-index:60; width:236px;
  background:#fff; border:1px solid var(--border-2); border-radius:12px; padding:12px;
  box-shadow:0 14px 38px rgba(20,16,50,.16); }
.pause-tip{ font-size:12px; line-height:1.5; color:var(--text-3); margin-bottom:10px; }
.pause-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.pause-opt{ border:1px solid var(--border-2); background:#fff; border-radius:9px; height:36px;
  cursor:pointer; font-family:inherit; font-size:14px; font-weight:600; color:var(--text); }
.pause-opt:hover{ background:var(--hover); border-color:var(--text-3); }
/* ---------- INSERT EXPRESSION PICKER (shared, floating) ---------- */
/* A short, grouped menu. Each row is emoji + name + the sound it makes, so the
   choice is made by ear-in-the-head rather than by decoding a tag name. */
.emo-menu{ position:fixed; z-index:60; width:292px; max-height:min(70vh, 460px); overflow-y:auto;
  background:#fff; border:1px solid var(--border-2); border-radius:12px; padding:12px;
  box-shadow:0 14px 38px rgba(20,16,50,.16); }
/* The AI row leads the menu: judging which of five near-identical question tags
   belongs after a given clause is the tedious part, and this does it in one
   click. Styled as the one filled/primary item so it reads as the shortcut
   rather than as a fourteenth tag. */
.emo-auto{ display:flex; align-items:flex-start; gap:9px; width:100%; margin-bottom:10px;
  padding:9px 10px; border:1px solid #d9cffb; border-radius:10px; background:#f5f1ff;
  cursor:pointer; font-family:inherit; text-align:left;
  transition:background .12s ease, border-color .12s ease; }
.emo-auto:hover{ background:#efe9ff; border-color:#c4b4f7; }
.emo-auto:focus-visible{ outline:2px solid #6c5ce7; outline-offset:1px; }
.emo-auto[disabled]{ cursor:default; opacity:.75; }
.emo-auto-ico{ flex:none; display:flex; color:#5b46c9; margin-top:1px; }
.emo-auto-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.emo-auto-name{ font-size:13.5px; font-weight:700; color:#3d2f8f; }
.emo-auto-sub{ font-size:11.5px; line-height:1.45; color:#6a5ea8; }
.emo-spin{ animation:emo-spin .8s linear infinite; }
@keyframes emo-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .emo-spin{ animation-duration:2.4s; } }
.emo-tip{ font-size:12px; line-height:1.5; color:var(--text-3); margin-bottom:10px; }
.emo-group + .emo-group{ margin-top:10px; }
.emo-group-label{ font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--text-3); margin:0 2px 5px; }
.emo-opt{ display:flex; align-items:center; gap:10px; width:100%; padding:7px 8px;
  border:1px solid transparent; background:none; border-radius:9px; cursor:pointer;
  font-family:inherit; text-align:left; transition:background .12s ease, border-color .12s ease; }
.emo-opt:hover{ background:var(--hover); border-color:var(--border-2); }
.emo-opt:focus-visible{ outline:2px solid var(--text-3); outline-offset:1px; }
.emo-emoji{ font-size:19px; line-height:1; flex:none; width:24px; text-align:center; }
.emo-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.emo-name{ font-size:14px; font-weight:600; color:var(--text); }
/* The sound the model actually makes — quoted so it reads as audio, not a label. */
.emo-sfx{ font-size:12px; color:var(--text-3); }
.emo-sfx::before{ content:"\201C"; }
.emo-sfx::after{ content:"\201D"; }
/* ---------- EXPRESSION CHIP (inside the text box) ---------- */
/* An expression reads as a chip, not as "[laughter]". contenteditable="false"
   makes it atomic: the caret can't get inside, so it cannot be half-deleted
   into something the voice would read out as a word. */
.emo-pill{ display:inline-flex; align-items:center; gap:4px; vertical-align:baseline;
  margin:0 1px; padding:1px 6px 1px 5px; border-radius:999px;
  background:#efeaff; border:1px solid #d9cffb; color:#4b3ba8;
  font-size:.82em; font-weight:600; line-height:1.5; white-space:nowrap;
  cursor:default; user-select:none; -webkit-user-select:none; }
.emo-pill .ep-emoji{ font-size:1.05em; line-height:1; }
.emo-pill .ep-x{ display:inline-flex; align-items:center; justify-content:center;
  width:13px; height:13px; margin-left:1px; border-radius:50%;
  font-size:12px; font-weight:700; line-height:1; color:#8a7bd0;
  cursor:pointer; opacity:0; transition:opacity .12s ease, background .12s ease, color .12s ease; }
.emo-pill:hover .ep-x{ opacity:1; }
.emo-pill .ep-x:hover{ background:#4b3ba8; color:#fff; }
/* Browser selection of the whole chip (click, or Backspace beside it). */
.speaker-text .emo-pill::selection,
.speaker-text .emo-pill *::selection{ background:#c9b8ff; }

/* ---------- CLONE / DESIGN PANELS ---------- */
.clone-card{ border:1px solid var(--border-2); border-radius:16px; background:#fafbfc; padding:20px 22px; margin-top:6px; }
.clone-label{ font-size:16px; font-weight:600; color:var(--text); margin:14px 0 8px; }
.clone-label:first-child{ margin-top:0; }
.dropzone{ border:2px dashed #c7cad2; border-radius:12px; padding:22px; text-align:center; cursor:pointer;
  font-size:16px; color:var(--text-2); background:#fff; }
.dropzone.has{ border-color:#34d399; color:var(--text); }
.dropzone.drag{ border-color:var(--accent,#4f46e5); background:#eef2ff; color:var(--text); }
.clone-ta{ width:100%; min-height:80px; border-radius:12px; border:1px solid var(--border-2); padding:12px 16px;
  font-size:16px; font-family:inherit; color:var(--text); resize:vertical; outline:none; }
.clone-ta:focus,.clone-name:focus{ border-color:#d1d5db; }
.clone-save{ display:flex; align-items:center; gap:8px; font-size:15px; color:var(--text); margin-top:12px; cursor:pointer; }
.clone-save input{ width:auto; }
.clone-name{ width:100%; height:46px; border-radius:12px; border:1px solid var(--border-2); padding:0 16px;
  font-size:16px; font-family:inherit; color:var(--text); outline:none; margin-top:10px; }

/* ---------- SETTINGS PANEL ---------- */
.st-tabs{ display:flex; align-items:center; gap:30px; border-bottom:1px solid var(--border); }
.st-tab{ position:relative; padding:4px 2px 16px; font-size:17px; font-weight:600; letter-spacing:-.01em;
  color:var(--text-3); cursor:pointer; background:none; border:none; font-family:inherit; }
.st-tab.active{ color:var(--text); }
.st-tab.active::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:2.5px; background:var(--text); border-radius:2px; }
.st-section{ margin-top:34px; }
.st-label{ font-size:17px; font-weight:600; letter-spacing:-.01em; color:var(--text); margin-bottom:14px; }
.st-label.dotted{ text-decoration:underline dotted; text-underline-offset:6px; text-decoration-color:#d1d5db; }
.st-label-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
/* A plain-language hint shown under a control label (replaces hover-only tips,
   which touch users can't reach). */
.st-hint{ font-size:13px; line-height:1.5; color:var(--text-2); margin:0 0 14px; }
/* Advanced settings: optional controls tucked into a collapsible so first-time
   users only see Voice + Generate by default. */
.st-adv{ margin-top:30px; border-top:1px solid var(--border); }
.st-adv > summary{ list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:16px 2px 0; font-size:15px; font-weight:600; color:var(--text-2); }
.st-adv > summary::-webkit-details-marker{ display:none; }
.st-adv > summary:hover{ color:var(--text); }
.st-adv-chev{ transition:transform .2s; flex:none; }
.st-adv[open] > summary .st-adv-chev{ transform:rotate(180deg); }
.st-adv[open] > summary{ color:var(--text); }
.st-adv .st-section:first-of-type{ margin-top:20px; }
.selector{ display:flex; align-items:center; gap:14px; width:100%; height:60px; padding:0 18px; border-radius:16px;
  border:1px solid var(--border-2); background:#fff; cursor:pointer; font-size:16px; font-weight:600;
  letter-spacing:-.01em; color:var(--text); font-family:inherit; text-align:left; }
.selector:hover{ background:var(--hover); }
/* Inline "hear this voice" preview button under the Voice selector. */
.voice-preview{ display:inline-flex; align-items:center; gap:8px; margin-top:10px; padding:8px 14px;
  border-radius:999px; border:1px solid var(--border-2); background:#fff; cursor:pointer;
  font-size:13.5px; font-weight:600; color:var(--text); font-family:inherit; transition:background .15s,border-color .15s; }
.voice-preview:hover{ background:var(--hover); border-color:#d1d5db; }
.voice-preview .voice-preview-ic{ display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%; background:var(--accent,#fe655d); color:#fff; flex:none; }
.voice-preview .voice-preview-ic svg{ width:13px; height:13px; }
/* Inline "popular voices" quick-pick strip under the Voice card. */
.pop-voices{ margin-top:16px; }
.pop-voices-label{ font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--text-3); margin-bottom:10px; }
.pop-voices-row{ display:flex; flex-direction:column; gap:8px; }
.pv-chip{ display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border-radius:12px;
  border:1px solid var(--border-2); background:#fff; cursor:pointer; font-family:inherit; text-align:left;
  transition:background .15s,border-color .15s; }
.pv-chip:hover{ background:var(--hover); }
.pv-chip.sel{ border-color:var(--accent,#fe655d); box-shadow:inset 0 0 0 1px var(--accent,#fe655d); }
.pv-av{ width:28px; height:28px; border-radius:50%; flex:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25), 0 1px 3px rgba(0,0,0,.16); }
.pv-name{ flex:1; min-width:0; font-size:14px; font-weight:600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pv-play{ flex:none; display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px;
  border-radius:50%; background:var(--hover); color:var(--text); }
.pv-play:hover{ background:#e5e7eb; }
.pv-play svg{ width:14px; height:14px; }
.selector .sel-av{ width:32px; height:32px; border-radius:50%; flex:none;
  background:radial-gradient(circle at 40% 35%,#3a3a3a,#111); }
.selector .chev{ margin-left:auto; color:var(--text-3); }
.v3-badge{ display:inline-flex; align-items:center; justify-content:center; min-width:42px; height:28px; padding:0 10px;
  border:1.5px solid var(--text); border-radius:999px; font-size:13px; font-weight:700; letter-spacing:.02em; }
.selector-grad{ padding:2px; border-radius:18px; background:linear-gradient(95deg,#34d399,#60a5fa,#fe655d,#fc3e57,#fb923c); }
.selector-grad .selector{ border-color:transparent; width:100%; height:56px; border-radius:16px; }
.callout{ display:flex; gap:16px; background:var(--callout); border-radius:16px; padding:20px 22px; margin-top:16px; }
.callout .ic{ flex:none; color:var(--text-2); margin-top:2px; }
.callout p{ font-size:14px; line-height:1.5; color:var(--text); letter-spacing:-.005em; }
.slider-ends{ display:flex; justify-content:space-between; font-size:14px; font-weight:600; color:var(--text); margin-bottom:14px; }
.slider-val{ font-size:13px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums;
  background:#f0f1f4; padding:2px 10px; border-radius:8px; }
.slider{ position:relative; height:8px; border-radius:8px; background:#e5e7eb; cursor:pointer; }
.slider-fill{ position:absolute; left:0; top:0; bottom:0; width:60%; background:var(--black); border-radius:8px; }
.slider-knob{ position:absolute; top:50%; left:60%; transform:translate(-50%,-50%); width:22px; height:22px;
  border-radius:50%; background:var(--black); border:3px solid #fff; box-shadow:0 1px 4px #0000002e; }
.dropdown{ display:flex; align-items:center; width:100%; height:60px; padding:0 18px; border-radius:16px;
  border:1px solid var(--border-2); background:#fff; cursor:pointer; font-size:16px; font-weight:600;
  letter-spacing:-.01em; color:var(--text); font-family:inherit; }
.dropdown:hover{ background:var(--hover); }
.dropdown .chev{ margin-left:auto; color:var(--text-3); }

/* ---------- VOICE PICKER VIEW ---------- */
/* Voice picker is a centered modal (ant-modal style) overlaying the studio. */
#viewVoice{ display:none; }
#viewVoice.vp-open{ display:flex; position:fixed; inset:0; z-index:2000; align-items:flex-start;
  justify-content:center; padding:5vh 16px; overflow:auto; background:rgba(20,14,45,.5);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); }
.vp-dialog{ width:min(780px,100%); max-height:90vh; display:flex; flex-direction:column;
  background:var(--bg); border:1px solid var(--border-2); border-radius:20px;
  box-shadow:0 24px 70px rgba(20,14,45,.35); padding:20px 22px; animation:vppop .18s ease; }
@keyframes vppop{ from{ transform:translateY(10px) scale(.985); opacity:.5 } to{ transform:none; opacity:1 } }
body.vp-locked{ overflow:hidden; }
.vp-head{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.vp-head h2{ font-size:19px; font-weight:700; letter-spacing:-.01em; }
.vp-close{ width:34px; height:34px; border-radius:50%; border:none; background:var(--hover); color:var(--text-2);
  display:grid; place-items:center; cursor:pointer; flex:none; }
.vp-close:hover{ background:#e9e9ee; color:var(--text); }
/* Tabs: Explore / My Voices / Favorites */
.vp-tabs{ display:flex; gap:22px; border-bottom:1px solid var(--border); margin-bottom:14px; }
.vp-tab{ border:none; background:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600;
  color:var(--text-3); padding:0 0 10px; margin-bottom:-1px; border-bottom:2px solid transparent; }
.vp-tab:hover{ color:var(--text); }
.vp-tab.is-active{ color:var(--text); border-bottom-color:var(--text); }
.vp-back{ display:flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:10px;
  border:none; background:none; cursor:pointer; color:var(--text); }
.vp-back:hover{ background:var(--hover); }
.vp-search{ position:relative; display:flex; align-items:center; margin-bottom:12px; }
.vp-search .search-ico{ position:absolute; left:16px; color:var(--text-3); pointer-events:none; }
.vp-search input{ flex:1; height:50px; border-radius:12px; border:1px solid var(--border-2); padding:0 16px 0 46px;
  font-size:15px; font-family:inherit; color:var(--text); outline:none; background:#fff; }
.vp-search input::placeholder{ color:var(--text-3); }
.vp-search input:focus{ border-color:#d1d5db; }
.vp-filters{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.vp-filter{ flex:1 1 0; min-width:104px; height:40px; border-radius:10px; border:1px solid var(--border-2);
  background-color:#fff; color:var(--text); padding:0 32px 0 12px; font-size:14px; font-weight:500;
  font-family:inherit; cursor:pointer; outline:none; appearance:none; -webkit-appearance:none; -moz-appearance:none;
  white-space:nowrap; text-overflow:ellipsis;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px;
  transition:border-color .15s, background-color .15s; }
.vp-filter:hover{ background-color:var(--hover); }
.vp-filter:focus{ border-color:var(--text); }
.vp-count{ font-size:13px; color:var(--text-3); margin:2px 2px 12px; }
.vp-list-wrap{ display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
#voiceListPagination{ display:flex; align-items:center; }
.voice-item{ display:flex; align-items:center; gap:14px; padding:12px; border-radius:14px; cursor:pointer; }
.voice-item:hover{ background:var(--hover); }
.voice-item:focus-visible{ outline:2px solid var(--accent,#4f46e5); outline-offset:-2px; }
button:focus-visible, .selector:focus-visible, .dropdown:focus-visible,
.vp-filter:focus-visible, [tabindex]:focus-visible{ outline:2px solid var(--accent,#4f46e5); outline-offset:2px; }
.voice-item.selected{ background:#f3f4f6; }
.vi-avatar{ position:relative; flex:none; }
.vi-avatar .av{ width:46px; height:46px; border-radius:50%; display:block; position:relative; overflow:hidden; }
.av-img{ position:absolute; inset:0; width:100%; height:100%; border-radius:inherit; object-fit:cover; display:block; }
/* Favorite (star) toggle on each voice row */
.vi-fav{ width:34px; height:34px; border-radius:8px; border:none; background:none; flex:none; cursor:pointer;
  color:var(--text-3); font-size:18px; line-height:1; display:grid; place-items:center; }
.vi-fav:hover{ background:var(--hover); color:#f59e0b; }
.vi-fav.on{ color:#f59e0b; }
.vi-select{ height:30px; padding:0 12px; border-radius:8px; border:none; background:var(--black);
  color:#fff; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit;
  flex:none; white-space:nowrap; opacity:0; transition:opacity .12s; }
.voice-item:hover .vi-select,.voice-item:focus-within .vi-select{ opacity:1; }
.voice-item.selected .vi-select{ background:#16a34a; opacity:1; }
.vi-select:hover{ background:#262626; }
#voiceList{ overflow:auto; }
.vp-dialog #voiceList{ flex:1; min-height:0; }
.vi-info{ flex:1; min-width:0; }
.vi-name{ font-size:15px; font-weight:600; letter-spacing:-.01em; }
.vi-badge{ display:inline-block; margin-left:6px; color:#f59e0b; font-size:14px; vertical-align:middle; }

/* ---------- HISTORY ---------- */
#historyList{ margin-top:14px; }
#historyPagination{ margin-top:12px; display:flex; justify-content:center; }
.hist-header{ display:flex; align-items:center; justify-content:space-between; margin:14px 0 4px; }
.hist-count{ font-size:14px; font-weight:600; color:var(--text); }
.hist-clear{ display:inline-flex; align-items:center; gap:10px; height:42px; padding:0 20px; border:none;
  background:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600; color:var(--text); border-radius:10px;
  flex:none; white-space:nowrap; }
.hist-clear:hover{ background:var(--hover); }
.hist-empty{ color:var(--text-3); font-size:15px; text-align:center; padding:28px 12px; }
.hist-item{ display:flex; align-items:center; gap:12px; padding:10px; border-radius:12px; }
.hist-item:hover{ background:var(--hover); }
.hist-av{ width:38px; height:38px; border-radius:50%; flex:none; }
.hist-info{ flex:1; min-width:0; }
.hist-name{ font-size:15px; font-weight:600; display:flex; flex-direction:column; gap:2px; }
.hist-time{ font-size:12px; font-weight:400; color:var(--text-3); }
.hist-btn{ width:32px; height:32px; border-radius:8px; border:none; background:none; flex:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--text); }
.hist-btn:hover{ background:rgba(0,0,0,.06); }

/* History item dropdown menu */
.hist-menu-wrap{ position:relative; flex:none; }
.hist-dropdown{ display:none; position:absolute; top:36px; right:0; z-index:20; min-width:160px;
  background:#fff; border:1px solid var(--border-2); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.12);
  padding:6px; }
.hist-dropdown.show{ display:block; }
.hist-dd-item{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; border:none;
  background:none; border-radius:8px; font-size:14px; font-weight:500; color:var(--text);
  cursor:pointer; font-family:inherit; text-align:left; }
.hist-dd-item:hover{ background:var(--hover); }
.hist-dd-item.danger{ color:#dc2626; }
.hist-dd-item.danger:hover{ background:#fef2f2; }
.hist-dd-item svg{ width:16px; height:16px; flex:none; }
.hist-clear{height:40px; border-radius:10px;
  background:#fff; color:#dc2626; font-size:14px; font-family:inherit; cursor:pointer; }
.hist-clear:hover{ background:#fef2f2; }
.hist-modal{ text-align:left; max-width:560px; }
.hist-detail-name{ text-align:left; margin-bottom:4px; }
.hist-detail-meta{ text-align:left; margin:0 0 14px; font-size:13px; color:var(--text-3); }
.hist-detail-text{ white-space:pre-wrap; word-break:break-word; max-height:48vh; overflow:auto;
  background:var(--hover,#f6f6f7); border:1px solid var(--border-2); border-radius:12px;
  padding:14px 16px; font-size:15px; line-height:1.55; color:var(--text); }
.vi-desc{ font-size:13px; color:var(--text-3); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vi-play{ width:34px; height:34px; border-radius:50%; border:none; background:none; flex:none; display:flex;
  align-items:center; justify-content:center; cursor:pointer; color:var(--text); position:relative; }
.vi-play.playing{ color:#fc3e57; }
.vi-play.playing::before{ content:""; position:absolute; inset:-2px; border-radius:50%;
  border:2.5px solid transparent; border-top-color:#fc3e57;
  animation:vi-spin .8s linear infinite; }
@keyframes vi-spin{ to{ transform:rotate(360deg); } }
.voice-item:hover .vi-play,.voice-item.selected .vi-play{ background:rgba(0,0,0,.05); }

/* ---------- TOAST ---------- */
.toast{ position:fixed; right:24px; bottom:24px; transform:translateY(20px); opacity:0;
  pointer-events:none; display:flex; align-items:center; gap:10px; max-width:400px; padding:14px 18px;
  border-radius:14px; font-size:15px; font-weight:500; background:#111111; color:#fff;
  box-shadow:0 12px 40px #00000026; transition:opacity .22s, transform .22s; z-index:9000;
  overflow:hidden; }
.toast.show{ opacity:1; transform:translateY(0); pointer-events:auto; }
.toast-ico{ display:flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%;
  flex:none; background:rgba(255,255,255,.18); }
.toast-msg{ flex:1; min-width:0; }
.toast-close{ flex:none; display:flex; align-items:center; justify-content:center; width:24px; height:24px;
  border:none; background:rgba(255,255,255,.15); border-radius:6px; color:#fff; cursor:pointer;
  transition:background .15s; }
.toast-close:hover{ background:rgba(255,255,255,.3); }
.toast-progress{ position:absolute; left:0; bottom:0; height:3px; width:100%;
  background:rgba(255,255,255,.4); transform-origin:left; border-radius:0 0 14px 14px; }
@keyframes toast-countdown{ from{ transform:scaleX(1); } to{ transform:scaleX(0); } }
.toast.err{ background:#e11d48; }
.toast.err .toast-progress{ background:rgba(255,255,255,.5); }
.toast.ok{ background:#111111; }
.toast.ok .toast-ico{ background:#16a34a; }
/* "Ran fine, nothing to change" — blue, so it is legible as a real answer
   rather than as a click that did nothing. */
.toast.info{ background:#111111; }
.toast.info .toast-ico{ background:#2563eb; }

.editor::-webkit-scrollbar,.settings::-webkit-scrollbar{ width:10px; }
.editor::-webkit-scrollbar-thumb,.settings::-webkit-scrollbar-thumb{ background:#e0e0e0; border-radius:8px; border:2px solid #fff; }

/* Voice avatars: render the generated SVG orb cleanly with a subtle ring. */
.sel-av, .sp-av, .vi-avatar .av, .pb-left .av {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 1px 4px rgba(0,0,0,.16);
}

@media (max-width:1300px){
  .speaker-text,.ph-overlay{ font-size:18px; }
  .st-label{ font-size:16px; }
  .selector,.dropdown{ font-size:15px; }
}
/* Mid-range (tablet / small laptop): trim generous 40px gutters so the editor
   column keeps a comfortable width before the layout stacks at 820px. */
@media (max-width:1180px){
  .editor-scroll{ padding:26px 24px 20px; }
  .settings{ padding:26px 22px 48px; }
  .editor-footer{ padding:14px 24px 16px; }
}

/* ---------- DOCS / ABOUT MODAL ---------- */
.modal-backdrop{ position:fixed; inset:0; background:rgba(10,10,10,.45); display:none;
  align-items:center; justify-content:center; z-index:8000; padding:20px; }
.modal-backdrop.show{ display:flex; }
.modal{ position:relative; width:100%; max-width:460px; background:#fff; border-radius:20px;
  padding:34px 32px 28px; text-align:center; box-shadow:0 24px 70px #00000033; }
.modal-x{ position:absolute; top:14px; right:14px; width:36px; height:36px; border-radius:10px; border:none;
  background:none; cursor:pointer; color:var(--text-3); display:flex; align-items:center; justify-content:center; }
.modal-x:hover{ background:var(--hover); color:var(--text); }
.modal-logo{ line-height:1; margin-bottom:10px; }
.modal-logo img{ width:48px; height:48px; display:inline-block; filter:drop-shadow(0 4px 10px rgba(254,101,93,.28)); }
.modal-title{ font-size:22px; font-weight:800; letter-spacing:-.02em; margin-bottom:8px; }
.modal-tagline{ font-size:15px; line-height:1.5; color:var(--text-2); margin-bottom:20px; }
.modal-list{ list-style:none; text-align:left; display:flex; flex-direction:column; gap:12px; margin-bottom:24px; }
.modal-list li{ display:flex; align-items:center; gap:12px; font-size:15px; font-weight:500; }
.modal-ico{ display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; flex:none; color:#fff; }
.modal-ico.free{ background:#16a34a; }
.modal-ico.eco{ background:linear-gradient(135deg,#f59e0b,#ef4444); }
.modal-promo{ display:flex; align-items:center; justify-content:space-between; gap:12px; text-decoration:none;
  border:1px solid var(--border-2); border-radius:16px; padding:14px 16px; margin-bottom:16px; text-align:left;
  background:linear-gradient(135deg,#fff7ed,#eef2ff); color:var(--text); transition:box-shadow .15s, transform .15s; }
.modal-promo:hover{ box-shadow:0 6px 20px #4f46e51f; transform:translateY(-1px); }
.modal-promo-text{ display:flex; flex-direction:column; flex:1; min-width:0; }
.modal-promo-logo{ display:block; flex:none; }
.modal-promo-text strong{ font-size:15px; font-weight:700; }
.modal-promo-text span{ font-size:13px; color:var(--text-2); }
.modal-promo-go{ font-size:13px; font-weight:700; color:#4f46e5; white-space:nowrap; }
.modal-btn{ width:100%; height:48px; border-radius:12px; border:none; background:var(--black); color:#fff;
  font-size:16px; font-weight:600; cursor:pointer; font-family:inherit; }
.modal-btn:hover{ background:#262626; }

/* Confirm modal (delete voice etc.) */
.confirm-modal{ max-width:380px; padding:48px 28px 24px; text-align:left;
  opacity:0; transform:scale(.95) translateY(8px); transition:opacity .2s ease, transform .2s ease; }
.confirm-modal .modal-x{ top:8px; right:8px; }
.modal-backdrop.show .confirm-modal{ opacity:1; transform:scale(1) translateY(0); }
.confirm-msg{ font-size:16px; font-weight:600; color:var(--text); line-height:1.5; margin-bottom:24px; }
.confirm-actions{ display:flex; gap:10px; justify-content:flex-end; }
.prompt-input{ width:100%; height:44px; border:1px solid var(--border-2); border-radius:10px; padding:0 14px;
  font-size:15px; font-family:inherit; color:var(--text); outline:none; margin-bottom:20px; }
.prompt-input:focus{ border-color:#fe655d; box-shadow:0 0 0 3px rgba(254,101,93,.12); }
.confirm-cancel{ height:40px; padding:0 18px; border-radius:10px; border:1px solid var(--border-2);
  background:#fff; color:var(--text); font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; }
.confirm-cancel:hover{ background:var(--hover); }
.confirm-ok{ height:40px; padding:0 18px; border-radius:10px; border:none;
  background:var(--black); color:#fff; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; }
.confirm-ok:hover{ background:#262626; }
.confirm-ok.danger{ background:#e11d48; }
.confirm-ok.danger:hover{ background:#be123c; }

.modal-script{ max-width:560px; text-align:left; }
.modal-script .modal-title{ text-align:left; }
.modal-script .modal-tagline{ text-align:left; }
.script-ta{ width:100%; min-height:200px; border-radius:12px; border:1px solid var(--border-2);
  padding:12px 16px; font-size:15px; line-height:1.6; font-family:inherit; color:var(--text);
  resize:vertical; outline:none; background:#fafbfc; }
.script-ta:focus{ border-color:#d1d5db; }
.script-actions{ display:flex; gap:12px; margin-top:18px; }
.modal-btn.ghost{ background:#fff; color:var(--text); border:1px solid var(--border-2); }
.modal-btn.ghost:hover{ background:var(--hover); }

/* ---------- MOBILE / RESPONSIVE ---------- */
.sidebar-backdrop{ display:none; }

@media (max-width:820px){
  /* Let the whole page scroll instead of the fixed 3-column desktop frame. */
  html,body{ height:auto; }
  body{ overflow-x:hidden; overflow-y:auto; -webkit-text-size-adjust:100%; }
  .layout{ flex-direction:column; height:auto; min-height:100vh; min-height:100dvh; overflow:visible; }
  .app{ height:auto; }

  /* Sidebar becomes a slide-in drawer. */
  .sidebar{ position:fixed; top:0; left:0; height:100%; width:272px; max-width:84vw; z-index:200;
    transform:translateX(-100%); transition:transform .25s ease; border-right:1px solid var(--border); }
  .sidebar.open{ transform:translateX(0); box-shadow:0 0 50px rgba(0,0,0,.25); }
  .sidebar.collapsed{ width:272px; }            /* ignore desktop rail-collapse on mobile */
  .sidebar-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:150; }
  .sidebar-backdrop.show{ display:block; }

  /* Stack editor + settings vertically; page handles scrolling. */
  .main{ display:flex; flex-direction:column; height:auto; min-height:0; }
  /* Put Voice (settings) above the editor so the flow reads top-to-bottom:
     pick a voice -> type -> Generate. Settings is hidden in clone/design/
     translate modes, so this only affects Text to Speech. */
  .settings{ order:-1; width:100%; border-left:none; border-bottom:1px solid var(--border);
    overflow:visible; padding:18px 16px 20px; }
  .trust-strip{ display:flex; }               /* surface trust signals up top on phones */
  .editor{ order:0; width:100%; }
  .editor-footer{ order:1; }
  .editor-scroll{ overflow:visible; padding:20px 16px 8px; }

  /* Top bar tightening. */
  .topbar{ position:sticky; top:0; z-index:60; height:56px; padding:0 12px; background:#fff;
    border-bottom:1px solid var(--border); }
  .topbar-right{ gap:6px; }
  .topbar-title{ font-size:16px; }
  .notif-panel{ position:fixed; top:56px; right:8px; left:8px; width:auto; max-width:none; }
  .pill-btn{ padding:0 12px; }
  .lang-picker{ padding:0 8px; }
  .lang-picker select{ max-width:92px; }

  /* Editor footer wraps so the button never gets clipped. */
  .editor-footer{ flex-wrap:wrap; gap:10px; padding:12px 16px 16px; }
  .credits{ order:2; }
  .ef-right{ order:1; width:100%; justify-content:space-between; gap:12px; }
  .generate-btn{ flex:1; justify-content:center; }

  /* Editor text a touch smaller; selectors comfortable for touch. */
  .speaker-text,.ph-overlay{ font-size:18px; }
  .selector,.dropdown{ height:56px; }

  /* Add speaker / Import script / Subtitles to speech: three unshrinkable
     buttons never fit one narrow row, so let the row wrap and drop the
     decorative hairlines (they would claim a whole line of their own). */
  .add-speaker-row{ flex-wrap:wrap; gap:6px 10px; margin:10px 0 22px; }
  .add-speaker-row .ln{ display:none; }
  .add-speaker{ padding:0 14px; font-size:14px; }

  /* Playbar fixed to the bottom so controls are always visible after generating.
     Three clear rows: who/transport, waveform, then a full-width Download. The
     ±10s skip buttons add clutter for short clips (the waveform is tap-to-seek),
     so they're hidden on phones. `display:contents` lets .pb-right's children
     join the grid so Download can span full width. */
  .playbar{ position:fixed; left:0; right:0; bottom:0; z-index:70; padding:12px 14px 14px;
    column-gap:12px; row-gap:11px;
    grid-template-columns:auto 1fr auto;
    grid-template-areas:"left center close" "prog prog prog" "dl dl dl";
    border-radius:18px 18px 0 0; border-top:1px solid var(--border);
    background:rgba(255,255,255,.92); backdrop-filter:saturate(1.4) blur(12px); -webkit-backdrop-filter:saturate(1.4) blur(12px);
    box-shadow:0 -8px 28px rgba(0,0,0,.10); }
  .pb-center{ gap:14px; }
  .pb-center .skip-btn{ display:none; }         /* declutter: waveform is tap-to-seek */
  .play-main{ width:48px; height:48px; }
  .pb-progress{ padding:0; }
  .pb-right{ display:contents; }
  #pbClose{ grid-area:close; }
  .pb-dl{ grid-area:dl; width:100%; height:50px; font-size:16px; }
  body.has-playbar{ padding-bottom:196px; }     /* room so content isn't hidden behind the playbar */

  /* Live-chat bubble must clear the playbar (it was landing right on the
     controls). These are the same custom props Crisp's own offset uses. */
  body.has-playbar .crisp-client{ --crisp-customization-mobile-button-vertical:200px!important; }

  /* Modal full-width-ish. */
  .modal{ padding:28px 22px 22px; }
}

@media (max-width:420px){
  .speaker-text,.ph-overlay{ font-size:17px; }
  .pb-left .nm{ max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .play-main{ width:48px; height:48px; }
  .skip-btn{ width:34px; height:34px; }
}

/* ---------- HOMEPAGE MARKETING (scrollable content below the studio) ---------- */
/* NOTE: the home marketing block used to render below the studio here. It now
   lives on the lightweight home hub page (/{locale}/) — see
   frontend/assets/site.css + the buildHome* blocks in generate.mjs. The studio
   is a pure tool now, so those rules were removed from this stylesheet. */

/* ---------- VOICE LIBRARY (full-page browse view) ---------- */
/* min-height:0 lets this grid item bound to the viewport row so .lib-scroll can
   actually scroll (without it the row grows to content height and .layout's
   overflow:hidden clips it). grid-column spans the full width once the editor +
   settings panels are hidden in library mode. */
.library{ flex:1; min-width:0; min-height:0; display:none; flex-direction:column; grid-column:1 / -1; }
.lib-scroll{ flex:1; min-height:0; overflow-y:auto; padding:34px 40px 60px; }
.lib-inner{ max-width:1080px; margin:0 auto; }
.lib-head{ margin-bottom:22px; }
.lib-title{ font-size:30px; font-weight:800; letter-spacing:-.02em; }
.lib-sub{ font-size:15px; color:var(--text-2); margin-top:6px; max-width:640px; line-height:1.5; }

/* Promo cards -> Clone / Design */
.lib-promos{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:28px; }
.lib-promo{ display:flex; align-items:center; gap:15px; text-align:left; cursor:pointer; font-family:inherit;
  border:1px solid var(--border-2); border-radius:16px; padding:15px 18px; background:#fff; color:var(--text);
  transition:box-shadow .15s, transform .15s, border-color .15s; }
.lib-promo:hover{ transform:translateY(-2px); box-shadow:0 12px 30px rgba(20,14,45,.10); }
.lib-promo.clone{ background:linear-gradient(120deg,#fff6f4 0%,#eef3ff 100%); border-color:#e7e3fb; }
.lib-promo.design{ background:linear-gradient(120deg,#f0fdf4 0%,#fff7ed 100%); border-color:#dcefe0; }
.lib-promo.clone:hover{ border-color:#cfc7f5; }
.lib-promo.design:hover{ border-color:#bfe4c8; }
.lp-ico{ width:46px; height:46px; border-radius:13px; flex:none; display:grid; place-items:center; color:#fff; }
.lib-promo.clone .lp-ico{ background:linear-gradient(135deg,#9296e8,#b39ddb); box-shadow:0 6px 16px rgba(146,150,232,.35); }
.lib-promo.design .lp-ico{ background:linear-gradient(135deg,#72c978,#a5d6a7); box-shadow:0 6px 16px rgba(114,201,120,.35); }
.lp-txt{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.lp-t{ font-size:16px; font-weight:700; letter-spacing:-.01em; }
.lp-d{ font-size:13px; color:var(--text-2); line-height:1.45; }
.lp-arrow{ flex:none; color:var(--text-3); display:grid; place-items:center; }
.lib-promo:hover .lp-arrow{ color:#fc3e57; }

/* Tabs */
.lib-tabs{ display:flex; gap:24px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.lib-tab{ border:none; background:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600;
  color:var(--text-3); padding:0 0 12px; margin-bottom:-1px; border-bottom:2px solid transparent; }
.lib-tab:hover{ color:var(--text); }
.lib-tab.is-active{ color:var(--text); border-bottom-color:#fc3e57; }

/* Search + filters */
.lib-controls{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px; }
.lib-search{ position:relative; display:flex; align-items:center; flex:1 1 260px; min-width:220px; }
.lib-search .search-ico{ position:absolute; left:16px; color:var(--text-3); pointer-events:none; display: flex; align-items: center;}
.lib-search input{ flex:1; height:46px; border-radius:12px; border:1px solid var(--border-2); padding:0 16px 0 46px;
  font-size:15px; font-family:inherit; color:var(--text); outline:none; background:#fff; }
.lib-search input::placeholder{ color:var(--text-3); }
.lib-search input:focus{ border-color:#d1d5db; }
.lib-tool-btn{ display:inline-flex; align-items:center; gap:7px; height:46px; padding:0 16px; flex:none; cursor:pointer;
  border:1px solid var(--border-2); border-radius:12px; background:#fff; color:var(--text); font-family:inherit;
  font-size:14px; font-weight:600; transition:border-color .15s, background .15s; }
.lib-tool-btn:hover{ background:var(--hover); }
.lib-tool-btn.is-open{ border-color:#fc3e57; color:#e0468f; }
.lib-sort{ position:relative; display:flex; align-items:center; flex:none; }
.lib-sort > svg{ position:absolute; left:12px; color:var(--text-3); pointer-events:none; }
.lib-sort select{ height:46px; padding:0 34px 0 34px; border-radius:12px; border:1px solid var(--border-2); background:#fff;
  color:var(--text); font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; outline:none;
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px; }
.lib-sort select:hover{ background-color:var(--hover); }
.lib-filter-panel{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 14px; padding:12px; border:1px solid var(--border-2);
  border-radius:12px; background:#fbfafe; }
.lib-filter-panel .vp-filter{ flex:1 1 160px; }
.lib-filter-reset{ flex:none; margin-left:auto; height:36px; padding:0 14px; border-radius:10px;
  border:1px solid var(--border-2); background:#fff; color:var(--text-2); font-size:13px;
  font-weight:600; cursor:pointer; font-family:inherit; transition:background .12s, color .12s; }
.lib-filter-reset:hover{ background:var(--hover); color:var(--text); }
.lib-count{ font-size:13px; color:var(--text-3); margin:0 2px 16px; }

/* "•••" dropdown menu */
.ov-menu{ position:fixed; z-index:3000; min-width:172px; background:#fff; border:1px solid var(--border-2);
  border-radius:12px; box-shadow:0 16px 40px rgba(20,14,45,.18); padding:6px; animation:vppop .14s ease; }
.ov-menu-item{ display:flex; align-items:center; gap:9px; width:100%; text-align:left; border:none; background:none;
  cursor:pointer; font-family:inherit; font-size:14px; font-weight:600; color:var(--text); padding:9px 10px; border-radius:8px; }
.ov-menu-item:hover{ background:var(--hover); }
.ov-menu-item.danger{ color:#dc2626; }
.ov-menu-item.danger:hover{ background:#fef2f2; }
.ov-menu-item svg{ flex:none; width:16px; height:16px; }

.lib-grid{ display:block; }
.lib-empty{ text-align:center; color:var(--text-3); font-size:15px; padding:40px 12px;
  border:1px dashed var(--border-2); border-radius:16px; background:#fff; cursor:pointer; font-family:inherit; width:100%; }
.lib-empty:hover{ background:var(--hover); }

/* Library pagination */
.lib-pagination{ padding:20px 0 8px; display:flex; justify-content:center; }

/* Library loading skeleton */
.lib-skel-count{ display:inline-block; width:100px; height:16px; border-radius:8px;
  background:linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size:200% 100%; animation:lib-shimmer 1.4s ease-in-out infinite; }
.lib-loading{ display:flex; flex-direction:column; gap:18px; }
.lib-skel-featured{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.lib-skel-card{ aspect-ratio:4/3.15; border-radius:16px; background:linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size:200% 100%; animation:lib-shimmer 1.4s ease-in-out infinite; }
.lib-skel-bars{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.lib-skel-row{ height:72px; border-radius:14px; background:linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size:200% 100%; animation:lib-shimmer 1.4s ease-in-out infinite; }
@keyframes lib-shimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }
@media(max-width:960px){ .lib-skel-featured{ grid-template-columns:1fr 1fr; } }
@media(max-width:520px){ .lib-skel-featured{ grid-template-columns:1fr; } .lib-skel-bars{ grid-template-columns:1fr; } }
.pagination{ display:flex; align-items:center; gap:4px; }
.pg-btn{ min-width:36px; height:36px; border:1px solid var(--border-2); border-radius:10px; background:#fff;
  color:var(--text); font-size:14px; font-weight:600; cursor:pointer; font-family:inherit;
  display:inline-flex; align-items:center; justify-content:center; transition:background .12s, border-color .12s; }
.pg-btn:hover:not(:disabled){ background:var(--hover); border-color:#ddd; }
.pg-btn:disabled{ opacity:.35; cursor:default; }
.pg-btn.active{ background:var(--black); color:#fff; border-color:var(--black); }
.pg-prev,.pg-next{ font-size:20px; font-weight:400; }
.pg-dots{ width:28px; text-align:center; color:var(--text-3); font-size:16px; }
.pg-goto{ margin-left:auto; }
.pg-goto-select{ height:36px; border:1px solid var(--border-2); border-radius:10px; background:#fff; padding:0 10px;
  font-family:inherit; font-size:13px; font-weight:600; color:var(--text); cursor:pointer;
  -webkit-appearance:none; appearance:none; padding-right:24px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 8px center; }
.pg-goto-select:focus{ outline:none; border-color:#fe655d; }

/* Featured cards: big portrait with overlaid name + tags (SAYVOICE-style) */
.lib-featured{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.vfeat{ position:relative; aspect-ratio:4/3.15; border-radius:16px; overflow:hidden; cursor:pointer;
  background:#e9e7f2 center/cover no-repeat; box-shadow:0 6px 20px rgba(20,14,45,.14); }
.vfeat:focus-visible{ outline:2px solid var(--accent,#4f46e5); outline-offset:2px; }
.vfeat.selected{ outline:2px solid #fc3e57; outline-offset:-2px; }
.vfeat.fav{ outline:2px solid #fc3e57; outline-offset:-2px; }
.vfeat.fav::before{ content:"\2605"; position:absolute; top:10px; left:10px; z-index:4;
  width:24px; height:24px; display:grid; place-items:center; border-radius:50%;
  background:rgba(252,62,87,.9); color:#fff; font-size:12px; line-height:1; }
.vfeat.playing{ overflow:visible; outline:none; box-shadow:none; }
.vfeat.playing::before{ content:""; position:absolute; inset:-3px; border-radius:19px; z-index:-1;
  background:conic-gradient(from var(--spin-angle,0deg), #fc3e57, transparent 40%, transparent 60%, #fc3e57);
  animation:poster-spin 1s linear infinite; }
.vf-video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; opacity:0;
  transition:opacity .25s ease; pointer-events:none; }
.vfeat:hover .vf-video, .vfeat:focus-within .vf-video, .vfeat.playing .vf-video{ opacity:1; }
.vf-shade{ position:absolute; inset:0; z-index:1; border-radius:16px;
  background:linear-gradient(to top, rgba(10,8,25,.82) 0%, rgba(10,8,25,.30) 46%, rgba(10,8,25,0) 74%); }
.vfeat::after{ content:""; position:absolute; inset:0; z-index:1; border-radius:16px; background:rgba(10,8,25,.25);
  opacity:0; transition:opacity .2s ease; pointer-events:none; }
.vfeat:hover::after, .vfeat.playing::after{ opacity:1; }
.vf-top{ position:absolute; top:10px; right:10px; left:10px; z-index:3; display:flex; align-items:center;
  justify-content:flex-end; gap:8px; opacity:0; transform:translateY(-4px); transition:opacity .16s, transform .16s; }
.vfeat:hover .vf-top, .vfeat:focus-within .vf-top, .vfeat.playing .vf-top{ opacity:1; transform:none; }
.vf-use{ height:32px; padding:0 15px; border:none; border-radius:9px; cursor:pointer; font-family:inherit;
  font-size:13px; font-weight:700; color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); }
.vf-use:hover{ filter:brightness(1.04); }
.vf-fav{ width:32px; height:32px; border:none; border-radius:9px; cursor:pointer; color:#fff; font-size:16px;
  background:rgba(255,255,255,.24); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); display:grid; place-items:center; }
.vf-fav:hover{ background:rgba(255,255,255,.38); }
.vf-fav.on{ color:#f59e0b; }
.vf-menu{ width:32px; height:32px; border:none; border-radius:9px; cursor:pointer; color:#fff;
  background:rgba(255,255,255,.24); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); display:grid; place-items:center; }
.vf-menu:hover{ background:rgba(255,255,255,.38); }
.vf-play{ position:absolute; top:44%; left:50%; z-index:3; transform:translate(-50%,-50%) scale(.85);
  width:52px; height:52px; border-radius:50%; background:rgba(255,255,255,.92); color:#111; cursor:pointer;
  display:grid; place-items:center; opacity:0; transition:opacity .16s, transform .16s; box-shadow:0 6px 18px rgba(0,0,0,.25); }
.vfeat:hover .vf-play, .vfeat.playing .vf-play{ opacity:1; transform:translate(-50%,-50%) scale(1); }
.vfeat.playing .vf-play{ background:rgba(255,255,255,.92); color:#fc3e57; }
.vf-play svg{ width:22px; height:22px; }
.vf-info{ position:absolute; left:14px; right:14px; bottom:12px; z-index:2; color:#fff; }
.vf-name{ font-size:15px; font-weight:700; letter-spacing:-.01em; text-shadow:0 1px 6px rgba(0,0,0,.4); margin-bottom:6px; }
.vf-tags{ display:flex; flex-wrap:wrap; gap:4px; max-height:44px; overflow:hidden; }
.vf-tags .vt{ font-size:11px; font-weight:600; color:#fff; background:rgba(255,255,255,.22); border-radius:6px;
  padding:2px 7px; -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }

/* Compact bar rows: small poster + name + inline tags + Use */
.lib-bars{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px 14px; }
.lib-group-head{ grid-column:1/-1; font-size:13px; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  color:var(--text-3); margin:14px 2px 2px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.lib-group-head:first-child{ margin-top:0; }
.vbar{ display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--border-2); border-radius:14px;
  cursor:pointer; background:#fff; transition:border-color .15s, box-shadow .15s; }
.vbar:hover{ border-color:#f3d4e0; box-shadow:0 6px 18px rgba(20,14,45,.07); }
.vbar.selected{ border-color:#fc3e57; box-shadow:0 0 0 1px rgba(252,62,87,.3); }
.vbar.fav{ background:#fff8f8; border-color:#ffd7d3; }
.vb-poster-wrap{ position:relative; flex:none; padding:3px; border-radius:14px; }
.vbar.playing .vb-poster-wrap{
  background:conic-gradient(from var(--spin-angle,0deg), #fc3e57, transparent 40%, transparent 60%, #fc3e57);
  animation:poster-spin 1s linear infinite; }
@property --spin-angle{ syntax:"<angle>"; initial-value:0deg; inherits:false; }
@keyframes poster-spin{ to{ --spin-angle:360deg; } }
.vbar.playing .vb-poster{ border-radius:11px; }
.vb-fav-star{ position:absolute; top:-4px; right:-4px; width:18px; height:18px;
  display:grid; place-items:center; border-radius:50%; background:#fc3e57;
  color:#fff; font-size:10px; line-height:1; z-index:2; }
.vbar:focus-visible{ outline:2px solid var(--accent,#4f46e5); outline-offset:2px; }
.vb-poster{ position:relative; width:52px; height:52px; border-radius:11px; flex:none; overflow:hidden; background:#e9e7f2; }
.vb-play{ position:absolute; inset:0; display:grid; place-items:center; color:#fff; background:rgba(10,8,25,.30);
  opacity:1; transition:opacity .15s, background .15s; cursor:pointer; }
.vbar.playing .vb-play{ color:#fff; background:rgba(254,101,93,.85); }
.vbar.playing .vb-play svg{ filter:none; position:relative; z-index:2; }
.vb-play svg{ filter:drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.vbar:hover .vb-play{ background:rgba(10,8,25,.45); }
.vb-info{ flex:1; min-width:0; }
.vb-name{ font-size:14px; font-weight:700; letter-spacing:-.01em; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; display:flex; align-items:center; gap:5px; }
.vb-tags{ display:flex; gap:4px; margin-top:5px; overflow:hidden; flex-wrap:nowrap;
  -webkit-mask-image:linear-gradient(90deg,#000 84%,transparent); mask-image:linear-gradient(90deg,#000 84%,transparent); }
.vb-tags .vt{ font-size:11px; font-weight:600; color:var(--text-2); background:#f5f3fb; border-radius:6px;
  padding:2px 7px; white-space:nowrap; flex:none; }
.vb-tools{ display:flex; align-items:center; gap:6px; flex:none; }
.vb-menu{ width:30px; height:30px; border:none; background:none; border-radius:8px; cursor:pointer; color:var(--text-3);
  display:grid; place-items:center; }
.vb-menu:hover{ background:var(--hover); color:var(--text); }
/* Dark "Use" button (SAYVOICE sayvoice-dark-btn), revealed on hover/focus. */
.vb-use{ height:32px; padding:0 16px; border:none; background:#111114; border-radius:9px; cursor:pointer;
  font-family:inherit; font-size:13px; font-weight:700; color:#fff; opacity:0; transform:translateX(4px);
  transition:opacity .15s, transform .15s, background .15s; }
.vb-use:hover{ background:#000; }
.vbar:hover .vb-use, .vbar:focus-within .vb-use{ opacity:1; transform:none; }
@media (hover:none){ .vb-use{ opacity:1; transform:none; } }

@media (max-width:960px){
  .lib-featured{ grid-template-columns:1fr 1fr; }
  .lib-bars{ grid-template-columns:1fr; }
}
@media (max-width:900px){
  .lib-scroll{ padding:22px 18px 50px; }
  .lib-promos{ grid-template-columns:1fr; }
  .lib-title{ font-size:24px; }
}
@media (max-width:560px){
  .lib-featured{ grid-template-columns:1fr; }
}

/* ---------- VOICE CLONE: create-a-voice card ---------- */
.clone-hero{ display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.clone-face{ width:48px; height:48px; border-radius:50%; flex:none;
  background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:0 6px 18px rgba(252,62,87,.32); }
.clone-title{ font-size:18px; font-weight:700; letter-spacing:-.01em; color:var(--text); }
.clone-sub{ font-size:13.5px; line-height:1.5; color:var(--text-2); margin-top:3px; }

.clone-tabs{ display:flex; gap:6px; background:#fff1ef; border-radius:12px; padding:4px; margin-bottom:16px; }
.clone-tab{ flex:1; height:38px; border:none; border-radius:9px; background:none; cursor:pointer;
  font-family:inherit; font-size:14px; font-weight:600; color:var(--text-2); transition:background .15s,color .15s; }
.clone-tab:hover{ color:var(--text); }
.clone-tab.active{ background:#fff; color:var(--text); box-shadow:0 1px 4px rgba(0,0,0,.08); }

.clone-pane{ margin-bottom:6px; }

/* Record pane */
.rec-guide{ border:1px dashed #e2d8f6; background:#fff6f4; border-radius:14px; padding:14px 16px; margin-bottom:16px; }
.rec-guide-label{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:#9333ea; }
.rec-guide-text{ font-size:16px; line-height:1.5; color:var(--text); margin-top:6px; }
.rec-controls{ display:flex; align-items:center; gap:16px; }
.rec-btn{ display:inline-flex; align-items:center; gap:10px; height:40px; padding:0 18px; border-radius:10px;
  border:none; cursor:pointer; font-family:inherit; font-size:14px; font-weight:600; color:#fff;
  background:#fe655d; transition:background .15s; }
.rec-btn:hover{ background:#fc3e57; }
.rec-btn .rec-dot{ width:11px; height:11px; border-radius:50%; background:#fff; flex:none; }
.rec-btn.recording{ background:#e11d48; }
.rec-btn.recording:hover{ background:#be123c; }
.rec-btn.recording .rec-dot{ animation:rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse{ 0%,100%{ opacity:1; transform:scale(1) } 50%{ opacity:.35; transform:scale(.8) } }
@media (prefers-reduced-motion:reduce){ .rec-btn.recording .rec-dot{ animation:none } }
.rec-timer{ font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text-2); }
.rec-playback{ width:100%; margin-top:14px; }

/* Status / validation feedback (cute) */
.clone-status{ display:flex; align-items:center; gap:10px; border-radius:14px; padding:13px 15px;
  font-size:14px; line-height:1.5; height:66px; margin-top: 20px; }
.clone-status .cs-ico{ flex:none; font-size:18px; line-height:1.4; }
.clone-status.info{ background:#fff1ef; color:#5b3da8; }
.clone-status.ok{ background:#e8f9f0; color:#0f7a52; }
.clone-status.warn{ background:#fff3e6; color:#a5560b; }
.clone-status.err{ background:#fdecef; color:#b4123f; }
.clone-status.busy{ background:#fff1ef; color:#5b3da8; }
.clone-status .cs-spin{ width:17px; height:17px; border-radius:50%; flex:none; margin-top:1px;
  border:2px solid #d9ccf3; border-top-color:#9333ea; animation:spin 1s linear infinite; }

.clone-save-btn{ width:100%; height:50px; margin-top:16px; border:none; border-radius:14px; cursor:pointer;
  font-family:inherit; font-size:15px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:0 10px 26px rgba(252,62,87,.30); transition:transform .15s, box-shadow .15s, opacity .15s; }
.clone-save-btn:hover{ transform:translateY(-1px); box-shadow:0 14px 32px rgba(252,62,87,.4); }
.clone-save-btn:disabled{ opacity:.55; cursor:default; transform:none; box-shadow:none; }
.clone-hint{ font-size:12.5px; line-height:1.5; color:var(--text-3); text-align:center; margin-top:12px; }

/* Clone/Design own the full editor width when Settings is hidden. */
.vc, .vd{ }
.myvoices{ }

/* ============ VOICE CLONE WIZARD (Add Voice → Preview → Save) ============ */
.vc{ border:1px solid var(--border-2); border-radius:18px; background:#fff; padding:22px 24px 24px; margin-top:6px; }
.vc-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.vc-category{ font-size:20px; font-weight:800; letter-spacing:-.02em; color:var(--text); }
.vc-privacy{ font-size:12px; font-weight:600; color:#e0463c; background:#fff1ef; border:1px solid #ffd8d3;
  border-radius:999px; padding:6px 12px; white-space:nowrap; }

/* Stepper */
.vc-steps{ display:flex; align-items:center; list-style:none; margin:0 0 24px; padding:0; }
.vc-step{ display:flex; align-items:center; gap:10px; }
.vc-step-num{ width:30px; height:30px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:700; color:var(--text-3); background:#f0f1f4; border:1px solid var(--border-2); transition:.2s; }
.vc-step-title{ font-size:14px; font-weight:600; color:var(--text-3); transition:.2s; white-space:nowrap; }
.vc-step.is-active .vc-step-num{ background:linear-gradient(135deg,#fe655d,#fc3e57); color:#fff; border-color:transparent;
  box-shadow:0 6px 16px rgba(252,62,87,.32); }
.vc-step.is-active .vc-step-title{ color:var(--text); }
.vc-step.is-done .vc-step-num{ background:#ffe1dd; color:#fe655d; border-color:#ddd6fe; }
.vc-step.is-done .vc-step-title{ color:var(--text-2); }
.vc-step-line{ flex:1; height:2px; background:var(--border-2); margin:0 12px; border-radius:2px; }

.vc-pane-title{ font-size:15px; font-weight:700; color:var(--text); margin:0 0 12px; }
.vc-hint-line{ font-size:13px; line-height:1.5; color:var(--text-3); margin:-6px 0 12px; }

/* --- Step 1: source picker --- */
.vc-sources{ display:flex; align-items:stretch; gap:14px; }
.vc-source{ flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center;
  border:2px dashed #d8d5e4; border-radius:16px; background:#fafbfc; padding:26px 18px; cursor:pointer;
  font-family:inherit; transition:border-color .15s, background .15s, transform .15s; }
.vc-source:hover{ border-color:#fe655d; background:#fff6f4; transform:translateY(-1px); }
.vc-source.drag{ border-color:#fe655d; background:#ffece9; }
.vc-source-ico{ display:flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%;
  color:#fe655d; background:#fff1ef; margin-bottom:4px; }
.vc-source-ico-rec{ color:#db2777; background:#fdf2f8; }
.vc-source-title{ font-size:15px; font-weight:700; color:var(--text); letter-spacing:-.01em; }
.vc-source-desc{ font-size:12.5px; color:var(--text-3); }
.vc-tags{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px; margin-top:8px; }
.vc-tag{ font-size:11px; font-weight:600; color:var(--text-2); background:#fff; border:1px solid var(--border-2);
  border-radius:7px; padding:3px 8px; }
.vc-tag-more{ font-size:11.5px; color:var(--text-3); }
.vc-or{ display:flex; align-items:center; font-size:12px; font-weight:700; color:var(--text-3); }

/* --- Record panel --- */
.vc-record{ border:1px solid var(--border-2); border-radius:16px; background:#fafbfc; padding:20px; margin-top:24px; text-align:center; }
.vc-rec-tip{ font-size:13px; color:var(--text-3); margin:0 0 10px; }
.vc-rec-text{ font-size:17px; line-height:1.55; font-weight:600; color:var(--text); margin:0 auto 16px; max-width:520px; }
.vc-rec-meter{ display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:18px;
  padding:14px 20px; border-radius:14px; background:#fafbfc; border:1px solid var(--border-2); }
.vc-rec-timer{ font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text);
  background:#fff; border:1px solid var(--border-2); border-radius:8px; padding:6px 12px; min-width:56px; text-align:center; }
.waveform-live{ height:52px; }
.waveform-live .wbar{ background:#f472b6; transition:height .15s ease; }
.waveform-live .wbar.on{ background:#ec4899; }
.vc-rec-controls{ display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.vc-rec-change{ display:inline-flex; align-items:center; gap:7px; height:40px; padding:0 18px; border-radius:10px;
  border:1px solid var(--border-2); background:#fff; cursor:pointer; font-family:inherit; font-size:14px;
  font-weight:600; color:var(--text); transition:background .15s; }
.vc-rec-change:hover{ background:var(--hover); }
.vc-rec-rule{ font-size:12px; color:var(--text-3); margin:16px 0 0; }
.vc-consent{ font-size:12px; line-height:1.5; color:var(--text-3); margin:14px 0 0; text-align:center;
  display:flex; align-items:flex-start; gap:10px; text-align:left; }
.vc-consent a{ color:#e0463c; text-decoration:underline; white-space:nowrap; }
.vc-consent input[type="checkbox"]{ width:18px; height:18px; flex:none; margin-top:1px; cursor:pointer;
  accent-color:#fe655d; border-radius:4px; appearance:none; -webkit-appearance:none;
  border:2px solid #d1d5db; background:#fff; display:inline-grid; place-content:center; }
.vc-consent input[type="checkbox"]:checked{ background:#fe655d; border-color:#fe655d; }
.vc-consent input[type="checkbox"]:checked::before{ content:""; width:10px; height:10px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat; }
.vc-data-notice{ font-size:12px; line-height:1.5; color:var(--text-3); margin:14px 0 0;}
.vc-data-notice a{ color:#e0463c; text-decoration:underline; white-space:nowrap; }
.vc-rec-subtitle{ font-size:13.5px; font-weight:700; color:var(--text); margin:18px 0 10px; }
.vc-tips{ list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:10px 18px; margin:0; padding:0; }
.vc-tip{ font-size:13px; color:var(--text-2); }

/* --- Chosen clip / mini players --- */
.vc-clip{ margin-top:24px; border:1px solid var(--border-2); border-radius:16px; padding:16px 18px;
  background:#fafbfc; }
.vc-clip-name{ font-size:13px; color:var(--text-2); margin:0 0 10px; word-break:break-word; }
.vc-clip.is-busy .vc-player{ pointer-events:none; opacity:.5; }
#cloneStep2.is-busy textarea,
#cloneStep2.is-busy input,
#cloneStep2.is-busy button:not(.vc-btn-ghost),
#cloneStep2.is-busy .vc-player{ pointer-events:none; opacity:.5; }
.vc-player{ display:flex; align-items:center; gap:12px; border:1px solid var(--border-2); border-radius:14px;
  background:#fafbfc; padding:12px 16px; }
.vc-play-btn{ display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:50%;
  flex:none; border:none; cursor:pointer; color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57);
  box-shadow:0 6px 16px rgba(252,62,87,.30); }
.vc-play-btn:hover{ filter:brightness(1.05); }
.vc-time{ font-size:12.5px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text-2); min-width:42px; }
.vc-time-dur{ color:var(--text-3); text-align:right; }
.vc-bar{ flex:1; height:6px; border-radius:6px; background:#e5e7eb; cursor:pointer; position:relative; }
.vc-bar-fill{ position:absolute; left:0; top:0; bottom:0; width:0%; border-radius:6px;
  background:linear-gradient(90deg,#fe655d,#fc3e57); }

/* --- Step 2: transcript + listen --- */
.vc-transcript{ width:100%; min-height:80px; border-radius:12px; border:1px solid var(--border-2); padding:12px 16px;
  font-size:15px; font-family:inherit; color:var(--text); outline:none; margin-bottom:12px; resize:vertical;
  line-height:1.5; }
.vc-transcript:focus{ border-color:#fe655d; }
.vc-listen{ margin-top:24px; }
.vc-listen-text{ width:100%; min-height:88px; border-radius:12px; border:1px solid var(--border-2); padding:12px 16px;
  font-size:15px; line-height:1.5; font-family:inherit; color:var(--text); resize:vertical; outline:none; }
.vc-listen-text:focus{ border-color:#fe655d; }
.vc-listen-actions{ display:flex; align-items:center; gap:10px; margin-top:12px; }
.vc-player-listen{ margin-top:14px; }

/* --- Step 3: save form --- */
.vc-save{ display:flex; gap:22px; align-items:flex-start; }
.vc-poster{ flex:none; width:150px; height:150px; border-radius:18px; overflow:hidden; position:relative;
  background:linear-gradient(135deg,#ffe1dd,#ffe6e2); display:flex; align-items:center; justify-content:center; }
.vc-poster-orb{ width:88px; height:88px; border-radius:50%; background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:inset 0 0 0 3px rgba(255,255,255,.35), 0 8px 22px rgba(252,62,87,.3); background-size:cover; background-position:center; }
.vc-form{ flex:1; min-width:0; display:flex; flex-direction:column; gap:16px; }
.vc-field{ display:flex; flex-direction:column; gap:7px; }
.vc-field-label{ font-size:13.5px; font-weight:700; color:var(--text); }
.vc-req{ color:#e11d48; }
.vc-input{ width:100%; height:46px; border-radius:12px; border:1px solid var(--border-2); padding:0 16px;
  font-size:15px; font-family:inherit; color:var(--text); outline:none; }
.vc-input:focus{ border-color:#fe655d; }
.vc-textarea{ height:auto; min-height:80px; padding:12px 16px; line-height:1.5; resize:vertical; }
.vc-selects{ display:flex; gap:10px; }
.vc-select{ flex:1; height:44px; border-radius:12px; border:1px solid var(--border-2); background-color:#fff;
  padding:0 34px 0 14px; font-size:14px; font-family:inherit; color:var(--text); cursor:pointer; outline:none;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; }
.vc-select:focus{ border-color:#fe655d; }
.vc-consent{ display:flex; align-items:flex-start; gap:10px; font-size:12.5px; line-height:1.55; color:var(--text-2); cursor:pointer; }
.vc-consent input{ margin-top:2px; flex:none; width:16px; height:16px; accent-color:#fe655d; }

/* --- Action buttons --- */
.vc-actions{ display:flex; gap:12px; margin-top:22px; }
.vc-btn{ flex:1; height:48px; border-radius:13px; border:none; cursor:pointer; font-family:inherit;
  font-size:15px; font-weight:700; transition:transform .15s, box-shadow .15s, opacity .15s, background .15s; }
.vc-btn:disabled{ opacity:.55; cursor:default; transform:none; box-shadow:none; }
.vc-btn-ghost{ background:#fff; border:1px solid var(--border-2); color:var(--text); }
.vc-btn-ghost:hover{ background:var(--hover); }
.vc-btn-primary{ color:#fff; background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:0 10px 26px rgba(252,62,87,.30); }
.vc-btn-primary:hover:not(:disabled){ transform:translateY(-1px); box-shadow:0 14px 32px rgba(252,62,87,.4); }
.vc-btn-dark{ flex:none; padding:0 26px; height:40px; border-radius:10px; background:#111; color:#fff; }
.vc-btn-dark:hover:not(:disabled){ background:#000; }
.vc-btn-dark.is-loading{ opacity:.7; cursor:default; }

@media (max-width:680px){
  .vc-sources{ flex-direction:column; }
  .vc-or{ justify-content:center; }
  .vc-save{ flex-direction:column; align-items:center; }
  .vc-poster{ width:130px; height:130px; }
}

/* ================= VOICE DESIGN (describe-a-voice + gallery) ============== */
.vd-header{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.vd-header-left{ flex:1; min-width:0; }
.vd-category{ font-size:20px; font-weight:800; letter-spacing:-.02em; color:var(--text); }
.vd-subtitle{ font-size:13.5px; line-height:1.55; color:var(--text-2); margin-top:6px; max-width:640px; }
.vd-design-cta{ flex:none; white-space:nowrap; height:44px; padding:0 22px; border-radius:12px; border:none;
  cursor:pointer; font-family:inherit; font-size:14px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:0 8px 20px rgba(252,62,87,.3); transition:transform .15s, box-shadow .15s; }
.vd-design-cta:hover{ transform:translateY(-1px); box-shadow:0 12px 28px rgba(252,62,87,.4); }

/* Attribute builder (valid model tags only) */
.vd-builder{ display:flex; flex-direction:column; gap:14px; border:1px solid var(--border-2); border-radius:16px;
  background:#fafbfc; padding:16px 18px; }
.vd-group{ display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; }
.vd-group-label{ flex:0 0 84px; font-size:13px; font-weight:700; color:var(--text-2); }
.vd-chips{ display:flex; flex-wrap:wrap; gap:8px; flex:1; min-width:0; }
.vd-chip{ height:34px; padding:0 14px; border-radius:999px; border:1px solid var(--border-2); background:#fff;
  cursor:pointer; font-family:inherit; font-size:13.5px; font-weight:600; color:var(--text-2);
  transition:border-color .15s, background .15s, color .15s; }
.vd-chip:hover{ border-color:#fe655d; color:var(--text); }
.vd-chip.is-on{ background:linear-gradient(135deg,#fe655d,#fc3e57); border-color:transparent; color:#fff;
  box-shadow:0 4px 12px rgba(252,62,87,.28); }

/* Composed "voice recipe" + on-demand preview */
.vd-recipe{ margin-top:16px; border:1px solid var(--border-2); border-radius:16px; background:#fff; padding:16px 18px; }
.vd-recipe-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.vd-recipe-label{ font-size:13px; font-weight:700; color:var(--text); }
.vd-recipe-clear{ display:inline-flex; align-items:center; gap:4px; border:none; background:none; cursor:pointer;
  font-family:inherit; font-size:12.5px; font-weight:600; color:var(--text-3); padding:4px 8px; border-radius:6px; }
.vd-recipe-clear:hover{ color:#e11d48; background:#fef2f2; }
.vd-recipe-val{ font-size:15px; font-weight:600; color:#e0463c; line-height:1.5; word-break:break-word; margin:0; }
.vd-recipe-val.is-empty{ color:var(--text-3); font-weight:500; }
.vd-listen-row{ display:flex; align-items:center; gap:12px; margin-top:12px; flex-wrap:wrap;
  padding-top:16px; border-top:1px solid var(--border); }
.vd-listen-player{ flex:1; min-width:220px; }
.vd-result-box{ margin-top:14px; border:2px dashed #d8d5e4; border-radius:16px; padding:20px 16px;
  background:#fafbfc; display:flex; flex-direction:column; gap:0; }
.vd-player-wrap{ margin-top:12px; padding-top:12px; border-top:1px solid var(--border); display:none; }

/* Presets */
.vd-templates{ margin-top:22px; }
/* When templates lead the panel (easiest entry point), give them a little air. */
.vd-templates-top{ margin-top:18px; }
.vd-tpl-title{ font-size:15px; font-weight:700; color:var(--text); margin:0 0 12px; }
/* "Or build your own" divider between templates and the manual builder. */
.vd-or-build{ display:flex; align-items:center; gap:12px; margin:26px 0 14px; font-size:14px;
  font-weight:600; color:var(--text-2); }
.vd-or-build::before,.vd-or-build::after{ content:""; flex:1; height:1px; background:var(--border); }
/* Image gallery cards (local sayvoice art + model-generated preview clip) */
.vd-tpl-list{ list-style:none; margin:0; padding:0; display:grid; gap:12px;
  grid-template-columns:repeat(4, minmax(150px, 1fr)); }
.vd-tpl-pagination{ padding:16px 0 0; display:flex; justify-content:center; }
.vd-tpl{ position:relative; aspect-ratio:4/5; border-radius:17px; overflow:hidden; cursor:pointer;
  padding:3px; transition:transform .15s, box-shadow .15s; }
.vd-tpl-bg{ position:absolute; inset:3px; border-radius:14px; overflow:hidden;
  background:#e5e7eb center/cover no-repeat; box-shadow:inset 0 -60px 60px -20px rgba(0,0,0,.72); }
.vd-tpl:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(20,16,50,.22); }
.vd-tpl.is-selected{ outline:3px solid #fe655d; outline-offset:2px; }
.vd-tpl.is-selected .vd-tpl-try{ background:linear-gradient(135deg,#fe655d,#fc3e57); color:#fff; }
.vd-tpl-bg::after{ content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.62) 100%); }
.vd-tpl-play{ position:absolute; top:10px; right:10px; z-index:2; width:34px; height:34px; border-radius:50%;
  border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#fff;
  background:rgba(0,0,0,.45); backdrop-filter:blur(4px); transition:background .15s, transform .15s; }
.vd-tpl-play:hover{ background:rgba(0,0,0,.7); transform:scale(1.06); }
.vd-tpl-play.is-playing{ background:linear-gradient(135deg,#fe655d,#fc3e57); }
.vd-tpl.is-playing{
  background:conic-gradient(from var(--spin-angle,0deg), #fc3e57, transparent 40%, transparent 60%, #fc3e57);
  animation:poster-spin 1s linear infinite; }
.vd-tpl-body{ position:absolute; left:0; right:0; bottom:0; z-index:2; padding:12px; display:flex;
  flex-direction:column; gap:8px; }
.vd-tpl-name{ font-size:14px; font-weight:700; letter-spacing:-.01em; color:#fff; line-height:1.25;
  text-shadow:0 1px 4px rgba(0,0,0,.5); }
.vd-tpl-try{ display:inline-flex; align-items:center; gap:4px; align-self:flex-start; height:30px; padding:0 12px;
  border-radius:999px; border:none; cursor:pointer; font-family:inherit; font-size:12.5px; font-weight:700;
  color:var(--text); background:rgba(255,255,255,.94); opacity:0; transform:translateY(4px);
  transition:background .15s, opacity .15s, transform .15s; }
.vd-tpl-try:hover{ background:#fff; }
/* Save button only appears on hover/focus — keeps the gallery clean. */
.vd-tpl:hover .vd-tpl-try, .vd-tpl:focus-within .vd-tpl-try{ opacity:1; transform:translateY(0); }
@media (hover: none){ .vd-tpl-try{ opacity:1; transform:none; } }  /* touch: always visible */

/* Saving spinner overlay on the card */
.vd-tpl-loading{ display:none; position:absolute; inset:0; z-index:5; background:rgba(0,0,0,.5); }
.vd-tpl-loading::after{ content:""; position:absolute; top:50%; left:50%; width:26px; height:26px;
  margin:-13px 0 0 -13px; border-radius:50%; border:3px solid rgba(255,255,255,.45); border-top-color:#fff;
  animation:spin 1s linear infinite; }
.vd-tpl.is-saving{ pointer-events:none; }
.vd-tpl.is-saving .vd-tpl-loading{ display:block; }

/* Save-modal avatar chooser */
.vd-save-avatar{ display:flex; align-items:center; gap:14px; margin:4px 0 16px; }
.vd-save-avatar .vc-poster-orb{ width:56px; height:56px; }

/* designSaveStatus overrides */
#designSaveStatus{ height:auto; margin-top:14px; }

/* Voice details plain text */
.vd-save-details{ font-size:14px; font-weight:600; color:var(--text); margin:0; padding:10px 14px;
  background:var(--hover); border-radius:10px; line-height:1.5; }

/* Invalid input highlight */
.vc-input.is-invalid{ border-color:#dc2626; box-shadow:0 0 0 3px rgba(220,38,38,.12); }
.vd-avatar-shuffle{ display:inline-flex; align-items:center; gap:7px; height:36px; padding:0 14px; border-radius:10px;
  border:1px solid var(--border-2); background:#fff; cursor:pointer; font-family:inherit; font-size:13px;
  font-weight:600; color:var(--text-2); transition:background .15s, color .15s; }
.vd-avatar-shuffle:hover{ background:var(--hover); color:var(--text); }
.vd-preset-list{ list-style:none; margin:0; padding:0; display:grid; gap:10px;
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }
.vd-preset{ display:flex; align-items:center; gap:12px; border:1px solid var(--border-2); border-radius:14px;
  background:#fff; padding:12px 14px; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; }
.vd-preset:hover{ border-color:#e7dbf7; box-shadow:0 6px 18px rgba(254,101,93,.14); transform:translateY(-1px); }
.vd-preset-orb{ width:40px; height:40px; border-radius:50%; flex:none; background-size:cover; background-position:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22), 0 1px 4px rgba(0,0,0,.16); }
.vd-preset-body{ min-width:0; }
.vd-preset-name{ font-size:14px; font-weight:700; color:var(--text); letter-spacing:-.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vd-preset-tags{ font-size:12px; color:var(--text-3); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Buttons */
.vd-btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; height:44px; padding:0 22px;
  border-radius:12px; border:none; cursor:pointer; font-family:inherit;
  font-size:14px; font-weight:700; transition:transform .15s, opacity .15s, background .15s; }
.vd-btn:disabled{ opacity:.55; cursor:default; }
.vd-btn-dark{ background:#111; color:#fff; flex:none; }
.vd-btn-dark:hover:not(:disabled){ background:#000; }
.vd-btn-dark.is-loading{ opacity:.7; cursor:default; }

/* ---------- VOICE PICKER: "My Voices" group + items ---------- */
.vp-group{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-3); padding:14px 12px 6px; }
.vp-group:first-child{ padding-top:4px; }
.voice-item .vi-badge.mine{ color:#9333ea; font-size:11px; font-weight:700; border:1px solid #ffd8d3;
  border-radius:6px; padding:1px 6px; margin-left:6px; vertical-align:middle; text-transform:none; }
.voice-item .vi-del{ width:32px; height:32px; border-radius:8px; border:none; background:none; flex:none;
  cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text-3); }
.voice-item .vi-del:hover{ background:#fdecec; color:#e11d48; }
.voice-item.local .vi-avatar .av{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22), 0 0 0 2px #fc3e57aa; }

/* ---------- VOICE CLONE: "My Voices" manager (list + rename/delete) ---------- */
.myvoices{ margin-top:22px; }
.myvoices-page{ }
.myvoices-page-header{ margin-bottom:16px; }
.myvoices-page-title{ font-size:20px; font-weight:800; letter-spacing:-.02em; color:var(--text); margin:0; }
.myvoices-tabs{ display:flex; gap:4px; margin-bottom:14px; border-bottom:1px solid var(--border); padding-bottom:0; }
.myvoices-tab{ position:relative; padding:10px 16px; border:none; background:none; cursor:pointer; font-family:inherit;
  font-size:14px; font-weight:600; color:var(--text-2); border-radius:8px 8px 0 0; transition:color .12s; }
.myvoices-tab:hover{ color:var(--text); }
.myvoices-tab.active{ color:var(--text); }
.myvoices-tab.active::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background:#fe655d; border-radius:2px; }
.myvoices-head{ font-size:14px; font-weight:700; letter-spacing:-.01em; color:var(--text); margin:0 2px 10px; }
.myvoices-empty{ font-size:13.5px; color:var(--text-3); text-align:center; padding:18px 12px;
  border:1px dashed #e2d8f6; border-radius:14px; background:#fff6f4; }
.mv-item{ display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid #f0eaf8;
  border-radius:14px; background:#fff; margin-bottom:8px; cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.mv-item:hover{ border-color:#e7dbf7; box-shadow:0 4px 16px rgba(254,101,93,.12); }
.mv-item.selected{ border-color:#fc3e57; background:#fffbfa; box-shadow:0 4px 16px rgba(254,101,93,.15); }
.mv-item.playing{ border-color:#fc3e57; background:#fffbfa; box-shadow:0 4px 16px rgba(254,101,93,.18); }
.mv-play.playing{ color:#fc3e57; padding:3px; border-radius:12px;
  background:conic-gradient(from var(--spin-angle,0deg), #fc3e57, transparent 40%, transparent 60%, #fc3e57);
  animation:poster-spin 1s linear infinite; }
.mv-play.playing::before{ content:""; position:absolute; inset:2px; border-radius:9px; background:#fff; }
.mv-play.playing svg{ position:relative; z-index:1; }
.mv-av-wrapper{ position:relative; flex:none; width:38px; height:38px; border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22), 0 0 0 2px #fc3e57aa; }
.mv-av{display: block; width:100%; height:100%; border-radius:50%; position:relative; overflow:hidden;
  background-size:cover; background-position:center; }
.mv-av-img{ width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
.mv-av-star{ position:absolute; top:-2px; right:-2px; font-size:10px; line-height:1; color:#fc3e57;
  background:#fff; border-radius:50%; width:14px; height:14px; display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,.15); pointer-events:none; }
.mv-info{ flex:1; min-width:0; }
.mv-name{ font-size:15px; font-weight:600; letter-spacing:-.01em; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mv-meta{ font-size:12.5px; color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.mv-btn{ width:34px; height:34px; border-radius:9px; border:none; background:none; flex:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--text-2); position:relative; overflow:visible; }
.mv-btn:hover{ background:var(--hover); color:var(--text); }
.mv-btn.mv-del:hover{ background:#fdecec; color:#e11d48; }
.mv-btn.mv-fav-toggle{ font-size:16px; color:var(--text-3); }
.mv-btn.mv-fav-toggle:hover{ color:#f59e0b; background:var(--hover); }
.mv-btn.mv-fav-toggle.on{ color:#f59e0b; }
.mv-btn.mv-use{ width:auto; padding:0 12px; font-size:12px; font-weight:700; color:#fff; border-radius:8px;
  background:var(--accent,#fe655d); height:30px; }
.mv-btn.mv-use:hover{ filter:brightness(.94); background:var(--accent,#fe655d); }
.mv-btn.mv-remove{ width:auto; padding:0 12px; font-size:12px; font-weight:700; color:#e11d48; border-radius:8px;
  background:#fef2f2; border:1px solid #fecdd3; height:30px; }
.mv-btn.mv-remove:hover{ background:#fee2e2; }

/* mv-item dropdown */
.mv-menu-wrap{ position:relative; flex:none; }
.mv-dropdown{ display:none; position:absolute; top:36px; right:0; z-index:20; min-width:220px;
  background:#fff; border:1px solid var(--border-2); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:6px; }
.mv-dropdown.show{ display:block; }
.mv-dd-item{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 12px; border:none;
  background:none; border-radius:8px; font-size:14px; font-weight:500; color:var(--text);
  cursor:pointer; font-family:inherit; text-align:left; }
.mv-dd-item:hover{ background:var(--hover); }
.mv-dd-item.danger{ color:#dc2626; }
.mv-dd-item.danger:hover{ background:#fef2f2; }
.mv-dd-item svg{ width:16px; height:16px; flex:none; }

/* Voice picker: My Voices empty-state (jumps to Voice Clone) */
.vp-empty{ display:block; width:100%; text-align:left; border:1px dashed #e2d8f6; background:#fff6f4;
  color:var(--text-2); border-radius:12px; padding:13px 15px; font-size:13.5px; line-height:1.5;
  cursor:pointer; font-family:inherit; }
.vp-empty:hover{ background:#ffece9; color:var(--text); }

/* ============ ONE-CLICK TRANSLATION (Dubbing) ============ */
.tr{ border:1px solid var(--border-2); border-radius:18px; background:#fff; padding:22px 24px 24px; }
.tr-header{ margin-bottom:18px; }
.tr-category{ font-size:20px; font-weight:800; letter-spacing:-.02em; color:var(--text); margin:0 0 6px; }
.tr-subtitle{ font-size:13.5px; line-height:1.55; color:var(--text-3); margin:0; }

.tr-step-label{ display:flex; align-items:center; gap:9px; font-size:14px; font-weight:700; color:var(--text);
  margin:18px 0 10px; }
.tr-step-num{ width:24px; height:24px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); }

/* Upload dropzone */
.tr-drop{ display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; width:100%;
  border:2px dashed #d8d5e4; border-radius:16px; background:#fafbfc; padding:26px 18px; cursor:pointer;
  font-family:inherit; transition:border-color .15s, background .15s, transform .15s; margin-bottom:16px; }
.tr-drop:hover{ border-color:#fe655d; background:#fff6f4; transform:translateY(-1px); }
.tr-drop.drag{ border-color:#fe655d; background:#ffece9; }
.tr-drop.error{ border-color:#dc2626; background:#fef2f2; animation:tr-drop-shake .4s ease; }
@keyframes tr-drop-shake{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-4px); } 40%{ transform:translateX(4px); } 60%{ transform:translateX(-3px); } 80%{ transform:translateX(2px); } }
.tr-drop-ico{ display:flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%;
  color:#fe655d; background:#fff1ef; margin-bottom:4px; }
.tr-drop-title{ font-size:15px; font-weight:700; color:var(--text); letter-spacing:-.01em; }
.tr-drop-desc{ font-size:12.5px; color:var(--text-3); }

/* Chosen file chip */
.tr-file{ display:flex; align-items:center; gap:10px; border:1px solid var(--border-2); border-radius:13px;
  background:#fff6f4; padding:11px 14px; margin-top:10px; }
.tr-file-ico{ display:flex; color:#fe655d; flex:none; }
.tr-file-name{ flex:1; font-size:13.5px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tr-file-x{ flex:none; border:none; background:transparent; color:var(--text-3); font-size:15px; cursor:pointer;
  width:26px; height:26px; border-radius:7px; }
.tr-file-x:hover{ background:var(--hover); color:var(--text); }

/* Language selectors */
.tr-langs{ display:flex; align-items:flex-start; gap:14px; }
.tr-lang-col{ display:flex; flex-direction:column; gap:7px; min-width:150px; }
.tr-lang-col-grow{ flex:1; }
.tr-lang-label{ font-size:12px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--text-3); }
.tr-lang-arrow{ font-size:22px; color:var(--text-3); align-self:center; margin-top:16px; }
.tr-select{ height:44px; border:1px solid var(--border-2); border-radius:12px; background:#fff; padding:0 12px;
  padding-right:28px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; -webkit-appearance:none; appearance:none;
  font-family:inherit; font-size:14px; font-weight:600; color:var(--text); cursor:pointer; }
.tr-select:focus{ outline:none; border-color:#fe655d; }
.tr-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.tr-chip{ border:1px solid var(--border-2); background:#fff; color:var(--text-2); border-radius:999px;
  padding:8px 14px; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer;
  transition:border-color .15s, background .15s, color .15s, transform .1s; }
.tr-chip:hover{ border-color:#fe655d; background:#fff6f4; }
.tr-chip.on{ color:#fff; border-color:transparent; background:linear-gradient(135deg,#fe655d,#fc3e57);
  box-shadow:0 6px 16px rgba(252,62,87,.28); }

/* Options */
.tr-opts{ display:flex; flex-direction:column; gap:12px; margin:0 0 6px; }
.tr-toggle{ display:flex; align-items:center; gap:10px; font-size:13.5px; font-weight:600; color:var(--text-2); cursor:pointer; }
.tr-toggle input{ width:18px; height:18px; accent-color:#fe655d; cursor:pointer; border-radius:4px;
  appearance:none; -webkit-appearance:none; border:2px solid #d1d5db; background:#fff;
  display:inline-grid; place-content:center; }
.tr-toggle input:checked{ background:#fe655d; border-color:#fe655d; }
.tr-toggle input:checked::before{ content:""; width:10px; height:10px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat; }

/* Action */
.tr-actions{ margin-top:16px; }
.tr-btn{ height:50px; border-radius:13px; border:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:700;
  transition:transform .15s, box-shadow .15s, opacity .15s; width:100%;
  display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.tr-btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }
.tr-btn-primary{ color:#fff; background:linear-gradient(135deg,#ff9e99,#fe655d 55%,#fc3e57);
  box-shadow:0 10px 26px rgba(252,62,87,.35); }
.tr-btn-primary:hover:not(:disabled){ transform:translateY(-1px); box-shadow:0 14px 32px rgba(252,62,87,.4); }
.tr-btn.is-loading{ opacity:.7; }

/* Phase 2 disabled state during generation */
#dubPhase1.is-generating button:not(#dubRunBtn),
#dubPhase1.is-generating select,
#dubPhase1.is-generating input,
#dubPhase1.is-generating .tr-drop,
#dubPhase1.is-generating .tr-chip,
#dubPhase1.is-generating .tr-toggle,
#dubPhase1.is-generating .tr-file-x,
#dubPhase1.is-generating .tr-input-video,
#dubPhase1.is-generating .tr-file{
  pointer-events:none; opacity:.5; }
#dubPhase2.is-generating textarea,
#dubPhase2.is-generating select,
#dubPhase2.is-generating button:not(#dubRenderBtn),
#dubPhase2.is-generating input,
#dubPhase2.is-generating .tr-slider,
#dubPhase2.is-generating .tr-seg-ta{
  pointer-events:none; opacity:.5; }
#dubPhase2.is-generating .tr-adv-sum{ pointer-events:none; opacity:.5; }

/* Progress */
.tr-progress{ margin-top:18px; }
.tr-progress-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.tr-stage{ font-size:13.5px; font-weight:600; color:var(--text-2); }
.tr-pct{ font-size:13px; font-weight:700; color:#fe655d; }
.tr-bar{ height:10px; border-radius:999px; background:#f0f1f4; overflow:hidden; }
.tr-bar-fill{ height:100%; width:0%; border-radius:999px; background:linear-gradient(90deg,#fe655d,#fc3e57);
  transition:width .4s ease; }

/* Results */
.tr-results{ margin-top:22px; }
.tr-results-head{ font-size:15px; font-weight:700; color:var(--text); margin-bottom:12px; }
.tr-result{ border:1px solid var(--border-2); border-radius:14px; background:#fafbfc; padding:14px 16px; margin-bottom:12px; margin-top:12px; }
.tr-result-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.tr-result-lang{ font-size:14px; font-weight:700; color:var(--text); }
.tr-audio{ width:100%; height:40px; }
.tr-result-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.tr-dl{ font-size:12.5px; font-weight:700; color:#e0463c; background:#fff1ef; border:1px solid #ffd8d3;
  border-radius:9px; padding:7px 13px; text-decoration:none; }
.tr-dl:hover{ background:#ffe1dd; }
.tr-result-err{ font-size:13px; color:#b4123f; margin:0; }

@media (max-width:640px){
  .tr-langs{ flex-direction:column; }
  .tr-lang-arrow{ display:none; }
  .tr-lang-col{ min-width:0; }
}

/* Translate: voice choice */
.tr-voice-opts{ display:flex; gap:12px; }
.tr-voice-opt{ flex:1; display:flex; align-items:flex-start; gap:11px; text-align:left; cursor:pointer;
  border:1.5px solid var(--border-2); border-radius:14px; background:#fff; padding:14px 15px; font-family:inherit;
  transition:border-color .15s, background .15s, transform .12s, box-shadow .15s; }
.tr-voice-opt:hover{ border-color:#fe655d; background:#fff6f4; transform:translateY(-1px); }
.tr-voice-opt.on{ border-color:#fe655d; background:#fff2f0; box-shadow:0 6px 18px rgba(254,101,93,.14); }
.tr-voice-ico{ display:flex; align-items:center; justify-content:center; width:38px; height:38px; flex:none;
  border-radius:10px; color:#fe655d; background:#fff1ef; }
.tr-voice-opt.on .tr-voice-ico{ color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); }
.tr-voice-opt-body{ display:flex; flex-direction:column; gap:3px; }
.tr-voice-opt-title{ font-size:14px; font-weight:700; color:var(--text); letter-spacing:-.01em; }
.tr-voice-opt-desc{ font-size:12px; color:var(--text-3); line-height:1.4; }
.tr-voice-pick{ margin-top:12px; display:flex; flex-direction:column; gap:7px; }
.tr-select-block{ width:100%; }
/* Per-speaker voice assignment (multi-speaker "Choose voices") */
.tr-onevoice{ margin:2px 0; }
.tr-voice-hint{ font-size:12.5px; color:var(--text-2); line-height:1.5; margin:2px 0 6px; }
.tr-voice-speakers{ display:flex; flex-direction:column; gap:8px; }
.tr-spk-row{ display:flex; align-items:center; gap:8px; }
.tr-spk-label{ flex:none; min-width:88px; font-size:13px; font-weight:600; color:var(--text-2); }
.tr-spk-select{ flex:1; min-width:0; }
.tr-spk-prev{ flex:none; width:40px; height:40px; }
@media (max-width:640px){ .tr-voice-opts{ flex-direction:column; } .tr-spk-label{ min-width:64px; font-size:12px; } }

/* Translate phase 2: review & edit */
.tr-phase2-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:14px; }
.tr-phase2-titles{ flex:1; }
.tr-restart{ flex:none; border:1px solid var(--border-2); background:#fff; color:var(--text-2); border-radius:10px;
  padding:8px 14px; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; transition:background .15s, border-color .15s; }
.tr-restart:hover{ background:var(--hover); border-color:#fe655d; color:var(--text); }

.tr-lang-tabs{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.tr-lang-tab{ border:1px solid var(--border-2); background:#fff; color:var(--text-2); border-radius:999px;
  padding:7px 15px; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
.tr-lang-tab:hover{ border-color:#fe655d; background:#fff6f4; }
.tr-lang-tab.on{ color:#fff; border-color:transparent; background:linear-gradient(135deg,#fe655d,#fc3e57); box-shadow:0 6px 16px rgba(252,62,87,.28); }

.tr-seglist{ display:flex; flex-direction:column; gap:10px; margin-bottom:6px; }
.tr-seg{ border:1px solid var(--border-2); border-radius:12px; background:#fafbfc; padding:11px 13px; }
.tr-seg-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.tr-seg-spk{ font-size:11.5px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--text-3); }
.tr-seg-src{ font-size:12.5px; color:var(--text-3); margin:0 0 8px; line-height:1.45; font-style:italic; }
.tr-seg-ta{ width:100%; border:1px solid var(--border-2); border-radius:9px; background:#fff; padding:9px 11px;
  font-family:inherit; font-size:14px; line-height:1.5; color:var(--text); resize:vertical; box-sizing:border-box; }
.tr-seg-ta:focus{ outline:none; border-color:#fe655d; box-shadow:0 0 0 3px rgba(254,101,93,.15); }

/* Translate: informed waiting + saved hint */
.tr-detect{ margin:10px 0 0; font-size:12.5px; font-weight:600; color:#e0463c; }
.tr-saved{ display:none; align-items:center; gap:4px; margin-left:10px; font-size:12px; font-weight:700;
  color:#0f7a52; background:#e8f9f0; border-radius:999px; padding:2px 9px; vertical-align:middle; }

/* Translate: per-segment fit indicator + line actions */
.tr-seg-fit{ font-size:11px; font-weight:700; letter-spacing:.01em; padding:2px 8px; border-radius:999px; }
.tr-seg-fit.ok{ color:#0f7a52; background:#e8f9f0; }
.tr-seg-fit.tight{ color:#a5560b; background:#fff3e6; }
.tr-seg-fit.over{ color:#b4123f; background:#fdecef; }
.tr-seg-actions{ display:flex; gap:8px; margin-top:8px; }
.tr-seg-btn{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border-2); background:#fff;
  color:var(--text-2); border-radius:9px; padding:6px 11px; font-family:inherit; font-size:12px; font-weight:600;
  cursor:pointer; transition:background .15s, border-color .15s, opacity .15s; }
.tr-seg-btn:hover{ background:var(--hover); border-color:#fe655d; color:var(--text); }
.tr-seg-btn-accent{ color:#e0463c; }
.tr-seg-btn.is-loading{ opacity:.55; pointer-events:none; }

/* Translate: voice preview + empty state */
.tr-voice-pick-row{ display:flex; gap:8px; align-items:center; }
.tr-voice-preview{ flex:none; width:42px; height:44px; border:1px solid var(--border-2); background:#fff; color:#e0463c;
  border-radius:12px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s, border-color .15s; }
.tr-voice-preview:hover{ background:#fff6f4; border-color:#fe655d; }
.tr-voice-preview.is-loading{ opacity:.55; pointer-events:none; }
.tr-voice-preview.playing{ background:#fff6f4; border-color:#fe655d; position:relative; }
.tr-voice-preview.playing::after{ content:""; position:absolute; inset:-3px; border-radius:14px;
  border:2.5px solid transparent; border-top-color:#fe655d; animation:vi-spin .8s linear infinite; }
.tr-voice-empty{ margin:8px 0 0; font-size:12.5px; color:var(--text-3); }
.tr-link{ color:#e0463c; font-weight:700; text-decoration:none; }
.tr-link:hover{ text-decoration:underline; }

/* Translate: start-over armed state + original A/B row */
.tr-restart.armed{ border-color:#b4123f; color:#b4123f; background:#fdecef; }
.tr-result-orig{ background:#fff2f0; border-color:#ffd8d3; margin-top:14px; }

/* Translate: find & replace toolbar */
.tr-find{ display:flex; align-items:center; gap:8px; margin:0 0 12px; flex-wrap:wrap; }
.tr-find-in{ flex:1; min-width:120px; height:38px; border:1px solid var(--border-2); border-radius:10px;
  padding:0 11px; font-family:inherit; font-size:13px; color:var(--text); background:#fff; box-sizing:border-box; }
.tr-find-in:focus{ outline:none; border-color:#fe655d; }
.tr-find-arrow{ color:var(--text-3); font-size:15px; }
.tr-find-btn{ flex:none; height:38px; border:1px solid var(--border-2); background:#fff; color:#e0463c;
  border-radius:10px; padding:0 14px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; transition:background .15s, border-color .15s; }
.tr-find-btn:hover{ background:#fff6f4; border-color:#fe655d; }

/* Translate: mix level sliders */
.tr-mix{ display:flex; flex-direction:column; gap:12px; margin:2px 0 6px; }
.tr-mix-row{ display:flex; align-items:center; gap:12px; }
.tr-mix-label{ flex:none; width:96px; font-size:13px; font-weight:600; color:var(--text-2); }
.tr-slider{ flex:1; height:6px; cursor:pointer; accent-color:#fe655d;
  border-radius:999px; outline:none; border:none; margin:0; }
.tr-slider::-webkit-slider-thumb{ border:none; box-shadow:none; }
.tr-slider::-moz-range-thumb{ border:none; box-shadow:none; }
.tr-mix-val{ flex:none; width:48px; text-align:right; font-size:12.5px; font-weight:700; color:#e0463c; }

/* Translate: video export */
.tr-dl-video{ border:none; cursor:pointer; color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); font-family:inherit; }
.tr-dl-video:hover{ filter:brightness(1.05); }
.tr-dl-video.is-loading{ opacity:.6; pointer-events:none; }
.tr-video-wrap{ margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.tr-video{ width:100%; max-height:360px; border-radius:12px; background:#000; }

/* Translate: uploaded-video preview (phase 1) */
.tr-input-video{ width:100%; max-height:320px; border-radius:12px; background:#000; margin-top:10px; margin-bottom:16px; }

/* ============ Translate: guided redesign (stepper + disclosure) ============ */
/* Journey stepper */
.tr-steps{ display:flex; align-items:center; justify-content:center; gap:0; list-style:none; padding:0; margin:0 0 20px;
  width:100%; }
.tr-stepx{ display:flex; align-items:center; gap:7px; flex:none; width:auto; min-width:0; color:var(--text-3); font-size:12.5px; font-weight:600;
  padding:0 12px; }
.tr-stepx-n{ flex:none; width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; background:#eef0f4; color:var(--text-3); border:1.5px solid transparent; transition:all .2s; }
.tr-stepx-t{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tr-stepx:not(:last-child)::after{ content:""; width:60px; height:2px; background:#eef0f4; border-radius:2px; margin-left: 17px; }
.tr-stepx.on{ color:#e0463c; }
.tr-stepx.on .tr-stepx-n{ background:linear-gradient(135deg,#fe655d,#fc3e57); color:#fff; box-shadow:0 4px 12px rgba(254,101,93,.4); }
.tr-stepx.done{ color:#0f7a52; }
.tr-stepx.done .tr-stepx-n{ background:#e8f9f0; color:#0f7a52; border-color:#bff0d8; }
.tr-stepx.done:not(:last-child)::after{ background:#bff0d8; }
@media (max-width:640px){ .tr-stepx-t{ display:none; } .tr-stepx{ padding:0 2px; } .tr-stepx:not(:last-child)::after{ width:24px; margin-left:6px; } }

/* Generic block label */
.tr-block{ margin:16px 0; }
.tr-blk-label{ display:block; font-size:12px; font-weight:700; letter-spacing:.02em; text-transform:uppercase;
  color:var(--text-3); margin-bottom:8px; }

/* Collapsible advanced sections (native <details>) */
.tr-adv{ border:1px solid var(--border-2); border-radius:12px; margin:24px 0 16px; background:#fafbfc; overflow:hidden; }
.tr-adv-sum{ cursor:pointer; list-style:none; padding:12px 14px; font-size:13px; font-weight:700; color:var(--text-2);
  display:flex; align-items:center; gap:8px; user-select:none; }
.tr-adv-sum::-webkit-details-marker{ display:none; }
.tr-adv-sum::before{ content:""; display:inline-block; width:16px; height:16px; flex:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E") center/contain no-repeat;
  transition:transform .15s; }
.tr-adv[open] .tr-adv-sum::before{ transform:rotate(90deg); }
.tr-adv[open] .tr-adv-sum{ border-bottom:1px solid var(--border-2); }
.tr-adv-body{ padding:14px; display:flex; flex-direction:column; gap:14px; }
.tr-adv .tr-find, .tr-adv .tr-mix{ padding:14px; margin:0; }

/* Sticky primary action bar */
.tr-actions.tr-sticky{ position:sticky; bottom:0; z-index:5; margin:16px -4px 0; padding:14px 4px 6px;
  background:linear-gradient(to top, #fff 62%, rgba(255,255,255,0)); }

/* Voice summary (collapsed) */
.tr-voice-summary{ display:flex; align-items:center; gap:10px; border:1px solid var(--border-2); border-radius:12px;
  background:#fff6f4; padding:12px 14px; margin:0 0 16px; }
.tr-vs-ico{ display:flex; color:#fe655d; flex:none; }
.tr-vs-text{ flex:1; font-size:13.5px; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tr-vs-val{ color:var(--text); }
.tr-vs-change{ flex:none; border:1px solid var(--border-2); background:#fff; color:#e0463c; border-radius:9px;
  padding:6px 13px; font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.tr-vs-change:hover{ background:#fff1ef; border-color:#fe655d; }
.tr-voice-block{ margin:0 0 16px; }

/* Transcript review: lighter, "tap to edit" feel */
.tr-review-head{ display:flex; align-items:center; justify-content:space-between; gap:8px 10px; flex-wrap:wrap; margin:4px 0 10px; }
.tr-review-title{ font-size:13.5px; font-weight:700; color:var(--text); }
.tr-review-actions{ display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
/* Download subtitles/text straight from the review step (no audio needed). */
.tr-dl-mini{ display:inline-flex; align-items:center; gap:5px; font-family:inherit; font-size:12px; font-weight:700;
  color:#e0463c; background:#fff1ef; border:1px solid #ffd8d3; border-radius:8px; padding:5px 10px; cursor:pointer;
  transition:background .15s; }
.tr-dl-mini:hover{ background:#ffe1dd; }
.tr-dl-mini svg{ flex:none; }
.tr-seg{ border:1px solid transparent; border-bottom:1px solid var(--border-2); border-radius:0; background:transparent; padding:10px 4px; }
.tr-seg:hover{ background:#fafbfc; }
.tr-seg-src{ font-size:11.5px; color:var(--text-3); font-style:italic; margin:0 0 4px; opacity:.75; }
.tr-seg-ta{ border:1px solid transparent; background:transparent; padding:6px 8px; border-radius:8px; transition:border-color .15s, background .15s; }
.tr-seg-ta:hover{ background:#fff; border-color:var(--border-2); }
.tr-seg-ta:focus{ background:#fff; border-color:#fe655d; box-shadow:0 0 0 3px rgba(254,101,93,.15); }

/* Results: video-first */
.tr-export-hero{ width:100%; margin:4px 0 6px; margin-bottom:32px; box-shadow:none; }
.tr-export-hero:hover:not(:disabled){ box-shadow:0 10px 26px rgba(252,62,87,.35); }
.tr-export-hint{ font-size:12.5px; color:var(--text-3); margin:0 0 6px; }
.tr-audio-secondary{ opacity:.9; }

/* Translate: timing sync segmented toggle */
.tr-sync{ display:flex; align-items:center; gap:12px; margin:2px 0 4px; }
.tr-sync-label{ font-size:12px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--text-3); }
.tr-sync-opts{ display:inline-flex; border:1px solid var(--border-2); border-radius:10px; overflow:hidden; background:#fff; }
.tr-sync-opt{ border:none; background:transparent; color:var(--text-2); font-family:inherit; font-size:13px; font-weight:600;
  padding:8px 14px; cursor:pointer; transition:background .15s, color .15s; }
.tr-sync-opt + .tr-sync-opt{ border-left:1px solid var(--border-2); }
.tr-sync-opt.on{ color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); }
.tr-sync-hint{ font-size:12px; color:var(--text-3); margin:0 0 14px; }

/* Translate: "what's next?" actions after a result */
.tr-next{ margin-top:16px; padding:16px; border:1px dashed var(--border-2); border-radius:14px; background:#fff7f6; }
.tr-next-title{ margin:0 0 12px; font-size:13.5px; font-weight:700; color:var(--text); }
.tr-next-btns{ display:flex; flex-wrap:wrap; gap:10px; }
.tr-next-btn{ display:inline-flex; align-items:center; gap:8px; border:1px solid var(--border-2); background:#fff;
  color:var(--text); border-radius:11px; padding:10px 16px; font-family:inherit; font-size:13.5px; font-weight:700;
  cursor:pointer; transition:background .15s, border-color .15s, transform .12s, box-shadow .15s; }
.tr-next-btn:hover{ background:var(--hover); border-color:#fe655d; transform:translateY(-1px); }
.tr-next-btn-primary{ color:#fff; border-color:transparent; background:linear-gradient(135deg,#fe655d,#fc3e57);
  box-shadow:0 8px 20px rgba(252,62,87,.3); }
.tr-next-btn-primary:hover{ background:linear-gradient(135deg,#fe655d,#fc3e57); filter:brightness(1.05); }

/* ============ MOBILE POLISH for the studio feature panels ============ */
@media (max-width:560px){
  /* Tighter cards so content isn't squeezed by big paddings on phones */
  .vc, .vd, .tr{ padding:16px 14px 18px; border-radius:14px; margin-top:0; }
  .editor-scroll{ padding:16px 12px 10px; }
  .tr-category, .vd-category, .vc-category{ font-size:18px; }
  .tr-subtitle, .vd-subtitle, .clone-sub{ font-size:13px; }
  .tr-header{ margin-bottom:14px; }

  /* Journey stepper: keep it compact (labels already hide < 640) */
  .tr-steps{ margin-bottom:16px; }

  /* Find & replace stacks full-width instead of cramming on one line */
  .tr-find-in{ flex:1 1 100%; height:42px; }
  .tr-find-arrow{ display:none; }
  .tr-find-btn{ flex:1 1 100%; height:42px; }

  /* Phase-2 header + timing toggle wrap cleanly */
  .tr-phase2-head{ flex-wrap:wrap; }
  .tr-sync{ flex-wrap:wrap; gap:8px; }
  .tr-sync-opts{ width:100%; }
  .tr-sync-opt{ flex:1; text-align:center; }

  /* Mix row labels a bit narrower to leave room for the slider */
  .tr-mix-label{ width:72px; font-size:12.5px; }

  /* Comfortable, thumb-friendly primary actions */
  .tr-btn, .vc-btn, .vd-btn, .vd-btn-dark, .modal-btn{ min-height:50px; }

  /* "What's next?" buttons stack full-width */
  .tr-next{ padding:14px; }
  .tr-next-btn{ flex:1 1 100%; justify-content:center; }

  /* Voice-picker & result actions: larger touch targets */
  .voice-item{ padding:13px 12px; }
  .tr-seg-btn, .tr-dl{ min-height:40px; }
  .tr-result-actions{ gap:8px; }

  /* Voice preview pick row stays on one line */
  .tr-voice-preview{ width:46px; }
}

/* Prevent iOS zoom-on-focus: text-entry surfaces at >=16px on touch phones */
@media (max-width:560px){
  #translatePanel textarea, #translatePanel input[type="text"], #translatePanel input[type="search"], #translatePanel select,
  #clonePanel textarea, #clonePanel input[type="text"], #designPanel textarea, #designPanel input[type="text"],
  .script-ta{ font-size:16px; }
}

@media (max-width:380px){
  .vc, .vd, .tr{ padding:14px 11px 16px; }
  .tr-voice-opt{ padding:12px; }
  .tr-drop{ padding:20px 12px; }
  .tr-seg{ padding:10px 0; }
}

/* Mobile topbar: keep it on one row (title truncates, controls stay compact) */
@media (max-width:560px){
  .topbar{ gap:8px; }
  .topbar-title{ font-size:15px; }
  #installBtn{ display:none !important; }   /* PWA install still available via the browser menu */
  .lang-picker{ padding:0 6px; gap:4px; }
  .lang-picker svg{ display:none; }          /* the option flags already convey language */
  .lang-picker select{ max-width:100px; font-size:13.5px; }  /* fits "English"/"Español" but leaves room for the title */
  .icon-pill{ width:38px; }
}
@media (max-width:380px){
  .lang-picker select{ max-width:88px; }
}

/* ---------------------------------------------------------------------------
   Subtitles → speech modal (Text-to-Speech screen)
   Reuses .tr-drop / .tr-file / .modal-script; adds the mode picker + progress.
   --------------------------------------------------------------------------- */
.modal-srt{ max-width:560px; }
.srt-drop{ margin-top:4px; }

/* --- review panel --------------------------------------------------------- */
.srt-panel{ padding:2px 0 20px; }
.srt-head{ display:flex; align-items:flex-start; gap:14px; margin-bottom:6px; }
.srt-head-titles{ flex:1; }
.srt-category{ margin:0; font-size:19px; font-weight:800; letter-spacing:-.02em; color:var(--text); }
.srt-subtitle{ margin:4px 0 0; font-size:13px; line-height:1.5; color:var(--text-3); }
.srt-restart{ flex:none; height:36px; padding:0 14px; border-radius:10px; border:1px solid var(--border-2);
  background:#fff; color:var(--text-2); font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.srt-restart:hover{ background:var(--hover); color:var(--text); }
.srt-meta{ margin:4px 0 0; font-size:12.5px; font-weight:600; color:var(--text-3); }

/* What we did to a fragmented subtitle file (quality explainer) */
.srt-note{ display:block; margin:14px 0 0; padding:11px 13px; border-radius:12px;
  background:#f0fdf4; border:1px solid #bbf7d0; color:#166534;
  font-size:12.5px; font-weight:600; line-height:1.5; }

/* Two visible steps — everything else is opt-in below */
.srt-step{ display:flex; gap:12px; margin-top:18px; }
.srt-step-n{ flex:none; display:flex; align-items:center; justify-content:center;
  width:26px; height:26px; border-radius:50%; font-size:12.5px; font-weight:800; color:#fff;
  background:linear-gradient(135deg,#fe655d,#fc3e57); }
.srt-step-body{ flex:1; min-width:0; }
.srt-step-t{ margin:2px 0 10px; font-size:14.5px; font-weight:700; color:var(--text); }

/* Opt-in sections (review / advanced) */
.srt-adv{ margin-top:16px; border:1px solid var(--border-2); border-radius:13px; background:#fff; }
.srt-adv[open]{ background:#fafbfc; }
.srt-adv-sum{ list-style:none; cursor:pointer; padding:13px 15px; font-size:13.5px; font-weight:700;
  color:var(--text-2); display:flex; align-items:center; gap:8px; }
.srt-adv-sum::-webkit-details-marker{ display:none; }
.srt-adv-sum::before{ content:""; width:7px; height:7px; flex:none; border-right:2px solid var(--text-3);
  border-bottom:2px solid var(--text-3); transform:rotate(-45deg); transition:transform .15s; }
.srt-adv[open] > .srt-adv-sum::before{ transform:rotate(45deg); }
.srt-adv-sum:hover{ color:var(--text); }
.srt-adv-body{ padding:0 15px 15px; display:flex; flex-direction:column; gap:12px; }
.srt-adv-hint{ margin:0; font-size:12px; line-height:1.5; color:var(--text-3); }
.srt-progress-sub{ margin:6px 0 0; font-size:12px; line-height:1.5; color:var(--text-3);
  font-variant-numeric:tabular-nums; }

.srt-aud-wrap{ margin-top:11px; }
.srt-aud-lead{ display:block; margin-bottom:7px; font-size:12px; font-weight:600; color:var(--text-3); }
.srt-try{ display:inline-flex; align-items:center; gap:6px; }
.srt-try.is-loading{ opacity:.6; pointer-events:none; }

.srt-tool{ display:flex; flex-direction:column; gap:7px; }
.srt-tool-label{ font-size:11.5px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--text-3); }
.srt-tool-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.srt-voice-chip{ display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 10px 0 8px;
  border:1px solid var(--border-2); border-radius:11px; background:#fff; cursor:pointer; font-family:inherit;
  max-width:230px; }
.srt-voice-chip:hover{ border-color:#fe655d; background:#fff6f4; }
.srt-voice-chip.own{ border-color:#fe655d; background:#fff6f4; }
.srt-vc-av{ width:24px; height:24px; border-radius:50%; flex:none; }
.srt-vc-name{ font-size:13px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.srt-vc-chev{ display:flex; color:var(--text-3); flex:none; }
.srt-voice-chip-sm{ height:32px; padding:0 8px 0 6px; border-radius:9px; max-width:170px; }
.srt-voice-chip-sm .srt-vc-av{ width:19px; height:19px; }
.srt-voice-chip-sm .srt-vc-name{ font-size:12px; }

.srt-mini-btn{ height:36px; padding:0 13px; border-radius:10px; border:1px solid var(--border-2);
  background:#fff; color:var(--text-2); font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }
.srt-mini-btn:hover{ border-color:#fe655d; background:#fff6f4; color:var(--text); }

.srt-switch{ display:inline-flex; padding:3px; gap:3px; border:1px solid var(--border-2);
  border-radius:11px; background:#fff; }
/* nowrap + flex:none: the row has a fixed 32px height, so a wrapped label would
   spill out of the pill rather than just look cramped. Fits today at phone
   widths; this keeps it safe if a translation gets longer. */
.srt-switch button{ height:32px; padding:0 12px; border:none; border-radius:8px; background:transparent;
  font-family:inherit; font-size:12.5px; font-weight:600; color:var(--text-3); cursor:pointer;
  flex:none; white-space:nowrap; }
.srt-switch button:hover{ color:var(--text); }
.srt-switch button.on{ color:#fff; background:linear-gradient(135deg,#fe655d,#fc3e57); }

/* Quick voice audition chips */
.srt-aud-chips{ display:flex; flex-wrap:wrap; gap:7px; }
.srt-aud-chip{ display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 11px 0 7px;
  border:1px solid var(--border-2); border-radius:999px; background:#fff; cursor:pointer; font-family:inherit; }
.srt-aud-chip:hover{ border-color:#fe655d; background:#fff6f4; }
.srt-aud-chip.sel{ border-color:#fe655d; box-shadow:inset 0 0 0 1px #fe655d; background:#fff6f4; }
.srt-aud-chip.is-loading{ opacity:.6; pointer-events:none; }
.srt-aud-av{ width:20px; height:20px; border-radius:50%; flex:none; }
.srt-aud-nm{ font-size:12px; font-weight:600; color:var(--text); max-width:130px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Line list */
.srt-list{ display:flex; flex-direction:column; gap:10px; max-height:460px; overflow-y:auto; }
.srt-seg.is-ready{ border-color:#bbf7d0; background:#f7fef9; }
.srt-seg-actions{ flex-wrap:wrap; align-items:center; }
.srt-seg-status{ font-size:11.5px; font-weight:700; }
.srt-seg-status.ok{ color:#15803d; }
.srt-seg-status.err{ color:#dc2626; }

.srt-actions{ display:flex; align-items:center; gap:10px; margin-top:18px; }
.srt-actions .tr-btn{ flex:1; }
.srt-dl-all{ height:50px; padding:0 18px; }
.srt-progress{ margin-top:14px; }
.srt-progress-head{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:600;
  color:var(--text-2); margin-bottom:6px; }
.srt-bar{ height:8px; border-radius:999px; background:var(--border-2); overflow:hidden; }
.srt-bar-fill{ height:100%; width:0%; border-radius:999px;
  background:linear-gradient(90deg,#ff9e99,#fe655d,#fc3e57); transition:width .2s ease; }

/* Dubbing screen: the voice chips reuse .srt-voice-chip but must fill their row
   (declared last so they win over the narrower .srt-voice-chip defaults). */
.tr-voice-chip{ flex:1; min-width:0; max-width:none; height:44px; }
.tr-spk-chip{ flex:1; min-width:0; max-width:none; height:40px; }

/* ---------------------------------------------------------------------------
   Video export / download status (dubbing results)
   The mux has no measurable progress, so it uses an animated bar + elapsed
   time; the download reports a real percentage.
   --------------------------------------------------------------------------- */
.tr-export-progress{ margin:10px 0 14px; }
.tr-export-progress .tr-stage{ display:inline-flex; align-items:center; }
.tr-stage-spin{ display:inline-block; width:13px; height:13px; margin-right:7px; flex:none;
  border-radius:50%; border:2px solid rgba(252,62,87,.25); border-top-color:#fc3e57;
  animation:spin .8s linear infinite; }
.tr-export-progress .tr-pct{ font-variant-numeric:tabular-nums; }
.tr-export-note{ margin:8px 0 0; font-size:12px; line-height:1.5; color:var(--text-3); }

/* Indeterminate: a sweeping gradient says "working" without faking a number. */
.tr-export-progress.is-indeterminate .tr-bar-fill{
  width:100%; transition:none;
  background:linear-gradient(90deg,#ffe3e0 0%,#fe655d 35%,#fc3e57 55%,#ffe3e0 100%);
  background-size:220% 100%;
  animation:tr-indet 1.3s linear infinite;
}
@keyframes tr-indet{ 0%{ background-position:120% 0; } 100%{ background-position:-120% 0; } }

/* Failed step: stop animating, turn red, and keep the message on screen. */
.tr-export-progress.is-error .tr-stage{ color:#dc2626; }
.tr-export-progress.is-error .tr-stage-spin{ display:none; }
.tr-export-progress.is-error .tr-bar-fill{ animation:none; background:#fca5a5; }
.tr-retry{ margin-top:4px; }

/* Render progress pinned inside the sticky footer of the dubbing review step.
   The editable line list can be hundreds of rows tall, so a bar placed in the
   normal flow scrolled out of view and left a spinning button as the only
   feedback. */
.tr-progress-sticky{ margin:0 0 10px; }
.tr-progress-sticky .tr-progress-head{ margin-bottom:6px; }
.tr-progress-sticky .tr-stage{ font-size:13px; }
.tr-progress-sticky .tr-pct{ font-variant-numeric:tabular-nums; }
.tr-progress-sticky .tr-bar{ height:8px; }
.tr-render-note{ margin:8px 0 0; font-size:12px; line-height:1.5; color:var(--text-3); }
/* "You changed the voice — regenerate to hear it": shown next to the footer
   button when the on-screen result no longer matches the current settings. */
.tr-stale-hint{ margin:0 0 8px; font-size:12.5px; line-height:1.5; color:#b45309; }
.tr-btn-attention{ box-shadow:0 0 0 3px rgba(254,101,93,.28); }
