/* ═══ Аналитика /analytics — самостоятельные стили (поверх style.css) ═══ */
.an-body { background: #f6f8fc; }
/* width:100% обязателен — body это flex-column (style.css), без него блок
   сжимается до ширины контента (на пустом состоянии /analytics был узким). */
.an-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 24px 48px; }

.an-head { margin-bottom: 18px; text-align: center; }
/* max-width:none — снимаем глобальный h1{max-width:720px} (иначе блок узкий и
   текст «по центру» оказывается в левой части страницы) */
.an-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); max-width: none; }
.an-head .tb-modeswitch { justify-content: center; }
.an-sub { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: none; }
.an-nav-active { color: var(--green) !important; font-weight: 700; }

/* Вкладки измерений */
/* Вкладки-сегменты в общей рамке (segmented control) */
.an-tabs {
  display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 0 auto 18px;
  padding: 5px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  flex-wrap: wrap; justify-content: center;
}
.an-tab {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 9px 18px; border-radius: 10px; border: 1.5px solid transparent;
  background: transparent; color: var(--muted); transition: all .15s;
}
.an-tab:hover { color: var(--green-dark); background: rgba(255,255,255,.65); }
.an-tab:focus-visible, .an-li:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 10px; }
.an-li:focus-visible { outline-offset: -1px; }
.an-tab--active {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px -6px var(--green-glow);
}

/* Раскладка: список слева + детальная панель справа.
   minmax(0,1fr) — чтобы длинные подписи внутри НЕ распирали колонку (иначе
   ширина блоков «прыгает» при выборе разных значений). */
/* Список выбора (регионы/товары/страны) — горизонтальная полоса СВЕРХУ,
   дашборд ниже на всю ширину. */
.an-layout { display: block; border-top: 1px solid var(--border); padding-top: 18px; }
.an-detail { min-width: 0; }

.an-list-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 16px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.an-list-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.an-list-title { font-weight: 700; font-size: 15px; }
.an-list-hint { font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }
.an-list-count { font-size: 12px; color: var(--muted); }
/* Быстрый поиск по списку — выделен, чтобы заметили */
.an-list-search { display: flex; align-items: center; gap: 9px; margin-left: auto; flex-wrap: wrap; }
.an-list-search-lbl { font-size: 12px; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.an-list-search-box { position: relative; display: inline-flex; align-items: center; }
.an-list-search-ic { position: absolute; left: 11px; font-size: 13px; pointer-events: none; opacity: .65; }
.an-list-filter {
  font: inherit; font-size: 13.5px; padding: 9px 14px 9px 32px; border: 1.5px solid var(--green-light);
  border-radius: 10px; width: 250px; max-width: 100%; background: #fff; color: var(--text);
  box-shadow: 0 1px 5px rgba(214, 45, 65,.14); transition: border-color .15s, box-shadow .15s;
}
.an-list-filter::placeholder { color: #94a3b8; }
.an-list-filter:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(214, 45, 65,.18); }
.an-list-wrap { position: relative; }
.an-list { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px; margin: 0 -2px; scroll-behavior: smooth; }
/* Стрелки прокрутки полосы выбора */
.an-list-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px -3px rgba(15,23,42,.28); transition: border-color .12s, color .12s, background .12s;
}
.an-list-arrow--l { left: -4px; }
.an-list-arrow--r { right: -4px; }
.an-list-arrow:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-mint); }
.an-list-arrow[hidden] { display: none; }

.an-li {
  flex: 0 0 320px; width: 320px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 11px; align-content: start;
  padding: 15px 17px; border-radius: 13px; cursor: pointer; border: 1px solid var(--border); background: #fff;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.an-li:hover { background: var(--green-mint); border-color: #cbd5e1; }
.an-li--active { background: var(--green-mint); border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.an-li-name {
  font-size: 14.5px; font-weight: 700; color: var(--text); min-width: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.3em * 3);
}
.an-li-turn { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: var(--green-dark); white-space: nowrap; }
.an-li-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-li-bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: #eef1f6; overflow: hidden; margin-top: 9px; }
.an-li-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); border-radius: 3px; }

/* Детальная панель */
.an-detail { min-height: 360px; }
.an-empty {
  background: #fff; border: 1px dashed var(--border); border-radius: 16px;
  padding: 80px 24px; text-align: center; color: var(--muted);
}
.an-empty-ic { font-size: 40px; margin-bottom: 12px; }
.an-empty-txt { font-size: 15px; max-width: 420px; margin: 0 auto; }

