@charset "UTF-8";
/* ==========================================================================
   Clarity — web comercial
   --------------------------------------------------------------------------
   Índice
     1. Tipografía auto-alojada      12. Pantallas de producto (app shell)
     2. Tokens                       13. Escenas dentro de las pantallas
     3. Reset y base                 14. Riel de cuatro pasos y .split
     4. Escala tipográfica           15. Módulos (bento) y roles
     5. Contenedores y secciones     16. Galería con tabs
     6. Cabecera y navegación        17. Hechos, puesta en marcha y datos
     7. Botones y enlaces            18. Precio, planes y comparativa
     8. Portada                      19. Preguntas frecuentes
     9. Portada interior             20. Formulario
    10. Listas con marca             21. Migas, hermanas y tablas
    11. Notas                        22. Texto largo, cierre, pie
                                     23. Movimiento e impresión
   ========================================================================== */

/* ==========================================================================
   1. Tipografía auto-alojada
   Inter variable, solo los subsets latin y latin-ext.
   ========================================================================== */

@font-face {
  font-family: 'Clarity Wordmark';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/plusjakartasans-clarity.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter var';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-latin-wght.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter var';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext-wght.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   2. Tokens
   Paleta azul tomada de softwaredentalink.com. Blanco como papel, navy
   como tinta, azul de acción y degradados de marca. El disco de luz
   (--lens-*) es la firma visual del hero y del cierre. El sitio es siempre
   claro: `color-scheme: light` lo fija también para los controles nativos
   y las barras de desplazamiento, sin importar el modo del sistema.
   ========================================================================== */

:root {
  color-scheme: light;

  /* ------------------------------------------------------------------
     Paleta tomada del sistema de tokens de softwaredentalink.com
     (sus --color-brand-* / --color-neutral-*). Los valores de RELLENO y
     DEGRADADO se usan tal cual. Los de TEXTO se oscurecen cuando el suyo
     no llega a 4,5:1: su #0072d9 da 4,28:1 sobre su propio azul claro y
     su #0a87c2 da 3,99:1 sobre blanco, así que para texto van --accent
     (#0063bd) y --clinic (#0c6a99). Ver MARCA.md §5.
     ------------------------------------------------------------------ */
  --ink: #0f172a;
  --ink-deep: #080d18;
  --ink-2: #45526b;
  --ink-3: #5e6a7d;
  --bg: #ffffff;
  --bg-alt: #f3f8ff;
  --card: #ffffff;
  --sand: #e9f4ff;
  --line: #e2e8f0;
  --line-2: #cbd8e8;
  --field: #94a3b8;
  --field-line: #8190a6;

  --accent: #0063bd;
  --accent-bright: #0072d9;
  --accent-dark: #09039b;
  --accent-soft: #e9f4ff;
  --accent-line: #8fbeff;

  --clinic: #0c6a99;
  --clinic-soft: #d6e8ff;
  --clinic-line: #a9cdf2;

  --info: var(--clinic);
  --info-soft: var(--clinic-soft);

  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #8a5a00;
  --warn-soft: #fbefc8;
  --danger: #c0362c;
  --danger-soft: #fbe6e6;

  --on-dark: #e4edfb;
  --on-dark-2: #b8cdf0;

  --lens-1: #8fbeff;
  --lens-2: #d6e8ff;
  --lens-3: #e9f4ff;

  /* Degradados, como los usa la web de referencia */
  --grad-brand: linear-gradient(90deg, #09039b, #0072d9);
  --grad-btn: linear-gradient(90deg, #2a66e0, #1f59d6);
  --grad-btn-hover: linear-gradient(90deg, #1f59d6, #1844b4);

  --font: 'Inter var', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step-display: clamp(2.875rem, 1.5rem + 4.6vw, 5.25rem);
  --step-h1: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);
  --step-h2: clamp(1.875rem, 1.45rem + 1.6vw, 2.75rem);
  --step-h3: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --step-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --step-body: 1.0625rem;
  --step-small: 0.9375rem;
  --step-micro: 0.8125rem;
  --fs-ui: 0.8125rem;
  --fs-ui-sm: 0.75rem;

  --wrap: 1200px;
  --wrap-prose: 42rem;

  --r-sm: 8px;
  --r: 12px;
  --r-frame: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(21, 25, 28, 0.05);
  --sh-2: 0 1px 2px rgba(21, 25, 28, 0.05), 0 8px 24px -8px rgba(21, 25, 28, 0.1);
  --sh-frame: 0 1px 2px rgba(21, 25, 28, 0.06), 0 12px 32px -8px rgba(21, 25, 28, 0.1),
    0 48px 96px -32px rgba(21, 25, 28, 0.2);
  /* Solo para .feat y .mod (MARCA.md §9, excepción 7): sombra teñida del azul de acción. */
  --sh-feat: 0 1px 2px rgba(9, 3, 155, 0.06), 0 14px 32px -12px rgba(0, 99, 189, 0.28);
  --frame-edge: transparent;

  --figure-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  --promo-h: 2.5rem;
  --promo-now: 0rem;

  --head-h: 4.25rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}/* ==========================================================================
   3. Reset y base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

[id] {
  scroll-margin-top: calc(var(--head-h) + 1.5rem);
}

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-synthesis-weight: none;
  font-feature-settings: 'cv11';
  -webkit-font-smoothing: antialiased;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 150ms var(--ease), text-decoration-color 150ms var(--ease);
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ==========================================================================
   4. Escala tipográfica
   ========================================================================== */

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-h1);
  letter-spacing: -0.03em;
}

.display {
  font-size: var(--step-display);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 0.98;
}

h2 {
  font-size: var(--step-h2);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--step-h3);
  line-height: 1.25;
  letter-spacing: -0.014em;
}

h4 {
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: 1rem;
}

h1 + p,
h2 + p,
h3 + p,
h4 + p {
  margin-top: 0.875rem;
}

.lead {
  font-size: var(--step-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.small {
  font-size: var(--step-small);
}

.muted {
  color: var(--ink-3);
}

strong,
b {
  font-weight: 640;
  color: var(--ink);
}

.data {
  font-variant-numeric: tabular-nums;
}

/* Énfasis en color dentro de un titular. Es el único sitio donde el acento
   aparece en texto grande; ver MARCA.md §5.2. */
.key {
  color: var(--accent);
}

/* ==========================================================================
   5. Contenedores y secciones
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: 2rem;
  }
}

.band {
  padding-block: clamp(3.75rem, 2.25rem + 6vw, 7rem);
}

.band--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.band--alt + .band--alt {
  border-top: 0;
}

/* Banda con el disco de luz: fondo papel y la lente detrás del contenido. */
.band--lens {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.band--lens > .wrap {
  position: relative;
  z-index: 1;
}

.lens {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--lens-1) 0%, transparent 68%),
    radial-gradient(circle, var(--lens-2) 0%, transparent 62%),
    radial-gradient(circle, var(--lens-3) 0%, transparent 70%);
  filter: blur(28px);
  opacity: 0.9;
}

.lens::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}

.band--tight {
  padding-block: clamp(2.75rem, 1.5rem + 3.5vw, 4.5rem);
}

.band--defer {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.band-head {
  max-width: 44rem;
  margin-bottom: clamp(2.25rem, 1rem + 3.5vw, 3.75rem);
}

.band-head .lead {
  margin-top: 1.125rem;
}

.band-head--center {
  margin-inline: auto;
  text-align: center;
}

.band-head--center .lead {
  margin-inline: auto;
}

.band-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: none;
}

.band-head--row > div {
  max-width: 44rem;
}

.eyebrow {
  display: block;
  margin-bottom: 0.875rem;
  color: var(--accent);
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0;
}

.band--lens .eyebrow {
  color: var(--accent-dark);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 40rem) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Panel: la superficie intermedia. Planes, formulario, aside. */
.panel {
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* ==========================================================================
   6. Cabecera y navegación
   ========================================================================== */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}

.site-head.is-stuck {
  border-bottom-color: var(--line);
}

