/* RustamSpeech studio — warm milk / graphite, rounded line icons. */
:root {
  --font: "Onest Variable", Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar-w: 236px;
  --r-card: 20px;
  --r-ctl: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfaf8;
  --card: #ffffff;
  --ink: #18171a;
  --ink-2: #4f4a46;
  --muted: #8b847e;
  --line: #ece8e3;
  --line-2: #e2ddd6;
  --tint: rgba(96, 24, 0, .035);
  --tint-2: rgba(96, 32, 0, .065);
  --tint-3: rgba(96, 32, 0, .1);
  --primary: #18171a;
  --primary-ink: #ffffff;
  --accent: #e2643b;
  --accent-soft: rgba(226, 100, 59, .12);
  --green: #2f8a5b;
  --green-soft: rgba(47, 138, 91, .1);
  --amber: #b7791f;
  --amber-soft: rgba(183, 121, 31, .12);
  --shadow: 0 1px 2px rgba(40, 20, 0, .04), 0 8px 28px rgba(40, 20, 0, .045);
  --shadow-pop: 0 18px 60px rgba(40, 20, 0, .16);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161514;
  --card: #1f1e1c;
  --ink: #f4f1ec;
  --ink-2: #cdc6bd;
  --muted: #8f877e;
  --line: #2c2a27;
  --line-2: #35322e;
  --tint: rgba(255, 236, 214, .035);
  --tint-2: rgba(255, 236, 214, .065);
  --tint-3: rgba(255, 236, 214, .1);
  --primary: #f4f1ec;
  --primary-ink: #18171a;
  --accent: #ff8458;
  --accent-soft: rgba(255, 132, 88, .14);
  --green: #5cc28c;
  --green-soft: rgba(92, 194, 140, .12);
  --amber: #e2a94b;
  --amber-soft: rgba(226, 169, 75, .14);
  --shadow: none;
  --shadow-pop: 0 18px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flip { transform: rotate(180deg); }
[data-theme="light"] .only-dark, [data-theme="dark"] .only-light { display: none; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; padding: 0 12px 12px 0; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar h1 { margin: 0; font-size: 14px; font-weight: 500; }
.main { flex: 1; min-height: 0; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; position: relative; }
.view { height: 100%; }
.page { overflow-y: auto; padding: 32px 36px 120px; }

/* Sidebar */
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); font-weight: 450; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--tint); color: var(--ink); }
.nav-item.active { background: var(--tint-2); color: var(--ink); font-weight: 500; }
.nav-item svg { width: 17px; height: 17px; }
.nav-soon { margin-left: auto; font-size: 11px; color: var(--muted); }
.nav-caption { margin: 14px 12px 4px; font-size: 12px; color: var(--muted); }
.sidebar-recent { flex: 1; min-height: 0; overflow-y: auto; }
.recent { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); font-size: 13px; text-align: left; }
.recent:hover { background: var(--tint); }
.recent span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--line-2); }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }
.usage-card { padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #fde9de, #f3e6f4 55%, #e3ecf7); color: #2b2622; }
[data-theme="dark"] .usage-card { background: linear-gradient(135deg, #3a2a22, #31283a 55%, #232c38); color: var(--ink); }
.usage-top { display: flex; justify-content: space-between; font-size: 12px; }
.usage-top b { font-weight: 600; }
.usage-card p { margin: 4px 0 0; font-size: 12px; opacity: .75; line-height: 1.4; }

/* Controls */
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--ink-2); transition: background .15s; }
.icon-btn:hover { background: var(--tint-2); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 500; white-space: nowrap; transition: background .15s, opacity .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: .88; }
.btn.primary:disabled { opacity: .3; pointer-events: none; }
.btn.ghost { border: 1px solid var(--line-2); background: var(--card); }
.btn.ghost:hover { background: var(--tint); }
.btn.ghost:disabled { opacity: .4; pointer-events: none; }
kbd { font: inherit; font-size: 11px; opacity: .55; margin-left: 2px; }
.chip-btn { height: 30px; min-width: 44px; padding: 0 10px; border-radius: 999px; background: var(--tint-2); font-size: 12px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--tint-2); color: var(--ink-2); font-size: 11px; font-weight: 500; white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.proto-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--tint-2); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.proto-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.accent-glyph { font-size: 16px; font-weight: 500; line-height: 1; }
.segmented { display: flex; padding: 2px; border-radius: 999px; background: var(--tint); border: 1px solid var(--tint-2); }
.segmented button { flex: 1; height: 32px; border-radius: 999px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s; }
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
[data-theme="dark"] .segmented button.active { background: var(--tint-3); }
.segmented.small button { height: 30px; font-size: 13px; }
.seg-count { font-size: 11px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--muted); }
.search input { border: 0; outline: 0; background: none; color: var(--ink); width: 180px; }
.search.wide { flex: 1; }
.search.wide input { width: 100%; }
.search:focus-within { border-color: var(--ink-2); }

