/* ============================================================
   ISS Tracker — Style Sheet
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --bg:          #070b14;
  --surface:     #0d1525;
  --surface-2:   #131d2e;
  --surface-3:   #1a2540;
  --border:      rgba(255,255,255,0.07);
  --border-md:   rgba(255,255,255,0.12);
  --text:        #dce8f5;
  --text-muted:  #7b90aa;
  --text-faint:  #3a4a5e;
  --accent:      #00d4ff;
  --accent-glow: rgba(0,212,255,0.18);
  --accent-dim:  rgba(0,212,255,0.12);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167,139,250,0.12);
  --green:       #34d399;
  --green-dim:   rgba(52,211,153,0.14);
  --amber:       #fbbf24;
  --amber-dim:   rgba(251,191,36,0.14);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,0.14);

  --header-h:    105px;
  --nav-h:       64px;
  --radius:      14px;
  --radius-sm:   9px;
  --radius-lg:   20px;

  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-display:'Space Grotesk', system-ui, sans-serif;

  --shadow:      0 4px 24px rgba(0,0,0,0.45);
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="light"] {
  --bg:          #eef2f8;
  --surface:     #ffffff;
  --surface-2:   #f6f8fc;
  --surface-3:   #eef2f8;
  --border:      rgba(0,0,0,0.07);
  --border-md:   rgba(0,0,0,0.13);
  --text:        #0d1929;
  --text-muted:  #5c6f85;
  --text-faint:  #aab8c8;
  --accent:      #0077cc;
  --accent-glow: rgba(0,119,204,0.14);
  --accent-dim:  rgba(0,119,204,0.1);
  --purple:      #7c3aed;
  --purple-dim:  rgba(124,58,237,0.1);
  --green:       #059669;
  --green-dim:   rgba(5,150,105,0.1);
  --amber:       #d97706;
  --amber-dim:   rgba(217,119,6,0.1);
  --red:         #dc2626;
  --red-dim:     rgba(220,38,38,0.1);
  --shadow:      0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.07);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
svg { display: block; }

/* ---------- App Shell ---------- */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh; /* fallback */
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.loader-orbit {
  width: 80px;
  height: 80px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-iss {
  color: var(--accent);
  width: 28px;
  height: 28px;
}

.loader-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
#header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 4px;
  padding: 2px 6px;
}

[data-theme="light"] .live-badge {
  border-color: rgba(0,119,204,0.25);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 1.8s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visibility-chip {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  display: none;
}
.visibility-chip.daylight  { background: var(--amber-dim); color: var(--amber); }
.visibility-chip.eclipsed  { background: var(--purple-dim); color: var(--purple); }
.visibility-chip.visible   { background: var(--green-dim); color: var(--green); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-2);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Telemetry strip */
.telemetry-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.telemetry-strip::-webkit-scrollbar { display: none; }

.telem-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.telem-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.telem-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
  transition: color 0.3s;
}

.telem-value.updated {
  color: var(--accent);
  animation: flash 0.6s ease;
}

@keyframes flash {
  0%   { color: var(--accent); }
  100% { color: var(--text); }
}

.telem-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.telem-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 12px;
  flex-shrink: 0;
}

/* ---------- Main area ---------- */
#main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
}
.tab-pane.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ---------- Map tab ---------- */
#tabMap { overflow: hidden; }

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Override leaflet styles for dark mode */
.leaflet-container {
  background: #060a12 !important;
}
[data-theme="light"] .leaflet-container {
  background: #dde8f5 !important;
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border-md) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--surface-2) !important;
}

/* ISS marker */
.iss-marker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iss-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: iss-pulse 2.5s ease-out infinite;
}

@keyframes iss-pulse {
  0%   { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Map controls */
.map-controls {
  position: absolute;
  bottom: 16px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, color 0.2s;
}
.map-btn:hover { background: var(--surface-2); color: var(--text); }
.map-btn:disabled { opacity: 0.35; pointer-events: none; }
.map-btn svg { width: 18px; height: 18px; }

/* Mini pass card on map */
.map-pass-card {
  position: absolute;
  bottom: 16px;
  left: 12px;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  padding: 9px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  min-width: 130px;
}
.mpc-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.mpc-time {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.mpc-el {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Scrollable panes ---------- */
.pane-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--nav-h) + 16px);
  scrollbar-width: thin;
  scrollbar-color: var(--border-md) transparent;
}
.pane-scroll::-webkit-scrollbar { width: 4px; }
.pane-scroll::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

/* ---------- Section hero ---------- */
.section-hero {
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Location card ---------- */
.location-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.location-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.location-icon svg { width: 20px; height: 20px; }

.location-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.location-text strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.location-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.location-denied {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.btn-primary {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: 8px;
  padding: 8px 16px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

/* ---------- Passes loading ---------- */
.passes-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---------- Pass cards ---------- */
.pass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.pass-card:hover { border-color: var(--border-md); }
.pass-card.next { border-color: rgba(0,212,255,0.3); }
[data-theme="light"] .pass-card.next { border-color: rgba(0,119,204,0.3); }

.pass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.pass-datetime {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pass-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}
.pass-time {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.next-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 5px;
  padding: 3px 8px;
}
[data-theme="light"] .next-badge { border-color: rgba(0,119,204,0.2); }

.pass-quality {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 10px;
}
.pass-quality.excellent { background: var(--green-dim); color: var(--green); }
.pass-quality.good      { background: var(--accent-dim); color: var(--accent); }
.pass-quality.fair      { background: var(--amber-dim); color: var(--amber); }
.pass-quality.poor      { background: var(--red-dim); color: var(--red); }
[data-theme="light"] .pass-quality.good { color: var(--accent); }

.pass-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 10px 0;
}

.pm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-right: 1px solid var(--border);
}
.pm-item:last-child { border-right: none; }

.pm-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.pm-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.pm-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pass-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-2);
  gap: 8px;
  flex-wrap: wrap;
}

