/* ============================================================================================
   «АНАЛИТИКА» В ДИЗАЙНЕ ПАКЕТА v5 (Э4) — сетка сводки на 12 колонок, графики пакета, подсказка, погружение.
   Эталон — c-design v0.968.1 `concept/forbion-crm/package/css/components.css` (.fc-panel, .fc-kpi, .fc-chart,
   .fc-tip, .fc-legend) и `src/screens.css` (.dash, .w-15…w-6, .dash-crumbs). Своих цветов нет — только токены
   пакета (tokens.css): обе темы работают сами. Правила §6 HANDOFF-S: одна ось, колонка ≤ 24 px, скругление только
   у конца данных, подсказка на наведение И фокус, категории viz-1…8, упорядоченное seq-1…7, движение выключается
   при prefers-reduced-motion. Сетки с текстом — minmax(0, 1fr): на 390 px страница вбок не едет.
   Файл подключается ПОСЛЕ styles.css — старые правила экрана (6 колонок) сняты оттуда тем же срезом.
   ============================================================================================ */

/* ---- сетка сводки: 12 колонок; четверть = 3, треть = 4, половина = 6, вся ширина = 12 ---- */
.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.dashboard > * { min-width: 0; grid-column: span 12; }
.dashboard > .block--report { margin-top: 0; }
.dashboard > .block--size-third { grid-column: span 4; }
.dashboard > .block--size-half { grid-column: span 6; }
.dashboard > .an-w3 { grid-column: span 3; }
.dashboard > .an-w12 { grid-column: span 12; }
@media (max-width: 1180px) {
  .dashboard > .block--size-third, .dashboard > .an-w3 { grid-column: span 6; }
  .dashboard > .block--size-half { grid-column: span 12; }
}
@media (max-width: 640px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* Все классы ширины — поимённо: «span 12» у .an-w12 (0,2,0) перебил бы «> *» и создал неявные колонки. */
  .dashboard > *, .dashboard > .block--size-third, .dashboard > .block--size-half, .dashboard > .an-w3, .dashboard > .an-w12 { grid-column: 1 / -1; }
}
.dashboard__empty { text-align: center; padding: var(--space-6) var(--space-4); background: var(--bg-surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.dashboard__empty p { margin: 4px 0; }

/* ---- блок сводки = панель пакета (fc-panel): кромка сверху светлее, тень первого уровня ---- */
.dashboard .block--report, .an-panel {
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-2)) padding-box,
              linear-gradient(180deg, var(--edge-top), var(--line) 38%, var(--line)) border-box;
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow-1);
  padding: 14px 16px;
}
.dashboard .block--report .block__title,
.an-panel__over {
  font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.an-panel__head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; min-width: 0; }
.an-panel__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; color: var(--ink); text-wrap: balance; }
.chart__measure { margin: 0 0 8px; font-size: 12px; font-weight: 550; color: var(--muted); }

/* Появление контейнера — только fill-mode backwards (иначе блок станет рамкой для position: fixed, §6). */
@keyframes an-rise { from { opacity: 0; transform: translateY(6px); } }
.dashboard--drill > * { animation: an-rise .35s cubic-bezier(.2, .8, .2, 1) backwards; }

