/* ============================================================
   ISS Live Tracker — Mission Control design system
   Deep-void navy canvas, luminous cyan accents, mono readouts.
   ============================================================ */

:root {
  /* canvas */
  --bg: #07090c;
  --bg-2: #0a0e14;
  --surface-0: #080b10;
  --surface-1: #0e131c;
  --surface-2: #131a26;
  --surface-3: #1a2331;

  /* ink */
  --text: #e4ecf6;
  --muted: #8fa3b8;
  --faint: #5c6f82;

  /* stroke */
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);

  /* accents (additive light) */
  --accent: #22d3ee;
  --accent-soft: #67e8f9;
  --accent-dim: rgba(34, 211, 238, 0.16);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.16);
  --amber: #f5b84c;
  --red: #fb6f6f;
  --purple: #a78bfa;
  --gold: #f5a623;

  /* typography */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* metrics */
  --pad: 14px;
  --gap: 14px;
  --radius: 14px;
  --radius-sm: 10px;
  --content-max: 1900px;
  --side: 342px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 8px 30px rgba(34, 211, 238, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  font-size: 14px;
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(37, 99, 235, 0.13), transparent 55%),
    radial-gradient(900px 620px at -12% 32%, rgba(167, 139, 250, 0.06), transparent 52%),
    radial-gradient(1100px 700px at 50% 112%, rgba(34, 211, 238, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* faint star field */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 24px 34px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 118px 76px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 172px 22px, rgba(160, 220, 255, 0.45), transparent),
    radial-gradient(1px 1px at 66px 142px, rgba(255, 255, 255, 0.3), transparent);
  background-size: 190px 190px;
  opacity: 0.16;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #243041; }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: max(10px, env(safe-area-inset-top)) var(--pad) 10px;
  background: rgba(9, 13, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1001;
}

.brand { display: flex; align-items: center; gap: 11px; flex: 1 1 auto; min-width: 0; }
.brand-logo {
  width: 42px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35));
}
.brand h1 {
  font-size: clamp(16px, 4.5vw, 20px);
  letter-spacing: 0.1px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff, #bcd6ec);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand h1 span {
  color: var(--accent-soft);
  -webkit-text-fill-color: var(--accent-soft);
  font-weight: 600;
}
.subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(10px, 2.6vw, 11.5px);
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.3px;
}
.sub-pill {
  font-size: 9.5px;
  color: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.6px;
}

