/* ============================================================
   Zafrán · diseño v18
   Solo estilos (no cambia ninguna función). Se carga DESPUÉS del
   bloque <style> de index.html, así que puede refinarlo.
   Contenido:
     1. Base: tipografía, color-scheme, selección, movimiento
     2. Cabecera y botones de acción
     3. Barra de navegación (móvil) alineada
     4. Tarjetas, listas y estados vacíos con ilustración propia
     5. Tablet y ordenador: barra lateral + rejilla de dos columnas
     6. Accesibilidad: foco, contraste, tamaño táctil, menos movimiento
   Las ilustraciones son SVG propios (sin derechos de terceros).
   ============================================================ */

/* ---------- 1. Base ---------- */
:root {
  color-scheme: light;
  --zf-ease: cubic-bezier(.2, .7, .2, 1);
  --zf-rail: 92px;
  --zf-art-ink: #C98512;
  --zf-art-soft: #F7DDA0;
  --zf-art-leaf: #5E8A25;
}
:root[data-theme="dark"] { color-scheme: dark; --zf-art-ink: #E8A317; --zf-art-soft: #3A2C0B; --zf-art-leaf: #8DBB4A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --zf-art-ink: #E8A317; --zf-art-soft: #3A2C0B; --zf-art-leaf: #8DBB4A; }
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; min-height: 100%; }
/* El degradado de fondo no debe repetirse en franjas cuando la página es más baja que la ventana */
body { min-height: 100vh; min-height: 100dvh; background-repeat: no-repeat; background-attachment: fixed; }
::selection { background: rgba(232, 163, 23, .35); color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p, .hint, .meal-empty { text-wrap: pretty; }
/* Cifras alineadas en columnas (calorías, macros, tiempos) */
.ringtxt b, .hstats b, .mk, .mv, .gh-k b, .stats b, .wbar, time, [class*="kcal"], .entry b { font-variant-numeric: tabular-nums; }

/* Entrada suave al cambiar de pantalla */
@keyframes zfIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app > section:not([hidden]) { animation: zfIn .32s var(--zf-ease) both; }

/* ---------- 2. Cabecera y botones de acción ---------- */
.head { margin: 6px 0 12px; }
.head h1 { font-size: clamp(2.3rem, 9vw, 2.9rem); }
.head-btns { gap: 8px; }
/* Botones circulares (Conectar, Calendario, Compartir...): el círculo es el propio icono; más suave que el borde negro anterior */
.hbtn { min-width: 52px; font-size: .62rem; gap: 4px; }
.hbtn svg {
  width: 42px; height: 42px; padding: 10px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--sh1);
  transition: transform .15s var(--zf-ease), box-shadow .2s, border-color .2s, background .2s;
}
.hbtn:hover svg { border-color: var(--brand); box-shadow: var(--sh2); }
.hbtn:active svg { transform: scale(.94); background: var(--brandSoft); }
.hbtn span { font-weight: 700; color: var(--muted); letter-spacing: .01em; }

/* Botones de la ficha de entreno: botón principal con más presencia */
.bigstart { border-radius: 20px !important; letter-spacing: .005em; }

/* ---------- 3. Barra de navegación ---------- */
/* Etiquetas de todos los botones sobre la misma línea (antes Menú/Social/Consulta/Ajustes quedaban más arriba) */
.nv { justify-content: flex-end; padding: 6px 0 6px; gap: 3px; min-height: 56px; }
.nv span, .fablbl { line-height: 1.1; }
.fabwrap { padding-bottom: 6px; }
.nav { padding-top: 6px; }
/* Indicador de pestaña activa en azafrán */
.nv.is-on { color: var(--ink); }
.nv.is-on svg { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nv.is-on svg { color: var(--brand2); } }
:root[data-theme="dark"] .nv.is-on svg { color: var(--brand2); }

/* ---------- 4. Tarjetas, listas y estados vacíos ---------- */
.panel, .setsec, .wcard, #trainCard > *, #waterCard > *, #healthCard > * { transition: box-shadow .2s var(--zf-ease), transform .2s var(--zf-ease); }
@media (hover: hover) {
  .panel:hover { box-shadow: var(--sh3); }
}
.entry { border-radius: 14px; }
.meal { margin-top: 18px; }
.meal-head h3 { letter-spacing: -.005em; }

