/* Aerium Medical Center · páginas internas
   Se carga después de main.css, solo en especialidades, la clínica y agenda.
   El lenguaje de la portada, quieto: el carril teal a la izquierda con sus nodos
   ya llenos, Jost grande y la misma noche cálida al final de cada página. */

/* ---------- Geometría del carril ----------
   --rail-x: centro de la línea, medido desde el borde de contenido de .wrap
             (coincide con el centro de .step-node en la columna --lane de main.css).
   --text-x: donde empieza el texto a la derecha de la línea (= padding de .lane-head). */

.page-inner {
  --rail-x: calc(var(--lane) / 2);
  --text-x: var(--lane);
  /* la línea de la portada a plena vista: núcleo de 2 px y un halo de 2 px por lado (6 px en total) */
  --rail-w: 6px;
  --rail-c: #4FA3A8;
  --rail-paint: linear-gradient(to right, rgba(79, 163, 168, .24) 0 2px, var(--rail-c) 2px 4px, rgba(79, 163, 168, .24) 4px);
  --node: 9px;
}

/* ---------- Ruta (migas) ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--secondary);
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(var(--teal), var(--teal)) 0 calc(100% - 5px) / 0 1px no-repeat;
  transition: color .3s var(--ease-air), background-size .35s var(--ease-air);
}
.crumbs a:hover { color: var(--teal-text); background-size: 100% 1px; }
.crumbs a:focus-visible { color: var(--teal-text); }
.crumbs span { color: #9AABB9; }
.crumbs-light, .crumbs-light a, .crumbs-light span { color: rgba(255, 255, 255, .62); }
.crumbs-light a:hover, .crumbs-light a:focus-visible { color: var(--teal-light); }
.summary-note { margin-top: 16px; font-size: 15px; color: rgba(255, 255, 255, .58); }

/* ---------- Apertura ---------- */

.sub-hero {
  padding-block: clamp(56px, 10vh, 120px) clamp(56px, 9vh, 104px);
}
.sub-hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
}
/* el titular ocupa hasta la col. 8: «Inmunología» a 148 px necesita ese ancho */
.sub-hero-copy { grid-column: 1 / span 8; min-width: 0; }

/* número de la especialidad: dígitos tabulares y un filete vertical en lugar del guion */
.sub-hero .eyebrow:has(.sub-index)::before { display: none; }
.sub-index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
  color: var(--teal-text);
}
.sub-index::after {
  content: "";
  width: 1px; height: 14px;
  background: var(--teal-light);
}

.sub-title {
  margin-top: 24px;
  font-size: clamp(56px, 9vw, 148px);
  font-weight: 360;
  line-height: .96;
  letter-spacing: -.035em;
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow-wrap: anywhere;
}
.sub-hero-copy .lede { margin-top: 28px; }
.sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* el arco de la recepción, como en la portada: el dibujo de la especialidad respira dentro */
.sub-art,
.sub-photo {
  grid-column: 9 / span 4;
  justify-self: end;
  width: min(100%, 440px);
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
}
/* el arco es un nicho de nogal (la pared de la recepción) bajo una luz cenital suave;
   el dibujo de la especialidad vive dentro como una pieza retroiluminada (sub-hero.js) */
.sub-art {
  display: grid;
  place-items: center;
  padding-top: 14%;
  background:
    radial-gradient(ellipse 80% 46% at 50% -4%, rgba(255, 232, 196, .5), rgba(255, 220, 170, .14) 55%, rgba(255, 220, 170, 0) 80%),
    linear-gradient(180deg, rgba(14, 9, 5, 0) 30%, rgba(14, 9, 5, .55) 100%),
    url("../assets/img/pared-nogal-v6/0001.webp") 50% 0 / 640px 405px repeat;
  background-color: #4E3624;
  background-blend-mode: screen, normal, normal;
  box-shadow: 0 40px 80px -40px rgba(12, 34, 66, .45);
}
/* filete interior: el borde del arco se intuye sin caja */
.sub-art::after,
.sub-photo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  pointer-events: none;
}
.sub-art img,
.sub-glyph { position: relative; width: 82%; height: auto; }
/* sin el SVG en línea (p. ej. file://) el dibujo queda en luz plana, sin rellenos */
.sub-art img { filter: brightness(0) invert(.9) drop-shadow(0 0 8px rgba(92, 161, 170, .7)); opacity: .9; }
/* luz detrás de cada trazo: canto nítido, halo teal corto y uno largo muy tenue */
.sub-glyph {
  overflow: visible;
  filter: drop-shadow(0 -1px 0 rgba(255, 238, 202, .6)) drop-shadow(1px 3px 1px rgba(15, 12, 8, .85)) drop-shadow(0 0 4px rgba(255, 214, 155, .4));
}

