/* FL-177 — FactsLane Atlas (страница /atlas). Всё под .atlas-page / #atlas-root.
   Токены: дизайн-система (colors_and_type.css) — цвета групп `--fl-atlas-*` («только для атласа»),
   шкала турбулентности `--fl-turbulence-*`, шрифт `--fl-font-system`, подписи `--fl-label-sm-*`.
   Сцена читает их через getComputedStyle (app/javascript/immersive/atlas/tokens.js) — хардкода цветов в JS нет. */
:root {
  --fl-atlas-pol: #FF6B5A;   /* politics, security */
  --fl-atlas-soc: #F5B544;   /* society, entertainment */
  --fl-atlas-biz: #4FC3F7;   /* business, technology */
  --fl-atlas-sci: #5EE0A0;   /* science, health, climate */
  --fl-atlas-spo: #B48CFF;   /* sports */

  --fl-turbulence-calm: #3AA862;       /* 0–39  */
  --fl-turbulence-mild: #A8B82A;       /* 40–54 */
  --fl-turbulence-elevated: #D9A22A;   /* 55–64 */
  --fl-turbulence-high: #E8830A;       /* 65–71 */
  --fl-turbulence-extreme: #D03A2A;    /* 72–100 */

  --fl-font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Roboto, system-ui, sans-serif;
  --fl-label-sm-size: 11px; --fl-label-sm-lh: 16px; --fl-label-sm-weight: 500; --fl-label-sm-tracking: 0.5px;
}

.atlas-page {
  --a-void: #05070b;
  --a-ink: #eef2f7;
  --a-ink-2: #a7b1c0;
  --a-ink-3: #6c7787;
  --a-glass: rgba(19, 23, 31, .62);
  --a-line: rgba(255, 255, 255, .09);
  --a-brand: #E8830A;
  --a-weather: var(--fl-turbulence-calm);
  --a-label-on-dark: rgba(229, 231, 235, .55);
  --a-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--a-void);
  color: var(--a-ink);
  font-family: var(--fl-font-system);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
html:has(.atlas-page) { background: var(--a-void); }

