:root {
  --rosa: #C2185B;
  --rosa-claro: #FCE4EC;
  --morado: #7B1FA2;
  --morado-claro: #F3E5F5;
  --periodo: #E53935;
  --previsto: #FFCDD2;
  --fertil: #B2DFDB;
  --ovulacion: #00897B;
  --menor: #EDE7F0;
  --fondo: #FFFBFD;
  --texto: #222;
  --gris: #777;
  --card: #fff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding: env(safe-area-inset-top) 0 calc(72px + env(safe-area-inset-bottom));
}
#app { max-width: 560px; margin: 0 auto; padding: 16px; }
.cargando { font-size: 48px; text-align: center; margin-top: 30vh; animation: lat 1.2s infinite; }
@keyframes lat { 50% { transform: scale(1.15); } }
h1 { color: var(--rosa); font-size: 26px; margin: 4px 0 0; }
h2 { font-size: 18px; margin: 0 0 8px; }
.sub { color: var(--gris); font-size: 14px; margin-bottom: 14px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.estado { border-radius: 18px; padding: 20px; margin-bottom: 12px; }
.estado .dia { font-size: 15px; opacity: .9; }
.estado .titulo { font-size: 24px; font-weight: 700; margin: 2px 0; }
.dato { display: flex; gap: 12px; margin: 10px 0; }
.dato .ic { font-size: 22px; }
.dato .lbl { color: var(--gris); font-size: 13px; }
.dato .val { font-weight: 600; font-size: 17px; }
.dato .nota { font-size: 13px; }
.aviso { background: #FFF8E1; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 10px; }
.importante { background: var(--morado-claro); }
.pequeno { font-size: 13px; color: var(--gris); }
button { font: inherit; cursor: pointer; }
.btn { display: block; width: 100%; border: 0; border-radius: 26px; padding: 14px; font-size: 16px; font-weight: 600; background: var(--rosa); color: #fff; margin-bottom: 10px; }
.btn.borde { background: transparent; color: var(--rosa); border: 1.5px solid var(--rosa); }
.btn.suave { background: var(--rosa-claro); color: var(--rosa); }
.btn:disabled { opacity: .5; }
.fila { display: flex; gap: 8px; }
.fila > * { flex: 1; }
.link { background: none; border: 0; color: var(--rosa); padding: 6px 8px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1.5px solid #ddd; border-radius: 12px; background: #fff; margin-bottom: 12px;
}
input:focus, textarea:focus { outline: none; border-color: var(--rosa); }
label.cap { display: block; font-weight: 600; font-size: 15px; margin: 10px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid #ccc; background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 14px; }
.chip.sel { background: var(--rosa-claro); border-color: var(--rosa); color: var(--rosa); font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--rosa); }
/* calendario */
.mes { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mes .nombre { font-size: 20px; font-weight: 700; }
.mes button { background: none; border: 0; font-size: 30px; color: var(--rosa); padding: 0 14px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dsem { text-align: center; color: var(--gris); font-size: 13px; font-weight: 600; padding: 4px 0; }
.celda { aspect-ratio: 1; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; position: relative; font-size: 15px; background: transparent; color: var(--texto); }
.celda.hoy { box-shadow: 0 0 0 2px var(--morado) inset; font-weight: 700; }
.celda .punto { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--morado); }
.t-periodo { background: var(--periodo); color: #fff; }
.t-previsto { background: var(--previsto); }
.t-fertil { background: var(--fertil); }
.t-ovulacion { background: var(--ovulacion); color: #fff; }
.t-menor { background: var(--menor); }
.leyenda div { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 5px 0; }
.leyenda i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
/* historial */
.hist { display: flex; align-items: center; }
.hist > div { flex: 1; }
/* nav */
#nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid #eee; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
#nav button { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: 12px; color: var(--gris); display: flex; flex-direction: column; align-items: center; }
#nav button span { font-size: 22px; filter: grayscale(1); opacity: .6; }
#nav button.activo { color: var(--rosa); font-weight: 600; }
#nav button.activo span { filter: none; opacity: 1; }
/* modal */
#modal { position: fixed; inset: 0; background: var(--fondo); z-index: 10; overflow-y: auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
#modal .contenido { max-width: 560px; margin: 0 auto; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #333; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 20; max-width: 90%; text-align: center; }
.firma { text-align: center; color: var(--gris); font-size: 13px; margin: 18px 0 8px; }
.firma a { color: var(--gris); }
