/* Дизайн v2 — сдержанный тёмный стиль, общий для всех страниц тренажёра.
   Откат на v1: файлы в design-v1-backup/ (см. README). */

:root {
  --bg: #0f1116;
  --surface: #161922;
  --surface-2: #1d222d;
  --border: #262b37;
  --border-soft: #1f242f;
  --text: #e7eaf0;
  --muted: #a6afc0;
  --faint: #66708395;
  --faint-solid: #7d879a;
  --accent: #5b74e8;
  --accent-hover: #6d84f0;
  --accent-soft: rgba(91, 116, 232, 0.14);
  --accent-text: #aebcf7;
  --ok: #46b98c;
  --ok-soft: rgba(70, 185, 140, 0.13);
  --bad: #d96a80;
  --bad-soft: rgba(217, 106, 128, 0.12);
  --radius: 14px;
  --radius-s: 10px;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f1116 0%, #131721 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Боковое меню ----------
   Разделов стало больше, чем помещается в строку, и портал будет расти дальше:
   вертикальный список тянется без давки и оставляет место под счётчики. */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex: none;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 1rem 0.7rem 0.8rem;
  background: rgba(18, 21, 29, 0.9);
  border-right: 1px solid var(--border-soft);
}
.sidebrand { display: flex; gap: 0.6rem; align-items: center; padding: 0.2rem 0.45rem 0.9rem;
             color: inherit; text-decoration: none; }
.sidebrand .logo {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid rgba(91, 116, 232, 0.3); font-weight: 700; font-size: 0.9rem;
}
.sidebrand b { display: block; font-size: 0.86rem; letter-spacing: 0.1px; }
.sidebrand span { display: block; color: var(--faint-solid); font-size: 0.7rem; line-height: 1.3;
                  margin-top: 0.1rem; }
/* Демо-стенд: заметно, но не криком — клиент должен понимать, что смотрит на образец. */
.demo-note { margin: 0 0.45rem 0.7rem; padding: 0.45rem 0.6rem; border-radius: 8px;
             font-size: 0.72rem; line-height: 1.35; color: var(--accent-text);
             background: var(--accent-soft); border: 1px solid rgba(91, 116, 232, 0.3); }

