/* ==========================================================================
   PROTEC CHILE — Dossier operativo
   Sistema visual propio: azul marino institucional, retícula técnica,
   tipografía condensada Archivo y amarillo de acción solo para decisiones.
   ========================================================================== */

@import url("/assets/theme/fonts.css");

:root {
  --ink: #06152a;
  --ink-2: #0a1f38;
  --primary: #022243;
  --primary-ui: #113a66;
  --steel: #2b4270;
  --teal: #2e6c7b;
  --accent: #e7e64e;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --line: #dbe2eb;
  --muted: #5c6b80;
  --text: #10233b;
  --on-dark: #e9eff7;

  --line-dark: rgba(233, 239, 247, 0.14);
  --line-dark-strong: rgba(233, 239, 247, 0.26);
  --on-dark-muted: #9aabc2;

  --wrap: 1240px;
  --gutter: clamp(1.15rem, 3.2vw, 2.6rem);
  /* Ritmo: la separación entre secciones se ajusta a la tensión del contenido,
     no al revés. Bajó de 7.5rem a 5.2rem: la portada perdía ~900 px de aire. */
  --section-y: clamp(3rem, 5.6vw, 5.2rem);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 2rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.75rem);
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --step-5: clamp(2.5rem, 1.5rem + 4.2vw, 4.8rem);

  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@view-transition {
  navigation: auto;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.028em !important;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
/* Jerarquía: la portada tiene un solo titular de escala grande (el hero). Los
   h2 de sección bajan un paso para que compitan menos y la página respire.
   El cierre (banda de CTA) recupera la escala grande como segundo momento. */
h2 { font-size: var(--step-3); }
.cta-band h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.015em; line-height: 1.18; }
h4 { font-size: var(--step-1); font-weight: 700; line-height: 1.28; }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary-ui); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary); }

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

ul, ol { margin: 0 0 1.1em; padding-left: 1.15em; }
li { margin-bottom: 0.35em; }

strong { font-weight: 650; }

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

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

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

.skip-link {
  position: absolute; left: 0; top: -100px; z-index: 200;
  background: var(--accent); color: var(--ink); padding: 0.8rem 1.4rem;
  font-family: var(--font-mono); font-size: 0.82rem; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; color: var(--ink); }

/* ------------------------------------------------------------------ layout */
.wrap {
  width: min(100% - var(--gutter) * 2, var(--wrap));
  margin-inline: auto;
}

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}

.section { padding-block: var(--section-y); position: relative; }
.section--paper { background: var(--paper); }
.section--surface { background: var(--surface); }
.section--ink { background: var(--ink); color: var(--on-dark); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink a { color: var(--on-dark); }
.section--tight { padding-block: clamp(2.2rem, 4vw, 3.4rem); }

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

/* Marca de sección: número + rótulo mono + regla que corre al borde */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  /* Neutro: el amarillo queda reservado a la acción. La regla hereda el color
     del rótulo, así funciona igual sobre papel y sobre azul marino. */
  background: currentColor;
  opacity: 0.5;
  flex: 0 0 26px;
}
.section--ink .eyebrow { color: var(--on-dark-muted); }

.section-head { max-width: 44ch; margin-bottom: clamp(1.6rem, 2.6vw, 2.4rem); }
.section-head--wide { max-width: 62ch; }
.section-head h2 + p { margin-top: 1rem; color: var(--muted); font-size: var(--step-1); line-height: 1.55; }
.section--ink .section-head h2 + p { color: var(--on-dark-muted); }

/* ------------------------------------------------ firma: marcas de esquina */
/* Firma de la marca: cuatro esquinas de registro, como en un plano impreso.
   Se dibujan en el color del texto para no gastar el amarillo de acción. */
.ticks { position: relative; }
.ticks::before, .ticks::after,
.ticks > .tick-b, .ticks > .tick-c {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  opacity: 0.45;
  pointer-events: none;
}
.ticks::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ticks::after { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.ticks > .tick-b { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.ticks > .tick-c { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ----------------------------------------------------------------- botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #f2f16a; color: var(--ink); }

.btn-ghost { border-color: var(--line-dark-strong); color: var(--on-dark); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(231, 230, 78, 0.06); }

.btn-outline { border-color: var(--line); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary); background: var(--surface); color: var(--primary); }

.btn-sm { padding: 0.6rem 1rem; font-size: 0.78rem; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.02em; color: var(--primary-ui); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 0.2rem;
}
.link-arrow:hover { color: var(--primary); gap: 0.75rem; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in oklab, var(--ink) 94%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line-dark);
  color: var(--on-dark);
}
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0 128px, var(--steel) 128px 100%);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.6rem);
  padding-block: 0.7rem;
  min-height: 76px;
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 44px; width: auto; }
.brand:hover { opacity: 0.94; }

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 1.8vw, 1.7rem); margin-left: auto; }
.nav a {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark);
  text-decoration: none;
  padding-block: 0.4rem;
  position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--accent); transition: right 0.25s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }
/* La página actual se marca con el filete, no con el amarillo: es posición, no acción. */
.nav a[aria-current="page"] { color: #fff; }

.header-actions { display: flex; align-items: center; gap: 0.7rem; }
.header-phone {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--on-dark);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone span { display: block; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 400; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-dark-strong);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

@media (max-width: 1080px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-phone { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.6rem var(--gutter) 1rem;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line-dark);
  }
  .nav.is-open a { padding-block: 0.85rem; width: 100%; border-bottom: 1px solid var(--line-dark); }
}

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--on-dark);
  overflow: hidden;
  padding-block: clamp(2.6rem, 6vw, 5rem) 0;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, var(--line-dark) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, var(--line-dark) 0 1px, transparent 1px 88px);
  mask-image: radial-gradient(120% 90% at 78% 10%, #000 0%, transparent 78%);
  opacity: 0.5;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-dark-strong) 20%, var(--line-dark-strong) 80%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.6rem, 4vw, 3.6rem);
  align-items: end;
  padding-bottom: clamp(2rem, 4vw, 3.2rem);
}

.hero-copy { padding-bottom: 0.5rem; min-width: 0; }

.hero-title {
  font-size: clamp(2.15rem, 1.1rem + 3.7vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.035em !important;
  line-height: 0.95;
  margin-bottom: 1.1rem;
  color: #fff;
  text-wrap: balance;
  hyphens: manual;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--on-dark-muted);
  max-width: 46ch;
  margin-bottom: 1.9rem;
}

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