.head-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--head-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 48rem) {
  .head-row {
    padding-inline: 2rem;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand svg {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

/* Nombre: Plus Jakarta Sans 700 recortada a los glifos de «Clarity» (1 KB,
   SIL OFL). Es la única excepción tipográfica de MARCA.md §7. */
.brand-name {
  font-family: 'Clarity Wordmark', 'Inter var', Inter, system-ui, sans-serif;
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.95;
}

/* Lema: Inter 500, minúsculas y más pequeño; es la segunda voz del lockup. */
.brand-tag {
  margin-top: 0.1875rem;
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* Isotipo: el fondo del cuadrado recorre 3 tonos (MARCA.md §4 y §9.6).
   18 s por vuelta (cada tono 6 s: pausa y transición), 3 vueltas y termina en
   el tono base; con el ratón encima se pausa y con movimiento reducido queda fijo. */
.brand {
  --lg-a: #15191c;
  --lg-b: #09039b;
  --lg-c: #0063bd;
}

.site-foot .brand {
  --lg-a: #ffffff;
  --lg-b: #dcebff;
  --lg-c: #b5d4ff;
}

.logo-bg {
  fill: var(--lg-a);
  animation: clarity-tono 18s ease-in-out 3 both;
}

@keyframes clarity-tono {
  0%,
  28% {
    fill: var(--lg-a);
  }
  33.3%,
  61.7% {
    fill: var(--lg-b);
  }
  66.7%,
  95% {
    fill: var(--lg-c);
  }
  100% {
    fill: var(--lg-a);
  }
}

@media (hover: hover) {
  .brand:hover .logo-bg {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-bg {
    animation: none;
  }
}

@media (max-width: 22rem) {
  .head-row .brand-tag {
    display: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav a,
.nav-disclosure > button {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  font-size: var(--step-small);
  font-weight: 540;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.nav a:hover,
.nav-disclosure > button:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav a[aria-current='page'],
.nav-disclosure.is-current > button {
  color: var(--ink);
  font-weight: 620;
}

.nav-disclosure {
  position: relative;
}

.nav-disclosure > button::after {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.45em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.12em) rotate(45deg);
  transition: transform 180ms var(--ease);
}

.nav-disclosure > button[aria-expanded='true']::after {
  transform: translateY(0.1em) rotate(225deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.625rem);
  left: 50%;
  translate: -50% 0;
  width: min(36rem, calc(100vw - 2rem));
  padding: 0.5rem;
  display: grid;
  gap: 0.125rem;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-frame);
}

.nav-menu[hidden],
.nav[hidden] {
  display: none;
}

.nav-menu a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--step-small);
  font-weight: 600;
  white-space: normal;
}

/* Casilla del icono del módulo: mismo lenguaje que .sibling-icon, en menor. */
.nav-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-ico svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.nav-menu a:hover .nav-ico {
  background: var(--card);
  color: var(--accent-dark);
}

.nav-txt > span {
  display: block;
  color: var(--ink-3);
  font-size: var(--step-micro);
  font-weight: 400;
  line-height: 1.4;
}

.nav-menu a:hover .nav-txt > span {
  color: var(--accent-dark);
}

.head-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--field-line);
  border-radius: var(--r-sm);
  background: var(--card);
  cursor: pointer;
}

.nav-toggle span {
  position: relative;
  display: block;
  width: 1.125rem;
  height: 1.75px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--ink);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  display: block;
  width: 1.125rem;
  height: 1.75px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 200ms var(--ease);
}

.nav-toggle span::before {
  top: -0.375rem;
}

.nav-toggle span::after {
  top: 0.375rem;
}

.nav-toggle[aria-expanded='true'] span {
  background: transparent;
}

.nav-toggle[aria-expanded='true'] span::before {
  transform: translateY(0.375rem) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span::after {
  transform: translateY(-0.375rem) rotate(-45deg);
}

@media (max-width: 63.99rem) {
  .nav-toggle {
    display: block;
  }

  .head-cta > .btn {
    display: none;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    max-height: calc(100dvh - var(--head-h) - var(--promo-now));
    overflow-y: auto;
    padding: 0.5rem 1.25rem 1.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-2);
  }

  .nav > li + li {
    border-top: 1px solid var(--line);
  }

  .nav a,
  .nav-disclosure > button {
    width: 100%;
    padding: 0.875rem 0.5rem;
    font-size: 1.0625rem;
    text-align: left;
  }

  .nav-disclosure {
    position: static;
  }

  .nav-menu {
    position: static;
    translate: none;
    width: auto;
    grid-template-columns: 1fr;
    margin-bottom: 0.75rem;
    padding: 0 0 0 0.75rem;
    border: 0;
    border-left: 2px solid var(--accent-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .nav-ico {
    width: 1.75rem;
    height: 1.75rem;
  }

  .nav-mobile-cta {
    display: grid;
    gap: 0.625rem;
    margin-top: 1.25rem;
  }
}

@media (min-width: 64rem) {
  .nav-mobile-cta {
    display: none;
  }
}

/* Barra de promoción. Vive dentro del <header> para que
   tools/sincronizar-bloques.py la propague. Para que se vaya hacia arriba
   al bajar y reaparezca solo arriba del todo, la cabecera se pega con un
   `top` negativo igual al alto de la promo: la promo sale con el scroll y
   .head-row queda en top: 0. script.js §13 mide el alto real en
   --promo-alto (varía con el ancho); --promo-h es la reserva sin JS.
   --promo-now solo lo usa el menú móvil, que se abre con la promo a la
   vista. */
:root.has-promo {
  --promo-now: var(--promo-alto, var(--promo-h));
}

:root.has-promo .site-head {
  top: calc(-1 * var(--promo-alto, var(--promo-h)));
}

.promo {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--promo-h);
  padding: 0.375rem 1.25rem;
  /* Tercer uso permitido de --grad-brand (MARCA.md §5.2.3): la promoción
     tiene que verse. Sobre el degradado, todo en blanco puro. */
  background: var(--grad-brand);
  color: var(--bg);
  font-size: var(--fs-ui);
  font-weight: 500;
}

.promo p {
  flex: 1;
  margin: 0;
  text-align: center;
}

/* El enlace es una píldora blanca: es lo único claro de la barra y atrae
   la vista sin añadir un color nuevo. */
.promo a {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.promo a:hover {
  background: var(--accent-soft);
}

.promo a:focus-visible,
.promo-close:focus-visible {
  outline-color: var(--bg);
}

.promo-close {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--bg);
  cursor: pointer;
}

.promo-close::before {
  content: '×';
  font-size: 1.125rem;
  line-height: 1;
}

.promo-close:hover {
  background: color-mix(in srgb, var(--bg) 18%, transparent);
}

/* ==========================================================================
   7. Botones y enlaces
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--step-small);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease),
    color 160ms var(--ease), transform 160ms var(--ease), scale 180ms var(--ease);
}

.btn--primary {
  background: var(--grad-btn);
  border-color: transparent;
  color: #fff;
}

.btn--primary:hover {
  background: var(--grad-btn-hover);
  border-color: transparent;
  color: #fff;
}

/* CTA primario de enlace (todas las llamadas a la demo): al pasar el ratón o con
   foco crece un 4 % y asoma una flecha; al salir vuelve. Va en `a`, no en `.btn`,
   para que el botón de envío del formulario no la lleve. Sin sombra (MARCA.md §8).
   La flecha es una máscara SVG pintada con currentColor: no depende de que el
   glifo «→» esté en la fuente. En reposo mide 0 y su margen negativo anula el
   `gap`, así el botón conserva su ancho original. */
a.btn--primary::after {
  content: '';
  flex: none;
  width: 0;
  height: 1em;
  margin-left: -0.5rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / 1em 1em no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / 1em 1em no-repeat;
  opacity: 0;
  translate: -0.35em 0;
  transition: width 180ms var(--ease), margin-left 180ms var(--ease),
    opacity 180ms var(--ease), translate 180ms var(--ease);
}

a.btn--primary:hover,
a.btn--primary:focus-visible {
  scale: 1.04;
}

a.btn--primary:hover::after,
a.btn--primary:focus-visible::after {
  width: 1em;
  margin-left: 0;
  opacity: 1;
  translate: 0 0;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-dark);
}

.btn--lg {
  padding: 0.9375rem 1.5rem;
  font-size: 1.0625rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 26rem) {
  .actions {
    display: grid;
  }

  .actions .btn {
    width: 100%;
  }
}

.actions-note {
  flex-basis: 100%;
  color: var(--ink-3);
  font-size: var(--step-small);
}

.hero .actions-note {
  color: var(--ink-3);
}

.link-more {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
}

.link-more::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-right: 1.6px solid currentColor;
  border-top: 1.6px solid currentColor;
  rotate: 45deg;
  transition: translate 160ms var(--ease);
}

.link-more:hover::after {
  translate: 0.2em 0;
}

