/* =========================================================================
   Marea — estilos (v1.1)
   1. Temas   2. Base   3. Estructura y navegación   4. Componentes
   5. Pantallas   6. Animaciones   7. Impresión

   Rendimiento: solo se animan transform y opacity (y trazos SVG pequeños).
   Las animaciones de entrada usan "backwards" para no dejar capas vivas.
   ========================================================================= */

/* 1. TEMAS ---------------------------------------------------------------- */

/* Manta (por defecto): cálido, papel con textura, costuras y tipografía suave */
:root,
[data-theme='manta'] {
  color-scheme: light;
  --bg: #F2E8DA;
  --bg-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .24 0 0 0 0 .16 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 50% at 50% -8%, #FBF3E7 0%, rgba(251, 243, 231, 0) 70%);
  --surface: #FBF6EE;
  --surface-2: #F1E6D6;
  --surface-3: #F6EEE2;
  --ink: #3A2A22;
  --ink-soft: #6E5748;
  --ink-faint: #9C8676;
  --line: #E6D7C3;
  --line-strong: #CDB79C;
  --track: #EBDDCB;
  --track-strong: #DAC6AE;
  --period: #9E4A32;
  --period-ink: #FFF8F0;
  --period-soft: #F3DCCF;
  --period-strong: #8A3F2A;
  --glow: #F0DCCB;
  --accent: #9E4A32;
  --on-accent: #FFF8F0;
  --fertile: #E3E8D4;
  --fertile-arc: #BFCDA9;
  --fertile-ink: #4B5F41;
  --ovulation: #5E7552;
  --luteal-soft: #EEDFD3;
  --luteal-ink: #6B4A3A;
  --follicular-soft: #EFE5D5;
  --follicular-ink: #6E5748;
  --ph-period: #9E4A32;
  --ph-follicular: #E3D2BC;
  --ph-fertile: #8EA67F;
  --ph-luteal: #CDA683;
  --link: #5E7552;
  --energy: #8EA67F;
  --focus: #5E7552;
  --select: #3A2A22;
  --danger: #A33A2C;
  --warn: #8F5B12;
  --warn-soft: #F5E4C4;
  --ok: #4B5F41;
  --ok-soft: #E3E8D4;
  --deco: #CDA683;
  --stitch: rgba(176, 145, 110, 0.55);
  --nav-bg: rgba(251, 246, 238, 0.94);
  --nav-pill: #F0DFD0;
  --scrim: rgba(58, 42, 34, 0.38);
  --shadow: 0 1px 1px rgba(90, 60, 40, 0.04), 0 10px 24px -14px rgba(90, 60, 40, 0.22);
  --shadow-lift: 0 2px 4px rgba(90, 60, 40, 0.06), 0 16px 32px -14px rgba(90, 60, 40, 0.3);
  --shadow-pop: 0 18px 50px -12px rgba(58, 42, 34, 0.35);
  --card-border: 1px solid #EBDDCA;
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFF8F0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E5748' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head-fvs: 'SOFT' 100, 'WONK' 0, 'opsz' 48;
  --head-weight: 540;
  --head-tracking: -0.015em;
  --body-weight: 500;
  --r-card: 28px;
  --r-ctrl: 18px;
  --r-small: 14px;
  --r-chip: 999px;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* Sal: minimalista, blanco y aire */
[data-theme='sal'] {
  color-scheme: light;
  --bg: #F7F7F4;
  --bg-image: none;
  --surface: #FFFFFF;
  --surface-2: #F1F1ED;
  --surface-3: #FAFAF8;
  --ink: #16191B;
  --ink-soft: #5D6468;
  --ink-faint: #949A9D;
  --line: #E7E7E2;
  --line-strong: #C9CBC6;
  --track: #EEEEEA;
  --track-strong: #D9DAD5;
  --period: #B23A48;
  --period-ink: #FFFFFF;
  --period-soft: #F7E5E7;
  --period-strong: #9A3240;
  --glow: transparent;
  --accent: #B23A48;
  --on-accent: #FFFFFF;
  --fertile: #E3F0EC;
  --fertile-arc: #B9DDD5;
  --fertile-ink: #25615B;
  --ovulation: #25615B;
  --luteal-soft: #EDEBF4;
  --luteal-ink: #574A84;
  --follicular-soft: #F1F1ED;
  --follicular-ink: #5D6468;
  --ph-period: #B23A48;
  --ph-follicular: #D5DADB;
  --ph-fertile: #4A968D;
  --ph-luteal: #ABA0CF;
  --link: #25615B;
  --energy: #4A968D;
  --focus: #25615B;
  --select: #16191B;
  --danger: #B0303E;
  --warn: #8A5A00;
  --warn-soft: #FBF0D9;
  --ok: #25615B;
  --ok-soft: #E3F0EC;
  --deco: #C9CBC6;
  --stitch: transparent;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-pill: #F0F0EB;
  --scrim: rgba(17, 20, 22, 0.36);
  --shadow: none;
  --shadow-lift: 0 1px 2px rgba(22, 25, 27, 0.05), 0 8px 24px -12px rgba(22, 25, 27, 0.14);
  --shadow-pop: 0 18px 50px -12px rgba(22, 25, 27, 0.28);
  --card-border: 1px solid #ECECE7;
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D6468' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  --font-head: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head-fvs: normal;
  --head-weight: 600;
  --head-tracking: -0.03em;
  --body-weight: 450;
  --r-card: 20px;
  --r-ctrl: 14px;
  --r-small: 12px;
}

/* Noche: oscuro y sereno */
[data-theme='noche'] {
  color-scheme: dark;
  --bg: #0F1318;
  --bg-image: radial-gradient(100% 45% at 50% -10%, #17202B 0%, rgba(23, 32, 43, 0) 70%);
  --surface: #171C23;
  --surface-2: #1F262F;
  --surface-3: #1B2129;
  --ink: #E8EDF0;
  --ink-soft: #9DA9B2;
  --ink-faint: #6A7680;
  --line: #252D37;
  --line-strong: #3C4754;
  --track: #232B35;
  --track-strong: #34404D;
  --period: #E2727F;
  --period-ink: #11161D;
  --period-soft: #3A2328;
  --period-strong: #F2A0A9;
  --glow: #2A2028;
  --accent: #E2727F;
  --on-accent: #11161D;
  --fertile: #1B3533;
  --fertile-arc: #2D5A54;
  --fertile-ink: #91E0D4;
  --ovulation: #91E0D4;
  --luteal-soft: #29263D;
  --luteal-ink: #C8BEEC;
  --follicular-soft: #1F262F;
  --follicular-ink: #9DA9B2;
  --ph-period: #E2727F;
  --ph-follicular: #3A4552;
  --ph-fertile: #6FC3B8;
  --ph-luteal: #A99BD6;
  --link: #91E0D4;
  --energy: #4FA69A;
  --focus: #91E0D4;
  --select: #E8EDF0;
  --danger: #F2A0A9;
  --warn: #EDC07A;
  --warn-soft: #352B1B;
  --ok: #91E0D4;
  --ok-soft: #1B3533;
  --deco: #7D8A95;
  --stitch: transparent;
  --nav-bg: rgba(19, 24, 31, 0.92);
  --nav-pill: #242C37;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: none;
  --shadow-lift: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 18px 50px -10px rgba(0, 0, 0, 0.7);
  --card-border: 1px solid #222A33;
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2311161D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239DA9B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  --font-head: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head-fvs: normal;
  --head-weight: 600;
  --head-tracking: -0.03em;
  --body-weight: 450;
  --r-card: 20px;
  --r-ctrl: 14px;
  --r-small: 12px;
}

/* 2. BASE ------------------------------------------------------------------ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-repeat: repeat, no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: var(--body-weight);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-touch-callout: none; }
a { color: var(--link); }
strong { font-weight: 700; }

:focus { outline: none; }
:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
  border-radius: 10px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.is-hidden { display: none !important; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; }

.skip {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 100;
  width: 1px; height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
}
.skip:focus-visible { width: auto; height: auto; padding: 10px 16px; clip: auto; overflow: visible; }

/* Pantalla de arranque */
.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.boot svg { animation: breathe 1.6s ease-in-out infinite; }
.fatal { max-width: 420px; margin: 20vh auto; padding: 24px; text-align: center; }

/* Símbolo de Marea */
.logo-ring { stroke: currentColor; fill: none; }
.logo-wave { fill: var(--period); }
.logo-wave--move { animation: tide 5s ease-in-out infinite; will-change: transform; }
.logo--animated { overflow: visible; }

/* 3. ESTRUCTURA Y NAVEGACIÓN ------------------------------------------------- */

.shell { min-height: 100vh; min-height: 100dvh; }

.main {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 18px)
    max(16px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 110px)
    max(16px, env(safe-area-inset-left));
}
.main--bare {
  max-width: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.main:focus { outline: none; }

/* Barra inferior (móvil): estática entre pantallas; solo se desliza la marca activa */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-top: 1px solid var(--line);
  transform: translateZ(0);
}
[data-theme='manta'] .nav { border-top: 1.5px dashed var(--line-strong); }

.nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: var(--nav-pill);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.46s cubic-bezier(0.3, 1.25, 0.5, 1),
    width 0.36s var(--ease-out),
    height 0.36s var(--ease-out),
    opacity 0.2s ease;
  will-change: transform;
}
.nav__indicator.is-on { opacity: 1; }
.nav__indicator.no-anim { transition: none; }

