/* =================================================================
   TESTCO · Laboratorio y análisis de concreto
   Hoja de estilos principal (mobile-first)

   Índice
   1. Variables de marca          12. Proyectos, galería y visor
   2. Base y utilidades          13. Proceso, línea de tiempo
   3. Botones y enlaces          14. CTA
   4. Header y navegación        15. Detalle de servicio
   5. Hero                       16. Contacto y formularios
   6. Páginas interiores         17. Footer y WhatsApp
   7. Secciones genéricas        18. Portal de resultados
   8. Soluciones                 19. Área de clientes y tablas
   9. Servicios y carrusel       20. Panel interno
   10. Banda del portal          21. Animaciones
   11. Acreditación y datos      22. Breakpoints · 23. Impresión
   ================================================================= */

/* ---------- 1. Variables de marca ---------- */
:root {
  /* Identidad TESTCO: azul #0C3D91, azul oscuro #09224D, gris concreto #D9DDE1,
     blanco y verde EMA #1FAE4B (solo en elementos de acreditación). */
  --primary: #0C3D91;        /* Azul TESTCO */
  --primary-dark: #09224D;   /* Azul oscuro */
  --primary-deep: #06173A;   /* Azul oscuro profundo para el footer */
  --primary-mid: #3F6DB8;    /* Azul medio: foco de teclado y trazos */
  --primary-light: #EDF1F7;  /* Azul muy claro para fondos sutiles */
  --action: #0C3D91;         /* Botones principales */
  --action-hover: #09224D;
  --concrete: #D9DDE1;       /* Gris concreto */
  --ema: #1FAE4B;            /* Verde EMA */
  --ema-dark: #137A33;       /* Verde EMA para texto sobre blanco (contraste AA) */
  --whatsapp: #25D366;
  --whatsapp-hover: #1EBE5A;
  --whatsapp-ink: #052E16;
  --accent: #F2A516;         /* Amarillo de seguridad (solo acentos pequeños) */

  --text: #14213D;
  --text-muted: #5A6679;
  --background: #FFFFFF;
  --gray: #EEF0F2;           /* Gris concreto claro para fondos de sección */
  --line: #D9DDE1;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --ok: #067647;
  --ok-bg: #ECFDF3;
  --warn: #93370D;
  --warn-bg: #FFFAEB;

  --font-display: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Montserrat", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-hero: clamp(2.35rem, 1.6rem + 3.6vw, 4.1rem);

  --space-section: clamp(4rem, 3rem + 4vw, 6.5rem);
  --radius-sm: 2px;          /* Esquinas casi rectas: carácter industrial */
  --radius: 2px;
  --radius-lg: 4px;
  --header-h: 68px;
  --container: 1200px;
  --shadow: 0 1px 2px rgba(10, 30, 63, .06), 0 8px 24px rgba(10, 30, 63, .08);
  --shadow-lg: 0 2px 6px rgba(10, 30, 63, .06), 0 24px 48px rgba(10, 30, 63, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --grid-dark: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
}

/* ---------- 2. Base y utilidades ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--action); text-underline-offset: 3px; }
h1, h2, h3, h4, .h2, .h3, .h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
  color: var(--primary-dark);
}
h2, .h2 { font-size: var(--fs-xl); }
h3, .h3 { font-size: var(--fs-lg); line-height: 1.2; }
h4, .h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
code, .hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; }
.hash { word-break: break-all; color: var(--text-muted); }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 480px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.lead { font-size: var(--fs-md); }
.block { display: block; }
.center-row { display: flex; justify-content: center; margin-top: 2rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon-lg { width: 2.25rem; height: 2.25rem; }

:focus-visible { outline: 3px solid var(--primary-mid); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--primary-dark); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

.only-mobile { display: block; }
.only-mobile-flex { display: inline-flex; }

/* ---------- 3. Botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.35rem;
  font: 600 var(--fs-base)/1.2 var(--font-body);
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 42px; padding: .55rem 1rem; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); box-shadow: 0 6px 16px rgba(12,61,145,.28); }
.btn-wa { background: var(--whatsapp); color: var(--whatsapp-ink); }
.btn-wa:hover { background: var(--whatsapp-hover); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-light { border-color: rgba(255,255,255,.4); color: #fff; background: transparent; }
.btn-outline-light:hover { background: #fff; color: var(--primary-dark); }
.btn-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--primary-dark); }
.btn-link { background: none; color: var(--primary); padding-inline: .5rem; text-decoration: underline; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #912018; }
.btn-results { background: var(--primary-light); color: var(--primary-dark); border-color: #C9D8EE; }
.btn-results:hover, .btn-results.is-current { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-row form { display: contents; }

.link { font-weight: 600; color: var(--primary); text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; }
.link:hover { color: var(--action-hover); }
.link-light { color: #fff; }
.link-light:hover { color: #C9D7EE; }
.link-arrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: var(--fs-sm); color: var(--primary); text-decoration: none;
}
.link-arrow .icon { transition: transform .25s var(--ease); }
a.link-arrow:hover .icon, .service-card:hover .link-arrow .icon, .mini-service:hover .link-arrow .icon { transform: translateX(4px); }

/* Enlace que cubre toda la tarjeta */
.stretched { color: inherit; text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* ---------- 4. Header y navegación ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 18px rgba(10,30,63,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.brand img { width: 132px; height: auto; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--primary-dark); cursor: pointer;
}
.menu-toggle .icon { width: 24px; height: 24px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Menú móvil: panel bajo el header */
.main-nav {
  position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  background: #fff; padding: .5rem 1.25rem 2rem;
  overflow-y: auto;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .2s, transform .25s var(--ease), visibility .2s;
}
.main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
.nav-list > li { position: relative; border-bottom: 1px solid var(--line); }
.nav-list > li > a {
  display: block; padding: .95rem 0;
  font: 700 1.3rem/1.2 var(--font-display); color: var(--primary-dark); text-decoration: none;
}
.nav-list > li > a[aria-current="page"] { color: var(--primary); }
.sub-toggle {
  position: absolute; right: 0; top: .45rem; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; background: var(--primary-light); border-radius: var(--radius-sm);
  color: var(--primary-dark); cursor: pointer;
}
.sub-toggle .icon { transition: transform .25s var(--ease); }
.sub-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.sub-menu { display: none; padding: 0 0 1rem; }
.has-sub.is-open .sub-menu { display: block; }
.sub-menu a { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; text-decoration: none; color: var(--text); font-weight: 600; }
.sub-menu a .icon { width: 1.6rem; height: 1.6rem; color: var(--primary); padding: .2rem; background: var(--primary-light); border-radius: var(--radius-sm); }
.sub-menu small { display: block; font-weight: 500; font-size: .75rem; color: var(--text-muted); }
.sub-all { font-size: var(--fs-sm); color: var(--primary) !important; }
.nav-actions { display: grid; gap: .75rem; margin-top: 1.5rem; }
body.menu-open { overflow: hidden; }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative; color: #fff;
  background-color: var(--primary-dark);
  background-image: var(--grid-dark);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  padding: clamp(2.5rem, 2rem + 3vw, 5rem) 0 clamp(3rem, 2rem + 4vw, 5.5rem);
  overflow: hidden;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 1.25rem; max-width: 14ch; }
.hero-kicker { display: block; margin-bottom: 1rem; font: 600 var(--fs-base)/1.3 var(--font-body); letter-spacing: 0; color: #A9C4EE; }
.hero-lead { font-size: var(--fs-md); color: #D3E0F4; max-width: 56ch; margin-bottom: 1.75rem; }
.hero-results {
  display: inline-flex; align-items: center; gap: .85rem; margin-top: 1.75rem;
  padding: .6rem 1rem .6rem .6rem; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  color: #DCE6F6; text-decoration: none; font-size: var(--fs-sm);
  transition: background-color .2s, border-color .2s;
}
.hero-results strong { color: #fff; margin-right: .25rem; }
.hero-results:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); }
.hero-results > .icon { transition: transform .25s var(--ease); }
.hero-results:hover > .icon { transform: translateX(3px); }
.hero-results-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--action); color: #fff; flex: none; }

.hero-visual { position: relative; }
.hero-photo { position: relative; margin: 0; padding: 14px 0 0 14px; }
.hero-photo::before, .hero-photo::after { content: ""; position: absolute; pointer-events: none; }
.hero-photo::before { /* regla superior */
  top: 0; left: 14px; right: 0; height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(169,196,238,.9) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(169,196,238,.45) 0 1px, transparent 1px 8px);
  background-size: 100% 10px, 100% 5px; background-repeat: no-repeat; background-position: bottom, bottom;
}
.hero-photo::after { /* regla lateral */
  top: 14px; bottom: 0; left: 0; width: 10px;
  background:
    repeating-linear-gradient(180deg, rgba(169,196,238,.9) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(180deg, rgba(169,196,238,.45) 0 1px, transparent 1px 8px);
  background-size: 10px 100%, 5px 100%; background-repeat: no-repeat; background-position: right, right;
}
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); filter: saturate(.9) contrast(1.03); }
/* Línea de "escaneo" que recorre la foto: recurso de precisión */
.scan-line {
  position: absolute; left: 14px; right: 0; top: 14px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(125,176,255,.95), transparent);
  box-shadow: 0 0 14px rgba(125,176,255,.8);
  animation: scan 5.5s var(--ease) infinite;
  pointer-events: none;
}