/* ---- числа (KpiTile) ---- */
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.an-kpi {
  position: relative; overflow: hidden; display: grid; gap: 6px; min-width: 0; padding: 14px 16px;
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-2)) padding-box,
              linear-gradient(180deg, var(--edge-top), var(--line) 38%, var(--line)) border-box;
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow-1);
  transition: transform .18s, box-shadow .18s;
}
.an-kpi::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 180px; height: 180px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--primary)) 10%, transparent), transparent 68%);
}
/* Плитка внутри блока — вложенная: без тени и пятна, тонкая рамка (панель в панели не должна «всплывать»). */
.block--report .an-kpi { box-shadow: none; background: var(--bg-surface-2); border-color: var(--line); padding: 12px 14px; }
.block--report .an-kpi::after { display: none; }
.an-kpi__label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.an-kpi__name { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.an-kpi__zoom { margin-left: auto; color: var(--muted); }
.an-kpi__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.an-kpi__value { font-size: 28px; line-height: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.an-kpi__unit { font-size: 15px; font-weight: 700; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.an-kpi--empty .an-kpi__value { font-size: 15px; line-height: 32px; font-weight: 600; color: var(--muted); }
.an-kpi__note { font-size: 12px; font-weight: 550; color: var(--muted); }
.an-kpi.is-pick { cursor: pointer; }
.an-kpi.is-pick:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow-2); }
.an-kpi.is-pick:hover .an-kpi__zoom { color: var(--primary-ink); }
.an-delta { font: 700 12px/1 var(--font-sans); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.an-delta--up { color: var(--success); } .an-delta--down { color: var(--danger); } .an-delta--flat { color: var(--muted); }
.an-spark { position: relative; height: 32px; }
.an-spark__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an-spark__line { fill: none; stroke: var(--c, var(--viz-1)); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.an-spark__end { position: absolute; width: 6px; height: 6px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--c, var(--viz-1)); }

/* ---- общее для частей графика: фокус, «можно нажать», «выключено», «грузится» ---- */
.an-hbars__row, .an-cols__col, .an-heat__cell, .an-kpi { outline: none; }
.an-hbars__row:focus-visible, .an-cols__col:focus-visible, .an-heat__cell:focus-visible, .an-kpi:focus-visible,
.an-donut__arc:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.is-pick { cursor: pointer; }
.is-off { cursor: not-allowed; }
.is-busy { cursor: progress; opacity: .7; }

/* ---- полосы и воронка (FunnelChart) ---- */
.an-hbars { display: flex; flex-direction: column; gap: 4px; }
.an-hbars__row {
  display: grid; grid-template-columns: minmax(72px, 32%) minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
  padding: 4px 6px; margin: 0 -6px; border-radius: var(--radius-xs); font-size: 13px;
}
.an-hbars--extra .an-hbars__row { grid-template-columns: minmax(72px, 32%) minmax(0, 1fr) auto 44px; }
.an-hbars__row.is-pick:hover, .an-hbars__row:focus-visible { background: var(--bg-hover); }
.an-hbars__label { color: var(--ink-2); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-hbars__track { height: 20px; display: flex; align-items: center; }
.an-hbars__fill {
  display: block; height: 100%; background: var(--c, var(--viz-1));
  border-radius: 0 4px 4px 0;               /* скругление только у конца данных */
  transform-origin: left; animation: an-grow-x .6s cubic-bezier(.2, .8, .2, 1) backwards;
}
.an-hbars__value { text-align: right; font-weight: 800; color: var(--ink); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.an-hbars__extra { text-align: right; color: var(--muted); font-weight: 650; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.an-hbars__note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.an-hbars__note .cov-note { white-space: normal; }
.an-hbars__row.is-off .an-hbars__fill { opacity: .72; }

/* ---- столбцы и ряд с планом (TrendChart) ---- */
.an-cols { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.an-cols__body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 8px; }
.an-cols__y { position: relative; min-width: 28px; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.an-cols__tick { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.an-cols__plot { position: relative; min-width: 0; }
.an-cols__grid { position: absolute; inset: 0; pointer-events: none; }
.an-cols__line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.an-cols__line--zero { border-top-color: var(--line-strong); }
.an-cols__bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.an-cols__col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.an-cols__col.is-pick:hover, .an-cols__col:focus-visible { background: color-mix(in srgb, var(--viz-1) 8%, transparent); }
.an-cols__bar {
  position: relative; display: block; width: min(24px, 62%);
  background: color-mix(in srgb, var(--viz-1) 62%, var(--bg-surface));
  border-radius: 4px 4px 0 0;               /* скругление только у конца данных, основание прямое */
  transform-origin: bottom; animation: an-grow .6s cubic-bezier(.2, .8, .2, 1) backwards;
}
.an-cols__col--last .an-cols__bar, .an-cols__col.is-pick:hover .an-cols__bar { background: var(--viz-1); }
.an-cols__col--empty .an-cols__bar { display: none; }
.an-cols__val {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -3px); white-space: nowrap;
  font-size: 11px; font-weight: 800; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; pointer-events: none;
}
.an-cols__x { grid-column: 2; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding-top: 6px; }
.an-cols__xlabel { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 1px; }
/* Линия плана — не цель мыши (§6): подсказку ведёт колонка под ней. */
.an-cols__plan { position: absolute; inset: 0; pointer-events: none; }
.an-cols__plan-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an-cols__plan-line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.an-cols__plan-dot { position: absolute; width: 8px; height: 8px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink-2); border: 2px solid var(--bg-surface); }
.an-cols__notes { margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); columns: 2 240px; column-gap: var(--space-4); }
.an-cols__notes li { break-inside: avoid; }
.an-cols__note-label { color: var(--ink-2); }
.an-cols__footnote { margin: 0; font-size: 11.5px; line-height: 16px; color: var(--muted); }
.an-drill__converge { margin: -6px 0 10px; font-size: 13px; color: var(--ink-2); }
.an-drill__converge b { color: var(--ink); }
@media (max-width: 640px) { .an-cols__body { grid-template-rows: 170px auto; } .an-cols__val { display: none; } .an-cols__col--last .an-cols__val { display: inline; } }

/* ---- легенда ---- */
.an-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.an-legend i.an-legend__line { width: 14px; height: 3px; border-radius: 2px; }

/* ---- круговая (DonutChart) ---- */
.an-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.an-donut__figure { position: relative; width: min(190px, 100%); aspect-ratio: 1; flex: none; }
.an-donut__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an-donut__hole { stroke: var(--bg-sunken); }
.an-donut__arc { transition: opacity .2s, filter .2s; animation: an-fade .5s ease backwards; }
.an-donut__arc.is-pick:hover, .an-donut__arc:focus-visible { filter: brightness(1.08) saturate(1.08); }
.an-donut__svg:has(.an-donut__arc:hover) .an-donut__arc:not(:hover) { opacity: .45; }
.an-donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.an-donut__center strong { font-size: 22px; line-height: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; max-width: 104px; overflow-wrap: anywhere; }
.an-donut__center span { font-size: 11px; font-weight: 600; color: var(--muted); }
.an-donut__legend { flex: 1 1 200px; min-width: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.an-donut__item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; padding: 2px 4px; margin: 0 -4px; border-radius: var(--radius-xs); }
.an-donut__item.is-pick:hover { background: var(--bg-hover); }
.an-donut__swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.an-donut__label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-donut__value { text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.an-donut__share { text-align: right; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.an-donut__note { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.an-donut__note .cov-note { white-space: normal; }

/* ---- тепловая карта (Heatmap) ---- */
.an-heat { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.an-heat__scroll { overflow-x: auto; max-width: 100%; }
.an-heat__grid { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(24px, 1fr)); gap: 3px; min-width: min-content; }
.an-heat__col, .an-heat__row { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.an-heat__col { text-align: center; }
.an-heat__row { align-self: center; text-align: right; padding-right: 6px; }
.an-heat__cell { height: 26px; border-radius: 5px; background: var(--c, var(--bg-sunken)); animation: an-fade .4s ease backwards; }
.an-heat__cell--none { background: repeating-linear-gradient(45deg, var(--bg-sunken) 0 4px, transparent 4px 8px); }
.an-heat__cell.is-pick:hover { filter: brightness(1.08) saturate(1.08); }
.an-heat__legend { display: flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.an-heat__legend i { width: 20px; height: 8px; border-radius: 2px; background: var(--c); }
.an-heat__legend span { margin-left: 6px; }

/* ---- подсказка (fc-tip) — одна на документ ---- */
.fc-tip {
  position: fixed; z-index: 1000; pointer-events: none; min-width: 150px; max-width: min(280px, calc(100vw - 16px));
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 12.5px; line-height: 17px;
}
.fc-tip[hidden] { display: none; }
.fc-tip__v { font: 800 16px/20px var(--font-sans); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.fc-tip__off { margin-top: 6px; font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---- погружение: крошки, ячейка таблицы, срез ---- */
.an-crumbs {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; align-self: flex-start; max-width: 100%;
  padding: 8px 12px; border-radius: var(--radius-pill); background: var(--bg-surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.an-crumbs__link { border: 0; background: none; padding: 0; font: inherit; color: var(--primary-ink); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.an-crumbs__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.an-crumbs__link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.an-crumbs__here { color: var(--ink); overflow-wrap: anywhere; }
.an-crumbs__sep { display: inline-flex; width: 14px; height: 14px; color: var(--muted); }
.an-crumbs__sep svg { width: 14px; height: 14px; }
.an-back { display: inline-flex; align-items: center; gap: 6px; }
.an-back .icn svg { width: 16px; height: 16px; }

.an-drill-link {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; text-align: left;
  color: var(--primary-ink); font-weight: 650; cursor: pointer;
}
.an-drill-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.an-drill-link.is-off, .an-drill-link.is-busy { color: inherit; font-weight: inherit; text-decoration: none; }
.an-drill-link.is-off { cursor: not-allowed; }
.an-drill-link__ico { display: inline-flex; width: 14px; height: 14px; opacity: .7; }
.an-drill-link__ico svg { width: 14px; height: 14px; }
.an-drill-link.is-off .an-drill-link__ico { opacity: .35; }
.an-kpi__zoom { display: inline-flex; width: 16px; height: 16px; }
.an-kpi__zoom svg { width: 16px; height: 16px; }

.an-drill__hidden { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.an-drill__hidden b { color: var(--ink); }
.an-drill__empty { margin: 0; }
.an-drill__more { margin-top: 10px; }
.an-deals td.right, .an-deals th.right { text-align: right; white-space: nowrap; }
/* 390 px: сделка — строкой-карточкой (имя во всю ширину; стадия и сумма ниже, ответственный под ними):
   четыре колонки в 340 px рвали имя по слову и уводили сумму за край. */
@media (max-width: 640px) {
  .an-deals thead { display: none; }
  .an-deals, .an-deals tbody { display: block; }
  .an-deals tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .an-deals td { display: block; padding: 0; border: 0; min-width: 0; }
  .an-deals td:nth-child(1) { grid-column: 1 / -1; font-weight: 650; }
  .an-deals td:nth-child(2) { grid-column: 1; color: var(--ink-2); }
  .an-deals td:nth-child(4) { grid-column: 2; grid-row: 2; font-weight: 700; }
  .an-deals td:nth-child(3) { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
}
.an-series__error { margin: 0; }

@keyframes an-grow { from { transform: scaleY(0); } }
@keyframes an-grow-x { from { transform: scaleX(0); } }
@keyframes an-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dashboard--drill > *, .an-hbars__fill, .an-cols__bar, .an-donut__arc, .an-heat__cell { animation: none !important; }
  .an-kpi { transition: none; }
}

/* ============================================================================================
   Э4c — замечания c-design: строка фильтров, иконки плиток, погружение по эталону DrillView, когорты, «зависла»,
   пустое состояние блока, имена на 390 не режутся.
   ============================================================================================ */
.an-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.an-filters[hidden] { display: none; }
.an-filter {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
  padding: 3px 4px 3px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--bg-surface);
  box-shadow: var(--shadow-1); font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.an-filter__word { white-space: nowrap; }
.an-filter select.input { width: auto; min-width: 0; max-width: 100%; height: 28px; border: 0; background: transparent; color: var(--ink); font-weight: 650; padding: 0 22px 0 4px; box-shadow: none; }
.an-filter select.input:disabled { color: var(--muted); cursor: not-allowed; }
.an-filter:has(select:disabled) { opacity: .75; }
@media (max-width: 640px) { .an-filter { flex: 1 1 100%; justify-content: space-between; } }

.an-kpi__ico {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px;
  color: var(--c, var(--viz-1)); background: color-mix(in srgb, var(--c, var(--viz-1)) 14%, var(--bg-surface));
}
.an-kpi__ico .icn, .an-kpi__ico svg { width: 16px; height: 16px; display: block; }

/* Часть среза среди соседей: выбранная — в цвете, соседи приглушены (эталон `active`). */
.an-hbars__row.is-dim, .an-cols__col.is-dim { opacity: .38; }
.an-hbars__row.is-active .an-hbars__label, .an-hbars__row.is-active .an-hbars__value { color: var(--ink); }
.an-cols__col.is-active .an-cols__bar { background: var(--viz-1); }

.an-drill__conclusion {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--viz-4) 10%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--viz-4) 30%, var(--line));
}
.an-drill__conclusion p { margin: 0; flex: 1 1 260px; min-width: 0; font-size: 13.5px; line-height: 20px; color: var(--ink); }
.an-drill__conclusion-ico { color: var(--viz-4); flex: none; }
.an-drill__conclusion-ico svg { width: 20px; height: 20px; display: block; }
.an-deals__stage .stage-pill { white-space: nowrap; }

.an-stale { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.an-stale .icn svg { width: 14px; height: 14px; display: block; }

.block__body .empty-state, .an-panel .empty-state { padding: 18px 8px; }

.an-cohort-scroll { overflow-x: auto; max-width: 100%; }
.an-cohort { display: grid; grid-template-columns: minmax(96px, auto) auto repeat(var(--cols), minmax(44px, 1fr)); gap: 3px; min-width: min-content; font-size: 12.5px; }
.an-cohort__h { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.an-cohort__h--num, .an-cohort__paid, .an-cohort__cell { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.an-cohort__month, .an-cohort__paid { padding: 6px; color: var(--ink-2); white-space: nowrap; }
.an-cohort__cell { padding: 6px; border-radius: 5px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--c) 34%, var(--bg-surface)); }
.an-cohort__none { border-radius: 5px; background: repeating-linear-gradient(45deg, var(--bg-sunken) 0 4px, transparent 4px 8px); }

/* Имена (менеджеры, стадии) на узком экране не режутся многоточием — переносятся (замечание c-design, 390 px). */
.an-cols__xlabel { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 13px; }
@media (max-width: 640px) {
  .an-hbars__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .an-hbars--extra .an-hbars__row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .an-hbars__label { grid-column: 1 / -1; white-space: normal; overflow: visible; text-overflow: clip; }
  .an-hbars__track { grid-column: 1; }
}