/* ==========================================================================
   8. Portada
   Editorial y clara: el titular a toda anchura, la bajada y los botones a su
   derecha, y debajo la aplicación entera sobre el disco de luz.
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem) 0;
  background: var(--bg);
}

.hero-photo {
  position: absolute;
  inset: 0 0 auto;
  height: clamp(28rem, 54vw, 46rem);
}

.hero-photo img,
.mod-photo img,
.brigada-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo img {
  object-position: 66% center;
}

.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(243 248 255 / 94%) 0%, rgb(243 248 255 / 85%) 42%, transparent 72%, var(--bg) 100%);
}

@media (min-width: 64rem) {
  .hero-photo::after {
    background:
      linear-gradient(180deg, rgb(243 248 255 / 90%) 0%, rgb(243 248 255 / 78%) 40%, transparent 74%, var(--bg) 100%),
      linear-gradient(90deg, rgb(243 248 255 / 85%), transparent 80%);
  }
}

.hero > .wrap {
  position: relative;
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.75rem 3rem;
  align-items: end;
}

@media (min-width: 64rem) {
  .hero-copy {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

.hero h1,
.hero .display {
  max-width: 14ch;
  color: var(--ink);
}

/* Titular rotativo (MARCA.md §9, excepción 5). La píldora ocupa su propia
   línea para que el titular tenga siempre tres líneas y la bajada no salte.
   Sin JavaScript se ve la primera palabra; el ancho lo fija script.js §15. */
.rotor {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-block: 0.08em 0.04em;
  padding: 0 0.22em;
  border-radius: var(--r);
  background: var(--accent-dark);
  color: #fff;
}

/* El recorte va en el carril, no en la píldora: su interlineado propio y su
   relleno vertical dejan sitio a los descendentes (g, j) para que no se corten. */
.rotor-track {
  display: grid;
  overflow: hidden;
  padding-block: 0.02em 0.1em;
  line-height: 1.12;
  transition: width 460ms var(--ease);
}

.rotor-word {
  grid-area: 1 / 1;
  width: max-content;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.55em);
  transition:
    opacity 460ms var(--ease),
    transform 460ms var(--ease);
}

.rotor-word.is-on {
  opacity: 1;
  transform: none;
}

.rotor-word.is-out {
  opacity: 0;
  transform: translateY(-0.55em);
}

.hero-sub {
  font-size: var(--step-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 40ch;
}

.hero .actions {
  margin-top: 1.75rem;
  gap: 0.625rem;
}

.hero-visual {
  position: relative;
  margin-top: clamp(2.5rem, 1rem + 5vw, 4.5rem);
  padding-bottom: clamp(2rem, 1rem + 4vw, 4rem);
}

/* El disco de luz: la lente a través de la que se ve la aplicación. */
.hero-visual .lens {
  width: min(92rem, 160vw);
  aspect-ratio: 1;
  left: 50%;
  top: -42%;
  translate: -50% 0;
  opacity: 1;
}

.hero-visual .lens--photo {
  background-image: url('assets/imagenes/textura-lente.webp');
  background-image: image-set(
    url('assets/imagenes/textura-lente.avif') type('image/avif'),
    url('assets/imagenes/textura-lente.webp') type('image/webp')
  );
  background-size: cover;
  background-position: center;
  mask-image: radial-gradient(ellipse, #000 20%, transparent 68%);
}

.hero-visual .shot {
  position: relative;
  z-index: 1;
}

.hero-visual .frame {
  margin-inline: auto;
}

/* La ventana se corta abajo con la banda siguiente: entra en la página. */
.hero-visual .frame--app .app {
  min-height: 30rem;
}

.hero-caption {
  margin-top: 1rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
  text-align: center;
}

/* ==========================================================================
   9. Portada interior
   ========================================================================== */

.page-hero {
  position: relative;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(2.5rem, 1rem + 4vw, 4.5rem);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.page-hero .lens {
  width: 60rem;
  aspect-ratio: 1;
  right: -18rem;
  top: -22rem;
  opacity: 0.75;
  translate: var(--lens-x, 0) var(--lens-y, 0);
}

/* El disco deriva solo y sigue al ratón con retraso (MARCA.md §9, excepción 4).
   La deriva va en `transform`; el seguimiento, en `translate`, que escribe
   script.js §13 mediante --lens-x / --lens-y. Así se suman sin pisarse. */
@media (prefers-reduced-motion: no-preference) {
  .page-hero .lens {
    will-change: transform, translate;
    animation: lens-drift 24s ease-in-out infinite alternate;
    transition: translate 1.4s var(--ease);
  }
}

@keyframes lens-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  33% {
    transform: translate3d(-5rem, 3rem, 0) scale(1.05);
  }

  66% {
    transform: translate3d(-2rem, 7rem, 0) scale(0.97);
  }

  100% {
    transform: translate3d(-8rem, 2rem, 0) scale(1.03);
  }
}

.page-hero .wrap {
  position: relative;
  z-index: 1;
}

.page-hero .lead {
  margin-top: 1.125rem;
}

.page-hero .actions {
  margin-top: 1.75rem;
}

.page-hero--split .wrap {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 3.5rem);
  align-items: center;
}

@media (min-width: 64rem) {
  .page-hero--split .wrap {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .page-hero--split .hero-visual .frame {
    width: calc(100% + clamp(1rem, 6vw, 6rem));
    max-width: none;
  }
}

/* ==========================================================================
   10. Listas con marca
   La marca es una marca de verificación de verdad, no un círculo vacío.
   ========================================================================== */

.ticks {
  display: grid;
  gap: 0.75rem;
  font-size: var(--step-small);
}

.ticks li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  align-items: start;
  color: var(--ink-2);
}

.ticks li::before {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  border-radius: 50%;
  background-color: var(--accent-soft);
  -webkit-mask: none;
  position: relative;
}

.ticks li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14.5 7' fill='none' stroke='%230063bd' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}

.ticks--cols {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.875rem 2rem;
}

/* ==========================================================================
   11. Notas
   ========================================================================== */

.note {
  display: flow-root;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent-line);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: var(--step-small);
}

.note strong {
  color: var(--accent-dark);
}

/* ==========================================================================
   12. Pantallas de producto (app shell)
   Interfaz de ejemplo hecha en HTML/CSS. .frame--app lleva barra lateral,
   barra superior y área de trabajo; .frame--panel es la versión compacta
   para vignettes. El mismo hueco sirve para una captura real.
   ========================================================================== */

.shot {
  margin: 0;
  min-width: 0;
}

.shot img {
  width: 100%;
  border-radius: var(--r-frame);
}

figcaption {
  margin-top: 0.875rem;
  color: var(--ink-3);
  font-size: var(--step-small);
}

.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  background: var(--card);
  box-shadow: var(--sh-frame);
  color: var(--ink-2);
  font-size: var(--fs-ui);
  line-height: 1.45;
  text-align: left;
}

.frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--frame-edge);
  pointer-events: none;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.frame-dots {
  display: flex;
  gap: 0.3125rem;
  flex: none;
}

.frame-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--line-2);
}

.frame-title {
  color: var(--ink);
  font-size: var(--fs-ui-sm);
  font-weight: 640;
}

.frame-crumb {
  margin-left: auto;
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Shell -------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 22rem;
}

@media (min-width: 30rem) {
  .app {
    grid-template-columns: 3rem 1fr;
  }
}

@media (min-width: 44rem) {
  .app {
    grid-template-columns: 9.75rem 1fr;
  }
}

.frame--app.frame--tall .app {
  min-height: 27rem;
}

.app-side {
  display: none;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

@media (min-width: 30rem) {
  .app-side {
    display: flex;
  }
}

.app-side i {
  --icon: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 1.875rem;
  padding-inline: 0.5rem;
  border-radius: 6px;
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-style: normal;
  font-weight: 540;
  white-space: nowrap;
}

.app-side i::before {
  content: '';
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.app-side i::after {
  display: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 44rem) {
  .app-side i::after {
    display: block;
  }
}

.app-side i.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--sh-1);
}

.app-side i:nth-child(1) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.25'/%3E%3Cpath d='M3.5 20c0-3.1 2.5-5.5 5.5-5.5s5.5 2.4 5.5 5.5'/%3E%3Cpath d='M16 5.5a3 3 0 0 1 0 5.4M18 20c0-2-.6-3.7-1.7-5'/%3E%3C/svg%3E");
}

.app-side i:nth-child(1)::after {
  content: 'Pacientes';
}

.app-side i:nth-child(2) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3.5v4M16 3.5v4'/%3E%3Cpath d='M7.5 14h3M7.5 17.5h7'/%3E%3C/svg%3E");
}

.app-side i:nth-child(2)::after {
  content: 'Agenda';
}

.app-side i:nth-child(3) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5h2.4l2.1 10.2h9.8'/%3E%3Cpath d='M6.6 7.5H21l-1.9 6.2'/%3E%3Ccircle cx='9' cy='19' r='1.5'/%3E%3Ccircle cx='17.5' cy='19' r='1.5'/%3E%3C/svg%3E");
}

