/* Trampantojo — el aspecto, con el sistema de diseño de BIMIO (bimio.tools).

   Todo sale de website/assets/site.css de BIMIO: los mismos colores con los
   mismos nombres (--bg, --card, --ink, --ink-2, --ink-3, --line, --accent,
   --teal…), las tarjetas blancas con borde fino, las etiquetas en mayúsculas
   espaciadas con su raya, los botones de píldora, el degradado azul-turquesa
   del titular y el fondo vivo: cuadrícula de delineante + manchas de color que
   se mueven + constelación.

   Como en bimio.tools, CLARO POR DEFECTO; el oscuro sólo si se elige
   (Perfil › Apariencia) o con «Auto» si el móvil está en oscuro.
   Nada de colores sueltos fuera de estos bloques de variables. En el móvil,
   las alturas táctiles suben a 44 (Apple). */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #4b4b50;
  --ink-3: #707075;
  --ink-4: #aeaeb2;
  --line: #e5e5ea;
  --surface: #fbfbfd;
  --hover: #f2f2f7;
  --pressed: #e8e8ed;
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --accent-text: #005cbf;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --ok: #34c759;
  --ok-text: #1d7a3c;
  --ok-soft: color-mix(in srgb, var(--ok) 14%, transparent);
  --warn: #ff9f0a;
  --warn-text: #a35200;
  --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
  --bad: #ff3b30;
  --bad-text: #c4001d;
  --bad-soft: color-mix(in srgb, var(--bad) 12%, transparent);
  --teal: #30b0c7;
  --violet: #a98bff;
  --mint: #4fe0c0;
  --neutral-soft: rgba(118, 118, 128, 0.12);
  --segment-on: #ffffff;
  --nav-bg: rgba(251, 251, 253, 0.78);
  --hud-bg: rgba(29, 29, 31, 0.92);
  --hud-ink: #ffffff;
  --grid-ink: 0, 0, 0;
  --icon-glow: rgba(255, 159, 26, 0.38);   /* el brillo del icono amarillo */
  /* las tarjetas son de vidrio: dejan ver un poco las manchas y la constelación */
  --glass: color-mix(in srgb, var(--card) 70%, transparent);
  /* gráficos */
  --chart-trend: #0071e3;
  --chart-dot: rgba(0, 113, 227, 0.36);
  --chart-up: #ff3b30;
  --chart-grid: rgba(0, 0, 0, 0.07);
  --chart-axis: rgba(0, 0, 0, 0.18);
  /* tokens */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --pill: 980px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.06), 0 18px 50px rgba(0, 0, 0, 0.10);
  --touch: 44px;
  --tabs-h: 58px;
  --dur: 0.15s;
}

/* el oscuro de bimio.tools, elegido o por «Auto» con el móvil en oscuro */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --card: #1c1c1e;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #8e8e93;
  --ink-4: #48484a;
  --line: #2c2c2e;
  --surface: #161618;
  --hover: #2c2c2e;
  --glass: color-mix(in srgb, var(--card) 70%, transparent);
  --pressed: #3a3a3c;
  --accent: #0a84ff;
  --accent-text: #409cff;
  --ok: #30d158;
  --ok-text: #30d158;
  --warn: #ff9f0a;
  --warn-text: #ffb340;
  --bad: #ff453a;
  --bad-text: #ff6961;
  --neutral-soft: rgba(118, 118, 128, 0.24);
  --segment-on: #636366;
  --nav-bg: rgba(22, 22, 24, 0.72);
  --hud-bg: rgba(58, 58, 60, 0.94);
  --grid-ink: 255, 255, 255;
  --chart-trend: #0a84ff;
  --chart-dot: rgba(10, 132, 255, 0.45);
  --chart-up: #ff453a;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-axis: rgba(255, 255, 255, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #000000;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #8e8e93;
    --ink-4: #48484a;
    --line: #2c2c2e;
    --surface: #161618;
    --hover: #2c2c2e;
    --glass: color-mix(in srgb, var(--card) 70%, transparent);
    --pressed: #3a3a3c;
    --accent: #0a84ff;
    --accent-text: #409cff;
    --ok: #30d158;
    --ok-text: #30d158;
    --warn: #ff9f0a;
    --warn-text: #ffb340;
    --bad: #ff453a;
    --bad-text: #ff6961;
    --neutral-soft: rgba(118, 118, 128, 0.24);
    --segment-on: #636366;
    --nav-bg: rgba(22, 22, 24, 0.72);
    --hud-bg: rgba(58, 58, 60, 0.94);
    --grid-ink: 255, 255, 255;
    --chart-trend: #0a84ff;
    --chart-dot: rgba(10, 132, 255, 0.45);
    --chart-up: #ff453a;
    --chart-grid: rgba(255, 255, 255, 0.08);
    --chart-axis: rgba(255, 255, 255, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}