#atlas-root { position: fixed; inset: 0; overflow: hidden; background: var(--a-void); }
#atlas-root canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#atlas-root button { font-family: inherit; }
#atlas-root .glass { background: var(--a-glass); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--a-line); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); }
#atlas-root .sr-only-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* HUD */
#atlas-hud .hud { position: fixed; z-index: 5; pointer-events: none; }
#atlas-hud .hud > * { pointer-events: auto; }
#atlas-top { top: calc(16px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.a-brand { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; }
.a-brand a.a-lockup { display: flex; align-items: center; gap: 8px; text-decoration: none; border-radius: 10px; }
.a-lockup img { height: 32px; width: 32px; display: block; border-radius: 8px; }
.a-lockup .a-wm { font-weight: 700; font-size: 16px; line-height: 24px; letter-spacing: -0.025em; color: #fcfcfd; text-transform: none; }
.a-brand > span b { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; color: var(--a-ink); } /* «Atlas» заметнее дат */
.a-brand > span { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); color: var(--a-label-on-dark); text-transform: uppercase; padding-left: 12px; border-left: 1px solid var(--a-line); }
.a-top-right { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.a-modes { display: flex; padding: 4px; gap: 2px; border-radius: 999px; }
.a-modes button { all: unset; cursor: pointer; padding: 11px 16px; min-height: 22px; border-radius: 999px; font-size: 13px; font-weight: 550; color: var(--a-ink-2); transition: background .3s, color .3s; }
.a-modes button[aria-pressed="true"] { background: rgba(255,255,255,.12); color: var(--a-ink); }
.a-icon-group { display: flex; padding: 4px; gap: 2px; border-radius: 999px; }
.a-icon-btn { all: unset; cursor: pointer; box-sizing: border-box; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; color: var(--a-ink-2); font-size: 13px; font-weight: 600; padding: 0 12px; text-decoration: none; transition: background .2s, color .2s; }
.a-icon-btn:hover { background: rgba(255,255,255,.1); color: var(--a-ink); }
.a-icon-btn[aria-pressed="true"] { background: rgba(232,131,10,.22); color: #ffd2a1; }
.a-icon-btn svg { flex: none; }
#atlas-root :is(button, a, input):focus-visible { outline: 2px solid var(--a-brand); outline-offset: 2px; }

/* виджет турбулентности + ползунок времени */
#atlas-weather { left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100vw - 32px)); padding: 14px 16px 10px; }
.a-w-eyebrow { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); display: flex; justify-content: space-between; gap: 8px; }
.a-w-row { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.a-w-num { font-size: 40px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; transition: color .4s; }
.a-w-label { font-size: 15px; font-weight: 600; }
.a-w-scale { position: relative; height: 6px; border-radius: 3px; margin: 12px 0 4px; background: linear-gradient(90deg, var(--fl-turbulence-calm) 0%, var(--fl-turbulence-calm) 30%, var(--fl-turbulence-mild) 47%, var(--fl-turbulence-elevated) 60%, var(--fl-turbulence-high) 68%, var(--fl-turbulence-extreme) 78%, var(--fl-turbulence-extreme) 100%); }
.a-w-knob { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--a-ink); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(5,7,11,.7), 0 0 16px rgba(255,255,255,.5); pointer-events: none; }
.a-w-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--a-ink-3); font-variant-numeric: tabular-nums; }
#atlas-weather[hidden] { display: none; }
.a-time { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--a-line); }
.a-time-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a-time-head label { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); display: inline-flex; align-items: center; gap: 6px; }
.a-time-val { font-size: 12.5px; color: var(--a-ink-2); font-variant-numeric: tabular-nums; }
.a-time-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.a-time-row input[type="range"] { flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; accent-color: var(--a-brand); cursor: pointer; }
.a-time-row input[type="range"][aria-disabled="true"] { opacity: .45; }
.a-time-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--a-ink-3); font-variant-numeric: tabular-nums; margin: -6px 44px 0 8px; pointer-events: none; }
.a-time-lock { all: unset; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--a-ink-2); }
.a-time-lock:hover { background: rgba(255,255,255,.08); color: var(--a-ink); }
.a-play { all: unset; cursor: pointer; box-sizing: border-box; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: rgba(255,255,255,.07); color: var(--a-ink-2); }
.a-play:hover { background: rgba(255,255,255,.13); color: var(--a-ink); }
.a-play[aria-pressed="true"] { background: rgba(232,131,10,.22); color: #ffd2a1; }
.a-empty-day { position: fixed; z-index: 5; left: 50%; top: 46%; transform: translate(-50%, -50%); padding: 10px 16px; font-size: 13px; color: var(--a-ink-2); pointer-events: none; }
.a-empty-day[hidden] { display: none; }

/* легенда */
#atlas-legend { transition: opacity .4s; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.a-chip { all: unset; cursor: pointer; box-sizing: border-box; min-height: 32px; display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; color: var(--a-ink-2); transition: opacity .3s, background .2s; }
.a-chip:hover { background: rgba(255,255,255,.06); }
.a-chip i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 10px currentColor; flex: none; }
.a-chip em { font-style: normal; margin-left: auto; padding-left: 14px; color: var(--a-ink-3); font-variant-numeric: tabular-nums; }
.a-chip.off { opacity: .35; }
.a-chip.mine { border: 1px solid var(--a-line); margin-bottom: 4px; }
.a-chip.mine[aria-pressed="true"] { background: rgba(232,131,10,.22); color: #ffd2a1; }
.a-chip.mine svg { flex: none; }
.a-legend-sep { height: 1px; background: var(--a-line); margin: 2px 6px; }
body.atlas-reading #atlas-legend { opacity: 0; pointer-events: none; }
#atlas-hint { left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); font-size: 12px; color: var(--a-ink-3); white-space: nowrap; pointer-events: none; transition: opacity .6s; }

/* всплывашки: тултип, плашка «+N», приглашения */
#atlas-tip { position: fixed; z-index: 6; pointer-events: none; padding: 9px 12px; max-width: 280px; font-size: 13px; line-height: 1.35; border-radius: 12px; opacity: 0; transform: translate(14px, -50%); transition: opacity .15s; }
#atlas-tip small { display: block; color: var(--a-ink-3); font-size: 11px; margin-top: 3px; }
.a-toasts { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); top: calc(76px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.a-plate { pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; font-size: 13px; color: var(--a-ink); border-radius: 999px; }
.a-plate .a-plate-text { padding: 8px 6px 8px 0; line-height: 1.3; }
.a-plate .a-plate-act { all: unset; cursor: pointer; box-sizing: border-box; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: rgba(232,131,10,.24); color: #ffd2a1; font-weight: 600; text-decoration: none; }
.a-plate .a-plate-act:hover { background: rgba(232,131,10,.36); }
.a-plate .a-plate-x { all: unset; cursor: pointer; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--a-ink-3); }
.a-plate .a-plate-x:hover { background: rgba(255,255,255,.08); color: var(--a-ink); }
.a-glabel { position: fixed; z-index: 4; pointer-events: none; font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; font-weight: var(--fl-label-sm-weight); transform: translate(-50%, -50%); text-shadow: 0 0 18px rgba(0,0,0,.9); white-space: nowrap; opacity: 0; }

/* панель слоёв */
#atlas-drawer { position: fixed; z-index: 7; top: calc(var(--atlas-top-bottom, 76px) + 10px); /* под верхней панелью: меню не перекрывается */ bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: min(400px, calc(100vw - 32px)); perspective: 1400px; pointer-events: none; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: none; }
#atlas-drawer::-webkit-scrollbar { display: none; }
#atlas-drawer.open { pointer-events: auto; }
#atlas-drawer .layer { position: relative; padding: 16px 18px; transform-origin: 100% 50%; opacity: 0; transform: translateZ(-260px) rotateY(-18deg) translateX(40px); transition: transform .7s cubic-bezier(.2,.9,.25,1.15), opacity .5s; flex: none; }
#atlas-drawer.open .layer { opacity: 1; transform: none; }
.layer .k { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.layer .k b { font-family: var(--a-mono); font-weight: 500; color: var(--a-ink-2); }
.layer h2 { margin: 0; padding-right: 36px; font-size: 21px; line-height: 1.22; font-weight: 650; text-wrap: balance; }
.layer .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--a-ink-2); }
.layer .cat { display: inline-flex; align-items: center; gap: 6px; }
.layer .cat i { width: 7px; height: 7px; border-radius: 50%; }
.layer .yours { color: #ffd2a1; }
.layer p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--a-ink-2); }
.layer .actors { display: flex; flex-wrap: wrap; gap: 6px; }
.layer .actors span { font-size: 12.5px; padding: 5px 9px; border-radius: 8px; background: rgba(255,255,255,.07); border: 1px solid var(--a-line); }
.layer .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.layer .stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.layer .stats b { font-size: 22px; font-weight: 350; font-variant-numeric: tabular-nums; }
.layer .stats span { font-size: 11px; color: var(--a-ink-3); overflow-wrap: anywhere; }
.layer .bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.layer .bar i { display: block; height: 100%; background: var(--a-brand); border-radius: 2px; }
.layer .verdict { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--a-line); font-size: 13px; color: var(--a-ink-2); line-height: 1.45; }
.layer .verdict strong { color: var(--a-ink); font-weight: 600; }
.layer .verdict .muted { color: var(--a-ink-3); font-size: 12px; }
.layer .details { margin-top: 10px; display: grid; gap: 10px; font-size: 12.5px; color: var(--a-ink-2); line-height: 1.45; }
.layer .details h3 { margin: 0 0 4px; font-size: var(--fl-label-sm-size); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); }
.layer .details ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.layer .details a { color: #ffbf7a; }
.layer .linkish { all: unset; cursor: pointer; margin-top: 8px; font-size: 12.5px; color: #ffbf7a; min-height: 32px; display: inline-flex; align-items: center; }
.layer .linkish:hover { text-decoration: underline; }
.layer .rel { all: unset; cursor: pointer; display: block; box-sizing: border-box; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; font-size: 13px; line-height: 1.35; color: var(--a-ink-2); width: calc(100% + 20px); }
.layer .rel:hover { background: rgba(255,255,255,.06); color: var(--a-ink); }
.layer .rel small { display: block; color: var(--a-ink-3); font-size: 11px; margin-top: 2px; }
.layer .close { position: absolute; top: 10px; right: 10px; }
.layer .foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.layer .foot a { color: #ffbf7a; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.layer .foot a:hover { text-decoration: underline; }
.layer .foot span { font-size: 11px; color: var(--a-ink-3); }
.layer .a-slot:empty { display: none; }
.a-close { all: unset; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--a-ink-2); background: rgba(255,255,255,.07); }
.a-close:hover { background: rgba(255,255,255,.13); color: var(--a-ink); }
.layer .close.a-close { width: 36px; height: 36px; top: 8px; right: 8px; }

/* подкасты: «Слушать» в панели, тур «Слушать неделю», меню шоу */
.a-listen-k { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); font-weight: var(--fl-label-sm-weight); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); }
.a-listen { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--a-line); }
.a-listen-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.a-listen-btn { all: unset; cursor: pointer; box-sizing: border-box; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 999px; background: rgba(232,131,10,.24); color: #ffd2a1; font-size: 13px; font-weight: 600; }
.a-listen-btn:hover { background: rgba(232,131,10,.36); }
.a-listen-meta { font-size: 12.5px; color: var(--a-ink-2); }
.a-tour-menu { position: fixed; z-index: 9; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(76px + env(safe-area-inset-top, 0px)); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 200px; max-width: calc(100vw - 32px); }
.a-tour-menu[hidden], .a-tourbar[hidden] { display: none; }
.a-tour-menu button { all: unset; cursor: pointer; box-sizing: border-box; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; color: var(--a-ink-2); }
.a-tour-menu button:hover, .a-tour-menu button:focus-visible { background: rgba(255,255,255,.08); color: var(--a-ink); }
.a-tourbar { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(52px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100vw - 32px)); padding: 8px 8px 8px 8px; display: flex; align-items: center; gap: 10px; border-radius: 999px; }
body.atlas-reading .a-tourbar { opacity: 0; pointer-events: none; }
/* тур сам открывает карточки: на широком экране плашка остаётся (пауза/стоп), по центру свободного места слева от панели */
@media (min-width: 1000px) {
  body.atlas-reading.atlas-touring .a-tourbar { opacity: 1; pointer-events: auto; left: calc((100vw - 432px) / 2); width: min(560px, calc(100vw - 480px)); }
}
.a-tour-btn { all: unset; cursor: pointer; flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--a-ink-2); }
.a-tour-btn:hover { background: rgba(255,255,255,.14); color: var(--a-ink); }
.a-tour-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.a-tour-text small { font-size: var(--fl-label-sm-size); line-height: var(--fl-label-sm-lh); letter-spacing: var(--fl-label-sm-tracking); text-transform: uppercase; color: var(--a-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-tour-text strong { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.a-tour-link { flex: none; color: #ffbf7a; font-size: 12px; text-decoration: none; white-space: nowrap; padding: 0 4px; }
.a-tour-link:hover { text-decoration: underline; }
.a-tour-back { all: unset; cursor: pointer; flex: none; box-sizing: border-box; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: rgba(232,131,10,.24); color: #ffd2a1; font-size: 12.5px; font-weight: 600; }
.a-tour-back[hidden] { display: none; }
.a-tour-back:hover { background: rgba(232,131,10,.36); }

/* загрузка и ошибки */
#atlas-loading { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; align-content: center; gap: 16px; background: var(--a-void); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--a-ink-3); transition: opacity 1.2s; margin: 0; }
#atlas-loading.done { opacity: 0; pointer-events: none; }
/* Вход «из темноты» (FL-177): подпись загрузки появляется, только если ждать дольше полсекунды; глобус
   проявляется из размытия, интерфейс — следом. Опасность — не скрыть HUD навсегда: класс .atlas-ready
   ставит main.js и при успехе, и при сбое. */
#atlas-loading span { animation: a-loading-in .8s ease .5s both; }
@keyframes a-loading-in { from { opacity: 0; } to { opacity: 1; } }
#atlas-canvas { transition: opacity 1.8s ease, filter 2.2s ease, scale 2.6s cubic-bezier(.2,.7,.2,1); }
body:not(.atlas-ready) #atlas-canvas { opacity: 0; filter: blur(14px); scale: 1.06; }
/* HUD — animation с fill: backwards (не transition): после появления стили отпускаются и не мешают
   собственным переходам панелей (режим чтения прячет легенду и индекс). */
body:not(.atlas-ready) #atlas-top, body:not(.atlas-ready) #atlas-weather, body:not(.atlas-ready) #atlas-legend { opacity: 0; }
body.atlas-ready #atlas-top { animation: a-hud-down .9s cubic-bezier(.2,.7,.2,1) 1.1s backwards; }
body.atlas-ready #atlas-weather, body.atlas-ready #atlas-legend { animation: a-hud-up .9s cubic-bezier(.2,.7,.2,1) 1.25s backwards; }
@keyframes a-hud-down { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }
@keyframes a-hud-up { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
#atlas-loading .a-retry { all: unset; cursor: pointer; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--a-ink); letter-spacing: 0; text-transform: none; font-size: 14px; }

/* ARIA-зеркало: в WebGL-режиме скрыто, без WebGL — видимый список */
#atlas-mirror.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Клавиатура: зеркало скрыто, но пункт в фокусе виден плашкой внизу по центру (WCAG 2.4.7) */
#atlas-mirror.sr-only:focus-within { clip: auto; clip-path: none; width: auto; height: auto; margin: 0; overflow: visible; white-space: normal; position: fixed; z-index: 8; left: 50%; translate: -50% 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); max-width: min(520px, calc(100vw - 32px)); padding: 6px; border-radius: 16px; background: rgba(12,16,24,.82); backdrop-filter: blur(14px); border: 1px solid var(--a-line); }
#atlas-mirror.sr-only:focus-within h1, #atlas-mirror.sr-only:focus-within #atlas-fallback-note { display: none; }
#atlas-mirror.sr-only:focus-within ol { margin: 0; }
#atlas-mirror.sr-only:focus-within li:not(:focus-within), #atlas-mirror.sr-only:focus-within p:not(:focus-within) { display: none; }
#atlas-mirror.visible { position: absolute; inset: 0; z-index: 9; overflow-y: auto; padding: 72px max(16px, env(safe-area-inset-left, 0px)) 32px; background: var(--a-void); }
#atlas-mirror.visible .a-mirror-inner { max-width: 720px; margin: 0 auto; }
#atlas-mirror h1 { font-size: 20px; margin: 0 0 8px; }
#atlas-mirror ol { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 4px; }
#atlas-mirror li a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--a-ink); text-decoration: none; }
#atlas-mirror li a:hover { background: rgba(255,255,255,.06); }
#atlas-mirror li small { display: block; color: var(--a-ink-3); }
#atlas-mirror .a-mirror-more { color: #ffbf7a; }

/* средняя ширина: верхнее меню в один ряд — кнопки аудио и VR без подписей (aria-label/title остаются) */
@media (max-width: 1480px) {
  .a-listen-top span, #atlas-digest span, #atlas-vr span { display: none; }
}
@media (max-width: 1000px) {
  .a-range-dates { display: none; }
}
@media (max-width: 720px) {
  #atlas-legend { top: calc(var(--atlas-top-bottom, 60px) + 8px); bottom: auto; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 999px; }
  #atlas-legend .a-chip { flex: none; white-space: nowrap; }
  #atlas-legend .a-chip em, .a-legend-sep { display: none; }
  #atlas-legend .a-chip.mine { margin: 0; }
  #atlas-hint { display: none; }
  .a-toasts { top: calc(var(--atlas-top-bottom, 60px) + 64px); }
  .a-tour-menu { top: calc(var(--atlas-top-bottom, 60px) + 64px); }
  .a-tourbar { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); border-radius: 22px; flex-wrap: wrap; }
  .a-tour-link { display: none; }
  .a-listen-top span, #atlas-digest span { display: none; }
  #atlas-top { gap: 8px; }
  /* два ряда: логотип + иконки, под ними переключатель режимов */
  .a-top-right { display: contents; }
  .a-icon-group { order: 1; margin-left: auto; }
  .a-modes { order: 2; }
  .a-brand > span { display: none; }
  #atlas-weather { box-sizing: border-box; width: calc(100vw - 32px); padding: 10px 14px 6px; } /* отступы внутри ширины — блок не выезжает за край */
  .a-w-num { font-size: 30px; }
  #atlas-drawer { top: auto; left: max(16px, env(safe-area-inset-left, 0px)); width: auto; max-height: 62vh; }
  #atlas-drawer .layer { transform: translateY(60px) translateZ(-120px); }
  .layer h2 { font-size: 18px; }
  body.atlas-reading #atlas-weather { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  #atlas-drawer .layer { transition: opacity .3s; transform: none; }
  #atlas-loading { transition: none; }
  #atlas-loading span { animation: none; }
  #atlas-canvas { transition: opacity .4s; }
  body:not(.atlas-ready) #atlas-canvas { filter: none; scale: none; }
  body.atlas-ready #atlas-top, body.atlas-ready #atlas-weather, body.atlas-ready #atlas-legend { animation: none; }
}
