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

html, body {
  height: 100%;
  background-color: var(--color-backdrop);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App column — full-bleed phone frame centered on desktop ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  background-color: var(--color-app);
  position: relative;
  overflow: hidden;
}

/* ── Scrollable content area (scrollbar hidden) ── */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;          /* Firefox */
}
.tab-content::-webkit-scrollbar { width: 0; height: 0; }

/* Panels are full-bleed — each section supplies its own padding. */
.tab-panel { display: none; min-height: 100%; }
.tab-panel.active {
  display: block;
  animation: panel-in 0.18s ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom tab nav (fixed, centered to the column, above the intro overlay) ── */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  background-color: var(--color-nav);
  border-top: 1px solid var(--color-hairline);
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 540px;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-nav-idle);
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.nav-tab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: stroke 0.15s;
}

.nav-tab:active { color: var(--color-gold); }
.nav-tab.active { color: var(--color-gold-light); }

/* ── Keyboard focus visibility (WCAG 2.4.7) ── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}
.nav-tab:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: -3px;
}

/* ── Desktop framing ── */
@media (min-width: 540px) {
  #app {
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
  }
}