/* Estados vacíos: ilustración propia (plato con hoja) en vez de solo texto */
.meal-empty {
  display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; padding: 12px 14px;
  border: 1.5px dashed var(--line); border-radius: 16px; color: var(--muted); font-weight: 600;
}
.meal-empty::before {
  content: ""; flex: none; width: 38px; height: 38px;
  background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'><circle cx='24' cy='26' r='16' fill='%23F7DDA0'/><circle cx='24' cy='26' r='11' fill='%23FFF8E6' stroke='%23C98512' stroke-width='2'/><path d='M33 9c-5 0-9 3-10 8 5 0 9-3 10-8z' fill='%235E8A25'/><path d='M23 17c2-3 5-5 10-8' stroke='%233F6318' stroke-width='1.6' stroke-linecap='round'/></svg>");
}
:root[data-theme="dark"] .meal-empty::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'><circle cx='24' cy='26' r='16' fill='%233A2C0B'/><circle cx='24' cy='26' r='11' fill='%23242922' stroke='%23E8A317' stroke-width='2'/><path d='M33 9c-5 0-9 3-10 8 5 0 9-3 10-8z' fill='%238DBB4A'/><path d='M23 17c2-3 5-5 10-8' stroke='%23B6DC78' stroke-width='1.6' stroke-linecap='round'/></svg>");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .meal-empty::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'><circle cx='24' cy='26' r='16' fill='%233A2C0B'/><circle cx='24' cy='26' r='11' fill='%23242922' stroke='%23E8A317' stroke-width='2'/><path d='M33 9c-5 0-9 3-10 8 5 0 9-3 10-8z' fill='%238DBB4A'/><path d='M23 17c2-3 5-5 10-8' stroke='%23B6DC78' stroke-width='1.6' stroke-linecap='round'/></svg>");
  }
}

/* Botones secundarios largos de Entreno: texto centrado y respirando */
#trainView .btn.ghost, #trainView .wide.ghost { min-height: 52px; }

/* Pie de página discreto */
.foot { opacity: .8; font-size: .8rem; }

/* ---------- 5. Tablet y ordenador ---------- */
@media (min-width: 760px) {
  .app { max-width: 720px; padding-left: 24px; padding-right: 24px; }
  .hero { border-radius: 30px; }
}

