/* ==========================================================================
   SPOTREPORTER 22DX · v5 «ШКАЛА» — раздел «Аналитика»
   ----------------------------------------------------------------------------
   Страница живёт на тех же токенах и компонентах, что главная: ../styles.css
   даёт палитру, шапку, сегменты, кнопки, бейджи мод, панели и подвал. Здесь
   только то, чего на главной нет: сетка раздела, KPI-пульт, графики, радар,
   рейтинги, таблица приёмников и списки.

   Правила те же: без мягких теней и «карточек-плиток», линейки 1 px, моно-цифры,
   янтарный — только «живое» (сейчас, пик, сегодня), синий — данные.
   ========================================================================== */

/* ---------- 0. Каркас страницы ------------------------------------------- */
/* Главная — сетка на 100dvh с таблицей в центре. Аналитика — длинный документ,
   поэтому тело становится обычным потоком, шапка остаётся sticky из ../styles.css. */
body.an-page {
  display: block;
  height: auto;
  min-height: 100dvh;
  background: var(--bg);
}

.an {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--gap);
  width: 100%;
  margin: 0 auto;
  padding: var(--pad);
}

.an-span12 { grid-column: span 12; }
.an-span8 { grid-column: span 8; }
.an-span7 { grid-column: span 7; }
.an-span5 { grid-column: span 5; }
.an-span4 { grid-column: span 4; }
.an-tall { grid-row: span 2; }

/* G31: «Приёмники / Новые станции / Выводы» — один ряд.
   3 колонки на широком экране, 2 на 901–1365, 1 на ≤900. Внутри — свои панели. */
.an-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  min-width: 0;
}
.an-row3 > .panel { min-width: 0; }
@media (max-width: 1365px) {
  .an-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .an-row3 { grid-template-columns: minmax(0, 1fr); }
}

/* В узкой колонке ряда: таблица приёмников без бокового скролла (имя может
   переноситься на две строки), карточки новых станций — в одну колонку на всю
   ширину. На ≤900 ряд и так в одну колонку — там всё остаётся как было. */
@media (min-width: 901px) {
  .an-row3 #rcvTable { min-width: 0; }
  .an-row3 #rcvTable th,
  .an-row3 #rcvTable td { padding-left: 5px; padding-right: 5px; }
  .an-row3 #rcvTable th { font-size: 9px; }
  .an-row3 #rcvTable td {
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 10.5px;
  }
  .an-row3 #rcvTable td:first-child { white-space: normal; line-height: 1.2; }
  .an-row3 #rcvTable col.rcv-col-name { width: 18%; }
  .an-row3 #rcvTable col.rcv-col-share { width: 14%; }
  .an-row3 #rcvTable col.rcv-col-n { width: 10%; }
  .an-row3 #rcvTable col.rcv-col-snr { width: 11%; }
  .an-row3 #rcvTable col.rcv-col-km { width: 11%; }
  .an-row3 #rcvTable col.rcv-col-when { width: 14%; }
  .an-row3 #rcvTable .rcv-share { gap: 4px; }
  .an-row3 #rcvTable .rcv-share__track { width: 28px; }
  .an-row3 #panelNew .news { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* Карточка новой станции в узкой колонке — две строки с фиксированной сеткой:
     сверху позывной и страна, снизу мода/частота и когда·приёмник. Колонки не
     подстраиваются под каждую строку, поэтому данные не «пляшут». */
  .an-row3 #panelNew .news__row {
    grid-template-columns: 17px minmax(0, 1fr) auto;
    grid-template-areas:
      "flag id id"
      "flag meta when";
    align-items: center;
    height: auto;
    min-height: 44px;
    padding: 5px 2px;
    row-gap: 2px;
  }
  .an-row3 #panelNew .news__row > .flag { grid-area: flag; align-self: start; margin-top: 3px; }
  .an-row3 #panelNew .news__id { grid-area: id; }
  .an-row3 #panelNew .news__meta { grid-area: meta; }
  .an-row3 #panelNew .news__when {
    grid-area: when;
    justify-self: end;
    text-align: right;
  }
  .an-row3 #panelNew .news__when b { display: inline; margin-right: 4px; }
  .an-row3 #panelNew .news__when .news__src { display: inline; }
}

.an-card,
.an-bar { min-width: 0; }

.an-card .panel__body {
  gap: 7px;
  padding: 10px 12px 11px;
  min-width: 0;
}

