/* marzal: sistema visual (heredado de tools). Todo color, espacio y radio de la interfaz
   sale de estos tokens. La hoja del formulario (pii.css) es la excepción: copia los
   colores de la plantilla Word. */
:root {
  --c-fondo: #f6f5f1;
  --c-superficie: #ffffff;
  --c-texto: #1d2125;
  --c-texto-suave: #545b63;
  --c-borde: #dad6cd;
  --c-borde-fuerte: #b9b4a8;
  --c-acento: #1f6b5c;
  --c-sobre-acento: #ffffff;
  --c-acento-suave: #e2eeea;
  --c-aviso-fondo: #fcf2d4;
  --c-aviso-borde: #b98d12;
  --c-aviso-texto: #4f3c06;
  --c-error: #a3271f;
  --c-foco: #1f6b5c;

  --e-1: .25rem; --e-2: .5rem; --e-3: .75rem; --e-4: 1rem; --e-5: 1.5rem; --e-6: 2rem; --e-7: 3rem;
  --r-1: 4px; --r-2: 8px;
  --t-chico: .875rem; --t-base: 1rem; --t-medio: 1.125rem; --t-grande: 1.5rem; --t-titulo: 1.875rem;
  --ancho: 64rem;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-fondo: #121416;
    --c-superficie: #1a1d20;
    --c-texto: #e8e5de;
    --c-texto-suave: #a5abb1;
    --c-borde: #2d3236;
    --c-borde-fuerte: #454b51;
    --c-acento: #6cc3ad;
    --c-sobre-acento: #0c1a16;
    --c-acento-suave: #1b2c28;
    --c-aviso-fondo: #2c2513;
    --c-aviso-borde: #c9a227;
    --c-aviso-texto: #f1dfa3;
    --c-error: #f08a80;
    --c-foco: #8fd8c5;
    color-scheme: dark;
  }
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-fondo);
  color: var(--c-texto);
  font: var(--t-base)/1.55 var(--fuente);
}
main { flex: 1; padding-block: var(--e-6) var(--e-7); }
h1 { font-size: var(--t-titulo); line-height: 1.2; margin: 0 0 var(--e-2); letter-spacing: -.01em; }
h2 { font-size: var(--t-medio); margin: 0 0 var(--e-3); }
p { margin: 0 0 var(--e-3); }
a { color: var(--c-acento); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--c-foco); outline-offset: 2px; border-radius: var(--r-1); }
[hidden] { display: none !important; }
.contenedor { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: var(--e-4); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icono {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.saltar { position: absolute; left: var(--e-4); top: -3rem; padding: var(--e-2) var(--e-3); background: var(--c-acento); color: var(--c-sobre-acento); border-radius: var(--r-1); z-index: 1; }
.saltar:focus { top: var(--e-2); }

/* --- Barra y pie ---------------------------------------------------------------- */
.barra { border-bottom: 1px solid var(--c-borde); background: var(--c-superficie); }
.barra-interior { display: flex; align-items: center; justify-content: space-between; gap: var(--e-4); min-height: 3.5rem; }
.marca { color: var(--c-texto); text-decoration: none; font-weight: 650; }
.marca span { color: var(--c-texto-suave); font-weight: 450; }
.sello { display: flex; align-items: center; gap: var(--e-2); margin: 0; font-size: var(--t-chico); color: var(--c-acento); }
@media (max-width: 34rem) {
  .sello span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .marca span { display: none; }
}
.pie { border-top: 1px solid var(--c-borde); padding-block: var(--e-5); font-size: var(--t-chico); color: var(--c-texto-suave); }
.pie p { max-width: 42rem; }

/* --- Índice ------------------------------------------------------------------- */
.portada { max-width: 42rem; margin-bottom: var(--e-5); }
.bajada { color: var(--c-texto-suave); font-size: var(--t-medio); max-width: 42rem; }
.categoria { margin-bottom: var(--e-6); }
.categoria h2 { font-size: var(--t-chico); text-transform: uppercase; letter-spacing: .06em; color: var(--c-texto-suave); }
.lista-herramientas {
  list-style: none; margin: 0; padding: 0;
  background: var(--c-superficie); border: 1px solid var(--c-borde); border-radius: var(--r-2);
}
.lista-herramientas li + li { border-top: 1px solid var(--c-borde); }
.lista-herramientas a {
  display: flex; align-items: center; gap: var(--e-4);
  padding: var(--e-4); color: var(--c-texto); text-decoration: none;
}
.lista-herramientas a:hover { background: var(--c-acento-suave); }
.lista-herramientas li:first-child a { border-radius: var(--r-2) var(--r-2) 0 0; }
.lista-herramientas li:last-child a { border-radius: 0 0 var(--r-2) var(--r-2); }
.lista-icono {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none;
  border-radius: var(--r-2); background: var(--c-acento-suave); color: var(--c-acento);
}
.lista-texto { display: flex; flex-direction: column; gap: var(--e-1); flex: 1; }
.lista-texto span { color: var(--c-texto-suave); font-size: var(--t-chico); }
.lista-flecha { color: var(--c-texto-suave); }
.lista-herramientas a:hover .lista-flecha { color: var(--c-acento); }

/* --- Comunes ---------------------------------------------------------------------- */
.migas { display: flex; gap: var(--e-2); font-size: var(--t-chico); color: var(--c-texto-suave); margin-bottom: var(--e-3); }

/* Estados */
.vacio { color: var(--c-texto-suave); }
.error { color: var(--c-error); font-weight: 550; }

/* Avisos */
.aviso {
  display: flex; gap: var(--e-2); align-items: flex-start;
  padding: var(--e-3); border: 1px solid var(--c-aviso-borde); border-radius: var(--r-1);
  background: var(--c-aviso-fondo); color: var(--c-aviso-texto); font-size: var(--t-chico);
}
.aviso .icono { margin-top: .1em; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; gap: var(--e-2);
  min-height: 2.5rem; padding: var(--e-2) var(--e-3);
  font: inherit; font-size: var(--t-chico); font-weight: 550; text-decoration: none; cursor: pointer;
  color: var(--c-acento); background: transparent;
  border: 1px solid var(--c-acento); border-radius: var(--r-1);
}
.boton:hover { background: var(--c-acento-suave); }
.boton:disabled { opacity: .45; cursor: not-allowed; background: transparent; }
.boton-sutil { border-color: transparent; color: var(--c-texto-suave); }
.boton-primario { background: var(--c-acento); color: var(--c-sobre-acento); }
.boton-primario:hover { background: var(--c-acento); opacity: .9; }

.solo-impresion { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .lista-herramientas a, .boton { transition: background-color .12s ease, color .12s ease; }
}

/* --- Impresión: la interfaz no va al papel (la hoja, en pii.css) --------------------- */
@media print {
  .barra, .pie, .migas, .saltar { display: none !important; }
  main { padding: 0; }
}
