/* Blueprint Gamma — «Plano Gamma» (docs/DISENO.md §9 y §10).
 *
 * Los colores y el logo de Gamma (su verde y su tinta casi negra) sobre papel
 * con cuadrícula tenue, y el plano verde casi negro para el mapa, la entrada y
 * las portadas. Lo que pide atención va en ámbar, no en el verde de la marca. */

@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fuentes/figtree-latin-400-normal.7bfd10a3def3.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("../fuentes/figtree-latin-400-italic.5b322d9b8f64.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fuentes/figtree-latin-500-normal.94e34f97c4c6.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fuentes/figtree-latin-600-normal.4376f5953b85.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fuentes/figtree-latin-700-normal.70aaa6879de5.woff2") format("woff2"); }

:root {
  /* La marca de Gamma: tinta casi negra y su verde, el del líquido del matraz. */
  --papel: #f3f5f3;
  --hoja: #ffffff;
  --tinta: #15181b;
  --tinta-suave: #5b6168;
  --linea: #dde2df;
  --linea-fuerte: #c5ccc8;
  --tenue: #edf1ee;
  --acento: #1b7650;
  --acento-hover: #21905f;
  --verde: #2bb673;
  --aviso: #b8650a;
  --aviso-suave: #fcefd9;
  /* El plano: verde casi negro, como el fondo del ícono de Gamma. */
  --prusia: #0f1b16;
  --prusia-2: #17291f;
  --cielo: #9fdcbc;
  --bien: #2bb673;
  --riel: 264px;
  --barra: 64px;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(21, 24, 27, 0.06), 0 8px 24px -12px rgba(21, 24, 27, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Figtree, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinta);
  background-color: var(--papel);
  background-image:
    linear-gradient(rgba(21, 24, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 24, 27, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
/* Se siente aplicación: sin zoom por doble toque, sin texto que se selecciona solo. */
a, button, label, summary, .pick, .renglon-gestos, .barra, .riel { touch-action: manipulation; }
button, .boton, .barra, .riel nav, .pick, .estado, .mover { -webkit-user-select: none; user-select: none; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.8em; }
small { color: var(--tinta-suave); }
code { font-size: 0.9em; background: var(--tenue); padding: 0.1em 0.35em; border-radius: 4px; }
.tenue { color: var(--tinta-suave); }
.centrado { text-align: center; }

/* ---------------------------------------------------------------- riel */
.riel {
  position: fixed; inset: 0 auto 0 0; width: var(--riel);
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 14px 16px;
  background: var(--hoja); border-right: 1px solid var(--linea);
  overflow-y: auto; z-index: 30;
}
.marca { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; padding: 2px 6px 0; }
.marca img { display: block; width: 168px; height: auto; }
.marca-blueprint {
  display: inline-flex; align-items: baseline; gap: 4px; margin: 0; padding: 2px 10px; border-radius: 999px;
  background: var(--prusia); color: var(--verde); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.marca-blueprint small { color: var(--cielo); font-weight: 500; letter-spacing: 0; text-transform: none; }
/* Buscar va al fondo: se usa menos que las secciones. */
.buscar-riel { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--linea); }
.buscar-riel input { width: 100%; }
.indice { display: flex; flex-direction: column; gap: 2px; }
.indice a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px;
  border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 0.94rem;
}
.indice a:hover { background: var(--tenue); }
.indice a.actual { background: var(--tinta); color: #fff; }
.indice .n {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  font-size: 0.78rem; font-weight: 700; border: 1.5px solid var(--linea-fuerte);
}
.indice a.actual .n { border-color: var(--verde); color: var(--verde); }

/* ---------------------------------------------------------------- hoja */
.hoja { margin-left: var(--riel); padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: calc(var(--riel) + 1120px); }
body.acceso .hoja, body:not(:has(.riel)) .hoja { margin-left: 0; max-width: none; }
.miga { font-size: 0.9rem; margin-bottom: 14px; color: var(--tinta-suave); }
.miga a { text-decoration: none; font-weight: 600; color: var(--tinta-suave); }
.miga a:hover { color: var(--tinta); }
.sobre { margin: 0 0 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acento); }

.tarjeta {
  background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--sombra);
}
.tarjeta.atencion { border-color: #f0cf9c; background: linear-gradient(0deg, #fff, #fffaf1); }
.tarjeta-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tarjeta-cabeza h2 { margin: 0; }
.tarjeta-cabeza a { font-weight: 600; font-size: 0.92rem; color: var(--acento); text-decoration: none; padding: 8px 0; }

/* ---------------------------------------------------------------- botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--acento);
  background: var(--acento); color: #fff; font: inherit; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; transition: transform 0.08s ease, background 0.15s ease;
}
.boton:hover { background: var(--acento-hover); border-color: var(--acento-hover); }
.boton:active { transform: scale(0.98); }
.boton.claro { background: var(--hoja); color: var(--acento); }
.boton.claro:hover { background: var(--tenue); }
.boton.chico { min-height: 36px; padding: 6px 12px; font-size: 0.86rem; border-radius: 10px; }
.boton.peligro { background: var(--hoja); color: #b4321b; border-color: #e8a594; }
.boton.ancho { width: 100%; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.botonera { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------------------------------------------------------------- avisos */
.avisos { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 460px); }
.aviso { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--tinta); color: #fff; font-weight: 600; box-shadow: var(--sombra); transition: opacity 0.4s ease, transform 0.4s ease; }
.aviso-error { background: #b4321b; }
.aviso-warning { background: #8a5a00; }
.aviso.se-fue { opacity: 0; transform: translateY(-8px); }
form .aviso, .formulario .aviso { position: static; transform: none; }

/* ---------------------------------------------------------------- portada */
.plano {
  position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 22px;
  background: var(--prusia); color: #fff; box-shadow: 0 18px 40px -22px rgba(10, 20, 16, 0.8);
}
.plano-cabeza { padding: 22px 26px 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; }
.plano-cabeza > div { min-width: 0; }
.plano-cabeza .sobre { color: var(--verde); }
.plano-cabeza h1 { color: #fff; font-size: 1.55rem; margin: 0; }
.plano-total { margin: 4px 0 0; color: var(--cielo); }
.plano-total b { color: #fff; font-size: 1.1rem; }
.plano-dibujo svg { display: block; width: 100%; height: auto; }
.plano-dibujo .mapa-alto { display: none; }
.mapa a { cursor: pointer; }
.mapa a:hover circle:nth-of-type(2), .mapa a:focus circle:nth-of-type(2) { stroke-opacity: 0.6; }

.portada-rejilla { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.columna > .tarjeta:last-child { margin-bottom: 0; }
.avance-lista { list-style: none; padding: 0; margin: 0; }
.avance-lista a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 110px 48px; align-items: center; gap: 10px;
  min-height: 46px; padding: 6px 8px; border-radius: 10px; text-decoration: none;
}
.avance-lista a:hover { background: var(--tenue); }
.avance-lista .n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--tenue); font-size: 0.78rem; font-weight: 700; }
.avance-lista .nombre { font-weight: 600; }
.avance-lista .pct { text-align: right; font-weight: 700; }
.pct.flojo { color: var(--aviso); }
.barra-avance { width: 100%; height: 8px; display: block; }
.barra-avance .fondo { fill: var(--tenue); }
.barra-avance .lleno { fill: var(--acento); }
.barra-avance .lleno.flojo { fill: var(--aviso); }
.sencilla { list-style: none; padding: 0; margin: 0; }
.sencilla li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.sencilla li:last-child { border-bottom: 0; }
.sencilla a { text-decoration: none; }
.sencilla a:hover b { color: var(--acento); }
.estado-entrega { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-weight: 600; font-size: 0.78rem; background: var(--tenue); }
.estado-entrega.al-dia { background: #e0f3e8; color: var(--acento); }
.estado-entrega.vieja { background: var(--aviso-suave); color: #8a4b00; }

/* ---------------------------------------------------------------- sección */
.cabeza-seccion { margin-bottom: 22px; }
.cabeza-seccion h1 { font-size: 2.2rem; margin-bottom: 4px; }
.pregunta { font-size: 1.15rem; color: var(--tinta-suave); margin-bottom: 14px; }
.avance-seccion { display: grid; grid-template-columns: minmax(120px, 260px) auto; align-items: center; gap: 14px; font-size: 0.92rem; color: var(--tinta-suave); }
.avance-seccion b { color: var(--tinta); }

.lienzo { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 6px; }
.lienzo svg { display: block; max-width: 100%; height: auto; }
.lienzo svg.organigrama, .lienzo svg.procesos, .lienzo svg.historia { max-width: none; }
.lienzo.grande svg { max-width: none; }
.leyenda-riesgos { list-style: none; padding: 0; margin: 14px 0 0; columns: 2; column-gap: 24px; }
.leyenda-riesgos li { break-inside: avoid; padding: 4px 0; }
.leyenda-riesgos .num { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--tinta); color: #fff; font-size: 0.78rem; font-weight: 700; }
.leyenda-riesgos a { text-decoration: none; font-weight: 600; }

.renglones { list-style: none; padding: 0; margin: 0; }
.renglon {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 0 14px 14px; border-bottom: 1px solid var(--linea); border-left: 3px solid transparent;
  scroll-margin-top: 20px;
}
.renglon:last-child { border-bottom: 0; }
.renglon:target { background: #fffaf0; }
.renglon.s-vacio { border-left: 3px dashed var(--linea-fuerte); }
.renglon.s-borrador { border-left-color: var(--linea-fuerte); }
.renglon.s-listo { border-left-color: var(--tinta); }
.renglon-titulo { display: block; font-weight: 700; font-size: 1.02rem; text-decoration: none; margin: 0 0 4px; }
a.renglon-titulo:hover { color: var(--acento); }
.renglon-titulo small { font-weight: 500; margin-left: 4px; }
.renglon-texto p { margin: 0 0 4px; }
.renglon-texto .multi { color: var(--tinta-suave); font-size: 0.94rem; }
.guia { color: var(--tinta-suave); font-style: italic; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.84rem; color: var(--tinta-suave); margin: 4px 0 0; }
.meta a { color: var(--tinta-suave); }
.sello { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--aviso-suave); color: #8a4b00; font-weight: 600; }
.renglon-gestos { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 360px; }

.estado { display: inline-flex; border: 1.5px solid var(--linea-fuerte); border-radius: 12px; overflow: hidden; }
.estado button {
  min-height: 36px; padding: 4px 10px; border: 0; background: var(--hoja); color: var(--tinta-suave);
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.estado button + button { border-left: 1px solid var(--linea); }
.estado button.activo.e-vacio { background: var(--tenue); color: var(--tinta); }
.estado button.activo.e-borrador { background: #e3efe8; color: var(--tinta); }
.estado button.activo.e-listo { background: var(--acento); color: #fff; }
.mover { display: inline-flex; gap: 4px; }
.mover form { margin: 0; }
.mover button {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--linea); background: var(--hoja);
  color: var(--tinta-suave); font: inherit; font-weight: 700; cursor: pointer;
}
.mover button:hover { border-color: var(--linea-fuerte); color: var(--tinta); }
.vacio { border: 1.5px dashed var(--linea-fuerte); border-radius: 12px; padding: 18px; text-align: center; color: var(--tinta-suave); }

.pastilla { display: inline-block; padding: 1px 10px; border-radius: 999px; color: #fff; font-size: 0.78rem; font-weight: 600; background: #7b8197; }
.punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; background: #7b8197; vertical-align: baseline; }
.c-verde { background: #2f9e6b; } .c-azul { background: #2f6fd6; } .c-morado { background: #7a4fc9; }
.c-ambar { background: #c98512; } .c-rosa { background: #cc4a82; } .c-turquesa { background: #16939f; }
.c-gris { background: #7b8197; }

.pasos { list-style: none; counter-reset: paso; padding: 0; margin: 10px 0; }
.pasos li {
  counter-increment: paso; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 8px 0 8px 40px; position: relative; border-top: 1px dashed var(--linea);
}
.pasos li::before {
  content: counter(paso); position: absolute; left: 4px; top: 8px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%; background: var(--tenue); font-size: 0.78rem; font-weight: 700;
}
.pasos li.tenue::before { content: none; }
.paso-nombre { font-weight: 600; }
.paso-quien { color: var(--tinta-suave); font-size: 0.9rem; }
.paso-gestos { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.paso-gestos a { font-size: 0.86rem; font-weight: 600; color: var(--acento); padding: 8px 4px; }
.pasos.compacto li { padding-top: 4px; padding-bottom: 4px; }

.datos { margin: 6px 0 0; display: grid; gap: 6px; }
.datos div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.datos dt { color: var(--tinta-suave); font-size: 0.88rem; }
.datos dd { margin: 0; }

/* ---------------------------------------------------------------- documento */
.documento header { margin-bottom: 18px; }
.documento h1 { font-size: 2.2rem; }
.documento-gestos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.texto {
  background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 28px clamp(18px, 4vw, 48px); box-shadow: var(--sombra); font-size: 1.04rem; line-height: 1.7; max-width: 820px;
}
.texto h1 { font-size: 1.6rem; margin-top: 1.2em; }
.texto h2 { font-size: 1.3rem; margin-top: 1.2em; }
.texto h3 { font-size: 1.08rem; margin-top: 1em; }
.texto > :first-child { margin-top: 0; }
.texto table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.95rem; }
.texto th, .texto td { border-bottom: 1px solid var(--linea); padding: 6px 8px; text-align: left; }
.texto blockquote { margin: 1em 0; padding-left: 14px; border-left: 3px solid var(--verde); color: var(--tinta-suave); }
.documento-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 18px 0; max-width: 820px; }
.documento-pie a { font-weight: 600; text-decoration: none; color: var(--tinta-suave); padding: 10px 0; }
.documento-pie a:hover { color: var(--acento); }

/* ---------------------------------------------------------------- formularios */
.formulario { max-width: 760px; }
.formulario.escribir { max-width: 900px; }
.campo { display: grid; gap: 6px; margin-bottom: 16px; }
.campo > label { font-weight: 700; font-size: 0.92rem; }
.ayuda { font-size: 0.84rem; }
.error { color: #b4321b; font-weight: 600; }
.con-error input, .con-error textarea { border-color: #e8a594; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input:not([type]), textarea, select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--linea-fuerte);
  background: var(--hoja); color: var(--tinta); font: inherit; font-size: 16px;
}
textarea { line-height: 1.6; resize: vertical; }
textarea.escritura { min-height: 52vh; font-size: 16.5px; line-height: 1.7; padding: 18px 20px; }
input:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(27, 118, 80, 0.16); }
input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--acento); }
.ayuda-texto { font-size: 0.82rem; color: var(--tinta-suave); margin-top: -6px; }
.borrar { margin-top: 36px; padding-top: 18px; border-top: 1px dashed var(--linea-fuerte); }

/* Los botones de picar */
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span, a.pick {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 12px;
  border: 1.5px solid var(--linea-fuerte); background: var(--hoja); font-weight: 600; font-size: 0.94rem;
  cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
a.pick { text-decoration: none; }
.pick:active span { transform: scale(0.97); }
.pick input:checked + span, a.pick.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.pick input:focus-visible + span { box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.4); }
.picker-color .pick span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; background: #7b8197; }
.picker-color .pick-verde span::before { background: #2f9e6b; }
.picker-color .pick-azul span::before { background: #2f6fd6; }
.picker-color .pick-morado span::before { background: #7a4fc9; }
.picker-color .pick-ambar span::before { background: #c98512; }
.picker-color .pick-rosa span::before { background: #cc4a82; }
.picker-color .pick-turquesa span::before { background: #16939f; }
.secciones-picker { margin-bottom: 18px; }

/* ---------------------------------------------------------------- buscar, prensa */
.buscar-grande { display: flex; gap: 10px; margin-bottom: 18px; max-width: 640px; }
.alcances { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alcances a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--linea-fuerte); text-decoration: none; font-weight: 600; background: var(--hoja); }
.alcances a.actual { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.prensa { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.prensa-portada {
  aspect-ratio: 8.5 / 11; border-radius: 8px; padding: 18px 16px; color: #fff; display: flex; flex-direction: column; gap: 8px;
  background-color: var(--prusia);
  background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 14px 14px; box-shadow: 0 16px 30px -16px rgba(10, 20, 16, 0.9);
}
.prensa-portada img { width: 120px; height: auto; }
.prensa-portada b { margin-top: 30%; font-size: 1.25rem; line-height: 1.2; border-left: 3px solid var(--verde); padding-left: 10px; }
.prensa-portada span { margin-top: auto; font-size: 0.78rem; color: var(--cielo); }
.persona { padding: 6px 0 10px; }
.persona h3 { margin: 6px 0 2px; }
.detalle { margin-top: 14px; font-size: 0.86rem; color: var(--tinta-suave); }
.detalle summary { cursor: pointer; min-height: 32px; }

/* ---------------------------------------------------------------- acceso */
body.acceso { display: grid; min-height: 100vh; place-items: center; background-color: var(--prusia); background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px); }
body.acceso .hoja { padding: 24px 16px; width: 100%; }
.acceso-caja { width: min(100%, 420px); margin: 0 auto; background: var(--hoja); border-radius: 20px; padding: 28px 24px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6); }
.acceso-marca { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.acceso-marca img { width: 206px; height: auto; }
.acceso-caja h1 { font-size: 1.4rem; }
.qr { display: grid; place-items: center; margin: 12px 0; }
.qr svg { width: 220px; height: 220px; }
.clave { word-break: break-all; }
.respaldos { columns: 2; font-size: 1.05rem; padding-left: 22px; }
.respaldos li { padding: 4px 0; }

/* ---------------------------------------------------------------- barra del teléfono */
.barra { display: none; }
.velo { display: none; }

@media (max-width: 1100px) {
  .portada-rejilla { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --riel: 0px; }
  .hoja { margin-left: 0; padding: 18px 16px calc(var(--barra) + 28px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.6rem; }
  .cabeza-seccion h1, .documento h1 { font-size: 1.75rem; }
  .riel {
    width: min(86vw, 320px); transform: translateX(-105%); transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(10, 20, 16, 0.35); padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  body.riel-abierto .riel { transform: none; }
  body.riel-abierto { overflow: hidden; }
  .velo { display: block; position: fixed; inset: 0; background: rgba(10, 20, 16, 0.5); z-index: 25; }
  .velo[hidden] { display: none; }
  .barra {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--barra) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--linea);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .barra a, .barra button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 44px; border: 0; background: none; font: inherit; font-size: 0.72rem; font-weight: 600;
    color: var(--tinta-suave); text-decoration: none; cursor: pointer;
  }
  .barra svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .barra .actual { color: var(--tinta); }
  .barra .actual svg { stroke: var(--acento); }

  .plano-dibujo .mapa-ancho { display: none; }
  .plano-dibujo .mapa-alto { display: block; }
  .plano-cabeza { padding: 18px 18px 0; }
  .avance-lista a { grid-template-columns: 28px minmax(0, 1fr) 64px 44px; gap: 8px; }
  .avance-seccion { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .renglon { grid-template-columns: minmax(0, 1fr); padding-left: 12px; }
  .renglon-gestos { justify-content: flex-start; max-width: none; }
  .datos div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .leyenda-riesgos { columns: 1; }
  .prensa { grid-template-columns: minmax(0, 1fr); }
  .prensa-portada { max-width: 200px; }
  .tarjeta { padding: 16px; }
  .texto { padding: 20px 16px; }
  .avisos { top: auto; bottom: calc(var(--barra) + 14px + env(safe-area-inset-bottom)); }
  .lienzo svg.organigrama, .lienzo svg.procesos, .lienzo svg.historia, .lienzo svg.rutinas { min-width: 640px; }
  .lienzo svg.riesgos { min-width: 0; }
}

@media (hover: none) {
  .indice a:hover, .avance-lista a:hover { background: none; }
}
