@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@300;400;500;600&display=swap");

/* ── Dark (default) — logo: white on black ── */
:root,
[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #080808;
  --bg-card: #0c0c0c;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.48);
  --fg-subtle: rgba(255, 255, 255, 0.28);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #ffffff;
  --accent-inv: #000000;
  --logo-filter: none;
  --glass: rgba(0, 0, 0, 0.88);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  --positive: rgba(255, 255, 255, 0.92);
  --negative: rgba(255, 255, 255, 0.38);
  --color-up: #ef4444;
  --color-down: #3b82f6;
  color-scheme: dark;
}

/* ── Light — inverted ── */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --bg-card: #f5f5f5;
  --fg: #000000;
  --fg-muted: rgba(0, 0, 0, 0.52);
  --fg-subtle: rgba(0, 0, 0, 0.32);
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.2);
  --accent: #000000;
  --accent-inv: #ffffff;
  --logo-filter: invert(1);
  --glass: rgba(255, 255, 255, 0.92);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.06);
  --positive: #000000;
  --negative: rgba(0, 0, 0, 0.38);
  --color-up: #dc2626;
  --color-down: #2563eb;
  color-scheme: light;
}

:root {
  --radius: 2px;
  --radius-lg: 4px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* `hidden` attribute must always win over component display rules
   (otherwise overlays like the upsell sheet get stuck on top and eat taps). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  overscroll-behavior: none;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: background 0.45s var(--ease), color 0.45s var(--ease);
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

/* ── Header ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: calc(28px + var(--safe-t)) 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.brand-logo {
  width: min(92vw, 360px);
  height: auto;
  max-height: 128px;
  display: block;
  filter: var(--logo-filter);
  transition: filter 0.45s var(--ease);
  object-fit: contain;
  object-position: center center;
}

.brand-meta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.brand-meta {
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  text-align: center;
}

.brand-meta-detail {
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  text-align: center;
  opacity: 0.9;
  line-height: 1.5;
  max-width: 92vw;
}

.pro-badge {
  letter-spacing: 0.32em;
  opacity: 0.75;
}

.pro-entry-btn {
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.ad-slot {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.ad-slot.show {
  display: block;
}

.ad-label {
  display: block;
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 10px;
}

.house-ad {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px dashed var(--line);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--fg);
}

.house-ad strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.house-ad span {
  font-size: 0.68rem;
  color: var(--fg-muted);
}

/* ── Daily Brief ── */
.daily-brief {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
}

.brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.brief-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brief-streak {
  font-size: 0.6rem;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
}

.brief-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-chip {
  font-size: 0.66rem;
  padding: 6px 10px;
  border: 1px solid var(--line);
  color: var(--fg);
  white-space: nowrap;
}

.brief-chip small {
  font-size: 0.58rem;
}

.brief-tip {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

.brief-tip-label {
  display: block;
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 6px;
}

/* ── PRO in-app tools ── */
.tool-note {
  font-size: 0.66rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 4px 0 12px;
}

.tool-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--fg-muted);
}

.tool-field input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 10px 12px;
  width: 100%;
}

.tool-form .btn {
  grid-column: 1 / -1;
}

.tool-locked {
  position: relative;
}

.pro-activate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.pro-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.pro-msg {
  font-size: 0.68rem;
  color: var(--fg-muted);
  margin: 0;
  min-height: 1.2em;
}

.pro-row.unlocked .metric {
  color: var(--fg);
}

.pro-row.locked {
  opacity: 0.72;
}

html.is-pro .ad-slot {
  display: none !important;
}

/* ── Paywall / PRO pricing ── */
.pro-pricing {
  border: 1px solid var(--line-strong);
  padding: 28px 22px 24px;
  text-align: center;
  margin-bottom: 8px;
  background: var(--bg-elevated);
}

.pro-pricing.is-active { opacity: 0.6; }

.pro-pitch-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.pro-pitch-sub {
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 12px 0 20px;
  letter-spacing: 0.02em;
}

.pro-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.pro-price-anchor {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--fg-subtle);
  text-decoration: line-through;
}

.pro-price {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1;
}

.pro-price-note {
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.btn-buy {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--accent-inv);
  font-weight: 600;
}

.btn-buy:active { opacity: 0.8; }

.pro-trust {
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 14px 0 0;
}

