/* Base: reset, elementos nativos y estructura de la app (header, main, nav) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Sin zoom por doble toque (el pellizco sigue disponible) y sin rebote ni arrastre lateral del fondo */
html {
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow-x: clip;
}

body {
  overscroll-behavior: none;
  overflow-x: clip;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--lh-base);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

input, select, textarea {
  width: 100%;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  font: inherit;
  font-size: var(--text-md); /* 16px evita el zoom automático de iOS */
}
textarea { min-height: 5.5rem; }
input[type="color"] { padding: var(--sp-1); height: var(--tap); }
/* iOS da a fecha y hora un ancho propio que desborda la columna: se anula */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%;
  min-height: var(--tap); text-align: left;
}
input::-webkit-date-and-time-value { text-align: left; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--c-bg);
  padding: calc(var(--sp-3) + env(safe-area-inset-top)) var(--sp-4) var(--sp-2);
}
.app-header__logo {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--kit-stripes);
  border: 1px solid var(--c-line-strong);
}
.app-header__logo--img { width: var(--logo); height: var(--logo); background: none; border: 0; border-radius: 0; }
.app-header__logo--img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.app-header__title { flex: 1; font-size: var(--text-lg); font-weight: var(--fw-black); letter-spacing: -0.01em; }
.app-header__btn {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  background: var(--c-surface); border: 0; border-radius: 50%;
}
.icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }

/* Contenido */
.app-main { max-width: 40rem; margin: 0 auto; padding: var(--sp-4); }

.section-title {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.section-title:first-child { margin-top: 0; }

/* Navegación inferior */
.app-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex;
  background: var(--c-nav);
  border-top: 1px solid var(--c-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.app-nav__btn {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) 0;
  background: none; border: 0;
  color: var(--c-muted);
  font-size: var(--text-base);
}
.app-nav__icon {
  display: grid; place-items: center;
  width: 3.25rem; height: 2rem;
  border-radius: var(--r-pill);
}
.app-nav__label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-nav__btn--on { color: var(--c-text); font-weight: var(--fw-bold); }
.app-nav__btn--on .app-nav__icon { background: var(--c-ink); color: var(--c-on-ink); }