/* вкладка-ссылка «Споты» в общей шапке: визуально та же кнопка сегмента */
.seg__btn--link { text-decoration: none; }

/* Своя подсказка графиков и теплокарты (вместо нативного title) */
.an-tip {
  position: fixed;
  z-index: 1200;
  max-width: 260px;
  padding: 6px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: 400 10.5px/1.35 var(--font-ui);
  pointer-events: none;
}
.an-tip[hidden] { display: none; }

/* ---------- 1. Пульт периода --------------------------------------------- */
.an-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px 10px;
  overflow: visible;
}
.an-bar__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 18px;
  min-width: 0;
}
.an-bar__id { min-width: 0; }
.an-title {
  margin: 0;
  font: 600 18px/1.1 var(--font-ui);
  letter-spacing: .005em;
  color: var(--ink);
}
.an-window {
  margin: 2px 0 0;
  font: 500 10.5px/1.3 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.an-bar__ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.an-refresh .ico { width: 13px; height: 13px; }
.an-refresh.is-busy { opacity: .72; cursor: progress; }
.an-refresh.is-busy .ico { animation: an-spin 900ms linear infinite; }
@keyframes an-spin { to { transform: rotate(360deg); } }
.an-upd {
  margin: 0;
  font: 500 10px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.an-upd b { color: var(--ink-2); font-weight: 600; }

/* сегмент периода: шесть кнопок, текст по содержимому (как в контракте §3.6) */
.seg--period { height: 30px; }
.seg--period .seg__btn { height: 22px; padding: 0 8px; font-size: 10.5px; }

/* ---------- 2. Ошибка загрузки ------------------------------------------- */
.an-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--warn);
  border-left-width: 3px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 11.5px;
}
.an-error b { color: var(--warn); font-weight: 600; }
.an-error__note { color: var(--ink-3); font-size: 10.5px; }
.an-error .btn { margin-left: auto; }