.hero-badges {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  list-style: none; padding: 0; margin: 1.8rem 0 0;
}
.hero-badges li {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.36rem 0.65rem;
  border: 1px solid var(--line-dark-strong);
  border-radius: 2px;
  color: var(--on-dark-muted);
  margin: 0;
}

.hero-figure { position: relative; }
.hero-frame {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line-dark-strong);
  padding: 8px;
}
.hero-frame picture, .hero-frame img { width: 100%; }
.hero-frame img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}
.hero-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.25rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.hero-caption .live { color: var(--accent); display: inline-flex; align-items: center; gap: 0.4rem; }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(231, 230, 78, 0.6);
  animation: pulse 2.4s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(231, 230, 78, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(231, 230, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 230, 78, 0); }
}

.hero-status {
  border-top: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.02);
}
.hero-status-inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-block: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  overflow: hidden;
}
.hero-status-inner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-figure { order: -1; }
  .hero-frame img { aspect-ratio: 16 / 10; }
}

@media (max-width: 560px) {
  .hero { padding-top: 1.6rem; }
  .hero-title { font-size: clamp(1.95rem, 8.4vw, 2.55rem); letter-spacing: -0.03em; }
  .hero-lead { font-size: 1rem; }
  .hero-actions .btn { width: 100%; }
  .hero-caption { font-size: 0.58rem; letter-spacing: 0.08em; }
  .hero-status-inner { font-size: 0.6rem; letter-spacing: 0.08em; }
  .section-head h2 + p { font-size: 1rem; }
  .wa-float { font-size: 0.72rem; padding: 0.65rem 0.9rem; }

  /* La cabecera es lo primero que desborda en pantallas pequeñas */
  .header-inner { gap: 0.55rem; min-height: 64px; padding-block: 0.55rem; }
  .brand img { height: 34px; width: auto; }
  .nav-toggle { padding: 0.45rem 0.6rem; font-size: 0.66rem; letter-spacing: 0.06em; }
  .header-actions { gap: 0.4rem; }
  .header-actions .btn { padding: 0.5rem 0.7rem; font-size: 0.7rem; letter-spacing: 0.03em; }
}

/* ------------------------------------------------------------------ franja */
.franja { background: var(--surface); border-bottom: 1px solid var(--line); }
.franja-head {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-block: 1.6rem 1.1rem;
}
.franja-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.franja-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
  list-style: none;
  padding: 0;
}
.franja-items li {
  margin: 0;
  /* Aire simétrico: el texto no debe tocar el filete que separa columnas. */
  padding: 1.4rem 1.5rem 1.5rem;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.5rem;
  align-content: start;
}
.franja-items li:first-child { padding-left: 0; }
.franja-items li:last-child { border-right: 0; }
.franja-items img { max-height: 46px; width: auto; object-fit: contain; filter: grayscale(1) opacity(0.85); }
.franja-items li:hover img { filter: none; }
.franja-items strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.01em !important;
  color: var(--text);
}
.franja-items span { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }
.franja-placeholder {
  width: 46px; height: 46px; border: 1px dashed var(--line);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted);
}
.franja-mark { height: 38px; width: auto; opacity: 0.32; filter: grayscale(1); }
.franja-items li:hover .franja-mark { opacity: 0.55; }

/* --------------------------------------------------------------- servicios */
.services-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.service-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 72px minmax(0, 0.95fr) minmax(0, 1.15fr) 132px;
  gap: clamp(1rem, 2.4vw, 2.4rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.2rem);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.2s var(--ease);
}
.service-row::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.service-row:hover { background: var(--surface); }
.service-row:hover::before { transform: scaleY(1); }
.service-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 0.35rem;
}
.service-title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; letter-spacing: -0.025em; line-height: 1.06; margin: 0 0 0.35rem; }
.service-sub { display: block; font-size: 0.88rem; color: var(--muted); margin: 0.2rem 0 0; }
.service-excerpt { font-size: 0.94rem; color: var(--muted); line-height: 1.6; margin: 0.15rem 0 0; }
.service-go {
  justify-self: end;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-ui);
  display: inline-flex; align-items: center; gap: 0.4rem;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .service-row { grid-template-columns: 56px minmax(0, 1fr); }
  .service-excerpt, .service-go { grid-column: 2; }
  .service-go { justify-self: start; }
}

/* ------------------------------------------------------------------ cifras */
.cifras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-dark-strong);
  list-style: none;
  padding: 0;
  margin: 0;
}
.cifras-grid li {
  margin: 0;
  /* Misma regla: una cifra nunca se apoya en el filete de su columna. */
  padding: 1.6rem 1.8rem 1.8rem;
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.cifras-grid li:first-child { padding-left: 0; }
.cifras-grid li:last-child { border-right: 0; }
.cifra-valor {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em !important;
  line-height: 1;
  /* Las cifras son dato, no acción: blanco sobre el azul marino. */
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.55rem;
  display: block;
}
.cifra-etiqueta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
}
.cifra-detalle { font-size: 0.85rem; color: var(--on-dark-muted); line-height: 1.55; margin: 0; }

/* ---------------------------------------------------------------- nosotros */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(1.6rem, 4vw, 3.6rem);
  align-items: start;
}
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

.split-figure { position: relative; }
.split-figure img {
  width: 100%;
  aspect-ratio: 5 / 4.2;
  object-fit: cover;
  filter: saturate(0.9);
}
.split-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.7rem;
  display: flex; justify-content: space-between; gap: 1rem;
}

.prose { font-size: 1.02rem; line-height: 1.72; max-width: 60ch; }
.prose p + p { margin-top: 1.1rem; }

.bullets-check { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.65rem; }
.bullets-check li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 0.7rem;
  font-size: 0.94rem; margin: 0; align-items: start;
}
.bullets-check li::before {
  content: "";
  width: 14px; height: 14px; margin-top: 0.35rem;
  border: 1px solid var(--accent); position: relative;
}
.bullets-check li::before { content: "✓"; border: 0; font-size: 0.8rem; color: var(--teal); font-weight: 700; margin-top: 0.05rem; }

.pullquote {
  margin: 1.8rem 0 0;
  padding: 1.2rem 0 0 1.4rem;
  border-left: 2px solid var(--steel);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em !important;
}
.pullquote cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------- operación */
.operacion-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: start;
}
@media (max-width: 980px) { .operacion-grid { grid-template-columns: 1fr; } }

.operacion-figure { position: relative; border: 1px solid var(--line-dark-strong); padding: 8px; background: var(--ink-2); }
.operacion-figure img { aspect-ratio: 4 / 3.2; object-fit: cover; width: 100%; filter: grayscale(0.35) contrast(1.08) brightness(0.92); }
.operacion-figure figcaption {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--on-dark-muted); padding-top: 0.65rem;
}

