/* Estilos de la app. Móvil primero, una mano; con ventana ancha (≥ 600 px) la
   página usa el ancho (ver «Ancho adaptativo» al final).

   Tokens (ARCHITECTURE.md, «Interfaz»):
   - Neutros por tema, sin tinte: --base (página), --card (tarjetas y botones), --card2
     (chips y botones secundarios), --rule (líneas), --ink, --muted, --danger. Claro por
     defecto; oscuro con prefers-color-scheme o forzado con <html data-theme="dark|light">
     (Ajustes → Claro/Oscuro, por dispositivo; lo pone el script de index.html antes de pintar).
   - Color del bebé: <html data-color="teal|coral|violet|amber|blue|green"> → --accent
     (relleno puro), --on-accent (texto encima), --strong (texto e iconos del color) y
     --accent2 (secundario claro), sacados de la paleta del tema (--c-*, --c-*-on, --c-*-ink,
     --c-*-2). Se recalculan en cada [data-color]: --band / --on-band (cabecera y botón en
     curso: el relleno puro), --edge1..3, --tint, --nap, --soft.
   - Rangos previstos en los botones: --rng-now-ink / --rng-now-bg (dentro del rango) y
     --rng-past (pasado: el -ink apagado hacia --rng-grey); medicina con la hora
     pasada sin apuntar: --due-bg, --due-ink, --due-edge.
   - Contraste comprobado (WCAG AA, ≥ 4,5:1 calculado, no a ojo) para texto con
     cada color de bebé en los dos temas. */