.status-row {
  order: 3;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.status-row #status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--muted);
}
.dot.connecting { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.2s infinite; }
.dot.live { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.error { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }

.clocks { margin-left: auto; text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.clock-utc {
  font-family: var(--mono);
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}
.clock-utc::before {
  content: "UTC";
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent-soft);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 7px;
  vertical-align: 2px;
}
.clock-local {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.clock-local::before {
  content: "LOCAL";
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--faint);
  margin-right: 5px;
}

/* AR viewfinder button */
.ar-open-btn {
  appearance: none;
  cursor: pointer;
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent-soft);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.16), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 999px;
  padding: 4px 13px 4px 5px;
  min-height: 34px;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12), inset 0 0 12px rgba(34, 211, 238, 0.05);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.06s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ar-open-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.26), rgba(34, 211, 238, 0.1));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.28);
}
.ar-open-btn:active { transform: scale(0.97); }
.ar-open-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #04121a;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}
.ar-open-label { line-height: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line-strong);
  padding: 8px 14px;
  border-radius: 999px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: rgba(34, 211, 238, 0.25);
  touch-action: manipulation;
}
.btn svg { flex: none; }
.btn:hover {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2), 0 4px 14px rgba(0, 0, 0, 0.3);
}
.btn:active { transform: scale(0.98); }
.btn.active {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.22), rgba(34, 211, 238, 0.1));
  border-color: var(--accent);
  color: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.15), 0 0 12px rgba(34, 211, 238, 0.15);
}
.btn.accent {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent) 70%);
  border-color: rgba(34, 211, 238, 0.6);
  color: #04121a;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(34, 211, 238, 0.25);
}
.btn.accent:hover { background: linear-gradient(180deg, #9deaef, var(--accent)); box-shadow: 0 2px 20px rgba(34, 211, 238, 0.35); color: #04121a; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ============================================================
   Banner
   ============================================================ */
.banner {
  padding: 8px var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
  font-size: 13px;
  background: linear-gradient(180deg, #2a1015, #200b10);
  border-bottom: 1px solid #5a2530;
  color: #ffb4b4;
}
.banner.warn { background: linear-gradient(180deg, #26200c, #1d1809); border-color: #5a4a1b; color: #ffe08a; }

/* ============================================================
   Layout
   ============================================================ */
main, .panels {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--pad);
  min-height: 0;
}
.map-panel, .side-panel { min-width: 0; }

/* ============================================================
   Map
   ============================================================ */
.map-panel {
  position: relative;
  height: 46vh;
  height: 46dvh;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(34, 211, 238, 0.04);
}
.map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.55);
  z-index: 500;
}
#map { position: relative; width: 100%; height: 100%; min-height: 0; background: #060a12; }
.globe-canvas {
  position: absolute;
  inset: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}
.globe-canvas:active { cursor: grabbing; }
.globe-attr {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 600;
  font-size: 10px;
  color: var(--faint);
  background: rgba(7, 9, 12, 0.55);
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
}
.globe-zoom {
  display: flex;
  gap: 6px;
}
.globe-zoom .btn {
  min-width: 34px;
  width: 34px;
  padding: 6px 0;
  justify-content: center;
  font-size: 15px;
  color: var(--accent-soft);
}
.globe-zoom .btn:hover { color: var(--accent); }

/* map tools */
#map + .map-tools,
.map-tools {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 1000;
  max-width: calc(100% - 20px);
}
#map + .map-tools .btn,
.map-tools .btn {
  background: rgba(11, 16, 26, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: var(--line-strong);
  font-size: 12.5px;
  min-height: 34px;
  padding: 6px 12px;
}
#map + .map-tools .btn:hover,
.map-tools .btn:hover { border-color: var(--accent); }

.map-legend {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: none;
  gap: 13px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.lg::before { content: ""; display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: 2px; border-radius: 2px; }
.lg-past::before { background: #5c7a8c; }
.lg-future::before { background: var(--accent-soft); }
.lg-sun::before { background: var(--amber); border-radius: 50%; height: 7px; width: 7px; vertical-align: 1px; }
.lg-iss::before { background: var(--accent); border-radius: 50%; height: 7px; width: 7px; vertical-align: 1px; }

/* ============================================================
   Cards
   ============================================================ */
.side-panel { display: flex; flex-direction: column; gap: var(--gap); }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.85), rgba(10, 14, 21, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  box-shadow: var(--shadow-1);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), transparent);
  opacity: 0.8;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin-bottom: 14px;
}
.card h2 svg {
  color: var(--accent);
  flex: none;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.5));
}
.card h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  margin-left: 2px;
}

.meta { font-size: 12px; margin-bottom: 10px; color: var(--muted); line-height: 1.55; }