.app-side i:nth-child(3)::after {
  content: 'Ventas';
}

.app-side i:nth-child(4) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 20.5 8v8L12 20.5 3.5 16V8z'/%3E%3Cpath d='M3.5 8l8.5 4.5L20.5 8M12 12.5v8'/%3E%3C/svg%3E");
}

.app-side i:nth-child(4)::after {
  content: 'Inventario';
}

.app-side i:nth-child(5) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3.5h6M10 3.5v5L5.5 17a2.5 2.5 0 0 0 2.2 3.5h8.6a2.5 2.5 0 0 0 2.2-3.5L14 8.5v-5'/%3E%3Cpath d='M7.2 14h9.6'/%3E%3C/svg%3E");
}

.app-side i:nth-child(5)::after {
  content: 'Laboratorio';
}

.app-side i:nth-child(6) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5h17'/%3E%3Cpath d='M7 20.5V13M12 20.5V6.5M17 20.5v-4.5'/%3E%3C/svg%3E");
}

.app-side i:nth-child(6)::after {
  content: 'Reportes';
}

.app-side i:nth-child(7) {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E");
  margin-top: auto;
}

.app-side i:nth-child(7)::after {
  content: 'Configuración';
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--line);
}

.app-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  height: 1.75rem;
  padding-inline: 0.625rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  white-space: nowrap;
  overflow: hidden;
}

.app-search::before {
  content: '';
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  box-shadow: 0.42rem 0.42rem 0 -0.28rem currentColor;
  opacity: 0.8;
}

.app-search::after {
  content: 'Buscar paciente, cédula o venta';
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-branch {
  flex: none;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--fs-ui-sm);
  font-weight: 560;
}

.app-user {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.625rem;
  font-weight: 700;
}

.app-body {
  flex: 1;
  padding: 1rem 1rem 1.125rem;
  min-width: 0;
}

@media (min-width: 44rem) {
  .app-body {
    padding: 1.125rem 1.25rem 1.25rem;
  }
}

.frame--panel .app {
  grid-template-columns: 1fr;
  min-height: 0;
}

.frame--panel .app-body {
  padding: 0.875rem 1rem 1rem;
}

/* ==========================================================================
   13. Escenas dentro de las pantallas
   Primitivas compartidas por todas las pantallas: cabecera de pantalla,
   paciente, tablas, receta, agenda, indicadores, tablero, línea de tiempo,
   mensaje, formulario ficticio, matriz de permisos y documento.
   ========================================================================== */

.ui-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ui-head h4 {
  font-size: 0.875rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

.ui-head p {
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
}

.ui-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 1.625rem;
  padding-inline: 0.625rem;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
  white-space: nowrap;
}

.ui-btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.ui-btns {
  display: flex;
  gap: 0.375rem;
}

.ui-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-weight: 560;
  overflow: hidden;
  white-space: nowrap;
}