.pro-tag {
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  border: 1px solid var(--line-strong);
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Locked content ── */
.locked-stack { position: relative; border: 1px solid var(--line); }

.locked-rows {
  filter: blur(6px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.lock-overlay .paywall-cta { width: auto; padding: 12px 28px; }

.lock-icon svg,
.lock-mini svg {
  width: 20px;
  height: 20px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 1.5;
}

.locked-more {
  width: 100%;
  border: none;
  border-top: 1px solid var(--line);
  cursor: pointer;
  background: var(--bg-elevated);
  font-family: inherit;
}

.locked-more .body strong { color: var(--fg); }
.lock-mini svg { width: 16px; height: 16px; opacity: 0.7; }

/* ── Upsell sheet ── */
.upsell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.upsell-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  border-top: 1px solid var(--line-strong);
  padding: 30px 24px calc(26px + var(--safe-b));
  text-align: center;
  animation: sheet-up 0.35s var(--ease);
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.upsell-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.upsell-body {
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 12px 0 20px;
}

.upsell-later {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px;
}

/* ── Favorites ── */
.fav-btn {
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  flex-shrink: 0;
}

.fav-btn.faved { color: var(--color-up); }

/* ── Sparkline ── */
.sparkline {
  display: block;
  width: 60%;
  height: 28px;
  margin: 16px auto 0;
}

.sparkline polyline {
  fill: none;
  stroke: var(--fg-muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Pull to refresh ── */
.ptr-indicator {
  position: fixed;
  top: calc(-44px + var(--safe-t));
  left: 50%;
  margin-left: -18px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease);
}

.ptr-indicator span {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--fg-muted);
  border-bottom: 1.5px solid var(--fg-muted);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.25s var(--ease);
}

.ptr-indicator.ready span { transform: rotate(225deg) translateY(-1px); }

.ptr-indicator.loading span {
  border: 1.5px solid var(--fg-subtle);
  border-top-color: var(--fg);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  transform: none;
  animation: spin 0.7s linear infinite;
}

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

.topbar-actions {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions-left {
  right: auto;
  left: 14px;
}

.guide-entry-btn {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
}

.lang-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  padding: 2px;
}

.lang-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.lang-btn.active {
  background: var(--fg);
  color: var(--accent-inv);
}

.guide-disclaimer {
  font-size: 0.62rem;
  line-height: 1.6;
  color: var(--fg-subtle);
  margin: 28px 0 8px;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.theme-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.theme-btn:hover { border-color: var(--line-strong); }
.theme-btn:active { background: var(--bg-card); }

.theme-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.25;
}

.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
[data-theme="light"] .theme-btn .icon-sun { display: block; }
[data-theme="light"] .theme-btn .icon-moon { display: none; }

/* ── Screens ── */
.screen {
  display: none;
  padding: 28px 22px 12px;
  animation: rise 0.5s var(--ease);
}
.screen.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.section-title:first-child { margin-top: 0; }

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  padding-bottom: 8px;
  text-align: left;
  color: var(--fg-muted);
  transition: color 0.25s var(--ease);
}

.section-link::after {
  content: "?";
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--fg-subtle);
}

.section-link:active { color: var(--fg); }

/* ── Fear & Greed ── */
.fng-card {
  border: 1px solid var(--line);
  padding: 28px 24px 22px;
  text-align: center;
  background: var(--bg-elevated);
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.fng-card.zone-fear,
.fng-card.zone-extreme-fear {
  border-color: color-mix(in srgb, var(--color-down) 28%, var(--line));
}

.fng-card.zone-greed,
.fng-card.zone-extreme-greed {
  border-color: color-mix(in srgb, var(--color-up) 28%, var(--line));
}

.fng-value {
  font-family: var(--font-display);
  font-size: 4.25rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.zone-fear .fng-value,
.zone-extreme-fear .fng-value {
  color: color-mix(in srgb, var(--color-down) 42%, var(--fg));
}

.zone-greed .fng-value,
.zone-extreme-greed .fng-value {
  color: color-mix(in srgb, var(--color-up) 42%, var(--fg));
}

.fng-label {
  color: var(--fg-muted);
  margin-top: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.fng-meter {
  position: relative;
  height: 2px;
  margin: 22px 4px 0;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-down) 55%, transparent) 0%,
    var(--fg-subtle) 50%,
    color-mix(in srgb, var(--color-up) 55%, transparent) 100%
  );
  opacity: 0.85;
}

.fng-marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 12px;
  background: var(--fg);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px var(--bg);
}

.fng-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* ── Guide ── */
.guide-intro {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}

.guide-item {
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--bg);
}

.guide-item:last-child { border-bottom: 1px solid var(--line); }

.guide-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
}

.guide-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.guide-chevron {
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--fg-muted);
  border-bottom: 1px solid var(--fg-muted);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
  margin-top: -4px;
}

.guide-item.open .guide-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.guide-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.guide-item.open .guide-body { display: block; }

.guide-short {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 14px 0 12px;
  letter-spacing: 0.02em;
}

.guide-text {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.guide-text p { margin: 0 0 12px; }
.guide-text p:last-child { margin-bottom: 0; }
.guide-text strong { font-weight: 600; }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: var(--bg);
  padding: 18px 16px;
  transition: background 0.45s var(--ease);
}

.stat .label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.stat .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.stat .sub { color: var(--fg-muted); font-size: 0.72rem; margin-top: 4px; }

/* ── Stats ── */

/* ── Lists ── */
.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }

.row {
  background: var(--bg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.45s var(--ease);
}

.row .icon {
  font-family: var(--font-display);
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
  color: var(--fg-muted);
}

.row .body { flex: 1; min-width: 0; }

.row .body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.row .body span {
  color: var(--fg-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin-top: 3px;
  display: block;
}

.row .body span.up { color: var(--color-up); font-weight: 500; }
.row .body span.down { color: var(--color-down); font-weight: 500; }

.row .apr,
.row .metric {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  text-align: right;
  letter-spacing: 0.02em;
}

.row .metric small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--fg-subtle);
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.pos, .up, .val-up { color: var(--color-up) !important; }
.neg, .down, .val-down { color: var(--color-down) !important; }

.row .apr.up,
.row .apr.down,
.row .metric.up,
.row .metric.down,
.stat .value.up,
.stat .value.down {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ── Chips ── */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.chip.active {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--accent-inv);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.btn-secondary { margin-top: 10px; }
.btn:active { background: var(--fg); color: var(--accent-inv); }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  max-width: 430px;
  margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--line);
  padding: 14px 8px calc(14px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--fg-subtle);
  font-size: 0.46rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: color 0.3s var(--ease);
}

.nav-btn .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.nav-btn.active {
  color: var(--fg);
}

.nav-btn.active .dot {
  background: var(--fg);
  transform: scale(1);
}

.loading, .error-msg {
  text-align: center;
  color: var(--fg-muted);
  padding: 32px 16px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.install-banner {
  display: none;
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  line-height: 1.6;
}
.install-banner.show { display: block; }

@media (min-width: 431px) {
  .bottom-nav,
  .topbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