/* telemetry */
.tele-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tele {
  background: rgba(6, 9, 14, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
  transition: border-color 0.15s;
}
.tele:hover { border-color: rgba(34, 211, 238, 0.35); }
.tele.wide { grid-column: 1 / -1; }
.tele label {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faint);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tele span {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.tele span.sunlit.yes { color: var(--amber); }
.tele span.sunlit.no { color: var(--accent-soft); }

.tele-sub { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.tele-sub div { margin-top: 3px; font-family: var(--mono); overflow-wrap: anywhere; }
.tele-sub b { color: var(--text); font-weight: 600; }
.dim { color: var(--muted); opacity: 0.8; font-size: 11px !important; }

.next-pass { font-size: 13px; margin-bottom: 12px; min-height: 32px; line-height: 1.55; overflow-wrap: anywhere; }
.next-pass b { color: var(--green); font-family: var(--mono); font-weight: 600; }

.pass-controls { display: flex; flex-direction: column; gap: 8px; }
.coord-inputs { display: flex; gap: 6px; }
.coord-inputs input {
  flex: 1;
  min-width: 0;
  width: 0;
  background: rgba(6, 9, 14, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  padding: 8px 10px;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.coord-inputs input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
.coord-inputs input::placeholder { color: var(--faint); }

/* ============================================================
   Panels row
   ============================================================ */
.panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  padding: 0 var(--pad) var(--pad);
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
}

/* people */
.people-list { list-style: none; }
.people-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.people-list li:last-child { border-bottom: none; }
.crew-group { padding: 7px 0 !important; }
.crew-craft {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--purple);
  margin-bottom: 8px;
}
.crew-craft::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
}
.crew-names { display: flex; flex-wrap: wrap; gap: 6px; }
.crew-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(24, 32, 46, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px 3px 4px;
  font-size: 12px;
  transition: border-color 0.15s;
}
.crew-badge:hover { border-color: rgba(34, 211, 238, 0.4); }
.flag-chip {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  width: 26px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* passes */
.pass-list { list-style: none; max-height: 340px; overflow-y: auto; padding-right: 3px; }
.pass-row {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  background: rgba(6, 9, 14, 0.5);
  transition: border-color 0.15s;
}
.pass-row:hover { border-color: rgba(34, 211, 238, 0.3); }
.pass-row.visible { border-left: 3px solid var(--green); }
.pass-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.pass-arrow {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
  line-height: 18px;
}
.pass-main strong { font-size: 16px; font-family: var(--mono); font-weight: 700; }
.pass-date { color: var(--muted); font-size: 12px; }
.pass-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.pass-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pass-vis.on { color: var(--green); }
.pass-vis.off { color: var(--muted); }
.pass-list .loading, .pass-list .hint, .pass-list .error, .people-list .loading, .people-list .error { color: var(--muted); font-size: 13px; border: none; }
.pass-list .error, .people-list .error { color: var(--red); }

/* ============================================================
   Live card
   ============================================================ */
.rec-badge {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--red), #d13c3c);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: 1.4px;
  animation: pulse 1.4s infinite;
  vertical-align: 2px;
  box-shadow: 0 0 10px rgba(251, 111, 111, 0.35);
}
.video-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 9px; border: 1px solid var(--line); }
.video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-links { font-size: 13px; margin: 6px 0; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 18px var(--pad);
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}
.footer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 10px;
}
.footer-mark { color: var(--accent); filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.5)); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent-soft); text-decoration: underline; }

/* ============================================================
   AR sky-finder overlay
   ============================================================ */
body.ar-open { overflow: hidden; }
.ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #05070a;
  overflow: hidden;
}
.ar-camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #020307; }
.ar-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 32%, rgba(0, 0, 0, 0.2) 62%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 26%, transparent 62%, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.ar-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  color: #fff;
}
.ar-top { width: 100%; display: flex; align-items: center; gap: 10px; }
.ar-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(9, 13, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ar-rec {
  color: var(--accent-soft);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: var(--accent-dim);
  border-radius: 5px;
  padding: 1px 6px;
}
.ar-status {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #bcd3e6;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-stage { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; }
.ar-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.3);
}
.ar-crosshair::before,
.ar-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
}
.ar-crosshair::before { left: 50%; top: -8px; height: 16px; width: 2px; transform: translateX(-50%); }
.ar-crosshair::after { top: 50%; left: -8px; width: 16px; height: 2px; transform: translateY(-50%); }
.ar-marker {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.9));
  pointer-events: none;
}
.ar-marker.at-edge { opacity: 0.8; filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.8)); }
.ar-marker.at-edge .ar-marker-core {
  background: rgba(9, 13, 20, 0.72);
  border: 2.5px dashed rgba(34, 211, 238, 0.85);
  color: #9ff0ff;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.16);
}
.ar-marker-core {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8fffd0, var(--green) 60%, #1c9d6e);
  border: 2.5px solid #ffffff;
  color: #05301f;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.22);
}
.ar-marker.aligned .ar-marker-core { animation: ar-pulse 1.1s ease-in-out infinite; }
.ar-marker-flag {
  font-size: 11px;
  font-weight: 700;
  color: #eafff5;
  background: rgba(10, 40, 30, 0.8);
  border: 1px solid rgba(52, 211, 153, 0.6);
  border-radius: 999px;
  padding: 2px 9px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
@keyframes ar-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.22); }
  50% { box-shadow: 0 0 0 20px rgba(52, 211, 153, 0.05); }
}
.ar-marker.hidden, .ar-guide.hidden { display: none; }
.ar-guide {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 5;
}
.ar-guide-arrow {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28) 0%, rgba(34, 211, 238, 0.08) 55%, transparent 75%);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #9ff0ff;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.55));
  transition: transform 0.15s ease-out, opacity 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ar-guide-arrow svg { flex: none; }