/* ── Letra: Red Hat Text y Red Hat Display (SIL OFL, public/fonts/OFL.txt), alojadas aquí ── */
@font-face {
  font-family: "Red Hat Text";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/red-hat-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Red Hat Display";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/red-hat-display-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tema claro (por defecto) ── */
:root {
  color-scheme: light;
  --font-text: "Red Hat Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Red Hat Display", "Red Hat Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Neutros limpios: casi blanco, sin tinte del color del bebé */
  --base: #f7f7f8;
  --card: #ffffff;
  --card2: #eff0f2;
  --rule: #dcdee3;
  --ink: #141518;
  --muted: #4b5058;
  --danger: #b42318;
  --shade: rgba(15, 17, 20, 0.42);
  --shadow: 0 12px 36px rgba(15, 17, 20, 0.2);

  /* Cuánto color lleva el tinte suave (barra de día pasado, día marcado en Estadísticas) */
  --tint-p: 14%;

  /* Papel pintado del fondo (img/wallpaper.svg, en el color del bebé). 0 lo apaga. */
  --wallpaper-opacity: 0.08;
  /* Gris hacia el que se apaga un rango ya pasado (≥ 5,2:1 sobre la tarjeta con cada color) */
  --rng-grey: #6c7076;

  /* Colores de bebé (ARCHITECTURE.md, «Interfaz»). Por color: relleno puro (banda, botones elegidos,
     barras, bordes, papel pintado), -on (texto sobre el relleno), -ink (texto e iconos del color
     sobre blanco o --card2) y -2 (secundario claro: siestas en las gráficas, viñetas).
     Calculado: -on/relleno ≥ 5:1; -ink ≥ 5:1 sobre --card2 y ≥ 4,7:1 sobre el tinte.
     Naranja y turquesa puros no dan contraste con texto blanco: llevan texto oscuro encima. */
  --c-coral: #dd131e;  --c-coral-on: #ffffff;  --c-coral-ink: #cc111b;  --c-coral-2: #fb877c;
  --c-amber: #e07012;  --c-amber-on: #1e130d;  --c-amber-ink: #b1430a;  --c-amber-2: #fcaa2c;
  --c-green: #0d8124;  --c-green-on: #ffffff;  --c-green-ink: #0b7721;  --c-green-2: #26d044;
  --c-teal: #15a395;   --c-teal-on: #0b1412;   --c-teal-ink: #0b736b;   --c-teal-2: #26c7b7;
  --c-blue: #0a67ef;   --c-blue-on: #ffffff;   --c-blue-ink: #085edc;   --c-blue-2: #80aefb;
  --c-violet: #9635fb; --c-violet-on: #ffffff; --c-violet-ink: #9114f9; --c-violet-2: #bc97fb;
  /* Sin bebé (entrar, primera vez, familia sin bebés): añil */
  --c-none: #4655e9;   --c-none-on: #ffffff;   --c-none-ink: #434fe9;   --c-none-2: #93a9fb;
}

/* ── Tema oscuro: el del sistema, o forzado ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --base: #121212;
    --card: #1c1c1c;
    --card2: #272727;
    --rule: #383838;
    --ink: #ececec;
    --muted: #a8a8a8;
    --danger: #f4a093;
    --shade: rgba(0, 0, 0, 0.62);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    --tint-p: 16%;
    --wallpaper-opacity: 0.09;
    --rng-grey: #8f9094;
    /* Oscuro: el mismo relleno puro que en claro (rojo, verde, azul y morado con texto blanco, ≥ 5:1 y
       ≥ 3,3:1 sobre el fondo); naranja y turquesa, más luminosos, con texto oscuro. -ink: más claro, ≥ 5:1 sobre --card2. */
    --c-coral: #dd131e;  --c-coral-on: #ffffff;  --c-coral-ink: #fd6257;  --c-coral-2: #fca298;
    --c-amber: #fd8d19;  --c-amber-on: #1d140d;  --c-amber-ink: #fda856;  --c-amber-2: #fdc769;
    --c-green: #0d8124;  --c-green-on: #ffffff;  --c-green-ink: #15ad34;  --c-green-2: #2be34b;
    --c-teal: #1bc1b1;   --c-teal-on: #0b1412;   --c-teal-ink: #21e1ce;   --c-teal-2: #32f7e2;
    --c-blue: #0a67ef;   --c-blue-on: #ffffff;   --c-blue-ink: #5694fc;   --c-blue-2: #9abffc;
    --c-violet: #9635fb; --c-violet-on: #ffffff; --c-violet-ink: #af7bfc; --c-violet-2: #c9adfc;
    --c-none: #4655e9;   --c-none-on: #ffffff;   --c-none-ink: #7d94f0;   --c-none-2: #a8bafc;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --base: #121212;
  --card: #1c1c1c;
  --card2: #272727;
  --rule: #383838;
  --ink: #ececec;
  --muted: #a8a8a8;
  --danger: #f4a093;
  --shade: rgba(0, 0, 0, 0.62);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --tint-p: 16%;
  --wallpaper-opacity: 0.09;
  --rng-grey: #8f9094;
  /* Oscuro: el mismo relleno puro que en claro (rojo, verde, azul y morado con texto blanco, ≥ 5:1 y
     ≥ 3,3:1 sobre el fondo); naranja y turquesa, más luminosos, con texto oscuro. -ink: más claro, ≥ 5:1 sobre --card2. */
  --c-coral: #dd131e;  --c-coral-on: #ffffff;  --c-coral-ink: #fd6257;  --c-coral-2: #fca298;
  --c-amber: #fd8d19;  --c-amber-on: #1d140d;  --c-amber-ink: #fda856;  --c-amber-2: #fdc769;
  --c-green: #0d8124;  --c-green-on: #ffffff;  --c-green-ink: #15ad34;  --c-green-2: #2be34b;
  --c-teal: #1bc1b1;   --c-teal-on: #0b1412;   --c-teal-ink: #21e1ce;   --c-teal-2: #32f7e2;
  --c-blue: #0a67ef;   --c-blue-on: #ffffff;   --c-blue-ink: #5694fc;   --c-blue-2: #9abffc;
  --c-violet: #9635fb; --c-violet-on: #ffffff; --c-violet-ink: #af7bfc; --c-violet-2: #c9adfc;
  --c-none: #4655e9;   --c-none-on: #ffffff;   --c-none-ink: #7d94f0;   --c-none-2: #a8bafc;
}

/* ── Color del bebé y lo que se deriva de él (se recalcula en cada [data-color]) ── */
:root { --accent: var(--c-none); --on-accent: var(--c-none-on); --strong: var(--c-none-ink); --accent2: var(--c-none-2); }
[data-color="teal"] { --accent: var(--c-teal); --on-accent: var(--c-teal-on); --strong: var(--c-teal-ink); --accent2: var(--c-teal-2); }
[data-color="coral"] { --accent: var(--c-coral); --on-accent: var(--c-coral-on); --strong: var(--c-coral-ink); --accent2: var(--c-coral-2); }
[data-color="violet"] { --accent: var(--c-violet); --on-accent: var(--c-violet-on); --strong: var(--c-violet-ink); --accent2: var(--c-violet-2); }
[data-color="amber"] { --accent: var(--c-amber); --on-accent: var(--c-amber-on); --strong: var(--c-amber-ink); --accent2: var(--c-amber-2); }
[data-color="blue"] { --accent: var(--c-blue); --on-accent: var(--c-blue-on); --strong: var(--c-blue-ink); --accent2: var(--c-blue-2); }
[data-color="green"] { --accent: var(--c-green); --on-accent: var(--c-green-on); --strong: var(--c-green-ink); --accent2: var(--c-green-2); }
:root, [data-color] {
  /* Fondos y líneas neutros: el color va en la banda, los bordes, los rellenos y el papel pintado. */
  --bg: var(--base);
  --surface: var(--card);
  --surface2: var(--card2);
  --line: var(--rule);
  --tint: color-mix(in oklab, var(--accent) var(--tint-p), var(--card));
  --soft: var(--accent2);
  --nap: var(--accent2);
  /* Banda de arriba y botón en curso: el relleno puro, con su texto */
  --band: var(--accent);
  --on-band: var(--on-accent);
  /* Reborde de los tres botones grandes: el color puro en los tres */
  --edge1: var(--accent);
  --edge2: var(--accent);
  --edge3: var(--accent);
  /* Rango previsto: dentro, píldora del color puro con su texto (≥ 5:1); ya pasado, el -ink
     llevado hacia el gris (≥ 5,2:1 en claro y ≥ 5,5:1 en oscuro). Sobre la banda: ver .act.is-on .rng. */
  --rng-now-ink: var(--on-accent);
  --rng-now-bg: var(--accent);
  --rng-past: color-mix(in oklab, var(--strong) 50%, var(--rng-grey));
  /* Medicina con la hora pasada sin apuntar: relleno puro, texto -on (≥ 5:1) y marco discontinuo
     del color del texto (se ve sobre el relleno). Con la medicina sin destacar: .act.is-due-soft. */
  --due-bg: var(--accent);
  --due-ink: var(--on-accent);
  --due-edge: var(--on-accent);
}