/* la línea que baja del arco al carril (sub-hero.js la mide y la dibuja) */
main.sub { position: relative; }
.sub-thread {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}
.sub-thread.is-ready { opacity: 1; z-index: 4; }
/* One SVG owns the entire route, above dusk and outside section clipping. */
.has-continuous-thread .has-rail > .wrap::before,
.has-continuous-thread .sub-hero + .has-rail > .wrap::after,
.has-continuous-thread .sub-night-actions::before,
.has-continuous-thread .sub-night-actions::after { display: none; }
.has-continuous-thread .sub-night-inner { clip-path: none; }
.sub-thread path { fill: none; stroke-linecap: round; }
.sub-thread .t-halo { stroke: rgba(79, 163, 168, .22); stroke-width: 6; }
.sub-thread .t-core { stroke: var(--rail-c); stroke-width: 2; }
.sub-thread circle { fill: var(--rail-c); }
.rail-probe { position: absolute; left: calc(var(--gutter) + var(--rail-x)); top: 13px; width: 0; height: 0; pointer-events: none; }

/* variante con la foto de la recepción (la clínica) */
.sub-photo {
  background: var(--wood-dark);
  box-shadow: 0 40px 80px -40px rgba(12, 34, 66, .45);
}
.sub-photo::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sub-photo picture { display: block; width: 100%; height: 100%; }
.sub-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Carril quieto ----------
   Cada sección con carril dibuja su tramo de borde a borde (incluido su padding):
   los tramos se tocan en la costura y se leen como una sola línea. */

.page-inner .has-rail {
  --rail-pt: clamp(72px, 11vh, 128px);
  --rail-pb: clamp(48px, 7vh, 88px);
  padding-block: var(--rail-pt) var(--rail-pb);
}
.page-inner .sub-pasos.has-rail {
  --rail-pt: clamp(56px, 9vh, 104px);
  --rail-pb: clamp(40px, 6vh, 72px);
}
.page-inner .otras.has-rail { --rail-pt: clamp(56px, 9vh, 104px); }
/* la última sección de día deja aire limpio: ahí sube el atardecer de .sub-night */
.page-inner .has-rail:has(+ .sub-night) { --rail-pb: clamp(220px, 28vh, 280px); }

.has-rail > .wrap { position: relative; }
.has-rail > .wrap::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) + var(--rail-x) - var(--rail-w) / 2);
  top: calc(var(--rail-pt, 0px) * -1);
  bottom: calc(var(--rail-pb, 0px) * -1);
  width: var(--rail-w);
  /* color plano en vertical (un degradé por tramo marcaría cada costura); el halo es horizontal */
  background: var(--rail-paint);
  /* por encima del atardecer (z 1); los nodos van en z 3 */
  z-index: 2;
  pointer-events: none;
}
/* el primer tramo nace en el rótulo de la sección, con un punto de partida */
.sub-hero + .has-rail > .wrap::before { top: 13px; }
.sub-hero + .has-rail > .wrap::after {
  content: "";
  position: absolute;
  left: calc(var(--gutter) + var(--rail-x) - 3.5px);
  top: 9.5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rail-c);
  z-index: 3;
}

/* nodo hueco sobre la línea (motivos, valores) */
.motivos li::before,
.valores li::before {
  content: "";
  position: absolute;
  width: var(--node); height: var(--node);
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--teal);
  z-index: 3;
}