/* ── base ───────────────────────────────────────────────────── */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* El papel de bimio.tools: una cuadrícula de delineante a dos escalas, al borde
   de lo visible. Va en <html> porque <body> es transparente: así queda debajo
   de todo y encima de nada. */
html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(to right, rgba(var(--grid-ink), 0.04) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(to bottom, rgba(var(--grid-ink), 0.04) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(to right, rgba(var(--grid-ink), 0.02) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(to bottom, rgba(var(--grid-ink), 0.02) 0 1px, transparent 1px 16px);
  background-attachment: fixed;
}

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* ── el fondo vivo (aurora + constelación), como en bimio.tools ── */

.page-fx {
  position: fixed; inset: -24vh 0; z-index: 0; overflow: hidden; pointer-events: none;
  transform: translate3d(0, var(--pa, 0), 0); will-change: transform;
}
.page-fx .hx { position: absolute; border-radius: 50%; filter: blur(64px); pointer-events: none; }
.page-fx .b1 {
  width: min(104vw, 760px); height: min(104vw, 760px); left: -32vw; top: 17vh; opacity: 0.8;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 72%, transparent), transparent 70%);
  animation: drift-a 24s ease-in-out infinite alternate;
}
.page-fx .b2 {
  width: min(92vw, 700px); height: min(92vw, 700px); right: -34vw; top: 42vh; opacity: 0.55;
  background: radial-gradient(circle, color-mix(in srgb, var(--teal) 48%, transparent), transparent 70%);
  animation: drift-b 28s ease-in-out infinite alternate;
}
.page-fx .b3 {
  width: min(104vw, 760px); height: min(104vw, 760px); left: -28vw; top: 66vh; opacity: 0.8;
  background: radial-gradient(circle, color-mix(in srgb, var(--violet) 90%, transparent), transparent 68%);
  animation: drift-c 32s ease-in-out infinite alternate;
}
.page-fx .b4 {
  width: min(88vw, 660px); height: min(88vw, 660px); right: -26vw; top: 90vh; opacity: 0.5;
  background: radial-gradient(circle, color-mix(in srgb, var(--mint) 60%, transparent), transparent 68%);
  animation: drift-a 30s ease-in-out infinite alternate-reverse;
}
.page-fx .b5 {
  width: min(98vw, 740px); height: min(98vw, 740px); left: 8vw; top: 108vh; opacity: 0.62;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%);
  animation: drift-b 34s ease-in-out infinite alternate;
}
.page-cloud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@keyframes drift-a { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 4vh) scale(1.14); } }
@keyframes drift-b { from { transform: translate(0, 0) scale(1.08); } to { transform: translate(-5vw, 4vh) scale(0.94); } }
@keyframes drift-c { from { transform: translate(0, 0) scale(1); } to { transform: translate(4vw, -4vh) scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .page-fx .hx { animation: none; }
  .page-cloud { display: none; }
}

#app {
  position: relative; z-index: 1;
  max-width: 620px; margin: 0 auto;
  padding: 0 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom));
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fine { margin: 18px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.center { text-align: center; }
.empty { color: var(--ink-2); font-size: 15px; margin: 24px 0; text-align: center; }
.error { margin: 10px 4px 0; color: var(--bad-text); font-size: 14px; }
.error:empty { display: none; }

/* el degradado del titular de bimio.tools */
.grad {
  background: linear-gradient(92deg, #0a84ff, var(--teal) 55%, #5ac8fa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── cabecera ───────────────────────────────────────────────── */

.app-header {
  display: flex; align-items: center; gap: 14px;
  padding: calc(20px + env(safe-area-inset-top)) 2px 18px;
}
.app-mark { width: 46px; height: 46px; border-radius: 11px; flex: none; box-shadow: 0 4px 14px var(--icon-glow); }
.app-header-text { min-width: 0; }
.app-header h1 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.022em; }
.app-header-sub {
  margin: 0 0 2px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-text);
}

/* ── tarjetas: blancas, borde fino, sombra suave (las tool-card de bimio.tools) ── */

/* Sin desenfoque detrás de las tarjetas: con las manchas y la constelación en
   movimiento, el móvil tendría que volver a desenfocar el fondo de cada tarjeta
   en cada fotograma (tirones y batería). Las manchas ya vienen desenfocadas, así
   que basta con la transparencia; bimio.tools sólo desenfoca la barra. */
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 0 14px;
}
.eyebrow {
  display: block; margin: 0 0 4px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-text);
}
.card-sub { margin: 4px 0 6px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.card-foot { margin: 8px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }

/* la etiqueta de sección de bimio.tools: mayúsculas espaciadas y una raya hasta el borde */
.section-label {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 4px 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-foot { margin: 8px 6px 0; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.section-foot:empty { display: none; }
.section-foot.warn { color: var(--bad-text); font-weight: 600; }

/* ── lista agrupada (las filas de ajustes de BIMIO: título a la izquierda, valor a la derecha) ── */

.group {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0; padding: 0; overflow: hidden; list-style: none;
}
.spaced-group { margin-top: 22px; }
.item {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 50px; padding: 6px 18px; margin: 0;
  font: inherit; font-size: 16.5px; color: var(--ink);
  background: transparent; border: 0; width: 100%; text-align: left;
}
.item + .item::before, .group > li + li::before, .facts > div + div::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 0; height: 1px; background: var(--line);
}
.group > li { position: relative; }
body:not(.sex-m) .only-m { display: none !important; }
.item-title { flex: none; max-width: 60%; }
.item-title small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.25; }
.item.stacked { display: block; padding: 12px 18px; }
.item.action, .item.picker { cursor: pointer; }
.item.action .item-title { color: var(--accent); font-weight: 500; }
.item.action:active, .item.picker:active { background: var(--hover); }
.item.destructive .item-title { color: var(--bad); }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-4); border-top: 2px solid var(--ink-4); transform: rotate(45deg); margin-right: 4px; flex: none; }
.picker-value { flex: 1; min-width: 0; text-align: right; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.item input {
  flex: 1; min-width: 0; width: auto;
  font: inherit; font-size: 16.5px; color: var(--ink-2);
  background: transparent; border: 0; outline: none;
  text-align: right; padding: 8px 0; margin: 0;
}
.item input:focus { color: var(--ink); }
.item input::placeholder { color: var(--ink-4); }
.item input[type="date"] { color-scheme: inherit; }
.item textarea {
  display: block; width: 100%; min-height: 90px; resize: vertical;
  font: inherit; font-size: 16.5px; color: var(--ink);
  background: transparent; border: 0; outline: none; padding: 4px 0;
}
.item textarea::placeholder { color: var(--ink-3); }

.field-unit { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.field-unit input { flex: 1; min-width: 0; }
.field-unit > span { color: var(--ink-3); font-size: 15px; }

/* la lista de un selector: una marca en la opción elegida */
.picker-list { margin-top: 2px; max-height: 62vh; overflow-y: auto; }
.picker-list .item { min-height: 52px; }
.picker-list .opt-text { flex: 1; min-width: 0; }
.picker-list .opt-hint { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.picker-list .check { width: 18px; height: 10px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg) translateY(-3px); flex: none; visibility: hidden; }
.picker-list [aria-selected="true"] .check { visibility: visible; }
.picker-list [aria-selected="true"] .opt-label { color: var(--accent); font-weight: 600; }

/* ── control segmentado (el .seg de bimio.tools) ────────────── */

.segmented {
  display: flex; gap: 2px; padding: 3px;
  background: var(--neutral-soft);
  border-radius: 11px;
  margin: 0 0 14px;
}
.segmented > button, .segmented > label {
  flex: 1; position: relative; margin: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--dur), box-shadow var(--dur);
}
.segmented > button[aria-checked="true"], .segmented > label:has(input:checked) {
  background: var(--segment-on);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}
.segmented input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented.compact { margin: 0; flex: none; }
.segmented.compact > label, .segmented.compact > button { min-height: 30px; padding: 0 12px; font-size: 13.5px; }

/* ── botones: píldoras, como en bimio.tools ─────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 22px; margin: 0;
  font: inherit; font-size: 16px; font-weight: 600;
  border: 0; border-radius: var(--pill);
  background: var(--hover); color: var(--accent);
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur) ease, filter var(--dur) ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:active { filter: brightness(0.92); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:active { background: var(--accent-soft); }
.btn.plain { background: transparent; color: var(--accent); }
.btn.destructive { color: var(--bad); }
.btn.block { display: flex; width: 100%; min-height: 50px; margin-top: 18px; font-size: 17px; }
#add-past.block { margin-top: 0; }
.btn.small { min-height: 34px; padding: 0 16px; font-size: 14.5px; margin-top: 8px; }

.row-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin: 12px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line);
  background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left;
}
.row-link::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--ink-4); border-top: 2px solid var(--ink-4); transform: rotate(45deg); margin-right: 4px; }

/* ── hoy ────────────────────────────────────────────────────── */

.weigh-row { display: flex; gap: 10px; margin-top: 8px; align-items: stretch; }
.field-unit.big {
  align-items: center; justify-content: flex-start;
  background: var(--hover); border-radius: var(--radius-sm); padding: 0 16px;
}
.field-unit.big input {
  font: inherit; font-size: 32px; font-weight: 700; letter-spacing: -0.022em; color: var(--ink);
  background: transparent; border: 0; outline: none; padding: 6px 0; width: 100%; min-height: 58px;
}
.field-unit.big input::placeholder { color: var(--ink-4); }
.field-unit.big:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.field-unit.big > span { font-size: 18px; font-weight: 600; }
.weigh-row .btn { min-height: 58px; padding: 0 24px; }

details.more { margin-top: 10px; }
details.more summary { color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; padding: 4px 0; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+ '; }
details.more[open] summary::before { content: '− '; }
.measures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
body:not(.sex-m) .measures { grid-template-columns: 1fr 1fr; }
.measures label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.measures .field-unit { margin-top: 4px; background: var(--hover); border-radius: var(--radius-sm); padding: 0 12px; align-items: center; }
.measures input { font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; outline: none; padding: 10px 0; width: 100%; min-width: 0; }
.measures .field-unit:focus-within { box-shadow: 0 0 0 2px var(--accent); }

.message { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.message-title { margin: 2px 0 3px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.message-text { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.nudge .btn { margin-top: 14px; }

.hero-value { margin: 2px 0 0; font-size: 46px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.hero-value .unit { font-size: 20px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.hero-delta { margin: 8px 0 2px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.hero-delta.good { color: var(--ok-text); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.tile { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 15px 15px; min-width: 0; }
.tile .eyebrow { font-size: 11.5px; color: var(--ink-3); }
.tile-value { margin: 4px 0 0; font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.022em; }
.tile-sub { margin: 5px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.tile .tag { margin-top: 8px; }

/* etiqueta de estado: punto + texto, nunca sólo color */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding: 0 10px 0 9px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--neutral-soft); color: var(--ink-2);
}
.tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag.good { background: var(--ok-soft); color: var(--ok-text); }
.tag.warning { background: var(--warn-soft); color: var(--warn-text); }
.tag.serious, .tag.critical { background: var(--bad-soft); color: var(--bad-text); }

/* ideas de objetivo */
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 4px; }
.ideas .btn { margin: 0; }
.log-side .tag { margin-top: 0; }
.log-row.add .log-date { color: var(--accent); font-weight: 600; }
.card.spaced { margin-top: 14px; }

/* ── tengo un antojo ─────────────────────────────────────────── */

.craving-cta {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  border-color: color-mix(in srgb, #ff9f1a 45%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, #ffde4a 18%, var(--glass)), var(--glass) 70%);
}
.craving-cta:active { transform: scale(0.99); }
.craving-icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffde4a, #ff9f1a); box-shadow: 0 4px 12px var(--icon-glow);
}
.craving-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.craving-text { flex: 1; min-width: 0; }
.craving-text strong { display: block; font-size: 18px; letter-spacing: -0.01em; }
.craving-text small { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; }
.crv-q { margin: 18px 4px 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.crv-q:first-child { margin-top: 4px; }
.crv-help { margin: -4px 4px 10px; }
.crv-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crv-type {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 72px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.crv-type:active { background: var(--hover); }
.crv-type-label { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.crv-type-kcal { font-size: 13px; color: var(--ink-3); }
.crv-why .message-title { margin-top: 10px; }
.crv-why .message-title:first-child { margin-top: 2px; }
.crv-kcal { font-size: 38px; }
.crv-portion { margin: 2px 0 2px; font-size: 15px; color: var(--ink-2); }

/* si te lo comes: los ejercicios, en una rejilla de dos */
.burn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 4px; }
.burn-cell {
  display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--hover);
}
.burn-ico { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.burn-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burn-cell strong { font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.2; }
.burn-cell small { font-size: 12.5px; color: var(--ink-2); line-height: 1.2; }

/* el semáforo de las calorías */
.qdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: none; background: var(--ink-4); }
.qdot.q-b, .qbar .q-b { background: var(--ok); }
.qdot.q-r, .qbar .q-r { background: var(--warn); }
.qdot.q-m, .qbar .q-m { background: var(--bad); }
.qchip { display: inline-block; padding: 3px 10px; border-radius: 980px; font-size: 13px; font-weight: 700; margin-right: 4px; }
.qchip.q-b { background: var(--ok-soft); color: var(--ok-text); }
.qchip.q-r { background: var(--warn-soft); color: var(--warn-text); }
.qchip.q-m { background: var(--bad-soft); color: var(--bad-text); }
.qchip-line { margin: 4px 0 6px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* los porqués, desplegables */
.type-list { margin-top: 6px; }
.type-item { border-top: 1px solid var(--line); padding: 2px 0; }
.type-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 700; font-size: 16px; }
.type-item summary::-webkit-details-marker { display: none; }
.type-item summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform var(--dur); }
.type-item[open] summary::after { transform: rotate(-135deg); }
.type-item .message-text { padding: 0 0 12px 18px; }
.tdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tone-bad.tdot, .body-legend .tone-bad::before { background: var(--bad); }
.tone-meh.tdot, .body-legend .tone-meh::before { background: var(--warn); }
.tone-good.tdot, .body-legend .tone-good::before { background: var(--ok); }

/* el mapa del cuerpo */
.body-wrap { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; margin-top: 6px; }
.body-map { width: 104px; height: auto; display: block; }
.body-sil { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.bz { opacity: 0.8; }
.bz-bad { fill: var(--bad); }
.bz-meh { fill: var(--warn); }
.bz-good { fill: var(--ok); }
@media (prefers-reduced-motion: no-preference) {
  .bz-bad { animation: bz-pulse 2.4s ease-in-out infinite; }
  @keyframes bz-pulse { 50% { opacity: 0.45; } }
}
.body-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.body-legend li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.body-legend li::before { content: ''; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; }
.body-legend strong { color: var(--ink); }

/* mismas calorías: la comparación en dos columnas */
.swap-compare { display: grid; grid-template-columns: auto 1fr 1fr; gap: 1px; margin: 10px 0 10px; border-radius: var(--radius-sm); overflow: hidden; background: var(--line); font-size: 13.5px; }
.swap-compare span { background: var(--card); padding: 8px 9px; line-height: 1.3; }
.swap-compare .sc-head { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.swap-compare .sc-head:nth-child(3) { color: var(--ok-text); }
.swap-compare .sc-label { color: var(--ink-3); font-weight: 600; }
.swap-compare .sc-bad { color: var(--ink-2); }
.swap-compare .sc-good { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.crv-swap-card { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }

/* la calidad del día (Comidas) y de los últimos 14 (Evolución) */
#water-form { display: block; }
/* ejercicio */
.ex-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ex-list:empty { display: none; }
.ex-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-radius: 980px; border: 1px solid var(--line);
  background: var(--hover); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ex-x { color: var(--ink-3); font-size: 16px; line-height: 1; }
.ex-meter { margin: 12px 0 6px; }
.ex-meter span.done { background: var(--ok); }
#exercise-add { margin-top: 10px; }
.ex-types .crv-type { min-height: 52px; }
.ex-types .crv-type[aria-pressed="true"], .crv-type[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
#ex-minutes { margin-bottom: 4px; }
.exchart { position: relative; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.exbar { border-radius: 6px 6px 3px 3px; min-height: 2px; background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.exbar.cur { background: var(--accent); }
.exbar.done { background: var(--ok); }
.ex-who { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--ok) 70%, transparent); pointer-events: none; }
/* el menú de la semana */
.menu-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -4px; scrollbar-width: none; }
.menu-days::-webkit-scrollbar { display: none; }
.menu-days button { flex: none; padding: 7px 13px; border-radius: 980px; border: 1px solid var(--line); background: var(--hover);
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-transform: capitalize; }
.menu-days button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.menu-meals { list-style: none; margin: 0; padding: 0; }
.menu-meals li { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.menu-meals li:first-child { border-top: 0; padding-top: 4px; }
.menu-slot { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.menu-dish { margin: 3px 0 2px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.menu-meta { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.menu-acts { display: flex; gap: 8px; margin-top: 8px; }
.menu-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.menu-how { margin: 6px 0 0; }
.menu-how summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-text); list-style: none; }
.menu-how summary::-webkit-details-marker { display: none; }
.menu-how summary::before { content: '▸ '; }
.menu-how[open] summary::before { content: '▾ '; }
.menu-how ol { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.menu-how .menu-how-note { list-style: none; margin-left: -20px; margin-top: 4px; font-weight: 600; color: var(--ink); }
/* comer fuera */
.out-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.out-icon { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #5ac8fa, var(--accent)); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.out-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#out-places { margin-top: 4px; }
.section-label.out-b { color: var(--ok-text); }
.section-label.out-r { color: var(--warn-text); }
.section-label.out-m { color: var(--bad-text); }
.out-tips { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.out-tips li + li { margin-top: 6px; }
/* la lista de la compra */
.shop-group { margin-bottom: 4px; }
.shop-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; background: transparent;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.shop-group li + li .shop-item { border-top: 1px solid var(--line); }
.shop-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-4); flex: none; display: grid; place-items: center; }
.shop-item.done .shop-check { background: var(--ok); border-color: var(--ok); }
.shop-item.done .shop-check::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.shop-text { display: flex; flex-direction: column; min-width: 0; }
.shop-name { font-size: 16px; font-weight: 600; }
.shop-amount { font-size: 13px; color: var(--ink-2); }
.shop-item.done .shop-name { text-decoration: line-through; color: var(--ink-3); }
/* el calendario de hábitos */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head .eyebrow { margin: 0; text-transform: uppercase; }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--hover); color: var(--accent); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.cal-nav:disabled { color: var(--ink-4); cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; aspect-ratio: 1 / 1.05; min-width: 0;
  border: 1px solid transparent; border-radius: 10px; font: inherit; color: var(--ink); cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--ok) calc(var(--lvl, 0) * 32%), var(--hover)); }
.cal-day:disabled { background: transparent; color: var(--ink-4); cursor: default; }
.cal-day.today { border-color: var(--accent); }
.cal-day.picked { box-shadow: 0 0 0 2px var(--accent); }
.cal-num { font-size: 13px; font-weight: 600; line-height: 1; }
.cal-dots { display: flex; gap: 2px; }
.cal-dots i, .cal-legend i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.cal-dots i.on.h-peso, .cal-legend i.h-peso { background: var(--accent); }
.cal-dots i.on.h-agua, .cal-legend i.h-agua { background: var(--teal); }
.cal-dots i.on.h-verde, .cal-legend i.h-verde { background: var(--ok); }
.cal-dots i.on.h-ejercicio, .cal-legend i.h-ejercicio { background: var(--violet); }
.cal-dots i.on.h-antojo, .cal-legend i.h-antojo { background: var(--warn); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; }
/* las fotos */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 4px; }
.photo-grid:empty { display: none; }
.photo-thumb { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--hover); cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11.5px; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); text-align: left; }
.photo-thumb.missing .photo-cap { color: var(--ink-2); background: none; }
.photo-add { cursor: pointer; }
.photo-full { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius); background: #000; }
.danger-text { color: var(--bad-text) !important; }
.compare { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #000; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); pointer-events: none; }
.cmp-tag { position: absolute; top: 10px; padding: 3px 9px; border-radius: 980px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.45); }
.cmp-tag.left { left: 10px; }
.cmp-tag.right { right: 10px; }
.cmp-range { width: 100%; margin: 14px 0 4px; accent-color: var(--accent); }
.cmp-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cmp-pick { flex: none; padding: 6px 12px; border-radius: 980px; border: 1px solid var(--line); background: var(--hover); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cmp-pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.backup-nudge { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qday { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.qbar { display: flex; height: 10px; border-radius: 980px; overflow: hidden; background: var(--neutral-soft); margin: 6px 0 8px; }
.qbar span { display: block; height: 100%; transition: width 0.4s ease; }
.qday-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.qchart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; height: 150px; margin-top: 10px; align-items: end; }
.qcol { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 4px; }
.qstack { display: flex; flex-direction: column; min-height: 2px; border-radius: 6px; overflow: hidden; background: var(--neutral-soft); }
.qstack span { display: block; min-height: 2px; }
.qstack .q-b { background: var(--ok); }
.qstack .q-r { background: var(--warn); }
.qstack .q-m { background: var(--bad); }
.qday-l { font-size: 11px; color: var(--ink-3); text-align: center; flex: none; }
.log-date .qdot { margin-right: 7px; }
#portion-types { margin: 0 0 4px; }
.crv-swap-card .btn { margin-top: 12px; }
.reasons { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.reasons.empty-reasons .message-text { font-size: 14.5px; }
.crv-ring { position: relative; width: 220px; height: 220px; margin: 10px auto 18px; }
.crv-ring svg { width: 100%; height: 100%; }
.crv-ring .ring-bg { fill: none; stroke: var(--accent-soft); stroke-width: 9; }
.crv-ring .ring-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.crv-clock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.crv-tip { min-height: 3em; }
.crv-portion { margin-top: 12px; }
.crv-done-mark {
  width: 76px; height: 76px; margin: 20px auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-size: 40px; font-weight: 700; box-shadow: 0 8px 24px color-mix(in srgb, var(--ok) 35%, transparent);
}
.heat { display: grid; grid-template-columns: 22px repeat(5, 1fr); gap: 4px; margin: 12px 0 4px; }
.heat-h { font-size: 11px; color: var(--ink-3); text-align: center; font-weight: 600; }
.heat-d { font-size: 11.5px; color: var(--ink-3); font-weight: 600; display: grid; place-items: center; }
.heat-c {
  height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--accent) calc(var(--lvl, 0) * 70% + 4%), transparent);
}
.insights { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.insights .message-title { margin-top: 10px; font-size: 16.5px; }

/* ── agua ───────────────────────────────────────────────────── */

.water-head { display: flex; align-items: baseline; justify-content: space-between; }
.water-count { font-size: 14px; font-weight: 600; color: var(--ink-2); }
/* ocho vasos por fila: caben en el móvil más estrecho sin que el último salte de línea */
.glasses { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.glass {
  width: 100%; max-width: 40px; aspect-ratio: 36 / 44; justify-self: center;
  border: 0; padding: 0; background: none; cursor: pointer; color: var(--accent);
}
.glass svg { width: 100%; height: 100%; }
.glass .g-out { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-width: 1.6; }
.glass .g-in { fill: color-mix(in srgb, var(--accent) 80%, #5ac8fa); opacity: 0; transition: opacity 0.2s; }
.glass.full .g-in { opacity: 1; }
.glass.full .g-out { stroke: var(--accent); }
.glass:active { transform: scale(0.94); }

/* ── logros ─────────────────────────────────────────────────── */

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 6px 10px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.badge-token {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: #fff;
  background: linear-gradient(135deg, #ffde4a, #ff9f1a); box-shadow: 0 4px 12px var(--icon-glow);
}
.badge.locked .badge-token { background: var(--neutral-soft); color: var(--ink-4); box-shadow: none; }
.badge-title { font-size: 13px; font-weight: 700; line-height: 1.2; }
.badge-sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.25; }
.badge.locked .badge-title { color: var(--ink-3); }

/* ── tu semana ──────────────────────────────────────────────── */

.week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 8px; }
.week-item .v { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.week-item .l { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.week-item .d { display: block; font-size: 12.5px; color: var(--ink-2); }
.week-item .d.good { color: var(--ok-text); }

/* ── comidas ────────────────────────────────────────────────── */

.day-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.day-nav .btn { margin: 0; padding: 0 6px; }
.day-nav .btn:disabled { color: var(--ink-4); cursor: default; }
.day-label { font-weight: 700; font-size: 16px; }
.day-label::first-letter { text-transform: uppercase; }
.meter { height: 10px; border-radius: var(--pill); background: var(--accent-soft); overflow: hidden; margin: 12px 0 4px; }
.meter span { display: block; height: 100%; width: 0; border-radius: var(--pill); background: var(--accent); transition: width 0.3s ease; }
.meter span.over { background: var(--warn); }
.search input {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  background: var(--neutral-soft); border: 0; border-radius: var(--radius-sm);
  padding: 12px 14px; outline: none;
}
.search input:focus { box-shadow: 0 0 0 2px var(--accent); }
.food-actions { display: flex; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.food-actions .btn { margin: 0; }
.phrase { margin: 14px 0 0; }
.phrase-line { margin: 4px 0; font-size: 15.5px; }
.phrase-line.miss { color: var(--warn-text); }
.phrase .btn.block { margin-top: 12px; }
.portion-name { margin: 4px 4px 2px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.ideas .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 38px; height: 38px; border-radius: var(--pill); border: 0; cursor: pointer;
  background: var(--neutral-soft); color: var(--accent); font: inherit; font-size: 22px; font-weight: 600; line-height: 1;
}
.stepper input { width: 64px; text-align: center; color: var(--ink); font-weight: 700; padding: 6px 0; flex: none; }
.card.result { margin: 14px 0 0; text-align: center; }
.card.result .hero-value { font-size: 38px; }
#scan-video { width: 100%; border-radius: var(--radius); background: var(--ink); aspect-ratio: 4 / 3; object-fit: cover; }
dialog.sheet.tall { min-height: 80vh; }

.ideas-card .group.inner { box-shadow: none; margin-top: 4px; background: var(--hover); border-color: transparent; }
.ideas-card .group.inner .log-row { min-height: 56px; }

/* ── evolución: datos de salud ──────────────────────────────── */

.facts > div { position: relative; padding: 13px 18px; }
.facts dt { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fact-value { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.facts small { flex-basis: 100%; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }

/* ── registro ───────────────────────────────────────────────── */

.log-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 62px; padding: 9px 18px; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.log-row:active { background: var(--hover); }
.log-main { flex: 1; min-width: 0; }
.log-date { display: block; font-size: 16px; font-weight: 600; }
.log-date::first-letter { text-transform: uppercase; }
.log-sub { display: block; font-size: 13.5px; color: var(--ink-2); }
.log-side { text-align: right; font-variant-numeric: tabular-nums; }
.log-kg { display: block; font-size: 18px; font-weight: 700; }
.log-change { display: block; font-size: 13.5px; color: var(--ink-2); }

/* ── gráficos ───────────────────────────────────────────────── */

.chart { position: relative; margin-top: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .baseline { stroke: var(--chart-axis); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .band-good { fill: var(--ok); opacity: 0.09; }
.chart .band-label { fill: var(--ok-text); font-size: 11px; font-weight: 600; }
.chart .goal { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .goal-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.chart .dot { fill: var(--chart-trend); stroke: var(--card); stroke-width: 1.5; }
.chart .trend { fill: none; stroke: var(--chart-trend); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.55; }
.chart .projection { fill: none; stroke: var(--chart-trend); stroke-width: 2.2; stroke-dasharray: 1 6; stroke-linecap: round; }
.chart .proj-hit { fill: var(--card); stroke: var(--chart-trend); stroke-width: 2.5; }
#journey-sub { white-space: pre-line; }
.chart .proj-label { fill: var(--accent-text); font-size: 11.5px; font-weight: 700; }
.chart .end-dot { fill: var(--chart-trend); stroke: var(--card); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart .today-line { stroke: var(--ink-4); stroke-width: 1; }
.chart .today-label { fill: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .bar-down { fill: var(--chart-trend); }
.chart .bar-up { fill: var(--chart-up); }
.chart .bar-ok { fill: var(--chart-trend); }
.chart .bar-over { fill: var(--warn); }
.chart .target-line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .lane { fill: var(--chart-trend); opacity: 0.08; }
.chart .plan-line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 7 5; stroke-linecap: round; opacity: 0.7; }
.chart .flag { fill: var(--chart-trend); stroke: var(--card); stroke-width: 2; }
.chart .flag-label { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.chart .ms { stroke: var(--card); stroke-width: 2; }
.chart .ms-conseguido { fill: var(--ok); }
.chart .ms-en-camino { fill: var(--chart-trend); }
.chart .ms-detras, .chart .ms-pasado { fill: var(--warn); }
.chart .ms-sin-datos { fill: var(--ink-3); }
.chart .ms-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--card); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  padding: 8px 12px; white-space: nowrap;
}
.tip-value { font-weight: 700; font-size: 16px; }
.tip-sub { color: var(--ink-2); font-size: 13px; }
.tip-date { color: var(--ink-3); font-size: 12px; }
.tip-date::first-letter { text-transform: uppercase; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; flex: none; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-trend); }
.key-line { width: 16px; height: 3px; border-radius: 2px; background: var(--chart-trend); }
.key-plan { width: 18px; height: 0; border-top: 2px dashed var(--ink-3); opacity: 0.8; }
.key-dash { width: 16px; height: 0; border-top: 1px dashed var(--ink-3); }
.key-proj { width: 16px; height: 0; border-top: 2px dotted var(--chart-trend); }
.key-ms { width: 9px; height: 9px; background: var(--ink-2); transform: rotate(45deg); margin: 0 2px; }
.key-bar-down, .key-bar-up { width: 10px; height: 10px; border-radius: 3px; }
.key-bar-down { background: var(--chart-trend); }
.key-bar-over { width: 10px; height: 10px; border-radius: 3px; background: var(--warn); }
.key-bar-up { background: var(--chart-up); }

/* ── pestañas: translúcidas, como la barra de bimio.tools ───── */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  padding: 0 8px env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; max-width: 150px; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; font: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--ink-3); cursor: pointer;
}
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent); }
.tabs button[aria-current="page"] svg { stroke-width: 2.1; }

/* ── bienvenida ─────────────────────────────────────────────── */

.welcome {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto; overflow-x: hidden;
  background: transparent;
  padding: calc(40px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}
/* mientras dura la bienvenida, detrás sólo queda el fondo vivo */
body.welcoming #app { display: none; }
.welcome-card { max-width: 480px; margin: 0 auto; }
.welcome-mark { display: block; margin: 0 auto; width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 10px 30px var(--icon-glow); }
.welcome h1 { margin: 20px 0 6px; text-align: center; font-size: 42px; line-height: 1.04; font-weight: 700; letter-spacing: -0.022em; }
.lead { margin: 0 0 26px; text-align: center; color: var(--ink-2); font-size: 17.5px; line-height: 1.45; }
.welcome-actions .btn.plain { margin-top: 6px; }

/* ── hojas inferiores ───────────────────────────────────────── */

dialog.sheet {
  margin: auto auto 0; width: 100%; max-width: 620px; max-height: 92vh;
  border: 0; border-radius: 22px 22px 0 0;
  padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
}
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--ink-4); margin: 4px auto 6px; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 0 0 14px; }
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.bar-btn { background: none; border: 0; font: inherit; font-size: 17px; color: var(--accent); cursor: pointer; min-height: var(--touch); padding: 0; justify-self: start; }
.bar-btn.strong { font-weight: 700; justify-self: end; }

/* ── avisos ─────────────────────────────────────────────────── */

.alert {
  position: fixed; left: 16px; right: 16px; z-index: 40;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 588px; margin: 0 auto;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--bad-soft); box-shadow: var(--shadow-lg); padding: 18px;
}
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: min(520px, calc(100vw - 32px)); width: max-content;
  background: var(--hud-bg); color: var(--hud-ink);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 15px; font-weight: 500; line-height: 1.4;
  padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg);
}
.toast.error { background: var(--bad); }

@media (prefers-reduced-motion: no-preference) {
  .screen { animation: fade 0.22s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