/* ── Ancho: margen lateral y tamaño fijo de los botones grandes ── */
:root {
  --gutter: 16px;
  /* Botón grande: título + dos renglones (desde cuándo y rango previsto, o el pecho). Alto igual
     para los tres, calculado para el texto más largo que pueden enseñar (ARCHITECTURE.md, «Interfaz»). */
  --act-h: 104px;
  --act-min-w: 420px;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* Sin fondo propio: lo lleva <html>, y así el papel pintado (body::before) queda detrás de todo. */
  color: var(--ink);
  font: 17px/1.4 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ── Papel pintado: detrás de la página, nunca dentro de tarjetas ni botones (son opacos) ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--accent);
  opacity: var(--wallpaper-opacity);
  -webkit-mask: url("/img/wallpaper.svg") 0 0 / 320px 320px repeat;
  mask: url("/img/wallpaper.svg") 0 0 / 320px 320px repeat;
}
@media (prefers-contrast: more), (forced-colors: active), print {
  body::before { display: none; }
}

body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sheet:focus-visible { outline: none; }
.ic { display: block; width: 100%; height: 100%; fill: var(--ic-fill, none); stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.center { min-height: 60vh; display: grid; place-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap, .chips.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }

/* ── Páginas sueltas (entrar, invitación, primera vez) ── */
.page {
  padding: calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
.narrow { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.brand { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--strong); letter-spacing: -0.01em; }
/* Cabecera con ilustración: los iconos propios en pastillas de los seis colores (BrandHead, icons.js). */
.brand-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 8px; }
.hero { display: flex; gap: 10px; }
.hero-b {
  width: 46px; height: 46px; padding: 9px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--accent); color: var(--on-accent); --ic-fill: none;
  transform: rotate(var(--turn, 0deg));
  box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 55%, var(--ink));
}
.hero-b .ic { stroke-width: 2.1; }
@media (max-width: 359px) { .hero-b { width: 40px; height: 40px; padding: 8px; } }
/* Páginas sueltas: el papel pintado con los seis colores y más presente; en oscuro, además, un
   resplandor de color en las esquinas, para que no quede sombrío. Las tarjetas, con una franja de colores. */
:root:has(main.page) body::before {
  background: linear-gradient(135deg, var(--c-coral), var(--c-amber) 20%, var(--c-green) 40%, var(--c-teal) 60%, var(--c-blue) 80%, var(--c-violet));
  opacity: var(--page-wallpaper, 0.16);
}
.page .card {
  background:
    linear-gradient(90deg, var(--c-coral) 0 16.66%, var(--c-amber) 0 33.33%, var(--c-green) 0 50%, var(--c-teal) 0 66.66%, var(--c-blue) 0 83.33%, var(--c-violet) 0) top / 100% 6px no-repeat,
    var(--surface);
  padding-top: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):has(main.page) {
    --page-wallpaper: 0.3;
    background:
      radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--c-violet) 30%, transparent), transparent 45%),
      radial-gradient(circle at 100% 30%, color-mix(in oklab, var(--c-teal) 22%, transparent), transparent 40%),
      radial-gradient(circle at 20% 100%, color-mix(in oklab, var(--c-blue) 26%, transparent), transparent 45%),
      var(--base);
  }
}
:root[data-theme="dark"]:has(main.page) {
  --page-wallpaper: 0.3;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--c-violet) 30%, transparent), transparent 45%),
    radial-gradient(circle at 100% 30%, color-mix(in oklab, var(--c-teal) 22%, transparent), transparent 40%),
    radial-gradient(circle at 20% 100%, color-mix(in oklab, var(--c-blue) 26%, transparent), transparent 45%),
    var(--base);
}
.lead { font-size: 19px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; }