.protocols { list-style: none; padding: 0; margin: 1.8rem 0 0; border-top: 1px solid var(--line-dark); }
.protocols li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line-dark);
  margin: 0;
}
.protocols .code {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--on-dark-muted); padding-top: 0.2rem;
}
.protocols strong { display: block; font-family: var(--font-display); font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 0.15rem; color: #fff; }
.protocols p { font-size: 0.88rem; color: var(--on-dark-muted); margin: 0; line-height: 1.55; }

/* ---------------------------------------------------------------- sectores */
.sectores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  list-style: none;
  padding: 0;
  margin: 0;
}
.sectores-grid li {
  margin: 0;
  padding: 1.4rem 1.4rem 1.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background 0.2s var(--ease);
}
.sectores-grid li:hover { background: var(--paper); }
.sectores-grid strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.015em !important;
  margin-bottom: 0.35rem;
}
.sectores-grid span { font-size: 0.85rem; color: var(--muted); line-height: 1.5; display: block; }
.sectores-grid .idx {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  color: var(--muted); background: var(--paper); border: 1px solid var(--line);
  padding: 0.1rem 0.35rem;
  display: inline-block; margin-bottom: 0.7rem;
}

/* ---------------------------------------------------------------- proceso */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line-dark-strong);
}
.steps li {
  margin: 0;
  /* Aire simétrico, igual que en cifras y respaldos. */
  padding: 1.5rem 1.5rem 1.7rem;
  border-right: 1px solid var(--line-dark);
}
.steps li:first-child { padding-left: 0; }
.steps li:last-child { border-right: 0; }
.steps .num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--on-dark-muted);
  display: block;
  margin-bottom: 0.9rem;
}
.steps strong { display: block; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -0.015em; color: #fff; margin-bottom: 0.4rem; }
.steps p { font-size: 0.88rem; color: var(--on-dark-muted); margin: 0; line-height: 1.6; }

/* ------------------------------------------------------------- testimonios */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.quotes blockquote {
  margin: 0;
  background: var(--surface);
  padding: clamp(1.3rem, 2.4vw, 1.9rem);
}
.quotes p {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.45;
  letter-spacing: -0.01em !important;
  margin-bottom: 1.1rem;
}
.quotes footer { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.quotes footer strong { display: block; font-family: var(--font-text); font-size: 0.85rem; letter-spacing: 0; text-transform: none; color: var(--text); margin-bottom: 0.15rem; }

/* --------------------------------------------------------------------- faq */
.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding-block: 0.3rem;
}
.faq summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.15rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.015em !important;
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { content: "−"; color: var(--primary); }
.faq details[open] summary { color: var(--primary); }
.faq-body { padding: 0 0 1.4rem 2.1rem; max-width: 70ch; color: var(--muted); font-size: 0.96rem; }
@media (max-width: 640px) { .faq-body { padding-left: 0; } }

/* --------------------------------------------------------------------- cta */
.cta-band {
  background: var(--ink);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  /* Halo frío de acero: el amarillo no se usa como atmósfera. */
  background: radial-gradient(90% 120% at 88% 0%, rgba(233, 239, 247, 0.07), transparent 62%);
  pointer-events: none;
}
.cta-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: clamp(1.4rem, 3vw, 3rem);
  align-items: center;
  padding-block: clamp(2.6rem, 5vw, 4.2rem);
}
@media (max-width: 860px) { .cta-inner { grid-template-columns: 1fr; } }
.cta-inner h2 { color: #fff; margin-bottom: 0.7rem; }
.cta-inner p { color: var(--on-dark-muted); max-width: 52ch; margin: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* --------------------------------------------------------- páginas internas */
.page-hero {
  background: var(--ink);
  color: var(--on-dark);
  padding-block: clamp(2.6rem, 5vw, 4.4rem) clamp(2.2rem, 4vw, 3.4rem);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, var(--line-dark) 0 1px, transparent 1px 88px);
  opacity: 0.4;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.6rem); color: #fff; margin-bottom: 0.9rem; max-width: 20ch; }
.page-hero .lead { font-size: var(--step-1); color: var(--on-dark-muted); max-width: 58ch; margin: 0; }
.page-hero .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* Dato de ficha, no acción: el amarillo no se gasta en rótulos. */
  color: var(--on-dark-muted);
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-dark);
}

.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-dark-muted);
  padding-block: 0.9rem;
}
.breadcrumbs a { color: var(--on-dark-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-current] { color: var(--on-dark); }
.breadcrumbs li { margin: 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr);
  gap: clamp(1.8rem, 4vw, 3.6rem);
  align-items: start;
}
@media (max-width: 940px) { .two-col { grid-template-columns: 1fr; } }

.aside-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.4rem;
  position: sticky;
  top: 100px;
}
.aside-card h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.aside-list { list-style: none; margin: 0; padding: 0; }
.aside-list li {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding-block: 0.7rem;
  border-bottom: 1px dashed var(--line);
  margin: 0;
  font-size: 0.88rem;
}
.aside-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.aside-list .k {
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.aside-list .v { color: var(--text); line-height: 1.5; }

.numbered-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); counter-reset: n; }
.numbered-list li {
  counter-increment: n;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.3rem;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.numbered-list li::before {
  content: counter(n, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 0.25rem;
}
.numbered-list strong { display: block; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.015em; margin-bottom: 0.25rem; }
.numbered-list p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  margin-block: 1.8rem;
}
.notice h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.notice p { color: var(--muted); font-size: 0.94rem; }

/* --------------------------------------------------------------- contacto */
.contacto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: start;
}
@media (max-width: 940px) { .contacto-layout { grid-template-columns: 1fr; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.field label .req { color: var(--primary); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.field textarea { resize: vertical; min-height: 128px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary-ui);
  box-shadow: 0 0 0 3px rgba(17, 58, 102, 0.12);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: #b42318; }

.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.82rem; color: var(--muted); }
.consent input { width: 16px; height: 16px; margin-top: 0.2rem; accent-color: var(--primary); }

.form-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.9rem; }
.form-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.alert { padding: 0.9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: 0.9rem; border: 1px solid; }
.alert-error { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #05603a; }
.alert ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.contact-blocks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.contact-blocks li {
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line);
  margin: 0;
  display: grid;
  gap: 0.2rem;
}
.contact-blocks .k {
  font-family: var(--font-mono); font-size: 0.64rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.contact-blocks .v { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.contact-blocks a { text-decoration: none; }
.contact-blocks a:hover { text-decoration: underline; }

.map-frame { border: 1px solid var(--line); padding: 8px; background: var(--surface); margin-top: 1.4rem; }
.map-frame iframe { width: 100%; height: 260px; border: 0; display: block; }
.map-frame .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.3; }

.consent {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.2rem 0 1.2rem;
}
.consent input { width: 16px; height: 16px; margin: 0.15rem 0 0; accent-color: var(--primary); }
.consent label { line-height: 1.5; }

.page-hero .excerpt {
  font-size: 1rem;
  color: var(--on-dark-muted);
  max-width: 62ch;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-dark);
}

/* ------------------------------------------------------- ficha de servicio */
.dossier-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 940px) { .dossier-head { grid-template-columns: 1fr; } }