/* ---------- Motivos ---------- */

.motivos {
  max-width: 900px;
  margin-top: clamp(40px, 7vh, 72px);
  padding-left: var(--text-x);
}
.motivos li {
  --pad: 22px;
  position: relative;
  padding-block: var(--pad);
  border-top: 1px solid var(--divider);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
  text-wrap: balance;
}
.motivos li:last-child { border-bottom: 1px solid var(--divider); }
/* el nodo se alinea con el centro de la primera línea (em = tamaño del ítem) */
.motivos li::before {
  left: calc(var(--rail-x) - var(--text-x) - var(--node) / 2);
  top: calc(var(--pad) + .575em - var(--node) / 2);
}
.sub-note {
  margin-top: 24px;
  padding-left: var(--text-x);
  font-size: 15px;
  color: var(--secondary);
}

/* ---------- Pasos (ya cumplidos) ---------- */

html.js .page-inner .step .step-title,
.page-inner .step-title { color: var(--ink); }
/* el nodo lleno se apoya sobre la línea, no debajo */
.page-inner .step-node { position: relative; z-index: 3; }

/* ---------- Otras especialidades / La casa ---------- */

.otras-head { margin-left: var(--text-x); }
.otras-list {
  max-width: 1000px;
  margin-top: 28px;
  padding-left: var(--text-x);
}
.lane-head + .otras-list { margin-top: clamp(40px, 7vh, 72px); }
.otras-list li { border-top: 1px solid var(--divider); }
.otras-list li:last-child { border-bottom: 1px solid var(--divider); }
.otras-list a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  min-height: 88px;
  padding-block: 16px;
  text-decoration: none;
  color: var(--ink);
}
.otras-index {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .2em;
  font-variant-numeric: tabular-nums;
  color: var(--teal-text);
}
.otras-name {
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -.02em;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: anywhere;
  transition: color .35s var(--ease-air), translate .5s var(--ease-out);
}
.otras-list .arrow { color: var(--teal-text); margin-right: 4px; }
.otras-list a:hover .otras-name,
.otras-list a:focus-visible .otras-name { color: var(--teal-text); translate: 8px 0; }
.otras-list a:hover .arrow,
.otras-list a:focus-visible .arrow { width: 34px; }
.otras-list a:focus-visible { outline: 2px solid var(--teal-text); outline-offset: 4px; border-radius: 2px; }
.otras-list a:active .otras-name { color: var(--ink); }

/* ---------- La clínica: valores ---------- */