.nav__brand { display: none; }

.nav__item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 68px;
  padding-top: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}
.nav__item .icon { transition: transform 0.3s var(--ease-spring); }
.nav__item.is-active { color: var(--ink); }
.nav__item:active .icon { transform: scale(0.86); }
.nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav__add {
  position: relative;
  z-index: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 65%, transparent);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.25s;
}
[data-theme='manta'] .nav__add { border-radius: 20px; }
[data-theme='noche'] .nav__add { box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.nav__add:active { transform: scale(0.9); }
.nav__add.is-active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); }
.nav__add-icon { display: grid; place-items: center; }
.nav__add-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 640px) {
  .main {
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
    padding-top: calc(env(safe-area-inset-top) + 30px);
  }
  .nav { grid-template-columns: repeat(5, minmax(0, 112px)); justify-content: center; }
}

/* Escritorio: barra lateral */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); }
  .nav {
    position: sticky;
    top: 0;
    left: auto; right: auto; bottom: auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 28px 18px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-top: 0;
    border-right: 1px solid var(--line);
    transform: none;
  }
  [data-theme='manta'] .nav { border-top: 0; border-right: 1.5px dashed var(--line-strong); }
  .nav__indicator { border-radius: 14px; }
  [data-theme='manta'] .nav__indicator { border-radius: 16px; }
  .nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 26px;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-head);
    font-variation-settings: var(--head-fvs);
    font-size: 27px;
    font-weight: var(--head-weight);
    letter-spacing: -0.03em;
  }
  .nav__add {
    order: 1;
    width: auto;
    height: 52px;
    margin: 0 0 18px;
    gap: 10px;
    padding: 0 18px;
    border-radius: var(--r-ctrl);
    justify-content: flex-start;
    font-weight: 700;
    box-shadow: none;
  }
  .nav__add:hover { filter: brightness(1.06); }
  .nav__add-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nav__item {
    order: 2;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.25s, background-color 0.2s;
  }
  .nav__item:hover:not(.is-active) { color: var(--ink); background: color-mix(in srgb, var(--nav-pill) 55%, transparent); }
  .main { max-width: 1140px; padding: 44px 48px 72px; }
  .main--bare { max-width: none; padding: 0; }
}

/* Vista: cada pantalla entra con un movimiento corto (la barra no se toca) */
.view { display: block; }
.view--enter-forward { animation: view-in-right 0.36s var(--ease-out) backwards; }
.view--enter-back { animation: view-in-left 0.36s var(--ease-out) backwards; }
.view--enter-fade { animation: view-in-fade 0.3s var(--ease-out) backwards; }

/* Páginas */
.page { display: flex; flex-direction: column; gap: 18px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}
.page-head > div { min-width: 0; }

.eyebrow { font-size: 14px; color: var(--ink-soft); margin-bottom: 2px; }
[data-theme='manta'] .eyebrow { font-family: var(--font-head); font-style: italic; font-size: 16px; }

.title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: clamp(28px, 6.6vw, 38px);
  line-height: 1.06;
  letter-spacing: var(--head-tracking);
  text-wrap: balance;
}

/* 4. COMPONENTES ------------------------------------------------------------ */

/* Tarjetas */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-card);
  border: var(--card-border);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
/* Manta: costura interior, como una manta acolchada */
[data-theme='manta'] .card:not(.card--list):not(.card--outline):not(.card--soft) {
  outline: 1.5px dashed var(--stitch);
  outline-offset: -7px;
}
.card--outline { background: transparent; border: 1px solid var(--line); box-shadow: none; }
[data-theme='manta'] .card--outline { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-color: transparent; }
.card--soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card--outline .btn--soft, .card--soft .btn--soft { background: var(--surface); }
.card--list { padding: 4px 0; overflow: hidden; }

.card__label { font-size: 13px; color: var(--ink-soft); }
.card__title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-size: 18px;
  font-weight: var(--head-weight);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.card__headrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
}
.card__hint { font-size: 13px; color: var(--ink-soft); }
.card__caption { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-ctrl);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s var(--ease-out), background-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--accent { background: var(--accent); color: var(--on-accent); }
[data-theme='manta'] .btn--accent { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 18px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
[data-theme='manta'] .btn--primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.btn--primary:hover:not(:disabled), .btn--accent:hover:not(:disabled) { filter: brightness(1.08); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
[data-theme='sal'] .btn--ghost, [data-theme='noche'] .btn--ghost { box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--soft { background: var(--surface-2); }
.btn--soft:hover { filter: brightness(0.97); }
[data-theme='noche'] .btn--soft:hover { filter: brightness(1.15); }
.btn--text { min-height: 44px; padding: 0 10px; background: transparent; color: var(--link); }
.btn--text:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.btn--danger { background: var(--danger); color: var(--surface); }
.btn--danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--danger-text { color: var(--danger); }
.btn--small { min-height: 42px; padding: 0 14px; font-size: 14px; border-radius: var(--r-small); }
.btn--block { width: 100%; }
.btn--big { min-height: 56px; font-size: 16.5px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: var(--card-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background-color 0.2s;
}
[data-theme='manta'] .icon-btn { border: 1.5px dashed var(--line-strong); }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn--small { width: 40px; height: 40px; }
.icon-btn--flat, [data-theme='manta'] .icon-btn--flat { border: 0; background: transparent; }
.icon-btn--flat:hover { background: var(--surface-2); }
.icon-btn.is-ghost { visibility: hidden; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.spinner--big { width: 32px; height: 32px; border-width: 3px; color: var(--ink-soft); }

/* Píldora de fase */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: var(--follicular-soft);
  color: var(--follicular-ink);
}
.pill--period, .pill--late, .pill--expected { background: var(--period-soft); color: var(--period-strong); }
.pill--fertile, .pill--ovulation { background: var(--fertile); color: var(--fertile-ink); }
.pill--luteal { background: var(--luteal-soft); color: var(--luteal-ink); }

/* Nivel de fertilidad (modo buscar embarazo) */
.level {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--surface);
}
.level--low { color: var(--ink-soft); }
.level--medium { color: var(--fertile-ink); }
.level--high { background: var(--fertile-ink); color: var(--surface); }

/* Chips */
.chips, .chiplist { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-out);
}
.chip:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip:active { transform: scale(0.95); }
.chip.is-on { background: var(--ink); color: var(--bg); box-shadow: none; }
[data-theme='manta'] .chip.is-on { background: var(--period); color: var(--period-ink); }
.chip--add { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-strong); color: var(--ink); }
.chip--wide { width: 100%; justify-content: center; }
.chip--static {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
  background: var(--surface-2);
  box-shadow: none;
  cursor: default;
}
.chip--static:hover { box-shadow: none; }
.chip--static:active { transform: none; }
.chip--flow { background: var(--period-soft); color: var(--period-strong); }
.chip--none { background: var(--surface-2); color: var(--ink-soft); }
.chip--test, .chip--mucus { background: var(--fertile); color: var(--fertile-ink); }
.chip--removable { padding-right: 4px; }
.chip__x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip__x:hover { background: var(--surface); color: var(--ink); }

/* Leyendas */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend--inline { justify-content: flex-start; }
.legend--phases { margin: -4px 0 14px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend__swatch--period { background: var(--period); }
.legend__swatch--predicted { border: 1.5px dashed var(--period); }
.legend__swatch--fertile { background: var(--ph-fertile); }
.cal .legend__swatch--fertile { background: var(--fertile-arc); }
.legend__swatch--ov { width: 8px; height: 8px; background: var(--ovulation); }
.legend__swatch--today { border: 2px solid var(--ink); }
.legend__swatch--log { width: 5px; height: 5px; background: var(--ink-soft); }
.legend__swatch--cycle { background: var(--track-strong); }
.legend__swatch--follicular { background: var(--ph-follicular); }
.legend__swatch--luteal { background: var(--ph-luteal); }
.legend__swatch--avg { width: 16px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--ink-faint); }

/* Avisos dentro de la página */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 12px 12px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}
.main:not(.is-refresh) .banner { animation: rise 0.45s var(--ease-out) backwards; }
.banner p { flex: 1 1 200px; }
.banner > .icon { color: var(--link); }
.banner__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.banner--warn { background: var(--period-soft); color: var(--period-strong); border-color: transparent; }
.banner--warn > .icon { color: currentColor; }
.banner--calm { background: var(--fertile); color: var(--fertile-ink); border-color: transparent; }
.banner--calm > .icon { color: currentColor; }
.banner--soft { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.banner--soft > .icon { color: currentColor; }
.banner--soft .btn--soft { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }

/* Interruptor */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--track-strong);
  transition: background-color 0.25s;
}
.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.34s var(--ease-spring);
}
[aria-checked='true'] > .switch { background: var(--accent); }
[aria-checked='true'] > .switch .switch__knob { transform: translateX(20px); }
[data-theme='noche'] [aria-checked='true'] > .switch .switch__knob { background: var(--on-accent); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-ctrl);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

