@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #06080f;
  --bg-secondary: #0c1020;
  --bg-card: rgba(15, 20, 40, 0.7);
  --bg-card-hover: rgba(20, 28, 58, 0.8);
  --bg-glass: rgba(255,255,255,0.04);
  --header-bg: rgba(6,8,15,0.85);
  --bg-inset: rgba(0,0,0,0.3);
  --border: rgba(255,255,255,0.08);
  --border-glow: rgba(0,212,255,0.25);
  --text-primary: #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted: #5a6478;
  --accent-blue: #00d4ff;
  --accent-green: #00ff88;
  --accent-purple: #7c3aed;
  --accent-amber: #fbbf24;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --cat-msi: #00d4ff;
  --cat-sar: #f97316;
  --cat-hyper: #a855f7;
  --cat-moderate: #22c55e;
  --cat-commercial: #eab308;
  --cat-legacy: #6b7280;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(0,212,255,0.15);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(0,0,0,0.05);
  --header-bg: rgba(255,255,255,0.85);
  --bg-inset: rgba(0,0,0,0.03);
  --border: rgba(0,0,0,0.12);
  --border-glow: rgba(2,132,199,0.3);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-green: #16a34a;
  --accent-purple: #6d28d9;
  --accent-amber: #d97706;
  --cat-msi: #0284c7;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 20px rgba(2,132,199,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; transition: background-color var(--transition), border-color var(--transition); }

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; width: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 3px; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; width: 100%; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.header__inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.header__logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; color: var(--text-primary);
  text-decoration: none;
}
.header__logo span { background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== NAV TABS ===== */
.nav-tabs {
  display: flex; gap: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  padding: 4px;
}
.nav-tab {
  padding: 8px 20px; border: none; border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-glass); }
.nav-tab.active {
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,58,237,0.15));
  color: var(--accent-blue);
  box-shadow: inset 0 0 0 1px var(--border-glow);
}

/* ===== HERO ===== */
.hero {
  position: relative; padding: 4rem 2rem 3rem; margin-top: 64px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(124,58,237,0.06) 0%, transparent 50%);
  overflow: hidden;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  line-height: 1.1; margin-bottom: 0.75rem;
}
.hero__title span {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary); max-width: 650px; margin: 0 auto 2rem;
}
.hero__stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
}
.hero__stat { text-align: center; }
.hero__stat-num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ===== SEARCH ===== */
.header-search { display: none; } /* Hidden on desktop */
.search-wrap {
  max-width: 560px; margin: 2rem auto 0; position: relative;
}
.search-input {
  width: 100%; padding: 14px 20px 14px 48px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); color: var(--text-primary);
  font-family: inherit; font-size: 0.95rem;
  transition: var(--transition); outline: none;
}
.search-input:focus { border-color: var(--accent-blue); box-shadow: var(--shadow-glow); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
#headerSearchWrap .search-input { padding: 8px 16px 8px 36px; font-size: 0.85rem; border-radius: var(--radius-lg); }

/* ===== MAIN ===== */
.main { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* ===== SECTION TABS CONTENT ===== */
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== FILTER CHIPS ===== */
.filters { 
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; 
  max-width: 1200px; margin-left: auto; margin-right: auto;
}
.filter-chip {
  padding: 6px 16px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--bg-glass);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.filter-chip:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.filter-chip.active {
  background: rgba(0,212,255,0.12);
  border-color: var(--accent-blue); color: var(--accent-blue);
  padding-right: 10px;
}
.filter-chip .count {
  background: rgba(255,255,255,0.08); padding: 1px 7px;
  border-radius: 100px; font-size: 0.7rem;
}
.filter-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  margin-left: 6px; transition: var(--transition);
  color: var(--text-muted); opacity: 0.8;
}
.filter-remove:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ef4444; opacity: 1;
}