.valores {
  margin-top: clamp(40px, 7vh, 72px);
}
.valores li {
  --pad: clamp(28px, 4.4vh, 44px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: baseline;
  padding: var(--pad) 0 var(--pad) var(--text-x);
  border-top: 1px solid var(--divider);
}
.valores li:last-child { border-bottom: 1px solid var(--divider); }
/* em del nodo = tamaño del nombre: queda en el centro de su primera línea */
.valores li::before {
  font-size: clamp(40px, 5vw, 80px);
  left: calc(var(--rail-x) - var(--node) / 2);
  top: calc(var(--pad) + .5em - var(--node) / 2);
}
.valor-name {
  grid-column: 1 / span 6;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 1;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.valor-text {
  grid-column: 7 / span 6;
  font-size: 19px;
  color: var(--secondary);
  max-width: 26em;
  text-wrap: pretty;
}

/* ---------- La noche cálida (cierre de cada página interna) ---------- */

.sub-night {
  --night-pt: clamp(112px, 16vh, 176px);
  --dusk-top: 200px;
  --lit-top: 120px;
  --lx: 80%;
  --ly: 50%;
  position: relative;
  background: var(--night);
  color: #fff;
  padding-block: var(--night-pt);
  /* solo a los lados: el atardecer sube por encima de la costura */
  overflow-x: clip;
}
/* atardecer: las mismas paradas que .cierre::before de la portada */
.sub-night::before {
  content: "";
  position: absolute; left: 0; right: 0;
  top: calc(var(--dusk-top) * -1);
  height: calc(var(--dusk-top) + var(--lit-top) + 20px);
  z-index: 1;
  background: linear-gradient(to bottom,
    rgba(227, 233, 236, 0) 0%, #E3E9EC 24%, #C9D3DB 34%, #A3B3C4 44%,
    #7A8FA8 54%, #536A8A 64%, #33496D 74%, #1B3255 84%, #0C2242 93%, rgba(12, 34, 66, 0) 100%);
  pointer-events: none;
}

/* la pared de nogal de la recepción, ya encendida (receta de .night-wood en .is-on) */
.sub-night-wall {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(12, 34, 66, 0) 58%, rgba(12, 34, 66, .7) 100%),
    radial-gradient(ellipse 9% 58% at var(--lx, 80%) var(--lit-top, 120px), rgba(255, 196, 128, .75) 0%, rgba(255, 176, 104, .25) 45%, rgba(255, 170, 100, 0) 78%),
    url("../assets/img/pared-nogal-v6/0001.webp") 0 0 / 1024px 648px repeat;
  background-blend-mode: normal, soft-light, normal;
  --wash: radial-gradient(ellipse 8% 56% at var(--lx, 80%) var(--lit-top, 120px), #000 0%, rgba(0, 0, 0, .8) 24%, rgba(0, 0, 0, .28) 55%, transparent 82%);
  --spill: radial-gradient(ellipse 19% 30% at var(--lx, 80%) var(--ly, 50%), rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
  --dim: linear-gradient(to right, rgba(0, 0, 0, .03) 0%, rgba(0, 0, 0, .05) 40%, rgba(0, 0, 0, .12) 66%, rgba(0, 0, 0, .1) 88%, rgba(0, 0, 0, .02) 100%);
  -webkit-mask-image: var(--wash), var(--spill), var(--dim);
  mask-image: var(--wash), var(--spill), var(--dim);
  opacity: var(--wall-o, 1);
}

.sub-night-inner {
  position: relative;
  z-index: 3;
  padding-left: calc(var(--gutter) + var(--text-x));
  /* recorta el tramo de carril en el borde superior de la banda (los lados y abajo quedan libres) */
  clip-path: inset(calc(var(--night-pt) * -1) -100vw -100vw -100vw);
}
.sub-night-title {
  margin-top: 24px;
  max-width: 13em;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(38px, 5vw, 76px);
  line-height: 1.04;
  letter-spacing: -.025em;
  color: rgba(255, 255, 255, .94);
  text-wrap: balance;
}
.sub-night-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-top: 40px;
}
/* el carril baja desde la costura y termina en el centro del botón (56 px → 28 px),
   en la misma x que la línea de las secciones de día */
.sub-night-actions::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-x) - var(--text-x) - var(--rail-w) / 2);
  bottom: calc(100% - 28px);
  width: var(--rail-w);
  height: 3000px;
  background: linear-gradient(to right, rgba(151, 201, 203, .22) 0 2px, var(--teal-light) 2px 4px, rgba(151, 201, 203, .22) 4px);
  pointer-events: none;
}
.sub-night-actions::after {
  content: "";
  position: absolute;
  left: calc(var(--rail-x) - var(--text-x) - var(--node) / 2);
  top: calc(28px - var(--node) / 2);
  width: var(--node); height: var(--node);
  border-radius: 50%;
  background: var(--teal);
  pointer-events: none;
}

/* botón teal sobre la noche */
.btn-night {
  --h: 56px;
  gap: 14px;
  background: #2F7880;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
/* en hover el texto pasa a azul noche: blanco sobre --teal no llega a 4.5:1 */
.btn-night:hover { background: var(--teal); color: var(--night); }
.btn-night:hover .arrow,
.btn-night:focus-visible .arrow { width: 34px; }
.btn-night:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; }
.btn-night:active { background: #276A71; color: #fff; }

.sub-night-contact {
  display: grid;
  gap: 2px;
}
.sub-night-contact span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal-light);
}
.sub-night-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  transition: color .3s var(--ease-air);
}
.sub-night-contact a:hover { color: var(--teal-light); }
.sub-night-contact a:focus-visible { outline-color: var(--teal-light); }