.spec-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.9rem; }
.spec-table th, .spec-table td { text-align: left; padding: 0.7rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.spec-table th {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; width: 42%;
}

.checklist-plain { list-style: none; padding: 0; margin: 0; }
.checklist-plain li {
  padding: 0.62rem 0 0.62rem 1.7rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  margin: 0;
  font-size: 0.94rem;
}
.checklist-plain li::before {
  content: "";
  position: absolute; left: 0; top: 1rem;
  width: 9px; height: 9px;
  /* Marca de casilla del dossier, en secundario. */
  border: 1px solid var(--steel);
  background: var(--steel);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 2rem;
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* -------------------------------------------------------------- colecciones */
.collection-hero {
  background: var(--ink);
  color: var(--on-dark);
  padding-block: clamp(2.4rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}
.collection-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, var(--line-dark) 0 1px, transparent 1px 88px);
  opacity: 0.35;
}
.collection-hero .wrap { position: relative; }
.collection-hero h1 { color: #fff; max-width: 22ch; }
.collection-hero p { color: var(--on-dark-muted); max-width: 60ch; font-size: var(--step-1); }

/* ------------------------------------------------------------------ buscar */
.search-form { display: flex; gap: 0.6rem; margin-block: 1.6rem 2.4rem; flex-wrap: wrap; }
.search-form input {
  flex: 1 1 260px; font: inherit; padding: 0.8rem 1rem;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  background: var(--ink);
  color: var(--on-dark-muted);
  padding-top: clamp(2.8rem, 5vw, 4.4rem);
  border-top: 1px solid var(--line-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.7fr));
  gap: clamp(1.6rem, 3vw, 2.8rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
@media (max-width: 940px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand img { height: 40px; width: auto; margin-bottom: 1.1rem; }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; max-width: 34ch; }
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 500;
  margin-bottom: 0.9rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; font-size: 0.88rem; }
.footer-col a { color: var(--on-dark-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  justify-content: space-between;
  align-items: center;
  padding-block: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: #7d8ea6;
}
.footer-bottom a { color: #7d8ea6; }
.footer-bottom a:hover { color: var(--accent); }

.wa-float {
  position: fixed;
  right: clamp(0.9rem, 2vw, 1.6rem);
  bottom: clamp(0.9rem, 2vw, 1.6rem);
  z-index: 80;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--ink);
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 12px 28px -12px rgba(6, 21, 42, 0.7), 0 0 0 1px rgba(6, 21, 42, 0.12);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.wa-float:hover { background: #f2f16a; color: var(--ink); transform: translateY(-2px); }
.wa-float svg { width: 27px; height: 27px; fill: currentColor; }
.wa-float .wa-label {
  position: absolute;
  right: calc(100% + 10px);
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--on-dark);
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  pointer-events: none;
}
.wa-float:hover .wa-label,
.wa-float:focus-visible .wa-label { opacity: 1; transform: translateX(0); }

/* -------------------------------------------------------------- error page */
.error-page { background: var(--ink); color: var(--on-dark); min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.error-wrap { max-width: 620px; text-align: left; }
.error-code { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.3em; color: var(--accent); margin: 0 0 1rem; }
.error-wrap h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.error-message { color: var(--on-dark-muted); margin-bottom: 1.8rem; }
.error-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 2rem; }
.error-nav { display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.error-nav a { color: var(--on-dark-muted); }

/* ---------------------------------------------------- animaciones de entrada */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 26%;
    }
    @keyframes reveal-in {
      from { opacity: 0; transform: translateY(18px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }
}

/* La línea de perímetro: trazo que se dibuja con el scroll en la portada */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .perimeter {
      position: fixed;
      left: 0; top: 0; bottom: 0;
      width: 2px;
      /* Trazo de perímetro en azul acero: marca el avance del scroll sin
         competir con el amarillo reservado a la acción. */
      background: var(--steel);
      transform-origin: top;
      transform: scaleY(0);
      animation: draw-perimeter linear both;
      animation-timeline: scroll(root block);
      z-index: 95;
      opacity: 0.85;
    }
    @keyframes draw-perimeter { to { transform: scaleY(1); } }
  }
}

/* Piezas de apoyo para plantillas interiores */
.section-foot { margin-top: clamp(1.6rem, 3vw, 2.4rem); }
.block-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.022em !important;
  margin: clamp(2rem, 4vw, 3rem) 0 1rem;
}
.aside-cta { margin-top: 1.4rem; }
.btn-block { width: 100%; }
.cta-band--inline { margin-top: clamp(2.4rem, 5vw, 4rem); }
.cta-band--inline .cta-inner { padding-inline: 0; }
.dossier-head > * { min-width: 0; }
.message-body p { margin-bottom: 0.9rem; }

/* ------------------------------------------------------------- impresión */
@media print {
  .site-header, .wa-float, .cta-band, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; }
}

/* === ajuste-tipografico === */
/* Titulares: el tilde de la Ñ, las tildes y la diéresis necesitan aire vertical.
   Se conserva la tensión del diseño (tracking cerrado) sin que los acentos se
   monten sobre la línea anterior ni se recorten en la primera línea. */
:where(h1, h2, h3, h4, h5, h6, .hero-title, [class*="hero-title"], [class*="display-title"], [class*="titular"]) {
  line-height: 1.10 !important;
  letter-spacing: -0.018em !important;
  padding-block-start: 0.08em;
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: manual;
  font-kerning: normal;
}
:where(h1, h2, .hero-title) {
  line-height: 1.14 !important;
  letter-spacing: -0.022em !important;
  padding-block-start: 0.12em;
}
/* Rótulos y etiquetas en mayúsculas: mismo cuidado con el tilde */
:where(.eyebrow, .kicker, .overline, .label, .tag) {
  line-height: 1.5 !important;
}
/* === fin ajuste-tipografico === */
/* ==========================================================================
   Gráfica del sistema: plano de instalación y flujo del protocolo
   ========================================================================== */
.plano, .flujo {
  margin: 0;
  border: 1px solid var(--line-dark-strong);
  background: var(--ink-2);
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
}
.plano-svg, .flujo-svg { width: 100%; height: auto; display: block; color: var(--accent); }
.plano-svg text, .flujo-svg text { font-family: var(--font-mono); }
.plano-label { font-size: 9px; letter-spacing: 0.14em; fill: var(--on-dark-muted); }
.plano-code { font-size: 10px; letter-spacing: 0.1em; fill: var(--accent); }
.plano-pie, .flujo-pie {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 0.7rem; margin-top: 0.7rem;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--on-dark-muted);
}
.flujo-nodo rect { fill: rgba(255,255,255,.03); stroke: var(--line-dark-strong); }
.flujo-nodo--final rect { stroke: var(--accent); }
.flujo-code { font-size: 10px; letter-spacing: 0.12em; fill: var(--accent); }
.flujo-name { font-size: 15px; font-weight: 700; fill: #fff; font-family: var(--font-display); }.flujo-desc { font-size: 9px; letter-spacing: 0.06em; fill: var(--on-dark-muted); }
.flujo-flechas path { stroke: var(--line-dark-strong); stroke-width: 1.4; fill: none; }
.flujo-flechas .flujo-punta { fill: var(--accent); stroke: none; }
.flujo-linea path { stroke: var(--accent); stroke-opacity: .5; stroke-width: 1.2; fill: none; }

/* ==========================================================================
   Transiciones de página (View Transitions API)
   ========================================================================== */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-salida 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
::view-transition-new(root) {
  animation: vt-entrada 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes vt-salida {
  to { opacity: 0; transform: scale(0.994) translateY(6px); filter: blur(1px); }
}
@keyframes vt-entrada {
  from { opacity: 0; transform: scale(1.006) translateY(-6px); filter: blur(1px); }
}
::view-transition-group(sitio-header) { animation-duration: 0.42s; }
.site-header { view-transition-name: sitio-header; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ==========================================================================
   Capa app: adaptación móvil específica (no es responsive, es otra interfaz)
   ========================================================================== */
.mobile-dock { display: none; }

@media (max-width: 860px) {
  html { scroll-behavior: smooth; }
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }

  /* barra inferior de acciones */
  .mobile-dock {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 95;
    display: grid;
    /* Cinco acciones: inicio, servicios, agenda, cotizar y llamar. */
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--ink) 93%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
    border-top: 1px solid var(--line-dark-strong);
  }
  .dock-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 7px 2px; border-radius: 10px;
    color: var(--on-dark-muted); text-decoration: none;
    font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: 0.07em; text-transform: uppercase;
    transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  }
  .dock-item svg { width: 21px; height: 21px; }
  .dock-item:active { transform: scale(0.93); }
  .dock-item.is-active { color: #fff; }
  .dock-item--cta { background: var(--accent); color: var(--ink); font-weight: 700; }
  .dock-item--cta.is-active { background: #f2f16a; color: var(--ink); }

  .wa-float, .wa-float--app {
    width: 48px; height: 48px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    right: 14px;
  }
  .wa-float svg { width: 24px; height: 24px; }
  .wa-float .wa-label { display: none; }

  /* cabecera compacta tipo app */
  .site-header::before { height: 2px; }
  .header-inner { min-height: 56px; padding-block: 0.45rem; }
  .brand img { height: 32px; }
  .nav-toggle {
    padding: 0.5rem 0.7rem; border-radius: 8px;
    font-size: 0.62rem; letter-spacing: 0.08em;
  }

  /* menú a pantalla completa, como hoja de app */
  .nav.is-open {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: calc(84px + env(safe-area-inset-top)) 22px 28px;
    background: color-mix(in oklab, var(--ink) 97%, transparent);
    backdrop-filter: blur(22px);
    z-index: 120;
    animation: sheet-in 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .nav.is-open a {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line-dark);
    width: 100%;
  }
  .nav.is-open a[aria-current="page"] { color: #fff; }
  .nav.is-open::after {
    content: "PROTEC CHILE · Seguridad desde 1988";
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--on-dark-muted);
  }
  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* portada tipo app: imagen a sangre, texto debajo, acciones grandes */
  .hero { padding-block: 0 0; }
  .hero-grid { gap: 1.1rem; padding-bottom: 1.4rem; }
  .hero-figure { margin-inline: calc(var(--gutter) * -1); }
  .hero-frame { border: 0; padding: 0; }
  .hero-frame img { aspect-ratio: 16 / 11; filter: saturate(0.9); }
  .hero-caption { padding-inline: var(--gutter); }
  .hero-title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-lead { font-size: 0.98rem; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 0.55rem; }
  .hero-actions .btn { width: 100%; min-height: 50px; }
  .hero-badges { gap: 0.35rem; }
  .hero-badges li { font-size: 0.58rem; padding: 0.3rem 0.5rem; }
  .hero-status-inner { font-size: 0.58rem; letter-spacing: 0.06em; }

  /* servicios como carrusel horizontal con snap */
  .services-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 0 0.6rem;
    border-top: 0;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }
  .services-list::-webkit-scrollbar { display: none; }
  .services-list > li { scroll-snap-align: start; }
  .service-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1.05rem 1.1rem 1.15rem;
    min-height: 232px;
    height: 100%;
  }
  .service-row::before { display: none; }
  .service-code { padding-top: 0; }
  .service-title { font-size: 1.3rem; }
  .service-sub { font-size: 0.82rem; }
  /* El extracto sigue a la bajada; el que se ancla al pie de la tarjeta es el
     enlace, no el texto (antes quedaba un hueco muerto en medio). */
  .service-excerpt { font-size: 0.86rem; }
  .service-go { margin-top: auto; padding-top: 0.6rem; }

  /* cifras en dos columnas con separadores finos */
  .cifras-grid { grid-template-columns: 1fr 1fr; }
  .cifras-grid li { padding: 1.1rem 0.9rem 1.2rem 0; }
  .cifras-grid li:nth-child(2n) { border-right: 0; padding-left: 0.9rem; }
  .cifra-valor { font-size: 1.9rem; }

  /* sectores en tarjetas táctiles */
  .sectores-grid { grid-template-columns: 1fr 1fr; }
  .sectores-grid li { padding: 0.9rem 0.8rem 1rem; }

  /* proceso como pasos verticales con línea */
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .steps li {
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
    /* El sangrado móvil reemplaza el aire de columna del escritorio. */
    padding: 1.1rem 0 1.2rem 1.6rem;
    position: relative;
  }
  .steps li::before {
    content: "";
    position: absolute; left: 0; top: 1.5rem;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--on-dark-muted);
  }
  .steps li::after {
    content: "";
    position: absolute; left: 3.5px; top: 2.2rem; bottom: 0;
    width: 1px; background: var(--line-dark);
  }
  .steps li:last-child { border-bottom: 0; }
  .steps li:last-child::after { display: none; }

  /* documentos gráficos a sangre */
  .plano, .flujo { margin-inline: calc(var(--gutter) * -1); border-inline: 0; }

  /* CTA final como bloque app */
  .cta-inner { grid-template-columns: 1fr; gap: 1.1rem; padding-block: 2.2rem; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; min-height: 50px; }

  /* formularios: campos altos y táctiles */
  .field input, .field select, .field textarea { min-height: 50px; font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .consent { font-size: 0.8rem; }

  /* pie de página compacto */
  .site-footer { padding-top: 2.2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
.operacion-figuras { display: flex; flex-direction: column; gap: 1.1rem; }
.operacion-flujo { margin-top: clamp(1.6rem, 3vw, 2.4rem); }
.operacion-flujo .flujo { border-color: var(--line-dark); background: transparent; }
@media (max-width: 860px) {
  .operacion-figuras { gap: 0.8rem; }
  .plano-pie, .flujo-pie { font-size: 0.56rem; letter-spacing: 0.06em; }
}
/* En móvil el CTA vive en la barra inferior: se evita duplicarlo arriba */
@media (max-width: 860px) {
  .header-actions { display: none; }
}
/* WhatsApp en la cabecera (móvil): reemplaza al flotante, que tapaba lectura */
.header-wa {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-dark-strong);
  color: var(--on-dark);
  text-decoration: none;
}
.header-wa svg { width: 19px; height: 19px; fill: currentColor; }
.header-wa:active { transform: scale(0.94); }

@media (max-width: 860px) {
  .header-wa { display: inline-flex; }
  .wa-float { display: none; }
}
/* Corrección: en móvil la cabecera muestra WhatsApp + Menú (el CTA vive abajo) */
@media (max-width: 860px) {
  .header-actions { display: flex !important; }
  .header-actions .btn,
  .header-actions .header-phone { display: none !important; }
}
/* El backdrop-filter del encabezado crea un contenedor para position:fixed y
   atrapaba la hoja de menú dentro de la cabecera. En móvil se desactiva. */
@media (max-width: 860px) {
  .site-header {
    backdrop-filter: none;
    background: var(--ink);
  }
}
/* La hoja de menú deja visible la cabecera (logo + Cerrar) y gana opacidad */
@media (max-width: 860px) {
  .nav.is-open {
    z-index: 80;
    padding: calc(96px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--ink) 99%, transparent);
    backdrop-filter: blur(8px);
  }
  .nav.is-open a { font-size: 1.7rem; padding-block: 1.05rem; }
}
/* Ajuste final de la hoja de menú: queda debajo de la cabecera (logo + Cerrar) */
@media (max-width: 860px) {
  .nav.is-open {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 22px calc(28px + env(safe-area-inset-bottom));
    background: var(--ink);
    backdrop-filter: none;
    overflow-y: auto;
  }
  .nav.is-open a { font-size: 1.65rem; padding-block: 0.95rem; }
  .nav.is-open::after { padding-top: 1.4rem; }
}