/* Filas (ajustes) */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 18px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s;
}
.card--list > .row + .row { border-top: 1px solid var(--line); }
[data-theme='manta'] .card--list > .row + .row { border-top-style: dashed; }
button.row, a.row { cursor: pointer; }
button.row:hover, a.row:hover { background: var(--surface-3); }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__label { font-size: 15px; font-weight: 650; line-height: 1.35; }
.row__hint { font-size: 13px; line-height: 1.42; color: var(--ink-soft); font-weight: 500; }
.row__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
}
.row__chev { color: var(--ink-faint); }
.row--danger .row__label, .row--danger .row__icon { color: var(--danger); }
.row--block { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.row--note { min-height: 0; font-size: 13px; color: var(--ink-soft); }
.row--info { align-items: flex-start; }
.row--info .row__icon { color: var(--ink-soft); }
.row--seg, .row--stepper { flex-wrap: wrap; row-gap: 10px; }
.row--stepper .row__text { flex: 1 1 210px; }
.row--seg .row__text { flex: 1 1 150px; }
.row--stepper .stepper, .row--seg .segmented { margin-left: auto; }
.row--inline { width: auto; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* Selector numérico */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface-2);
}
.stepper__btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s, opacity 0.2s;
}
[data-theme='noche'] .stepper__btn { background: var(--track-strong); box-shadow: none; }
.stepper__btn:active { transform: scale(0.9); }
.stepper__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper__value { min-width: 92px; padding: 0 4px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.stepper--big .stepper__btn { width: 54px; height: 54px; font-size: 26px; }
.stepper--big .stepper__value { min-width: 108px; font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-size: 21px; font-weight: var(--head-weight); }

/* Control segmentado */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface-2);
}
.segmented__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.22s, color 0.22s, box-shadow 0.22s;
}
.segmented__btn[aria-checked='true'],
.segmented__btn[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme='noche'] .segmented__btn[aria-checked='true'],
[data-theme='noche'] .segmented__btn[aria-selected='true'] { background: var(--track-strong); box-shadow: none; }
.segmented--wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.segmented--wide .segmented__btn { min-height: 46px; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; font-weight: 700; }
.field__hint { font-size: 13px; color: var(--ink-soft); line-height: 1.42; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 16px;
  transition: box-shadow 0.2s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus { box-shadow: inset 0 0 0 2px var(--focus); outline: none; }
.input[aria-invalid='true'] { box-shadow: inset 0 0 0 2px var(--danger); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.dialog .input, .row--block .input { background: var(--bg); }
[data-theme='noche'] .dialog .input, [data-theme='noche'] .row--block .input { background: var(--surface-2); }
.input--select {
  -webkit-appearance: none;
  appearance: none;
  width: auto;
  min-height: 40px;
  padding: 6px 34px 6px 12px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.input--time { width: auto; min-height: 40px; padding: 6px 10px; font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.input--code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
.input[type='date'] { -webkit-appearance: none; appearance: none; text-align: left; }
.input[type='date']::-webkit-date-and-time-value { text-align: left; }

/* Casillas */
.check-list { display: flex; flex-direction: column; border-radius: var(--r-ctrl); background: var(--bg); overflow: hidden; }
[data-theme='noche'] .check-list { background: var(--surface-2); }
.check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 58px;
  padding: 10px 14px;
  cursor: pointer;
}
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-row__text { flex: 1 1 140px; font-size: 15px; font-weight: 650; line-height: 1.3; }
.check-row .input { background-color: var(--surface); }
.check {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line-strong);
  cursor: pointer;
  transition: background-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease-spring);
}
.check:checked { background: var(--accent) var(--check-mark) center / 16px no-repeat; box-shadow: none; }
.check:active { transform: scale(0.9); }

/* Diálogos: hoja inferior en móvil, ventana centrada en escritorio */
.dialog {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.dialog::backdrop {
  background: var(--scrim);
  animation: fade-in 0.25s ease both;
}
.dialog.is-closing::backdrop { animation: fade-out 0.2s ease both; }
.dialog__panel {
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: sheet-in 0.42s var(--ease-out) both;
}
[data-theme='manta'] .dialog__panel { background-image: var(--bg-image); background-color: var(--surface); background-repeat: repeat, no-repeat; }
.dialog.is-closing .dialog__panel { animation: sheet-out 0.22s ease both; }
.dialog__panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 5px;
  margin: -12px auto 16px;
  border-radius: 99px;
  background: var(--line-strong);
  opacity: 0.6;
}
.dialog__form { display: flex; flex-direction: column; gap: 16px; }
.is-shaking { animation: shake 0.45s; }
.dialog__title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.dialog__text { color: var(--ink-soft); font-size: 15px; line-height: 1.5; margin-bottom: 4px; }
.dialog__body { color: var(--ink); font-size: 15px; line-height: 1.55; margin: 12px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.dialog__body ol { list-style: decimal; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.dialog__note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.dialog__note .icon { margin-top: 1px; }
.dialog__error { min-height: 1.2em; color: var(--danger); font-size: 14px; font-weight: 700; }
.dialog__error:empty { min-height: 0; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog__form .dialog__actions { margin-top: 2px; }
.dialog__actions .btn { flex: 1 1 0; }
.dialog__actions--stack { flex-direction: column; align-items: stretch; }
.dialog__choices { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.dialog__alt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 12px; border-top: 1px dashed var(--line); text-align: center; }

@media (min-width: 640px) {
  .dialog { width: min(480px, calc(100% - 32px)); margin: auto; }
  .dialog__panel { border-radius: 28px; padding: 28px; animation-name: pop-in; }
  .dialog.is-closing .dialog__panel { animation-name: pop-out; }
  .dialog__panel::before { display: none; }
  .dialog__actions:not(.dialog__actions--stack) .btn { flex: 0 0 auto; }
}

/* Ventana de instalación */
.install { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.install__icon { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 8px; box-shadow: var(--shadow-lift); }
.main:not(.is-refresh) .install__icon, .install__icon { animation: pop 0.6s 0.1s var(--ease-spring) backwards; }
.install__title { margin-bottom: 0; }
.install__perks { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 14px 0 4px; text-align: left; }
.install__perks li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.install__perks .icon { color: var(--period); }
.install__steps { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; text-align: left; font-size: 14.5px; line-height: 1.45; }
.install__steps li { display: flex; align-items: center; gap: 12px; }
.install__n { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 800; }
.ios-glyph { display: inline-block; vertical-align: -4px; margin: 0 2px; color: #0A84FF; }
.install .dialog__actions { width: 100%; margin-top: 14px; }
.install__later { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.install__never { color: var(--ink-soft); }

/* Avisos flotantes */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100% - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-pop);
  font-size: 14.5px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.42s var(--ease-spring) both;
}
.toast.is-leaving { animation: toast-out 0.25s ease both; }
.toast--error { background: var(--danger); color: var(--surface); }
.toast__msg { flex: 1; }
.toast__action {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  color: inherit;
  font-weight: 800;
  cursor: pointer;
}
@media (min-width: 960px) {
  .toasts { left: calc(50% + 128px); bottom: 28px; }
}
[data-shell='bare'] .toasts, [data-shell='lock'] .toasts { left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* Estado vacío */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
}
.empty--big { padding: 44px 20px; }
.empty__art, .empty__logo { color: var(--ink); margin-bottom: 6px; }
.empty__title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 23px;
}
.empty__text { max-width: 380px; color: var(--ink-soft); }
.empty__progress { font-size: 14px; font-weight: 700; color: var(--period-strong); margin-bottom: 8px; }

.footnote { padding: 0 6px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* Barra de progreso */
.progress { width: 100%; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

/* Pasos numerados */
.steps { display: flex; flex-direction: column; gap: 12px; padding: 0 4px; font-size: 15px; line-height: 1.45; }
.steps li { display: flex; align-items: flex-start; gap: 12px; }
.steps__n {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
}

/* Opciones de objetivo (Ajustes y bienvenida) */
.goal-opts { display: flex; flex-direction: column; gap: 10px; }
.goal-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: var(--card-border);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.18s var(--ease-out), background-color 0.25s;
}
.goal-opt:active { transform: scale(0.985); }
.goal-opt.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.goal-opt__icon { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); color: var(--ink); transition: background-color 0.25s, color 0.25s; }
.goal-opt.is-on .goal-opt__icon { background: var(--period-soft); color: var(--period-strong); }
.goal-opt__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.goal-opt__name { font-size: 16px; font-weight: 750; }
.goal-opt__desc { font-size: 13.5px; line-height: 1.4; color: var(--ink-soft); }
.goal-opt__check {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line-strong);
  color: transparent;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.3s var(--ease-spring);
}
.goal-opt.is-on .goal-opt__check { background: var(--accent); box-shadow: none; color: var(--on-accent); transform: scale(1.05); }

/* Tema y color */
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 8px 12px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.18s var(--ease-out);
}
.theme-card:active { transform: scale(0.97); }
.theme-card.is-on { box-shadow: inset 0 0 0 2.5px var(--accent); }
.theme-card__name { padding: 4px 4px 0; font-size: 14.5px; font-weight: 800; }
.theme-card__desc { padding: 0 4px; font-size: 12px; line-height: 1.3; color: var(--ink-soft); }
.tp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 14px;
  transition: transform 0.3s var(--ease-spring);
}
.theme-card.is-on .tp { transform: scale(0.96); }
.tp__svg { width: 58%; overflow: visible; }
.tp__track, .tp__arc { fill: none; stroke-width: 7; }
.tp__lines { display: flex; flex-direction: column; gap: 4px; width: 66%; }
.tp__lines i { display: block; height: 5px; border-radius: 3px; }
.tp__lines i:last-child { width: 62%; }
.tp--sal { background: #F7F7F4; box-shadow: inset 0 0 0 1px #E7E7E2; }
.tp--sal .tp__track { stroke: #EEEEEA; stroke-width: 5; }
.tp--sal .tp__arc { stroke-width: 5; }
.tp--sal .tp__dot { stroke: #16191B; stroke-width: 0; }
.tp--sal .tp__lines i { background: #E7E7E2; }
.tp--manta { background: #F2E8DA; border-radius: 18px; }
.tp--manta::after { content: ''; position: absolute; inset: 5px; border-radius: 14px; border: 1.2px dashed rgba(176, 145, 110, 0.6); }
.tp--manta .tp__track { stroke: #E5D6C2; stroke-width: 9; }
.tp--manta .tp__arc { stroke-width: 9; stroke-linecap: round; }
.tp--manta .tp__lines i { background: #E3D4C0; }
.tp--noche { background: #0F1318; }
.tp--noche .tp__track { stroke: #252D37; }
.tp--noche .tp__lines i { background: #252D37; }

.color-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.color-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}
.color-opt.is-on { color: var(--ink); }
.color-opt__dot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--c, var(--period));
  color: var(--on-accent);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.25s;
}
[data-theme='manta'] .color-opt__dot { border-radius: 16px; }
.color-opt__dot .icon { opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.35s var(--ease-spring); }
.color-opt.is-on .color-opt__dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c, var(--period)); transform: scale(1.04); }
.color-opt.is-on .color-opt__dot .icon { opacity: 1; transform: none; }
.color-opt:active .color-opt__dot { transform: scale(0.9); }
.color-opt__name { line-height: 1.2; }

/* 5. PANTALLAS ---------------------------------------------------------------- */

/* ---- Hoy ---- */
.today { display: grid; gap: 14px; }
.today__side { display: grid; gap: 14px; align-content: start; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 18px 20px; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.hero__actions .btn { flex: 1 1 auto; white-space: nowrap; }

.ring {
  position: relative;
  width: min(80vw, 316px);
  aspect-ratio: 1;
}
/* Resplandor cálido detrás del anillo (estático: no cuesta nada al desplazar) */
.ring::before {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  pointer-events: none;
}
.ring__svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.ring__track { fill: none; stroke: var(--track); }
[data-theme='manta'] .ring__track { stroke: #EADCC9; }
.ring__stitch { fill: none; stroke: var(--stitch); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.ring--empty .ring__stitch { stroke: var(--line-strong); }
.ring__bead { fill: var(--line-strong); opacity: 0.6; }
.ring__bead.is-logged { fill: var(--ink-soft); opacity: 1; }
.ring__window { fill: none; stroke: var(--period); stroke-linecap: round; stroke-dasharray: 0 11; opacity: 0.7; }
.ring__arc {
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.1s var(--ease-out) forwards;
}
[data-theme='manta'] .ring__arc { stroke-linecap: round; }
.ring__arc--period { stroke: var(--period); animation-delay: 0.1s; }
.ring__arc--period.is-assumed { stroke: color-mix(in srgb, var(--period) 55%, var(--surface)); }
.ring__arc--fertile { stroke: var(--fertile-arc); animation-delay: 0.36s; }
.ring__ov { fill: var(--ovulation); transform-box: fill-box; transform-origin: center; animation: pop 0.45s 0.95s var(--ease-spring) backwards; }
.ring__ov.is-confirmed { stroke: var(--surface); stroke-width: 2.5; }
.ring__tick { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.ring__halo { fill: var(--ink); opacity: 0.08; transform-box: fill-box; transform-origin: center; animation: halo 2.8s 1.2s ease-in-out 4; }
[data-theme='noche'] .ring__halo { fill: var(--ink); opacity: 0.1; }
.ring__today {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.55s 0.6s var(--ease-spring) backwards;
}
.ring__deco { fill: var(--deco); transform-box: fill-box; transform-origin: center; animation: twinkle 3.6s ease-in-out 6; }
.ring__deco--2 { animation-delay: 1.2s; }
.ring__deco--3 { animation-delay: 2.4s; }
.ring__star { fill: var(--ink-soft); animation: twinkle 4.2s ease-in-out 6; }
.ring__star--2 { animation-delay: 1.4s; }
.ring__star--3 { animation-delay: 2.6s; }
.main.is-refresh .ring__arc { animation: none; stroke-dashoffset: 0; }
.main.is-refresh .ring__today, .main.is-refresh .ring__ov { animation: none; }

.ring__center {
  position: absolute;
  inset: 17%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
}
.main:not(.is-refresh) .ring__center { animation: rise 0.6s 0.18s var(--ease-out) backwards; }
.ring__eyebrow { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
[data-theme='manta'] .ring__eyebrow { font-family: var(--font-head); font-style: italic; font-size: 19px; font-weight: 450; }
[data-theme='sal'] .ring__eyebrow, [data-theme='noche'] .ring__eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11.5px; font-weight: 700; }
.ring__day {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: clamp(60px, 19.5vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
[data-theme='sal'] .ring__day, [data-theme='noche'] .ring__day { font-weight: 500; letter-spacing: -0.06em; }
.ring__sub { font-size: 13px; line-height: 1.35; color: var(--ink-soft); margin: 3px 0 10px; max-width: 170px; }
.ring__sub--wide { max-width: 190px; margin-top: 12px; }
.ring--empty .ring__center { gap: 4px; }

.next { display: flex; flex-direction: column; gap: 12px; }
.next__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.next__main { min-width: 0; }
.next__big {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.next__range { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.next__dates { font-size: 15.5px; font-weight: 800; color: var(--period-strong); }
.next__hint { font-size: 12.5px; color: var(--ink-soft); }
.next__note { font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.next__fertile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--fertile);
  color: var(--fertile-ink);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
}
.next__fertile > span:not(.level) { flex: 1 1 180px; }
.next__quality { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }

/* Guía de la fase */
.guide { display: flex; flex-direction: column; gap: 10px; }
.guide__head { display: flex; align-items: center; gap: 12px; }
.guide__icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; background: var(--follicular-soft); color: var(--follicular-ink); }
[data-theme='manta'] .guide__icon { border-radius: 50%; }
.guide--period .guide__icon, .guide--late .guide__icon, .guide--expected .guide__icon { background: var(--period-soft); color: var(--period-strong); }
.guide--fertile .guide__icon { background: var(--fertile); color: var(--fertile-ink); }
.guide--luteal .guide__icon { background: var(--luteal-soft); color: var(--luteal-ink); }
.guide__text { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.guide__personal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.45;
}
.guide__personal .icon { margin-top: 1px; color: var(--link); }
.guide__personal strong { font-weight: 800; }

/* Registro rápido */
.quick { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px 14px; }
.quick__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.quick__status { font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.quick__edit { font-size: 14px; font-weight: 750; text-decoration: none; padding: 6px 2px; }
.quick .chiplist { padding: 0 4px; }
.quick__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 8px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 70px;
  padding: 8px 4px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), filter 0.2s;
}
.tile:hover { filter: brightness(0.98); }
[data-theme='noche'] .tile:hover { filter: brightness(1.15); }
.tile:active { transform: scale(0.94); }
[data-theme='manta'] .tile { border-radius: 20px; }
.tile__icon--flow { color: var(--period); }
.tile__icon--temp { color: var(--warn); }

/* Recordatorio de copia */
.reminder-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.reminder-card__row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
.reminder-card__row .icon { color: var(--link); margin-top: 1px; }
.reminder-card__actions { display: flex; gap: 6px; justify-content: flex-end; }

@media (min-width: 960px) {
  .today { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 20px; }
  .today__side { gap: 16px; }
  .hero { padding: 34px 28px 28px; position: sticky; top: 32px; }
  .ring { width: min(100%, 350px); }
}

/* ---- Calendario ---- */
.calendar-layout { display: grid; gap: 14px; }
.calendar-side { display: grid; gap: 14px; align-content: start; }
.cal { padding: 14px 12px 18px; }
.cal__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal__nav .icon-btn { background: var(--surface-2); border: 0; }
.cal__month {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 20px;
  letter-spacing: -0.01em;
  text-align: center;
}
.cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 6px 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-faint);
  text-align: center;
  text-transform: uppercase;
}
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; touch-action: pan-y; }
.cal__grid--next { animation: slide-from-right 0.36s var(--ease-out) backwards; }
.cal__grid--prev { animation: slide-from-left 0.36s var(--ease-out) backwards; }
.cal__cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; }
.cal__day {
  --today-sh: 0 0 #0000;
  --sel-sh: 0 0 #0000;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(44px, 11.6vw);
  height: min(44px, 11.6vw);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--today-sh), var(--sel-sh);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-out);
}
[data-theme='manta'] .cal__day { border-radius: 40%; }
.cal__day:hover { background: var(--surface-2); }
.cal__day:active { transform: scale(0.9); }
.cal__day.is-future { color: var(--ink-soft); }
.cal__day.is-fertile { background: var(--fertile); color: var(--ink); }
.cal__day.is-predicted { border: 1.5px dashed var(--period); color: var(--period-strong); font-weight: 750; }
.cal__day.is-assumed { background: color-mix(in srgb, var(--period-soft) 70%, transparent); border: 1.5px dashed color-mix(in srgb, var(--period) 60%, transparent); color: var(--period-strong); }
.cal__day.is-spotting { background: var(--period-soft); color: var(--period-strong); }
.cal__day.is-period { background: var(--period); color: var(--period-ink); font-weight: 750; border: 0; }
.cal__day.is-today { --today-sh: inset 0 0 0 2px var(--ink); font-weight: 800; }
.cal__day.is-period.is-today { --today-sh: inset 0 0 0 2px var(--period-ink); }
.cal__day.is-selected { --sel-sh: 0 0 0 2px var(--surface), 0 0 0 4px var(--select); }
.cal__ov { width: 5px; height: 5px; margin-top: 2px; border-radius: 50%; background: var(--ovulation); }
.cal__day.is-ov-confirmed .cal__ov { width: 7px; height: 7px; box-shadow: 0 0 0 1.5px var(--surface); }
.cal__dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.cal__dot.is-on { background: var(--ink-faint); }
.cal .legend { margin-top: 14px; justify-content: flex-start; padding: 0 8px; }

.detail { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.detail.is-swapping { animation: rise 0.3s var(--ease-out) backwards; }
.detail__title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 19px;
  letter-spacing: -0.01em;
}
.detail__today { color: var(--ink-soft); font-weight: 500; }
.detail__sub { font-size: 13.5px; color: var(--ink-soft); }
.detail .chiplist { margin-top: 8px; }
.detail__note {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail__empty { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.detail__btn { align-self: flex-start; margin-top: 10px; }

.next-mini { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.next-mini__title { font-size: 14.5px; font-weight: 750; }
.next-mini__sub { font-size: 13px; color: var(--ink-soft); }
.next-mini__days { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-day { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 13px; font-weight: 750; }
.mini-day--predicted { border: 1.5px dashed var(--period); color: var(--period-strong); }

@media (min-width: 960px) {
  .calendar-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 20px; }
  .cal { padding: 20px 20px 22px; }
  .cal__day { width: 48px; height: 48px; font-size: 16px; }
  .calendar-side { position: sticky; top: 32px; }
}

/* ---- Registro ---- */
.page--log { gap: 14px; padding-bottom: 86px; }
.page-head--log { align-items: center; }
.log__date { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.log__nav { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.log__sub { font-size: 14.5px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log { display: flex; flex-direction: column; gap: 24px; }
.log__section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; border-radius: 18px; }
.log__section.is-highlight { animation: highlight 1.6s ease; }
.log__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px; }
.log__title { font-size: 15px; font-weight: 800; }
[data-theme='manta'] .log__title { font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-weight: 560; font-size: 17px; }
.log__value { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }

.opts--flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 80px;
  padding: 8px 2px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-out);
}
[data-theme='manta'] .opt { border-radius: 22px; }
.opt:active { transform: scale(0.95); }
.opt.is-on { background: var(--period-soft); box-shadow: inset 0 0 0 2px var(--period); }
.opt[data-flow='none'].is-on { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--ink-soft); }
.opt__label { font-size: clamp(11px, 3.1vw, 12.5px); font-weight: 700; line-height: 1.15; text-align: center; -webkit-hyphens: auto; hyphens: auto; }
.drops { display: flex; align-items: flex-end; gap: 1px; height: 18px; }
.drops--none { align-items: center; color: var(--ink-soft); }
.none-mark { position: relative; display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.none-mark::after { content: ''; position: absolute; left: 50%; top: -1px; width: 2px; height: 14px; margin-left: -1px; background: currentColor; transform: rotate(45deg); }
.drop path { fill: var(--track-strong); transition: fill 0.25s; }
.opt.is-on .drop path { fill: color-mix(in srgb, var(--period) 30%, var(--period-soft)); }
.drop.is-full path, .opt.is-on .drop.is-full path { fill: var(--period); }
.opt.is-pop .drop.is-full { animation: drop-in 0.4s var(--ease-spring) backwards; }
.opt.is-pop .drop.is-full:nth-child(2) { animation-delay: 0.05s; }
.opt.is-pop .drop.is-full:nth-child(3) { animation-delay: 0.1s; }
.drops--spot { align-items: center; }
.spot { width: 7px; height: 7px; border-radius: 50%; background: var(--period); opacity: 0.75; }
.is-pop { animation: pop-soft 0.3s var(--ease-spring); }

.segs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.seg {
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, transform 0.15s;
}
.seg:active { transform: scale(0.93); }
.seg.is-on { background: var(--energy); box-shadow: none; }

.test-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 4px 4px; }
.test-row + .test-row { margin-top: 6px; }
.test-row__label { font-size: 14.5px; font-weight: 650; }
.test-row .segmented { flex: 0 0 auto; }

.temp { display: flex; align-items: center; gap: 10px; }
.input--temp { max-width: 160px; font-size: 20px; font-variant-numeric: tabular-nums; }
.temp__unit { font-weight: 750; color: var(--ink-soft); }

.log__footer {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
}
.log__done { min-width: 140px; }
.log__footer .btn--text { white-space: nowrap; }
@media (max-width: 359px) { .log__footer .btn--text span { display: none; } }
.log__done.is-saved { animation: pop-soft 0.4s var(--ease-spring); }
@media (min-width: 640px) {
  .log__footer { left: 50%; right: auto; width: min(680px, 100%); transform: translateX(-50%); padding-left: 28px; padding-right: 28px; border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; }
}
@media (min-width: 960px) {
  .page--log { max-width: 720px; padding-bottom: 0; }
  .log__footer { position: sticky; bottom: 0; left: auto; transform: none; width: auto; margin: 6px -4px 0; padding: 14px 4px; background: var(--bg); border: 0; border-top: 1px solid var(--line); border-radius: 0; }
}

/* ---- Resumen ---- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--shadow);
}
[data-theme='manta'] .stat { outline: 1.5px dashed var(--stitch); outline-offset: -6px; padding: 18px; }
.stat__label { font-size: 13px; color: var(--ink-soft); line-height: 1.3; font-weight: 600; }
.stat__value {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat__unit { margin-left: 4px; font-family: var(--font-body); font-size: 14px; font-weight: 650; letter-spacing: 0; color: var(--ink-soft); }
.stat__sub { font-size: 12.5px; color: var(--ink-soft); }
.insights-grid { display: grid; gap: 14px; }

/* Salud del ciclo (criterios FIGO) */
.health__list { display: flex; flex-direction: column; gap: 10px; }
.health__row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 16px; background: var(--ok-soft); }
.health__row.is-warn { background: var(--warn-soft); }
.health__icon { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--ok); }
.health__row.is-warn .health__icon { color: var(--warn); }
.health__text { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; flex: 1; min-width: 0; }
.health__label { font-size: 14.5px; font-weight: 750; }
.health__value { font-size: 14.5px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.health__range { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.health__note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.health__note .icon { margin-top: 2px; }
.health__foot { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink-faint); }

.chart { position: relative; height: 200px; padding-top: 18px; }
.chart__avg {
  position: absolute;
  left: 0; right: 0;
  top: -100px;
  border-top: 1.5px dashed var(--ink-faint);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.chart__avg.is-placed { opacity: 0.8; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar__value { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar__col {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(100%, 34px);
  height: calc((100% - 50px) * var(--h, 0));
  border-radius: 10px 10px 6px 6px;
  background: var(--track-strong);
  overflow: hidden;
  transform-origin: bottom;
}
.main:not(.is-refresh) .bar__col { animation: grow-y 0.7s var(--ease-out) backwards; }
.bar__period { display: block; height: calc(100% * var(--p, 0)); background: var(--period); border-radius: 0 0 6px 6px; }
.bar__label { font-size: 11.5px; color: var(--ink-soft); text-transform: capitalize; white-space: nowrap; }
.bar:nth-child(2) .bar__col { animation-delay: 0.04s; }
.bar:nth-child(3) .bar__col { animation-delay: 0.08s; }
.bar:nth-child(4) .bar__col { animation-delay: 0.12s; }
.bar:nth-child(5) .bar__col { animation-delay: 0.16s; }
.bar:nth-child(6) .bar__col { animation-delay: 0.2s; }
.bar:nth-child(n + 7) .bar__col { animation-delay: 0.24s; }

/* Gráfico de temperatura */
.tchart { width: 100%; height: auto; overflow: visible; }
.tchart__grid { stroke: var(--line); stroke-width: 1; }
.tchart__label { fill: var(--ink-faint); font-size: 10px; font-family: var(--font-body); font-weight: 650; font-variant-numeric: tabular-nums; }
.tchart__line { fill: none; stroke: var(--warn); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.tchart__dot { fill: var(--surface); stroke: var(--warn); stroke-width: 1.8; }
.tchart__ov { stroke: var(--ovulation); stroke-width: 1.5; stroke-dasharray: 3 4; }
.tchart__ovlabel { fill: var(--ovulation); font-size: 10.5px; font-weight: 800; font-family: var(--font-body); }
.tchart__luteal { fill: var(--luteal-soft); opacity: 0.7; }
.tchart__cover { stroke: var(--ink-faint); stroke-width: 1.2; stroke-dasharray: 5 4; }
.tchart__coverlabel { fill: var(--ink-faint); font-size: 9.5px; font-weight: 700; font-family: var(--font-body); }
.tchart__today { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 2 3; }
.tchart-tabs { margin-bottom: 10px; }
.tchart-tabs .segmented__btn { min-height: 34px; font-size: 13px; }

.syms { display: flex; flex-direction: column; gap: 16px; }
.sym { display: flex; flex-direction: column; gap: 6px; }
.sym__head { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.sym__name { font-weight: 750; }
.sym__count { color: var(--ink-soft); font-size: 13px; }
.sym__note { font-size: 12.5px; color: var(--ink-soft); }
.dist { display: flex; gap: 3px; height: 10px; }
.dist__seg { flex: 0 1 0; border-radius: 99px; min-width: 0; transition: flex-grow 0.6s var(--ease-out); }
.dist__seg--period { background: var(--ph-period); }
.dist__seg--follicular { background: var(--ph-follicular); }
.dist__seg--fertile { background: var(--ph-fertile); }
.dist__seg--luteal { background: var(--ph-luteal); }

.ebars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ebar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ebar__track { position: relative; display: flex; align-items: flex-end; width: 100%; max-width: 54px; height: 110px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.ebar__fill { display: block; width: 100%; height: calc(100% * var(--h, 0)); border-radius: 14px; transform-origin: bottom; }
.main:not(.is-refresh) .ebar__fill { animation: grow-y 0.7s var(--ease-out) backwards; }
.ebar__fill--period { background: var(--ph-period); }
.ebar__fill--follicular { background: var(--ph-follicular); }
.ebar__fill--fertile { background: var(--ph-fertile); }
.ebar__fill--luteal { background: var(--ph-luteal); }
.ebar__value { font-weight: 800; font-variant-numeric: tabular-nums; }
.ebar__label { font-size: 12px; color: var(--ink-soft); text-align: center; line-height: 1.25; }

.moodlist { display: flex; flex-direction: column; }
.moodlist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.moodlist li:first-child { border-top: 0; padding-top: 0; }
.moodlist__phase { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.moodlist__mood { font-weight: 750; }

/* Cómo calculamos */
.explain { padding: 0; }
.explain summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 14px 20px;
  list-style: none;
  font-weight: 750;
  cursor: pointer;
}
.explain summary::-webkit-details-marker { display: none; }
.explain summary > span { flex: 1; }
.explain summary > .icon:first-child { color: var(--link); }
.explain__chev { color: var(--ink-faint); transition: transform 0.3s var(--ease-out); }
.explain[open] .explain__chev { transform: rotate(90deg); }
.explain__list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 20px 54px; list-style: disc; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.explain[open] .explain__list { animation: rise 0.35s var(--ease-out) backwards; }

.report-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.report-cta__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); color: var(--ink); }
.report-cta__text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.report-cta__text p { font-size: 13.5px; color: var(--ink-soft); }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .chart-card, .health { grid-column: 1 / -1; }
  .health__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart { height: 240px; }
}

/* ---- Ajustes ---- */
.settings { display: flex; flex-direction: column; gap: 26px; }
.settings__section { display: flex; flex-direction: column; gap: 10px; }
.settings__title { padding: 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); }
[data-theme='manta'] .settings__title { font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-style: italic; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.settings__lead { padding: 0 6px; margin-top: -4px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
@media (min-width: 960px) {
  .page--settings { max-width: 760px; }
}

/* ---- Pasar a otro dispositivo ---- */
.sync { display: flex; flex-direction: column; gap: 16px; }
.method { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.method__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  border: var(--card-border);
  border-radius: var(--r-ctrl);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: box-shadow 0.2s, color 0.2s, transform 0.15s var(--ease-out);
}
.method__btn:active { transform: scale(0.97); }
.method__btn[aria-selected='true'] { color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.method__btn[aria-selected='true'] .icon { color: var(--period); }
.sync__panel { display: flex; flex-direction: column; gap: 16px; }
.sync__panel.is-swapping { animation: rise 0.35s var(--ease-out) backwards; }
.sync__card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; text-align: center; }
.sync__empty { padding: 20px 8px 4px; text-align: center; color: var(--ink-soft); }
.sync__title { font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-weight: var(--head-weight); font-size: 21px; line-height: 1.2; }
.sync__text { max-width: 420px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.sync__hint { display: flex; align-items: flex-start; gap: 10px; padding: 0 6px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.sync__hint .icon { margin-top: 1px; }
.qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  padding: 12px;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px #E7E7E2;
}
.qr-canvas { opacity: 0; transition: opacity 0.3s; image-rendering: pixelated; }
.qr-frame.is-ready .qr-canvas { opacity: 1; }
.qr-frame .spinner { position: absolute; }
.qr-frame.is-ready .spinner { display: none; }
.qr-part { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.qr-explain { display: flex; align-items: flex-start; gap: 8px; max-width: 380px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); text-align: left; }
.qr-explain .icon { margin-top: 2px; color: var(--link); }
.qr-tools { display: flex; justify-content: center; margin-top: -6px; }
.parts { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: 100%; max-width: 380px; }
.parts:empty { display: none; }
.parts__cell { flex: 1 1 8px; max-width: 22px; min-width: 6px; height: 6px; border-radius: 3px; background: var(--track); transition: background-color 0.2s, transform 0.25s var(--ease-spring); }
.parts__cell.is-on { background: var(--accent); }
.page--sync[data-mode] .scan ~ .parts .parts__cell.is-on { transform: scaleY(1.4); }

.scan {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: 22px;
  background: #16191B;
  overflow: hidden;
}
.scan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.scan.is-live .scan__video { opacity: 1; }
.scan__idle { color: #9DA9B2; }
.scan.is-live .scan__idle { display: none; }
.scan__corners {
  position: absolute;
  inset: 16%;
  z-index: 1;
  border-radius: 18px;
  background:
    linear-gradient(#F7F7F4, #F7F7F4) top left / 34px 4px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) top left / 4px 34px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) top right / 34px 4px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) top right / 4px 34px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) bottom left / 34px 4px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) bottom left / 4px 34px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) bottom right / 34px 4px no-repeat,
    linear-gradient(#F7F7F4, #F7F7F4) bottom right / 4px 34px no-repeat;
}
.scan__line {
  position: absolute;
  left: 16%; right: 16%;
  top: 16%;
  z-index: 1;
  height: 2px;
  border-radius: 2px;
  background: #91E0D4;
  box-shadow: 0 0 12px #91E0D4;
  opacity: 0;
}
.scan.is-live .scan__line { opacity: 1; animation: scan 2.2s ease-in-out infinite alternate; }
.scan__status { font-size: 15px; font-weight: 700; text-align: center; min-height: 1.5em; }

/* Transferencia por archivo */
.file-hero { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: var(--period-soft); color: var(--period-strong); }
.file-hero__lock { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: 0 0 0 3px var(--surface); }
.file-ready { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.main:not(.is-refresh) .file-ready { animation: rise 0.4s var(--ease-out) backwards; }
.code {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 6px 6px 18px;
  border-radius: 18px;
  background: var(--bg);
  border: 1.5px dashed var(--line-strong);
}
[data-theme='noche'] .code { background: var(--surface-2); }
.code__value {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(19px, 5.6vw, 26px);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  user-select: all;
  -webkit-user-select: all;
}
.code__hint { max-width: 360px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.file-ready__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; width: 100%; }
.file-ready__actions .btn { flex: 1 1 180px; max-width: 280px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 30px 20px;
  border-radius: 20px;
  border: 2px dashed var(--line-strong);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease-out);
}
[data-theme='noche'] .dropzone { background: var(--surface-2); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--period-soft); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone__icon { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 4px; border-radius: 50%; background: var(--surface); color: var(--period); }
.dropzone__title { font-size: 16px; font-weight: 800; }
.dropzone__hint { font-size: 13px; color: var(--ink-soft); }
.code-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; text-align: left; }
.main:not(.is-refresh) .code-form { animation: rise 0.35s var(--ease-out) backwards; }
.code-form__file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.code-form__actions { display: flex; gap: 10px; justify-content: flex-end; }
.code-form__actions .btn { flex: 1 1 0; }

.success { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 20px; text-align: center; }
.success__check { width: 76px; height: 76px; margin-bottom: 8px; }
.success__check--small { width: 56px; height: 56px; margin-bottom: 2px; }
.success__check circle, .success__check path {
  fill: none;
  stroke: var(--fertile-ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.success__check circle { animation: draw 0.6s var(--ease-out) forwards; }
.success__check path { animation: draw 0.4s 0.5s var(--ease-out) forwards; }
.success__title { font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-weight: var(--head-weight); font-size: 25px; }
.success__text { color: var(--ink-soft); margin-bottom: 8px; }

@media (min-width: 960px) {
  .page--sync { max-width: 760px; }
}

/* ---- Bienvenida ---- */
.ob {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.ob__dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 6px; }
.ob__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--track-strong); transition: width 0.35s var(--ease-out), background-color 0.3s; }
.ob__dot.is-done { background: var(--ink-faint); }
.ob__dot.is-on { width: 26px; background: var(--ink); }
.ob__panel { display: flex; flex-direction: column; flex: 1; gap: 20px; }
.ob__panel--next { animation: slide-from-right 0.42s var(--ease-out) backwards; }
.ob__panel--back { animation: slide-from-left 0.42s var(--ease-out) backwards; }
.main.is-refresh .ob__panel { animation: none; }
.ob__top { display: flex; justify-content: space-between; align-items: center; }
.ob__body { display: flex; flex-direction: column; gap: 18px; flex: 1; padding-top: 12px; }
.ob__body--center { align-items: center; text-align: center; justify-content: center; }
.ob__logo { color: var(--ink); margin-bottom: 4px; }
.ob__logo--done { margin-bottom: 8px; }
.ob__step { font-size: 12.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); }
.ob__title {
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-weight: var(--head-weight);
  font-size: clamp(31px, 8.2vw, 42px);
  line-height: 1.05;
  letter-spacing: var(--head-tracking);
  text-wrap: balance;
}
.ob__lead { font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.ob__hint { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.ob__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 18px; }
.ob__actions--row { flex-direction: row; justify-content: space-between; }
.ob__actions--row .btn--primary { flex: 1; max-width: 260px; margin-left: auto; }
.ob__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.ob__fine { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); text-align: center; max-width: 380px; }

.promises { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.promises li { display: flex; gap: 14px; align-items: flex-start; }
.promises__icon { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 15px; background: var(--surface); color: var(--period); border: var(--card-border); }
[data-theme='manta'] .promises__icon { border-radius: 50%; border: 1.5px dashed var(--line-strong); }
.promises li div { display: flex; flex-direction: column; gap: 2px; }
.promises strong { font-size: 16px; }
.promises span { font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }

.ob-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--shadow);
}
.ob-stepper__label { font-weight: 750; }

.tips { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; margin-top: 8px; }
.tips li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: var(--card-border);
  font-size: 14.5px;
  line-height: 1.45;
}
.tips .icon { color: var(--period); margin-top: 1px; }

@media (min-width: 960px) {
  .ob { padding-top: 6vh; }
}

/* ---- Bloqueo ---- */
.lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 9vh) 24px calc(env(safe-area-inset-bottom) + 6vh);
}
.lock.is-open { animation: lock-open 0.4s var(--ease-out) forwards; }
.lock__top { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lock__logo { color: var(--ink); margin-bottom: 8px; }
.lock__title { font-family: var(--font-head); font-variation-settings: var(--head-fvs); font-weight: var(--head-weight); font-size: 27px; letter-spacing: -0.02em; }
.lock__status { min-height: 1.5em; font-size: 15px; color: var(--ink-soft); }
.lock__dots { display: flex; gap: 14px; margin-top: 18px; min-height: 16px; }
.lock__dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink-soft); transition: background-color 0.15s, transform 0.2s var(--ease-spring), box-shadow 0.15s; }
.lock__dot.is-on { background: var(--ink); box-shadow: none; transform: scale(1.15); }
.keypad { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 14px 24px; }
.key {
  width: clamp(62px, 19vw, 78px);
  height: clamp(62px, 19vw, 78px);
  border: var(--card-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-head);
  font-variation-settings: var(--head-fvs);
  font-size: 30px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, background-color 0.15s;
}
[data-theme='manta'] .key { border: 1.5px dashed var(--line-strong); }
.key:active { transform: scale(0.92); background: var(--surface-2); }
.key--fn { background: transparent; box-shadow: none; border: 0 !important; font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--ink-soft); display: grid; place-items: center; }
.lock.is-busy .keypad { opacity: 0.5; pointer-events: none; }
.lock__ok { min-width: 200px; }
@media (max-height: 640px) {
  .lock { padding-top: calc(env(safe-area-inset-top) + 20px); }
  .key { width: 60px; height: 60px; font-size: 24px; }
  .keypad { gap: 10px 22px; }
}

/* ---- Acerca de ---- */
.about { display: flex; flex-direction: column; gap: 14px; }
.about__hero { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.about__lead { font-size: 15.5px; line-height: 1.55; }
.about__list { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.about__list li { display: flex; gap: 12px; align-items: flex-start; }
.about__list li > .icon { color: var(--ok); margin-top: 2px; }
.about__list div { display: flex; flex-direction: column; gap: 2px; }
.about__list span, .about__text, .about__plain { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.about__plain { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.about .steps { margin: 14px 0; }
.about__text { margin-top: 8px; }
.about__version { font-variant-numeric: tabular-nums; }
@media (min-width: 960px) {
  .page--about { max-width: 760px; }
}

/* ---- Informe ---- */
.report-tools { display: flex; flex-direction: column; gap: 12px; padding: 0 4px; font-size: 14.5px; color: var(--ink-soft); }
.report-tools__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.report { padding: 28px 24px; color: var(--ink); }
[data-theme='manta'] .report.card { outline: 0; }
.report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.report__brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.report__meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; font-size: 13.5px; color: var(--ink-soft); }
.report__meta strong { font-size: 16px; color: var(--ink); }
.report__section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.report__section h2 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.report__kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; }
.report__kv div { display: flex; flex-direction: column; gap: 2px; }
.report__kv dt { font-size: 12.5px; color: var(--ink-soft); }
.report__kv dd { font-weight: 700; }
.report__alerts { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; line-height: 1.45; list-style: disc; padding-left: 30px; }
.report__table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report__table th, .report__table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.report__table th { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.report__foot { margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }
.report__notes { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.report__notes li { overflow-wrap: anywhere; }
.report__disclaimer { padding-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
@media (min-width: 960px) {
  .page--report { max-width: 860px; }
  .report { padding: 40px 44px; }
}

/* 6. ANIMACIONES ---------------------------------------------------------------- */

.main:not(.is-refresh) .stagger > * { animation: rise 0.5s var(--ease-out) backwards; }
.main:not(.is-refresh) .stagger > :nth-child(2) { animation-delay: 0.05s; }
.main:not(.is-refresh) .stagger > :nth-child(3) { animation-delay: 0.1s; }
.main:not(.is-refresh) .stagger > :nth-child(4) { animation-delay: 0.15s; }
.main:not(.is-refresh) .stagger > :nth-child(5) { animation-delay: 0.2s; }
.main:not(.is-refresh) .stagger > :nth-child(6) { animation-delay: 0.24s; }
.main:not(.is-refresh) .stagger > :nth-child(n + 7) { animation-delay: 0.28s; }

@keyframes rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
@keyframes view-in-right { from { opacity: 0; transform: translate3d(16px, 0, 0); } }
@keyframes view-in-left { from { opacity: 0; transform: translate3d(-16px, 0, 0); } }
@keyframes view-in-fade { from { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes pop-soft { 0% { transform: scale(1); } 40% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes halo { 0%, 100% { transform: scale(0.85); opacity: 0.1; } 50% { transform: scale(1.15); opacity: 0.02; } }
@keyframes drop-in { 0% { transform: translateY(-6px) scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes tide { 0%, 100% { transform: translate(1px, 0); } 50% { transform: translate(4.5px, 0.8px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes sheet-in { from { transform: translate3d(0, 100%, 0); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translate3d(0, 100%, 0); } }
@keyframes pop-in { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.97); } }
@keyframes toast-in { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(0, 10px, 0); } }
@keyframes slide-from-right { from { opacity: 0; transform: translate3d(26px, 0, 0); } }
@keyframes slide-from-left { from { opacity: 0; transform: translate3d(-26px, 0, 0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes scan { from { top: 16%; } to { top: 84%; } }
@keyframes highlight { 0% { background-color: transparent; } 25% { background-color: var(--surface-2); } 100% { background-color: transparent; } }
@keyframes lock-open { to { opacity: 0; transform: scale(1.04); } }

/* Cambio de tema: un círculo que se expande (View Transitions, si existe) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ring__arc { stroke-dashoffset: 0; }
}

/* 7. IMPRESIÓN (informe para la consulta) ----------------------------------------- */

@media print {
  @page { margin: 16mm; }
  :root, [data-theme] {
    --bg: #FFFFFF; --surface: #FFFFFF; --ink: #000000; --ink-soft: #444444; --line: #CCCCCC;
    --bg-image: none;
    color-scheme: light;
  }
  html, body { background: #FFFFFF !important; color: #000000 !important; }
  .nav, .skip, .toasts, .no-print, .log__footer { display: none !important; }
  .shell { display: block !important; }
  .main { max-width: none !important; padding: 0 !important; }
  .report { box-shadow: none !important; border: 0 !important; outline: 0 !important; padding: 0 !important; }
  .report__table { page-break-inside: auto; }
  .report__table tr { page-break-inside: avoid; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo-wave { fill: #B23A48; }
}