.an-detail-head { margin-bottom: 16px; }
.an-detail-headrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.an-detail-title { font-size: 20px; font-weight: 800; color: var(--text); }
.an-detail-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.an-detail-sub a { color: inherit; text-decoration: none; }
.an-detail-sub a:hover { text-decoration: underline; }
.an-search-link {
  flex: none; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  padding: 9px 16px; border-radius: 10px; border: 1.5px solid var(--green);
  background: #fff; color: var(--green-dark); transition: all .15s;
}
.an-search-link:hover { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; box-shadow: 0 6px 16px -8px var(--green-glow); }
@media (max-width: 560px) { .an-detail-headrow { flex-direction: column; align-items: stretch; } .an-search-link { width: 100%; } }

/* KPI-карточки */
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .an-kpis { grid-template-columns: 1fr 1fr; } }
.an-kpi {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
}
.an-kpi--accent { background: linear-gradient(135deg, var(--green), var(--green-dark)); border-color: transparent; }
.an-kpi--accent .an-kpi-val, .an-kpi--accent .an-kpi-lbl { color: #fff; }
.an-kpi-val { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.an-kpi-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Сетка виджетов */
.an-widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .an-widgets { grid-template-columns: minmax(0, 1fr); } }
.an-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  min-width: 0; overflow: hidden;
}
.an-card--wide { grid-column: 1 / -1; }
.an-card-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding-bottom: 11px; margin-bottom: 14px; border-bottom: 1px solid #eef1f5;
  display: flex; align-items: center; gap: 0; white-space: nowrap; overflow: hidden;
}
.an-card-title-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* ⓘ — пометка «оценочный разрез» (нативная подсказка по наведению/фокусу) */
.an-info {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 7px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; font-style: italic; line-height: 1; cursor: help;
}
.an-info:hover, .an-info:focus { border-color: var(--green); color: var(--green-dark); outline: none; }
.an-info--sm { width: 14px; height: 14px; margin-left: 5px; font-size: 9px; vertical-align: middle; }
.an-card-empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* Горизонтальные бар-строки (товары/страны/регионы/контрагенты) */
.an-bars { display: flex; flex-direction: column; gap: 10px; }
.an-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.an-bar-name { font-size: 13px; color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-val { font-size: 13px; font-weight: 700; color: var(--green-dark); justify-self: end; }
/* Фон-дорожка прозрачная — видна только цветная полоска доли (разной длины),
   а не одинаковая серая линия во всю ширину у каждой строки. */
.an-bar-track { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: transparent; overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--green-dark)); transition: width .5s; }

