  :root {
    --bg: #05070d;
    --land: #111b30;
    --land-edge: #3a5288;
    --land-other: #080c16;
    --grid: rgba(110,140,200,.07);
    --panel: rgba(12,17,30,.82);
    --panel-edge: rgba(120,150,210,.14);
    --text: #e8edf7;
    --muted: #8691a8;
    --dim: #545e75;
    --red: #ff3b5c;
    --amber: #ffb547;
    --green: #2ee6a6;
    --gray: #5b6475;
    --blue: #6aa8ff;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
    font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
  body { overflow: hidden; }
  button { font: inherit; color: inherit; }

  /* ---------- Карта ---------- */
  #stage { position: fixed; inset: 0; }
  #map { width: 100%; height: 100%; display: block; cursor: grab; }
  #map:active { cursor: grabbing; }
  .vignette { position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.75) 100%); }
  .sweep { position: fixed; left: 50%; top: 48%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax;
    pointer-events: none; opacity: .045; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, rgba(106,168,255,.9) 358deg, transparent 360deg);
    animation: sweep 9s linear infinite; mix-blend-mode: screen; }
  @keyframes sweep { to { transform: rotate(360deg); } }

  .land-other { fill: var(--land-other); stroke: rgba(120,150,210,.06); stroke-width: .5; }
  .graticule { fill: none; stroke: var(--grid); stroke-width: .6; }
  .russia { fill: var(--land); stroke: var(--land-edge); stroke-width: 1; stroke-linejoin: round;
    filter: drop-shadow(0 0 18px rgba(80,120,220,.18)); }
  .russia.draw { fill-opacity: 0; stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: draw 2.4s cubic-bezier(.6,.05,.3,1) forwards, fillin 1.2s 1.6s ease forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fillin { to { fill-opacity: 1; } }

  .ap { cursor: pointer; }
  .ap .in { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.34,1.56,.64,1) forwards; }
  @keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
  .ap .core { stroke: var(--bg); stroke-width: 1.2; }
  .ap .halo { opacity: .22; }
  .ap.ours .ring { fill: none; stroke: #fff; stroke-width: 1.4; opacity: .9; }
  .ap .ping { fill: none; stroke-width: 1.5; transform-box: fill-box; transform-origin: center;
    animation: ping 2.4s cubic-bezier(.2,.6,.3,1) infinite; }
  .ap .ping.p2 { animation-delay: 1.2s; }
  @keyframes ping { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(5.5); opacity: 0; } }
  .ap:hover .core, .ap.sel .core { stroke: #fff; stroke-width: 1.6; }
  .lbl { font-weight: 600; fill: #c9d3e8; paint-order: stroke; stroke: var(--bg);
    pointer-events: none; opacity: 0; animation: fade .6s forwards; transition: visibility 0s; }
  .lbl.far { visibility: hidden; }
  .lbl.red { fill: #ffd0d8; }
  @keyframes fade { to { opacity: 1; } }

  /* ---------- Шапка и цифры ---------- */
  .top { position: fixed; left: 24px; top: 20px; right: 400px; pointer-events: none; }
  .top > * { pointer-events: auto; }
  .brand { display: flex; align-items: center; gap: 12px; }
  .brand h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
  .live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
    padding: 5px 10px; border-radius: 99px; background: rgba(255,59,92,.08); border: 1px solid rgba(255,59,92,.25); }
  .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255,59,92,.6);
    animation: blink 1.6s infinite; }
  @keyframes blink { 0% { box-shadow: 0 0 0 0 rgba(255,59,92,.6); } 70% { box-shadow: 0 0 0 8px rgba(255,59,92,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,92,0); } }
  .sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
  .sub b { color: #ffc2cc; font-weight: 600; }

  .kpis { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
  .kpi { min-width: 128px; padding: 12px 14px; border-radius: 14px; background: var(--panel);
    border: 1px solid var(--panel-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    opacity: 0; transform: translateY(8px); animation: rise .6s forwards; }
  .kpi:nth-child(2) { animation-delay: .08s; } .kpi:nth-child(3) { animation-delay: .16s; } .kpi:nth-child(4) { animation-delay: .24s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  .kpi .v { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
  .kpi .k { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .kpi .k .short { display: none; }
  .kpi.red .v { color: var(--red); text-shadow: 0 0 18px rgba(255,59,92,.45); }
  .kpi.amber .v { color: var(--amber); }

  /* ---------- Правая панель ---------- */
  .panel { position: fixed; top: 16px; right: 16px; bottom: 16px; width: 368px; display: flex; flex-direction: column;
    border-radius: 20px; background: var(--panel); border: 1px solid var(--panel-edge);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden;
    opacity: 0; transform: translateX(16px); animation: slide .7s .3s cubic-bezier(.2,.8,.2,1) forwards; }
  @keyframes slide { to { opacity: 1; transform: none; } }
  .grab { display: none; }
  .panel .head { padding: 18px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .disclaimer { margin: 10px 0 0; font-size: 11px; line-height: 1.45; color: var(--dim); }
  .disclaimer b { color: var(--muted); font-weight: 600; }
  .panel .scroll { overflow-y: auto; padding: 14px 18px 8px; flex: 1; scrollbar-width: thin; scrollbar-color: #2a3550 transparent; }
  .panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 10px; font-weight: 700; }
  .search { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--panel-edge);
    background: rgba(255,255,255,.03); color: var(--text); font: inherit; font-size: 14px; outline: none; }
  .search:focus { border-color: rgba(106,168,255,.5); }
  .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .empty { color: var(--muted); font-size: 13px; padding: 4px 0 12px; }

  .board { margin-bottom: 18px; }
  .brd { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.05); cursor: pointer; }
  .brd:first-child { border-top: 0; }
  .brd .h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 0; }
  .brd .h .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .brd .h .code { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; flex: none; }
  .brd .h .st { margin-left: auto; flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
  /* Плитки цифр — всегда одной высоты, что бы в них ни лежало (правило DESIGN.md). */
  .bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 48px; gap: 6px; margin-top: 8px; }
  .bars > div { display: flex; flex-direction: column; justify-content: center; min-width: 0;
    background: rgba(255,255,255,.03); border-radius: 8px; padding: 0 8px; }
  .bars > .wide { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
  .bars > .none { background: rgba(255,255,255,.015); color: var(--dim); }
  .bars b { display: block; font-family: var(--mono); font-weight: 500; font-size: 15px; }
  .bars span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bars .bad b { color: var(--red); } .bars .warn b { color: var(--amber); }

  .foot { padding: 12px 0 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: var(--dim); line-height: 1.5; }
  .foot b { color: var(--muted); font-weight: 600; }
  .foot > p a { color: var(--blue); }

  /* ---------- Карточка аэропорта ---------- */
  .card { position: fixed; left: 24px; bottom: 76px; width: 340px; padding: 18px; border-radius: 18px;
    background: var(--panel); border: 1px solid var(--panel-edge); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    transform: translateY(20px); opacity: 0; pointer-events: none; transition: .35s cubic-bezier(.2,.8,.2,1); }
  .card.on { transform: none; opacity: 1; pointer-events: auto; }
  .card .x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0;
    background: rgba(255,255,255,.06); cursor: pointer; font-size: 16px; line-height: 1; }
  .card .city { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
  .card .an { color: var(--muted); font-size: 13px; margin-top: 2px; }
  .badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; }
  .card .since { font-size: 12px; color: var(--muted); margin-top: 8px; font-family: var(--mono); }
  .card .bars { margin-top: 14px; }
  .card .note { font-size: 12px; color: var(--muted); margin-top: 12px; }
  .stuck { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(241,46,85,.14), rgba(241,46,85,.04)); border: 1px solid rgba(241,46,85,.28);
    text-decoration: none; color: var(--text); font-size: 13px; line-height: 1.35; }
  .stuck b { display: block; font-size: 14px; }
  .stuck span { color: #ffb3c1; }
  .stuck svg { flex: none; }

  /* ---------- Легенда, тултип, зум ---------- */
  .legend { position: fixed; left: 24px; bottom: 20px; display: flex; gap: 14px; flex-wrap: wrap; padding: 9px 14px; border-radius: 99px;
    background: var(--panel); border: 1px solid var(--panel-edge); backdrop-filter: blur(14px); font-size: 12px; color: var(--muted); }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .legend .ring { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; }
  .zoom { position: fixed; right: 400px; bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
  .zoom button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--panel-edge); background: var(--panel);
    backdrop-filter: blur(14px); cursor: pointer; font-size: 18px; }
  .zoom button:hover { border-color: rgba(106,168,255,.5); }
  .tip { position: fixed; pointer-events: none; padding: 8px 11px; border-radius: 10px; font-size: 12px;
    background: rgba(8,12,22,.95); border: 1px solid var(--panel-edge); opacity: 0; transition: opacity .15s; white-space: nowrap; z-index: 5; }
  .tip b { font-size: 13px; } .tip em { font-style: normal; color: var(--muted); font-family: var(--mono); }
  .demo { position: fixed; top: 20px; right: 400px; font-size: 11px; color: #ffcf7a; padding: 5px 10px; border-radius: 99px;
    background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.3); }

  /* ---------- Телефон ----------
     Карта на весь экран. Список — нижняя шторка: свёрнута (видны поиск и дисклеймер)
     или развёрнута; тянется пальцем за ручку и шапку, логика — в app.js. --peek ставит app.js. */
  @media (max-width: 860px) {
    .top { left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); }
    .brand { flex-direction: column; align-items: flex-start; gap: 6px; }
    .brand h1 { font-size: 20px; line-height: 1.15; }
    .live { order: -1; font-size: 11px; padding: 3px 9px; gap: 6px; white-space: nowrap; }
    .live i { width: 6px; height: 6px; }
    .sub { font-size: 12px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .kpis { flex-wrap: nowrap; gap: 6px; margin-top: 10px; }
    .kpi { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border-radius: 10px; } /* ширина по подписи — длинным больше места */
    .kpi .v { font-size: 16px; }
    .kpi .k { font-size: 10px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kpi .k .full { display: none; } .kpi .k .short { display: inline; }

    .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 78vh; height: 78dvh;
      border-radius: 20px 20px 0 0; border-bottom: 0; z-index: 3;
      transform: translateY(calc(100% - var(--peek, 120px))); transition: transform .35s cubic-bezier(.2,.8,.2,1);
      animation: fade .5s .3s forwards; }
    .panel.open { transform: none; }
    .panel.drag { transition: none; }
    .grab { display: block; flex: none; width: 100%; height: 22px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
    .grab i { display: block; width: 40px; height: 4px; border-radius: 4px; background: #2a3550; margin: 0 auto; }
    .panel .head { padding: 0 16px 10px; touch-action: none; }
    .search { padding: 10px 14px; font-size: 16px; } /* 16px — иначе iPhone зумит страницу при фокусе */
    .disclaimer { margin-top: 8px; }
    .panel .scroll { padding: 12px 16px calc(8px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
    .legend { display: none; }
    .zoom { display: none; }
    .demo { top: auto; right: 16px; bottom: calc(var(--peek, 120px) + 12px); }
    .card { left: 12px; right: 12px; width: auto; top: calc(12px + env(safe-area-inset-top)); bottom: auto; transform: translateY(-20px); z-index: 4; }
    .card .city { font-size: 20px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
    .sweep { display: none; }
  }

  /* ---------- Продакшен-дополнения ---------- */
  button.brd { width: 100%; background: none; border: 0; text-align: left; font: inherit; color: inherit; display: flex; }
  button.brd { display: block; }
  .ap:focus { outline: none; } .ap:focus-visible .core { stroke: #fff; stroke-width: 2.4; }
  .brd:focus-visible, .zoom button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  .share { margin-top: 12px; width: 100%; padding: 10px; border-radius: 12px; border: 1px solid var(--panel-edge);
    background: rgba(255,255,255,.04); cursor: pointer; font-weight: 600; font-size: 13px; }
  .share:hover { border-color: rgba(106,168,255,.5); }
  .live.stale { background: rgba(255,181,71,.08); border-color: rgba(255,181,71,.35); color: #ffcf7a; }
  .live.stale i { background: var(--amber); animation: none; }
  .toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; transition: .25s;
    padding: 10px 16px; border-radius: 99px; background: #1b2438; border: 1px solid var(--panel-edge); font-size: 13px; z-index: 9; }
  .toast.on { opacity: 1; transform: translate(-50%, 0); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .about { margin-top: 8px; color: var(--muted); }
  .about a { color: var(--muted); }
  noscript p { position: fixed; inset: 40% 20px auto; text-align: center; color: var(--muted); }
