/* POPRADAR — тёмная тема по макетам docs/design/*.dc.html */
:root {
  --bg: #0A1022; --bg-deep: #070B18; --map: #0E1630; --sheet: rgba(16,24,48,.94); --glass: rgba(10,16,34,.78);
  --surf: rgba(255,255,255,.05); --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.12);
  --text: #EEF1FA; --soft: #C9D0E4; --text2: #9AA3BD; --text3: #7480A0;
  --amber: #FFB020; --amber2: #FFC75A; --green: #3DDC97; --red: #FF5A4E; --gray: #7480A0;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.35 'Onest', system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--soft); }
[hidden] { display: none !important; }
.t2 { color: var(--text2); font-size: 13px; }
.sm { font-size: 12px; }
.grow { flex-grow: 1; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.card { border-radius: 24px; padding: 16px; background: var(--surf); border: 1px solid var(--line); }

.tone-green { --c: var(--green); --c-a: rgba(61,220,151,.20); --c-b: rgba(61,220,151,.05); --c-l: rgba(61,220,151,.35); }
.tone-amber { --c: var(--amber); --c-a: rgba(255,176,32,.20); --c-b: rgba(255,176,32,.05); --c-l: rgba(255,176,32,.35); }
.tone-red   { --c: var(--red);   --c-a: rgba(255,90,78,.20);  --c-b: rgba(255,90,78,.05);  --c-l: rgba(255,90,78,.40); }
.tone-gray  { --c: var(--gray);  --c-a: rgba(116,128,160,.16); --c-b: rgba(116,128,160,.04); --c-l: rgba(116,128,160,.30); }

/* ---------- каркас: телефон — одна колонка ---------- */
.app { max-width: 480px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px calc(40px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px; }
.grid { display: flex; flex-direction: column; gap: 16px; }
.side { display: contents; }
.hero { order: 1; } .airports { order: 2; } .signals { order: 3; } .mapbox { order: 4; } .feed { order: 5; } .stats { order: 6; }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; gap: 12px; position: relative; }
.logo { width: 36px; height: 36px; border-radius: 9px; }
.brand { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.pill { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 13px;
  font-weight: 600; color: var(--gray); background: rgba(116,128,160,.14); white-space: nowrap; }
.pill.ok { color: var(--green); background: rgba(61,220,151,.12); }
.pill.bad { color: var(--red); background: rgba(255,90,78,.12); }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); background: var(--surf);
  color: var(--soft); display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.nav { display: none; gap: 6px; }
.nav a, .nav button { padding: 10px 14px; border-radius: 12px; color: var(--soft); font-size: 14px; font-weight: 500;
  text-decoration: none; background: none; border: 0; }
.nav .on { background: rgba(255,255,255,.08); color: var(--text); font-weight: 600; }
.menu { position: absolute; right: 0; top: 52px; z-index: 2000; min-width: 220px; padding: 6px; border-radius: 16px;
  background: #141C38; border: 1px solid var(--line2); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.menu button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-radius: 11px;
  background: none; font-size: 15px; }
.menu button:hover { background: rgba(255,255,255,.06); }
.menu form { margin: 0; }

/* ---------- карточка SVO (стиль карточки угрозы) ---------- */
.hero { border-radius: 28px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(160deg, var(--c-a), var(--c-b) 55%, rgba(255,255,255,.03)); border: 1px solid var(--c-l); }
.hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hero-h { font-size: 14px; color: var(--soft); font-weight: 500; }
.hero-title { font-size: 40px; line-height: 1; font-weight: 700; color: var(--c); letter-spacing: -.01em; }
.segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.segs i { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); }
.segs i.g { background: var(--green); } .segs i.a { background: var(--amber); } .segs i.r { background: var(--red); }
.why { display: flex; flex-direction: column; gap: 8px; }
.why .t2 { font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 7px 11px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 13px; }

/* ---------- аэропорты ---------- */
.airports { display: flex; flex-direction: column; gap: 10px; }
.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap { border-radius: 20px; padding: 14px; background: var(--surf); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-h { display: flex; justify-content: space-between; align-items: center; }
.ap-code { font-family: 'Unbounded', sans-serif; font-weight: 600; font-size: 15px; }
.ap-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ap-st { font-size: 15px; font-weight: 600; color: var(--c); }
.ap-sub { font-size: 12px; color: var(--text2); }

.signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sig { border-radius: 18px; padding: 12px; background: var(--surf); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; }
.sig span:first-child { font-size: 12px; color: var(--text2); }
.sig span:last-child { font-size: 14px; font-weight: 600; color: var(--c); }

/* ---------- карта ---------- */
.mapbox { position: relative; height: 250px; border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,.10);
  background: var(--map); }