/* Помесячная динамика (SVG) — столбцы оборота + линия веса */
.an-msvg { width: 100%; height: auto; display: block; }
.an-msvg-year { font-size: 12px; font-weight: 700; fill: var(--muted); font-family: inherit; }
.an-msvg-ax { font-size: 10px; font-weight: 700; fill: #D62D41; font-family: inherit; }
.an-msvg-ax--t { fill: #d97706; }
.an-msvg-peak { font-size: 11px; font-weight: 800; fill: #A82030; font-family: inherit; }
.an-mhit { cursor: default; }
.an-mlegend { display: flex; gap: 20px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.an-mleg { display: flex; align-items: center; gap: 7px; }
.an-mleg-bar { width: 12px; height: 12px; border-radius: 3px; background: #D62D41; }
.an-mleg-bar--imp { background: #D62D41; }
.an-mleg-bar--exp { background: #10B981; }
.an-mleg-line { width: 16px; height: 0; border-top: 2.5px solid #DF5060; border-radius: 2px; }

/* Секции Импорт / Экспорт — тонированные карточки с заголовком-баннером */
.an-dir { margin-top: 18px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); }
.an-dir--imp { background: linear-gradient(180deg, #F0F6FF, #FBFCFE); border-color: #FAE3E5; }
.an-dir--exp { background: linear-gradient(180deg, #EFFBF6, #FBFEFC); border-color: #CFF3E2; }
.an-dir-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.an-dir-ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 5px 14px -7px rgba(15, 23, 42, .35);
}
.an-dir--imp .an-dir-ic { background: #FAE3E5; }
.an-dir--exp .an-dir-ic { background: #D1FAE5; }
.an-dir-headtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-dir-name { font-size: 15px; font-weight: 800; letter-spacing: .05em; }
.an-dir--imp .an-dir-name { color: #A82030; }
.an-dir--exp .an-dir-name { color: #047857; }
.an-dir-share { font-size: 12px; color: var(--muted); }
.an-dir-sum { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.an-dir .an-widgets { margin-bottom: 0; }

/* Годовая динамика — сгруппированные столбцы */
.an-yearly { display: flex; align-items: flex-end; justify-content: space-around; gap: 18px; height: 180px; padding-top: 8px; }
.an-yr { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; height: 100%; justify-content: flex-end; }
.an-yr-bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.an-yr-bar { width: 26px; border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.an-yr-bar--imp { background: linear-gradient(180deg, var(--green), var(--green-dark)); }
.an-yr-bar--exp { background: linear-gradient(180deg, #DF5060, #d97706); }
.an-yr-lbl { font-size: 12px; font-weight: 700; color: var(--text); }
.an-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.an-legend-item { display: flex; align-items: center; gap: 6px; }
.an-legend-dot { width: 11px; height: 11px; border-radius: 3px; }
.an-legend-dot--imp { background: var(--green); }
.an-legend-dot--exp { background: #DF5060; }

/* Компании — ранг (медали топ-3) + название + оборот + тонкий бар доли */
.an-co-list { display: flex; flex-direction: column; }
.an-co {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "rank name turn" "rank bar bar"; gap: 4px 11px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid #f3f4f6;
}
.an-co:last-child { border-bottom: none; }
.an-co--click { cursor: pointer; position: relative; padding-right: 22px; border-radius: 8px; transition: background .12s; }
.an-co--click:hover { background: var(--green-mint); }
.an-co-go { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--green); font-weight: 800; opacity: 0; transition: opacity .12s; }
.an-co--click:hover .an-co-go { opacity: 1; }
.an-co-rank { grid-area: rank; }
.an-co-name { grid-area: name; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.an-co-name-main { font-size: 13px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-co-sub { font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Сверх квоты — имя+реквизиты под «замком» (лимит открытых компаний исчерпан) */
.an-co--locked .an-co-name { filter: blur(4px); opacity: .55; user-select: none; }
.an-co--locked .an-co-go { display: none; }
.an-co-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-bottom: 10px; padding: 7px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.an-co--locked::after { content: "🔒"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .85; }
.an-co-turn { grid-area: turn; font-size: 13px; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.an-co-bar { grid-area: bar; height: 5px; border-radius: 3px; background: transparent; overflow: hidden; }

.an-footer { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.an-loading { padding: 60px; text-align: center; color: var(--muted); font-size: 14px; }

/* ─── Сводка над списком — единая stat-полоса ─── */
.an-summary {
  display: none;   /* скрыт по просьбе — KPI-сводка (регионов/оборот/в среднем) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  margin: -2px 0 18px; overflow: hidden;
}
@media (max-width: 620px) { .an-summary { grid-template-columns: 1fr; } }
.an-sum-cell {
  display: flex; align-items: center; gap: 13px; padding: 15px 20px;
  border-right: 1px solid var(--border); min-width: 0;
}
.an-sum-cell:last-child { border-right: none; }
@media (max-width: 620px) {
  .an-sum-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .an-sum-cell:last-child { border-bottom: none; }
}
.an-sum-ic {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--green-mint);
}
.an-sum-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.an-sum-val { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.an-sum-lbl { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Полировка: карточки, KPI, скелетоны, медали, крошка ─── */
.an-kpi { position: relative; overflow: hidden; }
.an-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; margin-bottom: 6px; }
.an-kpi-ic { font-size: 17px; opacity: .9; }
.an-kpi--accent .an-kpi-ic { filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.an-kpi-val { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.an-kpi-num { font-variant-numeric: tabular-nums; }

/* Хлебная крошка «← назад» */
.an-back {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: #fff; color: var(--green-dark); transition: all .15s;
}
.an-back:hover { background: var(--green-mint); border-color: var(--green); }

/* Скелетоны загрузки */
@keyframes an-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.an-sk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .an-sk-kpis { grid-template-columns: 1fr 1fr; } }
.an-sk-kpi, .an-sk-card, .an-sk-line, .an-sk-bar {
  background: #eef1f6; background-image: linear-gradient(90deg, #eef1f6 0, #f6f8fc 40px, #eef1f6 80px);
  background-size: 600px 100%; animation: an-shimmer 1.2s infinite linear; border-radius: 10px;
}
.an-sk-kpi { height: 84px; }
.an-sk-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; animation: none; }
.an-sk-line--t { height: 16px; width: 45%; margin-bottom: 16px; }
.an-sk-bars { display: flex; flex-direction: column; gap: 12px; }
.an-sk-bar { height: 16px; }
.an-sk-bar:nth-child(2) { width: 92%; } .an-sk-bar:nth-child(3) { width: 78%; }
.an-sk-bar:nth-child(4) { width: 64%; } .an-sk-bar:nth-child(5) { width: 50%; } .an-sk-bar:nth-child(6) { width: 38%; }

.an-bar-row[title] { cursor: default; }
.an-bar-row--drill[title] { cursor: pointer; }

/* Пагинация виджета: ‹ N–M из K › */
.an-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.an-pager-info { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 96px; text-align: center; }
.an-pager-btn {
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--green-dark);
  transition: background .12s, border-color .12s;
}
.an-pager-btn:hover:not(:disabled) { background: var(--green-mint); border-color: var(--green); }
.an-pager-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Тонкие брендовые скроллбары */
.an-list { scrollbar-width: thin; scrollbar-color: #cfd8e6 transparent; }
.an-list::-webkit-scrollbar { width: 8px; height: 8px; }
.an-list::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 4px; }
.an-list::-webkit-scrollbar-thumb:hover { background: #aab8cc; }
.an-list::-webkit-scrollbar-track { background: transparent; }

/* Плавное появление контента детали/обзора */
@keyframes an-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.an-detail-head, .an-kpis, .an-split, .an-widgets, .an-hero, .an-ov-hint, .an-ov-explain, .an-dir { animation: an-fade .32s ease both; }

/* ─── ОБЗОРНЫЙ дашборд (пустое состояние) ─── */
.an-hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px;
  background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff;
  border-radius: 20px; padding: 26px 28px; margin-bottom: 16px;
  box-shadow: 0 20px 44px -24px var(--green-glow);
}
@media (max-width: 760px) { .an-hero { grid-template-columns: 1fr; } }
.an-hero-tag { font-size: 13px; opacity: .9; font-weight: 600; }
.an-hero-big { font-size: 42px; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.an-hero-sub { font-size: 14px; opacity: .92; }
.an-hero-split { margin-top: 16px; max-width: 540px; }
.an-hero-split .an-split-bar { height: 14px; background: rgba(255,255,255,.22); }
.an-hero-split .an-split-imp { background: #fff; }
.an-hero-split .an-split-exp { background: #fbbf24; }
.an-hero-split .an-split-legend { color: rgba(255,255,255,.92); margin-top: 7px; }
.an-hero-r { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.an-mini { display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.14); border-radius: 12px; padding: 11px 15px; }
.an-mini-ic { font-size: 18px; }
.an-mini-val { font-size: 20px; font-weight: 800; }
.an-mini-lbl { font-size: 12px; opacity: .9; }

.an-ov-hint {
  font-size: 13px; color: var(--muted); background: #fff; border: 1px dashed var(--border);
  border-radius: 12px; padding: 11px 16px; margin-bottom: 12px;
}
.an-ov-hint b { color: var(--green-dark); }
.an-ov-explain {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--green-mint); border: 1px solid var(--green-light); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px;
}
.an-ov-explain-ic {
  width: 44px; height: 44px; border-radius: 12px; flex: none; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 4px 12px -6px var(--green-glow);
}
.an-ov-explain-txt { font-size: 14px; color: var(--text); line-height: 1.5; min-width: 0; }
.an-ov-explain-txt b { color: var(--green-dark); }
.an-ov-warn { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.an-lead { margin-bottom: 16px; }
.an-lead-list { display: flex; flex-direction: column; gap: 4px; }
.an-lead-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "rank name turn comp go" "bar bar bar bar bar";
  gap: 3px 12px; align-items: center; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.an-lead-row:hover { background: var(--green-mint); border-color: var(--green); }
.an-lead-row .an-li-rank { grid-area: rank; }
.an-lead-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.an-lead-flag { font-size: 16px; }
.an-lead-turn { grid-area: turn; font-weight: 800; color: var(--green-dark); font-size: 14px; white-space: nowrap; }
.an-lead-comp { grid-area: comp; font-size: 12px; color: var(--muted); white-space: nowrap; }
.an-lead-row .an-bar-go { grid-area: go; position: static; opacity: 0; }
.an-lead-row:hover .an-bar-go { opacity: 1; }
.an-lead-track { grid-area: bar; height: 6px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.an-lead-more { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 2px; }

/* ─── Ранг и доля в списке ─── */
.an-li {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "rank name" "turn turn" "sub sub" "bar bar";
}
.an-li-rank {
  grid-area: rank; align-self: center; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  color: var(--green-dark); background: var(--green-mint);
}
.an-li-name { grid-area: name; }
.an-li-turn { grid-area: turn; margin-top: 4px; }
.an-li-sub { grid-area: sub; }
.an-li-bar { grid-area: bar; }
.an-li--active .an-li-rank { background: var(--green); color: #fff; }
/* Медали топ-3 в списке — идут ПОСЛЕ базового .an-li-rank, чтобы реально
   переопределять его цвет/фон (та же специфичность у обоих селекторов,
   выигрывает порядок в файле). */
.an-li-rank--m1 { background: linear-gradient(135deg,#fde68a,#DF5060); color: #7c2d12; }
.an-li-rank--m2 { background: linear-gradient(135deg,#e5e7eb,#9ca3af); color: #1f2937; }
.an-li-rank--m3 { background: linear-gradient(135deg,#fed7aa,#d97706); color: #7c2d12; }
.an-li--active .an-li-rank--m1, .an-li--active .an-li-rank--m2, .an-li--active .an-li-rank--m3 { color: #fff; }
/* Флаг страны на месте номера (страны — без нумерации) */
.an-li-flag { grid-area: rank; align-self: center; font-size: 20px; line-height: 1; text-align: center; width: 26px; }

/* ─── KPI: рост г/г ─── */
.an-kpi-val { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.an-kpi-yoy { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.an-kpi-yoy small { font-weight: 600; opacity: .8; font-size: 10px; }
.an-kpi-yoy--up { color: #047857; background: #ecfdf5; }
.an-kpi-yoy--down { color: #b91c1c; background: #fef2f2; }
.an-kpi--accent .an-kpi-yoy { background: rgba(255,255,255,.22); color: #fff; }

/* ─── Полоса импорт/экспорт ─── */
.an-split { margin-bottom: 16px; }
.an-split-bar { display: flex; height: 12px; border-radius: 7px; overflow: hidden; background: #eef1f6; }
.an-split-imp { background: linear-gradient(90deg, var(--green), var(--green-dark)); }
.an-split-exp { background: linear-gradient(90deg, #DF5060, #d97706); }
.an-split-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ─── Бары: доля, drill-down, флаг контрагента ─── */
.an-bar-pct { font-size: 11px; color: var(--muted); font-weight: 600; }
.an-bar-fill { width: 0; }
.an-bar-row { grid-template-columns: 1fr auto; position: relative; }
.an-bar-row--drill { cursor: pointer; padding: 4px 28px 4px 6px; margin: -4px -6px; border-radius: 9px; transition: background .12s; }
.an-bar-row--drill:hover { background: var(--green-mint); }
.an-bar-go { position: absolute; right: 8px; top: 4px; color: var(--green); font-weight: 800; opacity: 0; transition: opacity .12s; }
.an-bar-row--drill:hover .an-bar-go { opacity: 1; }
.an-cp-flag {
  display: inline-block; font-size: 10px; font-weight: 800; color: var(--green-dark);
  background: var(--green-mint); border-radius: 5px; padding: 1px 5px; margin-right: 6px; vertical-align: middle;
}
.an-cp-flag--unknown { background: #f1f5f9; color: var(--muted); }
/* Настоящий флаг-эмодзи — без плашки, нормального размера (плашка осталась только
   для 2-буквенного фолбэка, когда флаг не отрисовался) */
.an-cp-flag--emoji { background: none; padding: 0; font-size: 15px; line-height: 1; }

/* ─── Годовая динамика: подписи значений ─── */
.an-yr-bars { align-items: flex-end; }
.an-yr-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.an-yr-cap { font-size: 10px; font-weight: 700; color: var(--muted); }
.an-yr-bar { transition: height .5s; }

/* ═══ Батч 1: чарты, инсайты, deep-link ═══ */
/* Концентрация */
.an-conc { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.an-conc b { color: var(--green-dark); }

/* Донат топ-5 + легенда */
.an-donut-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.an-donut { width: 120px; height: 120px; flex: none; }
.an-donut-c { font-size: 26px; font-weight: 800; fill: var(--text); text-anchor: middle; font-family: inherit; }
.an-donut-s { font-size: 11px; fill: var(--muted); text-anchor: middle; font-family: inherit; }
.an-dleg { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.an-dleg-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.an-dleg-dot { width: 10px; height: 10px; border-radius: 3px; }
.an-dleg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.an-dleg-pct { font-weight: 700; color: var(--green-dark); }

/* 100%-полоса композиции (страны/регионы) — вместо доната, не дублирует рейтинг */
.an-stack {
  display: flex; width: 100%; height: 80px; border-radius: 10px; overflow: hidden;
  margin-bottom: 14px; background: #eef1f5; box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
  gap: 1px;
}
.an-stack-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  min-width: 3px; transition: filter .12s; overflow: hidden; position: relative;
}
.an-stack-seg:first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
.an-stack-seg:last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
.an-stack-seg:hover { filter: brightness(1.07); }
.an-stack-lbl {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.35); padding: 0 5px; letter-spacing: .2px;
}
.an-stack-lbl .an-stack-fl { font-size: 13px; text-shadow: none; }

/* Treemap товаров */
.an-tmap-wrap { margin-bottom: 14px; }
.an-tmap { width: 100%; height: auto; display: block; border-radius: 4px; overflow: hidden; }
.an-tcell--drill { cursor: pointer; }
.an-tcell rect { transition: opacity .12s; }
.an-tcell--drill:hover rect { opacity: .85; }
.an-tcell-lbl { font-size: 14px; font-weight: 800; fill: #fff; font-family: inherit; pointer-events: none; }
.an-tcell-sub { font-size: 11px; font-weight: 600; fill: rgba(255,255,255,.88); font-family: inherit; pointer-events: none; }

/* Флаг страны в строке */
.an-row-flag { margin-right: 6px; font-size: 14px; }

/* Авто-инсайты */
.an-insights { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; }
.an-insight {
  font-size: 13px; color: var(--text); background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 13px;
}

/* Кнопки в шапке детали */
.an-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.an-copy-link {
  font: inherit; font-size: 15px; cursor: pointer; width: 38px; height: 38px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff; transition: all .15s;
}
.an-copy-link:hover { border-color: var(--green); background: var(--green-mint); }
@media (max-width: 560px) { .an-head-actions { width: 100%; } .an-head-actions .an-search-link { flex: 1; } }

/* Переключатель режима динамики */
.an-mtoggle { display: flex; width: fit-content; gap: 2px; padding: 3px; background: #eef2f8; border-radius: 10px; margin: 0 auto 12px; }
.an-mtoggle-btn {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted);
  padding: 6px 14px; border: none; border-radius: 8px; background: transparent; transition: all .12s;
  white-space: nowrap; flex-shrink: 0;
}
.an-mtoggle-btn:hover { color: var(--text); }
.an-mtoggle-btn--active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
@media (max-width: 640px) {
  .an-mtoggle { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .an-mtoggle::-webkit-scrollbar { display: none; }
  .an-mtoggle-btn { padding: 6px 12px; }
}

/* Карта-картограмма регионов */
.an-mapcard { margin-top: 16px; position: relative; }
/* Подсказка горизонтального скролла карты (мобайл): градиент + стрелка справа,
   видна только когда есть что листать (класс ставит JS). */
.an-map-fade { display: none; }
.an-mapcard--more .an-map-fade {
  display: block; position: absolute; right: 0; width: 46px; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 78%);
}
.an-mapcard--more .an-map-fade::after {
  content: '›'; position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 700; color: var(--muted);
}
.an-map-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 64px; gap: 6px;
}
@media (max-width: 720px) { .an-map-grid { grid-auto-rows: 52px; } }
/* Мобайл: карта не помещается в 8 колонок — даём горизонтальную прокрутку
   при читаемой минимальной ширине, чтобы значения в блоках не обрезались. */
.an-map-scroll { overflow-x: auto; }
@media (max-width: 680px) {
  .an-map-scroll { -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .an-map-grid { min-width: 560px; }
  .an-map-name { font-size: 11px; }
  .an-map-val { font-size: 10px; }
}
.an-map-tile {
  font: inherit; cursor: pointer; border: 1px solid rgba(255,255,255,.5); border-radius: 10px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  padding: 6px 10px; color: #1e3a8a; overflow: hidden; transition: transform .1s, box-shadow .1s, outline .1s;
  outline: 2px solid transparent; outline-offset: -2px;
}
.an-map-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(15,23,42,.4); z-index: 1; }
.an-map-tile--dark { color: #fff; }
.an-map-tile--active { outline-color: #DF5060; }
.an-map-name { font-size: 12px; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.an-map-val { font-size: 11px; font-weight: 600; opacity: .92; }
.an-map-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.an-map-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.an-map-scale { width: 90px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgb(250, 227, 229), rgb(168, 32, 48)); }
.an-map-ne {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted);
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 20px; background: #fff; transition: all .12s;
}
.an-map-ne:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-mint); }

/* Сравнение двух объектов (D2) */
.an-compare { background: #fff; border: 1px solid var(--green-light); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.an-compare-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.an-compare-title { font-size: 14px; font-weight: 700; color: var(--green-dark); }
.an-compare-sel { font: inherit; font-size: 13px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fafbff; flex: 1; min-width: 180px; }
.an-compare-close { margin-left: auto; font: inherit; font-size: 14px; cursor: pointer; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--muted); }
.an-compare-close:hover { border-color: var(--green); color: var(--green-dark); }
.an-compare-body { margin-top: 12px; }
.an-cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.an-cmp-table th:first-child, .an-cmp-table td:first-child { width: 38%; }
.an-cmp-table th:not(:first-child), .an-cmp-table td:not(:first-child) { width: 31%; }
.an-cmp-table td:not(:first-child), .an-cmp-table th:not(:first-child) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-cmp-table th { text-align: left; font-weight: 800; color: var(--text); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.an-cmp-table th:not(:first-child) { color: var(--green-dark); }
.an-cmp-table td { padding: 9px 10px; border-bottom: 1px solid #f3f4f6; }
.an-cmp-table td:first-child { color: var(--muted); }
.an-cmp-table td:not(:first-child) { font-weight: 700; color: var(--text); }
.an-cmp-delta { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 20px; }
.an-cmp-delta--up { color: #047857; background: #ecfdf5; }
.an-cmp-delta--down { color: #b91c1c; background: #fef2f2; }
/* Выпадашка кабинета в аналитике использует классы tb-account-* из app.css —
   1-в-1 как на главной. Своих стилей не держим. */

/* ═══════════════════════════════════════════════════════════════════════
   БРЕНД UZDATA — страница аналитики. Ранее жили в отдельном brand.css
   с оверлеем [data-brand="v2"]; сведено сюда напрямую.
   ═══════════════════════════════════════════════════════════════════════ */

.an-list-filter:focus { box-shadow: 0 0 0 2px rgba(214, 45, 65, 0.18) !important; }

.an-main { max-width: 1528px; }

/* ── Графики/виджеты: импорт→красный, экспорт→янтарь ── */

.an-mleg-bar--imp { background: #d62d41; }

.an-mleg-bar--exp { background: #df5060; }

/* Блоки импорт/экспорт: убираем синий/зелёный градиент и бордеры → серый */

.an-dir--imp,
.an-dir--exp { background: #f3f4f4 !important;
  border: none !important; }

.an-dir--imp .an-dir-ic { background: #fae3e5 !important; }

.an-dir--exp .an-dir-ic { background: #fae3e5 !important; }

.an-dir--exp .an-dir-name { color: #c22038 !important; }

/* Динамика: полоски экспорта янтарь */

.an-yr-bar--exp { background: linear-gradient(180deg, #df5060, #c22038); }

.an-legend-dot--exp { background: #df5060; }

.an-split-exp { background: linear-gradient(90deg, #df5060, #c22038); }

/* Динамика YoY и delta «вверх»: зелёный → красный */

.an-kpi-yoy--up,
.an-cmp-delta--up { color: #a82030 !important; background: #fae3e5 !important; }

/* Месячный бар-чарт: SVG-градиенты захардкожены в analytics.js.
   CSS stop-color переопределяет SVG presentation attributes (по спеке SVG/CSS).
   Оба стопа одного цвета = плоская заливка без градиента. */

#anImpG stop:first-child { stop-color: #d62d41; }

#anImpG stop:last-child { stop-color: #d62d41; }

#anExpG stop:first-child { stop-color: #df5060; }

#anExpG stop:last-child { stop-color: #df5060; }

#anVesG stop:first-child { stop-color: #f0a6af; }

#anVesG stop:last-child { stop-color: #f0a6af; }

/* Шкала карты: синий градиент → красный */

.an-map-scale { background: linear-gradient(90deg, #fbeaeb, #d62d41) !important; }

/* Карточки/блоки → радиус 16px (как Card_ у myorg), граница #eceef2 */

.an-card,
.an-kpi,
.an-summary { border-radius: 16px; }

/* Инпуты → белые, граница видимая, радиус 8px, текст #222 15px */

.an-list-filter { background: #fff !important; border: 1px solid #d4d6db !important; border-radius: 8px; color: #222; font-size: 15px; }

/* Табы/переключатели → радиус 8px, 15px */

.an-tab { border-radius: 8px; font-size: 15px; }

/* Бейджи/коды → радиус 8px */

.an-badge { border-radius: 8px; }

.an-kpi-val,
.an-li-turn,
.an-dir-sum,
.an-bar-val,
.an-co-turn,
.an-dleg-pct,
.an-bar-pct,
.an-list-search-lbl { color: #161414; }

.an-kpi--accent .an-kpi-val,
.an-kpi--accent .an-kpi-lbl { color: #fff; }

/* 3) Блоки БЕЗ бордеров (белые на сером, без обводки) */

.an-card,
.an-kpi,
.an-summary { border: none !important; }

/* 4) НЕТ синего — добиваем захардкоженные синие места */

.an-msvg-ax { fill: #6b6f73; }

.an-msvg-peak { fill: #a82030; }

.an-mleg-bar,
.an-mleg-bar--imp { background: #d62d41; }

/* 3. Все «заголовочные» классы не являющиеся h-тегами: 800 → 600 */

.an-title,
.an-detail-title,
.an-list-title,
.an-dir-name { font-weight: 600 !important;
  letter-spacing: -.015em; }

/* 4. Крупные числа — 800/900 → 700 (Inter хорошо читается) */

.an-kpi-val,
.an-li-turn,
.an-dir-sum,
.an-hero-big { font-weight: 700 !important;
  letter-spacing: -.02em; }

/* 5. Размеры заголовков по шкале myorg */

.an-title { font-size: 28px; }

.an-card-title { font-size: 16px; font-weight: 600; }

/* 7. Плотность: паддинг карточек, гэпы */

.an-card { padding: 16px; }

.an-kpis,
.an-grid { gap: 12px; }

.an-dir { padding: 0 !important; border: none !important; background: transparent !important; border-radius: 0 !important; }

.an-tcell-lbl { font-size: 10px !important; }

/* Карта-тайлмап аналитики: текст синий в base CSS → тёмный */

.an-map-name,
.an-map-val { color: #161414 !important; }

/* Тайлы карты — фон розовый вместо синего диапазона */

.an-map-tile { color: #161414 !important; }

/* Синие прогресс-бары и индикаторы */

.an-bar--imp,
.an-progress--imp,
.an-li-bar--imp { background: #d62d41 !important; }

.an-bar--exp,
.an-progress--exp,
.an-li-bar--exp { background: #df5060 !important; }

/* аналитика: весь .an-main — серая карточка (как .tb-section--demo на главной) */

.an-main { background: #f3f4f4;
  border-radius: 24px;
  /* 1464 = 1528 - 64: .tb-main на главной капается на 1528px, а
     .tb-section--demo внутри него ЕЩЁ отступает по 32px с каждой стороны —
     то есть предельная ширина серой карточки там 1464px, не 1528.
     max-width:1528 (без вычета) давал на широких экранах карточку аналитики
     шире карточки поиска. */
  max-width: 1464px !important;
  width: calc(100% - 64px) !important;  /* инсет 32px с каждой стороны — как padding у .tb-main на главной */
  margin: 40px auto !important;
  padding: 36px 40px;                   /* как .tb-section--demo на главной — одинаковый внутренний отступ */
  box-sizing: border-box; }

@media (max-width: 640px) {
/* Аналитика: убрать боковые отступы */
  .an-main { width: calc(100% - 28px) !important;  /* 14px с каждой стороны — как .tb-main на мобильном */
    margin: 12px auto !important;
    padding: 20px 16px;                /* как .tb-section--demo на главной (мобильный) */
    border-radius: 16px; }
/* Табы аналитики */
  .an-tab { font-size: 12px !important;
    padding: 7px 8px !important; }
}
