/* ==========================================================================
   DreamVPN · админка — раскладка поверх дизайн-системы.
   Цвета, шрифт, кнопки, поля, статусы, ячейки — из ds/tokens.css и ds/ui.css
   (копии web/packages/ui/src/styles, сверяются тестом). Здесь только то,
   чего нет в системе: каркас страницы, плотные таблицы, сетки форм.
   ========================================================================== */

@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body { background: var(--canvas); font-size: 15px; }
h1, h2, h3 { margin: 0; }
.mt { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---- Каркас: верхняя панель + навигация-пилюля (как .hdr__nav лендинга) */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.top__in { max-width: 1280px; margin: 0 auto; padding: 0 16px; min-height: 64px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top .brand { --logo: 34px; margin-right: auto; }
.top .brand__name { font-size: 16px; }
.nav { order: 3; width: 100%; display: flex; gap: 2px; padding: 4px; margin-bottom: 10px; border-radius: var(--r-pill); background: var(--canvas);
  overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 8px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(15, 17, 22, .1); }
.who { display: flex; align-items: center; gap: 4px; margin: 0; }
.who__mail { display: none; font-size: 13px; color: var(--ink-3); margin-right: 6px; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--fill); }
.icon-btn svg { width: 20px; height: 20px; }
@media (min-width: 1100px) {
  .top__in { flex-wrap: nowrap; min-height: 68px; }
  .nav { order: 0; width: auto; margin: 0; }
  .who__mail { display: inline; }
}

.page { max-width: 1280px; margin: 0 auto; padding: 24px 16px 80px; display: grid; gap: 20px; }
@media (min-width: 760px) { .page { padding: 32px 24px 96px; } }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.page__head h1 { font: 800 clamp(26px, 4vw, 34px)/1.1 var(--font); letter-spacing: -0.045em; }
.page__head .micro a { color: var(--brand); font-weight: 700; text-decoration: none; }

/* ---- Сообщения */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-l); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.note--err { background: var(--stop-soft); color: var(--stop); }
.note--warn { background: var(--warn-soft); color: var(--warn); }

