/* =============================================================
   1. Tokens
   ============================================================= */
/* Colores animables: al cambiar de cuerpo la web pasa del azul al verde con transición */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #0a3a7a; }
@property --accent-2 { syntax: "<color>"; inherits: true; initial-value: #1d5fc2; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: #e8effa; }
@property --brand-dark { syntax: "<color>"; inherits: true; initial-value: #06244d; }
@property --pct { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f1b2d;
  --muted: #5a6677;
  --line: #dde3eb;
  --line-strong: #c3ccd6;
  --ok: #15803d;
  --ok-bg: #e8f8ee;
  --ok-line: #9bd8b3;
  --ko: #b42318;
  --ko-bg: #fdecea;
  --ko-line: #f1aaa4;
  --mid: #8a5a00;
  --mid-bg: #fdf3dc;
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .07);
}
/* Policía Nacional: azul marino */
:root, [data-theme="pn"] {
  --accent: #0a3a7a;
  --accent-2: #1d5fc2;
  --accent-soft: #e8effa;
  --brand-dark: #06244d;
  --focus: rgba(29, 95, 194, .22);
}
/* Guardia Civil: verde */
[data-theme="gc"] {
  --accent: #1d5e33;
  --accent-2: #2e8b4e;
  --accent-soft: #e7f3eb;
  --brand-dark: #0f3a1f;
  --focus: rgba(46, 139, 78, .24);
}
/* Otros cuerpos */
[data-theme="mossos"] { --accent: #102f5e; --accent-2: #2563b0; --accent-soft: #e7eef9; --brand-dark: #0a1f40; --focus: rgba(37, 99, 176, .22); }
[data-theme="ertz"]   { --accent: #a3162b; --accent-2: #d42a44; --accent-soft: #fbe9ec; --brand-dark: #6e0e1d; --focus: rgba(212, 42, 68, .22); }
[data-theme="pla"]    { --accent: #0e5a6b; --accent-2: #1a8aa0; --accent-soft: #e4f3f6; --brand-dark: #083c48; --focus: rgba(26, 138, 160, .24); }
[data-theme="tropa"]  { --accent: #4b5a1f; --accent-2: #6e8430; --accent-soft: #eff3e3; --brand-dark: #323d12; --focus: rgba(110, 132, 48, .26); }
[data-theme="sva"]    { --accent: #3b3f8f; --accent-2: #5a60c4; --accent-soft: #ecedf9; --brand-dark: #272a66; --focus: rgba(90, 96, 196, .24); }
[data-theme="pfn"]      { --accent: #7a1f3d; --accent-2: #a83a5f; --accent-soft: #f7e9ee; --brand-dark: #4f1227; --focus: rgba(168, 58, 95, .22); }
[data-theme="canarias"] { --accent: #5b2c83; --accent-2: #8a4fbf; --accent-soft: #f1eaf8; --brand-dark: #3b1b57; --focus: rgba(138, 79, 191, .22); }
[data-theme="plcv"] { --accent: #9a3412; --accent-2: #c2410c; --accent-soft: #fbeee6; --brand-dark: #6b240c; --focus: rgba(194, 65, 12, .22); }
[data-theme="pmm"]  { --accent: #075985; --accent-2: #0284c7; --accent-soft: #e6f3fb; --brand-dark: #053d5c; --focus: rgba(2, 132, 199, .22); }
html { transition: --accent .5s ease, --accent-2 .5s ease, --accent-soft .5s ease, --brand-dark .5s ease; }

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* La franja de color y los adornos van a todo el ancho: se recortan aquí para que la página
   nunca se pueda desplazar hacia los lados en el móvil */
main { overflow-x: hidden; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
a { color: var(--accent-2); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.015em; }
fieldset { border: 0; padding: 0; min-width: 0; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; z-index: 9999; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Header / footer
   ============================================================= */
.site-header { background: linear-gradient(90deg, var(--brand-dark), var(--accent)); color: #fff; position: relative; z-index: 2; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; }
.brand { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-weight: 800; font-size: .92rem; letter-spacing: -.01em; white-space: nowrap; flex: 0 0 auto; }
.brand-mark { width: 20px; height: 20px; }
.header-inner { position: relative; }
/* Botón «Instalar app» en la cabecera, al lado del logo */
.hdr-install {
  display: inline-flex; align-items: center; gap: 5px; margin-right: auto; margin-left: 8px; flex: 0 0 auto;
  color: #fff; font-weight: 700; font-size: .76rem; padding: 5px 9px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); white-space: nowrap;
}
.hdr-install:hover { background: rgba(255,255,255,.24); }
.hdr-install svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-ios {
  position: absolute; top: calc(100% + 6px); left: 16px; right: 16px; z-index: 60; max-width: 420px;
  background: var(--surface); color: var(--ink); font-size: .84rem; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(15,27,45,.25);
}
.header-nav { display: flex; align-items: center; gap: 16px; font-size: .84rem; font-weight: 600; }
.header-nav > a { color: rgba(255,255,255,.88); text-decoration: none; }
.header-nav > a:hover { color: #fff; text-decoration: underline; }
.header-nav .nav-main, .nav-more-lg, .hide-sm { display: none; }
/* Menú «Más cuerpos» (en móvil: botón ☰ con todo) */
.nav-more { position: relative; }
.nav-more summary {
  list-style: none; cursor: pointer; color: #fff; display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); user-select: none;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] summary { background: rgba(255,255,255,.22); }
.nav-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 250px;
  background: var(--surface); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,27,45,.25); padding: 6px; display: grid;
}
.nav-menu a { color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 4px 6px; }

.site-footer { background: var(--brand-dark); color: rgba(255,255,255,.8); font-size: .85rem; padding: 28px 0 34px; margin-top: 44px; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; gap: 8px; }

/* =============================================================
   5. Hero (franja de color) + tarjeta de la calculadora
   ============================================================= */
.hero { padding-top: 0; }
.hero-head { position: relative; isolation: isolate; padding: 12px 0 46px; color: #fff; }
.hero-head::before { /* franja a todo el ancho */
  content: ""; position: absolute; z-index: -2; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.16), transparent 55%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 2px, transparent 2px 16px),
    linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
}
.hero-head::after { /* "pista de atletismo" decorativa */
  content: ""; position: absolute; z-index: -1; right: -90px; bottom: -150px; width: 340px; height: 340px; border-radius: 50%;
  border: 26px solid rgba(255,255,255,.07); box-shadow: 0 0 0 22px rgba(255,255,255,.035), inset 0 0 0 22px rgba(255,255,255,.035);
  pointer-events: none;
}
.hero h1 { font-size: 1.14rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.hero-sub { font-size: .8rem; color: rgba(255,255,255,.88); margin-top: 3px; line-height: 1.35; }
.hero-chips { display: none; }
.crumbs { font-size: .76rem; color: rgba(255,255,255,.78); margin-bottom: 4px; }
.crumbs a { color: rgba(255,255,255,.9); }
.crumbs span[aria-hidden] { margin: 0 4px; }
.shared-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: 640px; margin-top: 8px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff;
  border-radius: 9px; padding: 7px 12px; font-size: .82rem; font-weight: 600;
}
.shared-note .link-btn { color: #fff; }

.tool-card {
  position: relative; z-index: 1; margin-top: -36px;
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 4px solid var(--accent);
  box-shadow: 0 2px 4px rgba(15,27,45,.06), 0 18px 40px rgba(15,27,45,.16);
  padding: 12px;
  max-width: 640px;
}
.noscript { padding: 12px; background: var(--mid-bg); border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 10px; }

/* Selectores */
.controls { display: grid; gap: 8px; margin-bottom: 8px; }
.controls-row { display: flex; gap: 8px; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  flex: 1 1 0; text-align: center; font-size: .84rem; font-weight: 600; color: var(--muted);
  padding: 7px 6px; border-radius: 7px; cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s;
}
.seg label:hover { color: var(--accent); }
.seg input:checked + label { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(15,27,45,.14); }
.seg input:focus-visible + label { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.seg-cuerpo label { font-size: .92rem; font-weight: 700; padding: 8px 6px; }
.seg-cuerpo input:checked + label, .seg-obj input:checked + label {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 12px var(--focus);
}
.opt-check {
  display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--ink);
  background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; cursor: pointer; user-select: none;
}
.opt-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.controls-row .opt-check { flex: 1 1 0; justify-content: center; white-space: nowrap; padding: 6px 10px; font-size: .82rem; }
.seg-sexo { flex: 2 1 0; }
.seg-edad { flex: 3 1 0; }
.seg-edad label { padding-inline: 2px; }

/* Filas de prueba */
.tests { display: grid; }
.test { padding: 6px 0 5px; border-top: 1px solid var(--line); }
.tests .test:first-child { border-top: 0; padding-top: 0; }
.controls ~ .tests .test:first-child { border-top: 1px solid var(--line); padding-top: 6px; }
.test-row { display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 8px; }
.test-name { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.test-input { display: flex; align-items: center; gap: 4px; }
.test-input input {
  width: 72px; height: 38px; padding: 0 8px; text-align: right; font-size: 1.02rem; font-weight: 700;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.test-input-time input { width: 48px; text-align: center; }
.test-input input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--focus); }
.test-input input[aria-invalid="true"] { border-color: var(--ko); }
.test-input input::placeholder { color: #a6b0bc; font-weight: 400; font-size: .85rem; }
.suf { font-size: .78rem; color: var(--muted); width: 26px; }
.colon { font-weight: 700; color: var(--muted); }
.test-input-time { margin-right: 30px; }

.badge {
  display: grid; place-items: center; height: 38px; border-radius: 9px; font-weight: 800; font-size: 1.08rem;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.badge.is-empty { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge.is-apto { font-size: .68rem; letter-spacing: .02em; }
.badge.is-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge.is-mid { background: var(--mid-bg); color: var(--mid); border-color: #f0d38f; }
.badge.is-ko { background: var(--ko-bg); color: var(--ko); border-color: var(--ko-line); }
.badge.pop { animation: pop .38s var(--ease-out); }
.hint { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.3; min-height: 1.3em; }
.hint strong { color: var(--ink); font-weight: 700; }
.hint.is-ko { color: var(--ko); }
.hint.is-ok { color: var(--ok); }

/* Resultado con anillo */
.result {
  position: relative; display: flex; align-items: center; gap: 12px;
  margin-top: 6px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg); transition: background .25s var(--ease-out), border-color .25s var(--ease-out);
}
.result:focus { outline: none; }
.result-text { min-width: 0; }
.result-title { font-weight: 800; font-size: 1.1rem; line-height: 1.2; }
.result-detail { font-size: .82rem; margin-top: 2px; line-height: 1.35; color: var(--muted); }
.result-ring {
  --ring: var(--accent);
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), rgba(15,27,45,.09) 0);
  transition: --pct .8s var(--ease-out);
}
.result-ring span {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font-weight: 800; font-size: .8rem; color: var(--ring); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.result[data-state="ok"] { background: var(--ok-bg); border-color: var(--ok); }
.result[data-state="ok"] .result-title, .result[data-state="ok"] .result-detail { color: var(--ok); }
.result[data-state="ok"] .result-ring { --ring: var(--ok); }
.result[data-state="ko"] { background: var(--ko-bg); border-color: var(--ko); }
.result[data-state="ko"] .result-title, .result[data-state="ko"] .result-detail { color: var(--ko); }
.result[data-state="ko"] .result-ring { --ring: var(--ko); }
.result[data-state="mid"] { background: var(--mid-bg); border-color: #d9a441; }
.result[data-state="mid"] .result-title, .result[data-state="mid"] .result-detail { color: var(--mid); }
.result[data-state="mid"] .result-ring { --ring: #c98a12; }
.result.bump { animation: bump .5s var(--ease-out); }
.confetti-piece {
  position: absolute; left: 37px; top: 50%; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 5;
  animation: confetti 1.15s cubic-bezier(.2,.7,.3,1) forwards;
}

.tool-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.link-btn { color: var(--accent-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 2px 0; font-size: .8rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: .82rem; padding: 8px 13px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 12px var(--focus);
  transition: transform .15s var(--ease-out), opacity .15s, box-shadow .15s;
}
.share-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--focus); }
.share-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.share-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.disclaimer-inline { font-size: .78rem; color: var(--muted); margin-top: 10px; max-width: 640px; }

/* =============================================================
   6. Content sections
   ============================================================= */
/* Portada: «elige tu oposición» */
.hub { position: relative; z-index: 1; margin-top: -36px; display: grid; gap: 10px; max-width: 640px; }
.hub-card, .hub-more > summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: var(--surface); color: var(--ink); text-decoration: none; border-radius: 14px; padding: 14px 16px;
  border-left: 5px solid var(--accent); box-shadow: 0 2px 4px rgba(15,27,45,.06), 0 12px 28px rgba(15,27,45,.14);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.hub-card:hover, .hub-more > summary:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(15,27,45,.08), 0 16px 34px rgba(15,27,45,.18); }
.hub-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  font-weight: 800; font-size: .86rem; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.hub-txt { display: grid; gap: 2px; min-width: 0; }
.hub-txt strong { font-size: 1.04rem; color: var(--accent); line-height: 1.2; }
.hub-txt span { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.hub-go { font-size: 1.3rem; font-weight: 700; color: var(--accent); transition: transform .2s var(--ease-out); }
.hub-more > summary { list-style: none; cursor: pointer; border-left-color: #475569; }
.hub-more > summary::-webkit-details-marker { display: none; }
.hub-more > summary .hub-ico { background: linear-gradient(135deg, #334155, #64748b); font-size: 1.4rem; }
.hub-more > summary .hub-txt strong, .hub-more > summary .hub-go { color: var(--ink); }
.hub-more[open] > summary .hub-go { transform: rotate(180deg); }
.hub-list {
  display: grid; gap: 6px; margin-top: 8px; padding: 8px; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow);
}
.hub-list a {
  display: block; padding: 11px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: .92rem;
  color: var(--accent); background: var(--accent-soft); border-left: 4px solid var(--accent);
}
.hub-list a:hover { filter: brightness(.97); }

.section { padding-top: 40px; }
.section h2 { font-size: 1.35rem; color: var(--accent); margin-bottom: 14px; }
.section > h2::after {
  content: ""; display: block; width: 48px; height: 4px; border-radius: 4px; margin-top: 9px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section h2:not(:first-child) { margin-top: 32px; }
.section-intro { font-size: .94rem; color: var(--muted); margin: -4px 0 14px; max-width: 760px; }

.steps { list-style: none; padding: 0; display: grid; gap: 12px; counter-reset: paso; }
.step {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.step::after { /* número grande decorativo */
  counter-increment: paso; content: counter(paso); position: absolute; right: 12px; top: -14px;
  font-size: 5.5rem; font-weight: 800; color: var(--accent-soft); line-height: 1; z-index: 0;
}
.step > * { position: relative; z-index: 1; }
.step-num {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 14px var(--focus);
}
.step h3 { font-size: 1.04rem; margin-bottom: 4px; }
.step p { font-size: .92rem; color: var(--muted); }

.two-col { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--accent); }
.prose p, .prose li { font-size: .94rem; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 10px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose li::marker { color: var(--accent-2); }

.source { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.tables { display: grid; gap: 14px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 800; padding: 12px 14px 10px; font-size: .95rem; color: var(--accent); }
th, td { padding: 7px 14px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--accent); color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
tbody tr:hover { background: var(--accent-soft); }
tbody th { font-weight: 800; }
tbody th small { font-weight: 500; color: var(--ko); }
.row-zero { background: #fff5f4; }
.row-five { background: var(--ok-bg); }
.row-five th { color: var(--ok); }
.table-wide th[rowspan] { white-space: normal; min-width: 140px; vertical-align: top; }
.table-wide small { display: block; color: var(--muted); font-weight: 500; }
.table-note { font-size: .85rem; color: var(--muted); margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border-radius: 10px; padding: 11px 18px; text-decoration: none; font-size: .95rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }

.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; transition: border-color .2s, box-shadow .2s; }
.faq details:hover { border-color: var(--line-strong); }
.faq details[open] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: .95rem; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; font-weight: 700; line-height: 1;
}
.faq details[open] summary::after { content: "–"; background: var(--accent); color: #fff; }
.faq details p { padding: 0 16px 14px; font-size: .93rem; color: var(--muted); }

/* Planificador */
.planner { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.planner-legend { font-weight: 800; font-size: .9rem; margin-bottom: 8px; float: left; width: 100%; color: var(--accent); }
.seg-obj { flex-wrap: wrap; }
.seg-obj label { font-size: 1.02rem; font-weight: 800; }
.planner-out { margin-top: 12px; }
.planner-empty { font-size: .9rem; color: var(--muted); }
.planner-list { list-style: none; padding: 0; display: grid; gap: 6px; margin-bottom: 10px; }
.planner-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline;
  padding: 10px 12px; background: var(--accent-soft); border-radius: 10px; font-size: .9rem;
}
.pl-name { font-weight: 700; }
.pl-mark { color: var(--accent); text-align: right; font-weight: 800; }
.pl-st { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.pl-st.is-ok { color: var(--ok); } .pl-st.is-mid { color: var(--mid); } .pl-st.is-ko { color: var(--ko); }
.planner-adv { font-size: .9rem; margin-top: 6px; }
.planner.is-off .planner-list { display: none; }
.tables-2 { display: grid; gap: 14px; }

/* Enlaces internos */
.links-grid { display: grid; gap: 12px; }
.links-col { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.links-col h3 { font-size: 1rem; margin-bottom: 8px; }
.links-col h3 a { color: var(--accent); }
.links-col ul { padding-left: 1.1em; display: grid; gap: 5px; font-size: .92rem; }
.links-col li::marker { color: var(--accent-2); }
.links-sub { font-size: 1.05rem; color: var(--ink); margin: 22px 0 10px; }
.links-cards { display: grid; gap: 10px; }
.links-card {
  display: grid; gap: 3px; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent); border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.links-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,27,45,.12); }
.links-card strong { color: var(--accent); font-size: .98rem; }
.links-card span { color: var(--muted); font-size: .84rem; }

/* Diálogo de compartir */
.share-dlg { margin: auto; border: 0; padding: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 380px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--ink); border-top: 4px solid var(--accent); }
.share-dlg::backdrop { background: rgba(10, 20, 35, .55); }
.share-dlg[open]:not(:modal) { position: fixed; inset: 0; z-index: 1000; }
.share-inner { position: relative; padding: 18px 20px 16px; }
.share-title { font-weight: 800; font-size: 1.05rem; padding-right: 30px; color: var(--accent); }
.share-preview { font-size: .82rem; color: var(--muted); background: var(--bg); border-radius: 9px; padding: 10px 12px; margin: 10px 0 12px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-opt {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 8px;
  border-radius: 10px; font-weight: 700; font-size: .88rem; text-decoration: none; background: var(--accent-soft); color: var(--accent);
}
.share-opt:hover { filter: brightness(.96); }
.share-wa { background: #25d366; color: #fff; }
.share-tg { background: #229ed9; color: #fff; }
.share-native { display: block; margin: 10px auto 0; }
.share-note { font-size: .72rem; color: var(--muted); margin-top: 10px; text-align: center; }

.notice { background: var(--mid-bg); border: 1px solid #f0d38f; border-radius: var(--radius); padding: 18px; }
.notice h2 { font-size: 1.1rem; color: var(--mid); margin-bottom: 6px; }
.notice p { font-size: .92rem; }

/* =============================================================
   7. Anuncios
   ============================================================= */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--line-strong); border-radius: 10px; background: repeating-linear-gradient(45deg, #f9fafc, #f9fafc 8px, #f1f4f8 8px, #f1f4f8 16px);
  color: #8793a3; text-align: center;
}
.ad-slot.is-live { display: block; border: 0; background: none; }
.ad-label { font-weight: 800; letter-spacing: .14em; font-size: .85rem; }
.ad-size { font-size: .7rem; }
.ad-leaderboard { min-height: 100px; margin-top: 22px; max-width: 728px; }
.ad-incontent { min-height: 280px; max-width: 336px; margin: 26px auto 4px; }
.dlg-x { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border-radius: 50%; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.dlg-x:hover { background: var(--bg); color: var(--ink); }

/* =============================================================
   8. Animaciones
   ============================================================= */
@keyframes pop { 0% { transform: scale(.82); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(.985); } 45% { transform: scale(1.018); } 100% { transform: scale(1); } }
@keyframes confetti {
  from { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; }
}

/* =============================================================
   9. Responsive
   ============================================================= */
@media (max-width: 359px) {
  .seg label { font-size: .76rem; }
  .test-input input { width: 62px; }
  .test-input-time input { width: 42px; }
  .test-name { font-size: .84rem; }
}
@media (min-width: 540px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: .92rem; }
  .tool-card { padding: 16px 18px; }
  .test-input input { width: 84px; }
  .test-input-time input { width: 52px; }
  .test-row { grid-template-columns: 1fr auto 60px; }
  .result-ring { width: 58px; height: 58px; }
  .result-ring span { width: 44px; height: 44px; font-size: .9rem; }
  .confetti-piece { left: 41px; }
  .hide-sm { display: inline; }
}
@media (min-width: 720px) {
  .header-nav .nav-main { display: inline; }
  .nav-more-lg { display: inline; }
  .nav-more-lg::after { content: " ▾"; font-size: .75em; }
  .nav-more-sm, .nav-menu .nav-only-sm { display: none; }
  .hero-head { padding: 34px 0 64px; }
  .hero-head::after { width: 460px; height: 460px; right: -80px; bottom: -220px; }
  .tool-card, .hub { margin-top: -44px; }
  .hub-list { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; max-width: 780px; }
  .hero-sub { font-size: 1rem; margin-top: 8px; }
  .hero-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-top: 16px; }
  .hero-chips li {
    font-size: .8rem; font-weight: 600; color: #fff; padding: 5px 12px; border-radius: 999px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
  }
  .hero-chips li::before { content: "✓ "; font-weight: 800; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .ad-leaderboard { min-height: 90px; }
  .tables-2, .links-grid, .links-cards { grid-template-columns: 1fr 1fr; }
  .planner-list { grid-template-columns: repeat(3, 1fr); }
  .planner-list li { grid-template-columns: 1fr; }
  .pl-mark { text-align: left; font-size: 1.05rem; }
  .section h2 { font-size: 1.6rem; }
}
@media (min-width: 960px) {
  .hero { text-align: center; }
  .hero h1, .hero-sub, .tool-card, .hub, .disclaimer-inline, .shared-note { margin-inline: auto; }
  .hub { text-align: left; }
  .hero-chips, .shared-note { justify-content: center; }
  .tool-card { text-align: left; }
  .ad-leaderboard { margin-inline: auto; }
  .tables { grid-template-columns: repeat(3, 1fr); }
  .tables.tables-2 { grid-template-columns: 1fr 1fr; }
  .links-cards { grid-template-columns: repeat(3, 1fr); }
  .tables th, .tables td { padding-inline: 10px; font-size: .84rem; }
  .tables thead th { white-space: normal; }
  .tables tbody th small { display: block; font-size: .72rem; }
}

/* =============================================================
   Transiciones entre páginas (elegir cuerpo / cambiar de cuerpo)
   ============================================================= */
/* Nada se mueve: la página vieja y la nueva se funden, así el color de la franja
   pasa poco a poco de un cuerpo a otro (p. ej. azul → verde) sin saltos. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; animation-timing-function: ease-out; }

/* Navegadores sin transición entre páginas: el contenido aparece fundido, sin desplazarse */
@supports not (view-transition-name: none) { main { animation: vt-fade .2s ease-out both; } }
@keyframes vt-fade { from { opacity: 0; } }

/* Portada: las tarjetas aparecen fundidas una tras otra y la elegida se «pulsa» */
.hub > * { animation: hub-in .25s ease-out both; }
.hub > :nth-child(2) { animation-delay: .03s; }
.hub > :nth-child(3) { animation-delay: .06s; }
.hub > :nth-child(4) { animation-delay: .09s; }
@keyframes hub-in { from { opacity: 0; } }
.hub-card:active, .hub-more > summary:active { transform: scale(.985); }
.hub-card.picked { transform: scale(.985); box-shadow: 0 0 0 3px var(--accent), 0 16px 34px rgba(15,27,45,.2); }
.hub-card.picked .hub-go { transform: translateX(5px); }
.hub-more[open] .hub-list { animation: hub-in .3s var(--ease-out) both; }
.hub-list a { transition: transform .15s var(--ease-out), filter .15s; }
.hub-list a:hover { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .hub > *, main, .hub-more[open] .hub-list { animation: none !important; }
  html { scroll-behavior: auto; transition: none; }
  .badge.pop, .result.bump { animation: none; }
  .confetti-piece { display: none; }
  .result-ring { transition: none; }
}