/* Ficha técnica (hero y acreditación) */
.ficha { background: #fff; color: var(--text); border-radius: var(--radius); border-top: 4px solid var(--primary); box-shadow: var(--shadow); padding: 1.1rem 1.25rem 1.2rem; }
.ficha-title { display: flex; align-items: center; gap: .5rem; font: 700 1.1rem/1.2 var(--font-display); color: var(--primary-dark); margin-bottom: .6rem; }
.ficha-title .icon { color: var(--ema); }
.ficha dl { margin: 0; }
.ficha dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.ficha dt { color: var(--text-muted); }
.ficha dd { margin: 0; font-weight: 700; text-align: right; color: var(--primary-dark); }
.ficha-link { display: inline-block; margin-top: .8rem; font-weight: 600; font-size: var(--fs-sm); }
.ficha-hero { margin-top: -2.5rem; margin-inline: 1rem; position: relative; }

.trust { border-bottom: 1px solid var(--line); background: #fff; }
.trust-list { display: grid; }
.trust-list li { display: flex; gap: .85rem; align-items: flex-start; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.trust-list li:last-child { border-bottom: 0; }
.trust-list .icon { width: 1.75rem; height: 1.75rem; color: var(--primary); margin-top: .1rem; }
.trust-list strong { display: block; color: var(--primary-dark); }
.trust-list span { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- 6. Páginas interiores ---------- */
.page-hero {
  position: relative; overflow: hidden; color: #fff;
  background-color: var(--primary-dark);
  background-image: var(--grid-dark);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  padding: clamp(2rem, 1.5rem + 2.5vw, 3.75rem) 0 clamp(2.25rem, 1.75rem + 2.5vw, 4rem);
}
.page-hero::after { /* regla de medición inferior */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(169,196,238,.55) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(169,196,238,.25) 0 1px, transparent 1px 8px);
  background-size: 100% 8px, 100% 4px; background-repeat: no-repeat; background-position: bottom;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 1.5rem + 2.4vw, 3.25rem); max-width: 22ch; margin-bottom: .6rem; }
.page-lead { color: #D3E0F4; font-size: var(--fs-md); max-width: 60ch; margin: 0; }
.page-kicker { display: inline-block; margin-bottom: .9rem; font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #A9C4EE; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .35rem; font-size: var(--fs-sm); margin-bottom: 1.25rem; color: #A9C4EE; }
.breadcrumb li + li::before { content: "/"; margin-right: .35rem; opacity: .6; }
.breadcrumb a { color: #DCE6F6; text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb [aria-current] { color: #fff; font-weight: 600; }

/* ---------- 7. Secciones genéricas ---------- */
.section { padding-block: var(--space-section); }
.section-tight { padding-block: clamp(2.5rem, 2rem + 2.5vw, 4rem); }
.section-gray { background: var(--gray); }
.section-light { background: var(--primary-light); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head p:not(.section-label) { color: var(--text-muted); font-size: var(--fs-md); margin: 0; }
.section-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; max-width: none; }
.section-head-row > div:first-child { max-width: 680px; }
.section-label { font-weight: 700; color: var(--primary); margin-bottom: .6rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.section-label-light { color: #7DB0FF; }

.checklist { display: grid; gap: .6rem; margin: 1.25rem 0 1.75rem; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; }
.checklist .icon { color: var(--ema-dark); margin-top: .15rem; }

/* ---------- 8. Soluciones ---------- */
.solver { display: grid; gap: 1rem; }
.solver-list { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .35rem; scrollbar-width: thin; }
.solver-tab {
  flex: 0 0 auto; scroll-snap-align: start;
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; min-height: 48px;
  font: 600 .95rem/1.25 var(--font-body); color: var(--text); text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.solver-tab .icon { width: 1.6rem; height: 1.6rem; color: var(--primary); }
.solver-tab:hover { border-color: #B7C8E2; }
.solver-tab[aria-selected="true"] { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: var(--shadow); }
.solver-tab[aria-selected="true"] .icon { color: #7DB0FF; }
.solver-panel { background: #fff; border-radius: var(--radius-lg); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); box-shadow: var(--shadow); }
.solver-panel:not([hidden]) { animation: panel-in .45s var(--ease); }
.solver-panel h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.solver-panel > p { color: var(--text-muted); max-width: 60ch; }
.solver-services { display: grid; gap: 1rem; margin: 1.25rem 0 1.5rem; }
.mini-service {
  position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: center;
  padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .25s, transform .25s var(--ease);
}
.mini-service:hover { border-color: #B7C8E2; box-shadow: var(--shadow); transform: translateY(-2px); }
.mini-service-body { display: grid; gap: .15rem; }
.mini-service small { color: var(--text-muted); font-weight: 600; font-size: .75rem; }
.mini-service strong { font: 700 1.2rem/1.2 var(--font-display); color: var(--primary-dark); }

.problems { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.problem { background: #fff; padding: 1.75rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .15rem; transition: background-color .25s; }
.problem:hover { background: #FBFCFE; }
.problem .icon-lg { color: var(--primary); margin-bottom: 1rem; }
.problem h3 { margin-bottom: .45rem; }
.problem p { color: var(--text-muted); }
.related { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 0; }
.related span, .related a {
  font-size: .78rem; font-weight: 600; color: var(--primary); text-decoration: none;
  background: var(--primary-light); border-radius: 999px; padding: .25rem .7rem;
  transition: background-color .2s, color .2s;
}
.related a:hover { background: var(--primary); color: #fff; }

/* ---------- 9. Servicios y carrusel ---------- */
.services { display: grid; gap: 1.25rem; }
.service {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #C7D3E4; }
.service-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.service-body h3 { font-size: 1.35rem; margin-bottom: .45rem; }
.service-body p { color: var(--text-muted); font-size: .95rem; }
.service-body .btn, .service-body .link-arrow { margin-top: auto; align-self: flex-start; }
.service-cat { display: flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--primary); margin-bottom: .4rem !important; }
.service-cat .icon { width: 1.1rem; height: 1.1rem; }
.service-help { background: var(--primary-dark); border-color: var(--primary-dark); }
.service-help h3 { color: #fff; }
.service-help p { color: #C9D7EE; }
.service-help a:not(.btn) { color: #fff; }

/* Imagen: ilustración base + foto real encima si existe */
.media {
  position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--primary-light);
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.service:hover .media img, .project:hover .media img, .mini-service:hover .media img { transform: scale(1.04); }
.media-mini { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.media-detail { border-radius: var(--radius-lg); aspect-ratio: 16 / 10; box-shadow: var(--shadow); }
.media-photo { border-radius: var(--radius); margin-top: 1.5rem; aspect-ratio: 2 / 1; }

.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(82%, 340px); gap: 1.25rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: .5rem max(1.25rem, calc((100% - var(--container)) / 2)) 1.5rem;
  scroll-padding-inline: max(1.25rem, calc((100% - var(--container)) / 2));
  scrollbar-width: thin; scrollbar-color: #B7C8E2 transparent;
}
.carousel > * { scroll-snap-align: start; }
.carousel:focus-visible { outline-offset: -3px; }
.carousel-controls { display: flex; gap: .5rem; }
.carousel-btn {
  width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
  background: #fff; color: var(--primary-dark); border: 1.5px solid var(--line); border-radius: 50%;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.carousel-btn:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.carousel-btn[data-carousel-prev] .icon { transform: rotate(180deg); }
.carousel-btn:disabled { opacity: .35; pointer-events: none; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .45rem 1rem;
  font: 600 var(--fs-sm)/1 var(--font-body); color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.chip span { font-size: .75rem; background: var(--primary-light); color: var(--primary); border-radius: var(--radius-sm); padding: .15rem .45rem; }
.chip:hover { border-color: var(--primary-mid); }
.chip.is-active { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.chip.is-active span { background: rgba(255,255,255,.15); color: #fff; }
[data-filter-grid] > .is-hidden { display: none; }
[data-filter-grid] > .is-entering { animation: card-in .45s var(--ease) both; }

/* ---------- 10. Banda del portal ---------- */
.results-band {
  color: #fff; padding-block: var(--space-section);
  background-color: var(--primary-deep);
  background-image: var(--grid-dark);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}
.results-grid { display: grid; gap: 3rem; align-items: center; }
.results-band h2 { color: #fff; max-width: 18ch; }
.results-lead { color: #C9D7EE; font-size: var(--fs-md); max-width: 56ch; }
.results-steps { display: grid; gap: 1rem; margin: 1.75rem 0 2rem; }
.results-steps li { display: flex; gap: 1rem; align-items: flex-start; color: #B9CCEA; font-size: .95rem; }
.results-steps strong { display: block; color: #fff; font-size: 1rem; }
.results-steps span {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  font: 700 1rem/1 var(--font-display); color: #7DB0FF; border: 1.5px solid rgba(125,176,255,.5);
}

.portal-mock { position: relative; }
.mock-window { background: #fff; color: var(--text); border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(0,0,0,.35); overflow: hidden; transform: perspective(1400px) rotateY(-4deg) rotateX(2deg); }
.mock-bar { display: flex; align-items: center; gap: .35rem; padding: .7rem .9rem; background: var(--gray); border-bottom: 1px solid var(--line); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #D0D6DF; }
.mock-bar span { margin-left: .75rem; font-size: .75rem; color: var(--text-muted); background: #fff; padding: .2rem .75rem; border-radius: 999px; flex: 1; }
.mock-body { padding: 1.5rem; display: grid; gap: .9rem; }
.mock-title { display: flex; align-items: center; gap: .5rem; font: 700 1.2rem/1.2 var(--font-display); color: var(--primary-dark); margin: 0; }
.mock-title .icon { color: var(--primary); }
.mock-field { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .75rem; min-height: 56px; }
.mock-field small { display: block; font-size: .7rem; font-weight: 600; color: var(--text-muted); }
.mock-field span { font-weight: 700; letter-spacing: .05em; color: var(--primary-dark); }
.typing::after { content: "|"; margin-left: 1px; color: var(--action); animation: blink 1s steps(1) infinite; }
.mock-result {
  display: flex; align-items: center; gap: .75rem; padding: .85rem; border-radius: var(--radius);
  background: var(--primary-light); border: 1px solid #C9D8EE;
  animation: mock-pop 7s var(--ease) infinite;
}
.mock-result > .icon { width: 2rem; height: 2rem; color: var(--primary); }
.mock-result strong { display: block; font-size: .95rem; color: var(--primary-dark); }
.mock-result small { color: var(--text-muted); font-size: .78rem; }
.mock-badge { margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: .2rem .55rem; }
.mock-badge .icon { width: .9rem; height: .9rem; }
.mock-download { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem; border-radius: var(--radius-sm); background: var(--action); color: #fff; font-weight: 700; animation: mock-pop 7s var(--ease) infinite; animation-delay: .15s; }
.mock-note { text-align: right; font-size: .75rem; color: #7F95B8; margin: .75rem .25rem 0; }

/* ---------- 11. Acreditación y datos ---------- */
.accred-grid { display: grid; gap: 2.5rem; align-items: start; }
.certificate { margin: 0; max-width: 460px; justify-self: center; }
.certificate a { position: relative; display: block; border-radius: var(--radius-sm); box-shadow: 0 2px 4px rgba(10,30,63,.08), 0 18px 40px rgba(10,30,63,.14); overflow: hidden; }
.certificate img { width: 100%; transition: transform .5s var(--ease); }
.certificate a:hover img { transform: scale(1.015); }
.zoom-hint { position: absolute; right: .75rem; bottom: .75rem; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(10,30,63,.85); color: #fff; font-size: .78rem; font-weight: 600; }
.certificate figcaption { font-size: var(--fs-sm); color: var(--text-muted); margin-top: .85rem; text-align: center; }
.accred-copy > p { max-width: 62ch; }
.ficha-full { margin: 1.75rem 0 1.25rem; box-shadow: none; border: 1px solid var(--line); border-top: 4px solid var(--primary); }
.ficha-full dl > div { flex-direction: column; gap: .15rem; }
.ficha-full dd { text-align: left; }
.note { font-size: var(--fs-sm); color: var(--text-muted); border-left: 3px solid var(--primary-light); padding-left: .85rem; margin: 1.5rem 0; }

.accred-teaser { display: grid; gap: 2.5rem; align-items: center; }
.certificate-thumb { margin: 0; max-width: 300px; justify-self: center; transform: rotate(-3deg); transition: transform .5s var(--ease); }
.certificate-thumb:hover { transform: rotate(0) scale(1.02); }
.certificate-thumb img { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }

.pillars { display: grid; gap: 1.25rem; }
.pillars article { background: #fff; border-radius: var(--radius); padding: 1.75rem 1.5rem; border-top: 4px solid var(--primary); transition: transform .3s var(--ease), box-shadow .3s; }
.pillars article:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pillars .icon-lg { color: var(--primary); margin-bottom: 1rem; }
.pillars p { margin: 0; color: var(--text-muted); }

.verify-teaser { display: grid; gap: 1.25rem; align-items: center; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border-radius: var(--radius-lg); background: var(--primary-light); border: 1px solid #C9D8EE; }
.verify-teaser h2 { font-size: 1.75rem; margin-bottom: .35rem; }
.verify-teaser p { margin: 0; color: var(--text-muted); }
.verify-teaser-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--radius); background: var(--primary-dark); color: #fff; }
.verify-teaser-icon .icon { width: 34px; height: 34px; }

.facts { background: var(--primary-dark); color: #fff; padding-block: 2.75rem; }
.facts-list { display: grid; gap: 1.5rem; }
.facts-list li { border-top: 1px solid rgba(255,255,255,.18); padding-top: 1rem; }
.facts-list strong { display: block; font: 700 clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem)/1.05 var(--font-display); letter-spacing: -0.01em; }
.facts-list span { color: #B9CCEA; font-size: var(--fs-sm); }

/* ---------- 12. Proyectos, galería y visor ---------- */
.projects { display: grid; gap: 1.5rem; }
.project { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .3s, transform .3s var(--ease); }
.project:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.project .media { aspect-ratio: 2 / 1; }
.project-body { padding: 1.25rem 1.4rem 1.4rem; }
.project-type { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-sm); font-weight: 700; color: var(--primary); margin-bottom: .3rem; }
.project-body h3 { margin-bottom: .3rem; }
.project-body > p:not(.project-type):not(.related) { margin-bottom: .75rem; color: var(--text-muted); }
.gallery-title { margin-top: 3rem; font-size: 1.6rem; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); background: var(--gray); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.empty-note { display: grid; gap: 1rem; align-items: center; margin-top: 2.5rem; padding: 1.5rem; border: 1.5px dashed #B7C8E2; border-radius: var(--radius-lg); }
.empty-note .icon-lg { color: var(--primary); }
.empty-note h3 { margin-bottom: .25rem; }
.empty-note p { margin: 0; color: var(--text-muted); }

.lightbox {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.5rem;
  background: rgba(6,20,43,.92); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(100%, 1100px); max-height: 85vh; width: auto; border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0,0,0,.5); transform: scale(.96); transition: transform .3s var(--ease); }
.lightbox.is-open img { transform: none; }
.lightbox-close, .lightbox-nav {
  position: absolute; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 1rem; } .lightbox-prev .icon { transform: rotate(180deg); }
.lightbox-next { right: 1rem; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.25); }

/* ---------- 13. Proceso y línea de tiempo ---------- */
.steps { display: grid; counter-reset: paso; }
.steps li { counter-increment: paso; position: relative; padding: 0 0 1.75rem 3.75rem; }
.steps li::before {
  content: counter(paso); position: absolute; left: 0; top: -.2rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.15rem/1 var(--font-display); background: #fff; color: var(--primary); border: 1.5px solid var(--primary);
  transition: background-color .3s, color .3s;
}
.steps li:hover::before { background: var(--primary); color: #fff; }
.steps li::after { content: ""; position: absolute; left: 1.3rem; top: 2.6rem; bottom: .2rem; width: 1.5px; background: #C7D3E4; }
.steps li:last-child::after { display: none; }
.steps li:last-child { padding-bottom: 0; }
.steps h3 { font-size: 1.25rem; margin-bottom: .25rem; }
.steps p { margin: 0; color: var(--text-muted); }

.timeline { position: relative; display: grid; gap: 1.25rem; }
.timeline::before { content: ""; position: absolute; left: 2.25rem; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(var(--primary), #C7D3E4); }
.timeline li { position: relative; display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem; align-items: start; }
.timeline-year {
  position: relative; z-index: 1; display: grid; place-items: center; min-height: 4.5rem; padding: .5rem;
  border-radius: 50%; aspect-ratio: 1; background: var(--primary-dark); color: #fff; text-align: center;
  font: 700 1.05rem/1 var(--font-display); box-shadow: 0 0 0 6px var(--gray);
}
.timeline li > div { background: #fff; border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.timeline h3 { margin-bottom: .3rem; }
.timeline p { margin: 0; color: var(--text-muted); }

/* ---------- 14. CTA ---------- */
.cta {
  color: #fff; padding-block: clamp(3.5rem, 3rem + 3vw, 5.5rem);
  background-color: var(--primary);
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(var(--primary), var(--primary));
  background-size: 32px 32px, 32px 32px, 100% 100%;
}
.cta-inner { display: grid; gap: 1.75rem; }
.cta h2 { color: #fff; margin-bottom: .5rem; }
.cta p { color: #D3E0F4; font-size: var(--fs-md); max-width: 54ch; margin: 0; }

/* ---------- 15. Detalle de servicio ---------- */
.service-detail { display: grid; gap: 2.5rem; }
.service-main { display: grid; gap: 2.5rem; min-width: 0; }
.service-main h2 { font-size: 1.85rem; }
.when-list { display: grid; gap: .75rem; }
.when-list li { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.1rem; background: var(--gray); border-radius: var(--radius); }
.when-list .icon { color: var(--ok); margin-top: .15rem; }
.flow { display: grid; gap: 1rem; counter-reset: flow; }
.flow li {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.flow h3 { font-size: 1.2rem; margin-bottom: .2rem; }
.flow p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.flow-n { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--primary-light); color: var(--primary); font: 700 1.1rem/1 var(--font-display); }
.js .reveal .flow li { opacity: 0; transform: translateX(-10px); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i) * 110ms + 150ms); }
.js .reveal.is-visible .flow li { opacity: 1; transform: none; }

.service-aside { display: grid; gap: 1rem; align-content: start; }
.aside-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; display: grid; gap: .75rem; }
.aside-card p { margin: 0; }
.aside-title { display: flex; align-items: center; gap: .5rem; font: 700 1.2rem/1.2 var(--font-display); color: var(--primary-dark); }
.aside-dark { background: var(--primary-dark); border-color: var(--primary-dark); color: #C9D7EE; }
.aside-dark .aside-title { color: #fff; }
.aside-dark .aside-title .icon { color: #7DB0FF; }
.aside-dark .link { justify-self: start; }
.aside-ema { grid-template-columns: auto 1fr; align-items: center; background: var(--primary-light); border-color: #C9D8EE; }
.aside-ema .icon-lg { color: var(--ema); }
.aside-phone { display: inline-flex; align-items: center; gap: .5rem; justify-self: center; font-weight: 700; color: var(--primary-dark); text-decoration: none; }
.pager { display: grid; gap: 1rem; margin-top: 2.5rem; }
.pager a {
  display: grid; gap: .15rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line);
  font: 700 1.15rem/1.2 var(--font-display); color: var(--primary-dark); text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.pager a:hover { border-color: #B7C8E2; box-shadow: var(--shadow); }
.pager small { font: 600 .75rem/1 var(--font-body); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.pager a[rel="next"] { text-align: right; }

/* Nosotros y sectores */
.about-grid { display: grid; gap: 2.5rem; }
.about-intro h2 { max-width: 20ch; }
.about-points { display: grid; gap: 1rem; align-content: start; }
.about-points article { background: #fff; border-radius: var(--radius); padding: 1.35rem 1.4rem; border-left: 4px solid var(--primary); box-shadow: 0 1px 2px rgba(10,30,63,.05); }
.about-points h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.about-points p { margin: 0; color: var(--text-muted); }
.sectors-grid { display: grid; gap: 2.5rem; }
.obra-types { display: grid; gap: .75rem; margin-top: 1.5rem; }
.obra-types li { display: flex; align-items: center; gap: .85rem; background: #fff; border-radius: var(--radius); padding: 1rem 1.15rem; font: 700 1.2rem/1.2 var(--font-display); color: var(--primary-dark); }
.obra-types .icon { width: 1.9rem; height: 1.9rem; color: var(--primary); }
.profiles-title { margin-bottom: 1rem; }
.profiles dl { margin: 0; background: #fff; border-radius: var(--radius); padding: .5rem 1.35rem; }
.profiles dl > div { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.profiles dl > div:last-child { border-bottom: 0; }
.profiles dt { font-weight: 700; color: var(--primary-dark); margin-bottom: .2rem; }
.profiles dd { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* ---------- 16. Contacto y formularios ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 3rem; }
.contact-card {
  display: grid; gap: .2rem; justify-items: start; height: 100%;
  padding: 1.25rem; border-radius: var(--radius); background: var(--gray); color: var(--primary-dark); text-decoration: none;
  transition: background-color .2s, transform .25s var(--ease), box-shadow .25s;
}
a.contact-card:hover { background: var(--primary-dark); color: #fff; transform: translateY(-3px); box-shadow: var(--shadow); }
a.contact-card:hover .icon { color: #7DB0FF; }
.contact-card .icon-lg { color: var(--primary); margin-bottom: .5rem; transition: color .2s; }
.contact-card strong { font: 700 1.1rem/1.2 var(--font-display); }
.contact-card span { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.contact-card-wa .icon-lg { color: var(--whatsapp-hover); }
.contact-grid { display: grid; gap: 2.5rem; align-items: start; }
.contact-list { display: grid; gap: 1.1rem; margin: 1rem 0 1.5rem; }
.contact-list li { display: flex; gap: .9rem; align-items: flex-start; }
.contact-list .icon { width: 1.5rem; height: 1.5rem; color: var(--primary); margin-top: .15rem; }
.contact-list strong { display: block; font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.contact-list address { color: var(--primary-dark); font-weight: 600; }
.contact-list .small { display: block; color: var(--text-muted); margin-top: .2rem; }
.contact-results { margin-top: 1.5rem; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 1rem; aspect-ratio: 16 / 10; background: var(--gray); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

.form-card { background: var(--gray); border-radius: var(--radius-lg); padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); border-top: 4px solid var(--primary); scroll-margin-top: calc(var(--header-h) + 16px); }
.form-card h2 { font-size: 1.75rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: 0 1rem; }
.field label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: .35rem; }
.field label span { color: var(--primary); }
.field input, .field select, .field textarea, .copy-field input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem .85rem; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,61,145,.15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.error { color: var(--error); font-size: .82rem; margin: .3rem 0 0; }
.error:empty { display: none; }
.hint { font-size: .8rem; color: var(--text-muted); margin: .35rem 0 0; }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: .25rem .6rem; align-items: start; }
.field-check input { width: 20px; height: 20px; min-height: 0; margin: .15rem 0 0; accent-color: var(--primary); }
.field-check label { font-weight: 500; margin: 0; }
.field-check .error { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.form-status { margin: 1rem 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--primary-dark); }
.form-status:empty { display: none; }

/* ---------- 17. Footer y WhatsApp ---------- */
.site-footer { background: var(--primary-deep); color: #B9CCEA; padding-top: 3.5rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.5rem; }
.logo-pill { display: inline-block; background: #fff; border-radius: 999px; padding: .75rem 1.5rem; }
.logo-pill img { width: 140px; }
.footer-brand p { margin-top: 1rem; max-width: 36ch; }
.footer-results { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); font-weight: 600; }
.site-footer h2 { font: 700 1.05rem/1.2 var(--font-display); color: #fff; margin-bottom: .9rem; letter-spacing: .01em; }
.site-footer ul { display: grid; gap: .45rem; }
.site-footer a { color: #DCE6F6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.4rem 5.5rem; font-size: var(--fs-sm);
}
.footer-bottom p { margin: 0; }

.wa-float {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--whatsapp); color: #fff; box-shadow: 0 6px 20px rgba(6,20,43,.25);
  transition: transform .25s var(--ease), background-color .2s;
}
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--whatsapp); animation: pulse 2.8s var(--ease) infinite; }
.wa-float .icon { width: 30px; height: 30px; }
.wa-float:hover { transform: scale(1.06); background: var(--whatsapp-hover); }

/* Páginas legales y 404 */
.legal { padding-block: 3rem 4rem; }
.legal .container { max-width: 780px; }
.legal h1 { font-size: var(--fs-xl); }
.legal h2 { font-size: 1.3rem; margin-top: 2.2rem; }
.legal p, .legal li { color: #2B3750; }
.legal ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1em; }
.legal .back { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; }
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.notfound .btn-row { justify-content: center; }
.notfound-code { font: 700 clamp(5rem, 4rem + 6vw, 9rem)/1 var(--font-display); color: var(--primary-light); -webkit-text-stroke: 2px var(--primary); margin-bottom: .5rem; }

/* ---------- 18. Portal de resultados ---------- */
.portal-grid { display: grid; gap: 2rem; align-items: start; }
.portal-main { display: grid; gap: 1.5rem; min-width: 0; }
.portal-aside { display: grid; gap: 1rem; }
.access-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); box-shadow: var(--shadow); }
.access-card h2 { font-size: 1.6rem; display: flex; align-items: center; gap: .5rem; }
.access-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .35rem; margin: calc(-1 * clamp(.5rem, .25rem + .5vw, .9rem)) calc(-1 * clamp(.5rem, .25rem + .5vw, .9rem)) 1.5rem; background: var(--gray); border-radius: var(--radius); }
.access-tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px;
  font: 700 .95rem/1 var(--font-body); color: var(--text-muted); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.access-tabs button[aria-selected="true"] { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(10,30,63,.12); }
.access-panel:not([hidden]) { animation: panel-in .35s var(--ease); }
.portal-form .btn-block { margin-top: .5rem; }
.form-foot { text-align: center; font-size: var(--fs-sm); margin: 1rem 0 0; }
.input-reveal { position: relative; }
.input-reveal input { padding-right: 3.25rem; }
.reveal-btn { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); }
.reveal-btn:hover, .reveal-btn[aria-pressed="true"] { color: var(--primary); background: var(--primary-light); }
#r-folio, #r-clave, #v-folio { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
#r-folio::placeholder, #r-clave::placeholder, #v-folio::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }

.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius); font-size: .95rem; border: 1px solid; }
.alert p { margin: 0; }
.alert .icon { margin-top: .1rem; }
.alert-error { background: var(--error-bg); border-color: #FECDCA; color: var(--error); }
.alert-ok { background: var(--ok-bg); border-color: #ABEFC6; color: var(--ok); }
.alert-info { background: var(--primary-light); border-color: #C9D8EE; color: var(--primary-dark); }
.alert-warn { background: var(--warn-bg); border-color: #FEDF89; color: var(--warn); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; font: 700 .75rem/1.2 var(--font-body); white-space: nowrap; vertical-align: middle; }
.badge .icon { width: .95rem; height: .95rem; }
.badge-vigente { background: var(--ok-bg); color: var(--ok); }
.badge-sustituido { background: var(--warn-bg); color: var(--warn); }
.badge-anulado { background: var(--error-bg); color: var(--error); }

.report-card { background: #fff; border-radius: var(--radius-lg); border-top: 5px solid var(--primary); box-shadow: var(--shadow-lg); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); display: grid; gap: 1.25rem; animation: panel-in .5s var(--ease); }
.report-card-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.report-card-head > .icon { color: var(--primary); }
.report-card-head h2 { margin: 0; font-size: 1.9rem; }
.report-card-head .badge { margin-left: auto; }
.report-kicker { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.report-kicker a { color: inherit; }
.report-data { margin: 0; display: grid; }
.report-data > div { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.report-data > div:last-child { border-bottom: 0; }
.report-data dt { color: var(--text-muted); }
.report-data dd { margin: 0; font-weight: 700; color: var(--primary-dark); min-width: 0; }
.report-data-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1.25rem; margin-bottom: 1rem; }
.report-expire { display: flex; align-items: center; gap: .4rem; margin: 0; }

.faq { display: grid; gap: .75rem; max-width: 860px; }
.faq details { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; font-weight: 700; color: var(--primary-dark); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.4rem/1 var(--font-display); color: var(--primary); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 1.25rem 1.2rem; color: var(--text-muted); }

.verify-result { display: flex; gap: 1rem; align-items: flex-start; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); border-radius: var(--radius-lg); border: 1.5px solid; animation: panel-in .5s var(--ease); }
.verify-result h2 { font-size: 1.6rem; margin-bottom: .4rem; }
.verify-result > div { flex: 1; min-width: 0; }
.verify-result .report-data { margin-top: 1rem; background: rgba(255,255,255,.7); border-radius: var(--radius); padding: .25rem 1rem; }
.verify-ok { background: var(--ok-bg); border-color: #ABEFC6; }
.verify-ok > .icon { color: var(--ok); }
.verify-warn { background: var(--warn-bg); border-color: #FEDF89; }
.verify-warn > .icon { color: var(--warn); }
.verify-bad { background: var(--error-bg); border-color: #FECDCA; }
.verify-bad > .icon { color: var(--error); }
.verify-tools { display: grid; gap: 1.25rem; }
.verify-form h2 { font-size: 1.3rem; }

.dropzone {
  display: grid; justify-items: center; gap: .5rem; text-align: center; cursor: pointer;
  padding: 1.75rem 1rem; border: 2px dashed #B7C8E2; border-radius: var(--radius); background: var(--primary-light);
  color: var(--text-muted); transition: border-color .2s, background-color .2s;
}
.dropzone .icon-lg { color: var(--primary); }
.dropzone strong { color: var(--primary-dark); }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: #E2EBF8; }
.dropzone:focus-within { outline: 3px solid var(--primary-mid); outline-offset: 2px; }
.dropzone small { font-weight: 600; color: var(--primary-dark); overflow-wrap: anywhere; }
.dropzone-sm { padding: 1.25rem 1rem; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }

/* ---------- 19. Área de clientes y tablas ---------- */
.client-bar { background: var(--primary-light); border-bottom: 1px solid #C9D8EE; }
.client-bar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding-block: .75rem; }
.client-who { display: flex; align-items: center; gap: .75rem; }
.client-who strong { display: block; color: var(--primary-dark); line-height: 1.2; }
.client-who small { color: var(--text-muted); }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-dark); color: #fff; font: 700 1.1rem/1 var(--font-display); flex: none; }
.client-bar nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.client-bar nav a, .client-bar nav button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .4rem .8rem; border-radius: var(--radius-sm);
  font: 600 var(--fs-sm)/1 var(--font-body); color: var(--primary-dark); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.client-bar nav a:hover, .client-bar nav button:hover { background: #fff; }
.client-bar nav a[aria-current="page"] { background: var(--primary-dark); color: #fff; }

.portal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.75rem; }
.portal-head h1 { font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem); margin-bottom: .25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.portal-head p { margin: 0; }
.mini-stats { display: flex; flex-wrap: wrap; gap: .75rem; }
.mini-stats li, .stat-cards li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1.1rem; min-width: 120px; }
.mini-stats strong, .stat-cards strong { display: block; font: 700 1.5rem/1.1 var(--font-display); color: var(--primary-dark); }
.mini-stats span, .stat-cards span { font-size: .8rem; color: var(--text-muted); }
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.75rem; }
.stat-cards strong { font-size: 2rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.25rem; }
.toolbar .field { margin: 0; flex: 0 1 auto; }
.toolbar .field-search { flex: 1 1 260px; position: relative; }
.field-search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field-search input { padding-left: 2.6rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th { text-align: left; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); background: var(--gray); padding: .75rem 1rem; white-space: nowrap; }
.data-table td { padding: .85rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { transition: background-color .15s; }
.data-table tbody tr:hover { background: #FAFBFD; }
.data-table a { font-weight: 700; color: var(--primary-dark); }
.data-table .is-muted td { opacity: .6; }
.data-table .is-alert td { background: var(--error-bg); color: var(--error); }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions form { display: inline; }
.td-actions .btn { vertical-align: middle; }
.data-table-compact td, .data-table-compact th { padding: .6rem .8rem; }

.pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 1.5rem; }
.pagination a { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.pagination a[aria-current="page"] { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.empty-state { text-align: center; padding: 3rem 1.5rem; border: 1.5px dashed #B7C8E2; border-radius: var(--radius-lg); background: #fff; }
.empty-state .icon-lg { color: var(--primary); margin: 0 auto 1rem; }
.empty-state h1, .empty-state h2 { font-size: 1.6rem; }
.narrow-grid { display: grid; gap: 2rem; align-items: start; }

/* ---------- 20. Panel interno ---------- */
body.admin { background: var(--gray); }
.admin-header { background: var(--primary-deep); color: #C9D7EE; position: sticky; top: 0; z-index: 50; }
.admin-header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .75rem 1.25rem; max-width: 1400px; margin: 0 auto; }
.admin-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; font-weight: 700; font-size: .9rem; }
.admin-brand img { width: 110px; background: #fff; padding: .45rem .7rem; border-radius: 999px; box-sizing: content-box; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.admin-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: var(--radius-sm); color: #C9D7EE; text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
.admin-user { display: flex; align-items: center; gap: .75rem; font-size: var(--fs-sm); }
.admin-user span { text-align: right; color: #fff; font-weight: 600; line-height: 1.2; }
.admin-user small { display: block; color: #9FB3D4; font-weight: 500; }
.admin-main { padding: 2rem 0 4rem; }
.admin-container { width: min(100% - 2.5rem, 1400px); margin: 0 auto; display: grid; gap: 1.25rem; }
.admin-login { display: grid; place-items: center; min-height: 60vh; }
.admin-login form { width: min(100%, 440px); }
.admin-split { display: grid; gap: 1.25rem; align-items: start; }
.admin-stack { display: grid; gap: 1.25rem; min-width: 0; }
.admin .access-card { box-shadow: none; }
.admin .access-card h2 { font-size: 1.35rem; }
.inline-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.qr-card { display: grid; gap: .75rem; justify-items: start; }
.qr-box { width: 180px; height: 180px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.qr-box img, .qr-box svg { width: 100%; height: auto; image-rendering: pixelated; }
.qr-url { margin: 0; overflow-wrap: anywhere; }
.qr-steps { list-style: decimal; padding-left: 1.2rem; display: grid; gap: .25rem; margin: .5rem 0 0; }
.code-reveal { background: #fff; border: 2px solid var(--primary); border-radius: var(--radius-lg); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); display: grid; gap: 1.25rem; animation: panel-in .5s var(--ease); }
.code-reveal-sm { border-width: 1.5px; }
.code-reveal-head { display: flex; gap: 1rem; align-items: flex-start; }
.code-reveal-head .icon-lg { color: var(--primary); }
.code-reveal-head h2 { margin-bottom: .25rem; }
.code-reveal-head p { margin: 0; color: var(--text-muted); }
.print-slip { border: 1px dashed #B7C8E2; border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: 560px; }
.slip-logo { width: 130px; margin-bottom: .75rem; }
.slip-title { font: 700 1.1rem/1.2 var(--font-display); color: var(--primary-dark); }
.print-slip dl { margin: 0 0 .75rem; }
.print-slip dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.print-slip dt { color: var(--text-muted); }
.print-slip dd { margin: 0; font-weight: 700; color: var(--primary-dark); text-align: right; }
.code-big { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.5rem; letter-spacing: .12em; color: var(--primary) !important; }
.slip-how { font-size: .85rem; color: var(--text-muted); margin: 0; }
.copy-field { display: flex; flex-wrap: wrap; gap: .5rem; }
.copy-field input { flex: 1 1 280px; min-height: 42px; font-size: .85rem; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--error); }
.danger-zone[open] summary { margin-bottom: .75rem; }

/* ---------- 21. Animaciones ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Entrada escalonada de tarjetas dentro de una cuadrícula */
.js .reveal.services > *, .js .reveal.projects > *, .js .reveal.problems > *, .js .reveal.pillars > * {
  opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-visible.services > *, .js .reveal.is-visible.projects > *, .js .reveal.is-visible.problems > *, .js .reveal.is-visible.pillars > * { opacity: 1; transform: none; }
.js .reveal.is-visible > :nth-child(2) { transition-delay: .08s; }
.js .reveal.is-visible > :nth-child(3) { transition-delay: .16s; }
.js .reveal.is-visible > :nth-child(4) { transition-delay: .24s; }
.js .reveal.is-visible > :nth-child(5) { transition-delay: .32s; }
.js .reveal.is-visible > :nth-child(6) { transition-delay: .40s; }
.js .reveal.is-visible > :nth-child(7) { transition-delay: .48s; }
.js .reveal.is-visible > :nth-child(n+8) { transition-delay: .56s; }
.js .reveal.is-visible.reveal-done > * { transition-delay: 0s; } /* sin retraso en el hover después de la entrada */

@keyframes scan { 0%, 100% { top: 14px; opacity: 0; } 8% { opacity: 1; } 50% { top: calc(100% - 2px); opacity: 1; } 58% { opacity: 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
@keyframes mock-pop { 0%, 35% { opacity: 0; transform: translateY(6px); } 45%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .js .reveal, .js .reveal > *, .js .reveal .flow li { opacity: 1 !important; transform: none !important; }
  .scan-line, .wa-float::before { display: none; }
  .mock-result, .mock-download { animation: none; }
  .mock-window { transform: none; }
}

/* ---------- 22. Breakpoints ---------- */
@media (max-width: 639px) {
  /* Tablas como tarjetas en móvil */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: .75rem 1rem; border-top: 1px solid var(--line); }
  .data-table tr:first-child { border-top: 0; }
  .data-table td { border: 0; padding: .2rem 0; display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; }
  .data-table td[data-label]::before { content: attr(data-label); font-size: .78rem; color: var(--text-muted); font-weight: 600; }
  .data-table td.td-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-start; padding-top: .6rem; }
  .table-wrap { overflow: visible; }
  .report-data > div { grid-template-columns: 1fr; gap: .1rem; }
}

@media (min-width: 640px) {
  .trust-list { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; }
  .trust-list li:nth-last-child(2) { border-bottom: 0; }
  .problems { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .facts-list { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .ficha-full dl > div { flex-direction: row; }
  .ficha-full dd { text-align: right; }
  .ficha-hero { position: absolute; right: -.5rem; bottom: -3rem; margin: 0; width: min(330px, 62%); }
  .hero-visual { margin-bottom: 3rem; }
  .solver-services { grid-template-columns: repeat(2, 1fr); }
  .mini-service { grid-template-columns: 1fr; align-items: stretch; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .verify-teaser { grid-template-columns: auto 1fr auto; }
  .contact-cards { grid-template-columns: repeat(4, 1fr); }
  .pager { grid-template-columns: 1fr 1fr; }
  .empty-note { grid-template-columns: auto 1fr auto; }
  .stat-cards { grid-template-columns: repeat(4, 1fr); }
  .verify-tools { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 2.75rem; }
  .timeline li { grid-template-columns: 5.5rem 1fr; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 3.5rem; }
  .hero-visual { margin-bottom: 2.5rem; }
  .trust-list { grid-template-columns: repeat(4, 1fr); }
  .trust-list li { border-bottom: 0; padding: 1.5rem 0; }
  .problems { grid-template-columns: repeat(3, 1fr); }
  .services { grid-template-columns: repeat(3, 1fr); }
  .service-help { grid-column: span var(--help-span, 2); }
  .service-help .service-body { justify-content: center; padding: 2rem 2.25rem; }
  .service-help p { max-width: 52ch; }
  .service-help .btn { margin-top: .5rem; }
  .solver { grid-template-columns: 330px 1fr; gap: 1.5rem; align-items: start; }
  .solver-list { flex-direction: column; overflow: visible; }
  .solver-tab { width: 100%; }
  .results-grid { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
  .accred-teaser { grid-template-columns: .7fr 1.3fr; gap: 4rem; }
  .sectors-grid { grid-template-columns: .85fr 1.15fr; gap: 4rem; align-items: start; }
  .accred-grid { grid-template-columns: .8fr 1.2fr; gap: 4rem; }
  .certificate { position: sticky; top: calc(var(--header-h) + 24px); }
  .about-grid { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
  .facts-list { grid-template-columns: repeat(4, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
  .steps li { padding: 3.75rem 0 0; }
  .steps li::after { left: 3.2rem; right: -1.1rem; top: 1.3rem; bottom: auto; width: auto; height: 1.5px; }
  .cta-inner { grid-template-columns: 1fr auto; align-items: center; gap: 3rem; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr 1.4fr; gap: 2.5rem; }
  .footer-bottom { padding-bottom: 1.6rem; }
  .service-detail { grid-template-columns: minmax(0, 1fr) 340px; gap: 3.5rem; align-items: start; }
  .service-aside { position: sticky; top: calc(var(--header-h) + 24px); }
  .portal-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 3rem; }
  .narrow-grid { grid-template-columns: 1fr 420px; gap: 3rem; }
  .admin-split { grid-template-columns: minmax(0, 1fr) 360px; }
  .admin-split-wide { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* Escritorio: menú horizontal con submenú */
@media (min-width: 1140px) {
  :root { --header-h: 76px; }
  .brand img { width: 150px; }
  .menu-toggle, .only-mobile { display: none; }
  .only-mobile-flex { display: none; }
  .site-header { background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(8px); -webkit-backdrop-filter: saturate(160%) blur(8px); }
  .main-nav {
    position: static; inset: auto; height: auto; transform: none; opacity: 1; visibility: visible;
    background: none; padding: 0; overflow: visible;
    display: flex; align-items: center; gap: 1.5rem;
  }
  .nav-list { display: flex; gap: 1.2rem; align-items: center; }
  .nav-list > li { border: 0; display: flex; align-items: center; }
  .nav-list > li.only-mobile { display: none; } /* el logo ya lleva al inicio */
  .nav-list > li > a {
    padding: .4rem 0; position: relative; white-space: nowrap;
    font: 600 .9rem/1.2 var(--font-body); color: var(--text);
  }
  .nav-list > li > a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
    background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
  }
  .nav-list > li > a:hover, .nav-list > li > a[aria-current="page"] { color: var(--primary); }
  .nav-list > li > a:hover::after, .nav-list > li > a[aria-current="page"]::after { transform: scaleX(1); }
  .sub-toggle { position: static; width: 26px; height: 26px; margin-left: .1rem; background: none; }
  .sub-toggle .icon { width: 16px; height: 16px; }
  .sub-menu {
    display: block; position: absolute; top: calc(100% + 18px); left: -1.5rem; width: 560px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1rem; opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s, transform .25s var(--ease), visibility .2s;
  }
  .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -20px; height: 20px; } /* puente para el hover */
  .has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu, .has-sub.is-open .sub-menu { opacity: 1; visibility: visible; transform: none; }
  .sub-menu ul { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; }
  .sub-menu a { padding: .55rem .6rem; border-radius: var(--radius-sm); font-size: .92rem; }
  .sub-menu ul a:hover { background: var(--primary-light); }
  .sub-all { margin-top: .5rem; padding-top: .85rem !important; border-top: 1px solid var(--line); border-radius: 0 !important; }
  .nav-actions { display: flex; margin: 0; gap: .5rem; }
  .ficha-hero { right: -1.5rem; bottom: -2.5rem; }
  .services-catalog { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 23. Impresión (comprobante de acceso) ---------- */
@media print {
  body.admin * { visibility: hidden; }
  body.admin .print-slip, body.admin .print-slip * { visibility: visible; }
  body.admin .print-slip { position: absolute; left: 0; top: 0; border: 1px solid #999; }
  .site-header, .site-footer, .wa-float { display: none !important; }
}

/* =================================================================
   24. Imágenes pendientes (marcadores identificados)
   ================================================================= */
.img-pending {
  display: grid; place-items: center; margin: 0; padding: 1.5rem; text-align: center;
  background: repeating-linear-gradient(135deg, var(--gray) 0 14px, #E3E6E9 14px 28px);
  border: 1px dashed #8E98A3; color: var(--text-muted);
}
.img-pending figcaption { display: grid; gap: .35rem; max-width: 48ch; font-size: var(--fs-sm); }
.img-pending strong { color: var(--primary-dark); font-size: .95rem; }
.img-pending code { font-size: .74rem; color: var(--primary); word-break: break-all; }

/* =================================================================
   25. Galería (hoja de contactos)
   ================================================================= */
.gallery-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.gallery-bar .filters { margin: 0; }
.gallery-count { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 6px; }
.photo { position: relative; display: block; margin: 0; overflow: hidden; background: var(--primary-dark); color: #fff; text-decoration: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.photo:hover img, .photo:focus-visible img { transform: scale(1.03); }
.photo-wide { grid-column: span 2; }
.photo-tall { grid-row: span 2; }
.photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem .9rem .75rem;
  font-size: .8rem; font-weight: 600; line-height: 1.35;
  background: linear-gradient(transparent, rgba(6,23,58,.88)); /* velo para legibilidad del pie */
}
.photo-pending {
  display: grid; place-items: center; padding: 1rem; text-align: center; color: var(--text-muted);
  background: repeating-linear-gradient(135deg, var(--gray) 0 14px, #E3E6E9 14px 28px);
  border: 1px dashed #8E98A3;
}
.photo-pending figcaption { display: grid; gap: .3rem; font-size: .78rem; line-height: 1.4; }
.photo-pending strong { color: var(--primary-dark); font-size: .85rem; }
.photo-pending code { font-size: .7rem; color: var(--primary); }
.gallery-note { margin-top: 2rem; }
@media (min-width: 768px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; }
}
@media (min-width: 1140px) {
  .photo-grid { grid-auto-rows: 220px; gap: 8px; }
  .photo-caption { transform: translateY(100%); transition: transform .3s var(--ease); }
  .photo:hover .photo-caption, .photo:focus-visible .photo-caption { transform: none; }
}

/* =================================================================
   26. TESTCO Aprende
   ================================================================= */
/* Colores de cada línea editorial */
.tone-concreto { --tone: #7C8792; --tone-bg: var(--concrete); --tone-ink: var(--primary-dark); --tone-text: #56606B; }
.tone-ema      { --tone: var(--ema); --tone-bg: var(--ema); --tone-ink: var(--primary-deep); --tone-text: var(--ema-dark); }
.tone-azul     { --tone: var(--primary); --tone-bg: var(--primary); --tone-ink: #fff; --tone-text: var(--primary); }

/* Avatares (circulares: son caras) */
.avatar { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
/* Avatar ilustrado (PNG/WebP transparente) sobre un tinte suave de su línea editorial */
.tone-concreto { --tone-soft: #D9DDE1; }
.tone-ema      { --tone-soft: #C4EBD0; }
.tone-azul     { --tone-soft: #CCD8EE; }
.avatar-img { background: var(--tone-soft, var(--gray)); }
.avatar-ph { background: var(--tone-bg); color: var(--tone-ink); font: 800 .78rem/1 var(--font-display); letter-spacing: .02em; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.avatar-lg { width: 76px; height: 76px; font-size: .95rem; }
.avatar-sm { width: 42px; height: 42px; font-size: .62rem; }
.avatar-xs { width: 26px; height: 26px; font-size: .46rem; }

/* Portada con buscador */
.aprende-hero h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.8rem); letter-spacing: -.02em; }
.search {
  display: flex; align-items: center; gap: .5rem; max-width: 680px; margin-top: 2rem;
  padding: .35rem .35rem .35rem 1rem; background: #fff; border-radius: var(--radius-sm);
}
.search:focus-within { outline: 3px solid var(--primary-mid); outline-offset: 2px; }
.search > .icon { color: var(--text-muted); }
.search input { flex: 1; min-width: 0; padding: .75rem .25rem; border: 0; background: none; font: 500 1rem var(--font-body); color: var(--text); }
.search input:focus { outline: none; }

/* Guías */
.guides-title { font-size: var(--fs-lg); margin-bottom: 1.5rem; }
.guides { display: grid; border-top: 1px solid var(--line); }
.guide { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.guide::before { content: ""; position: absolute; left: 0; top: -1px; width: 64px; height: 3px; background: var(--tone); }
.guide-name { font: 800 1.35rem/1.1 var(--font-display); color: var(--primary-dark); margin: 0 0 .2rem; }
.guide-line { font-weight: 700; font-size: var(--fs-sm); color: var(--tone-text); margin: 0 0 .6rem; }
.guide-text { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
.guide-question { margin: .9rem 0 1rem; font-style: italic; font-weight: 500; color: var(--primary-dark); }
@media (min-width: 900px) {
  .guides { grid-template-columns: repeat(3, 1fr); column-gap: 2.5rem; border-top: 0; }
  .guide { grid-template-columns: 1fr; border-top: 1px solid var(--line); border-bottom: 0; }
}

/* Lista de artículos: fichas técnicas */
.art-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 2rem; }
.art-head h2 { margin: 0; }
.cat-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-nav .chip { text-decoration: none; }
.chip-concreto:not(.is-active) { box-shadow: inset 3px 0 0 #7C8792; }
.chip-ema:not(.is-active) { box-shadow: inset 3px 0 0 var(--ema); }
.chip-azul:not(.is-active) { box-shadow: inset 3px 0 0 var(--primary); }
.art-list { display: grid; gap: 1.5rem; }
.art-list:empty { display: none; }
.ficha-art { position: relative; display: grid; background: #fff; border-left: 4px solid var(--tone); }
.ficha-art[hidden] { display: none; }
.ficha-art-media { display: block; overflow: hidden; background: var(--primary-dark); }
.ficha-art-media img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .6s var(--ease); }
.ficha-art:hover .ficha-art-media img { transform: scale(1.03); }
.ficha-art-body { padding: 1.5rem; }
.ficha-art h3 { font-size: var(--fs-lg); line-height: 1.2; margin: 0 0 .6rem; }
.ficha-art h3 a { color: var(--primary-dark); text-decoration: none; }
.ficha-art h3 a:hover { color: var(--primary); text-decoration: underline; }
.ficha-art-body > p { color: var(--text-muted); margin: 0 0 1.1rem; max-width: 62ch; }
.spec-strip { display: flex; flex-wrap: wrap; margin: 0 0 1.1rem; border-block: 1px solid var(--line); }
.spec-strip > div { padding: .55rem 1.1rem .55rem 0; margin-right: 1.1rem; border-right: 1px solid var(--line); }
.spec-strip > div:last-child { border-right: 0; margin-right: 0; }
.spec-strip dt { font-size: .72rem; font-weight: 500; color: var(--text-muted); }
.spec-strip dd { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; font-size: .88rem; color: var(--primary-dark); }
.art-empty { padding: 1.5rem; background: #fff; border: 1px dashed #8E98A3; }
.art-empty[hidden] { display: none; }
.art-empty p { margin: 0; }
@media (min-width: 768px) {
  .ficha-art { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .ficha-art-body { padding: 2rem 2.25rem; align-self: center; }
}

/* Próximos temas */
.upcoming { margin-top: 3rem; }
.upcoming-title { font-size: 1.05rem; margin-bottom: .75rem; color: var(--primary-dark); }
.upcoming ul { border-top: 2px solid var(--primary-dark); }
.upcoming li { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.upcoming-text { flex: 1; display: grid; gap: .1rem; }
.upcoming-text strong { color: var(--primary-dark); }
.upcoming-text small { color: var(--text-muted); font-size: .82rem; }
.upcoming-tag { flex: none; padding: .3rem .6rem; border: 1px solid var(--line); background: #fff; font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.upcoming > .link-arrow { margin-top: 1.5rem; }
@media (max-width: 520px) { .upcoming-tag { display: none; } }

/* =================================================================
   27. Artículo
   ================================================================= */
.article-header { position: relative; color: #fff; background-color: var(--primary-dark); background-image: var(--grid-dark); background-size: 32px 32px; padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(5rem, 4rem + 4vw, 7.5rem); }
.article-header::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tone); }
.article-cat { display: inline-block; margin-bottom: 1rem; padding: .3rem .7rem; background: var(--tone-bg); color: var(--tone-ink); font-weight: 700; font-size: .8rem; text-decoration: none; }
.article-header h1 { color: #fff; font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); letter-spacing: -.02em; line-height: 1.08; max-width: 20ch; margin-bottom: 1rem; }
.article-summary { color: #D3E0F4; font-size: var(--fs-md); max-width: 62ch; margin: 0 0 1.75rem; }
.article-header .spec-strip, .article-header .spec-strip > div { border-color: rgba(255,255,255,.2); }
.article-header .spec-strip dt { color: #A9C4EE; }
.article-header .spec-strip dd { color: #fff; }
.spec-strip-lg dd { font-size: .95rem; }

.article-cover { position: relative; margin: -4rem 0 0; }
.article-cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: 30% 50%; box-shadow: var(--shadow-lg); }

.article-layout { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.toc { border-top: 2px solid var(--primary-dark); padding-top: .75rem; }
.toc summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); padding: .25rem 0 .5rem; }
.toc ol { margin: .25rem 0 0; padding-left: 1.2rem; display: grid; gap: .45rem; font-size: var(--fs-sm); }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }
.guide-card { display: flex; align-items: center; gap: .85rem; margin-top: 1.75rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.guide-card p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.guide-card strong { display: block; color: var(--primary-dark); font-size: 1rem; }

/* Texto del artículo: medida de lectura de ~68 caracteres */
.prose { max-width: 68ch; font-size: 1.0625rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 1.2rem; margin-top: 2rem; color: var(--primary-dark); }
.prose h2 + p, .prose h3 + p { margin-top: .6rem; }
.prose p { margin-bottom: 0; }
.prose a { color: var(--primary); font-weight: 600; }
.article-lead { font-size: 1.2rem; line-height: 1.65; color: var(--primary-dark); font-weight: 500; }
.article-list { padding-left: 1.2rem; display: grid; gap: .5rem; }
.article-steps { counter-reset: paso; list-style: none; padding: 0; display: grid; gap: 1rem; }
.article-steps li { counter-increment: paso; position: relative; padding-left: 2.75rem; }
.article-steps li::before { content: counter(paso); position: absolute; left: 0; top: .2rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; background: var(--primary-dark); color: #fff; font-weight: 800; font-size: .85rem; }
.article-steps strong { display: block; color: var(--primary-dark); }
.article-figure { margin: 2.25rem 0; }
.article-figure img { width: 100%; }
.article-figure figcaption { margin-top: .6rem; font-size: var(--fs-sm); color: var(--text-muted); }
.article-figure-cert { max-width: 360px; }
.article-figure-cert img { border: 1px solid var(--line); }

/* Bloques técnicos destacados */
.tech-note { margin: 2.25rem 0; padding: 1.25rem 1.5rem; background: var(--gray); border-left: 4px solid var(--primary-dark); }
.tech-note-title { font-weight: 800; color: var(--primary-dark); margin: 0 0 .4rem; }
.tech-note-tess { border-left-color: var(--ema); background: #EEF7F1; }
.testco-box { margin: 2.5rem 0; padding: 1.5rem; color: #fff; background: var(--primary-dark); }
.testco-box-title { font-weight: 800; font-size: 1.1rem; margin: 0 0 1rem; padding-left: .8rem; border-left: 4px solid var(--ema); }
.testco-box dl { display: grid; margin: 0 0 1rem; font-size: .95rem; }
.testco-box dl div { display: grid; grid-template-columns: minmax(0, 11rem) 1fr; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.14); }
@media (max-width: 560px) { .testco-box dl div { grid-template-columns: 1fr; gap: .1rem; } }
.testco-box dt { color: #A9C4EE; }
.testco-box dd { margin: 0; font-weight: 600; }
.testco-box p { color: #D3E0F4; margin: 0; }
.prose .testco-box-links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: .9rem; }
.prose .testco-box a { color: #fff; }

.article-foot { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 2px solid var(--primary-dark); }
.prose .article-foot-title { font-size: 1rem; margin: 0 0 .75rem; padding: 0; border: 0; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; margin: 0 0 1.75rem; }
.prose .tags a, .tags a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border: 1px solid var(--line); background: #fff; font-size: .85rem; font-weight: 600; color: var(--primary-dark); text-decoration: none; }
.tags a:hover { border-color: var(--primary); color: var(--primary); }
.tags .icon { width: 18px; height: 18px; color: var(--primary); }
.rel-title { margin-bottom: 1.75rem; }

@media (min-width: 1024px) {
  .article-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 4rem; }
  .article-aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
}
@media (max-width: 1023px) {
  .article-cover { margin-top: -3rem; }
  .article-cover img { aspect-ratio: 16 / 9; }
}

/* =================================================================
   28. Asistente TESS
   ================================================================= */
.tess { position: fixed; z-index: 95; right: 1rem; bottom: calc(1rem + 56px + 12px); }
.tess[hidden] { display: none; }
.tess-card {
  position: relative; width: 340px; padding: 1.25rem 1.25rem 1.1rem; background: #fff; color: var(--text);
  border-top: 4px solid var(--ema); box-shadow: 0 18px 48px -10px rgba(6,23,58,.35);
}
.tess-close { position: absolute; top: .5rem; right: .5rem; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.tess-close:hover { color: var(--primary-dark); background: var(--gray); }
.tess-close .icon { width: 18px; height: 18px; }
.tess-head { display: flex; align-items: center; gap: .85rem; padding-right: 2rem; margin-bottom: .75rem; }
.tess-q { margin: 0; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.tess-title { margin: 0; font: 800 1.15rem/1.2 var(--font-display); color: var(--primary-dark); }
.tess-text { margin: 0 0 1rem; font-size: .88rem; line-height: 1.55; color: var(--text-muted); }
.tess-card .btn { font-size: .88rem; }
.tess-bubble { display: none; }
.tess .tess-avatar { width: 52px; height: 52px; font-size: .74rem; }

/* Entrada discreta, una sola vez */
.tess { opacity: 0; transform: translateY(12px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.tess.is-in { opacity: 1; transform: none; }

/* Móvil: burbuja con la cara de TESS que se expande al tocarla */
@media (max-width: 767px) {
  .tess-bubble {
    display: grid; place-items: center; width: 56px; height: 56px; padding: 0; margin-left: auto;
    border: 3px solid #fff; border-radius: 50%; background: none; cursor: pointer; box-shadow: 0 6px 20px rgba(6,23,58,.3);
  }
  .tess-bubble .tess-avatar { width: 50px; height: 50px; }
  .tess-card { position: fixed; left: .75rem; right: .75rem; bottom: calc(1rem + 56px + 12px + 56px + 12px); width: auto; display: none; }
  .tess.is-open .tess-card { display: block; animation: tess-up .25s var(--ease); }
  .tess.is-open .tess-bubble { box-shadow: 0 0 0 3px var(--ema), 0 6px 20px rgba(6,23,58,.3); }
}
@keyframes tess-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tess { transition: none; transform: none; }
  .tess.is-open .tess-card { animation: none; }
}
@media print { .tess { display: none !important; } }

/* =================================================================
   29. Escritorio estrecho (1140–1359 px): el menú completo cabe con
   enlaces más compactos y "Resultados" solo con el candado.
   ================================================================= */
@media (min-width: 1140px) and (max-width: 1359px) {
  .main-nav { gap: 1rem; }
  .nav-list { gap: .95rem; }
  .nav-list > li > a { font-size: .84rem; }
  .btn-results { font-size: 0; gap: 0; padding-inline: .75rem; } /* el texto sigue siendo el nombre accesible */
  .btn-results .icon { width: 18px; height: 18px; }
}

/* =================================================================
   30. Componentes editoriales del artículo
   ================================================================= */
/* Requisitos de la acreditación: lista visual en dos columnas */
.prose .req-grid { display: grid; gap: 1px; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
.req-grid li { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: #fff; font-weight: 600; font-size: .95rem; color: var(--primary-dark); line-height: 1.35; }
.req-grid .icon { width: 22px; height: 22px; color: var(--primary); }
@media (min-width: 600px) {
  .prose .req-grid { grid-template-columns: 1fr 1fr; }
  .req-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; } /* sin celda vacía con número impar */
}
.prose .req-note { margin-top: .75rem; font-size: var(--fs-sm); color: var(--text-muted); }

/* Impactos: lista compacta dentro de un bloque técnico */
.impact-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.impact-list li { padding: .35rem .7rem; background: #fff; border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--primary-dark); line-height: 1.3; }

/* Frases destacadas */
.prose .article-statement { margin: 1.75rem 0; padding-left: 1.25rem; border-left: 4px solid var(--primary); }
.prose .article-statement p { margin: 0; font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); font-weight: 700; line-height: 1.45; color: var(--primary-dark); }
.prose .article-statement p + p { margin-top: .35rem; }

/* Checklist antes de elegir un laboratorio */
.check-block { margin: 1.5rem 0 2rem; padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--primary-dark); }
.check-block-title { margin: 0 0 1rem; font-weight: 800; line-height: 1.35; color: var(--primary-dark); }
.check-block ul { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.check-block li { display: flex; gap: .7rem; align-items: flex-start; line-height: 1.5; }
.check-block .icon { flex: none; width: 22px; height: 22px; padding: 3px; margin-top: .1rem; background: var(--primary); color: #fff; }

/* Intervención de TESS */
.tech-note-title { display: flex; align-items: center; gap: .55rem; }
.prose .note-source { margin-top: .75rem; font-size: .8rem; font-weight: 600; color: var(--ema-dark); }

/* =================================================================
   31. Ajustes del brief 30/09/2026
   ================================================================= */
/* Aplicaciones (Servicios): franja de materiales, no tarjetas */
.applications { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-bottom: 2rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.applications-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.applications ul { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0; padding: 0; list-style: none; }
.applications li { position: relative; padding-left: .95rem; font-weight: 700; color: var(--primary-dark); }
.applications li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; background: var(--primary); }

/* TESS en el asistente: avatar legible (asset de 320 px, mostrado a 64 px) */
.tess .tess-avatar { width: 64px; height: 64px; font-size: .8rem; }
.tess-head { gap: 1rem; }
@media (max-width: 767px) {
  .tess { bottom: calc(1rem + 56px + 12px); }
  .tess-bubble { width: 68px; height: 68px; }
  .tess-bubble .tess-avatar { width: 62px; height: 62px; }
  .tess-card { bottom: calc(1rem + 56px + 12px + 68px + 12px); }
}

/* TESS en la llamada educativa del artículo (imagen editorial a 96 px) */
.tess-callout { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.tess-callout .avatar-callout { width: 96px; height: 96px; font-size: .85rem; }
@media (max-width: 520px) {
  .tess-callout { grid-template-columns: 1fr; }
  .tess-callout .avatar-callout { width: 72px; height: 72px; }
}

/* =================================================================
   32. Imágenes: fotografía real frente a ilustración técnica (30/09/2026)
   Las fotos se muestran tal cual. Las ilustraciones (plano azul) quedan
   como lenguaje secundario: tono acerado y etiqueta visible, para que
   nunca se lean como evidencia fotográfica.
   ================================================================= */
.media.is-illus { background: #182231; }
.media.is-illus img, .figure-frame img { filter: saturate(.4) brightness(.94) contrast(1.04); }
.media-tag {
  position: absolute; top: .6rem; left: .6rem; z-index: 1; margin: 0;
  padding: .28rem .55rem; font: 600 .7rem/1.2 var(--font-body); letter-spacing: .01em;
  color: #fff; background: rgba(6, 23, 58, .78); pointer-events: none;
}
/* Fotos pequeñas del sitio anterior: en el detalle no se amplían más de ~1.3× */
.media-detail.is-lowres { max-width: 30rem; aspect-ratio: 4 / 3; }

/* Figuras de artículo con recurso existente mientras llega la foto definitiva */
.figure-fill > img { display: block; width: 100%; height: auto; aspect-ratio: var(--ratio); object-fit: cover; }
.figure-frame { position: relative; display: block; aspect-ratio: var(--ratio); overflow: hidden; background: #182231; }
.figure-frame img { width: 100%; height: 100%; object-fit: cover; }

/* =================================================================
   33. Necesito ayuda técnica: orientador por pasos
   ================================================================= */
.helper { display: grid; gap: 2rem; }
.helper-ask h2 { font-size: var(--fs-xl); margin-bottom: .6rem; }
.helper-lead { color: var(--text-muted); font-size: var(--fs-md); max-width: 44ch; margin: 0 0 2rem; }
.helper-step { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-weight: 700; font-size: .95rem; color: var(--primary-dark); }
.helper-step span { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary-dark); color: #fff; font-size: .8rem; }

.helper-list { display: grid; border-top: 1px solid var(--line); }
.helper-option {
  position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  width: 100%; min-height: 66px; padding: .85rem .9rem .85rem 1rem;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  transition: background-color .2s, box-shadow .2s;
}
.helper-option::after { content: ""; width: .5rem; height: .5rem; margin-right: .2rem; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); color: #A3AEBC; transition: color .2s, transform .2s var(--ease); }
.helper-option > .icon { width: 1.75rem; height: 1.75rem; color: var(--primary); }
.helper-option strong { display: block; font-size: 1rem; line-height: 1.3; color: var(--primary-dark); }
.helper-option small { display: block; margin-top: .15rem; font-size: .82rem; line-height: 1.35; color: var(--text-muted); }
.helper-option:hover { background: rgba(255, 255, 255, .65); }
.helper-option[aria-selected="true"] { background: #fff; box-shadow: inset 4px 0 0 var(--primary); }
.helper-option[aria-selected="true"]::after { color: var(--primary); transform: rotate(45deg) translate(2px, -2px); }

.helper-answer { background: #fff; padding: clamp(1.35rem, 1rem + 2vw, 2.5rem); border-top: 4px solid var(--primary-dark); box-shadow: var(--shadow); scroll-margin-top: calc(var(--header-h) + 12px); }

/* Ruta: los cuatro caminos como paradas de una línea; se enciende la recomendada */
.route { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: .25rem 0 2rem; padding: 0; list-style: none; }
.route::before { content: ""; position: absolute; top: 9px; left: 12.5%; right: 12.5%; height: 2px; background: var(--line); }
.route a { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: 0 .3rem; text-align: center; text-decoration: none; font-size: .78rem; font-weight: 600; line-height: 1.25; color: var(--text-muted); }
.route a:hover { color: var(--primary); }
.route i { position: relative; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #B7C3D3; transition: background-color .25s, border-color .25s, box-shadow .25s; }
.route .is-active a { color: var(--primary-dark); font-weight: 800; }
.route .is-active i { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 5px rgba(12, 61, 145, .15); }
.route-short { display: none; }

.helper-panel:not([hidden]) { animation: panel-in .45s var(--ease); }
.helper-path { margin: 0 0 .9rem; font: 800 var(--fs-lg)/1.2 var(--font-display); color: var(--primary-dark); }
.helper-path small { display: block; margin-top: .3rem; font: 500 .9rem/1.4 var(--font-body); color: var(--text-muted); }
.helper-text { max-width: 58ch; margin: 0 0 1.25rem; }
.helper-links { margin: 0 0 1.25rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.helper-links a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 48px; padding: .7rem 0; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--primary); text-decoration: none; }
.helper-links a:hover { color: var(--primary-dark); }
.helper-links .icon { flex: none; width: 18px; height: 18px; transition: transform .2s var(--ease); }
.helper-links a:hover .icon { transform: translateX(3px); }
.helper-topic { margin: 0 0 1.5rem; padding: .7rem 1rem; font-size: .88rem; color: var(--text-muted); background: var(--gray); border-left: 3px solid var(--ema); }
.helper-topic strong { color: var(--primary-dark); }
.helper-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 599px) {
  .route a { font-size: .74rem; }
  .route-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .route-short { display: block; }
  .helper-actions .btn { width: 100%; }
}
@media (min-width: 1024px) {
  .helper { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: start; }
  .helper-answer { position: sticky; top: calc(var(--header-h) + 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .helper-panel:not([hidden]) { animation: none; }
}

/* =================================================================
   34. TESS: formulario de orientación
   Escritorio: la tarjeta crece. Móvil: panel inferior con fondo.
   ================================================================= */
.tess-team { display: flex; align-items: center; gap: .45rem; margin: .8rem 0 0; font-size: .8rem; color: var(--text-muted); }
.tess-team .icon { flex: none; width: 16px; height: 16px; color: var(--ema-dark); }
.tess-form .tess-text { margin-bottom: .9rem; }
.tess-form .field { margin-bottom: .8rem; }
.tess-form .field label { font-size: .84rem; margin-bottom: .25rem; }
.tess-form .field input:not([type="checkbox"]), .tess-form .field select { min-height: 46px; padding: .6rem .75rem; }
.tess-form .field-check label { font-size: .84rem; line-height: 1.45; }
.tess-form .field-check a { color: var(--primary); font-weight: 600; }
.tess-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tess-error { margin: 0 0 .8rem; padding: .6rem .75rem; font-size: .85rem; font-weight: 600; color: var(--error); background: var(--error-bg); border-left: 3px solid var(--error); }
.tess-error:empty { display: none; }
.tess-form [data-tess-submit]:disabled { opacity: .75; cursor: progress; }
.tess-back { display: block; margin: .5rem auto 0; padding: .45rem .75rem; font: 600 .85rem var(--font-body); color: var(--text-muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.tess-back:hover { color: var(--primary-dark); }
.tess-done:focus { outline: none; }
.tess-ok { display: flex; align-items: flex-start; gap: .55rem; margin: 0 0 .5rem; font-weight: 800; line-height: 1.35; color: var(--ok); }
.tess-ok .icon { flex: none; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--ok); color: #fff; }
.tess-backdrop { display: none; }
.tess-card:focus { outline: none; }

/* Escritorio: tarjeta ampliada mientras hay formulario */
@media (min-width: 768px) {
  .tess.is-sheet .tess-card { width: 380px; max-height: calc(100vh - (1rem + 56px + 12px) - 1rem); overflow-y: auto; overscroll-behavior: contain; }
}
/* Móvil: panel inferior */
@media (max-width: 767px) {
  .tess.is-sheet.is-open .tess-backdrop { display: block; position: fixed; inset: 0; background: rgba(6, 23, 58, .55); animation: tess-fade .2s ease; }
  .tess.is-sheet.is-open .tess-card {
    left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 1.25rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0; animation: tess-sheet .28s var(--ease);
  }
  .tess.is-sheet .tess-head { margin-bottom: .5rem; }
  .tess.is-sheet .tess-card .tess-avatar { width: 48px; height: 48px; }
  .tess-form .field input:not([type="checkbox"]), .tess-form .field select { min-height: 50px; font-size: 16px; } /* 16 px: iOS no hace zoom */
  .tess-form .btn { min-height: 52px; }
  .tess-lock, .tess-lock body { overflow: hidden; }
}
@keyframes tess-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes tess-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tess.is-sheet.is-open .tess-card, .tess.is-sheet.is-open .tess-backdrop { animation: none; }
}

/* =================================================================
   35. Galería: fotografías y procesos ilustrados
   ================================================================= */
.gallery-heading { display: flex; align-items: baseline; gap: .5rem; margin: 0; font-size: var(--fs-lg); }
.gallery-heading small { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.illus-head { margin-bottom: 1.5rem; }
.illus-head p { max-width: 62ch; margin: .5rem 0 0; color: var(--text-muted); }
.illus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; margin: 0; padding: 0; list-style: none; }
.illus-grid p { margin: .55rem 0 0; font-size: .88rem; font-weight: 600; line-height: 1.35; color: var(--primary-dark); }
@media (min-width: 768px) { .illus-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
