/* ==========================================================================
   Вкладка «Марьям» (app/web/mariam.js). Только на токенах app.css — тёмная и светлая
   темы работают сами. Все классы с префиксом mr-, чтобы не задеть остальной кабинет.
   ========================================================================== */

/* ── шапка: разделы ── */
.mr-head { margin: -4px 0 16px; }
.mr-seg { display: flex; width: max-content; max-width: 100%; }
.mr-seg a { height: 36px; padding: 0 14px; font-size: 13px; }
.mr-banners:empty { display: none; }
.mr-banners { margin-bottom: 14px; }
.mr-spin { width: 16px; height: 16px; flex: none; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.mr-building { align-items: center; }
.mr-demo {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; flex: none;
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); border: 1px solid var(--accent-line); border-radius: 3px; line-height: 1;
}
.mr-title-demo { margin-left: 10px; vertical-align: 4px; }
.mr-about { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.mr-about .icon { flex: none; margin-top: 2px; }
.mr-section { margin-top: 18px; }
.mr-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mr-sec-head h2 { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.mr-card-sec { margin-top: 16px; }
.mr-card-sec .card-head { display: flex; align-items: center; gap: 10px; }
.mr-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mr-grid-2 > .mr-card-sec { margin-top: 16px; }
.mr-hint { margin-bottom: 14px; }
.mr-hint, .mr-building { flex-wrap: nowrap !important; align-items: flex-start; }
.mr-hint .btn { width: auto !important; margin: -6px -8px 0 0; }
.mr-stale { margin-bottom: 14px; flex-wrap: wrap; }

/* ── полоса чипов: фильтры, шаги доски ── */
.mr-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin-bottom: 14px; }
.mr-strip::-webkit-scrollbar { display: none; }
.mr-strip .chip { flex: none; height: 36px; }
/* Не влезает — край гаснет: видно, что чипов больше, чем на экране. */
.mr-strip.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.mr-strip.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.mr-strip.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.mr-dd .icon { margin-right: -4px; opacity: .7; }

/* ── «Обзор» — ниже, свой блок .ov-* ── */

/* ночные заявки клуба */
.mr-ev-list { display: flex; flex-direction: column; }
.mr-ev { padding: 14px 18px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.mr-ev-head { display: flex; gap: 10px; align-items: baseline; font-size: 12px; }
.mr-ev-club { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.mr-ev .msg { max-width: 92%; }
.mr-ev-human { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; margin: 2px 0; }
.mr-ev-human.warn { color: var(--warn); }
.mr-ev-human.danger { color: var(--danger); }
.mr-ev-draft { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.mr-ev-label { font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }


/* ── «Доска» v2 (mariam.js: renderBoard, makePanel) — классы mb-. Сетка 8 px; два размера
   текста на карточке: имя 14 px, всё остальное 12 px. Цвет — только у полоски «Нужен
   человек»: красный — жалоба/возврат/руководство, янтарный — передано, синий — повод. ── */
.mb, .mb-panel {
  --mb-col: #1c1c1c; --mb-card: #242424; --mb-card-hover: #292929;
}
:root[data-theme="light"] .mb, :root[data-theme="light"] .mb-panel {
  --mb-col: #ebebe5; --mb-card: #ffffff; --mb-card-hover: #ffffff;
}
:is(.mb-card, .mb-q, .mb-item, .mb-tr, .mb-need).tone-alert { --mb-tone: var(--danger); }
:is(.mb-card, .mb-q, .mb-item, .mb-tr, .mb-need).tone-relay { --mb-tone: var(--warn); }
:is(.mb-card, .mb-q, .mb-item, .mb-tr, .mb-need).tone-touch { --mb-tone: var(--info); }

/* Доска шире обычного экрана: шесть колонок видны целиком от 1280 px. */
.view.mb-wide { max-width: 1680px; padding-left: 20px; padding-right: 20px; }

/* полоса инструментов: воронка · поиск · фильтры … вид */
.mb-bar { margin-bottom: 16px; }
.mb-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mb-pipes { flex: none; }
.mb-pipes button { height: 30px; padding: 0 12px; font-size: 13px; gap: 8px; }
.mb-pipes .count { min-width: 18px; text-align: center; }
.mb-search { width: 248px; flex: 0 1 248px; height: 38px; font-size: 13.5px; }
.mb-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mb-bar .chip { height: 38px; border-radius: 19px; padding: 0 14px; }
.mb-drop .icon { margin-right: -4px; opacity: .7; }
.mb-reset { height: 38px; color: var(--muted); }
.mb-view-seg button { height: 30px; padding: 0 12px; gap: 6px; }
.mb-view-seg .icon { color: inherit; }

/* очередь «Нужен человек» над колонками */
.mb-queue { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
.mb-q-head { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.mb-q-head:hover { background: var(--surface-2); }
.mb-q-head:focus-visible { outline: none; box-shadow: var(--focus); }
.mb-q-head.is-on { background: var(--text); color: var(--bg); }
.mb-q-title { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.mb-q-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mb-q-head.is-on .mb-q-count { background: var(--bg); }
/* До двух строк чипов (mariam.js: fitQueue): лишние прячутся за «ещё N →», ничего не режется
   краем экрана — многоточие только внутри чипа, у причины. */
.mb-q-items { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; padding: 2px; max-height: 84px; overflow: hidden; }
.mb-q[hidden] { display: none; }
/* Чип — во всю длину своей причины (она уже короткая, ≤ 40 знаков, по границе слова):
   «продление: посчитать ск…» резало на полуслове (21.10). Не влез в строку — уходит
   в следующую или за «ещё N →». */
.mb-q { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; min-width: 0; max-width: 100%; padding: 0 12px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--mb-card); color: var(--text); font-size: 13px; text-decoration: none; box-shadow: inset 3px 0 0 var(--mb-tone); transition: border-color .12s; }
.mb-q:hover { border-color: var(--border-strong); text-decoration: none; }
.mb-q-name { flex: none; font-weight: 650; white-space: nowrap; }
.mb-q-more { flex: none; padding: 0 12px; box-shadow: none; border-style: dashed; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.mb-q-more:hover { color: var(--text); }
/* «Клиенты клуба: ещё 5 →» — кто ждёт человека в другой воронке; переключает воронку. */
.mb-q-side { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mb-q-other { flex: none; padding: 0 12px 4px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.mb-queue.is-empty .mb-q-other { margin-left: auto; padding: 0 8px; }
.mb-queue.is-empty { align-items: center; }
.mb-q-head.is-static { cursor: default; }
.mb-q-head.is-static:hover { background: transparent; }
.mb-q-count.is-zero { background: var(--surface-2); color: var(--muted); }
.mb-q-none { flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-q-why { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mb-q-age { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* колонки */
.mb-cols-wrap { overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -4px; padding: 0 4px 8px; scrollbar-width: thin; }
.mb-cols-wrap.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.mb-cols { display: grid; gap: 6px; align-items: start; min-width: min-content; }
.mb-col { display: flex; flex-direction: column; min-width: 0; background: var(--mb-col); border: 1px solid var(--border); border-radius: var(--radius-lg); scroll-snap-align: start; transition: border-color .2s, box-shadow .2s; }
.mb-col.is-focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.mb-col-head { min-height: 56px; padding: 12px 10px 8px; cursor: default; }
.mb-col-top { display: flex; align-items: center; gap: 8px; min-width: 0; height: 18px; }
.mb-col-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); }
.mb-col-count { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-col-sum { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-col-fold { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.mb-col-fold:hover { background: var(--surface-3); color: var(--text); }
.mb-col-body { display: flex; flex-direction: column; gap: 6px; padding: 0 6px 6px; min-width: 0; }
.mb-col-empty { padding: 4px 0 12px; text-align: center; color: var(--faint); font-size: 13px; }
.mb-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 184px; padding: 16px 0; background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--muted); font: inherit; cursor: pointer; transition: color .12s, border-color .12s; }
.mb-rail:hover { color: var(--text); border-color: var(--muted); }
.mb-rail:focus-visible { outline: none; box-shadow: var(--focus); }
.mb-rail-count { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mb-rail.is-empty { color: var(--faint); border-color: var(--border); }
.mb-rail.is-empty:hover { color: var(--text); border-color: var(--border-strong); }
.mb-rail-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }

/* карточка: три строки — имя · возраст / что известно / что дальше · значки */
.mb-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px; background: var(--mb-card); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none; transition: border-color .12s, background .12s; }
.mb-card:hover { border-color: var(--border-strong); background: var(--mb-card-hover); text-decoration: none; }
.mb-card.is-flag { padding-left: 13px; box-shadow: inset 3px 0 0 var(--mb-tone); }
.mb-card.is-selected, .mb-q.is-selected { border-color: var(--accent); }
.mb-item.is-selected, .mb-tr.is-selected { background: var(--accent-soft); }
:is(.mb-card, .mb-item, .mb-tr, .mb-q):focus-visible { outline: none; box-shadow: var(--focus); }
:is(.mb-card, .mb-item, .mb-tr, .mb-q).is-flag:focus-visible { box-shadow: inset 3px 0 0 var(--mb-tone), var(--focus); }
.mb-r1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; line-height: 20px; }
.mb-age { flex: none; font-size: 12px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mb-r2row { display: flex; align-items: center; gap: 8px; min-width: 0; height: 16px; }
.mb-r2row .mb-r2 { flex: 1 1 auto; }
.mb-r2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--muted); }
.mb-r2.is-empty { color: var(--faint); }
.mb-r3 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mb-line { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 16px; color: var(--text-2); }
.mb-line .icon { flex: none; display: inline-flex; color: var(--muted); }
.mb-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-line:is(.tone-alert, .tone-relay, .tone-touch) { color: var(--text); font-weight: 600; }
.mb-line.tone-alert .icon { color: var(--danger); }
.mb-line.tone-relay .icon { color: var(--warn); }
.mb-line.tone-touch .icon { color: var(--info); }
.mb-line.tone-ok .icon { color: var(--ok); }
.mb-line.tone-warn { color: var(--warn); font-weight: 600; }
.mb-line.tone-warn .icon { color: var(--warn); }
/* Узкие колонки (1280–1500 px): третья строка карточки — до двух строк вместо обрезки на
   полуслове («ссылка на опла…»); в списке на телефоне строки остаются однострочными. */
.mb-card .mb-r3 { align-items: flex-start; }
.mb-card .mb-line { align-items: flex-start; }
.mb-card .mb-line .icon { margin-top: 1px; }
.mb-card .mb-line-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }

.mb-icons { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.mb-icons:empty { display: none; }
.mb-src { display: inline-flex; }
.mb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.mb-ava { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--info-soft); color: var(--info); font-size: 8.5px; font-weight: 800; letter-spacing: 0; }
.mb-ava.is-wait { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.mb-tel { padding: 0 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 10.5px; font-weight: 700; line-height: 14px; color: var(--muted); }
.mb-take { position: absolute; top: 7px; right: 8px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.mb-card:hover .mb-take, .mb-card:focus-within .mb-take { opacity: 1; pointer-events: auto; }
.mb-card:has(.mb-take):hover .mb-age, .mb-card:has(.mb-take):focus-within .mb-age { visibility: hidden; }

/* список (компьютер) */
.mb-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.mb-tr { display: grid; grid-template-columns: minmax(180px, 1.3fr) 144px minmax(220px, 2fr) 144px 88px; gap: 16px; align-items: center; min-width: 0; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.mb-tr > span { min-width: 0; }
.mb-th { padding: 10px 16px; border-top: 0; background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
a.mb-tr:hover { background: var(--surface-2); text-decoration: none; }
.mb-tr.is-flag { box-shadow: inset 3px 0 0 var(--mb-tone); }
.mb-td-name { display: flex; flex-direction: column; gap: 2px; }
.mb-pill { display: inline-block; max-width: 100%; height: 24px; padding: 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 12px; font-weight: 600; line-height: 22px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-td-line { display: flex; align-items: center; gap: 8px; }
.mb-td-line .mb-line { font-size: 13px; }
.mb-td-owner { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-td-owner.is-wait { color: var(--muted); }
.mb-td-at { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* телефон и узкое окно: чипы этапов и список в две строки */
.mb-chips { margin-bottom: 12px; }
.chip.mb-chip-flag:not(.is-active) { border-color: var(--warn); color: var(--warn); }
.chip.mb-chip-flag:not(.is-active) .chip-count { color: var(--warn); }
.mb-sumline { margin: -4px 0 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.mb-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.mb-item + .mb-item::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--border); }
.mb-item:hover { background: var(--surface-2); text-decoration: none; }
.mb-item:active { background: var(--surface-2); }
/* Полоска у каждой строки своя — с отступом сверху и снизу: подряд идущие флаги не сливаются
   в один столб (критика 21.10). */
.mb-item.is-flag::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mb-tone); }
.mb-flag-scope { display: flex; align-items: baseline; gap: 4px; }
.mb-flag-scope .link-btn { font-size: 13px; }
.mb-item-ava { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 750; }
.mb-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mb-item .mb-name { flex: 0 1 auto; max-width: 62%; font-size: 15px; line-height: 20px; }
.mb-item-sum { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 20px; color: var(--muted); }
.mb-item-sum::before { content: "· "; }
.mb-item .mb-line { font-size: 13px; line-height: 18px; }
.mb-item .mb-age { margin-left: auto; font-size: 12.5px; }
.mb-empty { padding: 32px 16px; text-align: center; font-size: 13.5px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.mb-bar.is-phone { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mb-bar.is-phone .mb-bar-row { flex-wrap: nowrap; }
.mb-bar.is-phone .mb-search { flex: 1 1 auto; width: auto; min-width: 0; height: 44px; font-size: 16px; }
.mb-filter-btn { flex: none; height: 44px; padding: 0 14px; gap: 6px; }
.mb-filter-btn.is-on { border-color: var(--text); }
.mb-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; }
.mb-bar.is-phone .mb-pipes { display: flex; width: 100%; }
.mb-bar.is-phone .mb-pipes button { flex: 1 1 0; justify-content: center; height: 36px; }
.mb-sheet { padding-left: 16px; padding-right: 16px; }
.mb-sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; }
.mb-sheet-head h2 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.mb-sheet-group { padding: 12px 0; border-top: 1px solid var(--border); }
.mb-sheet-label { margin-bottom: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mb-sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-sheet-chips .chip { height: 44px; padding: 0 16px; border-radius: 22px; font-size: 14px; }
.mb-sheet-foot { padding-top: 12px; }
.mb-sheet-show { width: 100%; }

/* карточка разговора: панель справа, доска остаётся видна */
.mb-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 440px; max-width: 100vw; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); outline: none; opacity: 0; transform: translateX(24px); transition: transform .18s var(--ease), opacity .18s var(--ease); }
.mb-panel.is-open { opacity: 1; transform: none; }
.mb-p-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px 8px 24px; border-bottom: 1px solid var(--border); }
.mb-p-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 750; line-height: 24px; }
.mb-p-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 24px; }
.mb-p-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mb-p-meta { font-size: 13px; line-height: 18px; color: var(--muted); }
.mb-p-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mb-stage-btn { gap: 6px; max-width: 100%; }
.mb-stage-btn .icon { opacity: .7; }
.mb-manual { padding: 1px 6px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.mb-owner { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.mb-owner .icon { color: var(--muted); }
.mb-owner.is-wait { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.mb-owner.is-staff { background: var(--info-soft); color: var(--info); }
.mb-owner.is-staff .icon { color: var(--info); }
.mb-need { margin-bottom: 16px; padding: 12px 16px 12px 19px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: inset 3px 0 0 var(--mb-tone); }
.mb-need-head { display: flex; align-items: center; gap: 8px; }
.mb-need-head .icon { flex: none; color: var(--mb-tone); }
.mb-need-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 750; line-height: 20px; }
.mb-need-age { flex: none; font-size: 12px; color: var(--muted); }
.mb-need-full { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.mb-need-kv { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; margin-top: 8px; font-size: 13px; line-height: 1.45; }
.mb-need-kv > span:first-child { color: var(--muted); }
.mb-p-sec { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mb-p-top + .mb-p-sec, .mb-need + .mb-p-sec { margin-top: 0; }
.mb-p-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mb-p-sec-head h3 { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mb-more { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; }
.mb-known { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 20px; }
.mb-known li { display: flex; gap: 8px; color: var(--text-2); overflow-wrap: anywhere; }
.mb-known li:not(.is-ok):not(.is-muted)::before { content: ""; flex: none; width: 4px; height: 4px; margin: 8px 5px 0; border-radius: 50%; background: var(--faint); }
.mb-known li.mb-known-main { color: var(--text); font-weight: 650; }
.mb-known li .icon { flex: none; margin-top: 3px; }
.mb-known li.is-ok { color: var(--ok); }
.mb-known li.is-muted { color: var(--muted); }
.mb-touches { display: flex; flex-direction: column; }
.mb-touch { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; border-bottom: 1px solid var(--border); }
.mb-touch:last-child { border-bottom: 0; }
.mb-touch > .icon { flex: none; color: var(--muted); }
.mb-touch-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-touch-at { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-touch .badge { flex: none; }
.mb-chat { display: flex; flex-direction: column; max-height: 400px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.mb-chat .msg { max-width: 88%; }
.mb-chat .msg-bubble { font-size: 13.5px; padding: 7px 11px; }
.mb-p-foot { flex: none; display: flex; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.mb-p-foot:empty { display: none; }
.mb-p-foot .btn:not(.btn-icon) { flex: 1 1 0; min-width: 0; }
.mb-p-foot .btn { height: 40px; }
.mb-p-foot .btn-icon { width: 40px; flex: none; }
/* Главная кнопка шире второй; длинная подпись («Открыть переписку») не режется краем. */
.mb-p-foot .btn-primary:not(.btn-icon) { flex: 1 0 auto; }
.mb-p-foot .btn:not(.btn-icon) { padding: 0 12px; gap: 6px; overflow: hidden; white-space: nowrap; }
body.mb-panel-open .toasts { right: 460px; }

/* до 1440 px: вид — значками, поиск короче; полоса инструментов в одну строку от 1280 */
@media (max-width: 1439px) {
  .mb-view-word { display: none; }
  .mb-view-seg button { padding: 0 10px; }
  .mb-search { width: 200px; flex-basis: 200px; }
}
/* узкое окно с боковой панелью кабинета: список вместо колонок, панель — поверх */
@media (max-width: 1023px) {
  .view.mb-wide { padding-left: 24px; padding-right: 24px; }
}

/* ── «Проверка» ── */
.mr-kind { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.msg-bubble.mr-draft { border-style: dashed; border-width: 1.5px; }
.mr-edit-wrap { width: 100%; max-width: 100% !important; }
.mr-edit-wrap .input.mr-edit { width: 100%; height: auto; min-height: 64px; line-height: 1.5; padding: 9px 12px; border-color: var(--accent-line); background: var(--bubble-agent); }
.mr-sheet-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.mr-choice .chip { height: 36px; }
.mr-flag-quote { max-width: 100%; }

.mr-auto-list { display: flex; flex-direction: column; }
.mr-auto-item { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.mr-auto-item:first-child { border-top: 0; }
.mr-auto-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mr-auto-head .mr-kind { background: var(--surface-3); color: var(--text); }
.mr-why { font-size: 11.5px; font-weight: 700; color: var(--info); }
.mr-why::before { content: "· "; color: var(--faint); }
.mr-auto-text { color: var(--text-2); font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.mr-auto-group + .mr-auto-group { border-top: 1px solid var(--border); }
.mr-auto-sub { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px 4px; font-size: 13px; color: var(--text-2); }
.mr-auto-sub + .mr-auto-list .mr-auto-item:first-child { border-top: 0; }
.mr-auto-more { padding: 4px 18px 14px; }
.mr-auto-text:hover { color: var(--text); text-decoration: none; }
.mr-auto-foot { display: flex; justify-content: flex-end; }
.mr-flag { color: var(--muted); }
.mr-stats { margin-top: 16px; }
.mr-stats summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; min-height: 44px; }
.mr-stats summary::-webkit-details-marker { display: none; }
.mr-stats[open] summary .icon { transform: rotate(180deg); }
.mr-stats .table-wrap { border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.mr-suggest { color: var(--ok); font-weight: 700; }


/* ── «Проверка» v2 (mariam.js: renderReview) — классы rv-. Очередь строками, открытый
   черновик — справа от списка (от 1024 px) или во весь экран поверх кабинета (телефон,
   узкое окно). Тело черновика — на фоне страницы: пузыри гостя и Марьям читаются как чат. ── */
.rv-segbox { margin-bottom: 12px; }
.rv-seg { display: flex; width: max-content; max-width: 100%; }
.rv-seg a { height: 36px; padding: 0 14px; font-size: 13px; }
/* :is(...) — сильнее, чем «.rv.is-split .rv-split» ниже: на компьютере «Отправила сама»
   показывалась под списком черновиков, а не вместо него. */
.rv.is-auto:is(.is-split, :not(.is-split)) .rv-split { display: none; }
.rv:not(.is-auto) .rv-auto-pane { display: none; }
.rv-auto-pane { max-width: 880px; }
.rv:not(.is-split) .rv-split > .rv-focus { display: none; }
.rv.is-split .rv-split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.rv.is-split .rv-list-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 8px 0; }
.rv.is-split .rv-focus { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

/* очередь */
.rv-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rv-filter { gap: 6px; }
.rv-filter.is-on { border-color: var(--text); }
.rv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; }
.rv-reset { font-size: 13px; }
.rv-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.rv-row { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 16px 13px; color: var(--text); text-decoration: none; outline: none; }
.rv-row + .rv-row { border-top: 1px solid var(--border); }
.rv-row:hover, .rv-row:active { background: var(--surface-2); text-decoration: none; color: var(--text); }
.rv-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-line); }
.rv-row.is-sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.rv-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rv-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 750; line-height: 20px; }
.rv-row-when { flex: none; margin-left: auto; padding-left: 4px; }
.rv-row-said, .rv-row-draft { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; }
.rv-row-said { color: var(--muted); }
.rv-row-said.is-none { font-style: italic; }
.rv-row-draft { color: var(--text-2); border-left: 2px solid var(--accent-line); padding-left: 8px; margin-top: 1px; }
.rv-row.is-rewriting { opacity: .85; }
.rv-rewriting { display: flex; align-items: center; gap: 8px; border-left: 0; padding-left: 0; font-weight: 650; }
.rv-rules { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; padding: 14px 8px 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.rv-rules-edit { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }

.rv-kind { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.rv-kind.sm { height: 19px; padding: 0 7px; font-size: 11px; }
.rv-kind.k-price { background: var(--accent-soft); color: var(--accent-ink); }
.rv-kind.k-pay { background: var(--ok-soft); color: var(--ok); }
.rv-kind.k-member { background: var(--info-soft); color: var(--info); }
.rv-kind.k-human { background: var(--warn-soft); color: var(--warn); }
.rv-wait { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-wait.late { color: var(--danger); }
.rv-chip-demo { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; flex: none; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); border: 1px solid var(--accent-line); border-radius: 4px; white-space: nowrap; }
.rv-chip-play, .rv-chip-real { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.rv-chip-real { border-color: transparent; background: var(--info-soft); color: var(--info); }

.rv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rv-empty h3 { font-size: 16px; font-weight: 800; }
.rv-empty p { margin: 0 0 6px; max-width: 340px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.rv-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: var(--surface-2); color: var(--muted); margin-bottom: 4px; }
.rv-empty-icon.ok { background: var(--ok-soft); color: var(--ok); }

/* открытый черновик */
.rv-focus { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); outline: none; }
.rv-focus.is-overlay { position: fixed; left: 0; right: 0; top: 0; height: 100dvh; z-index: 46; animation: fade .12s ease-out; }
.rv-f-top { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.rv-focus.is-overlay .rv-f-top { min-height: calc(58px + env(safe-area-inset-top)); padding: calc(6px + env(safe-area-inset-top)) 12px 6px 4px; }
.rv-back { flex: none; width: 44px; height: 44px; }
.rv-f-who { flex: 1 1 auto; min-width: 0; }
.rv-f-name { font-size: 17px; font-weight: 800; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-f-meta { margin-top: 1px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-count { flex: none; padding: 3px 9px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-nav { flex: none; display: flex; gap: 2px; }
.rv-up .icon { transform: rotate(180deg); }
.rv-f-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 18px; padding: 16px 20px 22px; background: var(--bg); }
.rv-f-body.rv-f-empty { justify-content: center; }
.rv-f-empty .rv-empty { background: transparent; border: 0; }
.rv-f-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rv-f-tags .rv-wait { height: 22px; padding: 0 9px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.rv-f-tags .rv-wait.late { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.rv-f-tags .rv-chip-demo { height: 22px; }
.rv-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rv-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.rv-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.rv-label.is-draft { color: var(--accent-ink); }
.rv-ctx-toggle { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; min-height: 32px; }
.rv-ctx-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.rv-ctx { display: flex; flex-direction: column; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rv-ctx .msg-bubble { font-size: 13.5px; padding: 7px 11px; }
.rv-ctx .rv-past { opacity: .8; }
.rv-ctx-open { align-self: center; display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 12.5px; font-weight: 700; }
.rv-f-body .msg { max-width: 88%; }
.rv-guest { display: flex; flex-direction: column; }
.rv-guest .rv-earlier .msg-bubble { color: var(--text-2); }
.rv-guest .rv-latest .msg-bubble { border-color: var(--border-strong); color: var(--text); font-size: 15px; box-shadow: var(--shadow-sm); }
.rv-first-note { padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.rv-draft { display: flex; flex-direction: column; }
.rv-draft .msg-bubble { font-size: 15px; }
.rv-media-b { padding: 6px 12px 6px 6px; }
.rv-media { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.rv-media-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 18px; line-height: 1; }
.rv-stale { display: flex; justify-content: flex-end; }
.chip.rv-stale-btn { height: auto; min-height: 36px; padding: 7px 14px; border-color: transparent; background: var(--danger-soft); color: var(--danger); font-weight: 700; white-space: normal; text-align: left; line-height: 1.3; }
.chip.rv-stale-btn:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.chip.rv-stale-btn .icon { flex: none; }
.rv-rw { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.rv-rw-label { margin-right: 2px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.rv-chip-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 5px; }
.rv-own { border-style: dashed; }
.rv-edit-wrap { width: 100%; max-width: 100% !important; margin: 3px 0; }
.input.rv-edit { width: 100%; height: auto; min-height: 48px; padding: 9px 12px; line-height: 1.5; font-size: 15px; resize: none; border-color: var(--accent-line); background: var(--bubble-agent); }
.rv-edit-hint { font-size: 12px; color: var(--muted); text-align: right; }
.rv-does ul, .rv-facts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.rv-does li, .rv-facts li { position: relative; padding-left: 16px; overflow-wrap: anywhere; }
.rv-does li::before { content: "→"; position: absolute; left: 0; color: var(--accent-ink); font-weight: 800; }
.rv-facts li::before { content: "·"; position: absolute; left: 4px; color: var(--faint); font-weight: 800; }
.rv-facts { gap: 4px; }
.rv-facts-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0; background: none; border: 0; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.rv-facts-toggle > .icon { margin-left: auto; }
.rv-facts-toggle[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.rv-facts-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.rv-rewriting-box { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1.5px dashed var(--accent-line); border-radius: var(--radius-lg); background: var(--bubble-agent); }
.rv-rewriting-box .mr-spin { margin-top: 2px; }

/* кнопки решения: внизу, под большим пальцем; «Отправить» — главная */
.rv-f-bar { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.rv-f-bar .btn { min-width: 0; height: 44px; padding: 0 10px; }
.rv-f-bar.is-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.rv-f-bar.is-one { grid-template-columns: minmax(0, 1fr); }
.rv-skip { color: var(--text-2); }
.rv-keys { display: none; }
.rv.is-split .rv-f-bar { display: flex; align-items: center; }
.rv.is-split .rv-f-bar .btn { flex: none; padding: 0 16px; }
.rv.is-split .rv-f-bar .rv-send { min-width: 150px; }
.rv.is-split .rv-f-bar .rv-skip { margin-right: auto; }
.rv.is-split .rv-keys { display: block; padding: 6px 8px 0; font-size: 11.5px; color: var(--faint); text-align: center; }
.rv-focus.is-overlay .rv-f-bar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.rv-focus.is-overlay .rv-f-bar { grid-template-columns: minmax(0, 1.12fr) minmax(0, .92fr) minmax(0, 1.3fr); }
.rv-focus.is-overlay .rv-f-bar.is-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.rv-focus.is-overlay .rv-f-bar.is-one { grid-template-columns: minmax(0, 1fr); }
.rv-focus.is-overlay .rv-f-bar .btn { height: 48px; font-size: 14px; padding: 0 8px; }
.rv-focus.is-overlay .rv-f-bar:not(.is-edit) .btn:not(.rv-send) .icon { display: none; }

/* листы: фильтр, переписать */
.rv-sheet-group { padding: 12px 0; }
.rv-sheet-group + .rv-sheet-group { border-top: 1px solid var(--border); }
.rv-sheet-group:first-child { padding-top: 0; }
.rv-sheet-label { margin-bottom: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.rv-sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-sheet-chips .chip { height: 38px; padding: 0 14px; border-radius: 19px; font-size: 13.5px; }

/* «Отправила сама» */
.rv-auto { margin-top: 0; }
/* Строка: имя · вид · почему · время, под ней текст; справа — «так не надо» значком 44 px,
   у всех строк в одном месте. */
.mr-auto-item.rv-auto-item { flex-direction: row; align-items: flex-start; gap: 6px; padding-right: 8px; }
.rv-auto-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.rv-auto-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rv-auto-top .mr-why { white-space: nowrap; }
.rv-auto-at { flex: none; margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mr-flag.btn-icon { flex: none; width: 44px; height: 44px; margin-top: -4px; color: var(--muted); }
.mr-flag.btn-icon:hover { color: var(--text); }
.mr-flag.is-done, .mr-flag.is-done:disabled { color: var(--ok); opacity: 1; }

.rv-auto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }

/* узкое окно с боковой панелью: черновик поверх рабочей области, панель кабинета видна */
@media (min-width: 861px) and (max-width: 1023px) {
  .rv-focus.is-overlay { left: var(--sidebar-w); border-left: 1px solid var(--border); }
  .rv-list-pane { max-width: 720px; }
}
@media (min-width: 1024px) {
  .rv-f-body { padding: 18px 24px 24px; }
  /* две колонки во всю высоту окна — страница под ними не прокручивается */
  .view.rv-fit { padding-bottom: 20px; }
}
@media (max-width: 860px) {
  /* открытый черновик — во весь экран: верхняя и нижняя панели кабинета не нужны */
  body.rv-open .topbar, body.rv-open .tabbar { display: none; }
  body.rv-open { overflow: hidden; }
  body.rv-open .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .rv-seg { width: 100%; }
  .rv-seg a { flex: 1 1 0; justify-content: center; padding: 0 8px; height: 38px; font-size: 13px; }
  .rv-row { padding: 12px 14px 13px; }
  .rv-f-body { padding: 14px 14px 20px; gap: 16px; }
  .rv-f-body .msg { max-width: 90%; }
  .rv-auto-head { padding: 12px 14px; }
  .rv-auto .mr-auto-item { padding: 12px 6px 12px 14px; }
  .rv-auto .mr-auto-sub { padding: 14px 14px 4px; }
}
@media (max-width: 380px) {
  .rv-f-bar { gap: 6px; }
  .rv-focus.is-overlay .rv-f-bar .btn { padding: 0 6px; font-size: 13.5px; gap: 5px; }
}

/* ── «Попробовать» ── */
.mr-play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mr-play-grid > .mr-card-sec { margin-top: 0; }
.mr-play.has-chat > :not(.mr-chat) { display: none; }
.mr-start { width: 100%; margin-top: 4px; }
.mr-sims { margin-top: 18px; }
.mr-sims:empty { display: none; }
.mr-sims-title { margin-bottom: 6px; }
.mr-sims-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); }
.mr-sim-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--text); min-height: 52px; }
.mr-sim-row + .mr-sim-row { border-top: 1px solid var(--border); }
.mr-sim-row:hover { background: var(--surface-2); text-decoration: none; }
.mr-sim-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mr-sim-name { overflow-wrap: anywhere; }
.mr-sim-place { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mr-demo.sm { height: 16px; font-size: 9px; padding: 0 4px; }
.mr-num { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mr-num > .icon { color: var(--ok); }
.mr-num-phone { font-weight: 800; font-variant-numeric: tabular-nums; }
.mr-mine { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; font-weight: 600; }
.mr-mine .icon { margin-top: 2px; }
.mr-mine.ok { color: var(--ok); }
.mr-mine.warn { color: var(--warn); }
.mr-scen { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mr-scen-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); min-height: 52px; }
a.mr-scen-item:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.mr-scen-item .icon { color: var(--muted); }
.mr-scen-item.is-off { opacity: .55; }
.mr-scen-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin-top: 6px; font-size: 13px; font-weight: 700; }
.mr-scen-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.mr-scen-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.mr-scen-text { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.mr-reset .card-body { gap: 14px; }

/* чат игры: как WhatsApp — вы (гость) справа, Марьям слева */
.mr-chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 520px; max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mr-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mr-avatar { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.mr-chat-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.mr-chat-sub { font-size: 12px; color: var(--muted); }
.mr-chat-sub.typing { color: var(--ok); font-weight: 700; }
.mr-chat-scroll { background: var(--bg); }
.mr-chat-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto 12px; padding: 5px 12px; width: max-content; max-width: 100%; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.mr-chat-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; display: flex; flex-direction: column; gap: 6px; }
.mr-chat-empty b { color: var(--text); }
.msg.mr-me .msg-bubble { background: var(--bubble-agent); border-color: var(--bubble-agent-border); }
.msg.in:not(.mr-me) .msg-bubble { background: var(--bubble-in); }
.msg.mr-pending .msg-bubble { opacity: .6; border-style: dashed; }
.msg.mr-tmp .msg-bubble { opacity: .7; }
.mr-chat-approve { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 6px; padding: 12px 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius); }
.mr-chat-approve-text { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.mr-chat-approve-text .icon { color: var(--accent-ink); }
.mr-chat-approve.is-edit .msg { margin: 0; }
.mr-typing .msg-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.mr-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: mr-dot 1.2s infinite ease-in-out; }
.mr-typing i:nth-child(2) { animation-delay: .15s; }
.mr-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mr-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
/* QR в чате игры — не во всю ширину экрана; ссылка — подписью, не адресом. */
.mr-chat .att-img, .mb-chat .att-img, .rv .att-img, .rv-focus .att-img { max-width: 200px; max-height: 200px; width: auto; height: auto; }
.mr-link { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; word-break: normal; }
.mr-pay { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.mr-pay-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ok-soft); color: var(--ok); font-weight: 800; flex: none; }
.mr-pay-title { font-weight: 750; font-size: 13px; }
.mr-chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.mr-chat-composer .input { flex: 1 1 auto; resize: none; min-height: 42px; max-height: 140px; height: 42px; padding: 10px 12px; line-height: 1.4; border-radius: 21px; }
.mr-chat-composer .btn-icon { border-radius: 50%; width: 42px; height: 42px; flex: none; }

/* ── настройки ── */
.mr-settings { max-width: 760px; }
/* Шапка настроек «‹ Настройки Марьям» — только на телефоне (там это отдельный экран). */
.mr-subhead { display: none; }
.mr-settings > .mr-card-sec:first-of-type { margin-top: 6px; }
.mr-presets { display: flex; width: 100%; }
.mr-presets button { flex: 1 1 0; justify-content: center; height: 38px; }
.mr-preset-hint { margin: 8px 0 14px; }
.mr-kinds { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.mr-kind-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); min-height: 52px; }
.mr-kind-name { font-weight: 650; font-size: 13.5px; }
.mr-mode button { height: 32px; }
.mr-locked { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); padding-right: 10px; }
.mr-switches { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.mr-switch-row .small { margin: 4px 0 0 46px; }
.mr-acc-list { display: flex; flex-direction: column; }
.mr-acc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mr-acc:last-child { border-bottom: 0; }
.mr-acc-name { font-weight: 700; }
.mr-acc-toggles { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mr-acc-toggles .switch { font-size: 13px; }
.mr-no-tg { display: inline-flex; align-items: center; gap: 5px; }

/* ── широкий экран поуже ── */
@media (max-width: 1100px) {
  .mr-grid-2, .mr-play-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── телефон ── */
@media (max-width: 860px) {
  /* Разделы липнут под верхней панелью: переключаться, не прокручивая наверх. Прокрутили —
     шапка кабинета «МАРЬЯМ» уезжает вверх (body.mr-collapsed, mariam.js), липнет только эта
     полоса: 48 px, линия снизу — тенью, чтобы не добавлять высоты. */
  .mr-head { position: sticky; top: var(--topbar-h); z-index: 20; margin: -18px -16px 14px; padding: 2px 16px; background: var(--bg); box-shadow: 0 1px 0 var(--border); transition: top .2s var(--ease), padding .2s var(--ease); }
  body.mr-on .topbar { transition: transform .2s var(--ease); }
  body.mr-collapsed .topbar { transform: translateY(-100%); }
  body.mr-collapsed .mr-head { top: 0; padding-top: calc(2px + env(safe-area-inset-top)); }
  .mr-view .page-head { display: none; }
  .mr-seg { width: 100%; }
  .mr-seg a { flex: 1 1 auto; justify-content: center; padding: 0 8px; height: 36px; font-size: 12.5px; }

  /* Настройки — отдельный экран: «‹ Настройки Марьям» сверху, без шапки, разделов и
     нижней панели кабинета (как открытая карточка и черновик). */
  body.mr-sub-open .topbar, body.mr-sub-open .tabbar, body.mr-sub-open .mr-head { display: none; }
  body.mr-sub-open .view { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .mr-subhead { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 20; min-height: calc(56px + env(safe-area-inset-top)); margin: -18px -16px 12px; padding: env(safe-area-inset-top) 16px 0 4px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .mr-subhead-back { width: 44px; height: 44px; }
  .mr-subhead h2 { font-size: 17px; font-weight: 800; line-height: 22px; }
  .mb-chat { max-height: 52vh; }
  .mr-strip { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
  .mr-strip .chip { height: 38px; }

  .mr-ev { padding: 14px; }
  .mr-grid-2 { gap: 0; }

  /* доска: во всю ширину, карточка разговора — во весь экран поверх нижней панели */
  .view.mb-wide { padding-left: 16px; padding-right: 16px; }
  .mb-panel { width: 100vw; border-left: 0; box-shadow: none; transform: translateX(16px); }
  .mb-p-head { min-height: calc(56px + env(safe-area-inset-top)); padding: calc(6px + env(safe-area-inset-top)) 16px 6px 4px; }
  .mb-p-back { width: 44px; height: 44px; }
  .mb-p-name { font-size: 17px; }
  .mb-p-body { padding: 16px; }
  .mb-p-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .mb-p-foot .btn { height: 46px; }
  .mb-p-foot .btn-icon { width: 46px; }
  body.mb-panel-open { overflow: hidden; }
  body.mb-panel-open .toasts { right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); }

  /* чат игры — во весь экран, поверх нижней панели: как открытый чат в WhatsApp */
  .mr-chat { position: fixed; left: 0; right: 0; top: 0; height: 100dvh; min-height: 0; max-width: none; z-index: 45; border: 0; border-radius: 0; }
  .mr-chat-head { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .mr-chat-composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.mr-chat-open { overflow: hidden; }
  body.mr-chat-open .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mr-pay { min-width: 0; }

  .mr-presets button { padding: 0 6px; font-size: 12px; }
  .mr-switch-row .small { margin-left: 0; }
  .mr-acc-toggles { width: 100%; padding-left: 50px; gap: 10px 18px; }
}

/* ==========================================================================
   «Обзор» (renderOverview в mariam.js). Сетка 12 колонок, шаг 8 px, числа табличные,
   один акцент — жёлтый у денег (полосы «Ждём оплату» и «Оплачено»). Пометка «демо» — одна,
   в шапке. Высоты плиток и строк одинаковые: глаз идёт по колонке цифр, не по рамкам.
   ========================================================================== */
.ov-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.ov-seg { display: inline-flex; }
.ov-seg button { height: 32px; padding: 0 16px; font-size: 13px; }
.ov-club { height: 36px; }
.ov-when { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-date.is-day { color: var(--text); font-weight: 650; }

.ov { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ov > * { grid-column: 1 / -1; min-width: 0; }
.ov-card { overflow: hidden; }
.ov-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-height: 48px; padding: 16px 16px 8px; }
.ov-card-head h2 { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.ov-card-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-head-link { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ov-head-link:hover { color: var(--text); text-decoration: none; }
.ov-empty { padding: 8px 16px 16px; font-size: 13px; color: var(--faint); }

/* 1. ключевые цифры */
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ov-kpi {
  position: relative; display: flex; flex-direction: column; justify-content: flex-start; height: 128px; padding: 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none;
  transition: border-color .12s;
}
.ov-kpi:hover { border-color: var(--border-strong); text-decoration: none; }
/* Ссылка плитки — во всю площадь; своя ссылка в подписи («ждёт проверки 2») — поверх неё. */
.ov-kpi-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ov-kpi-link:focus-visible { outline: none; box-shadow: var(--focus); }
.ov-kpi-note.is-short { display: none; }
.ov-demo-phone { display: none; }
.ov-kpi:focus-visible, .ov-row:focus-visible, .ov-tr:focus-visible, .ov-tl-row:focus-visible { outline: none; box-shadow: var(--focus); }
.ov-kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 16px; }
/* Число — на одной высоте во всех плитках, подпись под ним: две строки подписи не сдвигают цифру. */
.ov-kpi-value { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin-top: 8px; white-space: nowrap; }
.ov-num { font-size: 32px; line-height: 36px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ov-unit { font-size: 16px; font-weight: 650; color: var(--text-2); }
.ov-kpi-extra { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ov-kpi-extra::before { content: "·"; margin-right: 6px; color: var(--faint); }
.ov-kpi-note { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-variant-numeric: tabular-nums; }

/* 2. воронка и клиенты клуба: строка = название · полоса · число · сумма */
.ov-funnel { grid-column: span 8; align-self: stretch; }
.ov-members { grid-column: span 4; align-self: stretch; }
.ov-rows { display: flex; flex-direction: column; padding: 0 8px 8px; }
.ov-row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr) 40px 96px; align-items: center; gap: 12px; height: 40px; padding: 0 8px;
  border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: 13px;
}
.ov-rows.no-bars .ov-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
/* Без полос сумма стоит перед числом: числа обеих карточек — одной колонкой справа. */
.ov-rows.no-bars .ov-row-extra { order: 2; }
.ov-rows.no-bars .ov-row-n { order: 3; }
.ov-rows.no-extra .ov-row { grid-template-columns: 128px minmax(0, 1fr) 40px; }
.ov-row:hover { background: var(--surface-2); text-decoration: none; }
.ov-row-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ov-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ov-row:hover .ov-track { background: var(--surface-3); }
.ov-fill { display: block; height: 100%; border-radius: 4px; background: var(--border-strong); }
.ov-row.is-money .ov-fill { background: var(--accent); }
.ov-row-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-row-extra { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-row.is-money .ov-row-extra { color: var(--text-2); font-weight: 650; }
.ov-row.is-muted .ov-row-label, .ov-row.is-muted .ov-row-n { color: var(--muted); }
.ov-row.is-zero .ov-row-n { color: var(--faint); font-weight: 600; }

/* 3. ночь: фраза слева, две большие цифры справа — «с Марьям» против «до Марьям» */
.ov-night { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 448px); }
.ov-night-main { padding: 24px; min-width: 0; }
.ov-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ov-kicker .icon { color: var(--accent-ink); }
.ov-kicker-sub::before { content: "·"; margin-right: 8px; }
.ov-night-line { margin-top: 8px; font-size: 20px; line-height: 28px; font-weight: 700; text-wrap: pretty; }
.ov-night-clubs { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ov-nc { display: flex; flex-direction: column; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; line-height: 16px; min-width: 0; }
.ov-nc-name { font-weight: 650; color: var(--text-2); }
.ov-nc-val { margin-top: 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-nc-base { color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; border-left: 1px solid var(--border); background: var(--surface-2); }
.ov-cmp-cap { grid-column: 1 / -1; padding: 24px 24px 0; font-size: 12px; font-weight: 650; line-height: 16px; color: var(--muted); }
.ov-cmp-col { padding: 8px 24px 24px; display: flex; flex-direction: column; min-width: 0; }
.ov-cmp-col + .ov-cmp-col { box-shadow: inset 1px 0 0 var(--border); }
.ov-cmp-num { font-size: 40px; line-height: 48px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ov-cmp-col.is-before .ov-cmp-num { color: var(--warn); }
.ov-cmp-label { margin-top: 4px; font-size: 13px; font-weight: 650; line-height: 16px; }
.ov-cmp-fine { font-size: 12px; line-height: 16px; color: var(--muted); }

/* 4. по клубам и откуда пришли */
.ov-clubs { grid-column: span 7; align-self: stretch; }
.ov-sources { grid-column: span 5; align-self: stretch; }
.ov-table { padding: 0 8px 8px; }
.ov-tr {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 112px 112px; gap: 12px; align-items: center; height: 40px; padding: 0 8px;
  border-radius: var(--radius); font-size: 13px; color: var(--text); text-decoration: none;
}
a.ov-tr:hover { background: var(--surface-2); text-decoration: none; }
.ov-th { height: 32px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ov-tr .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-td-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tr .is-strong { font-weight: 700; }
.ov-short { display: none; }

/* 5–7. что было, ночные заявки, как устроено */
.ov-tl-card { grid-column: span 7; }
.ov-side { grid-column: span 5; display: flex; flex-direction: column; gap: 16px; }
.ov-side > .mr-card-sec { margin-top: 0; }
/* Раскрытые ночные заявки — прежняя лента, но шапка как у остальных карточек «Обзора». */
.ov-side .mr-evidence .card-head { min-height: 48px; padding: 8px 16px; }
.ov-side .mr-evidence .card-head h2 { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.ov-tl { list-style: none; margin: 0; padding: 0 8px 8px; }
.ov-tl-row { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: 13px; }
a.ov-tl-row:hover { background: var(--surface-2); text-decoration: none; }
.ov-tl-time { flex: none; width: 40px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-tl.is-week .ov-tl-time { width: 80px; }
.ov-tl-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-more {
  display: block; width: calc(100% - 16px); height: 32px; margin: -4px 8px 8px; padding: 0 8px; border: 0; border-radius: var(--radius);
  background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; text-align: left; cursor: pointer;
}
.ov-more:hover { background: var(--surface-2); color: var(--text); }
.ov-ev-row { display: flex; align-items: center; gap: 16px; padding: 0 16px 16px; }
.ov-ev-text { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 20px; color: var(--text-2); }
.ov-num-sm { color: var(--text); font-variant-numeric: tabular-nums; }
.ov-ev-row .btn { flex: none; }
.ov-ev-close { width: auto; margin: 0 0 0 auto; height: 28px; }
.ov-how > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; }
.ov-how > summary::-webkit-details-marker { display: none; }
.ov-how > summary h2 { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.ov-how > summary .icon { color: var(--muted); transition: transform .15s; }
.ov-how[open] > summary .icon { transform: rotate(180deg); }
.ov-how-list { list-style: none; margin: 0; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.ov-how-list li { display: flex; gap: 8px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.ov-how-list .icon { flex: none; margin-top: 3px; color: var(--muted); }

@media (max-width: 1180px) {
  .ov-night { grid-template-columns: minmax(0, 1fr); }
  .ov-cmp { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 1023px) {
  .ov > * { grid-column: 1 / -1; }
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .ov-seg { flex: 1 1 100%; }
  .ov-seg button { flex: 1 1 0; justify-content: center; height: 34px; padding: 0 8px; }
  .ov-kpis { gap: 8px; }
  .ov-kpi { height: 112px; padding: 12px; }
  /* Подпись с периодом («Обращений сегодня») на телефоне бывает в одну строку, бывает в две —
     место под две строки у всех: число во всех плитках на одной высоте. */
  .ov-kpi-label { min-height: 32px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ov-kpi-note.is-long { display: none; }
  .ov-kpi-note.is-short { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ov-demo-phone { display: inline-flex; }
  .ov-kpi-value { margin-top: 4px; }
  .ov-num { font-size: 26px; line-height: 32px; }
  .ov-unit, .ov-kpi-extra { font-size: 14px; }
  .ov-row { grid-template-columns: 112px minmax(0, 1fr) 32px 80px; gap: 8px; }
  .ov-rows.no-bars .ov-row { grid-template-columns: minmax(0, 1fr) auto 32px; }
  .ov-rows.no-extra .ov-row { grid-template-columns: 112px minmax(0, 1fr) 32px; }
  /* Лента на телефоне — до двух строк: в одну «…ответила чер…» теряло смысл. */
  .ov-tl-row { height: auto; min-height: 40px; padding: 8px; align-items: flex-start; }
  .ov-tl-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 18px; }
  .ov-tl-time { line-height: 18px; }
  .ov-night-main { padding: 16px; }
  .ov-night-line { font-size: 17px; line-height: 24px; }
  .ov-night-clubs { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 12px; }
  /* Клуб и «ответила 1 из 1» — одной строкой, «раньше без ответа …» — мелко под ними:
     в три колонки на 390 px цифры переносились посреди фразы. */
  .ov-nc { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 8px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .ov-nc-name { flex: 1 1 auto; }
  .ov-nc-val { margin: 0; white-space: nowrap; }
  .ov-nc-base { flex: 1 1 100%; }
  .ov-nc-base:empty { display: none; }
  .ov-cmp-cap { padding: 16px 16px 0; }
  .ov-cmp-col { padding: 8px 16px 16px; }
  .ov-cmp-num { font-size: 32px; line-height: 40px; }
  .ov-tr { grid-template-columns: minmax(0, 1fr) 36px 84px 36px; gap: 8px; }
  .ov-long { display: none; }
  .ov-short { display: inline; }
}

/* Узкий телефон (360 px): четыре раздела «Обзор · Доска · Проверка · Попробовать» — в одну
   строку без обрезки: меньше поля и шрифт, счётчик поуже; кнопки карточки — без значков. */
@media (max-width: 400px) {
  .mr-seg { padding: 3px; }
  .mr-seg a { padding: 0 5px; font-size: 12px; gap: 4px; letter-spacing: -.01em; }
  .mr-seg a .count { min-width: 16px; height: 16px; padding: 0 4px; font-size: 10.5px; }
  .mb-p-foot .btn:not(.btn-icon) { padding: 0 8px; font-size: 13.5px; }
  .mb-p-foot .btn:not(.btn-icon) .icon { display: none; }
}

/* ==========================================================================
   Листы и строки выбора (openSheet, sheetRow в mariam.js): этап карточки, «Не отправлять»,
   клуб «Сводки». Строка — 52+ px под палец, кружок выбора слева, подсказка мелко.
   ========================================================================== */
.mr-srows { display: flex; flex-direction: column; }
.mr-srow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 10px 8px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mr-srow:hover, .mr-srow:active { background: var(--surface-2); }
.mr-srow:focus-visible { outline: none; box-shadow: var(--focus); }
.mr-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); transition: border-width .12s; }
.mr-srow.is-on .mr-radio { border: 6px solid var(--text); }
.mr-srow-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mr-srow-label { font-size: 15px; font-weight: 650; line-height: 20px; }
.mr-srow.is-on .mr-srow-label { font-weight: 800; }
.mr-srow-hint { font-size: 12.5px; line-height: 16px; color: var(--muted); }
.mr-srow-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); }
.mr-srow-ico .icon, .sheet .mr-srow-ico .icon { color: var(--text-2); }
.mr-srow-sep { height: 1px; margin: 6px 8px; background: var(--border); }
.mr-stage-sheet .mr-srows { padding-bottom: 4px; }
/* «Не отправлять»: три исхода крупными строками, причина — ниже и по желанию. */
.mr-outcome { min-height: 64px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--border); }
.mr-outcome.is-danger .mr-srow-ico { background: var(--danger-soft); }
.mr-outcome.is-danger .mr-srow-ico .icon { color: var(--danger); }
.mr-discard-why { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.mr-discard-why .mb-sheet-label { margin-bottom: 0; }
.pop-menu .mr-pop-sep { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

/* ── «Сводка»: первая строка — период и клуб; дата и «демо» — подписью под плитками ── */
.ov-bar-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ov-club-plus { padding: 0 6px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 18px; }
.chip.is-active .ov-club-plus { background: var(--bg); }
.ov-caption { display: none; }
.ov-tests { display: flex; flex-direction: column; gap: 4px; }
.ov-tests .switch { font-size: 15px; font-weight: 650; }
.ov-tests-hint { margin-left: 46px; }
.ov-kpi-chev { position: absolute; top: 14px; right: 12px; display: inline-flex; color: var(--faint); transition: color .12s, transform .12s; }
.ov-kpi:hover .ov-kpi-chev { color: var(--text-2); transform: translateX(2px); }
.ov-kpi-label { padding-right: 18px; }
.ov-fold-chev { display: none; }

@media (max-width: 860px) {
  .ov-bar { margin-bottom: 12px; flex-wrap: nowrap; }
  .ov-bar .ov-when { display: none; }
  .ov-bar-row { flex: 1 1 auto; }
  .ov-bar-row .ov-seg { flex: 1 1 auto; min-width: 0; }
  .ov-bar-row .ov-seg button { padding: 0 6px; }
  .ov-club { flex: none; max-width: 48%; height: 40px; padding: 0 12px; gap: 6px; }
  .ov-club-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ov-caption { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: -6px 0 -4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .ov { gap: 12px; }
  /* Заголовок карточки — в одну строку: «Доска ›» не уезжает на вторую строку на 360 px. */
  .ov-card-head { flex-wrap: nowrap; align-items: center; }
  .ov-card-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ov-head-link { flex: none; }
  .ov-kpi-chev { top: 12px; right: 8px; }

  /* Свёрнутые разделы после воронки: строка «заголовок · подпись · ⌄» на 52 px. */
  .ov-fold-head { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ov-fold-head:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
  .ov-fold-chev { display: inline-flex; flex: none; margin-left: auto; color: var(--muted); transition: transform .15s; }
  .ov-fold:not(.is-folded) .ov-fold-chev { transform: rotate(180deg); }
  .ov-card.ov-fold .ov-card-head { flex-wrap: nowrap; align-items: center; min-height: 52px; }
  .ov-card.ov-fold .ov-card-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ov-card.ov-fold.is-folded .ov-card-head { padding: 0 16px; }
  .ov-card.ov-fold.is-folded > :not(.ov-card-head) { display: none; }
  .ov-night.ov-fold.is-folded .ov-night-clubs, .ov-night.ov-fold.is-folded .ov-cmp { display: none; }
  .ov-night.ov-fold.is-folded .ov-night-main { padding: 14px 16px; }
  .ov-night .ov-kicker.ov-fold-head { min-height: 24px; }
  .ov-night.is-folded .ov-night-line { font-size: 15px; line-height: 22px; margin-top: 4px; }
}

/* Стикер Марьям в чате игры и в черновике — картинкой 120 px без пузыря, как в WhatsApp. */
.mr-sticker { display: inline-block; background: none; border: 0; padding: 0; }
.mr-sticker img { display: block; width: 120px; height: 120px; object-fit: contain; }
