:root {
  --bg: #0b1220;
  --bg-elev: #111a2e;
  --bg-card: #152038;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e8eef9;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.14);
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 212, 191, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.06), transparent);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 10px;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #134e4a, #2dd4bf);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #042f2e;
  flex-shrink: 0;
}
.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.brand .meta {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pill {
  font-size: 0.68rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.25);
  letter-spacing: 0.02em;
}

main { padding: 14px 14px 8px; max-width: 480px; margin: 0 auto; }

.panel { display: none; }
.panel.active { display: block; animation: fade 0.22s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.hero h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.sources-note {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
}
.card p, .card .body {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.q-num {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.metric:last-child { border-bottom: none; padding-bottom: 0; }
.metric:first-child { padding-top: 0; }
.metric .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric .value {
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.metric .note {
  font-size: 0.72rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}
.tag.primary { background: rgba(45, 212, 191, 0.15); color: var(--accent); }
.tag.podcast { background: rgba(251, 191, 36, 0.12); color: var(--warn); }
.tag.wire { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

.intel-link {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(11, 18, 32, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 2px 8px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav button.active {
  color: var(--accent);
}
.bottom-nav button:active { opacity: 0.75; }

.install-banner {
  display: none;
  margin: 0 14px 10px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text);
}
.install-banner.show { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install-banner button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #042f2e;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 4px 2px 8px;
  font-weight: 600;
}

@media (min-width: 480px) {
  main { padding-left: 18px; padding-right: 18px; }
}