/* ==========================================================================
   Correcciones de dirección de arte (ver docs/IDENTIDAD.md)
   ========================================================================== */

/* C2 · Recuperar la tensión tipográfica del titular: el ajuste de glifos dejó
   todos los titulares en 1.14, que aplana el contraste entre el hero y las
   secciones. El hero vuelve a 1.06 con aire de glifo suficiente para tildes. */
.hero-title {
  line-height: 1.06 !important;
  letter-spacing: -0.032em !important;
}
.page-hero h1,
.collection-hero h1 {
  line-height: 1.08 !important;
}

/* C3 · El ritmo también se lee en los remates: menos aire muerto en el cierre. */
.cta-inner { padding-block: clamp(2.2rem, 4vw, 3.4rem); }
.section--tight { padding-block: clamp(1.8rem, 3vw, 2.6rem); }

/* C1 · Los diagramas técnicos se dibujan en acero claro y sus rótulos en blanco:
   el amarillo no es tinta de plano, señala el desenlace del protocolo. */
.plano-svg { color: #93a8c1; }
.plano-svg text { fill: var(--on-dark-muted); }
.plano-label { fill: #c7d3e3; }
.plano-code { fill: #fff; }
.plano-leyenda text { font-size: 9px; letter-spacing: 0.1em; fill: var(--on-dark-muted); }
.flujo-svg { color: var(--on-dark-muted); }
.flujo-name { fill: #fff; }
.flujo-code { fill: #fff; }
.flujo-flechas path { stroke: color-mix(in oklab, var(--on-dark-muted) 55%, transparent); }
.flujo-flechas .flujo-punta { fill: var(--on-dark-muted); stroke: none; }
.flujo-linea path { stroke: color-mix(in oklab, var(--on-dark-muted) 60%, transparent); }

/* C4 · Retícula de columnas: aire simétrico junto a los filetes y sectores que
   cierran la retícula en dos filas exactas (ocho sectores = cuatro columnas). */
@media (min-width: 1100px) {
  .sectores-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* C5 · Los diagramas técnicos son dibujos: en móvil se leen tal cual, con
   desplazamiento horizontal, en vez de comprimirse a un texto de 5 px. */
@media (max-width: 860px) {
  .plano, .flujo {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    max-width: 100%;
    margin-inline: calc(var(--gutter) * -1);
  }
  .plano-svg, .flujo-svg { min-width: 620px; }
  .plano-pie, .flujo-pie { font-size: 0.6rem; }
  /* Sin esto el dibujo (620 px) fija el ancho mínimo de la columna y desborda
     la página: el ancho lo decide la pantalla, no el contenido desplazable. */
  .operacion-grid,
  .operacion-grid > *,
  .operacion-figuras { min-width: 0; }
}

/* Nota de apoyo en la ficha de servicio */
.aside-note {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
.aside-cta .btn + .btn { margin-top: 0.5rem; }

/* ==========================================================================
   Agenda de citas (vistas del motor) — vestida con el sistema de la marca
   Azul marino de base, retícula de plano y amarillo sólo en la acción.
   ========================================================================== */

/* --- retícula: misma anchura y mismo margen que el resto del sitio ------- */
.ag-wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); }

/* --- cabecera: el mismo plano que las páginas internas ------------------- */
.ag-hero {
  background: var(--ink);
  color: var(--on-dark);
  border-bottom: 1px solid var(--line-dark);
  padding-block: clamp(2rem, 4.4vw, 3.4rem) clamp(1.7rem, 3vw, 2.4rem);
  position: relative;
  overflow: hidden;
}
.ag-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, var(--line-dark) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, var(--line-dark) 0 1px, transparent 1px 88px);
  mask-image: linear-gradient(180deg, #000, transparent 82%);
  opacity: 0.45;
  pointer-events: none;
}
.ag-hero .ag-wrap { position: relative; }
.ag-crumbs {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--on-dark-muted);
  margin-bottom: 1.6rem;
}
.ag-crumbs a { color: var(--on-dark-muted); }
.ag-crumbs a:hover { color: #fff; }
.ag-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin: 0 0 1.2rem;
}
.ag-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  flex: 0 0 26px;
  background: currentColor;
  opacity: 0.5;
}
.ag-hero h1 {
  color: #fff;
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
  letter-spacing: -0.028em;
  max-width: 24ch;
}
.ag-lead {
  color: var(--on-dark-muted);
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 56ch;
  margin: 0;
}
.ag-facts {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  gap: 0.5rem 1.4rem;
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-dark);
}
.ag-facts strong { color: #fff; }

/* --- cuerpo y pasos ------------------------------------------------------ */
.ag-body { padding-block: clamp(1.8rem, 3.6vw, 3rem) clamp(2.4rem, 4.6vw, 3.6rem); }
.ag-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 1.8vw, 1.4rem);
}
.ag-step-head { gap: 0.8rem; margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); }
.ag-step-head--inline { border-bottom: 0; padding-bottom: 0; }
.ag-step-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.ag-step-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2 !important;
}