@media (min-width: 1024px) {
  /* Barra de navegación -> barra lateral izquierda fija */
  body { padding-left: var(--zf-rail); }
  .nav {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--zf-rail);
    padding: 18px 8px 18px; border-top: 0; border-right: 1px solid var(--line);
    box-shadow: 10px 0 30px -22px rgba(20, 24, 18, .35);
    display: flex; flex-direction: column; justify-content: flex-start;
  }
  .nav-in { display: flex; flex-direction: column; align-items: stretch; gap: 6px; max-width: none; min-height: 0; flex: 1; }
  .nav-in::before {
    content: ""; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 14px; flex: none;
    background: center / cover no-repeat url("icon-192.png"); box-shadow: var(--sh2);
  }
  .nv { flex: none; width: 100%; min-height: 62px; border-radius: 16px; justify-content: center; padding: 8px 0; transition: background .2s, color .2s; }
  .nv:hover { background: var(--chip); }
  .nv.is-on { background: var(--brandSoft); }
  .nv.is-on::before { display: none; }
  .nv span, .fablbl { font-size: .7rem; }
  .fabwrap, .fabmain, .fabsm { margin-top: 0; padding: 6px 0; width: 100%; justify-self: stretch; border-radius: 16px; }
  .fabwrap:hover { background: var(--chip); }
  .fabwrap.is-on { background: var(--brandSoft); }
  .fab, .fabsm .fab, .fabmain .fab { width: 40px; height: 40px; border-width: 0; box-shadow: var(--sh2); }
  .fab svg, .fabsm .fab svg, .fabmain .fab svg { width: 20px; height: 20px; }
  .fabwrap.is-on .fab { box-shadow: 0 0 0 3px var(--brand2), var(--sh2); }
  .fabmain .fablbl { font-size: .7rem; }
  /* Orden en la barra lateral: Inicio, Comida, Entreno, Social, Consulta, Menú, Ajustes */
  .nav-in > * { order: 5; }
  #fabDayWrap { order: 1; }
  #fabWrap, .fabwrap:has(#fab) { order: 2; }
  #fabTrainWrap { order: 3; }
  #nvSoc { order: 4; }
  #navAsk { order: 6; }
  #navMore { order: 7; }
  #navSet { order: 8; margin-top: auto; }
  /* El menú «Más» se abre a la derecha de la barra, no encima */
  .navmenu { left: calc(100% + 8px); bottom: 70px; top: auto; min-width: 240px; }

  /* Contenido más ancho, centrado en el espacio restante */
  .app { max-width: 1120px; padding: 28px 40px 48px; }
  .sheet { max-width: 560px; }
  .overlay { align-items: center; }
  .overlay .sheet { border-radius: 26px; padding-bottom: 24px; }
  .instbar { left: var(--zf-rail); }

  /* La semana no necesita estirarse por toda la pantalla */
  .week { max-width: 620px; }

  /* Inicio: dos columnas (resumen a la izquierda, tarjetas a la derecha) */
  #dayView { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  #dayView > .head, #dayView > .week, #dayView > #monthCard, #dayView > #alertCard, #dayView > #aiOffCard, #dayView > #pendBar, #dayView > #log, #dayView > .foot { grid-column: 1 / -1; }
  /* Sin «sticky»: en algunas tabletas el resumen se quedaba flotando encima de las comidas */
  #dayView > .hero { grid-column: 1; grid-row: span 3; align-self: start; position: relative; z-index: 0; }
  #dayView > #log { position: relative; z-index: 1; }
  #dayView > #trainCard, #dayView > #waterCard, #dayView > #healthCard { grid-column: 2; }
  /* Las comidas en dos columnas */
  #log { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  #log > * { min-width: 0; }
  #log > :not(.meal) { grid-column: 1 / -1; }

  /* Otras pantallas con tarjetas: leen mejor a dos columnas */
  #histView, #goalsView, #bodyView, #sleepView, #supView, #askView, #socView, #trainView { max-width: 860px; margin-left: auto; margin-right: auto; }
  #dayView { max-width: none; }
}

@media (min-width: 1400px) {
  .app { max-width: 1240px; }
}

