:root {
  --bg: #0e1024;
  --bg-2: #161936;
  --card: rgba(255, 255, 255, .055);
  --card-line: rgba(255, 255, 255, .09);
  --ink: #f2f0ff;
  --muted: #a9a6c9;
  --fis: #ff5d73;
  --emo: #3dd6c4;
  --int: #ffc94a;
  --pink: #ff7ab6;
  --violet: #8b7bff;
  --radius: 22px;
  --sans: 'Outfit', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; }
h2 { font-size: 24px; }
h3 { font-size: 18px; margin-bottom: 6px; }
h4 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; font-weight: 600; color: var(--pink); margin-bottom: 6px; }

/* Cielo */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 123, 255, .28), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, rgba(255, 93, 115, .16), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(61, 214, 196, .14), transparent 60%),
    var(--bg); }
.sky::after { content: ''; position: absolute; inset: 0; opacity: .55;
  background-image: radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 30%, #fff, transparent), radial-gradient(1px 1px at 75% 60%, #fff, transparent), radial-gradient(1px 1px at 90% 15%, #fff, transparent), radial-gradient(1.5px 1.5px at 20% 90%, #fff, transparent), radial-gradient(1px 1px at 65% 85%, #fff, transparent);
  animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: .25; } }

/* Cabecera */
.top { max-width: 980px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 20px 8px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 30px; letter-spacing: .01em; margin-right: auto; }
.brand svg { width: 38px; }
.help-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--card-line); background: var(--card); font-weight: 600; }
.help-btn:hover { border-color: var(--violet); }
.install { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 16px; background: linear-gradient(120deg, var(--pink), var(--violet)); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px -10px var(--violet); }
.install svg { width: 18px; }

/* Pestañas */
.tabs { position: sticky; top: 0; z-index: 20; max-width: 980px; margin: 0 auto; padding: 8px 20px 0; display: flex; gap: 6px; background: linear-gradient(var(--bg) 70%, transparent); }
.tab { border: 0; background: none; padding: 12px 14px 14px; font-weight: 500; color: var(--muted); transition: color .2s; }
.tab.on { color: var(--ink); }
.tab-ink { position: absolute; bottom: 4px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--fis), var(--emo), var(--int)); transition: left .3s cubic-bezier(.2, .8, .2, 1), width .3s; }

main { max-width: 980px; margin: 0 auto; padding: 12px 20px 60px; }
.panel { display: flex; flex-direction: column; gap: 16px; animation: rise .45s ease both; }
.panel[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(10px); }

/* Formularios */
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { background: rgba(0, 0, 0, .25); border: 1px solid var(--card-line); border-radius: 14px; padding: 12px 14px; font-size: 16px; color: var(--ink); min-width: 0; }
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 123, 255, .25); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .7; cursor: pointer; }

