/* Vocify — shared design system */
:root {
  --bg: #0b0a10;
  --bg-2: #100f17;
  --panel: #15131d;
  --panel-2: #1b1926;
  --panel-3: #221f30;
  --line: #262337;
  --line-2: #353049;
  --text: #f1edf8;
  --muted: #a39cb6;
  --faint: #6f6884;
  --accent: #ffb547;
  --accent-2: #ff7a59;
  --accent-soft: rgba(255, 181, 71, .12);
  --accent-ink: #1d1305;
  --grad: linear-gradient(135deg, #ffd27a 0%, #ff9a4d 52%, #ff5f6d 100%);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --danger: #ff5d73;
  --danger-soft: rgba(255, 93, 115, .12);
  --info: #8ab4ff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(255, 181, 71, .35), 0 10px 30px -10px rgba(255, 140, 70, .45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f3ee;
  --bg-2: #efebe4;
  --panel: #ffffff;
  --panel-2: #faf8f4;
  --panel-3: #f2eee6;
  --line: #e8e2d6;
  --line-2: #d9d1c1;
  --text: #19161f;
  --muted: #6a6375;
  --faint: #9d96a8;
  --accent: #e8870b;
  --accent-2: #f0603c;
  --accent-soft: rgba(232, 135, 11, .1);
  --accent-ink: #ffffff;
  --ok: #12a26b;
  --ok-soft: rgba(18, 162, 107, .1);
  --danger: #e03a52;
  --danger-soft: rgba(224, 58, 82, .09);
  --shadow: 0 20px 50px -24px rgba(60, 40, 10, .25);
  --glow: 0 0 0 1px rgba(232, 135, 11, .35), 0 10px 30px -12px rgba(240, 96, 60, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 140, 70, .10), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(140, 90, 255, .08), transparent 60%);
  z-index: 0;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 160, 80, .14), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(160, 120, 255, .08), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
