/* LegionellaTracker — Liquid Wave, versión clínica */
:root {
  --bg: #f2f8f8;
  --bg-soft: #e6f2f2;
  --surface: #ffffff;
  --deep: #04343a;
  --deep-2: #06464d;
  --ink: #0b2227;
  --muted: #4b666b;
  --on-deep: #e8f6f5;
  --on-deep-muted: #a9cdcb;
  --accent: #00a99d;
  --accent-ink: #007f76;
  --accent-soft: #c9eeea;
  --amber: #f4a83a;
  --hot: #e2553b;
  --cold: #3f8fd2;
  --line: rgba(11, 34, 39, 0.12);
  --line-deep: rgba(232, 246, 245, 0.16);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(4, 52, 58, .06), 0 12px 32px -12px rgba(4, 52, 58, .18);
  --shadow-lg: 0 30px 80px -30px rgba(4, 52, 58, .45);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-wave: cubic-bezier(.45, .05, .55, .95);
  --f-display: "Manrope", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-accent: "Fraunces", Georgia, serif;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 em, h1 em { font-family: var(--f-accent); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
abbr { text-decoration: underline dotted; cursor: help; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.1em; height: 1.1em; flex: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.container-narrow { width: min(820px, 100% - 32px); }

/* ---------- Splash (doble red de seguridad) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--deep);
  transition: opacity .6s var(--ease-out), visibility .6s;
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes splashSafety { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.splash-drop {
  width: 56px; height: 56px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, var(--accent), #5fe0d4);
  position: relative; overflow: hidden;
  animation: dropPulse 1.4s var(--ease-wave) infinite;
}
.splash-drop span {
  position: absolute; inset: 60% -40% -40% -40%;
  background: rgba(255,255,255,.35);
  border-radius: 40%;
  animation: spin 2.4s linear infinite;
}
@keyframes dropPulse { 50% { transform: rotate(-45deg) scale(.88); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Botones ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 0 1.5em;
  border: 0; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  font: 600 16px/1 var(--f-body);
  text-decoration: none; cursor: pointer;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ico { transition: transform .35s var(--ease-out); }
.btn:hover .ico { transform: translateX(4px); }
.btn-primary { --b-bg: var(--accent); --b-fg: #fff; box-shadow: 0 10px 30px -10px rgba(0,169,157,.7); }
.btn-primary:hover { --b-bg: #00b8ab; box-shadow: 0 16px 40px -12px rgba(0,169,157,.85); }
.btn-ghost { --b-bg: transparent; --b-fg: var(--on-deep); box-shadow: inset 0 0 0 1.5px var(--line-deep); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--on-deep); }
.btn-ghost-dark { --b-bg: transparent; --b-fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-small { white-space: nowrap; min-height: 42px; padding: 0 1.2em; font-size: 15px; --b-bg: var(--accent); --b-fg: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--ink); cursor: pointer;
  transition: background .2s, transform .3s var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--accent-soft); transform: rotate(90deg); }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 max(16px, calc((100% - 1200px) / 2));
  color: var(--on-deep);
  transition: background .4s, color .4s, box-shadow .4s, transform .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(242, 248, 248, .92);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
@supports (backdrop-filter: blur(12px)) {
  .nav.is-scrolled { background: rgba(242, 248, 248, .72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
}
.nav.is-hidden { transform: translateY(-100%); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #57d9cd);
  color: #fff;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font: 600 18px/1 var(--f-display); letter-spacing: -0.01em; }
.brand-name b { font-weight: 800; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; opacity: .85; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 160px;
  background:
    radial-gradient(80% 60% at 85% 10%, rgba(0,169,157,.35), transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgba(63,143,210,.25), transparent 60%),
    linear-gradient(180deg, #03282d 0%, var(--deep) 55%, var(--deep-2) 100%);
  color: var(--on-deep);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.blob {
  position: absolute; border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  filter: blur(2px);
  animation: morph 16s var(--ease-wave) infinite alternate;
}
.blob-a {
  width: min(46vw, 620px); aspect-ratio: 1; right: -6vw; top: 14%;
  background: radial-gradient(circle at 30% 30%, rgba(95,224,212,.55), rgba(0,169,157,.12) 60%, transparent 72%);
}
.blob-b {
  width: min(30vw, 380px); aspect-ratio: 1; left: -8vw; bottom: 8%;
  background: radial-gradient(circle at 60% 40%, rgba(63,143,210,.45), transparent 70%);
  animation-duration: 22s;
}
@keyframes morph {
  0%   { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; transform: translate(0,0) rotate(0deg); }
  50%  { border-radius: 62% 38% 46% 54% / 55% 61% 39% 45%; transform: translate(-2vw, 2vh) rotate(18deg); }
  100% { border-radius: 45% 55% 38% 62% / 38% 52% 48% 62%; transform: translate(1vw, -2vh) rotate(-10deg); }
}
.bubbles i {
  position: absolute; bottom: -40px;
  width: var(--s, 10px); height: var(--s, 10px); border-radius: 50%;
  border: 1px solid rgba(232,246,245,.35);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 60%);
  animation: rise var(--d, 14s) linear var(--delay, 0s) infinite;
}
.bubbles i:nth-child(1)  { left: 8%;  --s: 8px;  --d: 13s; }
.bubbles i:nth-child(2)  { left: 18%; --s: 14px; --d: 17s; --delay: -4s; }
.bubbles i:nth-child(3)  { left: 31%; --s: 6px;  --d: 11s; --delay: -8s; }
.bubbles i:nth-child(4)  { left: 44%; --s: 18px; --d: 20s; --delay: -2s; }
.bubbles i:nth-child(5)  { left: 57%; --s: 9px;  --d: 15s; --delay: -11s; }
.bubbles i:nth-child(6)  { left: 66%; --s: 12px; --d: 18s; --delay: -6s; }
.bubbles i:nth-child(7)  { left: 74%; --s: 7px;  --d: 12s; --delay: -1s; }
.bubbles i:nth-child(8)  { left: 83%; --s: 16px; --d: 19s; --delay: -9s; }
.bubbles i:nth-child(9)  { left: 91%; --s: 10px; --d: 14s; --delay: -13s; }
.bubbles i:nth-child(10) { left: 50%; --s: 5px;  --d: 10s; --delay: -5s; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(18px, -50vh); }
  100% { transform: translate(-10px, -105vh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bubbles { display: none; } }

.hero-inner { width: min(1200px, 100% - 32px); margin-inline: auto; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-deep-muted);
}
.kicker::before { content: ""; width: 28px; height: 1.5px; background: var(--accent); }
.hero-title {
  margin-top: 24px;
  font-size: clamp(2.8rem, 8.4vw, 7.2rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -0.045em;
  text-wrap: balance;
  max-width: 14ch;
}
.hero-title em {
  color: #7fe6db;
  background: linear-gradient(90deg, #7fe6db, #bff3ee 40%, #7fe6db 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sheen 6s linear infinite;
  padding-right: .06em;
}
@keyframes sheen { to { background-position: -200% 0; } }
.hero-lead { margin-top: 28px; max-width: 56ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--on-deep-muted); }
.hero-lead i { color: var(--on-deep); }
.hero-ctas { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats {
  margin: 64px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  max-width: 820px; padding-top: 28px; border-top: 1px solid var(--line-deep);
}
.hero-stats dt { font: 800 clamp(1.5rem, 3vw, 2.2rem)/1 var(--f-display); letter-spacing: -0.03em; }
.hero-stats dd { margin: 8px 0 0; font-size: 14px; color: var(--on-deep-muted); max-width: 22ch; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Olas ---------- */
.wave { width: 100%; pointer-events: none; }
.wave-hero { position: absolute; left: 0; bottom: -1px; height: 120px; width: 200%; }
.wave-hero .w1 { fill: rgba(242,248,248,.35); animation: drift 14s linear infinite; }
.wave-hero .w2 { fill: var(--bg); animation: drift 9s linear infinite reverse; }
@keyframes drift { to { transform: translateX(-50%); } }
.wave-divider { height: 70px; margin-top: -1px; fill: var(--deep); background: var(--bg); }
.wave-divider.wave-flip { transform: scaleY(-1); background: var(--bg); }
.wave-foot { height: 70px; fill: var(--deep); background: var(--bg-soft); }

/* ---------- Secciones ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section-deep { background: var(--deep); color: var(--on-deep); }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.section-deep .eyebrow { color: #7fe6db; }
.section-head h2 { margin-top: 14px; font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; text-wrap: balance; }
.section-head h2 em { color: var(--accent-ink); }
.section-deep .section-head h2 em { color: #7fe6db; }
.section-lead { margin-top: 20px; font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.section-deep .section-lead { color: var(--on-deep-muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--rd, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Tarjetas */
.cards-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .cards-4 { grid-template-columns: 1fr; } }
.card {
  position: relative;
  padding: 28px 26px 30px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-ico {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  background: var(--accent-soft); color: var(--accent-ink);
  transition: border-radius .8s var(--ease-out);
}
.card:hover .card-ico { border-radius: 62% 38% 46% 54% / 55% 61% 39% 45%; }
.card-ico svg { width: 26px; height: 26px; }
.card h3 { margin-top: 22px; font-size: 1.25rem; font-weight: 700; }
.card p { margin-top: 10px; color: var(--muted); font-size: .97rem; }

/* Termómetro */
.thermo {
  margin-top: 56px; padding: clamp(24px, 4vw, 44px);
  background: var(--surface); border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow);
}
.thermo-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; }
@media (max-width: 760px) { .thermo-head { grid-template-columns: 1fr; } }
.thermo-readout { margin-top: 8px; font: 700 clamp(1.4rem, 3vw, 2rem)/1.2 var(--f-display); letter-spacing: -0.02em; }
.thermo-readout strong { color: var(--zone-color, var(--hot)); transition: color .3s; }
.thermo-msg { color: var(--muted); }
.thermo-track {
  position: relative; height: 64px; margin-top: 36px; border-radius: 16px; overflow: visible;
  display: flex;
}
.thermo-zone {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--from) / 70 * 100%); width: calc((var(--to) - var(--from)) / 70 * 100%);
  display: flex; align-items: center; padding-left: 12px;
  font-size: 13px; font-weight: 600; color: #fff;
}
.thermo-zone span { white-space: nowrap; overflow: hidden; }
.z-cold { background: linear-gradient(90deg, #2f6fb0, var(--cold)); border-radius: 16px 0 0 16px; }
.z-grow { background: linear-gradient(90deg, #e9b14c, var(--amber) 40%, var(--hot) 55%, var(--amber) 75%, #e9b14c); }
.z-hot  { background: linear-gradient(90deg, #1b8f86, var(--accent)); border-radius: 0 16px 16px 0; }
.thermo-mark {
  position: absolute; top: -10px; bottom: -10px;
  left: calc(var(--at) / 70 * 100%); width: calc(var(--w) / 70 * 100%);
  border: 2px dashed var(--ink); border-radius: 8px;
}
.thermo-mark b { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 12px; white-space: nowrap; }
.thermo-tick { position: absolute; top: calc(100% + 8px); left: calc(var(--at) / 70 * 100%); transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.thermo-range { width: 100%; margin-top: 34px; accent-color: var(--accent); height: 28px; cursor: pointer; }
.thermo-legend { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; font-size: 14px; color: var(--muted); }
.thermo-legend b { display: block; color: var(--ink); font-family: var(--f-display); font-size: 1.05rem; }
@media (max-width: 760px) {
  .thermo-legend { grid-template-columns: 1fr 1fr; }
  .thermo-zone span { font-size: 11px; }
  .thermo-mark b { font-size: 11px; }
}

/* Cadena */
.chain { margin-top: 72px; }
.chain-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; counter-reset: c; }
.chain-steps li { position: relative; padding: 24px 22px; border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--bg-soft)); border: 1px solid var(--line); }
.chain-steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 44px; right: -14px; width: 10px; height: 10px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg);
}
.chain-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--deep); color: #7fe6db; font: 800 16px/1 var(--f-display); }
.chain-steps h4 { margin-top: 16px; font-size: 1.1rem; }
.chain-steps p { margin-top: 6px; font-size: .95rem; color: var(--muted); }
@media (max-width: 900px) {
  .chain-steps { grid-template-columns: 1fr 1fr; }
  .chain-steps li::after { display: none; }
}
@media (max-width: 520px) { .chain-steps { grid-template-columns: 1fr; } }

/* Normativa */
.law-grid { display: grid; grid-template-columns: 340px 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 960px) { .law-grid { grid-template-columns: 1fr; } }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), rgba(0,169,157,.1)); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--deep); border: 2px solid var(--accent); }
.tl-item.is-key::before { background: var(--accent); box-shadow: 0 0 0 6px rgba(0,169,157,.2); }
.tl-date { font: 700 15px/1.2 var(--f-display); color: #7fe6db; }
.tl-item p { margin-top: 4px; color: var(--on-deep-muted); font-size: .95rem; }
.duties { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
@media (max-width: 620px) { .duties { grid-template-columns: 1fr; } }
.duty {
  padding: 24px; border-radius: var(--radius);
  background: rgba(232,246,245,.05); border: 1px solid var(--line-deep);
  transition: background .4s, border-color .4s, transform .5s var(--ease-out);
}
.duty:hover { background: rgba(232,246,245,.09); border-color: rgba(127,230,219,.45); transform: translateY(-4px); }
.duty-art { display: inline-block; padding: 4px 10px; border-radius: 99px; background: rgba(0,169,157,.2); color: #7fe6db; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.duty h4 { margin-top: 14px; font-size: 1.15rem; }
.duty p { margin-top: 8px; font-size: .95rem; color: var(--on-deep-muted); }

.plans { margin-top: clamp(48px, 7vw, 80px); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { padding: clamp(26px, 4vw, 40px); border-radius: calc(var(--radius) + 6px); background: var(--on-deep); color: var(--ink); }
.plan-alt { background: linear-gradient(140deg, #0a5c63, #0b7a73); color: var(--on-deep); }
.plan-tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.plan h3 { margin-top: 12px; font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; }
.plan-name { font-family: var(--f-accent); font-style: italic; font-size: 1.15rem; opacity: .85; }
.plan ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.plan li { position: relative; padding-left: 28px; font-size: .98rem; }
.plan li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 2px; background: var(--accent); }
.plan-alt li::before { background: #7fe6db; }
.law-related { margin-top: 36px; font-size: .95rem; color: var(--on-deep-muted); max-width: 80ch; }

/* Tabla de frecuencias */
.table-wrap { border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.freq-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.freq-table th, .freq-table td { padding: 16px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.freq-table thead th { background: var(--deep); color: var(--on-deep); font: 600 13px/1.3 var(--f-body); letter-spacing: .02em; }
.freq-table thead th sup { color: #7fe6db; }
.freq-table tbody th { font: 700 .98rem/1.3 var(--f-display); width: 24%; }
.freq-table tbody th sup { color: var(--accent-ink); }
.freq-table tbody tr { transition: background .25s; }
.freq-table tbody tr:hover { background: var(--bg); }
.freq-table tbody tr:last-child > * { border-bottom: 0; }
.freq-table .na { color: #9bb0b3; }
.f { display: inline-block; padding: 4px 10px; border-radius: 99px; font-weight: 600; font-size: .88rem; }
.f-m { background: #ffe1d8; color: #a8341d; }
.f-t { background: #ffefd1; color: #8a5300; }
.f-s { background: #dff1ff; color: #1e5f95; }
.f-a { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 900px) {
  .table-wrap { background: transparent; box-shadow: none; overflow: visible; }
  .freq-table thead { display: none; }
  .freq-table, .freq-table tbody, .freq-table tr, .freq-table th, .freq-table td { display: block; width: 100%; }
  .freq-table tr { margin-bottom: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .freq-table tbody th { width: auto; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
  .freq-table td { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
  .freq-table td::before { content: attr(data-l); color: var(--muted); font-size: .88rem; }
  .freq-table td:last-child { border-bottom: 0; }
}
.footnotes { margin: 22px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: .88rem; color: var(--muted); columns: 2; }
@media (max-width: 760px) { .footnotes { columns: 1; } }

.cta-band {
  margin-top: clamp(56px, 8vw, 96px);
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 52px);
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(0,169,157,.45), transparent 60%),
    var(--deep);
  color: var(--on-deep);
  box-shadow: var(--shadow-lg);
}
.cta-band h3 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; }
.cta-band p { margin-top: 10px; color: var(--on-deep-muted); max-width: 52ch; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 22px 60px 22px 24px; position: relative;
  font: 700 1.06rem/1.35 var(--f-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink);
  transform: rotate(45deg); transition: transform .35s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 24px 22px; color: var(--muted); }

/* Footer */
.footer { background: var(--deep); color: var(--on-deep-muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; padding: 40px 0 48px; }
.footer .brand { color: var(--on-deep); }
.footer-note { margin-top: 16px; max-width: 64ch; font-size: .9rem; }
.footer-copy { font-size: .9rem; }
.footer a { color: var(--on-deep); }

/* ============ TEST ============ */
.quiz {
  width: min(980px, 100% - 24px); max-width: none;
  height: min(860px, 100% - 24px); max-height: none;
  padding: 0; border: 0; border-radius: 28px;
  background: var(--bg); color: var(--ink);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.55);
  overflow: hidden;
}
.quiz[open] { animation: quizIn .55s var(--ease-out); }
@keyframes quizIn { from { opacity: 0; transform: translateY(30px) scale(.98); } }
.quiz::backdrop { background: rgba(3, 30, 34, .62); backdrop-filter: blur(6px); }
@media (max-width: 640px) { .quiz { width: 100%; height: 100%; border-radius: 0; } }
.quiz-shell { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.quiz-top { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.quiz-brand { display: flex; align-items: center; gap: 8px; font: 700 15px/1 var(--f-display); color: var(--accent-ink); }
.quiz-progress { height: 6px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #57d9cd); transition: width .6s var(--ease-out); }
.quiz-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .quiz-top { grid-template-columns: 1fr auto; row-gap: 12px; padding: 14px 16px; }
  .quiz-progress { grid-column: 1 / -1; grid-row: 2; }
  .quiz-count { display: none; }
}
.quiz-body { position: relative; overflow-y: auto; padding: clamp(24px, 4vw, 44px); overscroll-behavior: contain; }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.quiz-nav[hidden] { display: none; }
.quiz-error { flex: 1; text-align: center; color: var(--hot); font-size: 14px; font-weight: 500; }
@media (max-width: 640px) { .quiz-nav { padding: 12px 16px; } .quiz-nav .btn { min-height: 46px; padding: 0 1.1em; } .quiz-error { font-size: 13px; } }

.q-step { animation: stepIn .5s var(--ease-out); }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } }
.q-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.q-title { margin-top: 10px; font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 800; text-wrap: balance; }
.q-help { margin-top: 10px; color: var(--muted); max-width: 64ch; }
.q-block { margin-top: 30px; }
.q-block + .q-block { padding-top: 26px; border-top: 1px dashed var(--line); }
.q-label { font: 700 1.05rem/1.35 var(--f-display); }
.q-sub { margin-top: 4px; font-size: .92rem; color: var(--muted); }

.opts { margin-top: 14px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.opts-inline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-box {
  display: flex; gap: 14px; align-items: flex-start; height: 100%;
  padding: 16px 16px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line);
  transition: border-color .2s, box-shadow .3s, transform .3s var(--ease-out), background .2s;
}
.opt:hover .opt-box { border-color: rgba(0,169,157,.5); transform: translateY(-2px); }
.opt input:checked + .opt-box { border-color: var(--accent); background: #f3fcfb; box-shadow: 0 0 0 4px rgba(0,169,157,.14); }
.opt input:focus-visible + .opt-box { outline: 3px solid var(--amber); outline-offset: 2px; }
.opt-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.opt-ico svg { width: 22px; height: 22px; }
.opt-txt b { display: block; font: 700 .98rem/1.3 var(--f-display); }
.opt-txt small { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.opt-check { margin-left: auto; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; transition: background .2s, border-color .2s; }
.opt-check svg { width: 14px; height: 14px; opacity: 0; }
.opt input[type="checkbox"] + .opt-box .opt-check { border-radius: 7px; }
.opt input:checked + .opt-box .opt-check { background: var(--accent); border-color: var(--accent); }
.opt input:checked + .opt-box .opt-check svg { opacity: 1; }
.opt-simple .opt-box { align-items: center; padding: 14px 16px; }

.field { margin-top: 14px; display: grid; gap: 6px; max-width: 420px; }
.field label { font-weight: 600; font-size: .95rem; }
.input, .select {
  width: 100%; min-height: 50px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font: 500 16px/1.2 var(--f-body);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,169,157,.15); }
.fields-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fields-row .field { max-width: none; }

.callout { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: #fff6e6; border: 1px solid #f6d69c; font-size: .94rem; color: #6b4300; }
.callout-info { background: #eaf7f6; border-color: #b9e6e1; color: #0c4f4a; }
.callout-warn { background: #fdecea; border-color: #f4c2b8; color: #8c2a17; }
.callout b { font-weight: 700; }

/* Tabla editable PPCL/PSL */
.ctable { margin-top: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ctable h4 { padding: 14px 18px; background: var(--bg-soft); font-size: 1rem; }
.crow { display: grid; grid-template-columns: 1fr 160px 190px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .93rem; }
.crow .select { min-height: 42px; font-size: 15px; }
.crow-min { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { .crow { grid-template-columns: 1fr 1fr; } .crow > span:first-child { grid-column: 1 / -1; font-weight: 600; } }
.crow.is-warn .select { border-color: var(--hot); }

/* ---------- Resultados ---------- */
.res-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.res-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.res-badge.is-psl { background: #e4ecff; color: #2a4a9b; }
.res-badge.is-ppcl { background: #ffefd1; color: #8a5300; }
.res-card { margin-top: 22px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.res-card-head { display: flex; gap: 14px; align-items: center; padding: 18px 22px; background: var(--deep); color: var(--on-deep); }
.res-card-head .opt-ico { background: rgba(127,230,219,.18); color: #7fe6db; }
.res-card-head h4 { font-size: 1.1rem; }
.res-card-head small { display: block; color: var(--on-deep-muted); font-size: .85rem; margin-top: 2px; font-family: var(--f-body); font-weight: 400; letter-spacing: 0; }
.res-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0; }
.res-param { padding: 16px 22px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.res-param .p-name { font-size: .85rem; color: var(--muted); }
.res-param .p-freq { margin-top: 4px; font: 800 1.15rem/1.2 var(--f-display); }
.res-param .p-src { margin-top: 4px; font-size: .78rem; font-weight: 600; color: var(--accent-ink); }
.res-param .p-src.is-psl { color: #2a4a9b; }
.res-param .p-src.is-ppcl { color: #8a5300; }
.res-param .p-src.is-warn { color: var(--hot); }
.res-param.is-key { background: #f6fcfb; }
.res-param.is-key .p-freq { color: var(--accent-ink); }
.res-notes { padding: 16px 22px 20px; display: grid; gap: 8px; font-size: .92rem; color: var(--muted); }
.res-notes li { margin-left: 18px; }
.res-notes ul { margin: 0; padding: 0; display: grid; gap: 6px; }
.res-notes strong { color: var(--ink); }

.choice { margin-top: 36px; padding: clamp(22px, 4vw, 36px); border-radius: 26px; background: var(--deep); color: var(--on-deep); }
.choice h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
.choice > p { margin-top: 8px; color: var(--on-deep-muted); }
.choice-opts { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .choice-opts { grid-template-columns: 1fr; } }
.choice-btn {
  display: flex; gap: 16px; align-items: flex-start; text-align: left;
  padding: 22px; border-radius: 20px; cursor: pointer;
  background: rgba(232,246,245,.06); color: var(--on-deep);
  border: 1.5px solid var(--line-deep);
  font: inherit;
  transition: background .3s, border-color .3s, transform .4s var(--ease-out);
}
.choice-btn:hover, .choice-btn.is-active { background: rgba(0,169,157,.18); border-color: #7fe6db; transform: translateY(-3px); }
.choice-btn svg { width: 30px; height: 30px; flex: none; color: #7fe6db; }
.choice-btn b { display: block; font: 700 1.1rem/1.3 var(--f-display); }
.choice-btn small { display: block; margin-top: 4px; color: var(--on-deep-muted); font-size: .9rem; }

.panel { margin-top: 22px; padding: clamp(20px, 3.4vw, 30px); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.panel h4 { font-size: 1.2rem; }
.panel .q-sub { margin-top: 6px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .92rem; color: var(--muted); }
.check-line input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.panel-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.form-msg { font-size: .95rem; font-weight: 500; }
.form-msg.is-ok { color: var(--accent-ink); }
.form-msg.is-err { color: var(--hot); }

/* Calendario visual */
.cal-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cal-month { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); }
.cal-month h5 { font: 800 1rem/1 var(--f-display); text-transform: capitalize; display: flex; justify-content: space-between; }
.cal-month h5 span { font: 500 .8rem/1 var(--f-body); color: var(--muted); }
.cal-ev { margin-top: 10px; display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; font-size: .86rem; }
.cal-day { display: grid; place-items: center; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font: 800 1.05rem/1 var(--f-display); }
.cal-day small { display: block; font: 500 .65rem/1 var(--f-body); color: var(--muted); text-transform: uppercase; }
.cal-ev b { display: block; font-weight: 600; }
.cal-ev span { color: var(--muted); }
.cal-ev.t-ld .cal-day { background: #fff6e6; border-color: #f6d69c; }
.cal-ev.t-post .cal-day { background: #fdecea; border-color: #f4c2b8; }
.cal-empty { margin-top: 10px; font-size: .85rem; color: #9bb0b3; }
.routine { margin-top: 18px; display: grid; gap: 8px; font-size: .92rem; }
.routine li { margin-left: 18px; color: var(--muted); }
.routine b { color: var(--ink); }

/* Impresión del resumen */
@media print {
  body > *:not(.quiz) { display: none !important; }
  .quiz { position: static; display: block; width: 100%; height: auto; box-shadow: none; border-radius: 0; overflow: visible; }
  .quiz-shell { display: block; }
  .quiz-top, .quiz-nav, .choice, .no-print { display: none !important; }
  .quiz-body { overflow: visible; padding: 0; }
  .res-card, .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