/* ===== SATELLITE CARDS ===== */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.sat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  height: max-content;
}
.sat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--cat-color, var(--accent-blue));
}
.sat-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.sat-card__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.sat-card__name { font-size: 1.05rem; font-weight: 700; }
.sat-card__operator { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.sat-card__badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge--active { background: rgba(0,255,136,0.12); color: var(--accent-green); }
.badge--decom { background: rgba(107,114,128,0.2); color: var(--cat-legacy); }
.badge--free { background: rgba(0,255,136,0.12); color: var(--accent-green); }
.badge--paid { background: rgba(251,191,36,0.12); color: var(--accent-amber); }
.badge--cat {
  background: rgba(255,255,255,0.06);
  color: var(--cat-color, var(--text-secondary));
  border: 1px solid currentColor;
  opacity: 0.8;
}

.sat-card__specs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 1rem 0;
}
.spec { display: flex; flex-direction: column; }
.spec__label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.spec__value { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

.sat-card__expand { color: var(--text-muted); font-size: 0.8rem; display: flex; align-items: center; gap: 4px; }
.sat-card__expand svg { transition: var(--transition); }
.sat-card.expanded .sat-card__expand svg { transform: rotate(180deg); }

/* ===== EXPANDED DETAIL ===== */
.sat-detail {
  display: none; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}
.sat-card.expanded .sat-detail { display: block; }

.band-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.8rem; margin: 0.75rem 0;
}
.band-table th {
  text-align: left; padding: 8px 10px;
  color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.band-table td {
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.band-table tr:hover td { color: var(--text-primary); background: rgba(255,255,255,0.02); }
.band-color {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; margin-right: 6px; vertical-align: middle;
}

.stac-section { margin-top: 1.5rem; }
.stac-section h4 { font-size: 0.8rem; color: var(--accent-blue); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.stac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.stac-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: var(--bg-inset); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  font-size: 0.8rem; transition: var(--transition);
}
.stac-item:hover { border-color: var(--accent-blue); }
.stac-item__provider { color: var(--text-secondary); font-weight: 500; }
.stac-item__url {
  font-family: 'JetBrains Mono', monospace; color: var(--accent-green);
  font-size: 0.75rem; word-break: break-all; flex: 1;

}
.stac-copy {
  background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent-blue); padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 0.7rem; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.stac-copy:hover { background: rgba(0,212,255,0.2); }

/* ===== INDEX TABLE ===== */
.index-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.index-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.index-table thead { background: var(--bg-secondary); position: sticky; top: 0; }
.index-table th {
  padding: 12px 14px; text-align: left;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.index-table th:hover { color: var(--text-primary); }
.index-table td {
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary); vertical-align: middle;
}
.index-table tr { cursor: pointer; transition: var(--transition); }
.index-table tbody tr:hover { background: rgba(0,212,255,0.04); }
.index-table tbody tr:hover td { color: var(--text-primary); }

.idx-name { font-weight: 600; color: var(--text-primary); }
.idx-abbr {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; color: var(--accent-blue);
}
.idx-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: var(--accent-green);
}
.idx-cat-badge {
  padding: 2px 8px; border-radius: 100px;
  font-size: 0.7rem; font-weight: 500;
  background: rgba(255,255,255,0.06);
}
.idx-cat-badge.vegetation { color: #22c55e; background: rgba(34,197,94,0.1); }
.idx-cat-badge.water { color: #3b82f6; background: rgba(59,130,246,0.1); }
.idx-cat-badge.burn { color: #ef4444; background: rgba(239,68,68,0.1); }
.idx-cat-badge.soil { color: #a16207; background: rgba(161,98,7,0.1); }
.idx-cat-badge.snow { color: #67e8f9; background: rgba(103,232,249,0.1); }
.idx-cat-badge.urban { color: #a855f7; background: rgba(168,85,247,0.1); }
.idx-cat-badge.geology { color: #f97316; background: rgba(249,115,22,0.1); }
.idx-cat-badge.chlorophyll { color: #84cc16; background: rgba(132,204,22,0.1); }
.idx-cat-badge.moisture { color: #06b6d4; background: rgba(6,182,212,0.1); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 2rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 700px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.95) translateY(10px); } to { opacity:1; transform: scale(1) translateY(0); } }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.modal__title { font-size: 1.3rem; font-weight: 800; }
.modal__close {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-secondary); width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; transition: var(--transition);
}
.modal__close:hover { color: var(--text-primary); border-color: var(--accent-blue); }
.modal__formula-box {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.25rem;
  text-align: center; margin-bottom: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem; color: var(--accent-green);
}
.modal__section { margin-bottom: 1.25rem; }
.modal__section h4 {
  font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 0.5rem;
}
.modal__section p, .modal__section li {
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7;
}
.modal__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal__tag {
  padding: 4px 12px; border-radius: 100px;
  background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.15);
  color: var(--accent-blue); font-size: 0.78rem; font-weight: 500;
}

.sat-formula-list { list-style: none; }
.sat-formula-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}
.sat-formula-list .sat-name { color: var(--text-primary); font-weight: 500; }
.sat-formula-list .sat-calc {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-green); font-size: 0.8rem;
}

/* ===== CROSS-REFERENCE ===== */
.xref-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.xref-table { border-collapse: collapse; font-size: 0.75rem; width: 100%; }
.xref-table th, .xref-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: center; }
.xref-table thead th {
  background: var(--bg-secondary); color: var(--text-muted);
  font-weight: 600; position: sticky; top: 0; writing-mode: vertical-rl;
  text-orientation: mixed; height: 120px; white-space: nowrap;
}
.xref-table tbody th {
  background: var(--bg-secondary); color: var(--text-primary);
  font-weight: 600; text-align: left; white-space: nowrap; position: sticky; left: 0;
}
.xref-check { color: var(--accent-green); font-size: 1rem; }
.xref-none { color: var(--text-muted); font-size: 0.7rem; }

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.8rem;
  margin-top: 3rem;
}
.footer a { color: var(--accent-blue); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted); font-size: 1rem;
}
.no-results svg { margin-bottom: 1rem; opacity: 0.3; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* === Global === */
  html { font-size: 13px; }
  body { padding-top: 0; }

  /* === Fixed Header === */
  .header {
    position: fixed; top: 0; left: 0; right: 0;
    width: auto; padding: 0 2.5%;
    box-sizing: border-box; z-index: 100;
  }
  .header__inner {
    flex-wrap: wrap; height: auto;
    padding: 10px 0; gap: 6px;
    justify-content: space-between;
  }
  .header__logo { font-size: 1rem; gap: 6px; }
  .header__logo svg { width: 22px; height: 22px; }

  /* === Header Actions === */
  #mobileMenuToggle { display: flex !important; }
  .header-actions { gap: 6px; }
  .nav-tabs {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    padding: 0; border-bottom: 2px solid var(--accent-blue);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    gap: 0; z-index: 200;
  }
  .nav-tabs.menu-open { display: flex; }
  .nav-tab {
    width: 100%; text-align: left;
    padding: 14px 20px; font-size: 0.9rem;
    border-radius: 0; border-bottom: 1px solid var(--border);
    color: var(--text-primary);
  }
  .nav-tab:hover { background: var(--bg-glass); }
  .nav-tab.active {
    box-shadow: inset 4px 0 0 0 var(--accent-blue);
    background: rgba(0,212,255,0.08);
    color: var(--accent-blue);
  }

  /* === Header Search === */
  #headerSearchWrap {
    display: block; flex-basis: 100%; width: 100%;
    position: relative; margin-top: 6px;
  }
  #headerSearchInput { font-size: 0.8rem; padding: 8px 12px 8px 30px; }
  .search-wrap { display: none; }

  /* === Push content below fixed header === */
  .hero { margin-top: 90px; }

  /* === All content inside 95% safe zone === */
  .hero, .main, .footer {
    width: 95%; max-width: 95%;
    margin-left: auto; margin-right: auto;
    padding-left: 0; padding-right: 0;
    box-sizing: border-box;
  }

  /* === Hero === */
  .hero {
    padding-top: 1.5rem; padding-bottom: 1.5rem;
    text-align: center;
  }
  .hero__title { font-size: 1.6rem; line-height: 1.2; word-break: break-word; }
  .hero__sub { font-size: 0.85rem; }
  .hero__stats { gap: 2rem; }
  .hero__stat-num { font-size: 1.6rem; }
  .hero__stat-label { font-size: 0.65rem; }

  /* === Filters (horizontal scroll inside 95% zone) === */
  .filters {
    flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    gap: 6px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-chip { white-space: nowrap; flex-shrink: 0; font-size: 0.75rem; padding: 5px 12px; }

  /* === Cards === */
  .card-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .sat-card { padding: 1rem; }
  .sat-card__head { flex-direction: column; gap: 4px; }
  .sat-card__name { font-size: 0.95rem; word-break: break-word; }
  .sat-card__operator { font-size: 0.7rem; }
  .sat-card__badges { flex-wrap: wrap; gap: 4px; }
  .badge { font-size: 0.6rem; padding: 2px 7px; }
  .sat-card__specs { grid-template-columns: 1fr; gap: 6px; }
  .spec__label { font-size: 0.65rem; }
  .spec__value { font-size: 0.8rem; }

  /* === Tables === */
  .index-table-wrap, .xref-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .index-table { font-size: 0.72rem; }
  .index-table th, .index-table td { padding: 6px 8px; }
  .xref-table thead th { height: 70px; font-size: 0.6rem; }

  /* === Modals === */
  .modal-overlay { padding: 1rem; }
  .modal { padding: 1.25rem; margin: 0; width: 95%; max-width: 95%; }
  .modal__title { font-size: 1.1rem; }
  .modal__formula-box { font-size: 1rem; padding: 1rem; }

  /* === STAC items === */
  .stac-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .stac-item__provider { min-width: unset; }
  .stac-item__url { font-size: 0.65rem; margin: 0; }

  /* === No Results === */
  .no-results { padding: 2rem 1rem; font-size: 0.9rem; }

  /* === Range Legend === */
  .range-legend { grid-template-columns: 1fr 1fr; font-size: 0.7rem; }
}

@media (max-width: 360px) {
  html { font-size: 12px; }
  .hero__title { font-size: 1.4rem; }
  .hero__stat-num { font-size: 1.4rem; }
  .header__logo span { font-size: 0.9rem; }
  .filter-chip { padding: 4px 10px; font-size: 0.7rem; }
}

/* Splash Screen */
#splashScreen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#splashScreen.hide { opacity: 0; visibility: hidden; }
.splash-logo {
  width: 96px; height: 96px; margin-bottom: 24px;
  border-radius: 16px;
  object-fit: cover;
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .7; transform: scale(1.05); } }
.splash-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.splash-author { font-size: 1rem; color: var(--text-muted); }

/* Range Categories */
.range-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 12px;
}
.range-segment {
  flex: 1;
}
.range-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.range-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.range-color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ===== LEARNING & KNOWLEDGE BASE ===== */
.tutorial-body h3 {
  font-size: 1.1rem;
  color: var(--accent-blue);
  margin: 1.5rem 0 0.75rem;
}
.tutorial-body h3:first-child { margin-top: 0; }
.tutorial-body p { margin-bottom: 1rem; }
.tutorial-body ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.tutorial-body li { margin-bottom: 0.5rem; }
.tutorial-body pre {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.kb-item { transition: var(--transition); }
.kb-question:hover { background: rgba(255,255,255,0.03); }
.kb-answer { animation: slideDown 0.3s ease-out; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== AUTH SCREEN ===== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.auth-overlay.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 24px; padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { width: 64px; height: 64px; border-radius: 12px; margin-bottom: 16px; }
.auth-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-left: 4px; }

.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.auth-form input {
  width: 100%; padding: 12px 16px 12px 48px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px; color: var(--text-primary);
  font-family: inherit; font-size: 0.95rem; outline: none;
  transition: var(--transition);
}
.auth-form input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15); }

.auth-btn {
  margin-top: 10px; padding: 14px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none; border-radius: 12px;
  color: white; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: var(--transition);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(124, 58, 237, 0.4); }
.auth-btn:active { transform: translateY(0); }

.auth-error {
  font-size: 0.85rem; color: #f87171; text-align: center;
  background: rgba(248, 113, 113, 0.1); padding: 8px; border-radius: 8px;
}
.auth-footer { margin-top: 32px; text-align: center; font-size: 0.75rem; color: var(--text-muted); }