/* --- 01 servicio: fichas de línea, no tarjetas --------------------------- */
/* Con cuatro servicios, dos columnas cierran la retícula (3+1 dejaba un hueco);
   el ancho evita que la descripción se corte en cuatro líneas. */
.ag-services { gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ag-service {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  font-family: var(--font-text);
}
.ag-service:hover { border-color: var(--steel); background: color-mix(in oklab, var(--ink) 3%, transparent); }
.ag-service.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}
.ag-service-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.012em;
}
.ag-service-detail { font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.ag-service-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  gap: 0.7rem;
}
.ag-simple-form input {
  border-radius: var(--radius);
  border-color: var(--line);
}

/* --- 02 calendario: retícula fina, selección en azul marino -------------- */
.ag-month { border-radius: var(--radius); border-color: var(--line); padding: 0.75rem 0.8rem 0.85rem; }
.ag-month-head {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.5rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.ag-month-nav { color: var(--primary-ui); border-radius: 2px; padding: 0.1rem 0.35rem; }
.ag-month-nav:hover { background: var(--paper); color: var(--ink); }
.ag-cal th {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.ag-day { border-radius: 2px; font-size: 0.82rem; }
.ag-day.is-selected { background: var(--ink); color: #fff; font-weight: 700; }
a.ag-day:hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.ag-day.is-off { color: color-mix(in oklab, var(--muted) 42%, transparent); }

/* --- 03 horas: misma retícula que los días ------------------------------- */
.ag-chosen {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.ag-slot span { border-radius: 2px; border-color: var(--line); font-variant-numeric: tabular-nums; }
.ag-slot input:hover + span { border-color: var(--steel); }
.ag-slot input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}
.ag-slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- 04 datos: los mismos campos que el formulario de contacto ----------- */
.ag-fields { gap: 0.9rem 1rem; }
.ag-field label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.ag-field input,
.ag-field textarea {
  border-radius: var(--radius);
  border-color: var(--line);
  font-family: var(--font-text);
}
.ag-field input:focus,
.ag-field textarea:focus {
  border-color: var(--primary-ui);
  box-shadow: 0 0 0 3px rgba(17, 58, 102, 0.12);
}
.ag-consent { font-size: 0.82rem; }
.ag-consent input { accent-color: var(--ink); }
.ag-consent a { color: var(--primary-ui); }

/* --- acción: el único amarillo de la pantalla ---------------------------- */
.ag-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 52px;
  padding: 0.95rem 1.5rem;
}
.ag-btn:hover { background: #f2f16a; border-color: #f2f16a; color: var(--ink); }
.ag-btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0.01em;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
}
.ag-btn-ghost:hover { border-color: var(--primary-ui); color: var(--primary-ui); }
.ag-note { font-size: 0.78rem; }

/* --- lateral: fichas del sistema ---------------------------------------- */
.ag-card { border-radius: var(--radius); border-color: var(--line); }
.ag-card--soft {
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--steel);
}
.ag-card-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 500;
}
.ag-summary dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ag-summary dd { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.ag-card--soft p { font-size: 0.86rem; color: var(--muted); line-height: 1.6; margin: 0; }
.ag-contact span { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; }
.ag-contact a { color: var(--primary-ui); }

/* --- confirmación: el vale de la cita ----------------------------------- */
.ag-ticket { border-radius: var(--radius); border: 1px solid var(--line); }
.ag-ticket-label { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; }
.ag-ticket-code {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.ag-ticket-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-ui);
}
.ag-next h2 {
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  line-height: 1.2 !important;
}
.ag-next-list li { font-size: 0.9rem; }