#map { position: absolute; inset: 0; background: var(--map); }
.leaflet-container { background: var(--map); font: inherit; }
.leaflet-tile-pane.osm-dark { filter: grayscale(1) invert(1) sepia(1) hue-rotate(190deg) saturate(1.6) brightness(.42) contrast(1.2); }
.leaflet-control-attribution { background: rgba(10,16,34,.6) !important; color: var(--text3) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text2) !important; }
.leaflet-control-zoom a { background: var(--glass) !important; color: var(--soft) !important; border-color: var(--line2) !important; }
.map-open { position: absolute; inset: 0; z-index: 900; border: 0; background: none; padding: 0; display: flex;
  align-items: flex-end; justify-content: flex-start; }
.map-open span { margin: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(10,16,34,.72);
  border: 1px solid rgba(255,255,255,.10); font-size: 13px; font-weight: 600; }
.map-top, .chips, .sheet, .hist { display: none; }
.mapbox .leaflet-control-container { display: none; }

/* полноэкранная карта на телефоне */
body.full { overflow: hidden; }
body.full .mapbox { position: fixed; inset: 0; z-index: 1500; height: auto; border-radius: 0; border: 0; }
body.full .map-open { display: none; }
body.full .leaflet-control-container { display: block; }
body.full .leaflet-control-zoom { display: none; }
body.full .map-top { display: flex; position: absolute; left: 12px; right: 12px; top: calc(12px + var(--safe-t)); z-index: 1000;
  gap: 8px; align-items: center; }
.back { background: var(--glass); border-color: var(--line2); color: var(--text); }
.map-status { flex-grow: 1; height: 44px; border-radius: 14px; background: var(--glass); border: 1px solid var(--c-l);
  display: flex; align-items: center; gap: 10px; padding: 0 14px; min-width: 0; color: var(--c); }
.map-status .dot { width: 9px; height: 9px; }
.map-status b { font-weight: 600; font-size: 15px; white-space: nowrap; }
.map-status .sub { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.full .chips { display: flex; position: absolute; left: 12px; top: calc(66px + var(--safe-t)); z-index: 1000; gap: 6px; }
.chip { height: 34px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line2); background: var(--glass);
  color: var(--soft); font-size: 13px; font-weight: 500; }
.chip.on { border-color: rgba(255,176,32,.45); background: rgba(255,176,32,.16); color: var(--amber2); font-weight: 600; }
body.full .sheet { display: flex; }
.hint { position: absolute; left: 50%; top: calc(116px + var(--safe-t)); transform: translateX(-50%); z-index: 1100;
  padding: 10px 14px; border-radius: 12px; background: var(--glass); border: 1px solid rgba(61,220,151,.45);
  color: var(--green); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* самолёты и подписи */
.plane-ic { transition: transform .4s; }
.plane-ic.est { opacity: .55; }
.ring { position: absolute; left: -6px; top: -6px; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.85); }
.plane-label.leaflet-tooltip { background: rgba(10,16,34,.72); border: 0; box-shadow: none; color: var(--soft);
  font: 600 11px 'Onest', sans-serif; padding: 2px 6px; border-radius: 7px; }
.plane-label.leaflet-tooltip::before { display: none; }
.mapbox:not(.big) .plane-label { display: none; }
.map-txt { color: var(--text2); font: 12px 'Onest', sans-serif; white-space: nowrap; text-align: center; }
.map-txt.svo { color: var(--soft); font-weight: 600; font-size: 12px; text-align: left; }

/* нижняя шторка: карточка борта */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1000; flex-direction: column; gap: 14px;
  border-radius: 28px 28px 0 0; background: var(--sheet); border-top: 1px solid var(--line2);
  padding: 10px 20px calc(24px + var(--safe-b)); max-height: 72%; overflow-y: auto; backdrop-filter: blur(8px); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); align-self: center; flex: none; }
.ac-h { display: flex; align-items: center; gap: 12px; }
.ac-ic { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none;
  background: rgba(201,208,228,.10); }
.ac-ic.svo { background: rgba(255,176,32,.16); }
.ac-t { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.ac-t b { font-size: 20px; font-weight: 700; line-height: 1.2; }
.ac-t .t2 { font-size: 13px; }
.ac-k { font-size: 14px; font-weight: 500; color: var(--soft); }
.ac-k.svo { color: var(--amber2); }
.ac-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; align-self: flex-start; flex: none; }
.x { width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.07); color: var(--text2);
  display: flex; align-items: center; justify-content: center; padding: 0; }