.pass-footer-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.pass-footer-item svg { width: 13px; height: 13px; flex-shrink: 0; }

.vis-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
}
.vis-tag.visible   { background: var(--green-dim); color: var(--green); }
.vis-tag.twilight  { background: var(--amber-dim); color: var(--amber); }
.vis-tag.daylight  { background: var(--purple-dim); color: var(--purple); }

.countdown-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Radio section ---------- */
.radio-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.rb-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rb-icon svg { width: 22px; height: 22px; }
.rb-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rb-text strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.rb-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 18px 0 10px;
}
.card-group-label:first-of-type { margin-top: 4px; }

/* Frequency cards */
.freq-list { display: flex; flex-direction: column; gap: 10px; }

.freq-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: border-color 0.2s;
}
.freq-card:hover { border-color: var(--border-md); }
.freq-card.always-on { border-color: rgba(52,211,153,0.25); background: linear-gradient(135deg, var(--surface), rgba(52,211,153,0.03)); }

.freq-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease infinite;
}
.freq-status-dot.scheduled { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: none; }
.freq-status-dot.region    { background: var(--purple); box-shadow: none; animation: none; }

.freq-info { flex: 1; }
.freq-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 3px;
}
.freq-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 7px;
}
.freq-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 2px 7px;
}
.tag-mode   { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border-md); }
.tag-status { background: var(--green-dim); color: var(--green); }
.tag-region { background: var(--purple-dim); color: var(--purple); }

.freq-mhz {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.freq-num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.freq-unit {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.freq-dir {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-top: 3px;
}

/* Info card */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 4px;
}
.info-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}
.info-list li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.info-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}
.info-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-style: italic;
  line-height: 1.5;
  margin-top: 10px;
}

/* Doppler table */
.doppler-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dt-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  gap: 4px;
}
.dt-row:last-child { border-bottom: none; }
.dt-head {
  background: var(--surface-2);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.dt-freq { color: var(--text); font-weight: 500; }
.dt-val  { color: var(--amber); font-weight: 600; }
.dt-zero { color: var(--text-muted); }

/* SSTV card */
.sstv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}
.sstv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.sstv-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--purple-dim);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sstv-icon svg { width: 18px; height: 18px; }
.sstv-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.sstv-sub   { font-size: 0.73rem; color: var(--text-muted); }

.sstv-modes {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sstv-mode-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.sstv-mode-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple);
  min-width: 70px;
  flex-shrink: 0;
}
.sstv-mode-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sstv-events { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.sstv-event-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.sstv-event-list { display: flex; flex-direction: column; gap: 7px; }
.sstv-event {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.78rem;
}
.se-date {
  font-weight: 600;
  color: var(--amber);
  min-width: 50px;
  flex-shrink: 0;
}
.se-desc { color: var(--text-muted); line-height: 1.4; }

.sstv-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}
.sstv-link:hover { background: var(--accent-dim); text-decoration: none; }

/* Tips grid */
.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.tip-icon  { font-size: 1.4rem; margin-bottom: 7px; }
.tip-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.tip-body  { font-size: 0.73rem; color: var(--text-muted); line-height: 1.5; }

/* Footer note */
.footer-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-faint);
  padding: 16px 0 4px;
  line-height: 1.8;
}
.footer-note a { color: var(--text-muted); }
.footer-note a:hover { color: var(--accent); }

/* ---------- Bottom navigation ---------- */
#bottomNav {
  flex-shrink: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  padding: 0 4px;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--accent); }
.nav-btn:not(.active):hover { color: var(--text-muted); }

/* ---------- Custom Leaflet popup ---------- */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-md) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 10px 14px !important; font-family: var(--font-sans) !important; }

/* ---------- Scrollbar (non-map panes) ---------- */
#tabPasses, #tabRadio { scrollbar-width: thin; }

/* ---------- Responsive: landscape ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .header-inner { padding: 8px 16px 6px; }
  .telemetry-strip { padding: 4px 16px 8px; }
  .telem-value { font-size: 0.88rem; }
  .brand-name { font-size: 1rem; }
}

/* ---------- Responsive: tablet+ ---------- */
@media (min-width: 600px) {
  .tips-grid { grid-template-columns: repeat(4, 1fr); }
  .pass-metrics { grid-template-columns: repeat(6, 1fr); }
}