.ar-guide-info {
  font-size: 13px;
  font-weight: 700;
  color: #eaf6ff;
  background: rgba(9, 13, 20, 0.66);
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 999px;
  padding: 4px 14px;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.ar-compass {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 110px;
  height: 110px;
}
.ar-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ar-coords { display: flex; gap: 6px; width: 100%; max-width: 420px; align-items: center; }
.ar-coord {
  flex: 1;
  min-width: 0;
  background: rgba(9, 13, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 15px;
  font-family: var(--mono);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ar-coord:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }
.ar-tele {
  width: 100%;
  max-width: 420px;
  text-align: center;
  font-size: 12.5px;
  color: #eaf6ff;
  background: rgba(9, 13, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.ar-tele b { color: var(--accent-soft); }
.ar-hint {
  max-width: 440px;
  text-align: center;
  font-size: 11.5px;
  color: #bcd3e6;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.ar-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(9, 13, 20, 0.65);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3010;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ar-close:hover { background: rgba(30, 41, 59, 0.8); border-color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 540px) {
  .map-panel { height: 50vh; height: 50dvh; }
  .tele-grid { gap: 8px; }
}

@media (min-width: 720px) {
  .topbar { flex-wrap: nowrap; }
  .status-row { order: 0; width: auto; margin-left: auto; }
  .clocks { margin-left: 0; }
  .ar-open-btn { margin-left: auto; }
  .ar-compass { width: 130px; height: 130px; }
  .map-panel { height: 56vh; height: 56dvh; min-height: 380px; }
  .tele span { font-size: 14px; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  :root { --side: 360px; }
  main { grid-template-columns: minmax(0, 1fr) var(--side); }
  .map-panel {
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    min-height: 460px;
  }
  .side-panel {
    position: sticky;
    top: 2px;
    align-self: start;
    max-height: calc(100dvh - 6px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
  }
  .tele span { font-size: 15px; }
  .map-legend { display: flex; }
  .card { padding: 18px; }
}

/* legend to its own corner on wide screens */
@media (min-width: 1200px) {
  .map-legend { left: 10px; transform: none; bottom: 12px; }
  .pass-main strong { font-size: 17px; }
}

@media (min-width: 1366px) {
  .panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tele span { font-size: 16px; }
}

@media (min-width: 1440px) {
  .map-panel { height: calc(100vh - 180px); height: calc(100dvh - 180px); }
  .card { padding: 20px; }
}

@media (min-width: 1920px) {
  :root { --side: 400px; }
  body { font-size: 15px; }
  .topbar { padding: 14px 24px; gap: 18px; }
  .brand-logo { width: 54px; height: 54px; }
  .brand h1 { font-size: 26px; }
  .subtitle { font-size: 13px; }
  .clock-utc { font-size: 20px; }
  .clock-local { font-size: 13px; }
  .status-row { font-size: 14px; }
  .map-panel { height: calc(100vh - 200px); height: calc(100dvh - 200px); min-height: 720px; }
  main { gap: 20px; padding: 20px; }
  .panels { gap: 20px; padding: 0 20px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .card { padding: 26px; }
  .card h2 { font-size: 12.5px; }
  .tele-grid { gap: 10px; }
  .tele { padding: 12px 14px; }
  .tele label { font-size: 10.5px; }
  .tele span { font-size: 19px; }
  .tele-sub { font-size: 13px; }
  .next-pass { font-size: 15px; }
  .btn { font-size: 14px; min-height: 44px; padding: 10px 18px; }
  .coord-inputs input { padding: 11px; font-size: 17px; }
  .meta { font-size: 13px; }
  .people-list li { font-size: 14px; }
  .crew-badge { font-size: 13px; padding: 4px 12px 4px 5px; }
  .pass-main strong { font-size: 19px; }
  .pass-date, .pass-meta, .pass-arrow { font-size: 13px; }
  .pass-list { max-height: 420px; }
  .footer { font-size: 13px; padding: 22px 24px; }
}

@media (pointer: coarse) {
  .btn { min-height: 46px; padding: 10px 16px; font-size: 14px; }
  .coord-inputs input { min-height: 46px; }
  .brand-logo { width: 46px; height: 46px; }
  .iss-rot { width: 52px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .map-panel { height: 64vh; height: 64dvh; min-height: 260px; }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  .subtitle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}