/* --- alertas ----------------------------------------------------------- */
.ag-alert {
  border-radius: var(--radius);
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: #912018;
}

/* --- móvil: la barra inferior ya reserva el espacio del dock ------------ */
@media (max-width: 900px) {
  .ag-body { padding-bottom: clamp(2rem, 5vw, 2.8rem); }
  .ag-aside { position: static; }
}
@media (max-width: 560px) {
  .ag-hero { padding-block: 1.5rem 1.4rem; }
  .ag-hero h1 { font-size: clamp(1.65rem, 7.4vw, 2.1rem); }
  .ag-lead { font-size: 0.96rem; }
  .ag-facts { font-size: 0.62rem; letter-spacing: 0.08em; }
  .ag-step { padding: 0.9rem; }
  .ag-slot span { min-height: 48px; }
  .ag-btn { width: 100%; }
  .ag-month { padding: 0.6rem 0.65rem 0.7rem; }
  .ag-ticket-code { font-size: clamp(1.4rem, 7vw, 1.9rem); }
}

/* ==========================================================================
   Pase de detalle · hoja de menú, láminas alineadas y retícula que cierra
   ========================================================================== */

/* El reset no incluía figure y el margen del navegador (1em 40px) metía cada
   lámina 40 px dentro de su columna: la foto no arrancaba en la retícula y las
   marcas de esquina quedaban flotando. */