.ui-tabs span {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.ui-tabs span.on {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.ui-grid {
  display: grid;
  gap: 0.875rem;
}

@media (min-width: 36rem) {
  .ui-grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .ui-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .ui-grid--aside {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

.ui-card {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  min-width: 0;
}

.ui-card h5 {
  margin-bottom: 0.5rem;
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
}

/* Paciente */
.person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.875rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.person-name {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 640;
  line-height: 1.3;
}

.person-meta {
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
}

.person .chip {
  margin-left: auto;
}

/* Filas etiqueta / valor */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem;
}

.row + .row {
  border-top: 1px solid var(--line);
}

.row-label {
  color: var(--ink-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-value {
  flex: none;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row--total {
  margin-top: 0.25rem;
  padding-block: 0.625rem;
  border-top: 2px solid var(--line-2) !important;
}

.row--total .row-label,
.row--total .row-value {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.875rem;
}

/* Chips de estado */
.chip {
  display: inline-block;
  padding: 0.0625rem 0.5rem;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: var(--fs-ui-sm);
  font-weight: 620;
  line-height: 1.5;
  white-space: nowrap;
}

.chip--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip--info {
  background: var(--info-soft);
  color: var(--info);
}

.chip--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip--muted {
  background: var(--bg);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* Tabla densa */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-ui-sm);
  font-variant-numeric: tabular-nums;
}

.tbl th,
.tbl td {
  padding: 0.4375rem 0.5rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.tbl th {
  color: var(--ink-3);
  font-weight: 600;
}

.tbl td {
  color: var(--ink);
}

.tbl td.num,
.tbl th.num {
  text-align: right;
}

.tbl td.dim {
  color: var(--ink-3);
}

.tbl tr.is-on td {
  background: var(--accent-soft);
}

.tbl tr.is-warn td {
  background: var(--warn-soft);
}

.tbl td:first-child,
.tbl th:first-child {
  padding-left: 0;
}

.tbl td:last-child,
.tbl th:last-child {
  padding-right: 0;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

/* Receta: OD arriba, OS debajo, columnas de la refracción. */
.rx {
  margin-bottom: 0.75rem;
  border: 1px solid var(--clinic-line);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}

.rx .tbl th,
.rx .tbl td {
  padding: 0.4375rem 0.625rem;
}

.rx .tbl thead th {
  background: var(--clinic-soft);
  color: var(--ink-2);
  font-size: 0.6875rem;
}

.rx .tbl tbody th {
  color: var(--clinic);
  font-weight: 700;
}

.rx .tbl td:first-child,
.rx .tbl th:first-child {
  padding-left: 0.625rem;
}

.rx .tbl td:last-child,
.rx .tbl th:last-child {
  padding-right: 0.625rem;
}

/* Agenda */
.agenda-item {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  gap: 0.625rem;
  align-items: center;
  padding-block: 0.5rem;
}

.agenda-item + .agenda-item {
  border-top: 1px solid var(--line);
}

.agenda-item time {
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-variant-numeric: tabular-nums;
}

.agenda-item strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-item small {
  display: block;
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-weight: 400;
}

.agenda-item.is-done strong {
  color: var(--ink-3);
  font-weight: 500;
}

/* Semana: cinco columnas con bloques. */
.week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
  min-height: 11rem;
}

.week > div {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.week b {
  display: block;
  padding-bottom: 0.25rem;
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.week b.on {
  color: var(--accent-dark);
}

.week span {
  display: block;
  padding: 0.25rem 0.375rem;
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 560;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week span.ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.week span.muted {
  border-left-color: var(--line-2);
  background: var(--bg);
  color: var(--ink-3);
}

/* Indicadores */
.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

@media (min-width: 36rem) {
  .kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .kpis--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.kpi small {
  display: block;
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi b {
  display: block;
  margin-top: 0.125rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi i {
  display: block;
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 600;
  color: var(--ok);
}

.kpi i.down {
  color: var(--danger);
}

.kpi i.flat {
  color: var(--ink-3);
}

/* Barras */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 0.375rem;
  height: 6.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.bars--sm {
  height: 4.5rem;
}

.bars span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  opacity: 0.3;
}

.bars span.on {
  opacity: 1;
}

.bars-x {
  display: flex;
  justify-content: space-between;
  margin-top: 0.375rem;
  color: var(--ink-3);
  font-size: 0.625rem;
}

/* Tablero por estados */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(8.5rem, 1fr);
  gap: 0.625rem;
  overflow: hidden;
}

.kanban > div {
  min-width: 0;
}

.kanban h5 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--ink-3);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
}

.kanban h5 span {
  color: var(--ink);
}

.kcard {
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.kcard b {
  display: block;
  color: var(--ink);
  font-weight: 640;
  font-size: var(--fs-ui-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kcard span {
  color: var(--ink-3);
}

.kcard.is-late {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}

.kcard.is-late span {
  color: var(--warn);
  font-weight: 600;
}

/* Línea de tiempo de estados */
.timeline {
  position: relative;
  padding-left: 1.125rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.3125rem;
  top: 0.375rem;
  bottom: 0.375rem;
  width: 2px;
  background: var(--line);
}

.timeline li {
  position: relative;
  padding-block: 0.3125rem;
  font-size: var(--fs-ui-sm);
  color: var(--ink);
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -1.125rem;
  top: 0.5625rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ok);
}

.timeline li.is-now::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline li.is-next {
  color: var(--ink-3);
}

.timeline li.is-next::before {
  border-color: var(--line-2);
}

.timeline small {
  display: block;
  color: var(--ink-3);
  font-size: 0.6875rem;
}

/* Mensaje de recordatorio */
.msg {
  max-width: 20rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px 10px 10px 2px;
  background: var(--ok-soft);
  color: var(--ink);
  font-size: var(--fs-ui-sm);
  line-height: 1.45;
}

.msg small {
  display: block;
  margin-top: 0.375rem;
  color: var(--ink-3);
  font-size: 0.6875rem;
  text-align: right;
}

.msg var {
  font-style: normal;
  font-weight: 640;
  color: var(--ok);
}

/* Campos de formulario ficticios */
.inp {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.inp small {
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 560;
}

.inp span {
  display: flex;
  align-items: center;
  height: 1.75rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-ui-sm);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
}

.inp span.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.inp span.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.inp span.empty {
  color: var(--ink-3);
}

.inp-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.inp-row--5 {
  grid-template-columns: 2.25rem repeat(4, 1fr);
  align-items: end;
}

.inp-row .eye {
  align-self: center;
  padding-bottom: 0.3125rem;
  color: var(--ink);
  font-size: var(--fs-ui-sm);
  font-weight: 700;
}

.ui-alert {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0.625rem;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.6875rem;
  font-weight: 560;
  line-height: 1.4;
}

.ui-alert::before {
  content: '!';
  flex: none;
  display: grid;
  place-items: center;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--warn);
  color: var(--warn-soft);
  font-size: 0.625rem;
  font-weight: 800;
}

/* Matriz de permisos */
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-ui-sm);
}

.matrix th,
.matrix td {
  padding: 0.375rem 0.375rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.matrix th {
  color: var(--ink-3);
  font-weight: 600;
  font-size: 0.6875rem;
}

.matrix th[scope='row'] {
  color: var(--ink);
  text-align: left;
  padding-left: 0;
  font-size: var(--fs-ui-sm);
}

.matrix td i {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--ok-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14.5 7' fill='none' stroke='%230063bd' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  vertical-align: middle;
}

.matrix td i.no {
  background: var(--bg);
  background-image: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.matrix td i.part {
  background: var(--warn-soft);
  background-image: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent);
}

/* Documento (certificado) */
.doc {
  position: relative;
  max-width: 17rem;
  margin-inline: auto;
  padding: 1.125rem 1.25rem 1.25rem;
  background: #fff;
  color: #1f2748;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--sh-2);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.doc::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  background: var(--ink);
}

.doc h5 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #161e3f;
}

.doc p {
  margin-top: 0.375rem;
  color: #4a5278;
}

.doc .lines {
  display: grid;
  gap: 0.3125rem;
  margin-top: 0.75rem;
}

.doc .lines span {
  display: block;
  height: 0.375rem;
  border-radius: 2px;
  background: #e4e7f0;
}

.doc .lines span:nth-child(2) {
  width: 82%;
}

.doc .lines span:nth-child(3) {
  width: 64%;
}

.doc .sig {
  display: flex;
  justify-content: space-between;
  margin-top: 1.125rem;
  padding-top: 0.5rem;
  border-top: 1px solid #d3d8e6;
  color: #68709a;
  font-size: 0.625rem;
}

.doc--sm {
  max-width: 13rem;
  padding: 0.875rem 1rem 1rem;
}

/* Entradas de movimientos / lista con icono de estado */
.moves li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.625rem;
  align-items: center;
  padding-block: 0.4375rem;
  font-size: var(--fs-ui-sm);
  color: var(--ink);
}

.moves li + li {
  border-top: 1px solid var(--line);
}

.moves li small {
  display: block;
  color: var(--ink-3);
  font-size: 0.6875rem;
}

.moves .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.moves .dot.out {
  background: var(--warn);
}

.moves .dot.in {
  background: var(--ok);
}

.moves .dot.adj {
  background: var(--info);
}

/* Chip navegable. A diferencia del resto de chips, que viven dentro de las
   maquetas aria-hidden, este es un enlace real: necesita foco y estado. */
.chip--link {
  text-decoration: none;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.chip--link:hover,
.chip--link:focus-visible {
  background: var(--accent-line);
  color: var(--ink);
}

/* ==========================================================================
   14. Riel de cuatro pasos y .split
   ========================================================================== */

.flow,
.split {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

@media (min-width: 64rem) {
  .flow {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
  }

  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .split--flip > :first-child {
    order: 2;
  }

  .split--flip > :last-child {
    order: 1;
  }

  .split--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.split .band-head {
  margin-bottom: 1.5rem;
}

.split h2 + .lead {
  margin-top: 1rem;
}

.split .ticks {
  margin-top: 1.5rem;
}

.split .note {
  margin-top: 1.5rem;
}

.steps {
  position: relative;
  counter-reset: step;
}

.steps::before {
  content: '';
  position: absolute;
  left: 0.9375rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: var(--line);
}

.steps::after {
  content: '';
  position: absolute;
  left: 0.9375rem;
  top: 1rem;
  width: 2px;
  height: var(--progress, 0%);
  background: var(--accent);
  transition: height 320ms var(--ease);
}

.step {
  position: relative;
  counter-increment: step;
  padding: 0 0 1.75rem 3.25rem;
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--step-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease),
    color 200ms var(--ease);
}

.band--alt .step::before {
  background: var(--bg-alt);
}

.step h3 {
  margin-bottom: 0.375rem;
  padding-top: 0.125rem;
}

.step p {
  font-size: var(--step-small);
  color: var(--ink-2);
}

.step.is-active::before {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

@media (min-width: 64rem) {
  .flow .step {
    padding-bottom: 5.5rem;
  }

  .step p {
    color: var(--ink-3);
    transition: color 200ms var(--ease);
  }

  .step.is-active p {
    color: var(--ink-2);
  }

  .flow-visual {
    position: sticky;
    top: calc(var(--head-h) + 2rem);
  }
}

.flow-visual .frame + .frame {
  margin-top: 1.25rem;
}

/* ==========================================================================
   15. Módulos (bento) y roles
   ========================================================================== */

.mods {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .mods {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .mods {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mod {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease),
    translate 220ms var(--ease);
}

.mod:hover,
.mod:focus-visible {
  border-color: var(--accent-line);
  color: inherit;
  translate: 0 -4px;
  box-shadow: var(--sh-feat);
}

.mod-photo img {
  transition: scale 600ms var(--ease);
}

.mod:hover .mod-photo img,
.mod:focus-visible .mod-photo img {
  scale: 1.04;
}

.mod-photo {
  display: block;
  height: 11.5rem;
  overflow: hidden;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
}

.mod-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.375rem 1.375rem;
}

.mod h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}

.mod-text p {
  flex: 1;
  font-size: var(--step-small);
  color: var(--ink-2);
}

.mod .link-more {
  margin-top: 0.375rem;
  color: var(--accent-dark);
}

.mod:hover .link-more {
  color: var(--accent);
}

/* Roles: un solo panel dividido por filetes, no cuatro cajas. */
.roles {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
}

@media (min-width: 40rem) {
  .roles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 72rem) {
  .roles {
    grid-template-columns: repeat(4, 1fr);
  }
}

.role {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.625rem;
  border-top: 1px solid var(--line);
}

.role:first-child {
  border-top: 0;
}

@media (min-width: 40rem) {
  .role:nth-child(2) {
    border-top: 0;
  }

  .role:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

@media (min-width: 72rem) {
  .role {
    border-top: 0 !important;
    border-right: 1px solid var(--line);
  }

  .role:last-child {
    border-right: 0;
  }
}

.role-vig {
  height: 7.25rem;
  margin: -0.25rem 0 1.25rem;
  padding: 0.75rem 0.875rem 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--bg);
  font-size: var(--fs-ui-sm);
  line-height: 1.4;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}

.role-vig .row {
  padding-block: 0.375rem;
}

.role h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.role p {
  font-size: var(--step-small);
  color: var(--ink-2);
}

.role-sees {
  margin-top: auto;
  padding-top: 0.875rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
}

.role p + .role-sees {
  margin-top: 0.875rem;
}

/* Cinco pilares por resultado comercial, en carrusel (index.html#resultados;
   script.js §16; MARCA.md §9, excepción 6). Cada tarjeta es una foto de
   ambiente a sangre con el texto en blanco puro sobre un velo de tinta.
   El velo es de legibilidad, no el degradado de marca: §5.2.3 sigue en sus
   tres bloques. Sin JavaScript, el riel se desplaza a mano con imán.

   El riel vive fuera del .wrap y ocupa todo el ancho de la sección, así que
   las tarjetas salen por los dos bordes de la ventana. Su relleno y su imán
   (scroll-padding) reproducen el margen del .wrap: los dos porcentajes se
   miden contra el mismo ancho y la primera tarjeta queda alineada con el
   titular. */
.band--carousel {
  --riel-gutter: 1.25rem;
  --riel-margen: calc(max(0px, (100% - var(--wrap)) / 2) + var(--riel-gutter));
}

/* Mismo salto que el padding de .wrap (§5). */
@media (min-width: 48rem) {
  .band--carousel {
    --riel-gutter: 2rem;
  }
}

.carousel-ctrl {
  display: flex;
  gap: 0.625rem;
}

.carousel-ctrl[hidden],
.carousel-btn[hidden] {
  display: none;
}

/* Borde --field-line: es un control que hay que identificar (3,2:1). */
.carousel-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--field-line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms var(--ease), color 150ms var(--ease),
    background-color 150ms var(--ease);
}

.carousel-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Anillo de cuenta atrás alrededor de la pausa: dice cuánto falta para que
   el carrusel avance solo. Se reinicia con .is-running en cada vuelta. */
.carousel-ring {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.carousel-ring circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 141.4;
  stroke-dashoffset: 141.4;
}

.carousel-btn--pause.is-running .carousel-ring circle {
  animation: carousel-ring var(--carousel-paso, 6s) linear forwards;
}

@keyframes carousel-ring {
  to {
    stroke-dashoffset: 0;
  }
}

.outcomes {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0.25rem var(--riel-margen) 0.5rem;
  scroll-padding-inline: var(--riel-margen);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  list-style: none;
}

.outcomes::-webkit-scrollbar {
  display: none;
}

.outcomes:focus-visible {
  outline-offset: -2px;
}

/* Alto mínimo: el párrafo más largo, en una tarjeta de móvil, tiene que caber
   entero sobre el velo. */
.outcome {
  position: relative;
  display: flex;
  flex: 0 0 min(82%, 23rem);
  flex-direction: column;
  justify-content: flex-end;
  min-height: 34rem;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--ink);
  scroll-snap-align: start;
  transition: border-color 160ms var(--ease);
}

.outcome:hover,
.outcome:focus-within {
  border-color: var(--accent-line);
}

.outcome-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  transition: transform 700ms var(--ease);
}

.outcome-media.is-missing {
  display: none;
}

.outcome:hover .outcome-media img,
.outcome:focus-within .outcome-media img {
  transform: scale(1.04);
}

/* El velo arranca transparente 6 rem por encima del texto y llega al 80 %
   de tinta donde empieza el antetítulo: blanco puro ahí da más de 10:1. */
.outcome-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 6rem 1.5rem 1.5rem;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--ink-deep) 92%, transparent) 0%,
    color-mix(in srgb, var(--ink-deep) 82%, transparent) calc(100% - 6rem),
    transparent 100%
  );
  color: #fff;
}

.outcome .eyebrow {
  margin-bottom: 0;
  color: #fff;
}

.outcome h3 {
  margin: 0;
  color: #fff;
  font-size: var(--step-h3);
  line-height: 1.25;
  text-wrap: balance;
}

.outcome p {
  margin: 0;
  color: #fff;
  font-size: var(--step-small);
}

.outcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

/* Chip enlace sobre foto: contorno blanco y fondo de tinta translúcido;
   al pasar el ratón se invierte. */
.chip--on-photo {
  padding: 0.1875rem 0.75rem;
  border: 1px solid #fff;
  background: color-mix(in srgb, var(--ink-deep) 35%, transparent);
  color: #fff;
}

.chip--on-photo:hover,
.chip--on-photo:focus-visible {
  background: #fff;
  color: var(--accent-dark);
}

/* Rejilla de funcionalidades: prueba de profundidad. Cada ítem sale de su
   página de módulo; ver el comentario de la sección en index.html.
   Tarjetas con icono grande centrado, sombra azulada y destello automático
   (script.js §17): MARCA.md §9, excepción 7, la única tarjeta con sombra
   al pasar el ratón. */
.feats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 30rem) {
  .feats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.feat {
  display: grid;
  grid-template-areas: 'icono' 'texto';
  justify-items: center;
  align-content: center;
  row-gap: 0.875rem;
  min-height: 9.5rem;
  padding: 1.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  background: linear-gradient(
    180deg,
    var(--card),
    color-mix(in srgb, var(--accent-soft) 45%, var(--card))
  );
  box-shadow: var(--sh-1);
  color: var(--ink-2);
  font-size: var(--step-small);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  transition: border-color 240ms var(--ease), background-color 240ms var(--ease),
    box-shadow 240ms var(--ease), transform 240ms var(--ease), color 240ms var(--ease);
}

/* La negrita se reserva con una copia invisible del texto (data-t del <li>)
   en la misma celda: la celda mide lo que mida la versión en negrita, así
   que el cambio de peso no mueve renglones ni cambia la altura. */
.feat span,
.feat::after {
  grid-area: texto;
  justify-self: stretch;
}

.feat::after {
  content: attr(data-t);
  visibility: hidden;
  font-weight: 650;
  user-select: none;
  pointer-events: none;
}

.feat:hover,
.feat.is-lit {
  border-color: var(--accent-line);
  background: var(--card);
  box-shadow: var(--sh-feat);
  transform: translateY(-4px);
  color: var(--accent-dark);
}

.feat:hover span,
.feat.is-lit span {
  font-weight: 650;
}

.feat svg {
  grid-area: icono;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--ink-2);
  transition: color 240ms var(--ease), transform 240ms var(--ease);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feat:hover svg,
.feat.is-lit svg {
  color: var(--accent);
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .feat,
  .feat:hover,
  .feat svg,
  .feat:hover svg {
    transform: none;
  }
}

/* ==========================================================================
   16. Galería con tabs
   ========================================================================== */

.tabs-list {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.tabs-list button {
  flex: none;
  padding: 0.5rem 0.9375rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--step-small);
  font-weight: 540;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease),
    color 160ms var(--ease);
}

.tabs-list button:hover {
  border-color: var(--accent-line);
  color: var(--accent-dark);
}

.tabs-list button[aria-selected='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.tabs-panels > [role='tabpanel'][hidden] {
  display: none;
}

.tabs-panels figure {
  max-width: 62rem;
  margin: 0 auto;
}

.tabs-panels figcaption {
  text-align: center;
}

.tabs-panels > [role='tabpanel'] {
  animation: panel-in 180ms var(--ease) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ==========================================================================
   17. Hechos, puesta en marcha y datos
   Listas con filetes: sin cajas, la estructura la dan las líneas.
   ========================================================================== */

.brigada-photo {
  display: block;
  height: clamp(14rem, 35vw, 25rem);
  margin-top: clamp(1.75rem, 4vw, 3rem);
  overflow: hidden;
  border-radius: var(--r-lg);
}

.facts {
  display: grid;
  border-top: 1px solid var(--line);
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 3rem;
  }
}

@media (min-width: 64rem) {
  .facts {
    grid-template-columns: repeat(4, 1fr);
    column-gap: 2.5rem;
  }
}

.fact {
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid var(--line);
}

.fact h3 {
  margin-bottom: 0.625rem;
  font-size: 1.0625rem;
}

.fact p {
  font-size: var(--step-small);
  color: var(--ink-2);
}

/* Puesta en marcha: secuencia de verdad, por eso va numerada. */
.stages {
  display: grid;
  gap: 2rem 2.5rem;
  counter-reset: stage;
}

@media (min-width: 40rem) {
  .stages {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .stages {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stage {
  position: relative;
  counter-increment: stage;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
}

.stage::before {
  content: counter(stage, decimal-leading-zero);
  position: absolute;
  top: -0.6875rem;
  left: 0;
  padding-right: 0.625rem;
  background: var(--bg);
  color: var(--accent);
  font-size: var(--step-micro);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.band--alt .stage::before {
  background: var(--bg-alt);
}

.stage h3 {
  margin-bottom: 0.5rem;
  font-size: 1.0625rem;
}

.stage p {
  font-size: var(--step-small);
  color: var(--ink-2);
}

.stage small {
  display: block;
  margin-top: 0.875rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
}

/* Datos: dos columnas de puntos, con la marca de verificación. */
.assurances {
  display: grid;
  gap: 1.25rem 3rem;
}

@media (min-width: 40rem) {
  .assurances {
    grid-template-columns: repeat(2, 1fr);
  }
}

.assurance {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.875rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.assurance::before {
  content: '';
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.0625rem;
  border-radius: 50%;
  background-color: var(--ok-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14.5 7' fill='none' stroke='%230063bd' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}

.assurance h3 {
  margin-bottom: 0.375rem;
  font-size: 1.0625rem;
}

.assurance p {
  font-size: var(--step-small);
  color: var(--ink-2);
}

/* Franja de cifras verificables. Misma familia de filetes que .facts: la
   fuerza la da el tamaño del número, no un fondo de color. */
.figures {
  display: grid;
  gap: 1.5rem 2rem;
  margin: 0;
  padding: clamp(1.75rem, 1rem + 3vw, 2.75rem) clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  list-style: none;
  border-radius: var(--r-lg);
  background: var(--grad-brand);
  color: #fff;
}

.figure b {
  display: block;
  margin-bottom: 0.375rem;
  color: #fff;
  font-size: var(--figure-size);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.figure p {
  margin: 0;
  color: #fff;
  font-size: var(--step-small);
}

.figures-note {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--step-micro);
  max-width: 54rem;
}

@media (min-width: 40rem) {
  .figures {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 64rem) {
  .figures {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Versión compacta de .assurances para poner junto al precio: solo el
   titular, sin párrafo, en cuatro columnas. */
.assurances--compact {
  margin-top: 1.5rem;
}

.assurances--compact .assurance {
  padding-block: 0.875rem;
}

.assurances--compact h3 {
  font-size: var(--step-small);
  font-weight: 600;
}

@media (min-width: 64rem) {
  .assurances--compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 2rem;
  }
}

/* ==========================================================================
   18. Precio, planes y comparativa
   ========================================================================== */

.plans {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 60rem) {
  .plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 1rem + 1.5vw, 2rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.plan.is-featured {
  border-color: transparent;
  background: var(--grad-brand);
  color: #fff;
}

.plan.is-featured .plan-name,
.plan.is-featured .plan-price b,
.plan.is-featured .plan-price small,
.plan.is-featured .plan-annual,
.plan.is-featured .plan-for,
.plan.is-featured .plan-rollup,
.plan.is-featured .ticks li,
.plan.is-featured .plan-setup,
.plan.is-featured .plan-setup b,
.plan.is-featured .link-more {
  color: #fff;
}

.plan.is-featured .plan-tag {
  background: #fff;
  color: var(--accent-dark);
}

.plan.is-featured .ticks li::before {
  background-color: #fff;
}

.plan.is-featured .btn {
  background: #fff;
  border-color: #fff;
  color: var(--accent-dark);
}

.plan.is-featured .btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-dark);
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.plan-name {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

.plan-tag {
  padding: 0.1875rem 0.625rem;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step-micro);
  font-weight: 620;
  white-space: nowrap;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.125rem;
}

.plan-price b {
  color: var(--ink);
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan-price small {
  color: var(--ink-3);
  font-size: var(--step-small);
}

/* Precio anual: siempre en una sola línea; la píldora del ahorro queda al
   lado si cabe y baja entera si no. */
.plan-annual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  margin-top: 0.5rem;
  color: var(--ink-3);
  font-size: var(--step-small);
}

.plan-annual-price {
  white-space: nowrap;
}

.plan-annual-price b {
  color: var(--ink);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.plan-save {
  padding: 0.125rem 0.5rem;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: var(--step-micro);
  font-weight: 620;
  white-space: nowrap;
}

.plan.is-featured .plan-annual-price b {
  color: #fff;
}

.plan.is-featured .plan-save {
  background: #fff;
  color: var(--accent-dark);
}

.plan-for {
  margin-top: 0.75rem;
  color: var(--ink-2);
  font-size: var(--step-small);
  min-height: 2.75em;
}

.plan .ticks {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.plan-setup {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--step-micro);
}

.plan-setup b {
  font-weight: 620;
  text-align: right;
}

.plan .btn {
  width: 100%;
  margin-top: 1.5rem;
}

.plan .link-more {
  margin-top: auto;
  padding-top: 1.5rem;
}

/* Beneficios del plan anual: tarjeta sobria bajo los planes, sin degradado. */
.annual-perks {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.annual-perks h3 {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

.annual-perks ul {
  display: grid;
  gap: 1rem 2rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .annual-perks ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.annual-perks li b {
  display: block;
  color: var(--accent-dark);
  font-weight: 640;
}

.annual-perks li span {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-2);
  font-size: var(--step-small);
}

.plans-note {
  margin-top: 1.5rem;
  color: var(--ink-3);
  font-size: var(--step-small);
  text-align: center;
}

/* Tabla comparativa */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
}

.compare th,
.compare td {
  padding: 0.875rem 1rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.compare thead th {
  background: var(--bg);
  color: var(--ink);
  font-weight: 640;
  border-bottom: 2px solid var(--line-2);
}

.compare thead th small {
  display: block;
  margin-top: 0.125rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
  font-weight: 500;
}

.compare th[scope='row'] {
  width: 40%;
  color: var(--ink);
  font-weight: 560;
  text-align: left;
  padding-left: 0;
}

.compare th[scope='rowgroup'] {
  padding: 1.75rem 0 0.5rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
  font-weight: 640;
  text-align: left;
  border-bottom: 0;
}

.compare td {
  color: var(--ink-2);
}

.compare .yes {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14.5 7' fill='none' stroke='%230063bd' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  vertical-align: middle;
}

.compare .no {
  color: var(--ink-3);
}

.compare td.is-featured {
  background: var(--accent-soft);
}

@media (max-width: 47.99rem) {
  .compare th,
  .compare td {
    padding: 0.75rem 0.5rem;
    font-size: var(--step-micro);
  }

  .compare th[scope='row'] {
    width: auto;
  }
}

/* Prueba */
.trial {
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--sand);
}

.trial h3 {
  margin-bottom: 0.75rem;
}

.trial .ticks {
  margin-block: 1.25rem;
}

.trial--row {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .trial--row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .trial--row .ticks {
    margin-block: 0;
  }
}

/* «Todo lo de X, y además:» — encabeza la lista en vez de ser un ítem más,
   para que se lea que los planes se acumulan. */
.plan-rollup {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 600;
}

/* ==========================================================================
   19. Preguntas frecuentes
   ========================================================================== */

.faq {
  max-width: var(--wrap-prose);
  margin-inline: auto;
}

.faq--wide {
  max-width: 50rem;
  margin-inline: 0;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:first-of-type {
  border-top: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0.25rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.375rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  rotate: 45deg;
  transition: rotate 200ms var(--ease);
}

.faq details[open] summary::after {
  rotate: 225deg;
}

.faq summary:hover {
  color: var(--accent-dark);
}

.faq-answer {
  padding: 0 2rem 1.375rem 0.25rem;
  font-size: var(--step-small);
  color: var(--ink-2);
}

.faq-answer > * + * {
  margin-top: 0.75rem;
}

/* ==========================================================================
   20. Formulario
   ========================================================================== */

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 44rem;
}

@media (min-width: 40rem) {
  .form {
    grid-template-columns: 1fr 1fr;
  }
}

.field--full {
  grid-column: 1 / -1;
}

.field > label,
.field fieldset legend {
  display: block;
  margin-bottom: 0.4375rem;
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 600;
}

.req {
  color: var(--accent);
}

.hint {
  display: block;
  margin: -0.125rem 0 0.4375rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--field-line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: right 1.125rem center, right 0.8125rem center;
  background-size: 0.3125rem 0.3125rem, 0.3125rem 0.3125rem;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--field);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field [aria-invalid='true'] {
  border-color: var(--danger);
}

.field [aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

/* Reserva de la demostración (demo.html): mes a la izquierda, horas a la
   derecha. Los días y horas no ofrecidos se ven atenuados y tachados. */
.booking-body {
  display: grid;
  gap: 1.25rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

@media (min-width: 40rem) {
  .booking-body {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1.5rem;
  }

  .booking-times {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
  }
}

.booking-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.booking-month,
.booking-day {
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 640;
}

.booking-arrow {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.booking-arrow:disabled {
  color: var(--ink-3);
  opacity: 0.45;
  cursor: default;
}

.booking-week,
.booking-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.booking-week {
  margin-top: 0.75rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
  font-weight: 600;
  text-align: center;
}

.booking-days {
  margin-top: 0.375rem;
}

.booking-daybtn {
  aspect-ratio: 1;
  min-height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: inherit;
  font-size: var(--step-small);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.booking-daybtn:hover:not(:disabled),
.booking-slot:hover:not(:disabled) {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.booking-daybtn:disabled {
  background: none;
  color: var(--ink-3);
  font-weight: 450;
  opacity: 0.55;
  cursor: default;
}

.booking-daybtn[aria-pressed='true'],
.booking-slot[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

.booking-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
  margin-top: 0.75rem;
}

@media (min-width: 40rem) {
  .booking-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.booking-slot {
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-size: var(--step-small);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.booking-slot:disabled {
  border-color: var(--line);
  background: none;
  color: var(--ink-3);
  font-weight: 450;
  text-decoration: line-through;
  opacity: 0.6;
  cursor: default;
}

.booking-summary {
  margin-top: 0.75rem;
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 600;
}

.booking-summary:empty {
  display: none;
}

.field-error {
  display: none;
  margin-top: 0.375rem;
  color: var(--danger);
  font-size: var(--step-micro);
  font-weight: 550;
}

.field-error.is-shown {
  display: block;
}

fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.checks {
  display: grid;
  gap: 0.625rem;
}

@media (min-width: 30rem) {
  .checks {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: var(--step-small);
}

.check input[type='checkbox'] {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1875rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.check label {
  margin: 0;
  font-weight: 400;
  color: var(--ink-2);
  cursor: pointer;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  display: none;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: var(--step-small);
}

.form-status.is-shown {
  display: block;
}

.form-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.form-status strong {
  color: inherit;
}

/* Secuencia «qué pasa después» del formulario. */
.after {
  counter-reset: after;
  display: grid;
  gap: 1rem;
}

.after li {
  position: relative;
  counter-increment: after;
  padding-left: 2.5rem;
  font-size: var(--step-small);
  color: var(--ink-2);
}

.after li::before {
  content: counter(after);
  position: absolute;
  left: 0;
  top: 0.0625rem;
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: var(--step-micro);
  font-weight: 700;
}

.after li strong {
  display: block;
  margin-bottom: 0.125rem;
}

/* ==========================================================================
   21. Migas, hermanas y tablas de detalle
   ========================================================================== */

.crumbs {
  margin-bottom: 1.25rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.crumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.375rem;
  color: var(--line-2);
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs [aria-current='page'] {
  color: var(--ink-2);
}

.siblings {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .siblings {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2.5rem;
  }
}

.sibling {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.875rem;
  align-items: start;
  padding: 1.375rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.sibling:hover {
  color: inherit;
}

.sibling-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.sibling-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.sibling strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}

.sibling:hover strong {
  color: var(--accent-dark);
}

.sibling span {
  color: var(--ink-2);
  font-size: var(--step-small);
}

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  text-align: left;
}

.detail-table caption {
  margin-bottom: 0.75rem;
  color: var(--ink-3);
  font-size: var(--step-micro);
  text-align: left;
}

.detail-table th,
.detail-table td {
  padding: 0.9375rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.detail-table thead th {
  color: var(--ink-3);
  font-size: var(--step-micro);
  font-weight: 640;
  border-bottom: 2px solid var(--line-2);
  white-space: nowrap;
}

.detail-table th[scope='row'] {
  color: var(--ink);
  font-weight: 620;
  padding-left: 0;
}

.detail-table thead th:first-child {
  padding-left: 0;
}

.detail-table td {
  color: var(--ink-2);
}

@media (max-width: 47.99rem) {
  .detail-table,
  .detail-table thead,
  .detail-table tbody,
  .detail-table tr,
  .detail-table th,
  .detail-table td {
    display: block;
    width: 100%;
  }

  .detail-table thead {
    display: none;
  }

  .detail-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
    overflow: hidden;
  }

  .detail-table th,
  .detail-table td {
    border-bottom: 0;
    padding: 0.875rem 1rem 0;
  }

  .detail-table th[scope='row'] {
    padding-left: 1rem;
  }

  .detail-table tr > :last-child {
    padding-bottom: 1rem;
  }

  .detail-table th[scope='row'] {
    padding-bottom: 0.25rem;
    font-size: 1rem;
  }

  .detail-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.125rem;
    color: var(--ink-3);
    font-size: var(--step-micro);
    font-weight: 640;
  }
}

/* ==========================================================================
   22. Texto largo, cierre y pie
   ========================================================================== */

.prose {
  max-width: var(--wrap-prose);
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: var(--step-h3);
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
}

.prose ul {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.125rem;
  list-style: disc;
}

.prose li::marker {
  color: var(--accent-line);
}

.prose dl {
  display: grid;
  gap: 0.75rem;
}

.prose dt {
  color: var(--ink);
  font-weight: 640;
}

/* Dirección para notificaciones del aviso de privacidad. Bloque, no itálica:
   es un dato que alguien va a copiar, no una cita. */
.prose-address {
  padding-left: 0.875rem;
  border-left: 2px solid var(--accent-line);
  color: var(--ink);
  font-style: normal;
  line-height: 1.5;
}

/* Texto pendiente de completar en el borrador legal. Se ve como texto. */
.pending {
  color: var(--ink-3);
  font-style: italic;
}

.closing {
  text-align: center;
}

.closing .lens {
  width: 64rem;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  opacity: 0.8;
}

.closing .band-head {
  margin-bottom: 0;
}

.closing .lead {
  margin-inline: auto;
}

.closing .actions {
  justify-content: center;
  margin-top: 2rem;
}

.closing .actions-note {
  text-align: center;
}

.site-foot {
  padding-block: clamp(2.75rem, 1.5rem + 4vw, 4.5rem) 1.75rem;
  background: var(--ink-deep);
  color: var(--on-dark);
  font-size: var(--step-small);
}

.foot-grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 40rem) {
  .foot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .foot-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.5rem;
  }
}

.foot-brand .brand {
  margin-bottom: 1rem;
  color: #fff;
}

.foot-brand .brand:hover {
  color: #fff;
}

.foot-brand p {
  color: var(--on-dark-2);
  max-width: 30ch;
}

.site-foot .brand .brand-name {
  color: #fff;
}

.site-foot .brand .brand-tag {
  color: var(--on-dark-2);
}

.foot-col h2 {
  margin-bottom: 1rem;
  color: #fff;
  font-size: var(--step-small);
  font-weight: 640;
  letter-spacing: 0;
}

.foot-col ul {
  display: grid;
  gap: 0.5625rem;
}

.foot-col a {
  color: var(--on-dark);
  text-decoration: none;
}

.foot-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.foot-col li {
  color: var(--on-dark);
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--on-dark) 16%, transparent);
  color: var(--on-dark-2);
  font-size: var(--step-micro);
}

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--sh-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms var(--ease), visibility 200ms var(--ease);
}

.to-top.is-shown {
  opacity: 1;
  visibility: visible;
}

.to-top::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  rotate: 45deg;
}

/* Llamada fija en móvil. Barra a todo el ancho y no burbuja: en un teléfono
   el pulgar y la legibilidad del texto lo piden. En escritorio no existe,
   porque el CTA de la cabecera fija ya está siempre visible. */
.cta-float {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 89;
  padding: 0.625rem 1.25rem;
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms var(--ease), visibility 200ms var(--ease);
}

.cta-float.is-shown {
  opacity: 1;
  visibility: visible;
}

.cta-float .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 64rem) {
  .cta-float {
    display: none;
  }
}

/* Mientras la barra está, el botón de volver arriba estorba y choca con ella. */
@media (max-width: 63.999rem) {
  .to-top {
    display: none;
  }

  .site-foot {
    padding-bottom: 5rem;
  }
}

/* ==========================================================================
   23. Movimiento e impresión
   Un solo momento orquestado: la portada entra una vez.
   ========================================================================== */

[data-enter] {
  animation: enter 520ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.hero-visual[data-enter] {
  animation-name: enter-frame;
  animation-duration: 760ms;
}

@keyframes enter-frame {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
}

@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  @view-transition {
    navigation: none;
  }
}

@media print {
  .site-head,
  .to-top,
  .cta-float,
  .nav,
  .lens {
    display: none;
  }

  body {
    color: #000;
  }
}

/* ==========================================================================
   Aviso de cookies (consentimiento.js). Dos botones del mismo peso a
   propósito: rechazar tiene que ser tan fácil como aceptar.
   ========================================================================== */
.cookie-aviso {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 300;
  max-width: 34rem;
  margin-inline: auto;
  padding: 1.125rem 1.25rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}

@media (min-width: 48rem) {
  .cookie-aviso {
    right: 1.25rem;
    bottom: 1.25rem;
    left: auto;
    margin-inline: 0;
  }
}

.cookie-aviso__titulo {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.cookie-aviso__texto {
  margin: 0 0 0.875rem;
  color: var(--ink-2);
  font-size: var(--step-small);
  line-height: 1.5;
}

.cookie-aviso__texto a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-aviso__acciones {
  display: flex;
  gap: 0.625rem;
}

.cookie-aviso__btn {
  flex: 1 1 0;
  background: var(--bg);
  border-color: var(--ink);
  color: var(--ink);
  cursor: pointer;
}

.cookie-aviso__btn:hover,
.cookie-aviso__btn:focus-visible {
  background: var(--bg-alt);
}

/* «Preferencias de cookies» en el pie: un botón que parece un enlace. */
.foot-col .foot-link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