.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty[hidden] { display: none; }
.empty p { color: var(--muted); max-width: 30em; }
.empty-waves { width: 160px; height: 70px; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 70'%3E%3Cpath d='M0 35c20-30 40-30 60 0s40 30 60 0 30-20 40-10' fill='none' stroke='%23ff5d73' stroke-width='3'/%3E%3Cpath d='M0 35c25-24 50-24 75 0s50 24 85 0' fill='none' stroke='%233dd6c4' stroke-width='3'/%3E%3Cpath d='M0 35c30-18 60-18 90 0s50 18 70 4' fill='none' stroke='%23ffc94a' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Barra de fecha */
.datebar { display: flex; align-items: center; gap: 12px; }
.date-mid { flex: 1; text-align: center; }
.date-mid h2 { font-family: var(--serif); font-size: 34px; font-weight: 400; }
.nav-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--card-line); background: var(--card); font-size: 24px; line-height: 1; flex: none; }
.nav-btn:hover { border-color: var(--violet); }
.date-actions { display: flex; justify-content: center; gap: 8px; margin-top: -4px; }
.chip { border: 1px solid var(--card-line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 14px; position: relative; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* Anillos */
.ring { display: block; width: 100%; height: auto; overflow: visible; }
.ring-arc { animation: draw 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes draw { from { stroke-dashoffset: var(--c); } }
.ring-num { fill: var(--ink); font: 600 34px var(--sans); }
.ring-num.sm { font-size: 19px; }
.ring-num.lg { font-size: 40px; }
.ring-sub { fill: var(--muted); font: 12px var(--sans); }

.energy { display: flex; align-items: center; gap: 22px; }
.energy-ring { width: 132px; flex: none; }
.energy-text h3 { font-family: var(--serif); font-size: 32px; font-weight: 400; }

.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gauge { border-top: 3px solid var(--c); display: flex; flex-direction: column; gap: 12px; }
.gauge-top { display: flex; align-items: center; gap: 14px; }
.gauge-top .ring { width: 96px; flex: none; }
.trend { font-size: 13px; font-weight: 600; margin: 2px 0; }
.trend.up { color: #7ee2a8; }
.trend.down { color: #ff9d9d; }
.badge { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255, 201, 74, .15); color: var(--int); }
.reading { font-size: 14.5px; line-height: 1.45; }

/* Gráficas */
.chart-card { padding-bottom: 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i, .tooltip i, .list i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.chart { position: relative; }
.chart-svg { width: 100%; height: 230px; display: block; touch-action: pan-y; cursor: crosshair; }
.chart-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
.g-zero { stroke: rgba(255, 255, 255, .25); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.g-week { stroke: rgba(255, 255, 255, .05); vector-effect: non-scaling-stroke; }
.g-today { fill: rgba(255, 255, 255, .22); }
.g-hover { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wave { vector-effect: non-scaling-stroke; stroke-dasharray: 2000; animation: wave 1.2s ease-out both; }
.wave-dash { stroke-dasharray: 7 6; animation: fade .8s ease-out both; }
@keyframes fade { from { opacity: 0; } }
@keyframes wave { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
.tooltip { position: absolute; z-index: 50; pointer-events: none; background: rgba(20, 22, 50, .95); border: 1px solid var(--card-line); border-radius: 12px; padding: 8px 12px; font-size: 13px; opacity: 0; transition: opacity .15s; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.tooltip.show { opacity: 1; }
.tooltip b:first-child { display: block; margin-bottom: 2px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.list li span { color: var(--muted); min-width: 92px; }
.list li em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 13px; }
.best { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.best-date { width: 64px; height: 70px; flex: none; border-radius: 16px; background: linear-gradient(160deg, var(--pink), var(--violet)); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.best-date span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.best-date b { font-size: 28px; margin-top: 4px; }
.mini-bars { display: flex; gap: 6px; margin: 8px 0; }
.mini-bars span { width: 54px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); position: relative; overflow: hidden; }
.mini-bars span::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: var(--c); border-radius: 4px; }

/* Compatibilidad */
.couple { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.person { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 600; align-self: center; }
.avatar.a { background: linear-gradient(140deg, var(--fis), var(--pink)); }
.avatar.b { background: linear-gradient(140deg, var(--emo), var(--violet)); }
.heart svg { width: 40px; fill: var(--pink); filter: drop-shadow(0 0 12px rgba(255, 122, 182, .7)); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } 60% { transform: scale(1); } }

.score { display: flex; align-items: center; gap: 26px; background: linear-gradient(135deg, rgba(255, 122, 182, .12), rgba(139, 123, 255, .12)); }
.score-ring { width: 160px; flex: none; }
.score h2 { font-family: var(--serif); font-size: 40px; font-weight: 400; margin-bottom: 6px; }
.score .chip { margin-top: 14px; }

.forever { margin-top: 10px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }

.today-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.today-num { font-size: 34px; font-weight: 600; background: linear-gradient(90deg, var(--emo), var(--int)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar-track.big { height: 12px; }
.today-sync .bar-track span { background: linear-gradient(90deg, var(--emo), var(--int)); }

.math summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.math summary::-webkit-details-marker { display: none; }
.math summary::after { content: '＋'; color: var(--muted); transition: transform .2s; }
.math[open] summary::after { transform: rotate(45deg); }
.math ol { margin: 14px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.math ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.math ul li { border-left: 3px solid var(--c); padding-left: 10px; }
.math code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 6px; font-size: 13px; white-space: normal; word-break: break-word; }

.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; }
.bar-head b { font-size: 24px; color: var(--c); }
.bar-track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .08); margin: 12px 0; overflow: hidden; }
.bar-track span { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 5px; animation: grow 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { width: 0; } }

.seg { display: flex; gap: 4px; background: rgba(0, 0, 0, .25); padding: 4px; border-radius: 999px; }
.seg-btn { border: 0; background: none; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.seg-btn.on { background: var(--c); color: #12142c; font-weight: 600; }
.sw-solid, .sw-dash { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--ink); vertical-align: middle; }
.sw-solid { border-color: var(--pink); }
.sw-dash { border-top-style: dashed; }

.best-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.bd { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .2); animation: rise .5s calc(var(--d) * .1s) both; }

/* Info */
.prose { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.prose h2 { font-family: var(--serif); font-size: 36px; font-weight: 400; }
.prose h3 { margin-top: 10px; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose code { background: rgba(0, 0, 0, .3); padding: 2px 6px; border-radius: 6px; }
.cycles-info { list-style: none; padding: 0 !important; }
.cycles-info li { border-left: 3px solid var(--c); padding: 4px 0 4px 12px; display: flex; flex-direction: column; }
.cycles-info span { color: var(--muted); }
.install-chip { align-self: flex-start; background: linear-gradient(120deg, var(--pink), var(--violet)); border: 0; font-weight: 600; }
.installed-note { color: #7ee2a8; font-weight: 500; }
.note { background: rgba(255, 201, 74, .1); border: 1px solid rgba(255, 201, 74, .25); border-radius: 14px; padding: 12px 14px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, calc(100% + 80px)); visibility: hidden; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 80; transition: transform .35s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* Introducción */
.intro { position: fixed; inset: 0; z-index: 100; background: radial-gradient(800px 500px at 50% 0%, #2a2264, var(--bg) 70%); display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.intro-open .intro { opacity: 1; visibility: visible; }
.intro-open { overflow: hidden; }
.intro-track { flex: 1; display: flex; transition: transform .55s cubic-bezier(.2, .8, .2, 1); min-height: 0; }
.slide { flex: 0 0 100%; overflow-y: auto; padding: calc(40px + env(safe-area-inset-top)) max(24px, calc(50% - 300px)) 24px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.slide > * { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.slide.on > * { opacity: 1; transform: none; }
.slide.on > :nth-child(2) { transition-delay: .08s; }
.slide.on > :nth-child(3) { transition-delay: .16s; }
.slide.on > :nth-child(4) { transition-delay: .24s; }
.slide.on > :nth-child(5) { transition-delay: .32s; }
.slide h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 60px); line-height: 1.02; }
.slide h1 em { background: linear-gradient(90deg, var(--fis), var(--emo), var(--int)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slide p { font-size: 17px; line-height: 1.55; }
.slide-art svg { width: 100%; max-width: 360px; }
.waves-art path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 600; animation: wave 2.4s ease-out both, drift 6s ease-in-out 2.4s infinite alternate; }
.waves-art .w1 { stroke: var(--fis); }
.waves-art .w2 { stroke: var(--emo); animation-delay: .2s, 2.6s; }
.waves-art .w3 { stroke: var(--int); animation-delay: .4s, 2.8s; }
@keyframes drift { to { transform: translateX(-8px); } }
.intro-cycles { display: flex; flex-direction: column; gap: 10px; }
.intro-cycles div { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); border-left: 4px solid var(--c); }
.intro-cycles span { grid-row: span 2; font-size: 28px; text-align: center; }
.intro-cycles b { color: var(--c); }
.intro-cycles p { font-size: 15px; color: var(--muted); }
.uses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.uses li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); }
.uses li > span { font-size: 26px; line-height: 1; }
.uses p { font-size: 15px; color: var(--muted); }
.orb { width: 110px; height: 110px; border-radius: 50%; background: conic-gradient(from 0deg, var(--fis), var(--emo), var(--int), var(--fis)); filter: blur(2px); box-shadow: 0 0 60px rgba(139, 123, 255, .6); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-start { align-self: flex-start; border: 0; border-radius: 999px; padding: 16px 28px; font-size: 17px; font-weight: 600; background: linear-gradient(120deg, var(--pink), var(--violet)); box-shadow: 0 12px 30px -10px var(--violet); margin-top: 8px; }
.btn-start:hover { filter: brightness(1.1); }
.start-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.start-btns .btn-start { margin-top: 0; }
.btn-start.alt { background: transparent; border: 1.5px solid var(--pink); box-shadow: none; }

/* Acceso destacado a compatibilidad */
.couple-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1px solid rgba(255, 122, 182, .35); border-radius: var(--radius); padding: 16px 18px; background: linear-gradient(120deg, rgba(255, 122, 182, .18), rgba(139, 123, 255, .18)); transition: transform .2s, border-color .2s; }
.couple-cta:hover { transform: translateY(-2px); border-color: var(--pink); }
.couple-cta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.couple-cta small { color: var(--muted); font-size: 13.5px; }
.cta-hearts { font-size: 30px; animation: beat 1.4s ease-in-out infinite; }
.cta-arrow { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #1a1030; font-weight: 700; flex: none; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px calc(20px + env(safe-area-inset-bottom)); max-width: 700px; width: 100%; margin: 0 auto; }
.intro-skip { border: 0; background: none; color: var(--muted); padding: 10px; }
.intro-next { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-size: 22px; }
.dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: rgba(255, 255, 255, .25); transition: width .3s, background .3s; }
.dot.on { width: 26px; background: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .slide > * { opacity: 1; transform: none; }
}

/* Móvil */
@media (max-width: 760px) {
  .top, .tabs, main { padding-left: 16px; padding-right: 16px; }
  .gauges, .bars, .split, .best-days { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; }
  .couple { grid-template-columns: 1fr; }
  .heart { justify-self: center; margin: -6px 0; }
  .score, .energy { flex-direction: column; text-align: center; }
  .score .chip { align-self: center; }
  .date-mid h2 { font-size: 26px; }
  .chart-svg { height: 190px; }
  .tab { padding: 12px 10px 14px; font-size: 15px; }
  .install span, .brand span { font-size: 26px; }
  .slide { justify-content: flex-start; }
}
@media (max-width: 380px) {
  .install { padding: 9px 12px; font-size: 0; gap: 0; }
  .install svg { width: 20px; }
}