/* ---- Карточки и сетки */
.card { padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.card > * { min-width: 0; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 { font: 800 18px/1.25 var(--font); letter-spacing: -0.02em; }
.card h3 { font: 800 15px/1.3 var(--font); }
.card--flush { padding: 0; overflow: hidden; gap: 0; }
.card--flush > .card__head { padding: 18px 22px 14px; }
.grid-2, .grid-3 { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; display: grid; gap: 2px; }
.tile__num { font: 800 30px/1.1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tile__label { font-weight: 700; }
.tile__sub { font-size: 13px; color: var(--ink-3); }
.tile--link { color: inherit; text-decoration: none; align-content: start; } .tile--link:hover { border-color: var(--ink-3); }

.chart { width: 100%; height: 140px; display: block; }
.chart rect { fill: var(--brand); }
.chart rect:hover { fill: var(--brand-press); }

/* Ключ — значение (как .cells, но без кликов) */
.kv { list-style: none; margin: 0; padding: 0; display: grid; }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.kv li:first-child { border-top: 0; padding-top: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv b.is-go { color: var(--go); } .kv b.is-warn { color: var(--warn); } .kv b.is-stop { color: var(--stop); }

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.log time { color: var(--ink-3); margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---- Плотная таблица на языке системы */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--ink-3); white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--fill) 60%, transparent); }
.table a { color: var(--brand); font-weight: 700; text-decoration: none; }
.table .empty { color: var(--ink-3); text-align: center; padding: 28px; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.strike { text-decoration: line-through; }

/* ---- Формы */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.form-grid > .span, .form-grid > fieldset, .form-grid > .reason, .form-grid > h2, .form-grid > .card__head { grid-column: 1 / -1; }
.field__input--sm { height: 44px; border-radius: 12px; font-size: 15px; }
select.field__input { appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A90A0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px; }
textarea.field__input { height: auto; min-height: 88px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.field__input[readonly] { background: var(--canvas); color: var(--ink-2); }
.field__input:user-invalid { border-color: var(--stop); }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }

/* Выбор из нескольких — чипы с галочкой */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.pick:has(input:checked)::before { content: "✓"; font-weight: 800; }
.pick:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.pick small { color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; }

/* Переключатель с подписью (ячейка без рамки) */
.toggle { display: flex; align-items: center; gap: 14px; min-height: 52px; cursor: pointer; }
.toggle__body { display: grid; gap: 1px; flex: 1; }
.toggle__title { font-weight: 700; }
.toggle__sub { font-size: 13px; color: var(--ink-3); }

.reason { display: grid; gap: 8px; }
.reason > span { font-size: 14px; font-weight: 700; }

/* Поиск: поле + кнопка */
.search { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .search { grid-template-columns: minmax(0, 1fr) auto; } .search--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; } }
.chips--filter { gap: 8px; }
.chips--filter .chip { min-height: 30px; padding: 0 12px; font-size: 13px; text-decoration: none; }

/* ---- Ремонт подписки: формы-карточки */
.actions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.action { border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; display: grid; gap: 12px; align-content: start; background: var(--paper); }
.action--wide { grid-column: 1 / -1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline .field__input { height: 40px; width: 180px; padding-left: 12px; border-radius: 10px; font-size: 14px; }
details > summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 14px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }
pre { margin: 0; padding: 12px; background: var(--canvas); border-radius: 12px; font: 12px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-all; max-width: 60ch; }

/* ---- Вход */
.auth { max-width: 440px; margin: 7vh auto 0; display: grid; gap: 22px; justify-items: center; padding: 0 16px 48px; }
.auth .card { width: 100%; padding: 30px 24px; gap: 18px; box-shadow: var(--shadow-card); }
.auth h1 { font: 800 24px/1.2 var(--font); letter-spacing: -0.03em; text-align: center; }
.auth .lead { text-align: center; font-size: 15px; }

/* ---- Редактор тарифов */
.editor { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1180px) { .editor { grid-template-columns: minmax(0, 1fr) 420px; } }
.editor-form { display: grid; gap: 20px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 0 6px 8px; white-space: nowrap; }
.price-table td { padding: 5px 6px; vertical-align: middle; }
.price-table .field__input { height: 44px; padding: 0 12px; border-radius: 12px; min-width: 76px; font-size: 15px; }
.price-table .calc { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.price-table td.chk { text-align: center; }
.price-table td.chk input { vertical-align: middle; margin: 0; }
.price-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); }
@media (max-width: 760px) {
  .price-table thead { display: none; }
  .price-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; padding: 12px 0; border-top: 1px solid var(--line); }
  .price-table td { padding: 0; }
  .price-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
  .price-table td.chk { text-align: left; }
}
.editor-preview { position: sticky; top: 140px; display: grid; gap: 12px; }
@media (min-width: 1100px) { .editor-preview { top: 88px; } }
.pv-frame { background: var(--canvas); border-radius: var(--r-xl); padding: 16px; border: 1px solid var(--line); }
.pv-frame .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Блок тарифов лендинга (reference/landing.html, .prices/.prow) — для предпросмотра */
.pv-prices { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.pv-title { padding: 16px 18px 0; display: grid; gap: 4px; }
.pv-title b { font: 800 19px/1.2 var(--font); letter-spacing: -0.02em; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; padding: 16px 18px; border-top: 1px solid var(--line); }
.pv-title + .prow { border-top: 0; }
.prow__info { display: grid; gap: 4px; min-width: 0; }
.prow__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.prow__sub { font-size: 13px; color: var(--ink-2); }
.prow__price { display: grid; justify-items: end; gap: 2px; }
.prow__sum { font: 800 28px/1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.prow__sum small { font-size: 15px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.prow__per { font-size: 12px; color: var(--ink-3); }
.prow__was { font-size: 12px; color: var(--ink-3); text-decoration: line-through; }
.prow__stars { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.prow .btn { grid-column: 1 / -1; margin-top: 10px; --h: 42px; border-radius: 14px; font-size: 15px; }
.prow--hot { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.prow--hot .prow__sum { color: var(--brand); }
.pv-inc { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 18px 18px; list-style: none; margin: 0; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
.pv-inc li::before { content: "✓ "; color: var(--go-dot); font-weight: 800; }
.pv-empty { padding: 20px; color: var(--ink-3); text-align: center; }

/* ---- Подтверждение опасных действий (нижний лист из эталона) */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 480px; background: transparent; color: var(--ink); }
@media (min-width: 760px) { .sheet { margin: auto; } .sheet__body { border-radius: var(--r-xl) !important; } }
.sheet::backdrop { background: rgba(10, 12, 16, .5); }
.sheet__body { background: var(--paper); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; justify-items: center; text-align: center; }
.sheet__grip { width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet .btn { width: 100%; }

/* В тёмной теме знак инвертируется, как в подвале эталона */
:root[data-theme="dark"] .brand { --logo-bg: #FFFFFF; --logo-fg: #0F1116; }

/* ---- Поддержка */
.nav__count { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: var(--r-pill); background: var(--warn); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--fill); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.tab[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.tab__count { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 800; }
.table td.preview { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.support { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .support { grid-template-columns: minmax(0, 1fr) 340px; } }
.feed { display: grid; gap: 12px; }
.msg { display: grid; gap: 6px; padding: 12px 16px; border-radius: var(--r-l); background: var(--fill); max-width: 90%; min-width: 0; }
.msg--user { justify-self: start; }
.msg--operator { justify-self: end; background: var(--brand-soft); color: var(--brand-ink); }
.msg--system { justify-self: center; background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.msg__head { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.msg__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.msg__img { max-width: 240px; max-height: 180px; border-radius: 10px; display: block; margin-bottom: 4px; }
.msg__input { white-space: pre-wrap; }

/* «Тестеры»: the actions menu must not be clipped by the card or the table wrapper. */
.card--menu { overflow: visible; }
.table-wrap--menu { overflow: visible; }
.table th.right, .table td.right { text-align: right; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.menu { position: relative; }
.menu > summary { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; }
.menu[open] > summary { margin-bottom: 0; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; display: grid; gap: 2px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 14px 36px rgba(0, 0, 0, .16); }
.menu__list form { margin: 0; }
.menu__item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.menu__item:hover:not(:disabled), .menu__item:focus-visible { background: var(--fill); }
.menu__item:disabled { color: var(--ink-3); cursor: not-allowed; }
.menu__item--danger { color: var(--stop); }
.menu__sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }


/* ---- «Аналитика»: крупные цифры, полосы воронки по целям, карточки вместо таблиц */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.an-tabs { margin: 4px 0 2px; }
.an-bar-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.an-selects { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.an-period { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.an-dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.an-dates input[type="date"] { width: 180px; padding-left: 12px; padding-right: 10px; text-align: left; }
.an-dates__dash { color: var(--ink-3); }
.an-selects select { min-width: 150px; max-width: 240px; }
.an-crumbs { margin-top: -4px; }
.an-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .an-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-tiles .tile { padding: 14px; } .an-tiles .tile__num { font-size: 24px; } }
.an-tiles .tile__label { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.tile__num.is-go { color: var(--go); } .tile__num.is-stop { color: var(--stop); }
.an-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; color: var(--ink-2); font-size: 14px; }
.an-meta b { color: var(--ink); }
.an-hint { margin-top: -6px; }
.an-goals { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.an-goal { gap: 10px; }
.an-goal__head { display: flex; align-items: center; gap: 10px; }
.an-goal__head h2 { font-size: 17px; letter-spacing: -0.02em; }
.an-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--brand); }
.an-goal--2 .an-num { background: var(--go); } .an-goal--3 .an-num { background: var(--warn); }
.an-goal__res { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.an-goal__res b { font: 800 30px/1.1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.an-goal__res span { color: var(--ink-2); font-size: 13px; }
.an-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.an-step { display: grid; gap: 5px; }
.an-step .micro { margin: 0; }
.an-step__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.an-step__n { font: 800 18px/1 var(--font); font-variant-numeric: tabular-nums; }
.an-bar { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.an-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.an-goal--2 .an-bar i { background: var(--go); } .an-goal--3 .an-bar i { background: var(--warn); }
.an-step__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.an-step__meta b { color: var(--ink); }
.an-break { display: grid; gap: 12px; }
.an-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.an-card { display: grid; gap: 6px; text-decoration: none; color: inherit; }
a.an-card:hover { border-color: var(--brand-line); }
.an-card__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.an-card__title { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.an-card__n { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-card__note { color: var(--warn); }
.an-card__kpi { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.an-card__kpi b { color: var(--ink); } .an-card__kpi b.is-go { color: var(--go); } .an-card__kpi b.is-stop { color: var(--stop); }
.an-mini { position: relative; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.an-mini i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.an-mini__conn { background: color-mix(in srgb, var(--brand) 55%, transparent); } .an-mini__paid { background: var(--go); }
.an-days { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-bottom: 20px; overflow-x: auto; }
.an-day { position: relative; flex: 1 0 14px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.an-day i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; }
.an-day__came { background: var(--fill); } .an-day__conn { background: color-mix(in srgb, var(--brand) 55%, transparent); } .an-day__paid { background: var(--go); }
.an-day span { position: absolute; bottom: -18px; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.an-day:not(:nth-child(4n+1)) span { display: none; }
.an-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin: 0 4px 0 10px; }
.an-key--came { background: var(--fill); border: 1px solid var(--line-strong); } .an-key--conn { background: color-mix(in srgb, var(--brand) 55%, transparent); } .an-key--paid { background: var(--go); }
.an-key--g1 { background: var(--brand); } .an-key--g2 { background: var(--go); } .an-key--g3 { background: var(--warn); } .an-key--g0 { background: var(--ink-3); }
.an-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-row { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m, 14px); padding: 10px 14px; display: grid; gap: 2px 14px; grid-template-columns: minmax(110px, auto) 1fr; align-items: baseline; }
.an-row .micro { grid-column: 1 / -1; }
.an-del { grid-column: 1 / -1; }
.an-del summary { cursor: pointer; color: var(--ink-3); width: max-content; }
.an-del form { margin-top: 8px; align-items: flex-end; }
.an-help ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.an-help summary { cursor: pointer; }
.an-dots { display: inline-flex; gap: 4px; align-items: center; }
.an-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fill); border: 1px solid var(--line-strong); }
.an-dot.is-on.an-dot--g1 { background: var(--brand); border-color: var(--brand); } .an-dot.is-on.an-dot--g2 { background: var(--go); border-color: var(--go); }
.an-dot.is-on.an-dot--g3 { background: var(--warn); border-color: var(--warn); }
.an-legend-dots .an-dot { background: var(--fill); }
.an-stages { margin-top: -4px; }
.an-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-person { display: grid; gap: 6px; padding: 12px 16px; text-decoration: none; color: inherit; }
.an-person:hover { border-color: var(--brand-line); }
.an-person__top, .an-person__bottom { display: flex; gap: 8px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.an-person__bottom .micro { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.an-person__right { white-space: nowrap; }
.an-who { display: grid; gap: 0; }
.an-who__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.an-who__row:first-child { border-top: 0; padding-top: 0; }
.an-who__row > span { color: var(--ink-2); }
.an-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; }
.an-ev { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0 10px 18px; border-left: 2px solid var(--line); }
.an-ev::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); border: 2px solid var(--paper); }
.an-ev--g1::before { background: var(--brand); } .an-ev--g2::before { background: var(--go); } .an-ev--g3::before { background: var(--warn); }
.an-ev--goal b { color: var(--go); } .an-ev--refund b { color: var(--stop); }
.an-ev > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.an-ev__time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.an-link { display: flex; gap: 8px; align-items: center; }
.an-link input { flex: 1; min-width: 0; }
/* What is not counted: the launch line, «свой», the card of «Кампании и расходы». */
.an-launch { margin: -4px 0 0; color: var(--ink-2); }
.an-channels { margin-bottom: -4px; }
.an-staff summary { cursor: pointer; }
.an-staff form { margin-top: 10px; flex-wrap: wrap; }
.an-clean .grid-2 { align-items: start; }
.an-clean p { margin: 0 0 8px; }
.an-clean__clear { margin-top: 10px; flex-wrap: wrap; }
/* Report tables (analytics_table.go): numbers right, «Итого» first, nested rows indented. */
.an-table th.right, .an-table td.right { text-align: right; }
.an-table td { vertical-align: top; font-variant-numeric: tabular-nums; padding-top: 10px; padding-bottom: 10px; }
.an-table td > .micro { display: block; margin-top: 2px; color: var(--ink-3); }
.an-table__dim { min-width: 180px; }
.an-table__dim a { color: inherit; font-weight: 700; text-decoration: none; }
.an-table__dim a:hover { color: var(--brand); }
.an-table__total td { background: var(--fill); font-weight: 700; }
.an-table__bold td { font-weight: 700; }
.an-table tr.an-table__bold.an-table__l0 td { background: color-mix(in srgb, var(--fill) 55%, transparent); }
.an-table tr.an-table__l1 td.an-table__dim { padding-left: 44px; }
.an-table__l1 .an-table__dim a { font-weight: 600; }
.an-table .is-go { color: var(--go); font-weight: 700; } .an-table .is-stop { color: var(--stop); font-weight: 700; }
.an-table__foot { margin: 0; padding: 10px 22px 14px; border-top: 1px solid var(--line); }
/* «Сводка»'s tree (an_tree): a line with lines under it opens them, as Метрика's groupings — «+» closed, «−» open; each level a step in. */
.an-tree tr[hidden] { display: none; }
.an-tree th { white-space: normal; vertical-align: bottom; line-height: 1.25; letter-spacing: 0; }
.an-tree th.right { min-width: 52px; }
.an-tree th, .an-tree td { padding-left: 7px; padding-right: 7px; }
.an-tree .an-table__dim { min-width: 150px; }
/* Bands of metric columns (an_colgroups): the trial tinted blue, the full price at once green, a line before each band; its name over the headers. */
.an-cg { border-left: 1px solid var(--line-strong); }
.an-cg--trial { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.an-cg--direct { background: color-mix(in srgb, var(--go-dot) 9%, transparent); }
.an-cg--pay { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.an-groups th { padding-top: 10px; padding-bottom: 0; border-bottom: 0; text-align: center; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); }
.an-groups__th--trial { color: var(--brand-ink); }
.an-groups__th--direct { color: var(--go); }
.an-groups__th--pay { color: var(--warn); }
.an-table .is-pay { font-weight: 700; }
.an-table .is-wait, .an-table td > .micro.is-wait { color: var(--warn); font-weight: 700; }
.an-tree tr[data-node]:has(> td > .an-tree__tog) { cursor: pointer; }
.an-tree tr.an-table__l1 td.an-table__dim { padding-left: 40px; }
.an-tree tr.an-table__l2 td.an-table__dim { padding-left: 64px; }
.an-tree tr.an-table__l3 td.an-table__dim { padding-left: 88px; }
.an-tree__tog { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.an-tree__tog::before { content: "+"; display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 12px; line-height: 1; color: var(--ink-2); }
.an-tree__tog[aria-expanded="true"]::before { content: "−"; }
.an-tree__tog:hover { color: var(--brand); }
.an-tree__tog:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.an-tree__leaf { display: inline-block; padding-left: 22px; font-weight: 600; }
.an-tree td.an-table__dim > .micro { padding-left: 22px; }
/* «Пользователи»: a line a user, nothing wraps; the details are in the hints and on the user's page. */
.an-ufilters { display: grid; gap: 10px; }
.an-more > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); width: max-content; }
.an-more[open] > summary { margin-bottom: 10px; }
.an-users__bar { margin-bottom: -6px; }
.an-users td { white-space: nowrap; vertical-align: middle; }
.an-users td.num, .an-users th[aria-sort] { text-align: right; font-variant-numeric: tabular-nums; }
.an-users__who { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.an-users__who a { color: inherit; text-decoration: none; }
.an-users__src { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.an-users__flag { color: var(--warn); }
.an-users__none { color: var(--ink-3); }
.an-users__until--go { color: var(--go); } .an-users__until--warn { color: var(--warn); } .an-users__until--stop { color: var(--stop); }
.an-users__problem { color: var(--warn); }
.an-verdict { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.an-verdict.is-go { color: var(--go); font-weight: 700; } .an-verdict.is-warn { color: var(--warn); } .an-verdict.is-stop { color: var(--stop); font-weight: 700; }
.an-verdict--big { font-size: 17px; }
.an-arms { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.an-arm.is-leader { border-color: var(--brand-line); box-shadow: 0 0 0 1px var(--brand-line) inset; }
.an-arm__num b { font: 800 30px/1.1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.an-ci { position: relative; height: 12px; border-radius: 999px; background: var(--fill); }
.an-ci__range { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--brand) 35%, transparent); }
.an-ci__point { position: absolute; top: -3px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--brand); }
.an-new .form-grid + .form-grid { border-top: 1px solid var(--line); padding-top: 14px; }
/* A/B: a color per variant, its funnel and its people by days */
.an-c0 { --c: var(--brand); } .an-c1 { --c: var(--go); } .an-c2 { --c: var(--warn); } .an-c3 { --c: var(--ink-2); } .an-c4 { --c: var(--ink-3); }
.an-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); margin-right: 6px; }
.an-vfunnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.an-vstep { display: grid; gap: 6px; }
.an-vstep__head { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; } .an-vstep__head .micro { margin: 0; }
.an-vstep__arm { display: grid; grid-template-columns: minmax(110px, 220px) 1fr minmax(76px, auto); gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.an-vstep__arm .an-bar i { background: var(--c); }
.an-vstep__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-vstep__n { text-align: right; font-variant-numeric: tabular-nums; } .an-vstep__n b { color: var(--ink); }
.an-vdays { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-bottom: 20px; overflow-x: auto; }
.an-vday { position: relative; flex: 1 0 auto; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.an-vday__col { position: relative; width: 10px; height: 100%; }
.an-vday__col i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 3px 3px 0 0; }
.an-vday__came { background: color-mix(in srgb, var(--c) 28%, transparent); } .an-vday__paid { background: var(--c); }
.an-vday span { position: absolute; bottom: -18px; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.an-vday:not(:nth-child(4n+1)) span { display: none; }
@media (max-width: 640px) {
  .an-vstep__arm { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .an-vstep__arm .an-bar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) { .an-ev { grid-template-columns: 1fr; gap: 2px; } .an-row { grid-template-columns: 1fr; } }

/* «Аккаунты»: filters, sortable headers, clickable rows, pager */
.acc-filters { display: grid; gap: 10px; }
.table th[aria-sort] .th-sort { color: inherit; font-weight: inherit; text-decoration: none; }
.table th[aria-sort] .th-sort:hover, .table th[aria-sort="ascending"] .th-sort, .table th[aria-sort="descending"] .th-sort { color: var(--ink); }
.table--rows tbody tr[data-href] { cursor: pointer; }
.acc-pager { justify-content: center; }
/* «Отчёт для агентства» (agency.html) and its links in «Кампании и расходы» */
.ag-files__row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.an-reports .an-row > .an-link { grid-column: 1 / -1; }
.ag-hint { margin-bottom: -4px; }
.ag-spend { min-width: 128px; }
.ag-spend__in { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.ag-table td .micro { display: block; }
/* The report's tables fit the page without a scroll: the numbers' columns share the width evenly, the headers
   wrap onto two lines (27.10.2026, Алексей: «выровняй столбцы … разместить на экран по ширине без прокрута»).
   Narrower than min-width — the table scrolls. */
.ag-table { table-layout: fixed; width: 100%; min-width: 1040px; }
.ag-table th, .ag-table td { padding-left: 6px; padding-right: 6px; }
.ag-table th { white-space: normal; vertical-align: bottom; font-size: 11px; letter-spacing: 0; line-height: 1.3; hyphens: auto; overflow-wrap: break-word; }
.ag-table th:first-child, .ag-table .ag-col-day { width: 142px; }
.ag-table th:nth-child(2), .ag-table .ag-col-spend { width: 104px; }
.ag-table .an-groups th { width: auto; }
.ag-table .an-table__dim { min-width: 0; overflow-wrap: anywhere; }
.ag-table .ag-spend { min-width: 0; }
.ag-table .ag-spend__in { width: 100%; padding: 0 10px; }
/* The period picker (an_period, admin.js): a button and its popover — presets and two months, as Яндекс Метрика. */
.dp { position: relative; display: inline-block; }
.dp__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-m, 16px);
  background: var(--paper); font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.dp__btn::-webkit-details-marker { display: none; }
.dp__btn svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.dp[open] .dp__btn { border-color: var(--brand); }
.dp[open] .dp__chev { transform: rotate(180deg); }
.dp__pop { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; display: grid; grid-template-columns: 150px auto; gap: 16px;
  width: max-content; max-width: calc(100vw - 32px); /* the button is narrow: the two months stand side by side */
  padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m, 16px); box-shadow: 0 16px 40px -12px rgba(15, 17, 22, .28); }
.dp__presets { display: grid; align-content: start; gap: 2px; border-right: 1px solid var(--line); padding-right: 12px; }
.dp__presets a { padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; white-space: nowrap; }
.dp__presets a:hover { background: var(--fill); }
.dp__presets a[aria-current] { background: var(--brand-soft); color: var(--brand); }
.dp__form { display: grid; gap: 12px; }
.dp__cal { position: relative; }
.dp__nav { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: space-between; pointer-events: none; }
.dp__step { pointer-events: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-3); }
.dp__step:hover { background: var(--fill); color: inherit; }
.dp__months { display: flex; flex-wrap: wrap; gap: 24px; }
.dp__month { width: 252px; }
.dp__title { height: 30px; display: grid; place-items: center; font-weight: 700; }
.dp__grid { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 2px; }
.dp__wd { height: 28px; display: grid; place-items: center; font-size: 12px; color: var(--ink-3); }
.dp__day { height: 34px; border: 0; background: none; border-radius: 10px; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; color: inherit; }
.dp__day:hover:not(:disabled) { background: var(--fill); }
.dp__day:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.dp__day.is-in { background: var(--brand-soft); border-radius: 0; }
.dp__day.is-from, .dp__day.is-to, .dp__day.is-from:hover, .dp__day.is-to:hover { background: var(--brand); color: #fff; } /* the hover does not hide the ends */
.dp__fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp__fields label { display: inline-flex; align-items: center; gap: 6px; }
.dp__fields label span { color: var(--ink-3); font-size: 13px; }
.dp__fields input[type="date"] { width: 160px; padding-left: 10px; padding-right: 8px; }
.dp__fields .btn { margin-left: auto; }
@media (max-width: 720px) {
  .dp__pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-height: calc(100vh - 32px); overflow: auto; grid-template-columns: 1fr; }
  .dp__presets { display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
  .dp__months { justify-content: center; }
}
/* «Сводка»: the funnel of the bot and the site together. */
.an-funnel__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-funnel__step { display: grid; gap: 6px; align-content: start; }
.an-funnel__title { font-weight: 700; color: var(--ink-2, inherit); }
.an-funnel__n { font: 800 30px/1.1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .an-funnel__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- «Аналитика» → «Подписки»: допущения прогноза и столбики месяцев (ожидаем: пул + новые; за ними — потенциал) */
.sub-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.sub-field { display: grid; gap: 4px; }
.sub-field > span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.sub-field input { width: 170px; }
.sub-chart { display: flex; align-items: stretch; gap: 8px; height: 220px; overflow-x: auto; }
.sub-col { flex: 1 0 64px; display: grid; grid-template-rows: 1fr auto auto; gap: 4px; text-align: center; min-width: 0; }
.sub-col__bars { position: relative; }
.sub-col__bars i { position: absolute; bottom: 0; left: 12%; right: 12%; border-radius: 6px 6px 0 0; }
.sub-col__pot { background: var(--fill); outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.sub-col__pool { background: var(--brand); }
.sub-col__new { background: var(--go); }
.sub-col b { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-col span { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.sub-key--pool { background: var(--brand); } .sub-key--new { background: var(--go); }
.sub-key--pot { background: var(--fill); border: 1px dashed var(--line-strong); }
/* «Платная выручка» (analytics_paid.go, paid.js): a toolbar of chips, a chart and a table of the same numbers. */
.page:has(.pr) { max-width: 1600px; }
.pr { display: flex; flex-direction: column; gap: 16px; min-width: 0; --pr-up: #10b981; }
.pr-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.pr-bar::-webkit-scrollbar { display: none; }
.pr-chip { position: relative; flex: none; display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--paper); font-size: 13px; transition: background .15s; }
.pr-chip.is-on { background: var(--fill); }
@media (hover: hover) { .pr-chip:hover { background: color-mix(in srgb, var(--fill) 70%, var(--line-strong)); } }
.pr-chip__main { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.pr-chip__main b { font-weight: 700; }
.pr-chip__val { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.pr-chip__x { position: absolute; right: 3px; top: 3px; width: 24px; height: 24px; display: none; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(15, 17, 22, .18); cursor: pointer; }
.pr-chip:hover .pr-chip__x, .pr-chip__x:focus-visible { display: inline-flex; }
@media (hover: none) { .pr-chip__x { display: inline-flex; position: static; margin-right: 3px; box-shadow: none; background: transparent; } .pr-chip__main { padding-right: 4px; } }
.pr-ico { flex: none; color: var(--ink-2); }
.pr-menu { position: fixed; z-index: 60; min-width: 200px; max-width: 340px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); box-shadow: 0 8px 28px rgba(15, 17, 22, .16); font-size: 13px; }
.pr-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pr-item:hover { background: var(--fill); }
.pr-item__t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pr-item.is-on .pr-item__t { font-weight: 700; }
.pr-item__h { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.pr-item__c { flex: none; width: 14px; height: 14px; color: var(--brand); }
.pr-item__c .pr-ico { color: inherit; display: block; }
.pr-item__empty { margin: 0; padding: 8px; color: var(--ink-2); }
.pr-search { width: 100%; box-sizing: border-box; height: 32px; margin-bottom: 6px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
.pr-menu__t { margin: 8px 8px 2px; color: var(--ink-3); font-size: 12px; }
.pr-pair { display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 3px 4px 3px 8px; border-radius: 8px; }
.pr-pair:hover { background: var(--fill); }
.pr-pick { min-width: 30px; height: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.pr-pick.is-on { border-color: var(--brand); background: var(--brand); color: #fff; }
.pr-dates { display: grid; gap: 6px; margin-top: 4px; padding: 8px; border-top: 1px solid var(--line); }
.pr-dates__t { color: var(--ink-2); }
.pr-dates__row { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-dates input { flex: 1; min-width: 124px; height: 32px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
.pr-notes { display: grid; gap: 4px; }
.pr-note { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.pr-note--warn { color: var(--warn); }
.pr-chart { min-width: 0; padding: 16px; gap: 8px; border-radius: 8px; box-shadow: none; }
.pr-chart__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pr-chart__title { margin: 0; font-size: 15px; font-weight: 700; }
.pr-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; max-width: 74%; }
.pr-legend__i { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.pr-legend__i i { width: 9px; height: 9px; border-radius: 3px; }
.pr-legend__i.is-off { color: var(--ink-3); text-decoration: line-through; }
.pr-legend__i.is-off i { opacity: .3; }
.pr-plot { position: relative; min-height: 250px; }
.pr-plot__empty { display: flex; align-items: center; justify-content: center; height: 250px; margin: 0; color: var(--ink-2); font-size: 14px; text-align: center; }
.pr-svg { display: block; }
.pr-grid { stroke: var(--line); }
.pr-tick { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.pr-hover { fill: var(--fill); opacity: .55; pointer-events: none; }
.pr-tip { position: absolute; z-index: 5; min-width: 150px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); box-shadow: 0 6px 20px rgba(15, 17, 22, .14); font-size: 12px; pointer-events: none; }
.pr-tip__t { margin-bottom: 4px; color: var(--ink-2); }
.pr-tip__r { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.pr-tip__r i { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.pr-tip__r span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-tip__r b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-tip__total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.pr-tablebox { display: grid; gap: 8px; min-width: 0; }
.pr-tablehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pr-count { color: var(--ink-2); font-size: 13px; }
.pr-scroll { overflow: auto; max-height: calc(100vh - 96px); background: var(--paper); border-radius: 8px; }
.pr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.pr-table th, .pr-table td { height: 44px; padding: 0 7px; border-bottom: 1px solid var(--line); background-clip: padding-box; white-space: nowrap; }
.pr-table thead th { position: sticky; top: 0; z-index: 2; background: var(--paper); color: var(--ink-2); font-weight: 500; }
.pr-table th[data-metric] { cursor: pointer; }
.pr-table th[data-metric]:hover { color: var(--ink); }
.pr-table th.is-picked { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.pr-th { display: inline-flex; align-items: center; gap: 4px; }
.pr-num { text-align: right; }
.pr-table .pr-first { position: sticky; left: 0; z-index: 1; padding-left: 12px; background: var(--paper); text-align: left; }
.pr-table thead .pr-first { z-index: 3; }
.pr-table tr > :last-child { padding-right: 12px; }
.pr-table tfoot td { position: sticky; bottom: 0; z-index: 2; height: 52px; background: var(--paper); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.pr-table tfoot .pr-first { z-index: 3; }
.pr-total td { font-weight: 700; }
.pr-table .pr-total small { display: block; color: var(--ink-2); font-size: 9.5px; font-weight: 400; }
.pr-group td { padding: 0; background: var(--paper); }
.pr-group__in { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.pr-group__in b { font-size: 13px; font-weight: 700; }
.pr-group__in span { color: var(--ink-2); }
.pr-group.is-off .pr-ico { transform: rotate(-90deg); }
.pr-skel { border-radius: 8px; background: var(--fill); }
.pr-skel--chart { height: 320px; }
.pr-skel--table { height: 240px; }
.pr-hidden { display: none; }
.pr-empty { margin: 0; padding: 32px 16px; color: var(--ink-2); text-align: center; }
.pr :focus-visible, .pr-menu :focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pr-svg { touch-action: pan-y; }
.pr-about summary { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; list-style: none; cursor: pointer; }
.pr-about summary::-webkit-details-marker { display: none; }
.pr-about .pr-note { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .pr-chip { transition: none; } }
/* A phone: the admin's bar scrolls away, the numbers come first, one scroll — the page's. */
@media (max-width: 759px) {
  body:has(.pr) .top { position: static; }
  .an-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .an-tabs::-webkit-scrollbar { display: none; }
  .an-tabs .tab { flex: none; }
  /* The reports' tables: the line's name stays while the numbers scroll. */
  .an-table .an-table__dim { width: 128px; min-width: 128px; max-width: 128px; white-space: normal; overflow-wrap: anywhere; }
  .ag-table { min-width: 1240px; } /* the lines under the numbers do not run into each other */
  .ag-table th:first-child, .ag-table .ag-col-day { width: 118px; }
  .ag-table .an-table__dim { width: auto; min-width: 0; max-width: none; }
  .an-table th:first-child, .an-table td.an-table__dim { position: sticky; left: 0; z-index: 1; background-color: var(--paper); }
  .an-table__total td.an-table__dim { background-image: linear-gradient(var(--fill), var(--fill)); }
}
@media (max-width: 599px) {
  .page:has(.pr) > .page__head > .micro { display: none; }
  .pr { gap: 12px; }
  .pr-bar { margin-inline: -16px; padding-inline: 16px; }
  .pr-chip__long { display: none; }
  .pr-menu { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 0; max-width: none; max-height: 72vh; overscroll-behavior: contain; font-size: 14px; box-shadow: 0 -4px 32px rgba(15, 17, 22, .28); }
  .pr-item, .pr-pair { min-height: 44px; }
  .pr-pick { min-width: 44px; height: 32px; font-size: 13px; }
  .pr-chart { padding: 12px; }
  .pr-chart__head { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
  .pr-legend { flex-wrap: nowrap; justify-content: flex-start; align-self: stretch; max-width: none; overflow-x: auto; scrollbar-width: none; gap: 12px; padding-block: 2px; }
  .pr-legend::-webkit-scrollbar { display: none; }
  .pr-legend__i { flex: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .pr-legend__i i { flex: none; }
  .pr-tick { font-size: 11px; }
  .pr-tip { max-width: 240px; max-height: 240px; overflow: hidden; }
  .pr-skel--chart { height: 260px; }
  /* The table edge to edge, its own scroll sideways only, «Итого» first as in the other reports. */
  .pr-scroll { max-height: none; margin-inline: -16px; border-radius: 0; }
  .pr-table { font-size: 12.5px; }
  .pr-table th, .pr-table td { height: 40px; padding: 0 3px; }
  .pr-table thead th { position: static; height: 38px; padding-block: 4px; vertical-align: bottom; white-space: normal; font-size: 11.5px; line-height: 1.15; }
  .pr-table thead th .pr-ico { display: none; }
  .pr-th { display: inline; }
  .pr-table .pr-first { padding-left: 12px; padding-right: 6px; }
  .pr-table thead .pr-first { position: sticky; }
  .pr-table tr > :last-child { padding-right: 10px; }
  .pr-table .pr-total td { height: 40px; border-bottom: 1px solid var(--line-strong); background-image: linear-gradient(var(--fill), var(--fill)); background-color: var(--paper); }
  .pr-table .pr-total td[style] { background-image: none; }
  .pr-table .pr-total small { display: none; }
  .pr-group__in { height: 44px; padding-left: 12px; }
  .pr-group__in b { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 379px) {
  .pr-table { font-size: 12px; }
  .pr-table th, .pr-table td { padding: 0 2px; }
  .pr-table .pr-first { padding-left: 8px; padding-right: 4px; }
  .pr-table tr > :last-child { padding-right: 6px; }
}
/* The table scrolled sideways: a line between the periods and the numbers under them. */
.pr-scroll.is-scrolled .pr-first { box-shadow: 1px 0 0 var(--line-strong); }