/* Voice orb avatars */
.orb { --a: #c9b8ff; --b: #ffd6c2; --c: #8ec5ff; position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .9), transparent 32%), radial-gradient(circle at 70% 75%, var(--c), transparent 60%), linear-gradient(140deg, var(--a), var(--b)); box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .08); }
.orb.sm { width: 28px; height: 28px; }
.orb.xs { width: 20px; height: 20px; }
.orb.lg { width: 64px; height: 64px; }
.orb[data-voice="pavel"] { --a: #8fb3d9; --b: #d7e3ee; --c: #4f7aa8; }
.orb[data-voice="maria"] { --a: #f2b8a2; --b: #fde3d6; --c: #d9826b; }
.orb[data-voice="anna"]  { --a: #d6b8f0; --b: #f7dcec; --c: #a685d6; }
.orb[data-voice="lev"]   { --a: #e7c18b; --b: #f4e3c6; --c: #b0793a; }
.orb[data-voice="ru_artem"]   { --a: #8fd8e0; --b: #dff5f2; --c: #2f9fb3; }
.orb[data-voice="ru_igor"]    { --a: #9aa9c9; --b: #dfe5f0; --c: #47608f; }
.orb[data-voice="ru_nikolay"] { --a: #d9b48f; --b: #f2e4d3; --c: #96683f; }
.orb[data-voice="ru_gleb"]    { --a: #7f8791; --b: #c4c9cf; --c: #3b4149; }
.orb[data-voice="ru_roman"]   { --a: #f0a772; --b: #fbe0c4; --c: #d0662c; }
.orb[data-voice="ru_mikhail"] { --a: #a4c8a0; --b: #e4f0dc; --c: #5c9259; }
.orb[data-voice="ru_timur"]   { --a: #a9e07c; --b: #eaf8c9; --c: #62b032; }
.orb[data-voice="ru_vera"]    { --a: #9d7fb5; --b: #dccde8; --c: #5f3f7d; }
.orb[data-voice="ru_elena"]   { --a: #d99a9f; --b: #f5dcdc; --c: #a85b63; }
.orb[data-voice="ru_polina"]  { --a: #bcd4ee; --b: #eef4fb; --c: #8bb0d8; }
.orb[data-voice="ru_kira"]    { --a: #a5757a; --b: #e0c5c4; --c: #6e3f46; }
.orb[data-voice="ru_marina"]  { --a: #f2d06b; --b: #fcf0c4; --c: #d39f1f; }
.orb.playing::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: .7; animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.95); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }

/* Workspace: editor + panel */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100%; }
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 12px; position: relative; }
#view-studio .editor-scroll { display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
#quickText { flex: 1; width: 100%; min-height: 220px; resize: none; border: 0; outline: 0; background: none; font-size: 16px; line-height: 1.75; color: var(--ink); }
#quickText::placeholder { color: var(--muted); }
.quick-clear { position: absolute; top: 18px; right: 20px; z-index: 1; }
.speaker-chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 4px; margin-bottom: 6px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.speaker-chip:hover { background: var(--tint); }
.empty-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; pointer-events: none; padding: 40px; }
.empty-hint > * { pointer-events: auto; }
.empty-hint h2 { margin: 10px 0 0; font-size: 16px; font-weight: 600; }
.empty-hint p { margin: 0 0 10px; max-width: 380px; color: var(--muted); }
.empty-orb { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #fff, transparent 40%), conic-gradient(from 200deg, #ffd8c6, #f2d3f0, #cfe0fb, #ffe4c2, #ffd8c6); filter: saturate(1.05); animation: spin 18s linear infinite; }
[data-theme="dark"] .empty-orb { opacity: .85; }
.empty-orb span { width: 48px; height: 48px; border-radius: 50%; background: var(--card); opacity: .55; }
@keyframes spin { to { transform: rotate(360deg); } }
.editor-bottom { padding: 10px 20px 16px; border-top: 1px solid transparent; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.examples > span { width: 100%; font-size: 12px; color: var(--muted); }
.example { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; transition: background .15s; }
.example:hover { background: var(--tint); }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-group, .generate-group { display: flex; align-items: center; gap: 6px; }
.generate-group { gap: 14px; }
.counter { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.panel { border-left: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.panel-body { display: flex; flex-direction: column; gap: 22px; padding: 4px 2px 80px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { display: flex; align-items: center; justify-content: space-between; font-weight: 500; }
.field-sub { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.voice-select { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line-2); text-align: left; transition: background .15s; }
.voice-select:hover { background: var(--tint); }
.voice-select b, .model-card b, .link-row b { display: block; font-weight: 500; }
.voice-select small, .model-card small, .link-row small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-card > div, .link-row > span:nth-child(2) { min-width: 0; }
.voice-select > div { flex: 1; min-width: 0; }
.voice-select .mini-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-2); }
.voice-select .mini-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.model-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--tint); }
.model-card > div { flex: 1; }
.model-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--card); border: 1px solid var(--line-2); }

.bar-slider { position: relative; display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 14px; border-radius: var(--r-ctl); background: var(--tint); overflow: hidden; cursor: ew-resize; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--fill, 50%); background: var(--tint-3); border-right: 2px solid var(--accent); transition: width .12s; }
.bar-name, .bar-value { position: relative; font-weight: 500; font-size: 13px; pointer-events: none; }
.bar-value { font-variant-numeric: tabular-nums; }
.bar-slider input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.bar-slider:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.qa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qa-list li { display: flex; gap: 10px; }
.qa-list svg { color: var(--green); margin-top: 1px; }
.qa-list b { display: block; font-weight: 500; font-size: 13px; }
.qa-list small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.link-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 16px; border: 1px solid var(--line-2); text-align: left; }
.link-row:hover { background: var(--tint); }
.link-row > span:nth-child(2) { flex: 1; }
.link-row .accent-glyph { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }

/* History */
.history-empty { text-align: center; padding: 48px 12px; color: var(--muted); }
.history-empty svg { width: 28px; height: 28px; margin-bottom: 8px; }
.history-empty h3 { margin: 0 0 4px; font-size: 14px; color: var(--ink); font-weight: 500; }
.history-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); }
.history-item:hover { background: var(--tint); }
.history-row { display: flex; align-items: center; gap: 10px; }
.history-row > div { flex: 1; min-width: 0; }
.history-row b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row small { color: var(--muted); font-size: 12px; }
.history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Project editor */
.project-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#projectTitle { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 600; padding: 4px 6px; border-radius: 8px; }
#projectTitle:focus { background: var(--tint); }
.save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.project-top-actions { display: flex; align-items: center; gap: 6px; }
#blocks { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.block { position: relative; padding: 12px 14px 12px 16px; border-radius: 16px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.block:hover { background: var(--tint); }
.block.selected { border-color: var(--line-2); background: var(--card); box-shadow: var(--shadow); }
.block.selected::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.block-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 20px; }
.voice-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 4px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.voice-pill:hover { background: var(--tint-2); }
.voice-pill svg { width: 14px; height: 14px; color: var(--muted); }
.block-head .spacer { flex: 1; }
.block-tools { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .15s; }
.block:hover .block-tools, .block.selected .block-tools { opacity: 1; }
.block-tools .icon-btn { width: 30px; height: 30px; }
.block-tools .icon-btn svg { width: 16px; height: 16px; }
.block-tools .icon-btn.on { color: var(--accent); }
.block textarea { width: 100%; resize: none; border: 0; outline: 0; background: none; font-size: 15px; line-height: 1.7; padding: 0 0 0 28px; min-height: 52px; overflow: hidden; }
.block .play-sm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.block .play-sm svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.block .play-sm:disabled { background: var(--tint-2); color: var(--muted); }
.project-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.project-summary span { display: inline-flex; align-items: center; gap: 6px; }
.project-summary i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.insp-head { display: flex; align-items: center; justify-content: space-between; }
.insp-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.insp-card { padding: 14px; border-radius: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.insp-card h4 { margin: 0; font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.metric { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.metric span:first-child { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.metric svg { width: 16px; height: 16px; color: var(--green); }
.take { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--tint); font-size: 13px; }
.take > div { flex: 1; }
.take small { display: block; color: var(--muted); font-size: 12px; }

/* Projects */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2, .voices-hero h2, .create-center h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.page-head p, .voices-hero p, .create-center p { margin: 6px 0 0; color: var(--muted); max-width: 560px; }
.page-actions { display: flex; gap: 10px; align-items: center; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); text-align: left; min-height: 170px; transition: background .15s, border-color .15s, transform .15s; }
.project-card:hover { background: var(--tint); border-color: var(--line-2); transform: translateY(-1px); }
.project-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.project-card p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.project-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.orb-stack { display: flex; }
.orb-stack .orb { margin-left: -6px; border: 2px solid var(--card); }
.orb-stack .orb:first-child { margin-left: 0; }
.project-card.new { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
.project-card.new svg { width: 22px; height: 22px; }

/* Voices */
.voices-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px; align-items: center; margin-bottom: 24px; }
.hero-words { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: flex-end; color: var(--muted); font-size: 14px; mask-image: linear-gradient(90deg, transparent, #000 30%); }
.hero-words span:nth-child(3n) { color: var(--accent); }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.filters.compact { margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; transition: background .15s, border-color .15s; }
.chip:hover { background: var(--tint); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 4px 0 14px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 36px; }
.voice-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.voice-card:hover { background: var(--tint); border-color: var(--line-2); }
.voice-top { display: flex; gap: 12px; align-items: center; }
.voice-top > div { flex: 1; min-width: 0; }
.voice-top h3 { margin: 0; font-size: 15px; font-weight: 600; }
.voice-top p { margin: 0; color: var(--muted); font-size: 13px; }
.voice-desc { margin: 0; font-size: 13px; color: var(--ink-2); }
/* likes and «озвучили» (2026-11-20): quiet, inside the existing card rows */
.pop-users { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pop-users svg { width: 12px; height: 12px; }
.icon-btn.fav.has-n { width: auto; min-width: 36px; padding: 0 9px; gap: 4px; display: inline-flex; }
.fav-n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.voice-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.voice-tags > .flag { width: 24px; height: 16px; border-radius: 3px; margin-right: 2px; }
.voice-tags > .flag-ml { width: 16px; height: 16px; border-radius: 50%; }
.mini-wave { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 14px; background: var(--tint); }
.mini-wave .play-sm { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.mini-wave .play-sm svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.mini-wave svg.wf { flex: 1; width: auto; height: 28px; stroke: var(--line-2); stroke-width: 2; }
[data-theme="dark"] .mini-wave svg.wf { stroke: #4a4540; }
.mini-wave svg.wf .on { stroke: var(--accent); }
.mini-wave small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.voice-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Equal-height catalog cards: fixed rows, nothing wraps. */
.voice-grid .voice-card { gap: 10px; }
.voice-grid .voice-top p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-grid .voice-top h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-grid .voice-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; min-height: 3em; }
.voice-grid .voice-tags { flex-wrap: nowrap; overflow: hidden; min-height: 22px; }
.voice-grid .voice-tags .tag { flex: none; }
.voice-grid .voice-foot { margin-top: auto; padding-top: 2px; }
.voice-grid .voice-foot .mini-wave { flex: 1; min-width: 0; padding: 6px 10px 6px 6px; }
.voice-grid .voice-foot .mini-wave small { display: none; }
.voice-grid .voice-foot .btn { flex: none; }
.qa-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); }
.qa-badge svg { width: 15px; height: 15px; }
.voice-foot .actions { display: flex; gap: 6px; align-items: center; }
.fav.on { color: var(--accent); }
.fav.on svg { fill: currentColor; }

.create-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.create-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; background: var(--tint); overflow: hidden; text-align: left; }
.create-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.create-card p { margin: 0; color: var(--muted); font-size: 13px; }
.create-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.create-card .art { position: absolute; right: -18px; top: -18px; width: 96px; height: 96px; border-radius: 50%; opacity: .55; background: radial-gradient(circle at 35% 35%, #fff, transparent 40%), conic-gradient(from 90deg, #ffd8c6, #f2d3f0, #cfe0fb, #ffd8c6); }
.create-card > :not(.art) { position: relative; }
.create-card .icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--card); }
.create-center { max-width: 760px; margin: 40px auto 0; text-align: center; }
.create-center p { margin: 8px auto 28px; }
.create-grid.big { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Voice cloning */
.clone-flow { text-align: left; display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.clone-card { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 14px; }
.clone-card h3 { margin: 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.clone-card h3 .icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.clone-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.clone-tips div { padding: 10px 12px; border-radius: 12px; background: var(--tint); font-size: 12px; color: var(--ink-2); }
.clone-tips b { display: block; font-size: 13px; color: var(--ink); font-weight: 500; }
.drop { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1.5px dashed var(--line-2); cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--tint); border-color: var(--ink-2); }
.drop .icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-2); flex: none; }
.drop b { display: block; font-weight: 500; }
.drop small { color: var(--muted); font-size: 12px; }
.clone-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.clone-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.clone-row input[type=text], .clone-card textarea { height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); outline: 0; font-size: 14px; }
.clone-card textarea { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.6; resize: vertical; font-family: inherit; }
.consent { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; color: var(--ink-2); }
.consent input { margin-top: 3px; accent-color: var(--ink); }
.clone-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.clone-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.busy-line { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.flag { display: inline-block; width: 18px; height: 12px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08); vertical-align: -1px; }
.flag-ru { background: linear-gradient(#fff 33.3%, #1c57a7 33.3% 66.6%, #d52b1e 66.6%); }
.flag-us { background: linear-gradient(#3c3b6e, #3c3b6e) 0 0 / 45% 54% no-repeat, repeating-linear-gradient(#b22234 0 7.7%, #fff 7.7% 15.4%); }
.flag-de { background: linear-gradient(#111 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%); }
.flag-fr { background: linear-gradient(90deg, #0055a4 33.3%, #fff 33.3% 66.6%, #ef4135 66.6%); }
.flag-it { background: linear-gradient(90deg, #009246 33.3%, #fff 33.3% 66.6%, #ce2b37 66.6%); }
.flag-es { background: linear-gradient(#aa151b 25%, #f1bf00 25% 75%, #aa151b 75%); }
.flag-br { background: #009c3b; position: relative; overflow: hidden; }
.flag-br::after { content: ""; position: absolute; inset: 15% 12%; background: #ffdf00; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); z-index: 0; }
.flag-br::before { content: ""; position: absolute; left: 36%; top: 26%; width: 28%; height: 48%; border-radius: 50%; background: #002776; z-index: 1; }
.flag-cn { background: radial-gradient(circle at 22% 30%, #ffde00 0 12%, transparent 13%), #de2910; }
.flag-jp { background: radial-gradient(circle at 50% 50%, #bc002d 0 28%, transparent 29%), #fff; }
.flag-kr { background: radial-gradient(circle at 50% 38%, #cd2e3a 0 18%, transparent 19%), radial-gradient(circle at 50% 62%, #0047a0 0 18%, transparent 19%), #fff; }
.flag-ml { background: conic-gradient(#de2910, #ffce00, #009246, #0055a4, #3c3b6e, #de2910); border-radius: 50%; width: 12px; }
.lang-select { position: relative; }
.lang-button { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line-2); text-align: left; font-weight: 500; }
.lang-button:hover { background: var(--tint); }
.lang-button .grow { flex: 1; }
.lang-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); padding: 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; animation: pop .15s var(--ease); }
.lang-menu button { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; font-size: 13px; text-align: left; }
.lang-menu button:hover { background: var(--tint); }
.lang-menu button.on { background: var(--tint-2); font-weight: 500; }
.flags { display: inline-flex; gap: 3px; align-items: center; }
.lang-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.orb[data-voice^="clone_"] { --a: #b7d9c6; --b: #f3ecd8; --c: #6fae8e; }

/* Create voice */
.create-root { max-width: 1040px; margin: 0 auto; }
.create-pick { max-width: 860px; margin: 48px auto 0; text-align: center; }
.create-pick h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.create-pick > p { margin: 8px auto 28px; color: var(--muted); max-width: 520px; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; text-align: left; }
.method { display: flex; align-items: center; gap: 14px; padding: 22px; border-radius: 20px; background: var(--tint); border: 1px solid transparent; text-align: left; min-height: 170px; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.method:hover { border-color: var(--line-2); background: var(--tint-2); transform: translateY(-2px); }
.method-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.method h3 { margin: 0; font-size: 17px; font-weight: 600; }
.method p { margin: 0; font-size: 13px; color: var(--muted); }
.method .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.method-art { flex: none; width: 150px; height: 110px; position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; }
.orb.ghost { --a: #e7e3de; --b: #f6f4f1; --c: #cfc9c1; }
[data-theme="dark"] .orb.ghost { --a: #4a4642; --b: #5a5550; --c: #3a3632; }
.art-wave { display: flex; align-items: center; gap: 3px; height: 40px; }
.art-wave i { width: 3px; border-radius: 3px; background: var(--accent); opacity: .75; height: 40%; }
.art-wave i:nth-child(2n) { height: 75%; } .art-wave i:nth-child(3n) { height: 55%; } .art-wave i:nth-child(5n) { height: 95%; }
.art-wave.live i { animation: bounce 1.2s ease-in-out infinite; }
.art-wave.live i:nth-child(2n) { animation-delay: .15s; } .art-wave.live i:nth-child(3n) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: scaleY(.45); } }
.design-art .bubble { position: absolute; left: 0; top: 14px; width: 74px; padding: 10px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 5px; }
.design-art .bubble i { height: 5px; border-radius: 4px; background: var(--line-2); } .design-art .bubble i:nth-child(2) { width: 70%; } .design-art .bubble i:nth-child(3) { width: 45%; background: var(--accent-soft); }
.design-art .orb { position: absolute; right: 6px; bottom: 6px; width: 72px; height: 72px; }
.create-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.create-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.upload-panel { border-radius: 20px; background: var(--tint); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.upload-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 320px; padding: 30px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: var(--card); cursor: default; transition: border-color .2s, background .2s; }
.upload-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop h3 { margin: 10px 0 0; font-size: 18px; font-weight: 600; }
.upload-drop p { margin: 0; color: var(--muted); font-size: 13px; }
.clone-illu { display: flex; align-items: center; gap: 10px; }
.clone-illu .orb { width: 84px; height: 84px; }
.upload-buttons { display: flex; gap: 8px; margin-top: 14px; }
.upload-buttons .btn { cursor: pointer; }
.btn.recording { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.meter { padding: 12px 14px 4px; }
.meter-top { display: flex; align-items: center; justify-content: space-between; }
.meter-top b { font-weight: 500; }
.meter small { color: var(--muted); font-size: 12px; }
.meter-bar { position: relative; height: 6px; border-radius: 6px; background: var(--tint-3); margin: 14px 0 6px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 6px; background: linear-gradient(90deg, #e2643b, #e6b34a 18%, #6cc28e 34%, #4fae7b); transition: width .5s var(--ease); }
.meter-bar .tick { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 2px; background: var(--ink-2); left: 11.1%; }
.meter-bar .tick.t30 { left: 33.3%; } .meter-bar .tick.t90 { left: calc(100% - 2px); }
.meter-labels { position: relative; height: 36px; font-size: 12px; }
.meter-labels span { position: absolute; transform: translateX(-50%); text-align: center; line-height: 1.2; }
.meter-labels .l10 { left: 11.1%; } .meter-labels .l30 { left: 33.3%; } .meter-labels .l90 { left: auto; right: 0; transform: none; text-align: right; }
.uploaded-panel { display: flex; flex-direction: column; gap: 12px; }
.uploaded-panel h3 { margin: 0; font-size: 16px; font-weight: 600; }
.uploaded-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line-2); }
.uploaded-item > div { flex: 1; min-width: 0; }
.uploaded-item b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploaded-item small { color: var(--muted); font-size: 12px; }
.uploaded-item .play-sm, .voice-summary + section .play-sm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); flex: none; }
.uploaded-item .play-sm svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.btn.wide { width: 100%; }
.details { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 20px; }
.details section { display: flex; flex-direction: column; gap: 10px; }
.details h3 { margin: 0; font-size: 16px; font-weight: 600; }
.details select { width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }
.details input[type=text], .details textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); outline: 0; font: inherit; font-size: 14px; resize: vertical; }
.details textarea { min-height: 76px; line-height: 1.6; }
.details input:focus, .details textarea:focus { border-color: var(--ink-2); }
.req { color: var(--accent); margin-right: 3px; }
.voice-summary { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; border: 1px solid var(--line); }
.voice-summary b { font-size: 15px; font-weight: 600; }
.voice-summary p { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.voice-summary .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-toggle { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; transition: background .15s, border-color .15s; }
.chip-toggle svg { width: 13px; height: 13px; }
.chip-toggle:hover { background: var(--tint); }
.chip-toggle.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.text-btn { font-size: 13px; color: var(--muted); padding: 0 6px; } .text-btn:hover { color: var(--ink); }
.access { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); }
.access > div { flex: 1; } .access b { display: block; font-weight: 500; } .access small { color: var(--muted); font-size: 12px; }
.access.on { border-color: var(--ink); } .access.off { opacity: .55; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); } .radio.on { border: 5px solid var(--ink); }
.consent-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--amber-soft); cursor: pointer; font-size: 13px; }
.consent-box.on { background: var(--green-soft); }
.consent-box input { margin-top: 3px; accent-color: var(--ink); }
.consent-box b { font-weight: 500; } .consent-box small { color: var(--ink-2); font-size: 12px; }
.details-actions { position: sticky; bottom: 0; display: flex; justify-content: center; gap: 10px; padding: 14px 0 4px; background: linear-gradient(transparent, var(--card) 30%); }
.details-actions .btn { min-width: 140px; } .details-actions .btn.primary { min-width: 220px; }
.details-actions.center { position: static; background: none; }
.done-orb { width: 96px; height: 96px; margin-bottom: 16px; display: inline-block; }
@media (max-width: 860px) { .method-grid, .upload-layout, .two-col { grid-template-columns: minmax(0, 1fr); } .method-art { width: 110px; } }

/* Dictionary */
.dict-explain { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: var(--tint); margin-bottom: 20px; flex-wrap: wrap; }
.dict-example { padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.dict-example .word { display: block; font-size: 18px; font-weight: 600; }
.dict-example small { color: var(--muted); font-size: 12px; }
.dict-explain p { flex: 1; min-width: 240px; margin: 0; color: var(--ink-2); font-size: 13px; }
.table { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tr { display: grid; grid-template-columns: 1fr 1fr 1.6fr 130px 44px; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.tr:first-child { border-top: 0; }
.tr.th { background: var(--tint); color: var(--muted); font-size: 12px; font-weight: 500; }
.tr .spoken { font-weight: 600; font-size: 15px; }
.tr .ctx { color: var(--muted); }
.table-empty { padding: 40px; text-align: center; color: var(--muted); }

/* Player */
.player { flex: none; margin-top: 10px; z-index: 20; display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 14px; border-radius: 20px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: rise .25s var(--ease); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.player-track { display: flex; align-items: center; gap: 10px; min-width: 0; }
#playerOrb { cursor: pointer; }
.player-track b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track > div { min-width: 0; }
.player-center { display: flex; align-items: center; gap: 12px; min-width: 0; }
.play-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.play-btn svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.wave { position: relative; flex: 1; height: 36px; min-width: 60px; }
.wave svg { width: 100%; height: 100%; stroke: var(--line-2); stroke-width: 2.4; }
[data-theme="dark"] .wave svg { stroke: #45403b; }
.wave svg .on { stroke: var(--accent); }
.wave svg .ready { stroke: #b5aea5; }
[data-theme="dark"] .wave svg .ready { stroke: #77706a; }
.wave svg .pending { stroke: var(--line-2); animation: shimmer 1.6s ease-in-out infinite; }
[data-theme="dark"] .wave svg .pending { stroke: #3d3935; }
@keyframes shimmer { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.player.streaming .play-btn:disabled { opacity: .35; }
.icon-btn.disabled { opacity: .35; cursor: default; }
.wave input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; margin: 0; }
.player-right { display: flex; align-items: center; gap: 4px; }

/* Modals */
.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 20px; border: 0; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop); }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(20, 14, 8, .28); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.form input, .form select { height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); outline: 0; font-weight: 400; font-size: 14px; }
.form input:focus, .form select:focus { border-color: var(--ink-2); }
.form .btn.sm { align-self: flex-start; }
.picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); text-align: left; }
.picker-item:hover { background: var(--tint); }
.picker-item.selected { border-color: var(--ink); }
.picker-item > div { flex: 1; min-width: 0; }
.picker-item b { display: block; font-weight: 600; }
.picker-item small { display: block; color: var(--muted); font-size: 12px; }
.picker-item .tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.export-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.export-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.export-row:hover { background: var(--tint); }
.export-row > div { flex: 1; }
.export-row b { display: block; font-weight: 500; }
.export-row small { color: var(--muted); font-size: 12px; }
.info p { margin: 0 0 10px; color: var(--ink-2); }
.info .step { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--tint); margin-bottom: 8px; }
.info .step b { display: block; font-weight: 500; }
.info .step small { color: var(--muted); }
.info .step span.n { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card); font-size: 12px; font-weight: 600; }

/* Live mode */
.auth-head { text-align: center; margin: 4px 0 18px; }
.auth-head h3 { margin: 8px 0 2px; font-size: 20px; font-weight: 600; }
.auth-head p { margin: 0; color: var(--muted); }
.auth-form { margin-top: 16px; }
.auth-form .btn { margin-top: 4px; }
.auth-error { color: var(--accent); min-height: 18px; margin-top: 10px; }
#authModal::backdrop { background: var(--bg); backdrop-filter: none; }
.invite-box { display: flex; gap: 8px; margin: 14px 0 8px; }
.invite-box input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--tint); font-size: 13px; }
.proto-pill.live i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.usage-card.live { background: var(--tint-2); color: var(--ink); }
.usage-card .usage-bar { height: 6px; border-radius: 6px; background: var(--tint-3); margin-top: 8px; overflow: hidden; }
.usage-card .usage-bar i { display: block; height: 100%; width: var(--used, 0%); background: var(--ink); border-radius: 6px; }
.usage-card .usage-actions { display: flex; gap: 6px; margin-top: 10px; }
.usage-card .usage-actions .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.job-progress { height: 4px; border-radius: 4px; background: var(--tint-2); overflow: hidden; }
.job-progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width .4s var(--ease); }
.job-stage { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--tint-3); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.qa-badge.warn { color: var(--amber); }
.qa-badge.fail { color: var(--accent); }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-accent { background: var(--accent); }
.grow { flex: 1; }

.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 13px; box-shadow: var(--shadow-pop); transition: opacity .2s, transform .2s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .voices-hero { grid-template-columns: 1fr; }
  .hero-words { display: none; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; background: var(--bg); transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .shell { padding: 0 8px 8px; height: auto; min-height: 100vh; }
  .main { overflow: visible; }
  .view { height: auto; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .editor-scroll { min-height: 46vh; }
  #quickText { min-height: 40vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .panel-body { padding-bottom: 110px; }
  .page { padding: 22px 16px 120px; overflow: visible; }
  .player { position: fixed; left: 8px; right: 8px; bottom: 8px; grid-template-columns: 1fr auto; }
  .player-track { display: none; }
  .tr { grid-template-columns: 1fr 1fr 44px; }
  .tr .ctx, .tr .scope { display: none; }
  .picker-list, .create-grid.big { grid-template-columns: minmax(0, 1fr); }
  .editor-actions { flex-wrap: wrap; }
  .project-top { flex-wrap: wrap; }
  #projectTitle { order: -1; flex-basis: 100%; }
  .project-top-actions { margin-left: auto; }
  .save-state { display: none; }
}
@media (max-width: 520px) {
  .proto-pill, .counter, kbd { display: none; }
  .generate-group { width: 100%; justify-content: flex-end; }
  .page-actions { width: 100%; }
  .page-actions .search { flex: 1; }
  .page-actions .search input { width: 100%; }
  #blocks { padding: 10px 8px 16px; }
  .block { padding: 10px; }
  .block-head { flex-wrap: wrap; }
  .block-head .spacer { display: none; }
  .block-tools { opacity: 1; margin-left: auto; }
  .block .play-sm { margin-left: auto; }
  .block textarea { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* voice from a description */
.design-wait { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 560px; margin: 32px auto; }
.design-wait h3 { font-size: 18px; font-weight: 500; margin: 0; }
.design-wait .meter-bar { width: 100%; margin: 4px 0; }
.design-wait p { margin: 0; color: var(--ink-2); }
.design-list { display: grid; gap: 10px; margin-top: 12px; }
.design-cand { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line-2); }
.design-cand.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.design-cand .mini-wave { flex: 1; min-width: 0; }
.design-cand .chip-toggle { flex: none; }
.design-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--tint-2, var(--tint-3)); color: var(--ink); }
@media (max-width: 560px) { .design-cand { flex-wrap: wrap; } .design-cand .chip-toggle { width: 100%; justify-content: center; } }
.design-cand { cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.design-cand:hover { background: var(--tint-1, transparent); }
.design-cand .mini-wave { cursor: default; }
.details input.invalid { border-color: #e2643b; box-shadow: 0 0 0 1px #e2643b inset; }
.design-error[role="alert"] { border: 1px solid #e2643b; }
.mini-wave svg.wf { cursor: pointer; } .design-cand .mini-wave { cursor: default; } .design-cand .mini-wave svg.wf { cursor: pointer; }
.mini-wave .wf-wrap { position: relative; flex: 1; min-width: 0; height: 28px; display: flex; }
.mini-wave .wf-wrap svg.wf { width: 100%; height: 100%; }
.mini-wave .wf-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fragment { display: grid; gap: 8px; padding-bottom: 6px; }
#quickGenerate.regen { background: var(--accent, #e2643b); border-color: var(--accent, #e2643b); color: #fff; }

.fragment-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
/* trial without sign-up (2026-11-07) */
.guest-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.guest-bar span { flex: 1; min-width: 200px; }
#view-studio:has(.guest-bar:not([hidden])) .workspace { height: calc(100% - 58px); }
/* «Сообщить о проблеме» (2026-11-07) */
.report-form .report-where { margin: 0; font-size: 13px; color: var(--muted); }
.report-form .report-text { margin: 0; padding: 10px 12px; border-left: 3px solid var(--line-2); border-radius: 8px; background: var(--tint); font-size: 13px; line-height: 1.6; color: var(--ink-2); max-height: 130px; overflow-y: auto; overflow-wrap: anywhere; }
.report-form textarea { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); outline: 0; font: inherit; font-weight: 400; font-size: 14px; resize: vertical; }
.report-form textarea:focus { border-color: var(--ink-2); }
.icon-btn.report-flag:hover { color: var(--accent); }
/* «Фрагменты» — a mode of the text field, not a window (owner, 2026-11-06) */
.editor-mode { margin-left: 10px; }
.editor-mode button { padding: 0 14px; flex: none; }
@media (max-width: 480px) { .topbar h1 { white-space: nowrap; } .editor-mode { margin-left: 4px; } .editor-mode button { padding: 0 10px; } }
.quick-fragments { flex: 1; width: 100%; min-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -10px; padding-right: 4px; }
.qfrag { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 6px 10px; border-radius: 12px;
  box-shadow: inset 0 0 0 1px transparent; transition: background .15s, box-shadow .7s ease; }
/* the fragment the voiceover is at (owner, 2026-11-11): a light frame that fades in, the previous one fades out */
.qfrag.reading { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 78%, transparent); }
.qfrag:hover, .qfrag.playing { background: var(--tint); }
.qfrag .num { padding-top: 5px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.qfrag.warn .num { color: var(--accent); }
.qfrag .txt { margin: 0; font-size: 16px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.qfrag .note { grid-column: 2; margin: 0; font-size: 12px; color: var(--accent); }
.qfrag .acts { display: flex; gap: 2px; padding-top: 1px; opacity: .55; transition: opacity .15s; }
.qfrag:hover .acts, .qfrag.playing .acts, .qfrag.busy .acts, .qfrag .acts:focus-within { opacity: 1; }
.qfrag.busy .txt { opacity: .45; transition: opacity .3s; }
.qfrag .txt[contenteditable="true"] { cursor: text; border-radius: 6px; outline: 0; }
.qfrag .txt[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--line-2); background: var(--card); }
.qfrag.edited .txt { box-shadow: inset 0 -2px 0 var(--accent); }
.qfrag.edited .regen { color: var(--accent); opacity: 1; }
.qfrag.edited .acts { opacity: 1; }
@media (hover: none) { .qfrag .acts { opacity: 1; } }
.fragment-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.fragment-head { display: flex; align-items: center; gap: 8px; }
.fragment-head .grow { flex: 1; }
.fragment-row p { margin: 0; font-size: 13px; color: var(--muted); }
.fragment-row .fragment-note { color: var(--ink, inherit); font-size: 12px; }
.fragment-row audio { width: 100%; height: 34px; }
/* Regenerate one fragment: an icon only; the arrows turn while the new take is made (owner, 2026-11-06). */
#fragmentsModal .fragment-list { display: grid; gap: 8px; max-height: min(64vh, 640px); overflow-y: auto; padding-right: 2px; }
.regen svg { width: 17px; height: 17px; }
.regen[aria-busy="true"] { color: var(--accent); cursor: default; background: none; }
.regen[aria-busy="true"] svg { animation: regen-spin .9s linear infinite; }
@keyframes regen-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .regen[aria-busy="true"] svg { animation: regen-pulse 1.2s ease-in-out infinite; } @keyframes regen-pulse { 50% { opacity: .35; } } }
.fragment-row.busy audio, .fragment-row.busy p { opacity: .45; transition: opacity .3s; }
.voice-tag-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 50vh; overflow: auto; }

/* Phones: dialogs, voice picker, create cards and history fit the screen */
@media (max-width: 520px) {
  .modal, .modal.wide { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); padding: 16px; border-radius: 20px; }
  .picker-list { max-height: calc(100dvh - 210px); }
  .picker-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 10px; }
  .picker-item > .btn { grid-column: 2 / 4; justify-self: stretch; }
  .create-pick { margin-top: 20px; }
  .method { flex-direction: column; align-items: stretch; min-height: 0; padding: 18px; }
  .method-art { order: -1; align-self: center; width: 150px; height: 96px; }
  .page-actions { flex-wrap: wrap; }
  .page-actions .search { flex: 1 1 100%; }
  .history-actions { gap: 4px; }
  .history-actions .btn.sm { padding: 0 9px; }
  .history-actions [data-hide-job], .history-actions [data-remove-history] { margin-left: auto; }
}
@media (max-width: 520px) { .picker-nations { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; } }
.picker-nations::-webkit-scrollbar { display: none; }
.picker-nations .chip { flex: none; }
.tag.nation { gap: 5px; }
.tag.nation .flag { width: 14px; height: 10px; }

/* Pricing: launch-discount strip with a live countdown, three plan cards on one screen, USDT invoice dialog. */
.nav-sale { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.pricing-root { max-width: 1240px; margin: 0 auto; display: grid; gap: 20px; }
.pricing-head h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.pricing-head p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.pricing-empty { padding: 48px 0; text-align: center; color: var(--ink-2); }
.promo-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--r-card); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.promo-text { display: grid; gap: 4px; justify-items: start; }
.promo-text b { font-size: 16px; }
.promo-text small { color: var(--ink-2); }
.promo-clock { display: flex; gap: 6px; }
.promo-clock .cell { display: grid; justify-items: center; min-width: 54px; padding: 6px 4px; border-radius: 12px; background: var(--card); }
.promo-clock b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.1; }
.promo-clock small { font-size: 11px; color: var(--muted); }
.plan-current { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--green-soft); color: var(--ink); }
.plan-current svg { width: 22px; height: 22px; color: var(--green); flex: none; }
.plan-current div { display: grid; gap: 2px; min-width: 0; }
.plan-current small { color: var(--ink-2); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 20px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card); min-width: 0; }
.plan-card.popular { border-color: var(--ink); box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -11px; left: 20px; padding: 2px 10px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 11px; font-weight: 600; }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-top h3 { margin: 0; font-size: 18px; font-weight: 600; }
.plan-for { margin: -6px 0 0; color: var(--muted); font-size: 13px; min-height: 2.6em; }
.plan-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-price b { font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-price s { color: var(--muted); font-size: 17px; }
.plan-price small { color: var(--muted); font-size: 13px; width: 100%; margin-top: -6px; }
.plan-credits { padding: 10px 12px; border-radius: 12px; background: var(--tint-2); color: var(--ink-2); font-size: 14px; }
.plan-credits b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.plan-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); flex: 1; }
.plan-points li { display: flex; gap: 8px; align-items: flex-start; }
.plan-points svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--green); }
.plan-card .btn { width: 100%; }
.pricing-note { margin: 0; }
.pay-steps { display: grid; gap: 12px; margin-top: 8px; }
.pay-lead { margin: 0; color: var(--ink-2); }
.pay-field { display: grid; gap: 4px; }
.pay-field > span { font-size: 12px; color: var(--muted); }
.pay-value { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--tint-2); }
.pay-value code { font: 500 14px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; min-width: 0; flex: 1; }
.pay-value.big code { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-value em { color: var(--muted); font-style: normal; }
.pay-warn { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.pay-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-size: 13px; font-variant-numeric: tabular-nums; }
.pay-status.expired { background: var(--tint-2); color: var(--ink-2); }
.pay-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: pay-pulse 1.4s ease-in-out infinite; }
@keyframes pay-pulse { 50% { opacity: .25; } }
.pay-done { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 0 6px; }
.pay-done svg { width: 44px; height: 44px; color: var(--green); }
.pay-done b { font-size: 18px; }
.pay-done p { margin: 0; color: var(--ink-2); }
@media (max-width: 860px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } .plan-for { min-height: 0; } }
@media (max-width: 520px) { .promo-clock .cell { min-width: 46px; } .promo-clock b { font-size: 18px; } }
.net-group { display: grid; gap: 6px; }
.net-caption { font-size: 12px; color: var(--muted); }
.net-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--tint-2); }
.net-name { display: grid; min-width: 0; }
.net-name small, .pay-value .muted { color: var(--muted); font-size: 12px; }
.net-tokens { display: flex; gap: 6px; flex: none; }
.pay-value .muted { margin-left: auto; }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-pay-note { margin-top: -6px; text-align: center; color: var(--muted); font-size: 12px; }
.plan-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-card.current { border-color: var(--green); }
.plan-flag.current { background: var(--green); color: #fff; }
.plan-current.free { background: var(--tint-2); }
.plan-current.free svg { color: var(--ink-2); }
.plan-credits small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.plan-points li.all { color: var(--ink); font-weight: 500; }
.plan-points li.no { color: var(--muted); }
.plan-points li.no svg { color: var(--muted); }
.plan-points li.no s { text-decoration-color: var(--muted); }
.plan-card .btn:disabled { opacity: .55; }
@media (max-width: 1380px) { .plan-grid.four { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .plan-grid.four { grid-template-columns: minmax(0, 1fr); } }

/* Logo: Rustam's head in equal sound bars; the hover wave runs in es.js (it plays backwards when the pointer leaves). */
.brand-mark { height: 52px; width: auto; flex: none; display: block; overflow: visible; }
.brand-bars { fill: var(--ink); }
.brand-bars g { transform-box: fill-box; transform-origin: 50% 50%; }
/* Plan cards of their own length: the head of every card (name … credits) sits on shared rows, so the feature lists
   start on one level; each list then ends where its own content ends. Head and list are two grid items drawn as one card. */
/* five plans since 2026-11-14 (class name kept): 5 columns, then 3 + 2, then one column */
.plan-grid.four { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(6, auto) auto; column-gap: 14px; row-gap: 0; align-items: start; }
.plan-grid.four .plan-card { grid-row: 1 / span 6; display: grid; grid-template-rows: subgrid; gap: 0; align-self: stretch;
  border-bottom: 0; border-radius: var(--r-card) var(--r-card) 0 0; padding: 22px 20px 0; box-shadow: none; }
.plan-grid.four .plan-card > * { margin: 0 0 12px; align-self: start; }
.plan-grid.four .plan-card > .plan-flag { margin: 0; }
.plan-grid.four .plan-card > .plan-credits { margin-bottom: 14px; }
.plan-grid.four .plan-foot { grid-row: 7; flex: none; padding: 0 20px 20px; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r-card) var(--r-card); background: var(--card); align-self: start; }
.plan-grid.four .plan-foot.popular { border-color: var(--ink); }
.plan-grid.four .plan-foot.current { border-color: var(--green); }
.plan-grid.four .col-1 { grid-column: 1; } .plan-grid.four .col-2 { grid-column: 2; } .plan-grid.four .col-3 { grid-column: 3; } .plan-grid.four .col-4 { grid-column: 4; } .plan-grid.four .col-5 { grid-column: 5; }
@media (max-width: 1380px) {
  .plan-grid.four { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(6, auto) auto repeat(6, auto) auto; }
  .plan-grid.four .col-4 { grid-column: 1; } .plan-grid.four .col-5 { grid-column: 2; }
  .plan-grid.four .col-4.plan-card, .plan-grid.four .col-5.plan-card { grid-row: 8 / span 6; margin-top: 18px; }
  .plan-grid.four .col-4.plan-foot, .plan-grid.four .col-5.plan-foot { grid-row: 14; }
}
@media (max-width: 640px) {
  .plan-grid.four { display: flex; flex-direction: column; }
  .plan-grid.four .plan-card { display: flex; flex-direction: column; }
  .plan-grid.four .plan-foot { align-self: stretch; }
  .plan-grid.four .plan-card + .plan-foot + .plan-card { margin-top: 18px; }
}
/* Plan buttons: every switch is the bright button; the current plan is a quiet grey one. */
.plan-card .btn.plan-go { background: var(--primary); color: var(--primary-ink); border: 0; }
.plan-card .btn.plan-go:hover { opacity: .88; }
.plan-card .btn.plan-now, .plan-card .btn.plan-now:disabled { background: var(--tint-2); color: var(--muted); border: 0; opacity: 1; }
.plan-no-button { display: block; height: 40px; }

/* Account: plan chip and avatar in the top bar; the menu under it like other studios (credits, upgrade, settings). */
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 3px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); }
.account-btn:hover { background: var(--tint); }
.plan-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--tint-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.plan-chip.paid { background: var(--accent-soft); color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.avatar.lg { width: 38px; height: 38px; font-size: 16px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 24px)); padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-pop); display: grid; gap: 12px; }
.am-head { display: flex; align-items: center; gap: 10px; }
.am-head > div { display: grid; min-width: 0; flex: 1; }
.am-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-head small { color: var(--muted); font-size: 12px; }
.credits { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--tint-2); }
.credits-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.credits-top b { font-variant-numeric: tabular-nums; }
.credits-top span, .credits small { color: var(--muted); font-size: 12px; }
.credits .usage-bar { height: 6px; border-radius: 6px; background: var(--tint-3); overflow: hidden; }
.credits .usage-bar i { display: block; height: 100%; width: var(--used, 0%); background: var(--ink); border-radius: 6px; }
.am-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.am-actions .btn { width: 100%; }
.am-list { display: grid; border-top: 1px solid var(--line); padding-top: 6px; }
.am-list button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px; border-radius: 10px; text-align: left; font-size: 14px; }
.am-list button:hover { background: var(--tint); }
.am-list svg { width: 18px; height: 18px; color: var(--muted); }
.am-list .danger, .am-list .danger svg { color: #d0453a; }
.settings-modal { width: min(760px, calc(100vw - 32px)); }
.settings { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; margin-top: 8px; min-height: 360px; }
.settings-tabs { display: grid; align-content: start; gap: 2px; }
.settings-tabs button { text-align: left; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.settings-tabs button:hover { background: var(--tint); }
.settings-tabs button.active { background: var(--tint-2); color: var(--ink); }
.settings-body { display: grid; align-content: start; gap: 14px; min-width: 0; }
.settings-body h4 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.settings-body p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.set-plan, .set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); flex-wrap: wrap; }
.set-plan > div, .set-row > div:first-child { min-width: 0; flex: 1 1 240px; }
.set-cancel { padding: 14px; border-radius: 14px; background: rgba(208, 69, 58, .08); border: 1px solid rgba(208, 69, 58, .35); }
.btn.danger { background: #d0453a; color: #fff; }
.pay-history { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ph-row { display: grid; grid-template-columns: 130px 80px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; font-size: 13px; border-top: 1px solid var(--line); }
.ph-row:first-child { border-top: 0; }
.ph-row span:nth-child(3) { color: var(--ink-2); overflow-wrap: anywhere; }
.ph-status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--tint-2); color: var(--muted); }
.ph-status.paid { background: var(--green-soft); color: var(--green); }
.ph-status.pending { background: var(--amber-soft); color: var(--amber); }
@media (max-width: 640px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .settings-tabs button { flex: none; }
  .ph-row { grid-template-columns: 1fr auto; }
  .account-btn .plan-chip { display: none; }
}

/* Sign-in: Google first, then e-mail; steps (check your mail, reset) replace the forms in the same dialog. */
#authModal .segmented { margin-bottom: 14px; }
.google-btn { width: 100%; gap: 10px; margin-bottom: 4px; }
.google-btn svg { width: 18px; height: 18px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form .text-btn { align-self: center; }
.auth-step h4 { margin: 0 0 6px; font-size: 17px; }
.auth-mail { display: grid; justify-items: center; text-align: center; gap: 6px; }
.auth-mail > svg { width: 40px; height: 40px; color: var(--green); }
.auth-mail p { margin: 0; color: var(--ink-2); }
.auth-mail .modal-actions { justify-content: center; margin-top: 8px; }

/* Balance: the plan status, the balance and a top-up button in one bar above the plans. */
.wallet-bar { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--tint-2); flex-wrap: wrap; }
.wallet-plan { display: flex; gap: 12px; align-items: center; flex: 1 1 320px; min-width: 0; }
.wallet-plan svg { width: 22px; height: 22px; color: var(--green); flex: none; }
.wallet-plan > div { display: grid; gap: 2px; min-width: 0; }
.wallet-plan small { color: var(--ink-2); }
.wallet-balance { display: grid; justify-items: end; }
.wallet-balance small { color: var(--muted); font-size: 12px; }
.wallet-balance b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pay-sum { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--tint-2); }
.pay-sum span, .pay-sum small { color: var(--muted); font-size: 13px; }
.pay-sum b { font-size: 26px; font-variant-numeric: tabular-nums; }
.pay-amount { height: 48px; font-size: 22px; font-weight: 600; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); width: 100%; box-sizing: border-box; }
.am-balance { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--tint-2); }
.am-balance span { color: var(--muted); font-size: 13px; }
.am-balance b { flex: 1; font-variant-numeric: tabular-nums; }
.ph-row.ledger { grid-template-columns: 130px minmax(0, 1fr) auto; }
.ph-row .plus { color: var(--green); font-variant-numeric: tabular-nums; }
.ph-row .minus { font-variant-numeric: tabular-nums; }

/* Pages: history, balance and payment, help, what's new. */
.page-root { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }
.page-root.narrow { max-width: 760px; }
.page-root .section-title { margin: 12px 0 0; }
.page-loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 40px 0; justify-content: center; }
.bill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bill-card { display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); min-width: 0; }
.bill-card small { color: var(--muted); font-size: 12px; }
.bill-card b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-card span { color: var(--ink-2); font-size: 13px; min-height: 2.6em; }
.bill-card .btn { justify-self: start; margin-top: 6px; }
.bill-card .usage-bar { height: 6px; border-radius: 6px; background: var(--tint-3); overflow: hidden; margin-top: 8px; }
.bill-card .usage-bar i { display: block; height: 100%; width: var(--used, 0%); background: var(--ink); border-radius: 6px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pack-card { display: grid; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.pack-card b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pack-card > span { color: var(--muted); font-size: 13px; }
.pack-price { font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pack-price small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pack-card .btn { justify-self: start; }
.hist-filters { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-start; justify-items: start; }
.hist-filters .search { flex: 1 1 260px; max-width: 420px; width: auto; margin: 0; }
.hist-filters select { height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 0 14px; font: inherit; }
.hist-day h4 { margin: 8px 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.hist-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.hist-cards .history-item { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq-body { padding: 0 0 14px; color: var(--ink-2); }
.faq-body p { margin: 0; }
.news { display: grid; gap: 12px; }
.news-item { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.news-item small { color: var(--muted); }
.news-item h3 { margin: 4px 0 8px; font-size: 17px; }
.news-item ul { margin: 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; }
@media (max-width: 1000px) { .bill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bill-grid, .pack-grid { grid-template-columns: minmax(0, 1fr); } .hist-cards { grid-template-columns: minmax(0, 1fr); } }

/* site dropdowns (assets/dropdown.css) sized for the studio (2026-11-07) */
.form .dd-btn { height: 42px; font-size: 14px; font-weight: 400; }
.hist-filters .dd { flex: none; min-width: 190px; }
.hist-filters .dd-btn { height: 40px; border-radius: 999px; padding-left: 16px; font-size: 14px; font-weight: 400; }

/* balance history rows in long languages (2026-11-08): the text wraps, on phones the date goes above */
.ph-row span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .ph-row.ledger { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ph-row.ledger span:first-child { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
}

/* voices of the paid plans, seen from the free plan (2026-11-09) */
.tag.paid { color: var(--accent); background: var(--accent-soft); }
/* RustamSpeech Lite languages (2026-11-20): simplified flags */
.flag-pl { background: linear-gradient(#fff 50%, #dc143c 50%); }
.flag-tr { background: radial-gradient(circle at 42% 50%, #fff 0 22%, transparent 23%), #e30a17; }
.flag-nl { background: linear-gradient(#ae1c28 33.3%, #fff 33.3% 66.6%, #21468b 66.6%); }
.flag-ar { background: linear-gradient(#006c35, #006c35); }
.flag-sv { background: linear-gradient(90deg, transparent 30%, #fecc00 30% 42%, transparent 42%), linear-gradient(transparent 40%, #fecc00 40% 60%, transparent 60%), #006aa7; }
.flag-da { background: linear-gradient(90deg, transparent 30%, #fff 30% 40%, transparent 40%), linear-gradient(transparent 42%, #fff 42% 58%, transparent 58%), #c60c30; }
.flag-no { background: linear-gradient(90deg, transparent 28%, #00205b 28% 40%, transparent 40%), linear-gradient(transparent 40%, #00205b 40% 60%, transparent 60%), linear-gradient(90deg, transparent 24%, #fff 24% 44%, transparent 44%), linear-gradient(transparent 32%, #fff 32% 68%, transparent 68%), #ba0c2f; }
.flag-fi { background: linear-gradient(90deg, transparent 30%, #003580 30% 44%, transparent 44%), linear-gradient(transparent 38%, #003580 38% 62%, transparent 62%), #fff; }
.flag-el { background: repeating-linear-gradient(#0d5eaf 0 11.1%, #fff 11.1% 22.2%); }
.flag-he { background: linear-gradient(#fff 12%, #0038b8 12% 24%, #fff 24% 76%, #0038b8 76% 88%, #fff 88%); }
.flag-hi { background: linear-gradient(#ff9933 33.3%, #fff 33.3% 66.6%, #138808 66.6%); }
.flag-vi { background: radial-gradient(circle, #ffcd00 0 22%, transparent 23%), #da251d; }
.flag-th { background: linear-gradient(#a51931 16.6%, #f4f5f8 16.6% 33.3%, #2d2a4a 33.3% 66.6%, #f4f5f8 66.6% 83.3%, #a51931 83.3%); }
.flag-id { background: linear-gradient(#ce1126 50%, #fff 50%); }
.flag-ms { background: linear-gradient(90deg, #010066 45%, transparent 45%), repeating-linear-gradient(#cc0001 0 14.3%, #fff 14.3% 28.6%); }
.flag-tl { background: linear-gradient(60deg, #fff 30%, transparent 30%), linear-gradient(#0038a8 50%, #ce1126 50%); }
.flag-my { background: linear-gradient(#fecb00 33.3%, #34b233 33.3% 66.6%, #ea2839 66.6%); }
.flag-km { background: linear-gradient(#032ea1 25%, #e00025 25% 75%, #032ea1 75%); }
.flag-lo { background: radial-gradient(circle, #fff 0 18%, transparent 19%), linear-gradient(#ce1126 25%, #002868 25% 75%, #ce1126 75%); }
.flag-sw { background: linear-gradient(150deg, #1eb53a 38%, #fcd116 38% 42%, #000 42% 58%, #fcd116 58% 62%, #00a3dd 62%); }

.captcha { min-height: 65px; }
