/* RadNews Article Map v1.0.0 — «Карта статьи».
   Токены RadNews Tech (--rn-*); светлая тема html.rn-light; reduced-motion; печать — скрыта. */

.rn-amap {
  --am-bg: var(--rn-panel, #141a20);
  --am-line: var(--rn-line, #232d38);
  --am-ink: var(--rn-ink, #d6dde6);
  --am-dim: #8b98a5;
  --am-amber: var(--rn-amber, #ffb000);
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 254px;
  max-height: min(64vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--am-bg);
  border: 1px solid var(--am-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 900;
  font-size: 12.5px;
  font-family: inherit;
  overflow: hidden;
}
html.rn-light .rn-amap {
  --am-bg: #f4f6f8;
  --am-line: #d9e0e6;
  --am-ink: #1c2733;
  --am-dim: #5d6a77;
  box-shadow: 0 10px 26px rgba(20, 30, 40, 0.18);
}
.rn-amap[hidden] { display: none; }

.rn-amap__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--am-line);
  flex: 0 0 auto;
}
.rn-amap.is-collapsed .rn-amap__head { border-bottom: none; }
.rn-amap__kicker {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--am-amber);
  font-weight: 700;
  white-space: nowrap;
}
.rn-amap__count {
  margin-left: auto;
  color: var(--am-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rn-amap__toggle {
  border: 1px solid var(--am-line);
  background: transparent;
  color: var(--am-dim);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.rn-amap__toggle:hover { color: var(--am-ink); border-color: var(--am-dim); }

.rn-amap__list {
  list-style: none;
  margin: 6px 0;
  padding: 0 6px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  counter-reset: amap;
}
.rn-amap__item { counter-increment: amap; }
.rn-amap__item a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  border-radius: 6px;
  color: var(--am-dim);
  text-decoration: none;
  line-height: 1.35;
}
.rn-amap__item a:hover { color: var(--am-ink); background: rgba(128, 148, 168, 0.08); }
.rn-amap__item.is-passed a { color: var(--am-dim); opacity: 0.72; }
.rn-amap__item.is-active a {
  color: var(--am-ink);
  border-left-color: var(--am-amber);
  background: rgba(255, 176, 0, 0.07);
  font-weight: 600;
}
.rn-amap__num {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--am-dim);
}
.rn-amap__item.is-active .rn-amap__num { color: var(--am-amber); }
.rn-amap__text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* узкий экран: кнопка + лист */
.rn-amap-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  border: 1px solid var(--am-line);
  background: var(--am-bg, #141a20);
  color: var(--am-ink, #d6dde6);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: inherit;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
html.rn-light .rn-amap-fab { background: #f4f6f8; color: #1c2733; border-color: #d9e0e6; }
.rn-amap-fab[hidden] { display: none; }

.rn-amap.is-sheet {
  right: 12px;
  left: 12px;
  top: auto;
  bottom: 74px;
  transform: none;
  width: auto;
  max-height: 56vh;
  border-radius: 14px;
}

/* заголовки, к которым ведут клики, не липнут к верхней кромке */
.post-content h2 { scroll-margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  .rn-amap, .rn-amap-fab { transition: none; }
}
@media print {
  .rn-amap, .rn-amap-fab { display: none !important; }
}
