: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; 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; }
.sb-logo .brand-logo{ width:30px; height:30px; display:block; filter:drop-shadow(0 3px 8px rgba(254,101,93,.26)); transition:transform .18s, filter .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-logo{ transform:translateY(-1px) rotate(-4deg); filter:drop-shadow(0 6px 14px rgba(254,101,93,.42)); }
.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; }

/* 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:16px; 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:flex; flex:1; min-height:0; }
.editor{ flex:1; min-width:0; display:flex; flex-direction:column; }
.editor-scroll{ flex:1; overflow-y:auto; padding:34px 40px 24px; }
.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; 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:44px; height:44px; 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); }
@media (max-width:600px){
  .result-card{ flex-wrap:wrap; }
  .rc-info{ order:-1; flex-basis:100%; }
}
.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:10px; font-size:14px; color:var(--text-2); }
.stat-line{ display:inline-flex; align-items:center; gap:6px; font-weight:600; color:var(--text); }
.stat-line::before{ content:"💛"; font-size:13px; }
.stat-line::after{ content:"·"; color:var(--text-3); margin-left:6px; }
.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; }
.char-count{ font-size:14px; color:var(--text-2); white-space:nowrap; }
.generate-btn{ height:48px; padding:0 24px; border-radius:12px; border:none; background:var(--black);
  color:#fff; font-size:15px; font-weight:600; cursor:pointer; font-family:inherit; letter-spacing:-.01em;
  display:inline-flex; align-items:center; gap:10px; }
.generate-btn:hover{ background:#262626; }
.generate-btn:disabled{ opacity:.65; cursor:default; }
.btn-spin{ width:18px; height:18px; border-radius:50%; border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff; animation:spin 1s linear infinite; }

/* ---------- 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-center{ grid-area:center; display:flex; align-items:center; gap:22px; justify-content:center; }
.skip-btn{ position:relative; width:38px; height:38px; border:none; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--text); }
.skip-btn:hover{ color:#000; }
.skip-btn .num{ position:absolute; font-size:8px; font-weight:700; top:50%; left:50%; transform:translate(-50%,-40%); }
.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:8px; justify-content:flex-end; }
.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; }
.speaker-text{ font-size:20px; line-height:1.55; 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; }
.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); }
.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; }
.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: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); }

/* ---------- 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 ---------- */
.settings{ width:480px; flex:none; border-left:1px solid var(--border); overflow-y:auto; padding:30px 40px 60px; }
.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 10px; 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; }
.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; }
#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 ---------- */
.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; align-items:baseline; gap:8px; }
.hist-time{ font-size:12px; font-weight:400; color:var(--text-3); }
.hist-text{ font-size:13px; color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.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); }
.hist-clear{ margin-top:12px; width:100%; height:40px; border-radius:10px; border:1px solid var(--border-2);
  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); }
.voice-item:hover .vi-play,.voice-item.selected .vi-play{ background:rgba(0,0,0,.05); }