/* Возраст данных: синк ходит раз в полчаса, без этого «где мой звонок?» неизбежен */
.fresh {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0 0.2rem 0.9rem; padding: 0.4rem 0.6rem;
  border-radius: var(--radius-s); border: 1px solid var(--border-soft);
  background: var(--ok-soft); color: var(--ok);
  font-size: 0.73rem; line-height: 1.25;
}
.fresh .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.fresh.stale { background: rgba(217, 169, 74, 0.13); color: #d9a94a; }
/* вне рабочего времени тишина — норма: серым, без тревоги */
.fresh.idle { background: var(--surface-2); color: var(--muted); }

.sidenav { display: flex; flex-direction: column; gap: 0.15rem; }
.sidelink {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.52rem 0.6rem; border-radius: var(--radius-s);
  font-size: 0.86rem; font-weight: 500;
  color: var(--muted); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s ease;
}
.sidelink:hover { color: var(--text); background: var(--surface-2); }
.sidelink.active {
  color: var(--accent-text); background: var(--accent-soft);
  border-color: rgba(91, 116, 232, 0.3);
}
.sidelink .ic { width: 17px; height: 17px; flex: none; opacity: 0.8; }
.sidelink .txt { flex: 1; }
.sidelink .count {
  background: var(--surface-2); color: var(--muted);
  border-radius: 2rem; padding: 0.05rem 0.45rem; font-size: 0.72rem; font-weight: 700;
}
.sidelink .count.high { background: var(--bad); color: #fff; }
.sidelink .count.wait { background: rgba(217, 169, 74, 0.2); color: #e3c07a; }
.sidefoot { margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--border-soft); }
.whoami { font-size: 0.82rem; font-weight: 600; padding: 0 0.6rem; }
.whorole { font-size: 0.72rem; color: var(--faint-solid); padding: 0 0.6rem 0.5rem; }
.sidefoot .logout:hover { color: var(--bad); background: var(--bad-soft); }

/* ---------- Шапка с меню-кнопками (тренажёр, экран входа) ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 1.4rem;
  background: rgba(15, 17, 22, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { font-weight: 700; font-size: 0.98rem; letter-spacing: 0.2px; white-space: nowrap; }
.topnav nav { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.navname {
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid rgba(91, 116, 232, 0.25);
  border-radius: 2rem;
  padding: 0.32rem 0.9rem;
  font-size: 0.82rem; font-weight: 600;
  margin-right: 0.5rem;
}
.navbtn {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-s);
  font-size: 0.85rem; font-weight: 500;
  color: var(--muted); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.navbtn:hover { color: var(--text); background: var(--surface-2); }
.navbtn.active {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: rgba(91, 116, 232, 0.35);
}
.navbtn.logout:hover { color: var(--bad); background: var(--bad-soft); }

main { padding: 2.2rem 1rem 4rem; }
main.center { display: flex; flex-direction: column; align-items: center; }
.shell > main { flex: 1; min-width: 0; padding-top: 1.6rem; }
/* меню держит левый край, поэтому контент центрируем по остатку ширины */
.shell > main > .wrap { margin: 0 auto; }
.wrap { max-width: 1000px; margin: 0 auto; }

h1 { font-weight: 650; font-size: 1.25rem; letter-spacing: 0.2px; margin: 0 0 1rem; }
h2 { font-size: 1rem; font-weight: 600; color: #c9cfdb; }

/* ---------- Кнопки и поля ---------- */
button {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 0.55rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: var(--accent); color: #fff; cursor: pointer;
  transition: all 0.15s ease;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.45; cursor: default; }
button.ghost { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
button.ghost:hover { color: var(--text); }

input, select, textarea {
  font: inherit; font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-s);
  background: #12151d; color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--faint-solid); }

/* ---------- Карточки, таблицы ---------- */
.card, .section, .call-row, .progress {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--border-soft);
            border-radius: var(--radius); padding: 0.3rem 0.9rem 0.7rem; margin-top: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border-soft);
         white-space: nowrap; }
tr:last-child td { border-bottom: none; }
th { color: var(--faint-solid); font-weight: 500; font-size: 0.74rem; text-transform: uppercase;
     letter-spacing: 0.5px; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
tr.inactive td { color: #565e6e; }
.num { text-align: right; }
.role-admin { color: #d9a94a; }
.actions a { color: #7d92ee; cursor: pointer; margin-right: 0.7rem; font-size: 0.82rem;
             text-decoration: none; }
.actions a:hover { text-decoration: underline; }
.actions a.danger { color: var(--bad); }

a { color: #7d92ee; }

/* ---------- Формы-блоки (админка) ---------- */
form.panel, #add-form, #gen-form, #sc-edit {
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  margin-top: 1.2rem; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
}
#msg, #sc-msg, #set-msg { min-height: 1.2em; font-size: 0.85rem; margin-top: 0.6rem; }
#msg.ok { color: var(--ok); } #msg.err { color: var(--bad); }
.totals { color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem; }

/* ---------- Звонки: строки, бейджи, разбор ---------- */
.call-row { padding: 0.75rem 1.05rem; margin-top: 0.55rem; cursor: pointer; font-size: 0.86rem;
            transition: border-color 0.15s ease; }
.call-row:hover { border-color: var(--border); }
.call-head { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.call-head .when { color: var(--muted); min-width: 105px; }
.call-head .who { min-width: 130px; font-weight: 600; }
.call-head .sc { flex: 1; min-width: 160px; }
.call-head .dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { border-radius: 2rem; padding: 0.18rem 0.75rem; font-size: 0.76rem; font-weight: 600; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.fail { background: var(--bad-soft); color: var(--bad); }
.badge.wait { background: var(--surface-2); color: var(--muted); }
.del { color: var(--faint-solid); font-size: 0.95rem; padding: 0 0.3rem; margin-left: 0.2rem; }
.del:hover { color: var(--bad); }
.fb { display: none; margin-top: 0.85rem; border-top: 1px solid var(--border-soft);
      padding-top: 0.85rem; cursor: default; }
.fb h5 { margin: 0.75rem 0 0.25rem; font-size: 0.8rem; color: #c9cfdb; text-transform: uppercase;
         letter-spacing: 0.4px; }
.fb ul { margin: 0.2rem 0 0 1.2rem; padding: 0; color: #b6becb; line-height: 1.45; }
.fb .verdict { color: var(--text); font-style: italic; }
.fb details { margin-top: 0.8rem; }
.fb summary { color: #7d92ee; cursor: pointer; font-size: 0.8rem; }
.fb pre { white-space: pre-wrap; color: var(--muted); font-size: 0.8rem; font-family: inherit;
          line-height: 1.5; }

/* ---------- Страница настроек ---------- */
.section { padding: 1.15rem 1.35rem; margin-top: 1.2rem; }
.section > h2 { margin: 0 0 0.2rem; font-size: 1rem; }
.section > .sub { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.6rem; line-height: 1.45; }
.block { border-top: 1px solid var(--border-soft); padding-top: 0.85rem; margin-top: 0.95rem; }
.block > h4 { margin: 0 0 0.5rem; font-size: 0.86rem; font-weight: 600; color: #c9cfdb; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.55rem; }
.lbl { min-width: 190px; font-size: 0.84rem; }
.src { color: var(--faint-solid); font-size: 0.76rem; }
.help { color: var(--faint-solid); font-size: 0.76rem; margin: 0.15rem 0 0 0.2rem;
        max-width: 720px; line-height: 1.45; }
.note { color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; line-height: 1.5; }

/* ---------- История: прогресс ---------- */
.progress { margin-top: 1rem; padding: 0.9rem 1.15rem; font-size: 0.86rem; color: #b6becb;
            line-height: 1.6; }
.progress b { color: var(--text); }

/* ================= Портал аналитики звонков ================= */

.wrap.wide { max-width: 1240px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.right { text-align: right; }

/* Плитки показателей */
/* Ровная сетка: шесть плиток в ряд на широком экране, по три — на среднем.
   auto-fit давал 4+2 и 5+1 с пустотой во втором ряду. */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.75rem; margin-top: 1rem; }
@media (max-width: 1360px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border-soft);
       border-radius: var(--radius); padding: 0.95rem 1.1rem; min-width: 0; }
.kpi .label { color: var(--faint-solid); font-size: 0.74rem; text-transform: uppercase;
              letter-spacing: 0.5px; }
.kpi .value { font-size: 1.75rem; font-weight: 650; margin-top: 0.35rem;
              font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.trend { font-size: 0.85rem; font-weight: 600; margin-left: 0.4rem; }
.trend.up { color: var(--ok); } .trend.down { color: var(--bad); }
.trend.flat { color: var(--faint-solid); }

/* Переключатель периода */
.tabs { display: flex; gap: 0.35rem; margin: 1.1rem 0 0; flex-wrap: wrap; }
.tab { padding: 0.4rem 0.9rem; border-radius: var(--radius-s); font-size: 0.84rem;
       color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
       cursor: pointer; }
.tab.active { color: var(--accent-text); background: var(--accent-soft);
              border-color: rgba(91, 116, 232, 0.35); }

/* Секции-панели */
.panelbox { background: var(--surface); border: 1px solid var(--border-soft);
            border-radius: var(--radius); padding: 1.05rem 1.25rem; margin-top: 1.1rem; }
.panelbox > h2 { margin: 0 0 0.15rem; }
.panelbox > .sub { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.7rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1.1rem; }

/* Алерты (подсказки в кабинете, лучший звонок) */
.alert { border: 1px solid var(--border-soft); border-left: 3px solid var(--bad);
         border-radius: var(--radius-s); background: var(--surface-2);
         padding: 0.75rem 0.95rem; margin-top: 0.6rem; font-size: 0.87rem; }
.alert .co { font-weight: 600; }
.alert .advice { margin-top: 0.45rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-s);
                 background: var(--accent-soft); color: #cdd7fb; line-height: 1.45; }
.alert .meta { color: var(--muted); font-size: 0.79rem; margin-top: 0.3rem; }
.alert.win { border-left-color: var(--ok); }
.empty { color: var(--faint-solid); font-size: 0.85rem; padding: 0.7rem 0; }

/* Полоски долей (профиль базы, воронка) */
.bar { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.45rem; font-size: 0.85rem; }
.bar .name { min-width: 190px; }
.bar .track { flex: 1; height: 9px; background: var(--surface-2); border-radius: 5px;
              position: relative; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.bar .fill.ok { background: var(--ok); } .bar .fill.bad { background: var(--bad); }
.bar .val { min-width: 74px; text-align: right; color: var(--muted);
            font-variant-numeric: tabular-nums; }
.target { position: absolute; top: -2px; bottom: -2px; border-left: 2px dashed var(--faint-solid); }

.spark { display: block; }
.rolehdr { margin: 1.4rem 0 0.2rem; font-size: 0.9rem; font-weight: 600; color: #c9cfdb; }
.pill { display: inline-block; border-radius: 2rem; padding: 0.12rem 0.6rem; font-size: 0.74rem;
        background: var(--surface-2); color: var(--muted); }
.pill.hunter { background: rgba(217, 169, 74, 0.14); color: #d9a94a; }
.pill.farmer { background: var(--ok-soft); color: var(--ok); }

/* Логин */
.login { max-width: 340px; margin: 8vh auto 0; }
.login .card { padding: 1.6rem 1.5rem; }
.login input { width: 100%; margin-top: 0.6rem; }
.login button { width: 100%; margin-top: 0.9rem; }

/* Карточка звонка */
.blockrow { border-top: 1px solid var(--border-soft); padding-top: 0.8rem; margin-top: 0.9rem; }
.blockrow h4 { margin: 0 0 0.35rem; font-size: 0.86rem; color: #c9cfdb; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 0.4rem 1rem; font-size: 0.87rem;
      line-height: 1.5; }
.kv .k { color: var(--faint-solid); }
pre.tr { white-space: pre-wrap; font-family: inherit; font-size: 0.84rem; line-height: 1.55;
         color: #b6becb; margin: 0; }

/* ================= Аудит: подсказки, загрузка, плеер, мобильная версия ========= */

/* Значок «?» с расшифровкой методики по наведению */
.hintdot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface-2); color: var(--faint-solid);
  border: 1px solid var(--border);
  font-size: 0.68rem; font-weight: 700; cursor: help;
  vertical-align: middle;
}
.hintdot:hover { color: var(--accent-text); border-color: var(--accent); }

/* Заглушки на время загрузки */
.skel {
  height: 12px; border-radius: 6px; margin: 0.55rem 0;
  background: linear-gradient(90deg, var(--surface-2) 25%, #232935 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel 1.2s ease-in-out infinite;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.errbox {
  display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--bad); border-left-width: 3px;
  background: var(--bad-soft); color: #f0c2cc;
  border-radius: var(--radius-s); padding: 0.7rem 0.9rem; font-size: 0.86rem;
}

/* Плеер записи разговора */
.player { width: 100%; max-width: 460px; height: 34px; margin-top: 0.5rem; }
audio.player::-webkit-media-controls-panel { background: var(--surface-2); }

/* Фильтры журнала звонков */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { font-size: 0.85rem; padding: 0.45rem 0.7rem; }
.pager { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.9rem;
         font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }

/* Отметка «показан точный период» в фильтрах журнала звонков */
.rangenote { color: var(--accent-text); }
.rangenote b { font-weight: 600; }
.rangenote a.pick { margin: 0 0 0 0.5rem; }

/* Подпись периода под вкладками на странице «Команда» */
.periodline { margin: 0.6rem 0 0; font-size: 0.86rem; color: var(--muted); }
.periodline b { color: var(--text); }

/* Подпись под процентом в рейтинге: «10 из 29» */
td.num .small { display: block; font-weight: 400; margin-top: 0.1rem; }

/* Страница «Как читать» */
.terms { display: grid; grid-template-columns: 96px 1fr; gap: 0.55rem 1rem; font-size: 0.88rem;
         line-height: 1.5; }
.terms .t { font-weight: 600; color: var(--accent-text); }
.stagetbl td:first-child { font-weight: 600; white-space: nowrap; }

/* Админка: таблицы широкие, поэтому контейнер шире и ячейки плотнее —
   горизонтальная прокрутка внутри таблицы неудобна, лучше ужать колонки */
.wrap.wider { max-width: 1520px; }
.admintbl th, .admintbl td { padding: 0.5rem 0.45rem; }
.admintbl input, .admintbl select { padding: 0.42rem 0.6rem; font-size: 0.85rem; }
.admintbl select { max-width: 168px; }
.admintbl .actions a { margin-right: 0.55rem; }
/* в узком окне прячем справочные колонки — редактируемые важнее:
   у менеджеров это «Город» и «Звонков», у пользователей — «Активен»
   (он и так виден по серой строке и по кнопке «включить») */
/* ---------- Приветственный обзор портала ---------- */
.tourback { position: fixed; inset: 0; z-index: 90; display: flex;
            align-items: center; justify-content: center; padding: 1.2rem;
            background: rgba(9, 11, 16, 0.62);
            -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
            animation: tourfade 0.18s ease-out; }
@keyframes tourfade { from { opacity: 0; } to { opacity: 1; } }
.tourbox { width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
           background: var(--surface); border: 1px solid var(--border);
           border-radius: var(--radius); padding: 1.1rem 1.4rem 1.2rem;
           box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.tourhead { display: flex; align-items: center; justify-content: space-between; }
.tourstep { color: var(--faint-solid); font-size: 0.74rem; text-transform: uppercase;
            letter-spacing: 0.5px; }
.tourx { background: none; border: none; color: var(--muted); font-size: 1.5rem;
         line-height: 1; padding: 0 0.2rem; cursor: pointer; }
.tourx:hover { background: none; color: var(--text); }
.tourbody { min-height: 210px; }
.tourbody h3 { margin: 0.5rem 0 0.4rem; font-size: 1.18rem; }
.tourlead { margin: 0 0 0.7rem; color: var(--text); font-size: 0.92rem; line-height: 1.5; }
.tourlist { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.88rem;
            line-height: 1.55; }
.tourlist li { margin-bottom: 0.4rem; }
.tourlist li::marker { color: var(--accent); }
.tournote { margin: 0.8rem 0 0; padding: 0.55rem 0.75rem; border-radius: var(--radius-s);
            background: var(--accent-soft); color: var(--accent-text); font-size: 0.85rem;
            line-height: 1.45; }
.tourdots { display: flex; gap: 0.35rem; justify-content: center; margin: 1rem 0 0.9rem; }
.tourdot { width: 7px; height: 7px; border-radius: 50%; background: var(--border);
           cursor: pointer; transition: background 0.15s ease, width 0.15s ease; }
.tourdot.on { background: var(--accent); width: 18px; border-radius: 4px; }
.tourfoot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
            border-top: 1px solid var(--border-soft); padding-top: 0.85rem; flex-wrap: wrap; }
.tourskip { display: flex; align-items: center; gap: 0.45rem; color: var(--muted);
            font-size: 0.83rem; cursor: pointer; }
.tourskip input { width: 16px; height: 16px; accent-color: var(--accent); }
.tournav { display: flex; gap: 0.5rem; margin-left: auto; }

@media (max-width: 560px) {
  .tourbox { padding: 0.9rem 1rem 1rem; max-height: 92vh; }
  .tourbody { min-height: 0; }
  .tourfoot { flex-direction: column-reverse; align-items: stretch; }
  .tournav { margin-left: 0; }
  .tournav button { flex: 1; }
}

@media (max-width: 1240px) {
  .mgrtbl th:nth-child(4), .mgrtbl td:nth-child(4),
  .mgrtbl th:nth-child(8), .mgrtbl td:nth-child(8),
  .usrtbl th:nth-child(6), .usrtbl td:nth-child(6) { display: none; }
}
@media (max-width: 1120px) {
  .admintbl input { max-width: 128px; }
  .admintbl select { max-width: 132px; }
  .access { min-width: 180px; }
}

/* Сообщения об ошибке и удаче в мелком тексте (форма пользователей, модалки) */
.err { color: var(--bad); }
#umsg.ok { color: var(--ok); }
.pwbox .row { margin-top: 0.7rem; }
.pwbox .err:empty { display: none; }

/* Админка: права доступа */
.roles { margin: 0.1rem 0 0.9rem 1.1rem; padding: 0; line-height: 1.6; }
.roles li { margin: 0; }
.access { white-space: normal; min-width: 196px; }
.access.warn > span { color: var(--bad); }
.access > span.small { display: block; }   /* ссылка «выбрать» — всегда со следующей строки */
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.chip { background: var(--surface-2); border: 1px solid var(--border-soft);
        border-radius: 2rem; padding: 0.1rem 0.55rem; font-size: 0.76rem; white-space: nowrap; }
.chip.more { color: var(--muted); }
a.pick { display: inline-block; margin-top: 0.25rem; font-size: 0.78rem;
         color: var(--accent-text); cursor: pointer; white-space: nowrap; }
a.pick:hover { text-decoration: underline; }

/* Модальное окно (выбор подчинённых) */
.modalback { position: fixed; inset: 0; background: rgba(6, 9, 16, 0.66); z-index: 50;
             display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modalbox { background: var(--surface); border: 1px solid var(--border-soft);
            border-radius: var(--radius); padding: 1.2rem 1.35rem; width: 100%; max-width: 460px;
            max-height: 82vh; overflow-y: auto; }
.modalbox h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.modalact { margin-top: 1rem; }
.picker .pickrow { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.2rem;
                   border-top: 1px solid var(--border-soft); font-size: 0.88rem; cursor: pointer; }
.picker .pickrow:hover { background: var(--surface-2); }
.picker input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Заливка ячеек по порогам ----------
   Красим фон, а не текст: проблемную строку видно, не читая цифр. */
/* Заливка приглушённая: цвет несёт цифра, фон лишь подсказывает строку — сплошные
   бурые и винные плашки утомляли и спорили друг с другом. */
td.heat-good { background: rgba(70, 185, 140, 0.075); color: #7fdcb7; }
td.heat-warn { background: rgba(217, 169, 74, 0.075); color: #e6c27a; }
td.heat-bad  { background: rgba(217, 106, 128, 0.085); color: #f0a3b2; }
td.heat-good, td.heat-warn, td.heat-bad { font-weight: 650; }
td.heat-good .small, td.heat-warn .small, td.heat-bad .small { color: var(--muted); }

/* ---------- Тепловая карта активности ---------- */
.heat { display: block; margin-top: 0.5rem; max-width: 620px; }
.heat .hlbl { fill: var(--muted); font-size: 11px; font-family: inherit; }
.heat .hc { fill: var(--surface-2); }
.heat .hc.l1 { fill: rgba(70, 185, 140, 0.26); }
.heat .hc.l2 { fill: rgba(70, 185, 140, 0.55); }
.heat .hc.l3 { fill: rgba(70, 185, 140, 0.92); }
.heatlegend { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.55rem; }
.heatlegend .sw { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); }
.heatlegend .sw.l1 { background: rgba(70, 185, 140, 0.26); }
.heatlegend .sw.l2 { background: rgba(70, 185, 140, 0.55); }
.heatlegend .sw.l3 { background: rgba(70, 185, 140, 0.92); }

/* ---------- Очередь сигналов ---------- */
.sig {
  border: 1px solid var(--border-soft); border-left: 3px solid var(--faint-solid);
  border-radius: var(--radius-s); background: var(--surface-2);
  padding: 0.8rem 1rem; margin-top: 0.6rem; font-size: 0.87rem;
}
.sig.sev1 { border-left-color: var(--bad); }
.sig.sev2 { border-left-color: #d9a94a; }
.sig.sev3 { border-left-color: var(--faint-solid); }
.sig.done { opacity: 0.6; }
.sighead { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
           margin-bottom: 0.35rem; }
.sighead .grow { flex: 1; }
.sigrule { font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
           letter-spacing: 0.4px; }
.sev1 .sigrule { color: #eda3b1; } .sev2 .sigrule { color: #e3c07a; }
.sev3 .sigrule { color: var(--muted); }
.sigsev { font-size: 0.7rem; color: var(--faint-solid); border: 1px solid var(--border);
          border-radius: 2rem; padding: 0.05rem 0.5rem; }
.sig .co { font-weight: 600; }
.sig .advice { margin-top: 0.45rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-s);
               background: var(--accent-soft); color: #cdd7fb; line-height: 1.45; }
.sigact { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
          margin-top: 0.7rem; }
.sigact button { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.sigact .navbtn { padding: 0.35rem 0.7rem; font-size: 0.8rem; border: 1px solid var(--border); }

/* ---------- Плитки критериев скоринга (карточка звонка) ---------- */
.crits { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
         gap: 0.6rem; margin-top: 0.7rem; }
.crit { border: 1px solid var(--border-soft); border-radius: var(--radius-s);
        padding: 0.7rem 0.85rem; background: var(--surface-2); }
.crit.ok   { background: var(--ok-soft);  border-color: rgba(70, 185, 140, 0.28); }
.crit.fail { background: var(--bad-soft); border-color: rgba(217, 106, 128, 0.28); }
.crit.part { background: rgba(217, 169, 74, 0.12); border-color: rgba(217, 169, 74, 0.28); }
.crithead { display: flex; gap: 0.5rem; align-items: baseline; }
.crithead .nm { flex: 1; font-weight: 600; font-size: 0.85rem; line-height: 1.3; }
.crithead .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.crit .txt { color: var(--muted); font-size: 0.81rem; line-height: 1.45; margin-top: 0.35rem; }
.crit .fix { color: #cdd7fb; font-size: 0.81rem; line-height: 1.45; margin-top: 0.35rem; }

/* ---------- Пересмотр оценки ---------- */
.badge.part { background: rgba(217, 169, 74, 0.14); color: #e3c07a; }
.rv {
  border: 1px solid var(--border-soft); border-left: 3px solid var(--faint-solid);
  border-radius: var(--radius-s); background: var(--surface-2);
  padding: 0.8rem 1rem; margin-top: 0.6rem; font-size: 0.87rem;
}
.rv.rv-review   { border-left-color: #d9a94a; }
.rv.rv-accepted { border-left-color: var(--ok); }
.rv.rv-rejected { border-left-color: var(--bad); }
.rv .co { font-weight: 600; margin-bottom: 0.2rem; }
.rv .co a { color: var(--text); text-decoration: none; }
.rv .co a:hover { color: var(--accent-text); }
.rv .advice { margin-top: 0.55rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-s);
              background: var(--accent-soft); color: #cdd7fb; line-height: 1.45; }
.rvquote { margin-top: 0.35rem; padding: 0.5rem 0.7rem; border-left: 2px solid var(--border);
           line-height: 1.45; white-space: pre-wrap; }
.rvcmp { display: flex; align-items: stretch; gap: 0.5rem; margin-top: 0.6rem; }
.rvcol { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border-radius: var(--radius-s);
         background: var(--surface); border: 1px solid var(--border-soft); }
.rvcol.new { border-color: rgba(70, 185, 140, 0.35); background: var(--ok-soft); }
.rvtype { font-weight: 600; margin-top: 0.15rem; }
.rvscore { color: var(--muted); font-variant-numeric: tabular-nums; }
.rvarrow { align-self: center; color: var(--faint-solid); font-size: 1.1rem; }
.rvline { margin-top: 0.45rem; line-height: 1.45; }
.rvdecision { margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--border-soft); }
.rvdecide { margin-top: 0.7rem; }
.rvdecide textarea, .rvform textarea { width: 100%; resize: vertical; font: inherit;
  font-size: 0.86rem; padding: 0.5rem 0.65rem; border-radius: var(--radius-s);
  background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.rvform .pickrow { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.2rem;
                   border-top: 1px solid var(--border-soft); font-size: 0.88rem; cursor: pointer; }
.rvform .pickrow:hover { background: var(--surface-2); }
.rvform input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); }
.rvform textarea { margin-top: 0.6rem; }
.rverr { color: var(--bad); margin: 0.4rem 0 0; min-height: 1em; }
.revised { display: inline-block; margin-left: 0.4rem; font-size: 0.72rem; padding: 0.05rem 0.5rem;
           border-radius: 2rem; background: var(--ok-soft); color: var(--ok); vertical-align: middle; }

/* Телефонная раскладка меню — в конце файла, блок «Нижнее меню». */
@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; gap: 0.4rem; padding: 0.6rem 0.9rem; }
  .brand { font-size: 0.9rem; }
  .topnav nav { gap: 0.25rem; width: 100%; overflow-x: auto; flex-wrap: nowrap;
                -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topnav nav::-webkit-scrollbar { display: none; }
  .navbtn { padding: 0.35rem 0.6rem; font-size: 0.8rem; white-space: nowrap; }
  .navname { margin-right: 0.2rem; padding: 0.28rem 0.7rem; font-size: 0.78rem; }
  main { padding: 1.2rem 0.7rem 3rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .kpi { padding: 0.7rem 0.8rem; }
  .kpi .value { font-size: 1.35rem; }
  .grid2 { grid-template-columns: 1fr; }
  .bar .name { min-width: 118px; font-size: 0.8rem; }
  .kv { grid-template-columns: 1fr; gap: 0.15rem; }
  .kv .k { margin-top: 0.5rem; }
  .terms { grid-template-columns: 1fr; gap: 0.15rem; }
  .terms .t { margin-top: 0.6rem; }
  .rvcmp { flex-direction: column; }
  .rvarrow { transform: rotate(90deg); }
}

/* ================= Редизайн 25.09.2026: удобство и телефон ================= */

h1 { font-size: 1.4rem; }

/* Заголовок панели со ссылкой справа («все сигналы →») */
.panelhead { display: flex; align-items: baseline; gap: 0.4rem 0.9rem; flex-wrap: wrap; }
.panelhead h2 { margin: 0; flex: 1; }
.panelhead a { font-size: 0.82rem; color: var(--accent-text); text-decoration: none; }
.panelhead a:hover { text-decoration: underline; }
.panelbox > .panelhead + .sub { margin-top: 0.15rem; }

/* ---------- Сигналы свёрнутой строкой ---------- */
.sig.compact { padding: 0.6rem 0.9rem; margin-top: 0.45rem; cursor: pointer;
               transition: border-color 0.15s ease; }
.sig.compact:hover { border-color: var(--border); }
.sig.compact .sighead { margin-bottom: 0.15rem; }
.sig.compact .co { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig.compact.open .co { white-space: normal; }
.sig.compact:not(.open) .sigbody { display: none; }
.sig .chev { width: 16px; height: 16px; flex: none; color: var(--faint-solid);
             transition: transform 0.15s ease; }
.sig.compact.open .chev { transform: rotate(180deg); }
.sigbody > :first-child { margin-top: 0.35rem; }
.sigbody > * + * { margin-top: 0.25rem; }
.sigbody > .advice, .sigbody > .sigact { margin-top: 0.55rem; }

/* ---------- Рейтинг: одинаковые колонки у хантеров и фермеров ---------- */
.ratetbl { table-layout: fixed; }
.ratetbl th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.ratetbl td:first-child { white-space: normal; font-weight: 600; }
.ratetbl td { vertical-align: middle; }
.ratetbl tbody tr { cursor: pointer; }
.ratetbl tbody tr:hover td:first-child { color: var(--accent-text); }
.rcards { display: none; }
.rcard { background: var(--surface-2); border: 1px solid var(--border-soft);
         border-radius: var(--radius-s); padding: 0.7rem 0.8rem; margin-top: 0.5rem; cursor: pointer; }
.rcard .rtop { display: flex; justify-content: space-between; gap: 0.6rem; font-weight: 600; }
.rcard .rtop span { color: var(--muted); font-weight: 400; font-size: 0.8rem; white-space: nowrap; }
.rmetrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem;
            margin-top: 0.55rem; }
.rm { border-radius: 8px; padding: 0.35rem 0.5rem; background: var(--surface); }
.rm .l { font-size: 0.64rem; color: var(--faint-solid); text-transform: uppercase;
         letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm .v { font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 0.1rem; }
.rm .n { font-size: 0.7rem; color: var(--muted); }
.rm.heat-good { background: rgba(70, 185, 140, 0.09); } .rm.heat-good .v { color: #7fdcb7; }
.rm.heat-warn { background: rgba(217, 169, 74, 0.09); } .rm.heat-warn .v { color: #e6c27a; }
.rm.heat-bad  { background: rgba(217, 106, 128, 0.1); }  .rm.heat-bad .v  { color: #f0a3b2; }

/* ---------- Таблица последних звонков в кабинете ---------- */
.calltbl tbody tr { cursor: pointer; }
.calltbl tbody tr:hover td { color: var(--text); }
.clip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
        white-space: nowrap; }
/* фиксированная раскладка: длинное название клиента обрезается, а не распирает таблицу */
.calltbl { table-layout: fixed; }
.calltbl th:nth-child(1) { width: 104px; }
.calltbl th:nth-child(3) { width: 24%; }
.calltbl th:nth-child(4) { width: 76px; }
.calltbl th:nth-child(5) { width: 64px; }
.calltbl th:nth-child(6) { width: 64px; }
.calltbl th:nth-child(7) { width: 112px; }
.calltbl td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; }
.badge.score { font-variant-numeric: tabular-nums; }

/* ---------- Журнал звонков ---------- */
.call-head .sc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.nos { background: transparent; border: 1px dashed var(--border); }
.call-row.noscore { opacity: 0.78; }
.call-row.noscore:hover { opacity: 1; }
.ftoggle { display: none; }

/* ---------- Карточка звонка ---------- */
.callhero { display: flex; gap: 1rem 1.4rem; align-items: flex-start; flex-wrap: wrap; }
.callhero .ttl { flex: 1; min-width: 0; }
.callhero h1 { margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.callmeta { color: var(--muted); font-size: 0.86rem; display: flex; gap: 0.3rem 0.9rem;
            flex-wrap: wrap; }
.callmeta b { color: var(--text); font-weight: 600; }
.callpills { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.6rem; }
.scorebig { text-align: center; min-width: 128px; padding: 0.65rem 1rem;
            border-radius: var(--radius); border: 1px solid var(--border); }
.scorebig .n { font-size: 2rem; font-weight: 700; line-height: 1.1;
               font-variant-numeric: tabular-nums; }
.scorebig .p { font-size: 0.78rem; margin-top: 0.15rem; }
.scorebig.ok   { background: var(--ok-soft); border-color: rgba(70, 185, 140, 0.35); color: #7fdcb7; }
.scorebig.part { background: rgba(217, 169, 74, 0.1); border-color: rgba(217, 169, 74, 0.35);
                 color: #e6c27a; }
.scorebig.fail { background: var(--bad-soft); border-color: rgba(217, 106, 128, 0.35); color: #f0a3b2; }
.scorebig.none { background: var(--surface-2); color: var(--muted); }
.scorebig.none .n { font-size: 0.95rem; font-weight: 600; padding: 0.35rem 0; }
/* плеер прилипает к верху: слушать запись и читать разбор одновременно */
.playerbar { position: sticky; top: 0.5rem; z-index: 15; display: flex; gap: 0.8rem;
             align-items: center; margin-top: 1rem; padding: 0.5rem 0.9rem;
             background: rgba(22, 25, 34, 0.95); backdrop-filter: blur(8px);
             border: 1px solid var(--border); border-radius: var(--radius);
             box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.playerbar .player { margin: 0; max-width: none; flex: 1; }
.playerbar a { font-size: 0.8rem; white-space: nowrap; color: var(--muted); }
.callgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
            gap: 0 1.1rem; align-items: start; }
.trpanel { position: sticky; top: 4.6rem; }
.trpanel pre.tr { max-height: calc(100vh - 11rem); overflow-y: auto; padding-right: 0.4rem; }
.callgrid .tabs { margin-top: 1.1rem; }
@media (max-width: 1100px) {
  .callgrid { grid-template-columns: 1fr; }
  .trpanel { position: static; }
  .trpanel pre.tr { max-height: 60vh; }
}

/* ---------- Нижнее меню на телефоне ----------
   Верхняя полоса прятала пункты за край экрана, и что её можно листать, было не видно.
   Внизу четыре главных раздела и «Ещё» — под большим пальцем, как в мобильных приложениях. */
.mbar, .msheet, .mshade { display: none; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; max-width: 100%; height: auto; align-self: stretch; min-width: 0;
    position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    border-right: none; border-bottom: 1px solid var(--border-soft);
    background: rgba(15, 17, 22, 0.93); backdrop-filter: blur(10px);
  }
  .sidebrand { padding: 0; flex: 1; min-width: 0; }
  .sidebrand span { display: none; }
  .sidebrand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebrand > div:last-child { min-width: 0; }
  .fresh { margin: 0; white-space: nowrap; font-size: 0.7rem; }
  .sidenav, .sidefoot { display: none; }
  .shell > main { padding: 1.1rem 0.8rem calc(86px + env(safe-area-inset-bottom)); }

  .mbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(18, 21, 29, 0.97); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 0.3rem 0.3rem calc(0.3rem + env(safe-area-inset-bottom));
  }
  .mitem {
    flex: 1; min-width: 0; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    padding: 0.4rem 0.1rem; border: none; border-radius: 10px; background: none;
    color: var(--muted); text-decoration: none; font-size: 0.66rem; font-weight: 500;
  }
  .mitem:hover { background: none; color: var(--text); }
  .mitem .ic { width: 22px; height: 22px; }
  .mitem.active { color: var(--accent-text); }
  .mitem .txt { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mitem .count { position: absolute; top: 0; left: calc(50% + 5px);
                  border-radius: 2rem; padding: 0 0.35rem; line-height: 1.45;
                  font-size: 0.6rem; font-weight: 700;
                  background: var(--surface-2); color: var(--text); }
  .mitem .count.high { background: var(--bad); color: #fff; }
  .mitem .count.wait { background: #d9a94a; color: #1a1405; }

  .msheet {
    display: block; position: fixed; left: 0.6rem; right: 0.6rem; z-index: 45;
    bottom: calc(72px + env(safe-area-inset-bottom));
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.45rem; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  body.msheet-open .msheet { opacity: 1; transform: none; pointer-events: auto; }
  .mwho { padding: 0.45rem 0.65rem 0.6rem; color: var(--muted); font-size: 0.8rem;
          border-bottom: 1px solid var(--border-soft); margin-bottom: 0.3rem; }
  .msheet .sidelink { padding: 0.72rem 0.7rem; font-size: 0.92rem; }
  .mshade { display: block; position: fixed; inset: 0; z-index: 35;
            background: rgba(6, 9, 16, 0.5); opacity: 0; pointer-events: none;
            transition: opacity 0.16s ease; }
  body.msheet-open .mshade { opacity: 1; pointer-events: auto; }
}

@media (max-width: 720px) {
  h1 { font-size: 1.25rem; }
  /* периоды одной прокручиваемой строкой, а не тремя рядами кнопок */
  .tabs.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
                 margin-left: -0.8rem; margin-right: -0.8rem; padding: 0 0.8rem; }
  .tabs.scroll::-webkit-scrollbar { display: none; }
  .tabs.scroll .tab { white-space: nowrap; flex: none; }
  .tabs.scroll .spacer { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .panelbox { padding: 0.9rem 0.9rem; }

  /* рейтинг карточками: в таблице на телефоне было видно только имя и диалоги */
  .ratewrap { display: none; }
  .rcards { display: block; }

  /* последние звонки: клиент, балл, шаг — остальное в карточке звонка */
  .calltbl th:nth-child(3), .calltbl td:nth-child(3),
  .calltbl th:nth-child(4), .calltbl td:nth-child(4),
  .calltbl th:nth-child(7), .calltbl td:nth-child(7) { display: none; }
  .calltbl th:nth-child(1) { width: 52px; }
  .calltbl td:nth-child(1) { white-space: normal; font-size: 0.78rem; line-height: 1.25; }
  .calltbl th:nth-child(5), .calltbl th:nth-child(6) { width: 50px; }
  .calltbl th, .calltbl td { padding-left: 0.35rem; padding-right: 0.35rem; }
  .tablebox { padding: 0.2rem 0.5rem 0.5rem; }

  /* фильтры журнала свёрнуты в кнопку, на виду только поиск */
  .ftoggle { display: inline-block; }
  .fpanel.collapsed .filters > :not(.fkeep) { display: none; }
  .fpanel .filters select { flex: 1 1 calc(50% - 0.5rem); min-width: 0; }
  #f-search { width: auto !important; flex: 1; min-width: 0; }
  .fpanel:not(.collapsed) #f-search { flex: 1 1 100%; order: -1; }

  .call-head { gap: 0.35rem 0.6rem; }
  .call-head .when { min-width: 0; }
  .call-head .who { min-width: 0; }
  .call-head .sc { flex-basis: 100%; order: 3; }
  .call-head .pill, .call-head .badge { order: 4; }

  .callhero { flex-direction: column; }
  .scorebig { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; text-align: left;
              padding: 0.5rem 0.8rem; }
  .scorebig .n { font-size: 1.5rem; }
  .playerbar { top: 3.4rem; padding: 0.4rem 0.6rem; }
  .playerbar a { display: none; }
}

/* Переключатель «чей кабинет», когда кабинет уже открыт: одна строка */
#picker.slim { padding: 0.55rem 0.9rem; margin-top: 0.6rem; }
#picker.slim h2, #picker.slim .sub { display: none; }
#picker.slim .row { margin-top: 0; }

/* ---------- Возражения и боли (с 28.09.2026) ---------- */
.objbar { display: flex; gap: 0.6rem 1.2rem; align-items: center; flex-wrap: wrap;
          justify-content: space-between; margin-bottom: 0.6rem; }
.objlegend { display: flex; gap: 0.4rem 1rem; flex-wrap: wrap; align-items: center; }
.objlegend span { display: inline-flex; gap: 0.35rem; align-items: center; }
.objlegend .heat { display: inline-block; width: 18px; height: 8px; border-radius: 4px; }
.heat.h3 { background: #e0607a; }
.heat.h2 { background: #e39a55; }
.heat.h1 { background: #d9c46a; }
.heat.h0 { background: var(--surface-2); }
.badge.objnew { background: var(--accent-soft); color: var(--accent-text); }
.pill.kind-objection { background: rgba(224, 96, 122, 0.12); color: #e893a5; }
.pill.kind-pain { background: rgba(122, 166, 232, 0.13); color: #9dbdf0; }

.objrow { border-top: 1px solid var(--border-soft); }
.objrow.isnew { box-shadow: inset 3px 0 0 var(--accent); }
.objhead .chev { color: var(--faint-solid); display: flex; justify-content: center; }
.objhead .chev .ic { width: 16px; height: 16px; transition: transform 0.15s; }
.objrow.open .objhead .chev .ic { transform: rotate(180deg); }
.objrow .objhead:hover .chev { color: var(--text); }
.objhead { display: grid; align-items: center; gap: 0.5rem 0.9rem; padding: 0.65rem 0.4rem;
           grid-template-columns: 2rem minmax(150px, 2.2fr) minmax(50px, 1fr) 4rem 3.6rem 5rem 1.2rem;
           cursor: pointer; }
.objrow .objhead:hover { background: var(--surface-2); }
.objcaption { cursor: default; padding-top: 0.2rem; padding-bottom: 0.4rem; }
.objhead .rank { color: var(--faint-solid); font-variant-numeric: tabular-nums; text-align: right; }
.objhead .ttl { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; min-width: 0; }
.objhead .ttl .txt { font-weight: 600; overflow-wrap: anywhere; }
.objhead .chips { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.objhead .bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.objhead .bar i { display: block; height: 100%; border-radius: 4px; }
.objcaption .bar.cap { height: auto; background: none; overflow: visible; }
.objhead .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.objhead .num.n { font-weight: 700; font-size: 1rem; }
.objcaption .num, .objcaption .trend { font-weight: 400; font-size: inherit; }
.trend { font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.trend.up { color: #e893a5; }
.trend.down { color: var(--ok); }
.trend.flat { color: var(--muted); }
.objact { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.2rem 0 0.5rem; }
.objact:empty { display: none; }
.objdescr { margin-bottom: 0.4rem; }
.objact button { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
button.ghost.danger:hover { color: var(--bad); background: var(--bad-soft); }
.objform { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; padding: 0 0 0.7rem; }
.objform input { flex: 1; min-width: 200px; }
.objbody { display: none; padding: 0 0.4rem 0.8rem 2.9rem; }
.objrow.open .objbody { display: block; }
.objquote { padding: 0.45rem 0; border-top: 1px dashed var(--border-soft); }
.objquote:first-child { border-top: 0; }
.objquote .q { color: var(--text); font-style: italic; }
.objquote a { color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--faint-solid); font-size: 0.78rem;
           padding: 0 0 0 0.8rem; cursor: pointer; }
.linkbtn:hover { background: none; color: var(--bad); }
.objpending { border-color: rgba(91, 116, 232, 0.35); }
.objtops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem;
           margin: 0.9rem 0; }
.objtop .t { font-size: 1.05rem; font-weight: 650; margin-top: 0.4rem; line-height: 1.3; }
.objtop .sub .trend { margin-left: 0.4rem; }
.objtop.link { cursor: pointer; }
.objtop.link:hover { border-color: var(--border); background: var(--surface-2); }
.objsig { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; padding: 0.35rem 0; }
.objsig .txt { color: var(--text); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 60;
         display: flex; gap: 0.9rem; align-items: center; background: var(--surface-2);
         border: 1px solid var(--border); border-radius: var(--radius-s); padding: 0.6rem 0.9rem;
         box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 2rem); }
@media (max-width: 860px) {
  .objhead { grid-template-columns: 1.4rem minmax(0, 1fr) auto auto auto; }
  .objhead .ttl { grid-column: 2 / 5; }
  .objhead .chev { grid-column: 5; grid-row: 1; }
  .objhead .bar { grid-column: 2 / 3; grid-row: 2; }
  .objhead .num, .objhead .trend { grid-row: 2; }
  .objcaption { display: none; }
  .objtops { grid-template-columns: 1fr; }
  .objbody { padding-left: 0.4rem; }
  .toast { bottom: 5rem; }
}
