/* =============================================
   BASE — Reset, app shell y sistema de pantallas
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  color: var(--text);
}

/* ── App shell ── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Sistema de pantallas ── */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--safe-top);

  /* Transición al cambiar pantalla */
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* ── Scroll utilitario ── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.scroll-area::-webkit-scrollbar {
  display: none;
}

/* ── Título de pantalla ── */
.screen-title {
  padding: 14px var(--gap-xl) 10px;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