/* ---------- 6. Accesibilidad ---------- */
:focus-visible { outline: 3px solid var(--brand2); outline-offset: 3px; border-radius: 10px; }
/* Tamaño táctil mínimo de 44 px en botones pequeños */
.pill, .chip, .add-mini, .wk-nav { min-height: 44px; }
.add-mini { min-width: 44px; }
.wk-nav { min-width: 32px; }
/* Texto secundario con contraste suficiente */
.head p, .meal-empty, .hint { color: color-mix(in srgb, var(--muted) 88%, var(--ink)); }
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .35); }
  .hero { border-color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app > section:not([hidden]) { animation: none; }
  * { transition-duration: .01ms !important; }
}
@media print {
  .nav, .fab, .instbar { display: none !important; }
  body { padding: 0; background: #fff; }
}


/* ============================================================
   7. Accesibilidad (Ajustes → Pantalla). Se activan con atributos en <html>:
      data-fz xxl · data-lh l|xl · data-ls w · data-hc y · data-bt y · data-mo y · data-ul y · data-cb y
   ============================================================ */
html[data-fz="xxl"] body { zoom: 1.5; }
/* La barra de navegación no crece del todo con la letra: así caben las 7 etiquetas */
html[data-fz="xl"] .nav { zoom: .85; }
html[data-fz="xxl"] .nav { zoom: .75; }

/* Espacio entre líneas y letras (solo textos de lectura, no títulos ni números grandes) */
html[data-lh="l"] :where(p, li, label, small, .hint, .note, .entry, .tc, .meal-empty, .fz-prev) { line-height: 1.7; }
html[data-lh="xl"] :where(p, li, label, small, .hint, .note, .entry, .tc, .meal-empty, .fz-prev) { line-height: 2; }
html[data-ls="w"] body { letter-spacing: .04em; word-spacing: .12em; }
html[data-ls="w"] .head h1, html[data-ls="w"] .ringtxt b { letter-spacing: 0; }

/* Alto contraste: negro sobre blanco (o blanco sobre negro en modo oscuro), bordes marcados */
html[data-hc="y"] {
  --bg: #fff; --surface: #fff; --ink: #000; --text: #000; --muted: #1f1f1f; --line: #000; --chip: #ececec; --input: #fff;
  --brandSoft: #fff1c9; --brandInk: #000;
}
@media (prefers-color-scheme: dark) {
  html[data-hc="y"]:not([data-theme="light"]) { --bg: #000; --surface: #000; --ink: #fff; --text: #fff; --muted: #e8e8e8; --line: #fff; --chip: #1c1c1c; --input: #000; --brandSoft: #3a2c0b; --brandInk: #ffd978; }
}
html[data-hc="y"][data-theme="dark"] { --bg: #000; --surface: #000; --ink: #fff; --text: #fff; --muted: #e8e8e8; --line: #fff; --chip: #1c1c1c; --input: #000; --brandSoft: #3a2c0b; --brandInk: #ffd978; }
html[data-hc="y"] body { background: var(--bg); }
html[data-hc="y"] .panel, html[data-hc="y"] .setsec, html[data-hc="y"] .btn, html[data-hc="y"] .chip, html[data-hc="y"] .pill, html[data-hc="y"] input,
html[data-hc="y"] select, html[data-hc="y"] textarea, html[data-hc="y"] .entry, html[data-hc="y"] .meal-empty { border: 2px solid var(--ink) !important; box-shadow: none !important; }
html[data-hc="y"] .head p, html[data-hc="y"] .hint, html[data-hc="y"] small, html[data-hc="y"] .meal-empty { color: var(--ink) !important; opacity: 1 !important; }
html[data-hc="y"] :focus-visible { outline: 4px solid #0050d8; outline-offset: 3px; }
html[data-hc="y"] .hero { border: 2px solid #fff; }

/* Botones y zonas táctiles grandes */
html[data-bt="y"] :where(button, .chip, .pill, .nv, .btn, summary, select, input[type=text], input[type=number], input[type=search], input[type=email], input[type=password]) { min-height: 56px; }
html[data-bt="y"] :where(.add-mini, .x, .wk-nav, .close) { min-width: 56px; min-height: 56px; }
html[data-bt="y"] .chips { gap: 10px; }
html[data-bt="y"] .nv span, html[data-bt="y"] .fablbl { font-size: .72rem; }

/* Sin animaciones */
html[data-mo="y"] *, html[data-mo="y"] *::before, html[data-mo="y"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Enlaces siempre subrayados */
html[data-ul="y"] a, html[data-ul="y"] .link, html[data-ul="y"] .inl { text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* Daltonismo: proteína azul, carbohidratos naranja, grasas morado (se distinguen por luminosidad y tono, no solo por rojo/verde) */
html[data-cb="y"] { --prot: #0072B2; --carb: #E69F00; --fat: #6A3D9A; --carbT: #8A5A00; }
@media (prefers-color-scheme: dark) { html[data-cb="y"]:not([data-theme="light"]) { --prot: #56B4E9; --carb: #F0B443; --fat: #CC79A7; --carbT: #F0B443; } }
html[data-cb="y"][data-theme="dark"] { --prot: #56B4E9; --carb: #F0B443; --fat: #CC79A7; --carbT: #F0B443; }

/* Aviso permanente de que se habla con una IA (Reglamento (UE) 2024/1689, art. 50) */
.ai-badge { margin: 8px 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--brandSoft); color: var(--brandInk); font-size: .88rem; line-height: 1.45; border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.ai-badge b { font-weight: 800; }

/* Botón «Escuchar» en las respuestas de la IA */
.askm .speak { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .85rem; cursor: pointer; }
.askm .speak:hover { border-color: var(--brand); }


/* ============================================================
   8. Idiomas: selector, resumen de términos y derecha-izquierda (árabe)
   ============================================================ */
.zi-pick { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.zi-pick select { appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line); background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center; border-radius: 999px; padding: 10px 36px 10px 16px; font: inherit; font-weight: 700; color: var(--ink); min-height: 44px; cursor: pointer; }
.field > .zi-pick { justify-content: flex-start; }
.zi-sum { margin: 10px 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--brandSoft); color: var(--brandInk); font-size: .9rem; line-height: 1.45; border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.zi-sum p { margin: 4px 0; } .zi-sum ul { margin: 6px 0 0; padding-inline-start: 20px; } .zi-sum li { margin: 4px 0; }
html[data-lang="es"] .zi-sum { display: none; }
#onbTc { direction: ltr; text-align: left; }   /* el texto legal vinculante está en español */

/* Tipografías por idioma */
html[lang="ar"] body { font-family: "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif; }
html[lang="zh-CN"] body { font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif; letter-spacing: 0; }
html[lang="zh-CN"] .head h1, html[lang="ar"] .head h1 { font-stretch: 100%; letter-spacing: 0; }

/* Derecha a izquierda (árabe): voltear lo que apunta o se ancla a un lado */
html[dir="rtl"] .wk-nav, html[dir="rtl"] .qres em, html[dir="rtl"] .chev { transform: scaleX(-1); }
html[dir="rtl"] .setlink::after { margin-left: 0; margin-right: auto; transform: rotate(-135deg); }
html[dir="rtl"] .navmenu { left: auto; right: 8px; }
html[dir="rtl"] .nv.is-on::before { margin-left: 0; margin-right: -11px; left: auto; right: 50%; }
html[dir="rtl"] .zi-pick { justify-content: flex-start; }
html[dir="rtl"] .zi-pick select { background-position: left 12px center; padding: 10px 16px 10px 36px; }
html[dir="rtl"] .zi-sum ul { padding-inline-start: 20px; }
@media (min-width: 1024px) {
  html[dir="rtl"] body { padding-left: 0; padding-right: var(--zf-rail); }
  html[dir="rtl"] .nav { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); box-shadow: -10px 0 30px -22px rgba(20, 24, 18, .35); }
  html[dir="rtl"] .navmenu { right: auto; left: auto; right: calc(100% + 8px); }
  html[dir="rtl"] .instbar { left: 0; right: var(--zf-rail); }
}

/* Aviso «La IA está desactivada» en Hoy */
.aioff { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; padding: 12px 14px; border-radius: 18px; background: var(--brandSoft); color: var(--brandInk); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.aioff[hidden] { display: none; }
.aioff-t { flex: 1 1 220px; min-width: 0; } .aioff-t p { margin: 4px 0 0; font-size: .88rem; line-height: 1.4; }
.aioff-b { display: flex; gap: 8px; } .aioff-b .btn { min-height: 44px; padding: 0 16px; font-size: .9rem; }

/* 9. Revisión mensual */
.mrcard { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 14px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #E9A21A 0%, #B87800 55%, #6E4A00 100%); box-shadow: 0 12px 28px -16px rgba(184, 120, 0, .7); }
.mr-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.mr-ico svg { width: 24px; height: 24px; }
.mr-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mr-tx b { font-size: 1.05rem; font-weight: 800; }
.mr-tx span { font-size: .84rem; opacity: .92; line-height: 1.3; }
.mr-badge { flex: none; font-weight: 900; font-size: 1.5rem; line-height: 1; padding: 6px 10px; border-radius: 14px; background: rgba(0, 0, 0, .25); }
.mr-badge small { font-size: .7rem; font-weight: 700; opacity: .8; }
.mrcard .mr-go { flex: none; min-height: 44px; padding: 0 16px; background: #fff; color: #5A3C00; font-weight: 800; border: 0; }
@media (max-width: 400px) { .mrcard { flex-wrap: wrap; } .mrcard .mr-go { flex: 1 1 100%; } }
.mr-head { display: flex; flex-direction: column; margin: 4px 0 10px; } .mr-head b { font-size: 1.3rem; font-weight: 900; display: block; } .mr-head small { color: var(--muted); display: block; margin-top: 2px; }
.mr-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mr-k { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 16px; background: var(--chip); text-align: center; }
.mr-k b { font-size: 1.5rem; font-weight: 900; } .mr-k span { font-size: .8rem; color: var(--muted); font-weight: 700; } .mr-k small { font-size: .75rem; color: var(--muted); }
.mr-sc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mr-s { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 16px; background: var(--chip); border: 2px solid var(--line); }
.mr-s b { font-size: 1.4rem; font-weight: 900; } .mr-s span { font-size: .76rem; color: var(--muted); font-weight: 700; }
.mr-s.hi { border-color: #3F7D1E; } .mr-s.mid { border-color: #E39A0B; } .mr-s.lo { border-color: #D9485F; } .mr-s.na { opacity: .6; }
.mr-sum { margin: 12px 0 0; line-height: 1.5; } .mr-note { margin: 12px 0; padding: 10px 12px; border-radius: 14px; background: var(--brandSoft); color: var(--brandInk); font-size: .88rem; line-height: 1.4; }
.mr-ul { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.45; } .mr-ul li { margin: 4px 0; }
.mr-btns, .mr-new { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; } .mr-btns .btn, .mr-new .btn { flex: 1 1 140px; }
.mr-hist { display: flex; flex-direction: column; gap: 6px; }
.mr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: var(--chip); border: 1px solid transparent; }
.mr-row.on { border-color: var(--primary); }
.mr-open { flex: 1; min-width: 0; text-align: start; background: none; border: 0; padding: 6px; display: flex; flex-direction: column; color: inherit; font: inherit; cursor: pointer; }
.mr-open small { color: var(--muted); } .mr-row .pill { min-height: 40px; padding: 0 14px; }

.svedit { display: flex; gap: 8px; flex-wrap: wrap; } .svedit .btn { flex: 1 1 150px; }


/* Zafrán v56: botones rápidos para importar/exportar junto a Avisos. */
.hbtn.hbtn-data { min-width: 46px; }
.hbtn.hbtn-data span { max-width: 48px; white-space: normal; text-align: center; line-height: 1.02; font-size: .54rem; }
@media (max-width: 520px) {
  #dayView > .head { flex-wrap: wrap; align-items: flex-start; }
  #dayView > .head .head-btns.tools { width: 100%; max-width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  #dayView > .head .head-btns.tools .hbtn { flex: 0 0 46px; }
}
@media (min-width: 521px) {
  #dayView > .head .head-btns.tools { flex-wrap: nowrap; max-width: none; }
}

/* ===== v70 · Ciclo menstrual (cycle.js) ===== */
#cycView .cy-card{margin-bottom:12px}
#cycView .cy-hero{background:var(--hero);color:var(--heroText);border-radius:26px;padding:20px 16px 16px;margin-bottom:12px;text-align:center;background-image:radial-gradient(120% 90% at 50% 0%,rgba(217,67,95,.22),transparent 60%)}
#cycView .cy-ring{position:relative;width:224px;height:224px;margin:0 auto}
#cycView .cy-mid{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
#cycView .cy-big{font-size:2.5rem;font-weight:900;letter-spacing:-.02em;line-height:1}
#cycView .cy-ph{font-weight:800;margin-top:6px;font-size:.98rem}
#cycView .cy-line{margin:14px auto 4px;max-width:30ch;font-weight:700;line-height:1.35}
#cycView .cy-est{margin:0 0 10px;font-size:.78rem;color:var(--heroMuted)}
#cycView .cy-leg{display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;font-size:.78rem;color:var(--heroMuted)}
#cycView .cy-leg i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:5px;vertical-align:-1px}
#cycView .cy-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
#cycView .cy-dl{font-size:1.02rem;text-align:center;flex:1}
#cycView .cy-lbl{font-weight:800;font-size:.85rem;color:var(--muted);margin:14px 0 6px;text-transform:uppercase;letter-spacing:.04em}
#cycView .cy-period{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:54px;border-radius:18px;border:2px solid #D9435F;background:transparent;color:#D9435F;font-weight:900;font-size:1rem;padding:10px 14px}
#cycView .cy-period.is-on{background:#D9435F;color:#fff}
#cycView .cy-priv{margin:12px 0 8px}
#cycView .cy-cal{margin:2px 0 8px}
#cycView .cy-wd,#cycView .cy-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
#cycView .cy-wd i{font-style:normal;text-align:center;font-size:.74rem;font-weight:800;color:var(--muted);padding:4px 0}
#cycView .cy-d{position:relative;aspect-ratio:1;border-radius:50%;border:2px solid transparent;background:transparent;color:var(--text);font-weight:700;font-size:.95rem;min-height:40px;padding:0}
#cycView .cy-d:disabled{opacity:.35}
#cycView .cy-d.p{background:#D9435F;color:#fff}
#cycView .cy-d.pr{border:2px dashed #D9435F;color:#D9435F}
#cycView .cy-d.fe{background:rgba(60,141,147,.22)}
#cycView .cy-d.lg::after{content:"";position:absolute;bottom:4px;left:50%;width:5px;height:5px;margin-left:-2.5px;border-radius:50%;background:var(--ink);opacity:.55}
#cycView .cy-d.p.lg::after{background:#fff}
#cycView .cy-d.t{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ink)}
#cycView .cy-d.s{outline:3px solid #E8A317;outline-offset:1px}
#cycView .cy-key{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.78rem;color:var(--muted)}
#cycView .cy-key i{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px;vertical-align:-1px}
#cycView .k-p{background:#D9435F}#cycView .k-pr{border:2px dashed #D9435F}#cycView .k-fe{background:rgba(60,141,147,.5)}#cycView .k-lg{background:var(--ink);opacity:.55;width:7px!important;height:7px!important}
#cycView .cy-h{margin:0 0 10px;font-size:1.1rem;font-weight:900}
#cycView .cy-tiles{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
#cycView .cy-tiles div{background:var(--input);border-radius:16px;padding:12px}
#cycView .cy-tiles b{display:block;font-size:1.6rem;font-weight:900;line-height:1.05}
#cycView .cy-tiles span{font-size:.78rem;color:var(--muted);font-weight:700}
#cycView .cy-bars{display:flex;align-items:flex-end;gap:8px;height:96px;margin:6px 0 8px}
#cycView .cy-bars div{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px}
#cycView .cy-bars b{display:block;width:100%;max-width:34px;background:linear-gradient(180deg,#D9435F,#8A5BD1);border-radius:8px 8px 4px 4px}
#cycView .cy-bars span{font-size:.72rem;font-weight:800;color:var(--muted)}
#cycView .cy-warn{background:rgba(232,163,23,.16);border-radius:14px;padding:10px 12px;font-size:.88rem;margin:8px 0 0}
#cycView .cy-tip{background:var(--input);border-radius:16px;padding:10px 12px;margin:8px 0}
#cycView .cy-tip p{margin:4px 0 0;font-size:.93rem;line-height:1.45}
#cycView .cy-pat{margin:0;padding-left:18px;font-size:.93rem;line-height:1.5}
#cycView .cy-step{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--input);border-radius:16px;padding:6px 8px;margin:4px 0 8px}
#cycView .cy-step b{font-size:1.05rem}#cycView .cy-step small{font-weight:600;color:var(--muted)}
#cycView .cy-fert{background:var(--input);border-radius:16px;padding:12px;margin-top:14px}
#cycView .cy-fert small{color:var(--muted)}
#cycView .cy-danger{display:grid;gap:8px;margin-top:14px}
#cycView .cy-arm{outline:3px solid #D9435F}
#cycView .cy-legal{padding:4px 6px 18px;font-size:.84rem;color:var(--muted);line-height:1.5}
#cycView .cy-legal a{color:inherit;text-decoration:underline}
#cycView .cy-intro{text-align:left}
#cycView .cy-intro h2{margin:8px 0;font-size:1.4rem}
#cycView .cy-intro ul{padding-left:18px;margin:10px 0;line-height:1.5;font-size:.95rem}
#cycView .cy-bigdrop{width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(217,67,95,.14);color:#D9435F}
#cycView .cy-msg{margin:0 0 10px;font-weight:700}

/* v70 · consejos de foto */
.ptips{margin:10px 0 4px;background:var(--input);border-radius:16px;padding:4px 14px}
.ptips summary{min-height:44px;display:flex;align-items:center;font-weight:800;cursor:pointer}
.ptips ul{margin:0 0 10px;padding-left:18px;font-size:.92rem;line-height:1.5}
.ptips li{margin:5px 0}