/* ── Campos ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 15px; color: var(--muted); }
.input {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--ink) 30%, var(--line));
  background: var(--card);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.input:disabled, .input.is-off { opacity: 0.45; }
.input.big { font-size: 20px; }
.input.code { font-size: 34px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.input.mono { font: 14px ui-monospace, Menlo, monospace; }
select.input {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
/* iOS no hace zoom si la letra es ≥ 16 px */
input[type="date"], input[type="time"] { font-size: 18px; }

/* ── Botones ── */
.btn {
  min-height: 56px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  font-size: 17px;
  font-weight: 600;
}
.btn.big { min-height: 60px; font-size: 19px; }
.btn.small { min-height: 48px; padding: 8px 12px; font-size: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.ghost { background: var(--surface); color: var(--strong); }
.btn.subtle { background: transparent; color: var(--muted); align-self: flex-start; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 55%, transparent); }
.btn.is-armed { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: 0.4; }
.btn:not(:disabled):active, .act:not(:disabled):active, .chip:not(:disabled):active, .nudge:not(:disabled):active { filter: brightness(1.12); }
.link { background: none; border: 0; color: var(--strong); min-height: 48px; padding: 0 4px; font-size: 16px; font-weight: 600; }
/* Enlace dentro de una frase: del tamaño del texto, subrayado. */
.link.inline { min-height: 0; padding: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.icon-btn {
  width: 56px; height: 56px; flex: 0 0 56px;
  display: grid; place-items: center;
  border: 0; border-radius: 16px; background: transparent;
  color: var(--ink); font-size: 32px; line-height: 1;
}
.icon-btn:disabled { opacity: 0.25; }

.chips { display: flex; gap: 8px; }
.chip {
  min-height: 56px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  font-size: 17px;
  white-space: nowrap;
}
.chip.is-wide { flex: 1 1 0; min-width: 0; padding: 8px 6px; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip:disabled { opacity: 0.4; }
.chip small { font-weight: 400; }
/* Cifra del atajo en una opción sin texto (KeyBadge en fields.js): solo con ratón y teclado. */
.chip { position: relative; }
.chip-key { display: none; position: absolute; top: 4px; right: 6px; font-family: var(--font-display); font-size: 11px; font-weight: 700; line-height: 1; opacity: 0.8; }
@media (hover: hover) and (pointer: fine) { .chip-key { display: block; } .chip:has(> .chip-key):not(.is-wide) { padding-right: 22px; } }

/* ── Estructura de la app: banda de color arriba, contenido, pestañas abajo ── */
.app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.band {
  background: var(--band);
  color: var(--on-band);
  padding: env(safe-area-inset-top) calc(var(--gutter) + env(safe-area-inset-right)) 0 calc(var(--gutter) + env(safe-area-inset-left));
  margin-bottom: 14px;
}
/* El texto de la banda, fijado aquí: las píldoras de los bebés llevan su propio data-color y su
   --on-band sería el de su color (texto blanco de Mateo sobre la banda naranja de Lucía). */
.band { --band-ink: var(--on-band); }
.band :focus-visible { outline-color: var(--band-ink); }
.band-in { max-width: var(--page-max, 560px); margin: 0 auto; }
.top { display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 4px 0 0; margin-right: -12px; }
.top .icon-btn:first-child { margin-left: -12px; }
.top .icon-btn { color: var(--on-band); }
.top-title { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 600; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band .pending { color: var(--on-band); opacity: 0.9; }
.band .pending .dot { background: currentColor; }
.band-pad { height: 6px; }
.pending { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 8px; }
.content { padding: 0 calc(var(--gutter) + env(safe-area-inset-right)) 0 calc(var(--gutter) + env(safe-area-inset-left)); }
.content > * { max-width: var(--page-max, 560px); margin-left: auto; margin-right: auto; }

/* Pestañas (como la propuesta B): barra blanca (en claro) y la elegida con una píldora de color tras el icono. */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding: 2px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1 1 0; max-width: 187px;
  min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500;
}
.tab svg { width: 60px; height: 30px; padding: 3px 0; border-radius: 999px; }
.tab.is-on { color: var(--strong); font-weight: 700; }
.tab.is-on svg { background: var(--accent); color: var(--on-accent); }

.notice { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 15px; margin-bottom: 12px; }

/* ── Bebés: dentro de la banda, en píldoras; el elegido, del color de la página ── */
.babies { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 16px; scrollbar-width: none; }
.baby {
  flex: 1 0 auto;
  min-height: 52px;
  padding: 6px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px;
  border: 2px solid color-mix(in oklab, var(--band-ink) 55%, transparent);
  background: transparent;
  color: var(--band-ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}
.baby::before { content: ""; flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--band-ink); }
.baby.is-on { background: var(--base); border-color: var(--base); color: var(--ink); }
.baby.is-on::before { box-shadow: none; }
.band .baby:focus-visible { outline-offset: 3px; }

/* ── Registro: los botones grandes (propuesta C) ── */
.actions { display: flex; flex-direction: column; gap: 10px; }
.act {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: var(--act-h);
  padding: 10px 14px;
  border-radius: 16px;
  border: 3px solid var(--edge, var(--line));
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.act-sleep { --edge: var(--edge1); }
.act-feed { --edge: var(--edge2); }
.act-diaper { --edge: var(--edge3); }
/* Icono: trazo del -ink y relleno del secundario claro (con el relleno puro se perdía el dibujo). */
.act-icon { flex: 0 0 48px; width: 48px; height: 48px; color: var(--strong); --ic-fill: var(--accent2); }
/* Columna del icono con el verbo debajo (lo que hace el botón, con la letra del atajo). Ancho fijo: los textos de los tres botones empiezan a la misma altura. */
.act-side { flex: 0 0 64px; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.act-side .act-icon { flex: none; }
.act-verb { font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 1.1; color: var(--strong); white-space: nowrap; }
/* En curso: el botón toma el color de la banda (lo que pasa, del color del bebé al que le pasa). Sin etiqueta: basta el fondo y el texto. */
.act.is-on { background: var(--band); border-color: var(--band); color: var(--on-band); }
.act.is-on .act-icon, .act.is-on .act-verb { color: var(--on-band); --ic-fill: none; }
.act:disabled { opacity: 0.45; }
.act-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 2px; }
.act-label { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.act-status { font-size: 16px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.act-pred { font-size: 15px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.act.is-on .act-pred { color: inherit; opacity: 0.88; }
/* Rango previsto: antes, como el texto; dentro, destacado; pasado, apagado (siempre visible: es un hecho). */
.rng { white-space: nowrap; font-weight: 650; }
.rng.is-within { color: var(--rng-now-ink); background: var(--rng-now-bg); border-radius: 6px; padding: 0 4px; margin: 0 -1px; font-weight: 800; }
.rng.is-after { color: var(--rng-past); font-weight: 500; }
.act.is-on .rng.is-within { color: var(--band); background: var(--on-band); }
/* Pasado, sobre la banda: el texto de la banda sin negrita (≥ 5:1; mezclado con la banda no llegaría). */
.act.is-on .rng.is-after { color: var(--on-band); font-weight: 400; }

/* Medicinas (propuesta C): compactas, en dos columnas, con borde fino. */
.meds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.act.small {
  position: relative;
  min-width: 0; min-height: 66px;
  align-items: flex-start;
  padding: 10px 12px; gap: 10px;
  border-width: 2px; border-color: var(--line); border-radius: 14px;
}
.act.small .act-icon { flex: 0 0 26px; width: 26px; height: 26px; margin-top: 1px; --ic-fill: none; }
.act.small .act-label { font-size: 16.5px; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.act.small .act-status { font-size: 14px; line-height: 1.3; color: var(--muted); }
/* La cuenta atrás (o la hora sin apuntar), destacada; debajo, el horario, más ligero. */
.act.small .act-status.is-hi { font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.2; color: var(--strong); }
.act.small .act-pred { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.act-tick svg { width: 1em; height: 1em; vertical-align: -0.12em; }
.act-tick { color: var(--strong); font-weight: 800; }
.act.is-on .act-tick { color: inherit; }
/* Hora pasada sin apuntar: relleno de contraste (más marcado que el resto) y marco discontinuo
   más grueso (se distingue también sin color). Sin parpadeo, sonido ni aviso. */
.act.is-due {
  border: 3px dashed var(--due-edge);
  padding: 9px 11px;
  background: var(--due-bg);
  color: var(--due-ink);
}
.act.is-due .act-icon, .act.is-due .act-status.is-hi, .act.is-due .act-pred, .act.is-due .act-warn, .act.is-due .act-key { color: inherit; }
.act.is-due .act-key { border-color: currentColor; }
/* Medicina que no se destaca (ajuste por medicina, p. ej. vitamina D): sin relleno, marco discontinuo
   del color y el texto «12:30 · sin apuntar» en el -ink, sin negrita extra. */
.act.is-due-soft { border: 2px dashed var(--strong); }
.act.is-due-soft .act-status.is-hi { color: var(--strong); font-weight: 650; }
.act-warn { font-size: 13px; color: var(--muted); border-top: 1px dotted var(--line); margin-top: 3px; padding-top: 3px; }
.meds-sync { font-size: 14px; color: var(--ink); padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--muted); background: var(--surface); }
/* Número del atajo de cada medicina: solo con ratón y teclado. */
.act-key { display: none; position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; line-height: 18px; text-align: center; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .act-key { display: block; } .act.small .act-label { padding-right: 22px; } }
@media (min-width: 520px) { .meds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Celdas estrechas (dos columnas en el móvil, tres entre 520 y 739): sin el icono, para que el
   nombre tenga todo el ancho y no se parta («Paracetam-ol»); el número del atajo se queda. */
@media (max-width: 739px) { .act.small .act-icon { display: none; } }

/* «Terminar toma» con «Cambiar pecho» al lado: dos botones hermanos en una tarjeta. */
.act-group { display: flex; align-items: stretch; gap: 8px; min-height: var(--act-h); border-radius: 16px; border: 3px solid var(--edge2); background: var(--card); }
.act-group.is-on { background: var(--band); border-color: var(--band); color: var(--on-band); }
.act-group > .act { flex: 1 1 auto; min-width: 0; min-height: calc(var(--act-h) - 6px); border: 0; background: transparent; color: inherit; }
.act-sub {
  flex: 0 0 80px; width: 80px; align-self: stretch;
  margin: 6px 6px 6px 0; padding: 5px 4px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 14px; border: 2px solid currentColor; background: color-mix(in oklab, var(--base) 16%, transparent);
  color: inherit; font-size: 14px; font-weight: 650; line-height: 1.15;
}
.act-sub-icon svg { width: 22px; height: 22px; display: block; }
.act-sub-to { font-size: 13px; font-weight: 500; opacity: 0.88; }
.act-sub:disabled { opacity: 0.45; }
.act-group.is-on :focus-visible { outline-color: var(--on-band); outline-offset: -5px; }
/* La tarjeta comparte ancho con «Cambiar pecho»: sin icono (la banda de color y «Terminar toma» bastan),
   para que «Comiendo 1 h 5 min · desde 23:59» quepa en un renglón y el botón no cambie de alto. */
.act-group > .act, .actions .act-group > .act:not(.small) { padding-right: 0; }
.act-group > .act .act-icon { display: none; }
.act-group > .act .act-verb { margin-bottom: 1px; }
@media (max-width: 480px) {
  .act-group .act-label { font-size: 23px; }
}

/* ── Registro: últimos 3 días, el día y su log ── */
.recent { margin-top: 12px; padding: 6px 10px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.st-compact .st-rowlabel { font-size: 11px; }
.st-compact .st-axis { font-size: 10px; }
.day { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.daynav { display: flex; align-items: center; gap: 4px; border-radius: 16px; }
.daynav-label {
  flex: 1 1 auto; min-height: 56px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 0; background: transparent;
  font-size: 19px; font-weight: 700; text-transform: capitalize;
}
.daynav-label:disabled { cursor: default; }
/* Otro día: la barra se tiñe y aparece un «volver a hoy» grande. */
.daynav.is-past { background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent); }
.daynav.is-past .daynav-label { color: var(--strong); }
.back-today {
  flex: 0 0 auto; min-height: 56px; min-width: 88px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 14px; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 700;
}

.figures { display: flex; gap: 8px; }
.figure {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.figure.wide { flex: 2.4 1 0; }
.figure-label { font-size: 13px; color: var(--muted); }
.figure-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figure-sub { font-size: 13px; line-height: 1.3; color: var(--muted); }

.entries { list-style: none; margin: 0; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.entries .empty { padding: 20px 4px; text-align: center; }
.entries > li:last-child .entry { border-bottom: 0; }
.entry {
  width: 100%;
  min-height: 60px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 2px;
  border: 0; border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.entry-emoji { font-size: 22px; width: 32px; text-align: center; flex: 0 0 32px; }
.entry-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.entry-time { font-family: var(--font-display); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.entry-detail { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-edited { font-style: italic; }
.entry-edited .pencil { width: 0.95em; height: 0.95em; vertical-align: -0.1em; margin-right: 2px; }
.entry.is-open .entry-time { color: var(--strong); font-weight: 700; }
.day > .btn.ghost { align-self: center; padding-left: 28px; padding-right: 28px; }

/* ── Hoja inferior: cabe entera en 375×667 con las barras de Safari ── */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--shade);
}
.sheet {
  width: 100%; max-width: 560px;
  max-height: 100vh; max-height: 100dvh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.confirm { display: flex; flex-direction: column; gap: 12px; }
.confirm-head { display: flex; align-items: center; gap: 10px; }
.confirm-head h2 { font-size: 22px; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-icon { flex: 0 0 30px; width: 30px; height: 30px; color: var(--strong); --ic-fill: var(--accent2); }
.confirm-time { display: flex; align-items: baseline; justify-content: center; gap: 12px; border-radius: 14px; padding: 2px 0; }
.kbd-hint { display: none; margin-top: -8px; text-align: center; font-size: 13px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; } }
.confirm-time .time { font-family: var(--font-display); font-size: 60px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.confirm-time .rel { font-size: 17px; color: var(--muted); min-width: 6em; }
.nudges { display: flex; gap: 8px; }
.nudge {
  flex: 1 1 0; min-width: 0;
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.nudge:disabled { opacity: 0.3; }
.fields { display: flex; flex-direction: column; gap: 8px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .nudge { flex: 1 1 0; min-width: 0; }
.stepper-value { flex: 1.6 1 0; min-width: 0; white-space: nowrap; text-align: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Ventana ancha (tablet, ordenador): tarjeta junto al botón; la posición la pone ui.js (Sheet). */
.backdrop.is-anchored { display: block; }
.backdrop.is-anchored .sheet {
  position: fixed; max-width: none;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.chip.poo-size { line-height: 1; }
.poo-1 { font-size: 18px; }
.poo-2 { font-size: 26px; }
.poo-3 { font-size: 36px; }
.diaper-icons { letter-spacing: 0.05em; }
.check.still { min-height: 56px; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
.sheet-actions .btn.primary { flex-grow: 1.6; }
.edit h2 { font-size: 20px; }
/* Errores dentro de la tarjeta, junto a los botones (y anunciados: role=alert). */
.sheet-error { color: var(--danger); font-weight: 600; font-size: 16px; }
.sheet-error:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.merge-ask { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; border: 2px solid var(--accent); background: var(--surface); }
.merge-q { font-weight: 650; font-size: 17px; }
.edit-meta { display: flex; flex-direction: column; font-size: 14px; }
/* Confirmación: un hecho que conviene ver antes de aceptar (otra dosis cerca, sin conexión). */
.confirm-note { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--accent); background: var(--surface2); font-size: 16px; font-weight: 600; }
/* Reparto por pecho al apuntar a mano */
.split { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); }
.split-lines { margin: 0; padding-left: 20px; font-variant-numeric: tabular-nums; }
.split-add { align-self: flex-start; }

/* ── Aviso breve ── */
.toast {
  position: fixed; z-index: 60;
  left: 50%; transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: min(528px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding: 6px 6px 6px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 16px;
}
.toast > span { flex: 1 1 auto; }
.toast-action { min-height: 48px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
/* En ventana ancha el aviso breve sale arriba, donde se está mirando, no al fondo. */
@media (min-width: 600px) {
  .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }
}

/* ── Ajustes ── */
.settings { padding-bottom: 16px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.toggle-text { display: flex; flex-direction: column; }
.toggle input {
  -webkit-appearance: none; appearance: none;
  flex: 0 0 52px; width: 52px; height: 32px; margin: 0;
  border-radius: 16px; background: var(--surface2); border: 1px solid color-mix(in oklab, var(--ink) 30%, var(--line));
  position: relative; transition: background 0.15s;
}
.toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted); transition: transform 0.15s;
}
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(20px); background: var(--on-accent); }
.check { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.baby-edit { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.baby-edit .field > span { color: var(--strong); font-weight: 600; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 48px; height: 48px; border-radius: 50%; border: 3px solid transparent; background: var(--accent); box-shadow: inset 0 0 0 2px var(--card); }
.swatch.is-on { border-color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member-text { display: flex; flex-direction: column; min-width: 0; }
.member-text small { overflow-wrap: anywhere; }
.empty-state { align-items: center; text-align: center; padding: 28px 18px; }
.empty-emoji { font-size: 48px; line-height: 1; }
.empty-state .btn { align-self: stretch; }
/* Claro/Oscuro (por dispositivo): desplegable y, con «Por horario», las dos horas */
.theme-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Medicinas */
.med-li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.med-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.med-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.med-buttons { display: flex; gap: 8px; flex: 0 0 auto; }
.med-del { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--danger); }
.med-form { padding: 14px; border-radius: 16px; border: 2px solid var(--accent); background: var(--surface); }
.med-form h4 { margin: 0; font-size: 17px; }
.med-times-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; color: var(--muted); }
.info-btn { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface2); color: var(--strong); }
.info-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.med-help { padding: 10px 12px; border-radius: 12px; background: var(--surface2); font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.med-read { min-height: 1.4em; font-weight: 600; color: var(--strong); }
.med-read.error { color: var(--danger); }
.med-for { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.med-for select { flex: 1 1 160px; width: auto; }
.account-blocked { color: var(--ink); display: flex; flex-direction: column; gap: 6px; margin: 0; border-color: var(--danger); }
@media (max-width: 380px) { .med-item { flex-wrap: wrap; } }

/* ── Varios ── */
.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; }
/* Letra del atajo: subrayada solo con ratón y teclado. */
@media (hover: hover) and (pointer: fine) {
  .hk { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; }
}
/* Gota de pipí amarilla, del tamaño de un emoji. */
.pee-icon { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
/* Zonas horarias */
.tz-mark { color: var(--strong); font-weight: 700; margin-left: 2px; }
.tz-legend { font-size: 13px; padding: 2px 4px; }
.tz-notice { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.tz-notice .btn { align-self: flex-start; }
.install-notice { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Pantalla baja (375×667 y menos): botones algo más bajos para que el día asome bajo los últimos 3 días. */
@media (max-height: 700px) and (max-width: 599px) {
  :root { --act-h: 90px; }
  .actions { gap: 8px; }
  .act { padding-top: 6px; padding-bottom: 6px; }
  .act-label { font-size: 23px; }
  .recent { margin-top: 8px; }
  .day { margin-top: 10px; }
  .act-sub-icon { display: none; }
}

/* ── Ancho adaptativo ──
   Cortes (ver ARCHITECTURE.md, «Interfaz»):
   < 600   móvil: una columna de 560 como mucho, botones grandes apilados.
   600–739 tablet pequeña o móvil apaisado: Registro igual que el móvil (dos columnas no
           dejarían el estado más largo en un renglón); Estadísticas e Info, a lo ancho.
   ≥ 740   (iPad mini vertical 744, tablets 768–834): Registro con los botones grandes de
           dos en dos en un bloque de mando compacto (2 × 420 + 12 px como mucho), mismo
           orden y sitio que en el móvil; el resto de Registro, del mismo ancho.
   ≥ 1360  (iPad Pro horizontal 1366, ordenador): Registro a dos columnas, el mando a la
           izquierda y los últimos días con el log a la derecha.
   Estadísticas e Info: todo el ancho menos los márgenes, en rejilla de tarjetas
   (stats.css, info.css). Ajustes: 720 px centrado. */

/* Botón grande compacto: cuando mide menos de ~392 px (móvil estrecho y dos columnas en 740–919),
   icono y letra algo menores para que el estado y la predicción más largos quepan en un renglón cada uno. */
@media (max-width: 399px), (min-width: 740px) and (max-width: 919px) {
  .actions .act:not(.small) { padding-left: 10px; padding-right: 10px; gap: 10px; }
  .actions .act:not(.small) .act-icon { flex-basis: 40px; width: 40px; height: 40px; }
  .actions .act:not(.small) .act-side { flex-basis: 60px; width: 60px; }
  .actions .act:not(.small) .act-verb { font-size: 12.5px; }
}
/* Móvil estrecho (360–399): el título un punto menor para que «Último hace 12 h 59» quepa en un renglón. */
@media (max-width: 399px) {
  .actions .act:not(.small) .act-label { font-size: 24px; }
  .actions .act:not(.small) .act-status { font-size: 15px; }
  .actions .act:not(.small) .act-pred { font-size: 14px; }
}
@media (max-width: 919px) {
  .actions .act-group > .act .act-status, .actions .act-group > .act .act-pred { font-size: 14px; }
}

@media (min-width: 600px) {
  .app { --page-max: 880px; }
  .app.is-log { --page-max: 560px; }
  .app.is-stats, .app.is-info { --page-max: none; }
  .app.is-settings { --page-max: 720px; }
  .band-in { max-width: none; }
  .babies { max-width: 640px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .figure-value { font-size: 26px; }
}
@media (min-width: 740px) {
  .app.is-log { --page-max: calc(2 * var(--act-min-w) + 12px); }
  .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* Mismo orden y sitio que en el móvil: Dormir | Toma; debajo, Pañal a lo ancho; luego las medicinas. */
  .actions > .act-diaper, .actions > .meds, .actions > .meds-sync { grid-column: 1 / -1; }
  .meds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1360px) {
  .app.is-log { --page-max: none; }
  .log {
    display: grid;
    grid-template-columns: calc(2 * var(--act-min-w) + 12px) minmax(0, 1fr);
    grid-template-areas: "act recent" "act day";
    grid-template-rows: auto 1fr;
    column-gap: 40px;
    align-items: start;
  }
  .log > .notice { grid-column: 1 / -1; }
  .log > .actions { grid-area: act; }
  .log > .recent { grid-area: recent; margin-top: 0; }
  .log > .day { grid-area: day; margin-top: 12px; }
}