/* ---------- TOAST ---------- */
.toast{ position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(20px); opacity:0;
  pointer-events:none; display:flex; align-items:center; gap:10px; max-width:520px; padding:13px 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:50; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.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.err{ background:#e11d48; }
.toast.ok{ background:#111111; }
.toast.ok .toast-ico{ background:#16a34a; }

.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){
  .settings{ width:420px; }
  .speaker-text,.ph-overlay{ font-size:18px; }
  .st-label{ font-size:16px; }
  .selector,.dropdown{ font-size:15px; }
}

/* ---------- 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:100; 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; }
.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; 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{ 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%; flex:none; border-left:none; border-bottom:1px solid var(--border);
    overflow:visible; padding:18px 16px 20px; }
  .editor{ order:0; flex:none; width:100%; }
  .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; }

  /* Playbar fixed to the bottom so controls are always visible after generating. */
  .playbar{ position:fixed; left:0; right:0; bottom:0; z-index:70; padding:10px 14px 14px;
    column-gap:12px; box-shadow:0 -6px 24px rgba(0,0,0,.08); }
  .pb-center{ gap:14px; }
  .pb-progress{ padding:0; }
  body.has-playbar{ padding-bottom:140px; }     /* room so content isn't hidden behind playbar */

  /* 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) ---------- */
.library{ flex:1; min-width:0; display:none; flex-direction:column; }
.lib-scroll{ flex:1; 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; }
.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; 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-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); }

/* Featured cards: big portrait with overlaid name + tags (NOIZ-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; }
.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{ opacity:1; }
.vf-shade{ position:absolute; inset:0; z-index:1;
  background:linear-gradient(to top, rgba(10,8,25,.82) 0%, rgba(10,8,25,.30) 46%, rgba(10,8,25,0) 74%); }
.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{ 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-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{ opacity:1; transform:translate(-50%,-50%) scale(1); }
.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:1fr 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: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; }
.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 (NOIZ noiz-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:48px; padding:0 22px; border-radius:999px;
  border:none; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600; color:#fff;
  background:linear-gradient(135deg,#fe655d,#fc3e57); box-shadow:0 8px 22px rgba(252,62,87,.34);
  transition:transform .15s, box-shadow .15s; }
.rec-btn:hover{ transform:translateY(-1px); }
.rec-btn .rec-dot{ width:13px; height:13px; border-radius:50%; background:#fff; flex:none; }
.rec-btn.recording{ background:linear-gradient(135deg,#ef4444,#dc2626); }
.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:flex-start; gap:10px; border-radius:14px; padding:13px 15px;
  margin:16px 0 4px; font-size:14px; line-height:1.5; }
.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 — cap + center
   so the focused card doesn't stretch uncomfortably wide on large screens. */
.vc, .vd{ max-width:920px; margin-left:auto; margin-right:auto; }
.myvoices{ max-width:920px; margin-left:auto; margin-right:auto; }

/* ============ 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:4px; 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:12px; margin-bottom:16px; }
.vc-rec-timer{ font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text-2); }
.vc-rec-canvas{ width:240px; height:34px; }
.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 16px; border-radius:10px;
  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:background .15s, color .15s; }
.vc-rec-change:hover{ background:var(--hover); color:var(--text); }
.vc-rec-rule{ font-size:12px; color:var(--text-3); margin:16px 0 0; }
.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:14px; }
.vc-clip-name{ font-size:13px; color:var(--text-2); margin:0 0 10px; word-break:break-word; }
.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%; 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; margin-bottom:12px; }
.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{ margin-top:6px; }
.vd-header{ margin-bottom:16px; }
.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; }

/* 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{ border:none; background:none; cursor:pointer; font-family:inherit; font-size:12.5px; font-weight:600; color:var(--text-3); }
.vd-recipe-clear:hover{ color:#e11d48; }
.vd-recipe-val{ font-size:15px; font-weight:600; color:#e0463c; background:#fff1ef; border:1px solid #ffd8d3;
  border-radius:10px; padding:10px 14px; line-height:1.5; word-break:break-word; }
.vd-recipe-val.is-empty{ color:var(--text-3); font-weight:500; background:#fafbfc; border-color:var(--border-2); }
.vd-listen-row{ display:flex; align-items:center; gap:12px; margin-top:12px; flex-wrap:wrap; }
.vd-listen-player{ flex:1; min-width:220px; }

/* 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 noiz art + model-generated preview clip) */
.vd-tpl-list{ list-style:none; margin:0; padding:0; display:grid; gap:12px;
  grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); }
.vd-tpl{ position:relative; aspect-ratio:4/5; border-radius:14px; overflow:hidden; cursor:pointer;
  background:#e5e7eb center/cover no-repeat; box-shadow:inset 0 -60px 60px -20px rgba(0,0,0,.72);
  transition:transform .15s, box-shadow .15s; }
.vd-tpl:hover{ transform:translateY(-2px); box-shadow:inset 0 -60px 60px -20px rgba(0,0,0,.72), 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::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-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; }
.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{ 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-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-av{ width:38px; height:38px; border-radius:50%; flex:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22), 0 0 0 2px #fc3e57aa; background-size:cover; background-position:center; }
.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); }
.mv-btn:hover{ background:var(--hover); color:var(--text); }
.mv-btn.mv-del:hover{ background:#fdecec; color:#e11d48; }

/* 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{ max-width:920px; margin:6px auto 0; 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; max-width:640px; }

.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; }
.tr-drop:hover{ border-color:#fe655d; background:#fff6f4; transform:translateY(-1px); }
.tr-drop.drag{ border-color:#fe655d; background:#ffece9; }
.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;
  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:18px 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; }

/* 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%; }
.tr-btn:disabled{ opacity:.55; cursor:default; 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; cursor:default; }

/* 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; }
.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%; }
@media (max-width:640px){ .tr-voice-opts{ flex-direction:column; } }

/* 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-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; }

/* 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; accent-color:#fe655d; height:4px; cursor:pointer; }
.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; }

/* ============ Translate: guided redesign (stepper + disclosure) ============ */
/* Journey stepper */
.tr-steps{ display:flex; align-items:center; gap:6px; list-style:none; padding:0; margin:0 0 20px;
  max-width:920px; }
.tr-stepx{ display:flex; align-items:center; gap:7px; flex:1; min-width:0; color:var(--text-3); font-size:12.5px; font-weight:600; }
.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:""; flex:1; height:2px; background:#eef0f4; border-radius:2px; margin-left:2px; }
.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{ flex:none; } .tr-steps{ gap:4px; } }

/* Generic block label */
.tr-block{ margin:0 0 16px; }
.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:0 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:"▸"; color:var(--text-3); 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; margin:4px 0 10px; }
.tr-review-title{ font-size:13.5px; font-weight:700; color:var(--text); }
.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; }
.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-left{ 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:74px; font-size:13.5px; }
  .icon-pill{ width:38px; }
}
@media (max-width:380px){
  .lang-picker select{ max-width:54px; }
}
