/* Reset mínimo y estructura general de la app (mobile first). */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-700); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Contenedor de la app */
#app { min-height: 100dvh; }

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.shell__main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + var(--sp-6));
}
.shell--no-nav .shell__main { padding-bottom: var(--sp-8); }

.stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm{ display: flex; flex-direction: column; gap: var(--sp-2); }
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }

.view-enter { animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* Tablet */
@media (min-width: 768px) {
  .shell__main { max-width: 720px; padding-left: var(--sp-6); padding-right: var(--sp-6); }
}

/* Escritorio: navegación lateral en lugar de barra inferior */
@media (min-width: 1024px) {
  .shell--with-nav { flex-direction: row; }
  .shell--with-nav .shell__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .shell__main { max-width: 880px; padding-bottom: var(--sp-8); }
}