.times { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.times .t2 { font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { border-radius: 16px; padding: 12px; background: var(--surf); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile span:first-child { font-size: 12px; color: var(--text2); }
.tile b { font-size: 18px; font-weight: 700; white-space: nowrap; }
.tile span:last-child { font-size: 12px; color: var(--text3); }
.prof { display: flex; flex-direction: column; gap: 6px; }
.prof-h { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); gap: 8px; }
.prof svg { width: 100%; height: 64px; display: block; }
.prof-l { display: flex; gap: 14px; font-size: 11px; color: var(--text3); }
.prof-l span:first-child { color: var(--amber2); }
.note { font-size: 13px; color: var(--text2); }
.sum { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sum b { font-size: 16px; }
.np { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.np::-webkit-scrollbar { display: none; }
.np button { flex: none; border: 1px solid var(--line); background: var(--surf); border-radius: 14px; padding: 9px 12px;
  display: flex; flex-direction: column; gap: 2px; text-align: left; }
.np button b { font-size: 14px; }
.np button span { font-size: 12px; color: var(--text2); }
.np button.svo b { color: var(--amber2); }

/* ---------- лента ---------- */
.feed { display: flex; flex-direction: column; gap: 4px; }
.feed h2 { margin-bottom: 6px; }
.fi { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.fi:last-child { border-bottom: 0; }
.fi .fd { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--c); }
.fi .fb { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; min-width: 0; }
.fi .ft { font-size: 15px; font-weight: 600; line-height: 1.3; }
.fi .fm, .fi .fw { font-size: 13px; color: var(--text2); }
.fi .fw { flex: none; }
.empty { color: var(--text3); font-size: 14px; padding: 12px 0; }

/* ---------- статистика ---------- */
.stats { display: flex; flex-direction: column; gap: 12px; }
.stats-bars { display: flex; flex-direction: column; gap: 12px; }
.row-h { display: flex; justify-content: space-between; align-items: baseline; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bars i { flex: 1; border-radius: 3px; background: rgba(201,208,228,.35); min-height: 4px; }
.bars i.r { background: var(--amber); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-top: -4px; }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 4px; }
.nums div { display: flex; flex-direction: column; gap: 2px; }
.nums b { font-size: 20px; font-weight: 700; }
.nums span { font-size: 12px; color: var(--text2); }

.foot { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--text3); }
.foot .dot { width: 6px; height: 6px; color: var(--gray); }
.foot.ok .dot { color: var(--green); } .foot.bad .dot { color: var(--red); }

/* ---------- компьютер ---------- */
@media (min-width: 960px) {
  .app { max-width: 1600px; padding: 20px 24px 28px; }
  .logo { width: 40px; height: 40px; border-radius: 10px; }
  .brand { font-size: 20px; }
  .nav { display: flex; }
  .gear { display: none; }
  .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 16px; align-items: stretch; }
  .side { display: flex; flex-direction: column; gap: 14px; }
  .mapbox { order: 0; height: auto; min-height: 620px; border-radius: 28px; }
  .mapbox .map-open { display: none; }
  .mapbox .leaflet-control-container { display: block; }
  .chips { display: flex; position: absolute; left: 16px; top: 16px; z-index: 1000; gap: 6px; }
  .chip { height: 36px; padding: 0 14px; border-radius: 12px; }
  .hist { display: flex; position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1000; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 16px; background: rgba(10,16,34,.80); border: 1px solid rgba(255,255,255,.10); font-size: 13px; }
  .hist[hidden] { display: none !important; }
  .hist-bar { flex-grow: 1; height: 6px; border-radius: 3px; overflow: hidden; display: flex; background: rgba(116,128,160,.25); }
  .hist-bar i { height: 100%; }
  .sheet { display: flex; left: auto; right: 16px; bottom: 76px; width: 380px; max-height: calc(100% - 160px);
    border-radius: 24px; border: 1px solid var(--line2); padding: 16px 18px 18px; }
  .sheet .grab { display: none; }
  .hero { padding: 22px; }
  .hero-title { font-size: 44px; }
  .ap-grid { gap: 10px; }
  .ap { border-radius: 18px; padding: 12px 14px; gap: 4px; }
  .ap-code { font-size: 14px; } .ap-st { font-size: 14px; } .ap-dot { width: 9px; height: 9px; }
  .ap-sub { display: none; }
  .airports h2 { display: none; }
  .feed { border-radius: 22px; padding: 6px 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); gap: 0; }
  .feed h2 { display: none; }
  .fi { padding: 11px 0; }
  .fi .ft { font-size: 14px; } .fi .fm, .fi .fw { font-size: 12px; } .fi .fd { width: 9px; height: 9px; }
  .stats { grid-column: 1 / -1; order: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px;
    border-radius: 22px; align-items: center; }
  .nums b { font-size: 24px; }
  .foot { display: none; }
}

/* ---------- вход / задание пароля ---------- */
.center { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 380px; border-radius: 28px; padding: 28px 24px 24px; background: var(--surf);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.auth .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth .logo { width: 48px; height: 48px; border-radius: 12px; }
.auth h1 { margin: 0; font-size: 22px; font-weight: 700; }
.auth p { margin: 0; color: var(--text2); font-size: 14px; }
.auth input { width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2);
  background: rgba(255,255,255,.04); color: var(--text); font: inherit; font-size: 16px; outline: none; }
.auth input:focus { border-color: rgba(255,176,32,.6); }
.auth .go { height: 50px; border: 0; border-radius: 14px; background: var(--amber); color: #1A1200; font-weight: 700; font-size: 16px; }
.auth .err { color: var(--red); font-size: 14px; min-height: 0; }
.auth .err:empty { display: none; }