/* la banda toca el footer azul sin costura visible */
main.sub:has(> .sub-night:last-child) + .site-footer { border-top-color: transparent; }

/* ---------- Agenda: toda la página es noche ---------- */

body.page-agenda { background: var(--night); color: #fff; }
body.page-agenda ::selection { background: var(--teal-light); color: var(--night); }
/* si site.js no escribe --hb aquí, el encabezado fijo se queda en azul noche */
.page-agenda .site-header.is-scrolled { background: var(--hb, rgba(12, 34, 66, .94)); }
.page-agenda .site-footer { border-top-color: rgba(255, 255, 255, .06); }

.agenda-hero {
  --lit-top: 0px;
  --lx: 81%;
  --ly: 50%;
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(56px, 10vh, 112px);
  overflow: clip;
}
.agenda-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
}
.agenda-copy { grid-column: 1 / span 7; min-width: 0; }
.agenda-copy .display { margin-top: 24px; color: #fff; }
.agenda-copy .display em { color: var(--teal-light); }
.agenda-copy .lede { margin-top: 24px; color: rgba(255, 255, 255, .78); }

/* selector de especialidad: radios en forma de píldora;
   el anillo vacío se llena al elegir (el mismo nodo hueco/lleno del carril) */
.picker { margin-top: 44px; }
.picker-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 16px;
}
.picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 22px 8px 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s var(--ease-air), color .3s var(--ease-air), border-color .3s var(--ease-air), transform .3s var(--ease-air);
}
.pick::before {
  content: "";
  position: absolute;
  left: 18px; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
  transition: background-color .3s var(--ease-air), box-shadow .3s var(--ease-air);
}
.pick:hover { border-color: var(--teal-light); }
.pick:active { transform: translateY(1px); }
.pick:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; border-radius: 999px; }
.pick[aria-checked="true"] {
  background: #EAF4F3;
  color: var(--night);
  border-color: transparent;
}
.pick[aria-checked="true"]::before {
  background: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}
.pick-unsure { border-style: dashed; }
.pick-unsure:hover { border-style: dashed; }

.agenda-summary {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.summary-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal-light);
}
.summary-msg {
  margin: 10px 0 24px;
  max-width: 34em;
  padding-left: 18px;
  border-left: 2px solid var(--teal);
  font-family: var(--font-display);
  font-size: 19px;
  font-style: normal;
  line-height: 1.45;
  color: rgba(255, 255, 255, .86);
  transition: opacity .25s var(--ease-air);
}
/* gancho opcional para el cambio de mensaje desde el script */
.summary-msg.is-swapping { opacity: 0; }
.agenda-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

/* el letrero retroiluminado, encendido y quieto */
.agenda-sign {
  grid-column: 9 / span 4;
  justify-self: center;
  align-self: center;
  width: clamp(280px, 26vw, 420px);
  margin: 0;
}
.agenda-sign-face { position: relative; display: block; width: 100%; }
.agenda-sign-face img { display: block; width: 100%; height: auto; }
.agenda-sign-halo {
  position: absolute; inset: 0;
  filter: brightness(0) drop-shadow(0 0 .75px #FFDCA6) drop-shadow(0 0 1.5px #FFC782) drop-shadow(0 0 5px rgba(255, 168, 92, .9)) drop-shadow(0 0 12px rgba(255, 146, 70, .45));
}
.agenda-sign-halo.wide {
  filter: brightness(0) drop-shadow(0 0 34px rgba(255, 150, 72, .5));
  opacity: .85;
}
/* cara de bronce en dos tonos (logo-bronce-v2): cinta teal en bronce claro, cinta azul en bronce oscuro */
.agenda-sign-logo {
  position: relative;
  opacity: 1;
  filter: drop-shadow(0 -1px 0 rgba(255, 214, 160, .7)) drop-shadow(0 1px 0 rgba(0, 0, 0, .55));
}
/* agenda: la luz nace bajo el techo, sin franja dura contra el encabezado */
.agenda-hero .sub-night-wall::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 140px;
  background: linear-gradient(to bottom, var(--night) 0%, rgba(12, 34, 66, .6) 45%, rgba(12, 34, 66, 0) 100%);
}