::selection { background: rgba(255, 170, 70, .35); }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(0, 0, 0, .12);
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand svg { width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(255, 120, 70, .35)); }
.brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .32em; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav a.on .ic { color: var(--accent); }
.nav .pill { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--panel-3); color: var(--muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.wa-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(37,211,102,.35); background: rgba(37,211,102,.08); color: var(--text); }
.wa-link:hover { background: rgba(37,211,102,.15); }
.wa-link i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #25d366; color: #fff; flex: none; }
.wa-link span { display: flex; flex-direction: column; line-height: 1.25; }
.wa-link b { font-size: 13px; }
.wa-link small { color: var(--muted); font-size: 12px; }
.wa-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #25d366; color: #fff; font-weight: 700; font-size: 13px; margin-right: 8px; }
.wa-chip i { display: grid; place-items: center; }
.wa-chip:hover { filter: brightness(1.06); }
@media (max-width: 600px) { .wa-chip span { display: none; } .wa-chip { padding: 8px; } }
.usage-card { padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.usage-card .uc-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.usage-card .uc-who { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; }
.usage-card .uc-num { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.bar { height: 6px; margin-top: 10px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .4s; }
.usage-card .btn-soft { width: 100%; margin-top: 12px; }
.side-row { display: flex; gap: 8px; }
.side-row > * { flex: 1; }

.main { min-width: 0; display: flex; flex-direction: column; padding: 0 28px 140px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .menu-btn { display: none; }
.scrim { display: none; }

/* ---------- primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border-radius: 14px;
  background: var(--grad); color: #1d1305;
  font-weight: 800; letter-spacing: -.01em;
  box-shadow: var(--glow);
  transition: transform .12s, filter .15s, opacity .15s;
}
.btn-primary:hover { filter: brightness(1.05) saturate(1.05); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary kbd { background: rgba(0, 0, 0, .14); border-color: rgba(0, 0, 0, .12); color: #3b2508; }
.btn-soft, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-soft { background: var(--panel-3); border: 1px solid var(--line-2); }
.btn-soft:hover { border-color: var(--accent); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 700; font-size: 13px;
}
.chip:hover { border-color: var(--line-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.gold { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--panel-3); color: var(--muted); }
.tag.gold { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }

.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a39cb6' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field small { color: var(--faint); font-size: 12px; }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 38px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .35); }
.seg button.on .ic { color: var(--accent); }
.seg.sm button { padding: 5px 10px; font-size: 12.5px; }

.switch { position: relative; display: inline-block; vertical-align: middle; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: #22c55e; }
.switch input:not(:checked) + i::after { box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.sw-label { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--faint); vertical-align: middle; }
.sw-label.on { color: #16a34a; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }

.avatar {
  --h: 30;
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 13px;
  font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 80% 45%));
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.avatar.lg { width: 50px; height: 50px; border-radius: 15px; font-size: 19px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12.5px; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; z-index: 100; right: 20px; top: 20px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  max-width: 380px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-weight: 600; font-size: 13.5px;
  animation: toast-in .25s ease-out;
}
.toast.ok .ic { color: var(--ok); }
.toast.err .ic { color: var(--danger); }
.toast.info .ic { color: var(--accent); }
.toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(5, 4, 10, .6); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-box {
  position: relative; width: min(560px, 100%); max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-box.wide { width: min(880px, 100%); height: min(86vh, 900px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { color: var(--faint); }
.empty b { color: var(--text); font-size: 16px; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.editor { position: relative; display: flex; flex-direction: column; min-height: calc(100vh - 230px); overflow: hidden; }
.editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.editor-tools { margin-left: auto; display: flex; gap: 4px; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.tool-btn:hover { color: var(--text); background: var(--panel-2); }
.progress-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; }
.progress-line::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--grad); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
.mode-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.editor textarea.write {
  flex: 1; width: 100%; min-height: 340px; resize: none;
  padding: 22px 24px; border: 0; outline: none; background: transparent;
  font-size: 17px; line-height: 1.75; letter-spacing: -.005em;
}
.editor textarea.write::placeholder { color: var(--faint); }
.editor textarea.write.mono { font-family: var(--mono); font-size: 14px; line-height: 1.7; }
textarea[dir=rtl], .rtl { font-family: var(--urdu); font-size: 19px; line-height: 2.1; }
.hint-bar { display: flex; align-items: center; gap: 10px; margin: 0 16px 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-weight: 600; font-size: 13px; }
.hint-bar .ic { color: var(--accent); }
.hint-bar button { margin-left: auto; color: var(--accent); font-weight: 800; }
.editor-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.editor-foot .stat b { color: var(--text); font-weight: 800; }
.editor-foot .limit { margin-left: auto; }
.editor-foot .limit.over { color: var(--danger); }
.srt-opts { display: flex; align-items: center; gap: 10px; padding: 0 18px 14px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* dialogue */
.cast { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 18px 6px; }
.cast-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.cast-chip .who { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.cast-chip .who b { font-size: 13px; }
.cast-chip .who span { font-size: 11.5px; color: var(--muted); }
.cast-chip .icon-btn { width: 28px; height: 28px; }
.spk-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.add-spk { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-weight: 700; font-size: 13px; }
.add-spk:hover { color: var(--text); border-color: var(--accent); }
.lines { display: flex; flex-direction: column; gap: 8px; padding: 10px 18px; overflow: auto; flex: 1; }
.line { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.line:focus-within { border-color: var(--line); background: var(--panel-2); }
.line .spk-badge { cursor: pointer; margin-top: 2px; }
.line textarea { flex: 1; min-height: 34px; resize: none; padding: 5px 2px; border: 0; outline: none; background: transparent; font-size: 15.5px; line-height: 1.6; overflow: hidden; }
.line .icon-btn { opacity: 0; }
.line:hover .icon-btn, .line:focus-within .icon-btn { opacity: 1; }
.add-line { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 4px 18px 16px; padding: 8px 12px; border-radius: 12px; color: var(--muted); font-weight: 700; }
.add-line:hover { color: var(--text); background: var(--panel-2); }

/* control panel */
.controls { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.ctl { padding: 12px; border-radius: 14px; }
.ctl + .ctl { border-top: 1px solid var(--line); border-radius: 0; }
.ctl-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ctl-label button { letter-spacing: 0; text-transform: none; font-size: 12px; color: var(--muted); font-weight: 700; }
.ctl-label button:hover { color: var(--accent); }
.voice-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 16px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.voice-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.voice-card .vc-info { flex: 1; min-width: 0; }
.voice-card b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.voice-card span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-card .ic { color: var(--faint); }
.recent { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.recent button { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.recent button:hover { color: var(--text); border-color: var(--line-2); }
.recent .avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; }
.dialogue-note { padding: 12px; border-radius: 14px; background: var(--panel-2); color: var(--muted); font-size: 13px; }
.slider { margin-bottom: 12px; }
.slider:last-child { margin-bottom: 0; }
.slider-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; font-size: 13px; font-weight: 700; }
.slider-top output { font-family: var(--mono); font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 6px; }
.slider-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); font-weight: 600; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; font-weight: 700; }
.opt-row small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.generate { margin: 8px 4px 4px; padding: 15px 18px; font-size: 15.5px; border-radius: 16px; }
.fine { margin: 6px 8px 4px; text-align: center; color: var(--faint); font-size: 12px; }

/* voice browser */
.vb { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; }
.vb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vb-filters .search { flex: 1 1 220px; }
.vb-filters .select { width: auto; min-width: 170px; flex: 0 1 auto; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 13px; color: var(--muted); }
.chip-toggle:hover { color: var(--text); }
.chip-toggle.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.vb-quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.vb-quick button { flex: none; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.vb-quick button:hover { color: var(--text); }
.vb-quick button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.vb-count { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.vb-list { overflow: auto; min-height: 0; flex: 1; }
.vb-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-content: start; }
.vb-list.rows { display: flex; flex-direction: column; gap: 4px; margin: 0 -8px; padding: 0 8px; }
.vitem { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.vb-list.rows .vitem { cursor: pointer; }
.vb-list.rows .vitem:hover { background: var(--panel-2); }
.vb-list.grid .vitem { background: var(--panel); border-color: var(--line); padding: 14px; }
.vb-list.grid .vitem:hover { border-color: var(--line-2); }
.vitem.sel { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.vinfo { flex: 1; min-width: 0; }
.vname { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14.5px; }
.vsub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.play-sm { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--panel-3); color: var(--text); transition: background .15s, color .15s, transform .12s; }
.play-sm:hover { background: var(--accent); color: var(--accent-ink); transform: scale(1.05); }
.play-sm.playing { background: var(--accent); color: var(--accent-ink); }
.star { color: var(--faint); }
.star.on { color: var(--accent); }
.star.on .ic { fill: currentColor; }

/* voices page */
.page-card { padding: 18px; }
.voices-page { height: calc(100vh - 110px); display: flex; flex-direction: column; }
.voices-page .vb { flex: 1; }

/* history */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.h-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.h-item .h-main { flex: 1; min-width: 0; }
.h-item .h-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-item .h-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.h-item .h-keep { color: var(--accent); font-weight: 600; }
.hist-note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 4px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13.5px; }
.hist-note svg { flex: none; color: var(--accent); }
.hist-note a { color: var(--accent); font-weight: 600; }
.h-actions { display: flex; gap: 4px; }

/* player */
.player {
  position: fixed; z-index: 40; left: 284px; right: 24px; bottom: 18px;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px 12px 12px; border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .65);
  animation: rise .3s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
.play-btn { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; flex: none; background: var(--grad); color: #1d1305; box-shadow: var(--glow); transition: transform .12s; }
.play-btn:hover { transform: scale(1.05); }
.pl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-meta { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 13px; }
.pl-meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta span { color: var(--muted); white-space: nowrap; font-size: 12px; }
.pl-meta .pl-time { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.wave { width: 100%; height: 40px; cursor: pointer; display: block; }
.pl-caption { min-height: 18px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-caption b { color: var(--text); font-weight: 700; }
.pl-actions { display: flex; align-items: center; gap: 6px; }
.rate-btn { font-family: var(--mono); font-size: 12px; font-weight: 600; min-width: 46px; padding: 6px 8px; border-radius: 9px; background: var(--panel-3); color: var(--muted); }
.rate-btn:hover { color: var(--text); }

/* lexicon */
.lex-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.lex-row .ic { color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; background: var(--bg-2); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .5); }
  .topbar .menu-btn { display: inline-grid; }
  .main { padding: 0 16px 170px; }
  .topbar { padding: 14px 0 12px; }
  .topbar h1 { font-size: 19px; }
  .studio { grid-template-columns: 1fr; }
  .controls { position: static; }
  .editor { min-height: 0; }
  .editor textarea.write { min-height: 260px; padding: 18px; font-size: 16px; }
  .player { left: 10px; right: 10px; bottom: 10px; flex-wrap: wrap; gap: 10px 12px; padding: 10px; }
  .play-btn { width: 44px; height: 44px; }
  .pl-actions { width: 100%; justify-content: flex-end; }
  .voices-page { height: auto; }
  .vb-list { overflow: visible; }
  .modal { padding: 0; align-items: end; }
  .modal-box, .modal-box.wide { width: 100%; height: auto; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-box.wide { height: 92vh; }
  .vb-list.rows { overflow: auto; }
  .toasts { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 520px) {
  .editor-head .seg button span { display: none; }
  .editor-tools .tool-btn span { display: none; }
  .vb-filters .select { flex: 1 1 100%; }
  .lex-row { grid-template-columns: 1fr 1fr auto; }
  .lex-row > .ic { display: none; }
}

/* ---------- docs & admin pages ---------- */
.page-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); }
.page-top .brand { padding: 0; }
.page-top .brand svg { width: 34px; height: 34px; }
.page-top nav { display: flex; gap: 4px; margin-left: 12px; }
.page-top nav a { padding: 8px 12px; border-radius: 10px; font-weight: 700; color: var(--muted); font-size: 14px; }
.page-top nav a:hover { color: var(--text); background: var(--panel-2); }
.page-top nav a.on { color: var(--text); background: var(--panel-2); }
.page-top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.docs { position: relative; z-index: 1; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; max-width: 1180px; margin: 0 auto; padding: 32px 28px 120px; }
.toc { position: sticky; top: 90px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc b { margin: 14px 10px 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.toc a { padding: 6px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.toc a:hover, .toc a.on { color: var(--text); background: var(--panel-2); }
.doc-body { min-width: 0; }
.doc-body section { scroll-margin-top: 90px; padding-bottom: 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
.doc-body section:last-child { border-bottom: 0; }
.doc-body h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.doc-body h3 { margin: 26px 0 10px; font-size: 16px; font-weight: 800; }
.doc-body p, .doc-body li { color: var(--muted); font-size: 15px; line-height: 1.7; }
.doc-body p b, .doc-body li b { color: var(--text); }
.doc-body code:not(pre code) { font-family: var(--mono); font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--panel-3); color: var(--text); }
.hero { padding: 34px; border-radius: 26px; background: radial-gradient(600px 300px at 100% 0%, rgba(255, 140, 70, .18), transparent 70%), var(--panel); border: 1px solid var(--line); margin-bottom: 34px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.hero h1 { margin: 16px 0 10px; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; max-width: 620px; color: var(--muted); font-size: 16px; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats div b { display: block; font-size: 24px; font-weight: 800; }
.hero-stats div span { color: var(--faint); font-size: 12.5px; font-weight: 700; }
.base-url { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; max-width: 560px; }
.base-url span { color: var(--faint); }
.base-url code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }
.method { padding: 3px 9px; border-radius: 7px; font-weight: 800; font-size: 11.5px; letter-spacing: .04em; }
.method.post { background: var(--accent-soft); color: var(--accent); }
.method.get { background: var(--ok-soft); color: var(--ok); }
.endpoint small { margin-left: auto; font-family: var(--font); color: var(--faint); font-weight: 600; }
.params { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.params th { text-align: left; padding: 10px 12px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.params td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.params td:first-child { white-space: nowrap; }
.params td:first-child code { color: var(--text); }
.params .req { margin-left: 6px; color: var(--accent); font-size: 11px; font-weight: 800; }
.params .type { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.code { margin: 14px 0; border-radius: 16px; overflow: hidden; background: #0e0d14; border: 1px solid #262337; }
.code-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 6px 0; background: #14121c; border-bottom: 1px solid #262337; }
.code-tabs button { padding: 8px 12px; border-radius: 9px 9px 0 0; font-size: 12.5px; font-weight: 700; color: #8b84a0; }
.code-tabs button.on { color: #f1edf8; background: #0e0d14; }
.code-tabs .copy { margin-left: auto; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; color: #8b84a0; font-size: 12px; font-weight: 700; }
.code-tabs .copy:hover { color: #f1edf8; background: #221f30; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: #e9e5f2; }
.code .s { color: #ffc97a; }
.code .k { color: #c4a7ff; }
.code .c { color: #6f6884; font-style: italic; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); font-size: 14px; line-height: 1.6; }
.callout .ic { color: var(--accent); margin-top: 2px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.step { padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.step i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #1d1305; font-style: normal; font-weight: 800; margin-bottom: 10px; }
.step b { display: block; margin-bottom: 4px; }
.step p { margin: 0; font-size: 13.5px; }
.playground { padding: 20px; }
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pg-grid .full { grid-column: 1 / -1; }
.pg-out { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pg-out audio { flex: 1; min-width: 240px; height: 40px; }
.pg-status { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* admin */
.admin { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 28px 100px; }
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(400px, 100%); padding: 30px; text-align: center; }
.login-box .brand { justify-content: center; margin-bottom: 18px; }
.login-box h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.login-box p { margin: 0 0 20px; color: var(--muted); }
.login-box form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { padding: 18px; }
.stat-card span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stat-card span .ic { color: var(--accent); }
.stat-card b { display: block; margin-top: 8px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-card small { color: var(--faint); font-size: 12px; font-weight: 600; }
.panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 18px 18px 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .col i { display: block; width: 100%; max-width: 34px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: var(--grad); opacity: .9; }
.chart .col.zero i { background: var(--line-2); }
.chart .col span { font-size: 10.5px; color: var(--faint); font-weight: 700; }
.chart .col:hover i { opacity: 1; filter: brightness(1.1); }
.chart.dense { gap: 2px; }
.chart.dense .col span { white-space: nowrap; overflow: visible; }
.an-stats { padding: 4px 4px 0; gap: 0; }
.an-stats .stat-card { border-right: 1px solid var(--line); }
.an-stats .stat-card:last-child { border-right: 0; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.blist { padding: 8px 0 12px; }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; padding: 7px 18px; }
.brow .bl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.brow .bl em { font-style: normal; color: var(--faint); font-weight: 700; font-size: 12px; margin-left: 6px; }
.brow b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.brow i { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.brow i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 3px; background: var(--accent); }
.k-plan { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.k-plan.off { color: var(--faint); font-weight: 600; }
.plan-pick { display: grid; gap: 8px; }
.plan-opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; }
.plan-opt span { color: var(--muted); font-size: 12.5px; grid-column: 1; }
.plan-opt small { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--faint); font-weight: 700; font-size: 12px; }
.plan-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-rows { display: grid; gap: 10px; }
.plan-row { display: grid; grid-template-columns: 2fr 1.4fr .8fr 1fr auto; gap: 10px; align-items: end; }
.plan-row label span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 760px) { .plan-row { grid-template-columns: 1fr 1fr; } }
.an-empty { padding: 26px 18px; color: var(--faint); font-size: 13px; text-align: center; }
.an-note { margin: 18px 4px 0; color: var(--faint); font-size: 12.5px; line-height: 1.6; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); vertical-align: 1px; }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } .an-stats .stat-card:nth-child(2) { border-right: 0; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 14px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--panel-2); }
.k-name b { display: block; }
.k-name small { color: var(--faint); }
.k-key { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.k-usage { min-width: 140px; }
.k-usage .bar { margin-top: 6px; height: 5px; }
.k-usage small { color: var(--faint); font-size: 12px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.presets button { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.presets button:hover, .presets button.on { color: var(--accent); border-color: var(--accent); }
.key-reveal { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px dashed var(--accent); font-family: var(--mono); font-size: 14px; word-break: break-all; }
.key-reveal code { flex: 1; }
.settings-body { padding: 4px 18px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .txt b { display: block; font-size: 14px; }
.set-row .txt small { color: var(--muted); font-size: 12.5px; }
.set-row .input, .set-row .select { width: 220px; }
.admin-tabs { margin: 22px 0 0; }

@media (max-width: 960px) {
  .page-top { padding: 12px 16px; gap: 10px; }
  .page-top nav { margin-left: 0; }
  .page-top nav a { padding: 7px 9px; font-size: 13px; }
  .page-top .brand span:last-child { display: none; }
  .docs { grid-template-columns: 1fr; padding: 20px 16px 100px; gap: 0; }
  .toc { display: none; }
  .hero { padding: 22px; }
  .steps { grid-template-columns: 1fr; }
  .pg-grid, .form-grid { grid-template-columns: 1fr; }
  .admin { padding: 18px 16px 80px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .set-row { flex-direction: column; align-items: stretch; }
  .set-row .input, .set-row .select { width: 100%; }
  .params td:first-child { white-space: normal; }
}


/* ---------- pricing & checkout ---------- */
.price-hero { position: relative; overflow: hidden; padding: 40px; text-align: center; }
.price-hero h2 { margin: 12px 0 8px; font-size: clamp(38px, 5.5vw, 66px); line-height: 1.02; letter-spacing: -.035em; }
.price-hero p { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 16.5px; }
.price-facts { display: flex; justify-content: center; gap: 36px; flex-wrap: wrap; margin-top: 26px; }
.price-facts div { color: var(--muted); font-size: 13px; }
.price-facts b { display: block; font-family: var(--display); font-weight: 500; font-size: 30px; color: var(--text); letter-spacing: -.02em; line-height: 1.15; }
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.pack { position: relative; padding: 22px 20px; border-radius: 22px; text-align: left; background: var(--panel); border: 1px solid var(--line); transition: transform .3s, border-color .2s, box-shadow .3s; }
.pack:hover { transform: translateY(-4px); border-color: var(--line-2); }
.pack.on { border-color: var(--accent); box-shadow: 0 30px 70px -36px var(--accent); transform: translateY(-4px); }
.pack .p-usd { font-family: var(--display); font-size: 44px; font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.pack .p-tok { margin-top: 4px; font-weight: 600; }
.pack .p-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.p-extra { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: rgba(34,197,94,.14); color: #16a34a; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.pack-rows { display: grid; gap: 8px; justify-items: start; }
.pack-row { display: flex; gap: 8px; align-items: end; }
.pack-row label span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.pack-row .input { width: 140px; }
.pack .p-usd small { font-family: var(--font, inherit); font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.sec-label { display: flex; align-items: center; gap: 8px; margin: 26px 2px -8px; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.sec-label .ic { color: var(--accent); }
.plan-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.uc-plan { display: flex; gap: 7px; align-items: flex-start; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 12px; line-height: 1.45; }
.uc-plan .ic { flex: none; margin-top: 2px; color: var(--accent); }
.uc-plan.off { background: var(--panel-2); color: var(--faint); }
.pack .p-badge { position: absolute; top: -11px; right: 16px; padding: 3px 11px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; }
.checkout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; margin-top: 18px; padding: 26px; }
.checkout h3 { margin: 0 0 12px; font-size: 22px; }
.methods { display: grid; gap: 10px; }
.method { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; text-align: left; border: 1px solid var(--line); background: var(--panel-2); transition: border-color .2s, background .2s; }
.method:hover { border-color: var(--line-2); }
.method.on { border-color: var(--accent); background: var(--accent-soft); }
.method .m-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #f3ba2f; color: #1e2026; font-weight: 800; font-size: 12px; flex: none; }
.method.trc20 .m-ic { background: #26a17b; color: #fff; }
.method.bep20 .m-ic { background: #f0b90b; color: #1e2026; }
.method b { display: block; font-size: 14.5px; }
.method small { color: var(--muted); font-size: 12.5px; }
.method .radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.method.on .radio { border: 6px solid var(--accent); }
.summary { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); }
.summary .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.summary .row b { color: var(--text); }
.summary .total { padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 15px; }
.summary .total b { font-family: var(--display); font-size: 30px; font-weight: 500; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.how div { padding: 20px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.how b { display: block; color: var(--text); font-size: 15px; margin: 10px 0 2px; }
.how i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-family: var(--display); font-size: 17px; }
.pay-lines { display: grid; gap: 10px; margin: 14px 0; }
.pay-lines small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.copy-row span { flex: 1; }
.pay-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; font-size: 14px; }
.pay-status { margin: 12px 0; text-align: center; color: var(--muted); font-size: 14px; }
.tx-box { padding: 14px; border-radius: 14px; border: 2px solid var(--accent); }
.tx-box b { display: block; font-size: 14.5px; }
.tx-box small { color: var(--muted); font-size: 12.5px; }
.tx-box .input { margin-top: 10px; }
.tx-box .btn-primary { width: 100%; margin-top: 8px; }
.guide { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--panel-2); font-size: 13.5px; color: var(--muted); }
.guide b { color: var(--text); }
.guide ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.pending-chip { border-color: var(--accent); color: var(--accent); }
.done-tick { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.ai-box { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 26px; border-radius: 24px; border: 1px solid var(--accent); background: radial-gradient(500px 220px at 0% 0%, var(--accent-soft), transparent 70%), var(--panel); margin-bottom: 34px; }
.ai-box h3 { margin: 8px 0 6px; font-size: 28px; }
.ai-box p { margin: 0; color: var(--muted); font-size: 14.5px; }
.ai-box .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ai-box .actions { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
@media (max-width: 960px) {
  .packs { grid-template-columns: 1fr 1fr; }
  .checkout { grid-template-columns: 1fr; padding: 18px; }
  .how { grid-template-columns: 1fr; }
  .price-hero { padding: 28px 18px; }
  .ai-box { grid-template-columns: 1fr; }
  .ai-box .actions { min-width: 0; }
}

/* ---------- shared helpers for the newer sections (original look) ---------- */
:root { --display: var(--font); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.g { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-hero h2, .pack .p-usd, .summary .total b, .price-facts b, .usage-card .uc-big, .ai-box h3, .checkout h3 { font-weight: 800; letter-spacing: -.03em; }
.price-hero h2 { margin: 12px 0 8px; }
.price-hero { background: radial-gradient(600px 300px at 100% 0%, rgba(255, 140, 70, .16), transparent 70%), var(--panel); }
.usage-card .uc-big { margin-top: 4px; font-size: 26px; line-height: 1.15; }
.usage-card .uc-big small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.how i, .done-tick { font-family: var(--font); font-weight: 800; }
.how i { background: var(--grad); color: #1d1305; }
.pack .p-badge { background: var(--grad); color: #1d1305; }
.pack.on { box-shadow: var(--glow); }
.method.on .radio { border-color: var(--accent); }
.tx-box { border-color: var(--accent); }
.callout + .stats, .callout { margin-top: 18px; }
.expr-grid { display: grid; gap: 10px; }
.expr-grid .select { width: 100%; }
.expr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.expr-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tag-groups { display: grid; gap: 14px; }
.tag-groups b { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chips button { padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tag-chips button:hover { color: var(--text); border-color: var(--accent); }

.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px 0 4px; }
.pay-qr svg { width: 180px; height: 180px; padding: 6px; border-radius: 14px; background: #fff; }
.pay-qr small { color: var(--muted); font-size: 12px; }

/* ---------- voice cards v2 ---------- */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; }
.tag { white-space: nowrap; flex: none; gap: 3px; }
.vname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vname .vn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-list.grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.vb-list.grid .vitem.vcard { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; border-radius: 18px; }
.vc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vc-top .vinfo { flex: 1; min-width: 0; }
.vc-top .star { align-self: flex-start; }
.vcard .vname { font-size: 16px; }
.vmeta { display: flex; gap: 6px; margin-top: 6px; overflow: hidden; }
.vtraits { padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 10px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; text-align: left; }
.vid span { flex: none; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.vid code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 12.5px; }
.vid svg { flex: none; }
.vid:hover { border-color: var(--accent); color: var(--accent); }
#voiceId { margin-top: 8px; }
.vc-actions { display: flex; gap: 8px; }
.vc-actions > * { flex: 1; }
.play-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2); font-weight: 700; font-size: 13px; transition: background .15s, color .15s, border-color .15s; }
.play-pill:hover, .play-pill.playing { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vb-list.rows .vname .tag { font-size: 10px; }
.voice-card b .tag { font-size: 10px; }

/* API key card (account) */
.key-card { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); }
.kc-label { font-weight: 800; margin-bottom: 10px; }
.kc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kc-key { flex: 1 1 200px; min-width: 0; padding: 11px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-btn { border: 1px solid var(--line-2); border-radius: 50%; }
.kc-ai { padding: 8px 14px; }
.kc-btn.on { color: var(--accent); border-color: var(--accent); }
.key-field { display: flex; align-items: center; gap: 8px; }
.key-field .input { flex: 1; min-width: 0; }

.key-card small { display: block; margin-top: 10px; font-size: 12.5px; line-height: 1.5; }
