*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-body);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--text); margin: 0; line-height: 1.15; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }

/* Contenedor de la app: mobile-first, centrado en escritorio */
#app {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
}
#screen { min-width: 0; }
.screen {
  padding: 16px var(--pad) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
  min-width: 0;
}
.screen.no-nav { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > * { min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.label {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-16 { width: 16px; height: 16px; }
.icon-24 { width: 24px; height: 24px; }
.icon-28 { width: 28px; height: 28px; }