figure { margin: 0; }

/* --- la compañía: el sello ISO cierra la lámina, no la columna de texto --- */
.split-side { min-width: 0; }
.split-frame {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
}
@media (min-width: 981px) {
  .split-side { display: flex; flex-direction: column; }
  .split-side .pullquote { margin-top: clamp(1.1rem, 2vw, 1.6rem); }
}
/* En la columna, el sello se lee como anotación de la foto: mismo aire que el pie. */
.split-side .pullquote { max-width: 54ch; }

/* --- central de operaciones: el registro se estira hasta el pie de la lámina */
.operacion-registro { min-width: 0; }
@media (min-width: 981px) {
  .operacion-grid { align-items: stretch; }
  .operacion-registro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .operacion-registro .protocols { margin-bottom: clamp(1.2rem, 2.4vw, 2rem); }
  .operacion-registro .operacion-flujo { margin-top: 0; }
}
@media (max-width: 980px) {
  .operacion-registro { display: block; }
}
/* En la franja de 981-1100 px las dos columnas estrangulaban los diagramas:
   se consultan a tamaño real con scroll interno, como en móvil. */
@media (min-width: 981px) and (max-width: 1100px) {
  .plano, .flujo {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    max-width: 100%;
  }
  .operacion-registro .flujo { margin-inline: 0; }
  .plano-svg, .flujo-svg { min-width: 620px; }
}

/* --- respaldos: la retícula cierra a 2 columnas antes de apilarse ---------- */
@media (min-width: 561px) and (max-width: 900px) {
  .franja-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .franja-items li { padding: 1.2rem 1.2rem 1.35rem; }
  .franja-items li:first-child { padding-left: 0; }
  .franja-items li:nth-child(2n) { border-right: 0; padding-right: 0; }
  .franja-items li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  /* Apilado, el aire de columna se vuelve sangría: todos los sellos alinean. */
  .franja-items li { padding: 1.15rem 0 1.3rem; border-right: 0; }
  .franja-items li + li { border-top: 1px solid var(--line); }
}

/* --- menú móvil: botón de 42 px y hoja que cabe --------------------------- */
.nav-toggle-icon { display: block; width: 19px; height: 19px; grid-area: 1 / 1; }
.nav-toggle-icon--cerrar { opacity: 0; }
.nav-sheet-foot { display: none; }

@media (max-width: 1080px) {
  /* El botón deja de ser una píldora de texto: icono de 19 px en 42 × 42.
     (El mismo botón sirve al menú desplegable de 861-1080 px.) */
  .nav-toggle {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin-left: auto;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-dark-strong);
    border-radius: 2px;
    background: transparent;
    color: var(--on-dark);
    transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
  }
  .nav-toggle:hover { border-color: var(--on-dark); color: #fff; }
  /* Estado abierto: el botón se rellena (sobre cabecera oscura, en papel) y el
     icono invierte, para que aria-expanded sea visible sin gastar el amarillo. */
  .nav-toggle[aria-expanded="true"] {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon--abrir { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon--cerrar { opacity: 1; }
}

@media (max-width: 860px) {
  body.menu-abierto { overflow: hidden; }

  /* La hoja es hija de la cabecera: logo, botón y acciones tienen que quedar
     por encima de su fondo para poder cerrarla (y para ver aria-expanded). */
  .header-inner > .brand,
  .header-inner > .nav-toggle,
  .header-inner > .header-actions { position: relative; z-index: 85; }

  /* La hoja ocupa la pantalla; la cabecera queda arriba y el pie, despejado. */
  .nav.is-open {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(96px + env(safe-area-inset-top)) 22px calc(96px + env(safe-area-inset-bottom));
    background: var(--ink);
    border: 0;
    z-index: 80;
    backdrop-filter: none;
  }
  .nav.is-open a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding-block: 0.85rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--on-dark);
    border-bottom: 1px solid var(--line-dark);
  }
  /* En pantallas cortas la hoja hace scroll; ninguna fila se comprime. */
  .nav.is-open > a,
  .nav.is-open .nav-sheet-foot { flex: 0 0 auto; }
  .nav.is-open a[aria-current="page"] { color: #fff; }
  .nav.is-open::after { content: none; }

  /* Pie de la hoja: el dato de turno, como el pie de un parte. */
  .nav.is-open .nav-sheet-foot {
    display: block;
    margin-top: auto;
    padding-top: clamp(1.6rem, 6vw, 2.4rem);
  }
  .nav-sheet-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--on-dark-muted);
    margin: 0 0 0.55rem;
  }
  .nav.is-open .nav-sheet-phone {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0 0 0.5rem;
    border: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
  }
  .nav-sheet-meta {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--on-dark-muted);
    margin: 0;
  }

  /* La barra inferior y el flotante no se cuelan bajo la hoja. */
  body.menu-abierto .mobile-dock,
  body.menu-abierto .wa-float { display: none !important; }

  /* El flotante ya no se dibuja en móvil (la cabecera ofrece WhatsApp), pero
     se conserva con tamaño: display:none dejaba su SVG en 0 × 0. */
  .wa-float { display: inline-flex; visibility: hidden; pointer-events: none; }

  /* Rótulos de la barra: un punto más de cuerpo para que se lean. */
  .dock-item { font-size: 0.56rem; letter-spacing: 0.06em; }
}

/* Las piezas técnicas no dependen de que el navegador deduzca la proporción. */
.plano-svg { aspect-ratio: 640 / 400; min-height: 180px; }
.flujo-svg { aspect-ratio: 628 / 186; min-height: 110px; }

/* Código de sector: el rótulo gana contraste sin salir de la escala neutra. */
.sectores-grid .idx { color: var(--primary-ui); font-size: 0.66rem; }

/* Pie del plano apilado en móvil: dos datos largos no caben en una línea. */
@media (max-width: 560px) {
  .plano-pie { flex-direction: column; gap: 0.25rem; }
  /* "ISO 9001" a 1,9 rem toca el filete de su columna; baja un paso. */
  .cifra-valor { font-size: 1.7rem; }
  /* Titular de la central: a 1,8 rem "documentada." quedaba sola en su línea. */
  .h2-registro { font-size: 1.7rem; }
}
