:root {
  --bg: #0d1117;
  --bg-soft: #131a23;
  --card: #161d27;
  --line: #232c39;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, .14);
  --accent-contrast: #fff;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  --font-brand: var(--font-body);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb;
    --bg-soft: #eef2f7;
    --card: #ffffff;
    --line: #dfe6ef;
    --text: #16202c;
    --muted: #5c6a7d;
    /* На светлом фоне синий и зелёный тёмной темы не добирали контраста
       WCAG AA 4.5:1 (TRANS-163): #4c8dff — 3.0 на фоне и 3.2 под белым текстом
       кнопки, #3fb950 — 2.5 на белом. Те же цвета на ступень темнее: не ниже
       4.5 и на фоне страницы, и на карточке, и на своей бледной подложке. */
    --accent: #2160e6;
    --accent-soft: rgba(33, 96, 230, .12);
    --ok: #187a33;
    --shadow: 0 10px 30px rgba(20, 35, 60, .08);
  }
}

:root[data-theme="warm"] {
  --bg: #faf6f1;
  --bg-soft: #f4ede4;
  --card: #ffffff;
  --line: #ece2d6;
  --text: #201a15;
  --muted: #8a7a68;
  --accent: #e05a33;
  --accent-soft: rgba(224, 90, 51, .12);
  --accent-contrast: #fff;
  /* Зелёный — свой у каждой темы, а не из системной схемы: иначе он менялся
     от настройки ОС (TRANS-163). Светлым темам — тёмный, ночной — яркий. */
  --ok: #187a33;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(60, 40, 20, .08);
  --font-body: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: Unbounded, "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="night"] {
  --bg: #0b0d10;
  --bg-soft: #12151a;
  --card: #12151a;
  --line: #171b20;
  --text: #f2f5f0;
  --muted: #9aa49b;
  --accent: #d3f955;
  --accent-soft: rgba(211, 249, 85, .12);
  --accent-contrast: #0b0d10;
  --ok: #3fb950;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --font-body: Onest, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: Unbounded, Onest, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="pastel"] {
  --bg: #f3f1fb;
  --bg-soft: #ece8f8;
  --card: #ffffff;
  --line: #e3ddf2;
  --text: #2a2440;
  --muted: #8d84b8;
  --accent: #6c5ce7;
  --accent-soft: rgba(108, 92, 231, .12);
  --accent-contrast: #fff;
  --ok: #187a33;
  --radius: 22px;
  --shadow: 0 10px 26px rgba(42, 36, 64, .10);
  --font-body: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

header.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { font-family: var(--font-brand); font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
:root[data-theme="pastel"] .brand { font-weight: 900; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }
nav.top-links { display: flex; gap: 18px; align-items: center; }
nav.top-links a { color: var(--muted); font-size: 14px; }
nav.top-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s ease; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
/* TRANS-171: после копирования кнопка на две секунды становится сплошной
   зелёной с галочкой — уведомление сверху при прокрутке к тексту не видно.
   Текст цветом фона страницы: в тёмных темах --ok светлый, в светлых тёмный,
   так контраст держится в любой теме. Правило стоит после .primary и .ghost,
   чтобы перекрыть их фон и цвет. */
.btn.copied, .btn.copied:hover, .btn.primary.copied, .btn.primary.copied:hover {
  color: var(--bg); border-color: var(--ok); background: var(--ok);
  filter: none; animation: copied-pop .3s ease;
}
@keyframes copied-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .btn.copied { animation: none; } }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
/* Удаление учётки свёрнуто и не покрашено в красное целиком: его ищут
   осознанно, а мимо проходящий взгляд оно цеплять не должно. */
/* Поле ссылок — многострочное: список из десяти ссылок в одну строку не
   разглядеть. Растёт от содержимого, но не съедает форму. */
#url { resize: vertical; min-height: 44px; max-height: 220px; font-family: inherit; }
.danger-zone > summary { cursor: pointer; font-weight: 600; color: var(--err); }
.danger-zone[open] > summary { margin-bottom: 10px; }
.danger-zone p { margin: 0 0 12px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.run { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.badge.wait { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

.bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.bar.warn > i { background: var(--warn); }
.bar.full > i { background: var(--err); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.actions { white-space: nowrap; text-align: right; }
.table-scroll { overflow-x: auto; }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice.err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice:empty { display: none; }

mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; cursor: pointer; transition: .15s;
  background: var(--bg-soft);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { display: block; font-size: 15px; margin-bottom: 4px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 600;
  cursor: pointer; font-size: 14px;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.plan {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--card); display: flex; flex-direction: column;
}
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan h3 { margin: 0 0 6px; font-size: 18px; }
.plan .price { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 10px 0 2px; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 20px; flex: 1; }
.plan li { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 14px; color: var(--muted); }
.plan li svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }

.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -.035em; margin: 0 0 16px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-bg.on { display: flex; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 18px; font-size: 19px; }

footer.site { border-top: 1px solid var(--line); margin-top: 60px; padding: 26px 0; color: var(--muted); font-size: 13px; }
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }

/* ---------- theme picker ---------- */
.theme-picker { position: relative; display: inline-flex; flex: 0 0 auto; }
.theme-toggle { width: 44px; min-width: 44px; height: 44px; padding: 0; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-menu.card {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0;
  width: 184px; padding: 6px; border-radius: var(--radius);
}
.theme-picker.footer .theme-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }

/* ---------- язык интерфейса (TRANS-112) ---------- */
.lang-switch {
  width: auto; min-height: 36px; padding: 6px 30px 6px 10px; font-size: 13px;
  border-radius: 8px; flex: 0 0 auto;
}
.lang-switch-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.doc-lang-note { margin-bottom: 16px; }
.theme-option {
  width: 100%; min-height: 44px; padding: 10px 12px;
  justify-content: space-between; border-color: transparent; background: transparent;
}
.theme-option:hover, .theme-option[aria-checked="true"] {
  border-color: transparent; background: var(--accent-soft);
}
.theme-option svg { width: 16px; height: 16px; color: var(--accent); opacity: 0; }
.theme-option[aria-checked="true"] svg { opacity: 1; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- recording ---------- */
.rec { display: flex; align-items: center; gap: 14px; }
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--err);
  animation: recpulse 1.4s ease infinite;
}
.rec.paused .rec-dot { background: var(--warn); animation: none; }
.rec-timer { font-size: 38px; font-weight: 700; letter-spacing: .02em; }
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- drafts ---------- */
.draft {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.draft:last-child { border-bottom: none; }
@media (max-width: 640px) {
  .draft { flex-direction: column; align-items: flex-start; }
}

.hidden { display: none !important; }

/* ---------- offline notice (TRANS-239) ---------- */
.offline-notice {
  max-width: 420px; margin: 20vh auto 0; padding: 0 20px;
  text-align: center; line-height: 1.5;
}
.offline-notice p { margin-bottom: 10px; }
.bottom-nav[hidden] { display: none; }

/* ---------- dashboard redesign ---------- */
.dashboard-top .wrap { max-width: 1160px; }
.desktop-tabs {
  align-self: stretch; margin: 0 0 0 26px; border-bottom: 0;
  align-items: stretch;
}
.desktop-tabs button { min-height: 62px; padding-inline: 12px; }
.dashboard-main { padding-top: 28px; padding-bottom: 72px; }
.dashboard-section { min-width: 0; }

.home-intro { margin: 6px 0 22px; }
.home-intro h1, .page-heading h1 {
  margin: 0; font-family: var(--font-brand); font-size: 30px;
  line-height: 1.2; letter-spacing: -.03em;
}
.home-intro p, .page-heading p {
  margin: 7px 0 0; color: var(--muted); font-size: 15px;
}
.page-heading { margin: 4px 0 22px; }

.quota-card {
  padding: 18px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.quota-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.quota-head h2 { margin: 0 0 2px; font-size: 16px; }
.quota-head .sub { color: var(--muted); font-size: 13px; }

.create-panel { max-width: 760px; margin: 28px auto 24px; }
.record-action-wrap { display: flex; justify-content: center; padding: 4px 0 24px; }
.record-action {
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.record-circle {
  display: grid; place-items: center; width: 140px; height: 140px;
  border-radius: 50%; background: var(--accent); color: var(--accent-contrast);
  box-shadow: var(--shadow); transition: transform .18s ease, filter .18s ease;
}
.record-circle svg { width: 52px; height: 52px; }
.record-action:hover .record-circle { filter: brightness(1.06); transform: translateY(-2px); }
.record-action:focus-visible { outline: none; }
.record-action:focus-visible .record-circle { outline: 3px solid var(--accent-soft); outline-offset: 5px; }

.rec-panel { margin-bottom: 18px; }
/* TRANS-247: волна «запись идёт» — 32 столбика, высоту и яркость ставит app.js. */
.rec-wave {
  display: flex; align-items: center; gap: 2px;
  height: 36px; width: 100%; max-width: 320px; margin-top: 10px;
}
.rec-wave > i {
  flex: 1; min-height: 4px; height: 4px; opacity: 0.4;
  background: var(--err); border-radius: 2px; transition: height .1s;
}
.rec-wave.paused > i { background: var(--warn); }
@media (prefers-reduced-motion: reduce) {
  .rec-wave > i { transition: none; }
  .rec-dot { animation: none; }
}
.rec-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.rec-controls .btn:first-child { min-width: 150px; }
.rec-controls .btn:last-child { min-width: 220px; }
.rec-transcribe-check {
  align-self: center; flex: 1; min-height: 44px; margin: 0; padding: 8px 10px;
  border-radius: 10px; background: var(--bg-soft);
}
.rec-status { margin-top: 10px; }

.source-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.source-action, .source-action.drop {
  width: 100%; min-height: 104px; display: flex; align-items: center;
  gap: 14px; padding: 18px; text-align: left; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; font: inherit; transition: .15s ease;
}
.source-action:hover, .source-action:focus-visible,
.source-action.drop:hover, .source-action.drop:focus-visible,
.source-action.drop.over {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.source-action:disabled { opacity: .5; cursor: not-allowed; }
.source-action > svg { flex: 0 0 auto; width: 34px; height: 34px; color: var(--accent); }
.source-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.source-action .source-copy b { display: block; margin: 0; font-size: 16px; }
.source-copy small { color: var(--muted); font-size: 12px; }
.file-chosen { min-height: 20px; margin-top: 8px; }
.source-url { margin-top: 14px; }

.recognition-settings {
  margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.transcribe-now-check { margin: 0 0 16px; font-weight: 700; }
.recognition-settings summary {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; font-weight: 650; cursor: pointer; list-style: none;
}
.recognition-settings summary::-webkit-details-marker { display: none; }
.recognition-settings summary svg { width: 20px; height: 20px; color: var(--muted); transition: transform .15s ease; }
.recognition-settings[open] summary { border-bottom: 1px solid var(--line); }
.recognition-settings[open] summary svg { transform: rotate(180deg); }
/* TRANS-86: подпись «Заполнено по вашим настройкам» прижимается к шеврону */
.defaults-applied { margin-left: auto; text-align: right; }
.settings-body { padding: 18px 16px 4px; }
.diarize-check { margin: 4px 0 18px; }
.speakers-field { margin: -8px 0 18px; }
.speaker-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.speaker-chips button { border: 1px solid var(--line); background: var(--card);
  color: var(--fg); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-width: 44px; }
.speaker-chips button.on { background: var(--accent); color: var(--accent-contrast);
  border-color: var(--accent); }
.speaker-chips input[type=number] { width: 84px; margin: 0; }
.speaker-chips input.speakers-custom { border-color: var(--accent); }
.field-help { margin-top: 6px; }
.submit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.recent-section { margin-top: 24px; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading-row h2 { margin: 0; }
.text-button {
  min-height: 40px; padding: 6px 0; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.recent-list { margin-top: 8px; }
.recent-job { padding: 14px 0; border-bottom: 1px solid var(--line); }
.recent-job:last-child { padding-bottom: 2px; border-bottom: 0; }
.recent-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recent-job-head b { min-width: 0; overflow-wrap: anywhere; }
.recent-job-meta { margin-top: 3px; }
.recent-job-file { margin-top: 2px; overflow-wrap: anywhere; }
.recent-job-progress { margin-top: 8px; }
.recent-job .recorded-list-action { margin-top: 10px; }
.job-search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.job-search-row input { min-width: 0; }
.icon-button { flex: 0 0 auto; min-width: 38px; padding: 7px; }
.icon-button svg, td.actions .btn svg { width: 18px; height: 18px; }

/* ---------- folders, tags, trash (TRANS-74) ---------- */
.jobs-filter-row { margin-bottom: 14px; }
.jobs-filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jobs-filter-hint { margin-bottom: 10px; }
.filter-chip {
  min-height: 44px; padding: 8px 16px; display: inline-flex; align-items: center;
  gap: 6px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 13px;
  font-weight: 650; cursor: pointer; transition: .15s ease;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.on {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.filter-chip.trash-chip.on {
  background: color-mix(in srgb, var(--err) 12%, transparent);
  border-color: color-mix(in srgb, var(--err) 45%, var(--line));
  color: var(--err);
}

.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tag-chip {
  min-height: 44px; padding: 4px 12px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 650;
  cursor: pointer; transition: .15s ease;
}
.tag-chip:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}

.job-menu {
  position: fixed; z-index: 60; width: min(300px, calc(100vw - 16px));
  padding: 10px; box-shadow: var(--shadow);
}
.job-menu-label {
  padding: 4px 10px 8px; color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.job-menu-folders {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.menu-folder-chip {
  min-height: 44px; padding: 6px 12px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 650;
  cursor: pointer; transition: .15s ease;
}
.menu-folder-chip:hover { border-color: var(--accent); }
.menu-folder-chip.on {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.job-menu-item {
  width: 100%; min-height: 44px; display: flex; align-items: center;
  padding: 8px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.job-menu-item:hover { background: var(--accent-soft); }
.job-menu-item.danger { color: var(--err); }
.job-menu-item.danger:hover {
  background: color-mix(in srgb, var(--err) 12%, transparent);
}
.jobs-table tr.viewable { cursor: pointer; }
.jobs-table tr.viewable:hover { background: var(--bg-soft); }
.job-name-box { min-width: 0; }
.job-name-button {
  max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.job-name-button:hover { color: var(--accent); text-decoration: underline; }
.job-name-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
td.actions > .download-button { margin-left: 6px; }
.share-link-block {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap; margin-top: 8px; white-space: normal;
}
.button-row, .profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notification-prefs {
  display: grid; gap: 8px; margin: 4px 0 12px;
}
.notification-pref {
  min-height: 58px; margin: 0; padding: 10px 12px; display: flex;
  align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-soft); color: var(--text); cursor: pointer;
}
.notification-pref span { min-width: 0; display: grid; gap: 1px; }
.notification-pref strong { font-size: 14px; }
.notification-pref small { color: var(--muted); font-size: 12px; }
.notification-switch {
  appearance: none; position: relative; width: 42px; height: 24px;
  flex: 0 0 auto; margin: 0; border: 0; border-radius: 999px;
  background: var(--line); cursor: pointer; transition: background .15s ease;
}
.notification-switch::before {
  content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
.notification-switch:checked { background: var(--accent); }
.notification-switch:checked::before { transform: translateX(18px); }
.notification-switch:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.notification-switch:disabled { cursor: wait; opacity: .6; }
.push-device-settings {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.push-device-settings + .sub { margin-top: 3px; }
.credit-stats { margin-bottom: 16px; }
.section-title { margin: 26px 0 12px; font-size: 20px; }
.payments-card { margin-top: 22px; }

/* ---------- api keys (TRANS-87b) ---------- */
.api-keys-title {
  display: flex; align-items: center; gap: 10px;
}
.api-keys-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--accent); }
.api-keys-card .btn { min-height: 44px; }
.api-keys-help {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-soft); margin-bottom: 16px; overflow: hidden;
}
.api-keys-help summary {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; font-weight: 650; font-size: 14px;
  cursor: pointer; list-style: none;
}
.api-keys-help summary::-webkit-details-marker { display: none; }
.api-keys-help summary svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease; }
.api-keys-help[open] summary { border-bottom: 1px solid var(--line); }
.api-keys-help[open] summary svg { transform: rotate(180deg); }
.api-keys-help-body { padding: 14px; }
.api-keys-help-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.api-keys-help-body pre {
  margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); overflow-x: auto;
  white-space: pre; font-size: 12.5px; line-height: 1.6;
}
.api-token-list { display: grid; gap: 8px; margin-bottom: 18px; }
.api-token-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-soft);
}
.api-token-copy { min-width: 0; }
.api-token-copy b { display: block; overflow-wrap: anywhere; }
.api-token-copy .small { margin-top: 2px; overflow-wrap: anywhere; }
.api-token-revoke { flex: 0 0 auto; }
.api-token-secret {
  margin-bottom: 18px; padding: 16px; border: 1px solid var(--accent);
  border-radius: 12px; background: var(--accent-soft);
}
.api-token-secret-title { display: block; margin-bottom: 10px; font-size: 15px; }
.api-token-secret .notice { margin-bottom: 10px; }
.api-token-secret-value {
  display: block; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 16.5px; font-weight: 700; line-height: 1.5;
  overflow-wrap: anywhere; user-select: all;
}
.api-token-secret .button-row { margin: 0; }
@media (max-width: 480px) {
  .api-token-row { align-items: flex-start; flex-direction: column; }
  .api-token-revoke { align-self: stretch; }
}

.theme-rows { display: grid; gap: 8px; margin-top: 16px; }
.theme-row {
  width: 100%; min-height: 56px; display: grid;
  grid-template-columns: 28px 1fr 24px; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-soft); color: var(--text); text-align: left;
  font: inherit; font-weight: 650; cursor: pointer;
}
.theme-row:hover, .theme-row[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft);
}
.theme-row-icon, .theme-check { width: 22px; height: 22px; }
.theme-row-icon { color: var(--accent); }
.theme-check { color: var(--accent); opacity: 0; }
.theme-row[aria-checked="true"] .theme-check { opacity: 1; }

/* ---------- record viewer ---------- */
.record-view-header { max-width: 820px; margin: 0 auto 22px; }
.view-back { min-height: 44px; margin-bottom: 18px; padding-inline: 12px 16px; }
.view-back svg { width: 20px; height: 20px; }
.record-view-title-row { display: flex; align-items: flex-start; gap: 8px; }
.record-view-title-row h1 {
  min-width: 0; margin: 0; font-family: var(--font-brand); font-size: 30px;
  line-height: 1.22; letter-spacing: -.03em; overflow-wrap: anywhere;
}
.view-rename { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; }
.view-rename svg { width: 20px; height: 20px; }
.record-view-meta { margin-top: 7px; }
.audio-player-shell {
  margin-top: 18px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.audio-player-shell audio { display: block; width: 100%; min-height: 42px; color-scheme: light dark; }
.audio-waveform {
  height: 56px; margin-top: 10px; overflow: hidden; border-radius: 8px;
  background: var(--bg-soft);
}
.audio-waveform canvas {
  display: block; width: 100%; height: 56px; cursor: pointer; touch-action: manipulation;
}
.audio-waveform canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.audio-waveform-status { margin-top: 6px; text-align: center; }
.audio-waveform-status:empty { display: none; }
.audio-player-tools {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 10px; flex-wrap: wrap;
}
.audio-speed-pills { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.audio-speed-pills button {
  min-height: 32px; padding: 5px 9px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-soft); color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 750; cursor: pointer;
}
.audio-speed-pills button.on {
  border-color: var(--accent); background: var(--accent); color: var(--accent-contrast);
}
.record-view-actions { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; }
.record-downloads { display: flex; flex: 1; gap: 8px; flex-wrap: wrap; }
.record-downloads .download-button { min-height: 40px; }
.more-formats { flex-basis: 100%; }
.more-formats > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.more-formats-body { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.viewer-tabs {
  max-width: 680px; margin: 0 auto 24px; padding: 4px; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
}
.viewer-tabs button {
  min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: inherit; font-weight: 700;
  cursor: pointer;
}
.viewer-tabs button.on { background: var(--accent); color: var(--accent-contrast); }
.viewer-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Третья вкладка «Чат звонка» (TRANS-192) расширяет ряд только когда видна. */
.viewer-tabs:has(#viewChatTab:not(.hidden)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Лента чата звонка в просмотре записи (TRANS-192). */
.call-chat-feed { max-width: 680px; margin: 0 auto; }
.call-chat-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.call-chat-item:last-child { border-bottom: 0; }
.call-chat-item-head { display: flex; align-items: baseline; gap: 10px; }
.call-chat-time {
  border: 0; background: transparent; color: var(--accent); font: inherit;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; cursor: pointer; padding: 0;
}
.call-chat-name { font-weight: 700; font-size: 13px; }
.call-chat-item-body { margin-top: 4px; line-height: 1.6; overflow-wrap: anywhere; }
.call-chat-file { color: var(--accent); }
.call-chat-preview {
  display: block; max-width: min(320px, 100%); max-height: 220px;
  border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px;
}

.billing-autorenew { max-width: 720px; margin: 0 0 16px; align-items: flex-start; }
.billing-autorenew span { font-size: 13px; color: var(--muted); }
.app-footer { margin-top: 32px; }
.app-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  padding: 18px 20px 90px; font-size: 13px; }
.billing-period { display: flex; gap: 8px; justify-content: center; margin: 4px 0 18px; }
.billing-period button { border: 1px solid var(--line); background: var(--card);
  color: var(--fg); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.billing-period button.on { background: var(--accent); color: var(--accent-contrast);
  border-color: var(--accent); }
.plan-saving { color: var(--ok); }
.viewer-copy-row { max-width: 680px; margin: -4px auto 12px; display: flex; justify-content: flex-end; }
.transcript-edit-tools { max-width: 680px; margin: -8px auto 16px; }
.transcript-replace-form { margin-top: 10px; padding: 14px; }
.transcript-replace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.transcript-replace-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 10px;
}
.transcript-replace-actions .check { margin-right: auto; }
.transcript-edit-limit { margin: 10px 0 0; }

.summary-view { max-width: 820px; margin: 0 auto; }
.summary-version-toolbar {
  max-width: 680px; margin: 0 auto 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.summary-version-pills { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding: 2px; }
.summary-version-pill {
  flex: 0 0 auto; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-soft); color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.summary-version-pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.summary-version-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.summary-regenerate-form { max-width: 680px; margin: 0 auto 20px; padding: 16px; }
.summary-regenerate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.summary-regenerate-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 12px;
}
.summary-regenerate-actions .muted { margin-right: auto; }
.summary-content-shell { position: relative; min-height: 96px; }
.summary-preparing-overlay {
  position: absolute; z-index: 2; inset: 0; display: grid; place-items: start center;
  padding-top: 28px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--muted); font-weight: 700;
}

.record-reading { max-width: 680px; margin: 0 auto; line-height: 1.7; }
.transcript-paragraph {
  position: relative;
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px;
  margin: 0 -10px; padding: 18px 10px; border-bottom: 1px solid var(--line);
  border-radius: 10px; transition: background-color .2s ease;
}
.transcript-paragraph.is-active { background: var(--accent-soft); }
.transcript-paragraph.edited { padding-left: 22px; }
.transcript-paragraph.edited::before {
  content: ""; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 3px;
  border-radius: 999px; background: var(--accent);
}
.transcript-paragraph:last-child { border-bottom: 0; }
.transcript-time {
  align-self: stretch; min-width: 44px; min-height: 44px; padding: 3px 0 0;
  border: 0; background: transparent; color: var(--accent); font: inherit;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  text-align: left; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; cursor: pointer;
}
.transcript-time:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.transcript-time:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.transcript-copy { min-width: 0; }
.transcript-copy-head { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.transcript-edit-button { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; }
.transcript-edit-button svg { width: 17px; height: 17px; }
.transcript-copy p { margin: 7px 0 0; font-size: 16px; overflow-wrap: anywhere; }
.transcript-copy > p:first-child { margin-top: 0; }
.transcript-segment-form { margin-top: 8px; }
.transcript-segment-form textarea {
  position: relative; width: 100%; min-height: 112px; resize: vertical;
  background: var(--card);
}
.transcript-segment-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.speaker-label {
  --speaker: var(--accent);
  --speaker-soft: color-mix(in srgb, var(--speaker) 15%, transparent);
  width: fit-content; display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px 4px 5px; border-radius: 999px;
  background: var(--speaker-soft); color: var(--speaker); font-size: 12px; font-weight: 750;
}
.speaker-initial {
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--speaker); color: var(--bg); font-size: 11px; line-height: 1;
}
button.speaker-label { border: 0; cursor: pointer; font-family: inherit; }
button.speaker-label:hover, button.speaker-label:focus-visible {
  outline: 2px solid var(--speaker); outline-offset: 1px;
}
.speaker-name-input { width: min(260px, 100%); margin: 0; padding: 4px 10px; font-size: 13px; }
.speaker-tone-0 { --speaker: var(--accent); }
.speaker-tone-1 { --speaker: var(--ok); }
.speaker-tone-2 { --speaker: var(--warn); }
.speaker-tone-3 { --speaker: var(--err); }

.summary-markdown { font-size: 16px; overflow-wrap: anywhere; }
.summary-markdown h1, .summary-markdown h2 { margin: 1.4em 0 .55em; line-height: 1.3; }
.summary-markdown h1:first-child, .summary-markdown h2:first-child { margin-top: 0; }
.summary-markdown h1 { font-size: 25px; }
.summary-markdown h2 { font-size: 20px; }
.summary-markdown p { margin: 0 0 1em; }
.summary-markdown ul { margin: 0 0 1em; padding-left: 24px; }
.summary-markdown li { margin: .35em 0; }
.summary-markdown blockquote {
  margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; background: var(--accent-soft); color: var(--muted);
}
.viewer-empty {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); text-align: center;
}
.recorded-view-panel { max-width: 680px; margin: 0 auto 20px; text-align: center; }
.recorded-view-panel h2 { margin-top: 0; }
.recorded-transcribe-button, .recorded-list-action {
  min-height: 46px; padding-inline: 22px; font-weight: 750;
}

.bottom-nav { display: none; }

@media (min-width: 721px) {
  .desktop-tabs { display: flex; }
  .bottom-nav { display: none; }
}

@media (max-width: 720px) {
  .dashboard-body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .dashboard-top .wrap { height: 56px; padding-inline: 16px; }
  .desktop-tabs, .dashboard-email { display: none; }
  .dashboard-main { padding: 20px 16px 32px; }
  .home-intro { margin-top: 0; }
  .home-intro h1, .page-heading h1 { font-size: 26px; }
  .page-heading { margin-bottom: 16px; }

  .quota-card { padding: 16px; }
  .quota-head { display: block; }
  .quota-head #quotaText { margin-top: 8px; }
  .create-panel { margin-top: 24px; }
  .record-action-wrap { padding-bottom: 22px; }
  .record-circle { width: 140px; height: 140px; }
  .source-action, .source-action.drop { min-height: 96px; padding: 14px; gap: 10px; }
  .source-action > svg { width: 30px; height: 30px; }
  .settings-body { padding-inline: 14px; }
  .submit-row .btn { width: 100%; min-height: 48px; }
  .rec-controls .btn { width: 100%; min-width: 0; min-height: 48px; }
  .rec-transcribe-check { flex-basis: 100%; }

  .card { padding: 18px; }
  .card + .card { margin-top: 14px; }
  .recent-section { margin-top: 20px; }
  .recent-job-head { align-items: center; }

  .jobs-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .job-search-row { margin-bottom: 16px; }
  .job-search-row input { background: var(--card); min-height: 48px; }
  .job-search-row .icon-button { min-width: 48px; min-height: 48px; background: var(--card); }
  .jobs-table { overflow: visible; }
  .jobs-table table, .jobs-table tbody, .jobs-table tr, .jobs-table td { display: block; width: 100%; }
  .jobs-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .jobs-table tbody { display: grid; gap: 12px; }
  .jobs-table tr {
    padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow);
  }
  .jobs-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .jobs-table td::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    color: var(--muted); font-size: 11px; font-weight: 650;
    text-transform: uppercase; letter-spacing: .04em;
  }
  .jobs-table td:last-child { border-bottom: 0; }
  .jobs-table td.actions {
    display: flex; align-items: center; justify-content: flex-start;
    flex-wrap: wrap; gap: 8px; text-align: left; white-space: normal;
  }
  .jobs-table td.actions::before { flex: 0 0 100%; }
  .jobs-table td.actions .btn { min-height: 40px; margin-left: 0 !important; }
  .jobs-table td.actions > div { width: 100%; }

  .record-view-header { margin-bottom: 18px; }
  .view-back { margin-bottom: 14px; }
  .record-view-title-row h1 { font-size: 25px; }
  .record-view-actions { flex-wrap: wrap; }
  .record-downloads { flex-basis: 100%; }
  .record-view-actions > .btn { min-height: 44px; }
  .audio-player-tools > .btn { flex: 1; }
  .viewer-tabs { margin-bottom: 16px; }
  .transcript-edit-tools { margin-top: -4px; }
  .transcript-replace-grid { grid-template-columns: 1fr; }
  .transcript-replace-actions { align-items: flex-start; flex-wrap: wrap; }
  .transcript-replace-actions .check { flex: 0 0 100%; }
  .summary-version-toolbar { align-items: flex-start; margin-bottom: 14px; }
  .summary-version-pills { flex: 1; }
  .summary-regenerate-grid { grid-template-columns: 1fr; }
  .summary-regenerate-actions { flex-wrap: wrap; }
  .summary-regenerate-actions .muted { flex: 0 0 100%; }
  .transcript-paragraph { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 16px 10px; }
  .transcript-copy p, .summary-markdown { font-size: 15px; }

  .grid.cols-2.credit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-actions .btn { min-height: 48px; }

  .bottom-nav {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    /* 4 или 5 кнопок: «Звонок» видна, только когда звонки включены (TRANS-191). */
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  }
  .bottom-nav button {
    min-width: 0; min-height: 54px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px; padding: 4px 2px;
    border: 0; background: transparent; color: var(--muted);
    font: inherit; font-size: 11px; font-weight: 650; cursor: pointer;
  }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.on { color: var(--accent); }
  .bottom-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
}

@media (max-width: 380px) {
  .bottom-nav button { font-size: 10px; letter-spacing: -0.01em; }
  .source-action, .source-action.drop { padding-inline: 12px; }
  .source-action > svg { width: 26px; height: 26px; }
  .source-copy small { font-size: 11px; }
}

/* Выбор из двух вариантов карточками: выпадающий список со стрелкой прятал
   второй вариант, и пользователь не догадывался, что выбор вообще есть. */
.choice-field { border: 0; padding: 0; margin: 0 0 16px; }
.choice-field legend { padding: 0; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .choice-row { grid-template-columns: 1fr; } }
.choice {
  display: grid; gap: 4px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--bg-elevated, var(--bg-soft)); }
.choice input { margin: 0 0 2px; accent-color: var(--accent); }
.choice-title { font-weight: 600; }
.choice-note { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ---------- диктофон на устройстве (TRANS-110) ---------- */
/* Рассказ при первом входе и список записей, которые лежат только на этом
   устройстве. Цвета — из переменных темы, чтобы все три темы остались целы. */
.intro-card { margin-bottom: 18px; }
.intro-card h2 { font-size: 19px; }
.intro-points { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.intro-points li { margin: 4px 0; }
.intro-card #introIosHint { margin-top: 12px; }
.intro-actions { margin-top: 14px; }
.device-link { display: block; margin-top: 2px; }
.device-card { margin-bottom: 18px; }
.device-card .section-heading-row h2 { margin: 0; }
.device-note { margin-top: 8px; }
.device-warning { display: flex; align-items: flex-start; gap: 12px; }
.device-warning .btn { flex: 0 0 auto; }
.device-storage { min-height: 18px; margin-bottom: 10px; }
.device-storage:empty { display: none; }
.device-storage-warn { color: var(--warn); }
.device-list { display: grid; gap: 10px; }
.device-rec {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-soft);
}
.device-rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.device-rec-head b { min-width: 0; overflow-wrap: anywhere; }
.device-rec-state { margin-top: 4px; }
.device-rec-progress { margin-top: 8px; }
.device-rec-player { margin-top: 8px; }
.device-rec-player:empty { display: none; }
.device-rec-player audio { display: block; width: 100%; min-height: 42px; color-scheme: light dark; }
.device-rec-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rec-transcribe-check small { display: block; font-size: 12px; font-weight: 400; }
.source-storage-note { margin-top: 10px; }
@media (max-width: 720px) {
  .device-warning { flex-direction: column; }
  .device-rec-actions .btn { min-height: 40px; }
}

/* Почта и выход в шапке: без видимого выхода человек не понимает, под кем он
   вошёл и как выйти, — а это первое, что спрашивают о чужом устройстве. */
.dashboard-account { display: flex; align-items: center; gap: 10px; }
.btn-small { padding: 4px 10px; font-size: 13px; line-height: 1.2; }
@media (max-width: 640px) { .dashboard-account .dashboard-email { display: none; } }

/* ---------- вкладка «Видеозвонок» (TRANS-191) ---------- */
.calls-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.calls-history { flex: 1 1 280px; max-width: 380px; min-width: 0; padding: 18px; }
.calls-history h2 { margin: 0 0 10px; font-size: 17px; }
.calls-history-list { display: flex; flex-direction: column; }
.calls-history-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.calls-history-item:first-child { border-top: 0; }
.calls-history-item .btn { align-self: flex-start; margin-top: 4px; }
/* Действия карточки звонка: «Открыть запись», «Открыть запись → чат», «Чат». */
.calls-history-item .btn + .btn { margin-left: 8px; align-self: flex-start; }
.calls-chat-drop { margin-top: 6px; padding: 8px 0 2px; border-top: 1px dashed var(--line); }
.calls-chat-drop .call-chat-item { padding: 6px 0; }
.calls-tab .card + .card { margin-top: 0; }
.calls-history-item .head { display: flex; gap: 8px; align-items: baseline; }
.calls-history-item .head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls-history-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.calls-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg-soft); color: var(--muted); }
.calls-badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.calls-badge.wait { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.calls-badge.err { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.calls-badge.live { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.calls-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.calls-hero h1 { margin: 6px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.calls-hero p { margin: 0; }
.calls-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.calls-action { display: flex; flex-direction: column; gap: 10px; }
.calls-action h2 { margin: 4px 0 0; font-size: 19px; }
.calls-action input { width: 100%; box-sizing: border-box; }
.calls-action .btn { align-self: flex-start; min-height: 46px; }
.calls-action-icon { width: 48px; height: 48px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center;
                     background: var(--accent-soft); color: var(--accent); }
.calls-action-icon.primary { background: var(--accent); color: var(--accent-contrast); }
.calls-action-icon svg { width: 24px; height: 24px; }
#callInvite { width: 100%; box-sizing: border-box; }
.calls-limits .notice:empty, .calls-limits .small:empty { display: none; }
@media (max-width: 720px) {
  .calls-history { max-width: none; order: 2; }
  .calls-hero h1 { font-size: 22px; }
}

/* ---------- консультации (TRANS-196, срез B) ---------- */
.consult-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.consult-side { flex: 1 1 300px; max-width: 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.consult-side h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -.02em; }
.consult-side input[type="search"] { width: 100%; box-sizing: border-box; }
.consult-list { display: flex; flex-direction: column; }
.consult-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line);
                text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0;
                font: inherit; color: inherit; cursor: pointer; }
.consult-item:first-child { border-top: 0; }
.consult-item .head { display: flex; gap: 8px; align-items: baseline; }
.consult-item .head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consult-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.consult-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
                 background: var(--bg-soft); color: var(--muted); }
.consult-badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.consult-badge.wait { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.consult-badge.err { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.consult-card { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.consult-card h2 { margin: 0; font-size: 19px; }
.consult-card textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.consult-question { white-space: pre-wrap; overflow-wrap: anywhere; }
.consult-actions-row { flex-wrap: wrap; gap: 8px; }
.consult-chat-drop { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 720px) {
  .consult-side { max-width: none; order: 2; }
  .consult-side h1 { font-size: 22px; }
  .consult-card { order: 1; }
}

/* ---------- поддержка (TRANS-205): кнопка на виду с любой страницы ---------- */
.support-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-contrast); font: inherit; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer;
}
.support-fab:hover { filter: brightness(1.08); }
.support-modal { max-width: 480px; }
.support-modal textarea { width: 100%; resize: vertical; }
.support-modal input[type=file] { width: 100%; }
.support-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#supportStatus.err { color: var(--err); }
#supportStatus.ok { color: var(--ok); }
@media (max-width: 720px) {
  /* над нижней навигацией кабинета */
  .support-fab { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; padding: 9px 14px; }
}