/* ---------- 3. KPI-пульт -------------------------------------------------- */
.kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-width: 0;
}
.kpi__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 2px 12px 3px;
  box-shadow: inset 1px 0 0 var(--rule);
}
.kpi__cell:first-child { box-shadow: none; padding-left: 0; }
.kpi__k {
  font: 500 9.5px/1.25 var(--font-ui);
  letter-spacing: .055em;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi__v {
  font: 600 23px/1.05 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
}
.kpi__v .u {
  margin-left: 3px;
  font: 400 11px/1 var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0;
}
.kpi__v .kpi__call {
  display: block;
  margin-top: 3px;
  font: 600 12px/1 var(--font-mono);
  color: var(--ink-2);
  letter-spacing: .01em;
}
.kpi__n {
  font: 400 10.5px/1.35 var(--font-ui);
  color: var(--ink-2);
  min-height: 14px;
}
.kpi__cell--live .kpi__v { color: var(--live); }
.kpi__cell--muted .kpi__v { color: var(--ink-3); }

/* ---------- 4. Общие мелочи блоков --------------------------------------- */
.an-sub {
  margin: 0 0 4px;
  font: 600 10px/1.2 var(--font-ui);
  letter-spacing: .07em;
  color: var(--ink-3);
}
.an-note,
.an-hint {
  margin: 0;
  font: 400 10.5px/1.45 var(--font-ui);
  color: var(--ink-2);
}
.an-note b,
.an-hint b { color: var(--ink); font-weight: 600; }
.an-hint {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 10px;
}
.an-note--tight { margin-top: -2px; }
.an-noscript { padding: 20px; color: var(--warn); }

/* ---------- 5. График активности (SVG, без библиотек) -------------------- */
.an-chart {
  position: relative;
  width: 100%;
  height: 248px;
  min-width: 0;
}
.an-chart svg { display: block; width: 100%; height: 100%; }
.an-chart .chart-tip {
  font: 500 10.5px/1.4 var(--font-mono);
  padding: 4px 8px;
}

.tbase { stroke: var(--rule-strong); }
.tgrid { stroke: var(--rule); stroke-dasharray: 1 3; }
.tbar {
  fill: var(--link);
  opacity: .55;
  transition: opacity 120ms ease;
}
.tbar--above { opacity: .74; }
.tbar--peak { opacity: .95; }
.tbar--now { fill: var(--live); opacity: .95; }
.tbar--zero { fill: var(--rule-strong); opacity: .6; }
.tbar:hover { opacity: 1; }
.tavg {
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 5 4;
  opacity: .8;
}
.tavg-l {
  font: 500 9.5px var(--font-ui);
  fill: var(--ink-3);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.tavg-bg {
  fill: var(--surface);
  opacity: .94;
}
.taxis {
  font: 400 9.5px var(--font-mono);
  font-variant-numeric: tabular-nums;
  fill: var(--ink-3);
}
.taxis--y { text-anchor: end; }
.tval {
  font: 600 10px var(--font-mono);
  font-variant-numeric: tabular-nums;
  fill: var(--ink-2);
  text-anchor: middle;
}
.tempty {
  font: 500 11px var(--font-ui);
  fill: var(--ink-3);
  text-anchor: middle;
}
.tpartial { opacity: .85; }

/* ---------- 6. Моды и регионы (горизонтальные полосы) -------------------- */
.bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bar {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 26px;
  padding: 0 2px;
  border-bottom: 1px solid var(--rule);
}
.bar:last-child { border-bottom: 0; }
.bar__k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 500 10.5px/1 var(--font-ui);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--bar, var(--ink-3));
}
.bar__track {
  position: relative;
  height: 9px;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.bar__fill {
  display: block;
  height: 100%;
  background: var(--bar, var(--link));
  opacity: .9;
}
.bar__v {
  font: 500 10.5px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: right;
  white-space: nowrap;
}
.bar__v i {
  font-style: normal;
  color: var(--ink-3);
  font-size: 9.5px;
  margin-left: 6px;
}
.bar.is-zero { opacity: .5; }
.bar.is-rival .bar__fill { opacity: 1; }

.bars--reg .bar { grid-template-columns: 42px minmax(0, 1fr) 112px; }
.bar__code {
  font: 600 11.5px/1 var(--font-mono);
  letter-spacing: .02em;
  color: var(--ink);
}
.bar__code small {
  display: block;
  margin-top: 2px;
  font: 400 9px/1 var(--font-ui);
  color: var(--ink-3);
  letter-spacing: 0;
}

/* ---------- 7. Теплокарта «когда людно» ---------------------------------- */
.heat { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.heat__grid {
  display: grid;
  gap: 2px;
  align-items: center;
  min-width: 0;
}
.heat__h {
  font: 400 9px/1.2 var(--font-mono);
  color: var(--ink-3);
  text-align: center;
  white-space: nowrap;
}
.heat__d {
  padding-right: 6px;
  font: 400 9.5px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}
.heat__d.is-today { color: var(--live); font-weight: 600; }
.heat__c {
  height: 13px;
  min-width: 0;
  background: var(--surface-2);
  border-radius: 1px;
}
.heat__c i {
  display: block;
  height: 100%;
  background: var(--link);
  border-radius: 1px;
}
.heat__c.is-now { outline: 1px solid var(--live); outline-offset: 0; }
.heat__c.is-now i { background: var(--live); }
.heat__c:hover { outline: 1px solid var(--ink-2); outline-offset: 0; }
.heat__scale {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 400 9.5px/1 var(--font-ui);
  color: var(--ink-3);
}
.heat__scale span { width: 12px; height: 7px; background: var(--link); border-radius: 1px; }
.heat__scale span:nth-child(1) { opacity: .12; }
.heat__scale span:nth-child(2) { opacity: .34; }
.heat__scale span:nth-child(3) { opacity: .6; }
.heat__scale span:nth-child(4) { opacity: .88; }
.heat__scale em { font-style: normal; margin-left: auto; }

/* ---------- 8. Качество сигнала ------------------------------------------ */
.qbar {
  display: flex;
  width: 100%;
  height: 16px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.qbar__seg { height: 100%; min-width: 0; }
.qbar__seg--poor { background: var(--warn); }
.qbar__seg--mid { background: var(--ink-3); }
.qbar__seg--good { background: var(--ok); }
.qlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qlist li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  height: 25px;
  border-bottom: 1px solid var(--rule);
  font: 400 10.5px/1 var(--font-ui);
  color: var(--ink-2);
}
.qlist li:last-child { border-bottom: 0; }
.qdot { width: 8px; height: 8px; border-radius: 2px; }
.qdot--poor { background: var(--warn); }
.qdot--mid { background: var(--ink-3); }
.qdot--good { background: var(--ok); }
.qlist .q-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist .q-v {
  font: 500 11px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.qlist .q-v i { font-style: normal; color: var(--ink-3); font-size: 9.5px; margin-left: 5px; }

/* ---------- 9. Радар ------------------------------------------------------ */
.an-radar__body {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: flex-start;
}
.radar {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
}
.radar svg { display: block; width: 100%; height: 100%; overflow: visible; }
.radar__ring { fill: none; stroke: var(--rule); stroke-width: 1; }
.radar__ring--outer { stroke: var(--rule-strong); }
.radar__spoke { stroke: var(--rule); stroke-width: 1; opacity: .75; }
.radar__label {
  font: 400 9.5px var(--font-mono);
  fill: var(--ink-3);
  text-anchor: middle;
}
.radar__card {
  font: 600 11px var(--font-ui);
  fill: var(--ink-2);
  text-anchor: middle;
}
.radar__ring-l {
  font: 500 9px var(--font-mono);
  fill: var(--ink-3);
  text-anchor: start;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.radar__pt { stroke: none; }
.radar__pt--good { fill: var(--ok); }
.radar__pt--mid { fill: var(--link); }
.radar__pt--poor { fill: var(--ink-3); }
/* --src-2 (архивный NSK) в ../styles.css не объявлен: задаём здесь как «нет
   данных», чтобы легенда и точки совпадали, а серый оставался только у слабого SNR. */
:root { --src-2: var(--src-other); }
.radar__pt--src3 { fill: var(--src-3); }
.radar__pt--src4 { fill: var(--src-4); }
.radar__pt--src5 { fill: var(--src-5); }
.radar__pt--src1 { fill: var(--src-1); }
.radar__pt--src2 { fill: var(--src-2); }
.radar__pt:hover { stroke: var(--ink); stroke-width: 1; }

/* фильтр радара по приёмнику */
.radar__src {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 7px;
}
.radar__src[hidden] { display: none; }
.radar__src-btn {
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 10px/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
}
.radar__src-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.radar__src-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.radar__max-line {
  stroke: var(--live);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: .85;
}
.radar__max {
  fill: none;
  stroke: var(--live);
  stroke-width: 2;
}
.radar__max-l {
  font: 600 11px var(--font-mono);
  fill: var(--live);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.radar__max-l small {
  font: 400 9px var(--font-mono);
  fill: var(--ink-2);
}
.radar__max-s {
  font: 400 9px var(--font-mono);
  fill: var(--ink-2);
  letter-spacing: 0;
}
.heat__c.is-missing { opacity: .5; }
.radar__empty {
  font: 500 11px var(--font-ui);
  fill: var(--ink-3);
  text-anchor: middle;
}
.radar__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding-top: 7px;
  border-top: 1px solid var(--rule);
  font: 400 10px/1.3 var(--font-ui);
  color: var(--ink-2);
}
.radar__legend .rl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.radar__legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}
.radar__legend .rl--good i { background: var(--ok); }
.radar__legend .rl--mid i { background: var(--link); }
.radar__legend .rl--poor i { background: var(--ink-3); }
.radar__legend .rl--max i { background: transparent; border: 1.5px solid var(--live); }
.radar__legend .rl--note { color: var(--ink-3); }

/* ---------- 10. ТОП-10 ---------------------------------------------------- */
.top2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  min-width: 0;
}
.top2.top2--single { grid-template-columns: 1fr; }
.top2__col[hidden] { display: none !important; }
.top2__col { min-width: 0; }
.rank {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.rank__row {
  display: grid;
  grid-template-columns: 15px 62px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 7px;
  height: 27px;
  min-width: 0;
  padding: 0 2px;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}
.rank__row:last-child { border-bottom: 0; }
.rank__row:hover { background: var(--surface-2); }
.rank__row:focus-visible { outline-offset: -2px; }
.rank__i {
  font: 400 9.5px/1 var(--font-mono);
  color: var(--ink-3);
  text-align: right;
}
.rank__row:nth-child(1) .rank__i { color: var(--live); font-weight: 600; }
.rank__call {
  font: 600 11.5px/1 var(--font-mono);
  letter-spacing: .01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank__track {
  position: relative;
  height: 6px;
  min-width: 0;
  background: var(--surface-2);
  border-radius: 1px;
  overflow: hidden;
}
.rank__track i {
  display: block;
  height: 100%;
  background: var(--link);
  opacity: .8;
}
.rank__row:nth-child(1) .rank__track i { background: var(--live); opacity: .9; }
.rank__n {
  font: 500 10.5px/1.15 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.rank__n i {
  display: block;
  font-style: normal;
  font-size: 9px;
  color: var(--ink-3);
}
.rank__empty {
  padding: 8px 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ---------- 11. Таблица приёмников --------------------------------------- */
.an-tablewrap {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.an-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.an-table col.rcv-col-name { width: 21%; }
.an-table col.rcv-col-share { width: 15%; }
.an-table col.rcv-col-n { width: 10%; }
.an-table col.rcv-col-snr { width: 11%; }
.an-table col.rcv-col-km { width: 11%; }
.an-table col.rcv-col-when { width: 14%; }
.an-table th {
  height: 26px;
  padding: 0 8px;
  background: transparent;
  border-bottom: 1px solid var(--rule-strong);
  font: 500 9.5px/1 var(--font-ui);
  letter-spacing: .02em;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
}
.an-table th:nth-child(n+2) { text-align: right; }
.an-table td {
  height: 34px;
  padding: 0 8px;
  border-bottom: 1px solid var(--rule);
  font: 400 11.5px/1.2 var(--font-mono);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.an-table tbody tr:last-child td { border-bottom: 0; }
.an-table td:nth-child(n+2) { text-align: right; }
.an-table tbody tr:hover td { background: var(--surface-2); }
.an-table .src-tag { max-width: 100%; }
.an-table .rcv-share {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.an-table .rcv-share__track {
  width: 46px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--surface-2);
  border-radius: 1px;
  overflow: hidden;
}
.an-table .rcv-share__track i { display: block; height: 100%; background: var(--link); }
.an-table .rcv-share__v { font-size: 10.5px; color: var(--ink); }
.an-table .is-muted { color: var(--ink-3); }
.an-table .is-warn { color: var(--warn); }
/* SNR приёмников — теми же цветами, что SNR на радаре и в блоке качества
   (A-04: шкала одна с таблицей спотов — ≥ −5 good, −17…−5 mid, < −17 poor). */
.an-table .rcv-snr--good { color: var(--ok); }
.an-table .rcv-snr--mid { color: var(--ink); }
.an-table .rcv-snr--poor { color: var(--warn); }
.an-table .rcv-note { font: 400 9.5px/1.2 var(--font-ui); color: var(--ink-3); }
.an-td-empty {
  padding: 12px 8px !important;
  text-align: left !important;
  font: 400 11px/1.4 var(--font-ui) !important;
  color: var(--ink-3) !important;
  white-space: normal !important;
}
.an-tablehint {
  display: none;
  margin: 0 0 2px;
  font: 400 9.5px/1.3 var(--font-ui);
  color: var(--ink-3);
}

/* Новые станции в аналитике — те же карточки, что на главной (.tile--new),
   только колонка одна: убираем двойные отступы и ограничиваем высоту списка.
   Карточка — ссылка на главную, поэтому гасим браузерное подчёркивание ссылок. */
.an-row3 #panelNew #newList.tiles { padding: 0; }
.an-row3 #panelNew #newList .tile {
  text-decoration: none;
  color: var(--ink);
}
.an-row3 #panelNew #newList .tile:hover { text-decoration: none; }
.an-row3 #panelNew #newList .tile__call { text-decoration: none; }
.an-row3 #panelNew #newList.is-long {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

/* ---------- 12. Новые станции ------------------------------------------- */
.news {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  min-width: 0;
}
.news__row {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 2px;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}
.news__row:hover { background: var(--surface-2); }
.news__row:focus-visible { outline-offset: -2px; }
.news__row .flag { margin: 0; }
.news__id {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.news__call {
  font: 600 12px/1 var(--font-mono);
  color: var(--ink);
  white-space: nowrap;
}
.news__country {
  font: 400 9.5px/1 var(--font-ui);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news__meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.news__freq {
  font: 500 10.5px/1 var(--font-mono);
  color: var(--ink-2);
}
.news__when {
  font: 400 9.5px/1.15 var(--font-mono);
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}
.news__when b {
  display: block;
  font-weight: 500;
  color: var(--ink-2);
  font-size: 10px;
}
.news__when .news__src { display: block; font-family: var(--font-ui); }
.news__empty {
  padding: 10px 2px;
  font: 400 11px/1.5 var(--font-ui);
  color: var(--ink-3);
}
.news__more {
  grid-column: 1 / -1;
  margin-top: 6px;
  font: 500 10.5px/1 var(--font-ui);
  color: var(--link);
}
.news.is-long {
  max-height: 408px; /* ровно 12 строк по 34 px — без обрезанной тринадцатой */
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
  padding-right: 4px;
}

/* ---------- 13. Выводы ---------------------------------------------------- */
.findings {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: finding;
}
.findings li {
  position: relative;
  padding: 7px 0 7px 26px;
  border-bottom: 1px solid var(--rule);
  font: 400 11.5px/1.5 var(--font-ui);
  color: var(--ink-2);
}
.findings li:last-child { border-bottom: 0; }
.findings li::before {
  counter-increment: finding;
  content: counter(finding, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 8px;
  font: 500 9.5px/1 var(--font-mono);
  color: var(--ink-3);
}
.findings b { color: var(--ink); font-weight: 600; }
.findings .fnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- 14. Адаптив --------------------------------------------------- */
@media (max-width: 1439px) {
  /* на узких ступенях сетка и так тянется на всю ширину */
  .an { max-width: none; }
}

@media (max-width: 1099px) {
  .an { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .an-span12,
  .an-span8,
  .an-span7,
  .an-span5 { grid-column: span 6; }
  .an-span4 { grid-column: span 3; }
  .an-tall { grid-row: auto; }
  .radar { max-width: 470px; }
}

@media (max-width: 900px) {
  .an-bar__top { align-items: flex-start; }
  .an-bar__ctrl { width: 100%; margin-left: 0; justify-content: space-between; }
  .seg--period { flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
  .seg--period::-webkit-scrollbar { display: none; }
  .an-refresh { margin-left: auto; }
}

@media (max-width: 760px) {
  .an { grid-template-columns: 1fr; }
  .an-span12,
  .an-span8,
  .an-span7,
  .an-span5,
  .an-span4 { grid-column: 1 / -1; }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi__cell:nth-child(odd) { box-shadow: none; padding-left: 0; }
  .kpi__cell:nth-child(2n) { padding-left: 10px; }
  .kpi__cell:nth-child(3),
  .kpi__cell:nth-child(4) { padding-top: 8px; border-top: 1px solid var(--rule); margin-top: 6px; }
  .kpi__cell:nth-child(5) {
    grid-column: 1 / -1;
    padding: 8px 0 2px;
    margin-top: 6px;
    border-top: 1px solid var(--rule);
    box-shadow: none;
  }
  /* заголовок панели не должен резаться: метрика переносится под него */
  .an-card .panel__head {
    flex-wrap: wrap;
    align-content: center;
    height: auto;
    min-height: 34px;
    padding: 4px 10px 5px;
    row-gap: 2px;
  }
  .an-card .panel__head .panel__title { flex: 0 0 auto; max-width: 100%; }
  .an-card .panel__head .panel__meta { flex: 0 0 auto; }
  .an-card .panel__head .panel__meta::before { content: none; }
  .an-tablehint { display: block; }
  .an-chart { height: 224px; }
  .top2 { grid-template-columns: 1fr; gap: 4px; }
  .news { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 66px minmax(0, 1fr) 86px; }
  .bars--reg .bar { grid-template-columns: 38px minmax(0, 1fr) 112px; }
  .an-table { min-width: 560px; }
  .an-window { white-space: normal; }
}

@media (max-width: 480px) {
  .an { padding: 6px; gap: 6px; }
  .an-card .panel__body { padding: 8px 9px 9px; }
  .an-bar { padding: 8px 9px 9px; }
  .an-title { font-size: 16px; }
  .seg--period .seg__btn { padding: 0 6px; font-size: 10px; }
  .an-refresh span { display: none; }
  .an-refresh { width: 32px; padding: 0; }
  .kpi__v { font-size: 20px; }
  .an-chart { height: 200px; }
  .news__country { display: none; }
  .news__when .news__src { display: none; }
  .rank__row { grid-template-columns: 14px 58px minmax(0, 1fr) 44px; gap: 5px; }
  .radar__legend { gap: 3px 10px; font-size: 9.5px; }
}

/* тёмной теме отдельные правила не нужны: всё на токенах.
   Ниже — только то, что должно быть чуть контрастнее на ночном корпусе. */
html[data-theme="night"] .heat__c { background: var(--surface-2); }
html[data-theme="night"] .abbr,
html[data-theme="night"] .an-hint { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .an-refresh.is-busy .ico { animation: none; }
  .seg__thumb { transition: none; }
  .tbar,
  .chart-tip { transition: none; }
}