/* dock de la agenda: noche, con la elección en vivo */
.page-agenda .dock {
  background: rgba(12, 34, 66, .96);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .08);
}
.page-agenda .dock .btn-night { justify-content: center; min-width: 0; padding-inline: 18px; }
.page-agenda .dock .btn-night span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-agenda .dock-call { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.page-agenda .dock-call:hover { box-shadow: inset 0 0 0 1px var(--teal-light); }
.dock .is-updated { animation: dock-pick .6s var(--ease-air); }
@keyframes dock-pick {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 0 rgba(151, 201, 203, .55); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 12px rgba(151, 201, 203, 0); }
}

/* el mismo letrero, bajo la luz de la pared en el cierre de cada página interna */
.sub-night-sign {
  position: absolute;
  z-index: 2;
  left: var(--lx, 80%);
  top: 50%;
  width: clamp(220px, 19vw, 320px);
  margin: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* tablet: el título ocupa más ancho; el letrero se achica y baja al rincón de la luz */
@media (max-width: 1099px) {
  .sub-night-sign { width: clamp(160px, 22vw, 220px); top: 30%; }
  .sub-night-title { max-width: 58%; }
}
/* teléfono: el letrero corona el cierre, centrado bajo su propia luz, antes del texto */
@media (max-width: 767px) {
  .sub-night-sign { position: relative; left: auto; top: auto; transform: none; display: block; width: min(200px, 56vw); margin: 0 auto 40px; }
  .sub-night-title { max-width: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1099px) {
  .sub-hero-copy { grid-column: 1 / span 7; }
  .sub-art, .sub-photo { grid-column: 8 / span 5; }

  .valor-name { grid-column: 1 / span 5; }
  .valor-text { grid-column: 6 / span 7; }

  .agenda-copy { grid-column: 1 / span 7; }
  .agenda-sign { grid-column: 8 / span 5; }
  .agenda-hero { --lx: 79%; }

  /* luz en píxeles en pantallas estrechas (como .night-wood ≤1099 en main.css) */
  .sub-night-wall {
    background-size: auto, auto, 768px 486px;
    background-image:
      linear-gradient(to bottom, rgba(12, 34, 66, 0) 58%, rgba(12, 34, 66, .7) 100%),
      radial-gradient(ellipse 170px 460px at var(--lx, 80%) var(--lit-top, 120px), rgba(255, 196, 128, .7) 0%, rgba(255, 176, 104, .25) 45%, rgba(255, 170, 100, 0) 78%),
      url("../assets/img/pared-nogal-v6/0001.webp");
    --wash: radial-gradient(ellipse 190px 460px at var(--lx, 80%) var(--lit-top, 120px), #000 0%, rgba(0, 0, 0, .78) 22%, rgba(0, 0, 0, .3) 52%, transparent 80%);
    --spill: radial-gradient(ellipse 210px 170px at var(--lx, 80%) var(--ly, 50%), rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
  }
}

/* ---------- Móvil ---------- */

@media (max-width: 767px) {
  .page-inner {
    --rail-x: 8.5px;   /* centro de .step-node en móvil: margin-left 2px + 13px / 2 */
    --text-x: 28px;    /* = .lane-head en móvil */
  }

  .crumbs { margin-bottom: 20px; }
  .sub-hero { padding-block: 32px 48px; }
  .sub-hero-grid { display: block; }
  .sub-title { margin-top: 18px; line-height: 1; }
  .sub-hero-copy .lede { margin-top: 20px; }
  .sub-actions { margin-top: 28px; }
  .sub-actions .btn { flex: 1 1 auto; }
  .sub-art, .sub-photo {
    width: min(78vw, 340px);
    margin: 40px 0 0 var(--text-x);
  }

  .page-inner .has-rail { --rail-pt: 64px; --rail-pb: 40px; }
  .page-inner .sub-pasos.has-rail { --rail-pt: 56px; --rail-pb: 32px; }
  .page-inner .otras.has-rail { --rail-pt: 56px; }
  .page-inner .has-rail:has(+ .sub-night) { --rail-pb: 160px; }

  .motivos { margin-top: 32px; }
  .motivos li { --pad: 18px; font-size: clamp(22px, 6.4vw, 26px); }

  /* los pasos alinean su texto con el resto del carril (28 px) */
  .page-inner .step { grid-template-columns: var(--text-x) minmax(0, 1fr); }

  .otras-list { margin-top: 20px; }
  .lane-head + .otras-list { margin-top: 32px; }
  .otras-list a {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    column-gap: 12px;
    min-height: 72px;
  }
  .otras-name { font-size: clamp(24px, 7vw, 30px); }
  .otras-list .arrow { margin-right: 2px; }

  .valores { margin-top: 32px; }
  .valores li { display: block; --pad: 26px; }
  .valores li::before { font-size: clamp(36px, 10vw, 44px); }
  .valor-name { font-size: clamp(36px, 10vw, 44px); }
  .valor-text { margin-top: 12px; font-size: 17px; }

  .sub-night {
    --dusk-top: 120px;
    --lx: 50%;
    --ly: 16%;
    --wall-o: .6;
  }
  .sub-night-title { margin-top: 20px; }
  .sub-night-actions { flex-direction: column; align-items: stretch; gap: 24px; margin-top: 36px; }
  .sub-night-actions .btn-night { width: 100%; }

  .agenda-hero {
    --lx: 50%;
    --ly: calc(24px + 132px * .29);
    --wall-o: .6;
    min-height: 0;
    padding-block: 32px 72px;
    align-items: start;
  }
  .agenda-grid { display: flex; flex-direction: column; gap: 20px; }
  /* el letrero baja a 132 px: el selector entra antes y el dock confirma la elección */
  .agenda-sign { order: -1; width: 132px; align-self: center; }
  .agenda-hero { padding-top: 24px; }
  .agenda-sign-halo {
    filter: brightness(0) drop-shadow(0 0 .75px #FFDCA6) drop-shadow(0 0 1.5px #FFC782) drop-shadow(0 0 3px rgba(255, 168, 92, .9)) drop-shadow(0 0 8px rgba(255, 146, 70, .45));
  }
  .agenda-copy .display { margin-top: 18px; font-size: clamp(36px, 10.4vw, 44px); line-height: 1.05; }
  .agenda-copy .lede { margin-top: 18px; font-size: 17px; }
  .picker { margin-top: 32px; }
  .picker-label { font-size: 19px; }
  .pick {
    flex: 0 1 calc(50% - 5px);
    min-width: 0;
    padding: 8px 12px 8px 28px;
    font-size: 15px;
    hyphens: manual;
    -webkit-hyphens: manual;
    overflow-wrap: anywhere;
  }
  .pick::before { left: 13px; }
  /* «Otorrinolaringología» no cabe en media columna: fila propia, todas las píldoras en una línea */
  .pick-unsure, .pick-long { flex-basis: 100%; }
  .agenda-summary { margin-top: 32px; padding-top: 24px; }
  .summary-msg { font-size: 18px; }
  .agenda-cta-row { flex-direction: column; align-items: stretch; gap: 20px; }
  .agenda-cta-row .btn-night { width: 100%; }
}

/* ---------- Movimiento reducido: todo es estático; sin desplazamientos ---------- */

@media (prefers-reduced-motion: reduce) {
  .otras-name,
  .crumbs a,
  .pick, .pick::before,
  .summary-msg,
  .sub-night-contact a { transition: none; }
  .otras-list a:hover .otras-name,
  .otras-list a:focus-visible .otras-name { translate: none; }
  .pick:active, .btn-night:active { transform: none; }
  .dock .is-updated { animation: none; }
}
