@font-face { font-family: "Schibsted Grotesk"; src: url("schibsted.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

/* ============ Ambientes ============ */
/* Claro por defecto en todas las vistas: el ayuntamiento lo ve en un despacho o una sala con luz. El oscuro solo si alguien lo activa. */
body {
  color-scheme: light;
  --fondo: oklch(97.4% 0.006 168);
  --superficie: oklch(99.2% 0.003 168);
  --superficie-2: oklch(94.8% 0.009 168);
  --regla: oklch(87.5% 0.012 170);
  --regla-suave: oklch(92.5% 0.008 170);
  --tinta: oklch(19% 0.022 195);
  --tinta-2: oklch(40% 0.018 190);
  --tinta-3: oklch(54% 0.015 185);
  --acento: oklch(48% 0.12 160);
  --acento-txt: oklch(99% 0.004 168);
  --s1: #0b7a4f; --s2: #eb6834; --s3: #2a78d6;
  --sec-0: #e3f1ea; --sec-1: #bfe2cf; --sec-2: #8fcdae; --sec-3: #57b285; --sec-4: #2b9064; --sec-5: #126d48; --sec-6: #03432a;
  --bien: #0a7d0a; --bien-fondo: oklch(94% 0.05 145);
  --medio: #8a6100; --medio-fondo: oklch(95% 0.06 85);
  --alto: #a8481f; --alto-fondo: oklch(94% 0.04 45);
  --critico: #b52b2b; --critico-fondo: oklch(94% 0.035 25);
  --mapa-fondo: radial-gradient(120% 90% at 50% 25%, oklch(99% 0.004 168), oklch(92.5% 0.014 168));
  --m3-texto: #0a191a; --m3-dato: #0b6b45; --m3-sombra: 0 0 4px rgb(255 255 255 / 0.95), 0 1px 8px rgb(255 255 255 / 0.9);
  --m3-acceso: #3d4d4b; --capas-fondo: rgb(255 255 255 / 0.88); --etq-fondo: rgb(255 255 255 / 0.94);
}
/* Mando: la sala de la jefatura, pantallas encendidas todo el turno, luz baja, vigilancia en directo. */
html[data-tema="oscuro"] body {
  color-scheme: dark;
  --fondo: oklch(16.5% 0.02 182);
  --superficie: oklch(20% 0.022 180);
  --superficie-2: oklch(24% 0.025 178);
  --regla: oklch(30% 0.028 178);
  --regla-suave: oklch(26% 0.025 178);
  --tinta: oklch(95% 0.012 165);
  --tinta-2: oklch(79% 0.022 170);
  --tinta-3: oklch(64% 0.024 172);
  --acento: #5acb94;
  --acento-txt: #0a191a;
  --s1: #2fae78; --s2: #e06a3a; --s3: #4b8fe0;
  --sec-0: #15302a; --sec-1: #1b4537; --sec-2: #1f5c45; --sec-3: #257754; --sec-4: #339666; --sec-5: #55b783; --sec-6: #94dbb2;
  --bien: #6fd88a; --bien-fondo: oklch(30% 0.06 150);
  --medio: #f3c04f; --medio-fondo: oklch(30% 0.05 85);
  --alto: #f29a74; --alto-fondo: oklch(30% 0.05 40);
  --critico: #ff7b7b; --critico-fondo: oklch(30% 0.07 25);
  --mapa-fondo: radial-gradient(120% 90% at 50% 30%, oklch(23% 0.03 175), oklch(15% 0.02 182));
  --m3-texto: #eef7f2; --m3-dato: #7fe0aa; --m3-sombra: 0 1px 6px rgb(0 0 0 / 0.8);
  --m3-acceso: #a9c9be; --capas-fondo: rgb(10 25 26 / 0.7); --etq-fondo: rgb(10 25 26 / 0.78);
}
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --radio: 14px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 400ms ease, color 400ms ease;
}
html[data-tema="oscuro"] body {
  background:
    radial-gradient(1100px 600px at 70% -10%, oklch(30% 0.06 165 / 0.45), transparent 70%),
    radial-gradient(800px 500px at -10% 110%, oklch(26% 0.05 190 / 0.35), transparent 70%),
    var(--fondo);
  background-attachment: fixed;
}
a { color: var(--acento); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 4px; }
.saltar { position: absolute; left: -999px; top: 8px; background: var(--superficie); padding: 8px 12px; z-index: 30; }
.saltar:focus { left: 8px; }
.bh-num, .num, .eje, .ranking b, .cf-num { font-variant-numeric: tabular-nums; }

/* ============ Barra superior ============ */
.barra {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 10px 28px;
  background: color-mix(in oklab, var(--fondo) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--regla-suave);
  view-transition-name: barra;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.marca svg { width: 34px; height: 34px; flex: none; }
.m-fondo { fill: var(--tinta); } .m-verde { fill: #5acb94; } .m-trazo { stroke: #5acb94; } .m-col { fill: var(--fondo); }
.marca-txt { display: flex; flex-direction: column; line-height: 1.05; }
.marca-txt b { font-size: 19px; letter-spacing: -0.015em; }
.marca-txt span { font-size: 12px; color: var(--tinta-3); }
.navegacion { display: flex; align-items: center; gap: 18px; overflow-x: auto; scrollbar-width: none; justify-self: center; }
.navegacion::-webkit-scrollbar { display: none; }
.nav-grupo { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--superficie-2); }
.nav-etq { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tinta-3); padding: 0 8px 0 10px; white-space: nowrap; }
.navegacion a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: var(--tinta-2); padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .navegacion a:hover { color: var(--tinta); background: color-mix(in oklab, var(--tinta) 7%, transparent); } }
.navegacion a[aria-current="page"] { background: var(--tinta); color: var(--fondo); }
.nav-suelta { border: 1px solid var(--regla); }
.punto-vivo { width: 7px; height: 7px; border-radius: 50%; background: #ff6b6b; animation: latido-sombra 2s ease-out infinite; }
@keyframes latido-sombra { 0% { box-shadow: 0 0 0 0 rgb(255 107 107 / 0.6); } 70%, 100% { box-shadow: 0 0 0 7px rgb(255 107 107 / 0); } }
.municipio { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.muni-nombre { font-weight: 600; }
.demo { font-size: 12px; color: var(--tinta-3); }

main { outline: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 320ms; animation-timing-function: var(--ease-out); }

/* ============ Piezas comunes ============ */
.delta, .estado { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 9px 2px 6px; border-radius: 999px; white-space: nowrap; width: fit-content; }
.delta svg, .estado svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.delta.bueno, .estado.ok { color: var(--bien); background: var(--bien-fondo); }
.delta.malo, .estado.serio { color: var(--alto); background: var(--alto-fondo); }
.estado.aviso { color: var(--medio); background: var(--medio-fondo); }
.estado.critico { color: var(--critico); background: var(--critico-fondo); }
.estado.neutro { color: var(--tinta-2); background: var(--superficie-2); padding-left: 9px; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--acento); color: var(--acento-txt); border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: transform 140ms var(--ease-out), filter 160ms ease; }
.boton:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .boton:hover { filter: brightness(1.08); } }
.boton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.boton.peq { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.boton.sec { background: var(--superficie); color: var(--tinta); box-shadow: inset 0 0 0 1px var(--regla); }
.boton.icono { padding: 6px 8px; }
.boton-texto { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; color: var(--acento); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.boton-texto svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .boton-texto:hover svg { transform: translateX(3px); } }
.matricula { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; background: var(--superficie-2); border: 1px solid var(--regla); border-radius: 4px; padding: 0 5px; color: var(--tinta); letter-spacing: 0.04em; font-size: 0.92em; }
.matricula.grande { font-size: 20px; padding: 2px 10px; }
.nota-fuente { font-size: 12.5px; color: var(--tinta-3); margin-top: 12px; }

/* Gráficos */
.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.rejilla { stroke: var(--regla-suave); stroke-width: 1; }
.eje { fill: var(--tinta-3); font-size: 11.5px; }
.rotulo { fill: var(--tinta-2); font-size: 13px; font-weight: 700; }
.linea { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.linea.discontinua { stroke-dasharray: 5 4; }
.linea.s1, .punto.s1, .punto-h.s1 { stroke: var(--s1); } .linea.s2, .punto.s2, .punto-h.s2 { stroke: var(--s2); } .linea.s3, .punto.s3, .punto-h.s3 { stroke: var(--s3); }
.area-ini { stop-color: var(--s1); stop-opacity: 0.2; } .area-fin { stop-color: var(--s1); stop-opacity: 0; }
.punto { fill: var(--superficie); stroke-width: 2.25; }
.punto-h { fill: var(--superficie); stroke-width: 2; opacity: 0; }
.cruceta { stroke: var(--tinta-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.col:hover .cruceta, .col:hover .punto-h { opacity: 1; }
.anotacion line { stroke: var(--tinta-3); stroke-width: 1; }
.anotacion circle { fill: var(--tinta); }
.anotacion text { fill: var(--tinta-2); font-size: 12px; font-weight: 600; }
.relleno.s1 { fill: var(--s1); } .relleno.s2 { fill: var(--s2); } .relleno.s3 { fill: var(--s3); }
.leyenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--tinta-2); margin-bottom: 8px; }
.leyenda span { display: inline-flex; align-items: center; gap: 7px; }
.tt-marca { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--s1); }
.tt-marca.s2 { background: var(--s2); } .tt-marca.s3 { background: var(--s3); }
.tt-marca.discontinua { background: repeating-linear-gradient(90deg, var(--s2) 0 5px, transparent 5px 8px); }
.sec-0 { fill: var(--sec-0); background: var(--sec-0); } .sec-1 { fill: var(--sec-1); background: var(--sec-1); } .sec-2 { fill: var(--sec-2); background: var(--sec-2); }
.sec-3 { fill: var(--sec-3); background: var(--sec-3); } .sec-4 { fill: var(--sec-4); background: var(--sec-4); } .sec-5 { fill: var(--sec-5); background: var(--sec-5); } .sec-6 { fill: var(--sec-6); background: var(--sec-6); }
.calor rect, .barrio polygon { transition: opacity 150ms ease; }
.calor rect:hover, .barrio:hover polygon { opacity: 0.75; }
.calor-scroll { overflow-x: auto; }
.calor { min-width: 560px; }
.leyenda-sec { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--tinta-3); margin-top: 10px; }
.leyenda-sec i { width: 22px; height: 8px; border-radius: 2px; }
.leyenda-sec span:first-child { margin-right: 8px; } .leyenda-sec span:last-child { margin-left: 8px; }
.mapa polygon { stroke: var(--fondo); stroke-width: 3; stroke-linejoin: round; }
.mapa-nombre { font-size: 13px; font-weight: 600; fill: var(--tinta); pointer-events: none; }
.mapa-nombre.claro { fill: #f4f8f7; }
html[data-tema="oscuro"] body .mapa-nombre.claro { fill: #0a191a; }
.cam { fill: var(--tinta); stroke: var(--fondo); stroke-width: 1.5; }
.cam.caida { fill: var(--critico); }
.acceso rect { fill: var(--superficie); stroke: var(--tinta); stroke-width: 1.5; }
.acceso path { stroke: var(--tinta); stroke-width: 1.5; }
.barras-h { display: flex; flex-direction: column; gap: 11px; }
.bh-fila { display: grid; grid-template-columns: minmax(110px, 40%) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bh-etq { color: var(--tinta-2); }
.bh-pista { position: relative; height: 8px; background: var(--superficie-2); border-radius: 4px; }
.bh-valor { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--s1); transform-origin: left; }
.bh-valor.s2 { background: var(--s2); } .bh-valor.s3 { background: var(--s3); }
.objetivo { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--tinta); z-index: 1; border-radius: 1px; }
.bh-num { font-weight: 600; min-width: 64px; text-align: right; }
.apilada { display: flex; gap: 2px; height: 26px; transform-origin: left; }
.ap-seg:first-child { border-radius: 5px 0 0 5px; } .ap-seg:last-child { border-radius: 0 5px 5px 0; }
.apilada-etq { display: flex; gap: 2px; margin-top: 10px; font-size: 12.5px; color: var(--tinta-2); }
.apilada-etq span { min-width: 0; line-height: 1.3; }
.apilada-etq b { display: block; color: var(--tinta); font-size: 15px; }
.spark { width: 100%; max-width: 200px; height: 40px; display: block; }
.spark .linea { stroke-width: 2; }
.ver-tabla { margin-top: 14px; font-size: 13px; }
.ver-tabla summary { cursor: pointer; color: var(--tinta-3); width: fit-content; }
.tabla-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin-top: 8px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--regla-suave); vertical-align: top; }
thead th { color: var(--tinta-3); font-weight: 500; font-size: 12px; border-bottom-color: var(--regla); }
tbody th { font-weight: 600; }
.tabla-datos tbody th span { display: block; color: var(--tinta-3); font-weight: 400; font-size: 12px; }
.num { text-align: right; }

/* Tooltip */
.tooltip, .m3-tip { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; background: oklch(19% 0.022 195); color: #eef4f2; border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.4; max-width: 280px; opacity: 0; transition: opacity 120ms ease; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); }
html[data-tema="oscuro"] body .tooltip { background: oklch(93% 0.012 165); color: #0a191a; }
.tooltip.visible, .m3-tip.visible { opacity: 1; }
.tooltip strong, .m3-tip strong { font-weight: 700; }
.tt-fila { display: flex; align-items: center; gap: 6px; }
.tt-fila b { margin-left: auto; padding-left: 12px; }

/* ============ Informe (ambiente claro) ============ */
.informe { max-width: 1200px; margin: 0 auto; padding: 36px 32px 72px; }
.informe.estrecho { max-width: 980px; }
.masthead { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 0 10px; border-top: 3px solid var(--tinta); border-bottom: 1px solid var(--regla); font-size: 13px; color: var(--tinta-2); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acento); }
.masthead .kicker { margin-right: auto; }
.lede { font-size: clamp(34px, 5vw, 66px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; max-width: 21ch; margin: 44px 0 20px; outline: none; }
.lede em { font-style: normal; color: var(--acento); }
.dek { font-size: clamp(17px, 1.6vw, 21px); color: var(--tinta-2); max-width: 58ch; line-height: 1.45; }
.cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 44px 0 8px; border-top: 1px solid var(--regla); border-bottom: 1px solid var(--regla); }
.cifra { margin: 0; padding: 22px 24px 22px 0; display: flex; flex-direction: column; gap: 8px; }
.cifra + .cifra { padding-left: 24px; border-left: 1px solid var(--regla); }
.cifra figcaption { font-size: 13px; color: var(--tinta-2); }
.c-num { font-size: clamp(32px, 3.4vw, 46px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.c-num small { font-size: 0.38em; font-weight: 500; color: var(--tinta-3); letter-spacing: 0; margin: 0 6px 0 3px; }
.c-nota { font-size: 13px; color: var(--tinta-3); }

.bloque { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; padding: 52px 0; border-bottom: 1px solid var(--regla-suave); }
.bloque-cab { grid-column: 1 / 5; align-self: start; position: sticky; top: 90px; }
.bloque-num { display: block; font-size: 13px; font-weight: 700; color: var(--acento); letter-spacing: 0.05em; margin-bottom: 10px; }
.bloque-cab h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.bloque-cab p { margin-top: 10px; color: var(--tinta-2); font-size: 15px; max-width: 34ch; }
.bloque-cuerpo { grid-column: 5 / 13; min-width: 0; }
.parrafo { font-size: 18px; color: var(--tinta-2); max-width: 60ch; }

.mapa-y-ranking { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: center; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ranking li { display: grid; grid-template-columns: 1fr 90px 34px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--regla-suave); font-size: 14px; }
.r-barra { height: 6px; background: var(--superficie-2); border-radius: 3px; overflow: hidden; }
.r-barra i { display: block; height: 100%; width: var(--w); background: var(--s1); border-radius: 3px; transform-origin: left; }
.ranking b { text-align: right; font-size: 15px; }

.citas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }
.citas li { display: grid; grid-template-columns: 36px 1fr; column-gap: 8px; }
.citas li::before { content: "“"; font-size: 64px; line-height: 0.8; font-weight: 700; color: var(--acento); }
.citas blockquote { margin: 0; font-size: clamp(19px, 1.9vw, 24px); font-weight: 500; line-height: 1.32; letter-spacing: -0.01em; }
.citas .boton-texto { grid-column: 2; margin-top: 8px; }

.atencion { list-style: none; margin: 0; padding: 0; }
.atencion li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--regla-suave); }
.atencion li:first-child { padding-top: 0; }
.atencion p { font-size: 16px; color: var(--tinta-2); max-width: 62ch; }
.atencion b { color: var(--tinta); }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--regla-suave); }
.agenda li:first-child { padding-top: 0; }
.agenda time { font-size: 22px; font-weight: 700; color: var(--acento); letter-spacing: -0.02em; }
.agenda div { display: flex; flex-direction: column; }
.agenda b { font-size: 17px; }
.agenda div span { font-size: 13.5px; color: var(--tinta-3); }
.ag-cifra { font-size: 22px; font-weight: 700; text-align: right; }
.ag-cifra small { display: block; font-size: 12px; font-weight: 400; color: var(--tinta-3); }
.informe-pie { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding-top: 36px; }

.multiples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--regla-suave); }
.multiple { margin: 0; padding: 18px 18px 18px 0; border-bottom: 1px solid var(--regla-suave); display: flex; flex-direction: column; gap: 8px; }
.multiple:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--regla-suave); }
.multiple figcaption { font-size: 14px; color: var(--tinta-2); }
.m-valor { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.m-valor small { font-size: 13px; font-weight: 400; color: var(--tinta-3); margin-left: 6px; letter-spacing: 0; }

.conflictivos { list-style: none; margin: 0; padding: 0; }
.conflictivos li { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(90px, 1fr) 62px 52px; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--regla-suave); }
.cf-pos { font-size: 20px; font-weight: 700; color: var(--tinta-3); }
.cf-txt { display: flex; flex-direction: column; }
.cf-txt span { font-size: 13px; color: var(--tinta-3); }
.cf-barras { display: flex; flex-direction: column; gap: 4px; }
.cf-barras i { display: block; height: 6px; width: var(--w); border-radius: 3px; transform-origin: left; }
.cf-barras i.s1 { background: var(--s1); } .cf-barras i.s2 { background: var(--s2); }
.cf-num { text-align: right; font-weight: 700; font-size: 18px; line-height: 1.1; }
.cf-num small { display: block; font-size: 11px; font-weight: 400; color: var(--tinta-3); }
.gran-dato { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin-bottom: 24px; }
.gd-num { font-size: clamp(72px, 9vw, 128px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; color: var(--s2); }
.gd-num small { font-size: 0.4em; margin-left: 4px; }
.gran-dato p { font-size: 18px; color: var(--tinta-2); max-width: 38ch; }

.correo { background: var(--superficie); border: 1px solid var(--regla); border-radius: var(--radio); overflow: hidden; margin-top: 40px; box-shadow: 0 1px 2px rgb(10 25 26 / 0.04), 0 18px 48px -20px rgb(10 25 26 / 0.18); }
.correo-cab { padding: 16px 22px; background: var(--superficie-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.correo-cab span { display: inline-block; width: 64px; color: var(--tinta-3); }
.correo-cuerpo { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.correo-cuerpo ul { padding-left: 18px; margin: 0; display: flex; flex-direction: column; gap: 6px; color: var(--tinta-2); }
.correo-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.correo-kpis div { background: var(--superficie-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.correo-kpis b { font-size: 22px; }
.correo-kpis span { font-size: 12px; color: var(--tinta-3); }

.diagrama-scroll { overflow-x: auto; margin: 44px 0 8px; }
.diagrama { width: 100%; min-width: 720px; height: auto; display: block; }
.zona { fill: var(--superficie-2); stroke: var(--regla); stroke-dasharray: 4 4; }
.zona.nube { fill: var(--superficie); stroke-dasharray: none; }
.zona-txt { fill: var(--tinta-2); font-size: 13px; font-weight: 700; }
.caja { fill: var(--superficie); stroke: var(--regla); }
.caja.destacada { fill: #03432a; stroke: none; }
.caja-txt { fill: var(--tinta); font-size: 14px; font-weight: 600; }
.caja-sub { fill: var(--tinta-3); font-size: 12px; }
.caja-txt.claro, .caja-sub.claro { fill: #eef4f2; }
.flecha { fill: none; stroke: var(--regla); stroke-width: 1.5; }
.flecha.gruesa { stroke-width: 3; }
.flujo { fill: none; stroke: var(--acento); stroke-width: 2; stroke-dasharray: 3 14; stroke-linecap: round; animation: fluir 1.4s linear infinite; }
.flujo.grueso { stroke-width: 3.5; }
@keyframes fluir { to { stroke-dashoffset: -17; } }
.flecha-txt { fill: var(--tinta-2); font-size: 12px; }
.conectores { list-style: none; margin: 0; padding: 0; }
.conectores li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); column-gap: 24px; row-gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--regla-suave); }
.conectores li:first-child { padding-top: 0; }
.con-nombre { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; grid-row: span 2; }
.conectores p { color: var(--tinta-2); font-size: 14.5px; }
.con-datos { font-size: 12.5px; color: var(--tinta-3); }
.privacidad { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.privacidad li { display: flex; gap: 12px; align-items: center; font-size: 15.5px; }
.privacidad .estado { min-width: 54px; justify-content: center; }

/* ============ Mando (ambiente oscuro) ============ */
.mando { max-width: 1680px; margin: 0 auto; padding: 18px 24px 40px; }
.mando-cab { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 36px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--regla); }
.mc-titulo h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; outline: none; }
.mc-intro { color: var(--tinta-2); max-width: 60ch; }
.mc-reloj { display: flex; flex-direction: column; gap: 2px; }
#reloj { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.en-vivo { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #ff7b7b; }
.en-vivo i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: latido-sombra 2s ease-out infinite; }
.indicadores { display: flex; flex-wrap: wrap; margin: 0 0 0 auto; }
.indicadores div { padding: 0 22px; border-left: 1px solid var(--regla); }
.indicadores dt { font-size: 11.5px; color: var(--tinta-3); letter-spacing: 0.04em; }
.indicadores dd { margin: 4px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.indicadores dd small { font-size: 14px; font-weight: 500; color: var(--tinta-3); letter-spacing: 0; }
.indicadores dd.malo { color: var(--alto); }

.panel { background: color-mix(in oklab, var(--superficie) 88%, transparent); border: 1px solid var(--regla); border-radius: var(--radio); padding: 14px 16px 16px; min-width: 0; }
.panel-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-cab h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tinta-2); }
.panel-cab span { font-size: 12px; color: var(--tinta-3); text-align: right; }
.panel-cab.separado { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--regla-suave); }
.panel-cab.sobre { position: absolute; top: 14px; left: 16px; right: 16px; z-index: 3; pointer-events: none; }

.sala { display: grid; grid-template-columns: 360px minmax(0, 1fr) 330px; gap: 14px; height: clamp(600px, calc(100vh - 270px), 900px); }
.p-avisos { overflow-y: auto; scrollbar-width: thin; }
.p-mapa { position: relative; padding: 0; overflow: hidden; background: var(--mapa-fondo); }
.lienzo-mapa { position: absolute; inset: 0; }
.lienzo-mapa canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.mapa3d.arrastrando canvas { cursor: grabbing; }
.lienzo-mapa > .grafico { padding: 50px 20px 40px; height: 100%; }
.mapa-leyenda { position: absolute; left: 16px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--tinta-2); pointer-events: none; z-index: 3; }
.mapa-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.mapa-leyenda i { width: 9px; height: 9px; border-radius: 50%; }
.lg-cam { background: #e9fff3; box-shadow: 0 0 0 3px rgb(90 203 148 / 0.35); }
.lg-caida { background: #ff6b6b; }
.mapa-leyenda .lg-coche { background: #e8fff2; width: 5px; height: 5px; }
.mapa-leyenda .lg-relieve { border-radius: 2px; background: linear-gradient(#7fe0aa, #1d4a3b); height: 12px; }
.m3-capa { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.m3-etq, .m3-acceso, .m3-aviso { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; transition: opacity 200ms ease; }
.m3-etq { display: flex; flex-direction: column; align-items: center; font-size: 11.5px; line-height: 1.15; text-shadow: var(--m3-sombra); padding-bottom: 6px; }
.m3-etq b { color: var(--m3-texto); font-weight: 600; }
.m3-etq span { color: var(--m3-dato); font-weight: 700; font-size: 13px; }
.m3-acceso { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--m3-acceso); text-shadow: var(--m3-sombra); font-weight: 600; }
.m3-aviso { font-size: 12.5px; font-weight: 600; color: #0a191a; background: #f3c04f; padding: 4px 10px; border-radius: 999px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.4); margin-top: -6px; }
.m3-aviso.critico { background: #ff7b7b; } .m3-aviso.serio { background: #f29a74; } .m3-aviso.ok { background: #5acb94; }
.m3-tip { position: absolute; z-index: 4; }
html[data-tema="oscuro"] .m3-tip { background: oklch(93% 0.012 165); color: #0a191a; }

.p-lateral { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; scrollbar-width: thin; min-height: 0; }
.alertas, .unidades, .abiertos, .pendientes, .briefing { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.alertas { gap: 10px; }
.alerta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--regla); border-radius: 12px; background: var(--superficie-2); transition: opacity 180ms ease, transform 180ms var(--ease-out); }
.alerta[data-nivel="critico"] { border-color: color-mix(in oklab, var(--critico) 60%, var(--regla)); background: color-mix(in oklab, var(--critico) 9%, var(--superficie-2)); }
.alerta.nueva { animation: llegar 420ms var(--ease-out) both; }
@keyframes llegar { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.alerta.saliendo { opacity: 0; transform: translateX(14px); }
.alerta.atendida { opacity: 0.6; }
.mini { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: #1a2b29; align-self: start; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-hud { position: absolute; left: 8px; top: 6px; font: 600 11px/1.2 ui-monospace, Consolas, monospace; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.9); letter-spacing: 0.02em; }
.mini-rec { position: absolute; right: 9px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: #ff4b4b; box-shadow: 0 0 0 2px rgb(255 75 75 / 0.3); }
.foto-aviso { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; }
.al-cuerpo { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13.5px; }
.al-cab { display: flex; justify-content: space-between; align-items: center; }
.al-cab time { font-size: 12.5px; color: var(--tinta-3); }
.al-cuerpo > span { color: var(--tinta-2); }
.al-lista { font-size: 12.5px; color: var(--tinta-3) !important; }
.al-acciones { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.asignada, .sin-unidad { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; }
.asignada { color: var(--bien); } .sin-unidad { color: var(--alto); }
.asignada svg, .sin-unidad svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.unidades li, .abiertos li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--regla-suave); font-size: 13.5px; }
.unidades li:last-child, .abiertos li:last-child { border: 0; }
.unidades li > b { min-width: 38px; font-size: 14px; }
.unidades li > div, .abiertos li > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.unidades em { font-style: normal; color: var(--tinta-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unidades li.cambio { animation: destello 900ms ease-out; }
@keyframes destello { from { background: color-mix(in oklab, var(--acento) 22%, transparent); } }
.abiertos span { color: var(--tinta-3); font-size: 12.5px; }
.ab-min { font-weight: 700; min-width: 54px; }
.ab-min.largo { color: var(--alto); }

.cinta { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 10px 16px; border: 1px solid var(--regla); border-radius: var(--radio); background: color-mix(in oklab, var(--superficie) 88%, transparent); font-size: 13px; }
.cinta-etq { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tinta-2); flex: none; }
.cinta-pista { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.cinta-mov { display: flex; gap: 28px; width: max-content; animation: cinta 60s linear infinite; }
.cinta-mov span { display: inline-flex; gap: 8px; align-items: center; color: var(--tinta-3); white-space: nowrap; }
@keyframes cinta { to { transform: translateX(-50%); } }
.cinta-nota { font-size: 12px; color: var(--tinta-3); flex: none; }
.relevo-panel { margin-top: 14px; }
.relevo-panel p { color: var(--tinta-2); max-width: 110ch; }

.jefatura { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.j-mapa { grid-column: 1 / 8; position: relative; padding: 0; overflow: hidden; min-height: 460px; background: var(--mapa-fondo); }
.j-tiempos { grid-column: 8 / 13; }
.j-calor { grid-column: 1 / 13; }
.j-listas { grid-column: 1 / 8; }
.j-pendientes { grid-column: 8 / 13; }
.hallazgo { font-size: 18px; color: var(--tinta-2); margin-bottom: 14px; }
.hallazgo b { color: var(--tinta); }
.j-calor .calor { max-width: 980px; }
.pendientes li { display: grid; grid-template-columns: 54px 1fr; padding: 9px 0; border-bottom: 1px solid var(--regla-suave); }
.pendientes b { font-size: 24px; grid-row: span 2; line-height: 1.1; }
.pendientes em { font-style: normal; font-size: 12.5px; color: var(--tinta-3); }
.memoria { margin-top: 16px; border: 1px solid var(--regla); border-radius: 10px; padding: 10px 14px; }
.memoria summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--acento); }
.memoria summary::-webkit-details-marker { display: none; }
.memoria summary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform 200ms var(--ease-out); }
.memoria[open] summary svg { transform: rotate(90deg); }
.memoria ol { padding-left: 20px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; color: var(--tinta-2); font-size: 14px; }
.memoria ol b { color: var(--tinta); }

.agente-envoltura { display: grid; grid-template-columns: 390px 1fr; gap: 48px; align-items: start; }
.movil { border: 10px solid oklch(11% 0.015 185); outline: 1px solid var(--regla); border-radius: 40px; background: oklch(98% 0.005 168); color: #0a191a; min-height: 700px; overflow: hidden; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6); --superficie: #fff; --superficie-2: #eaf1ee; --regla: #d4dfdb; --regla-suave: #e3ebe8; --tinta: #0a191a; --tinta-2: #3b4b49; --tinta-3: #66756f; --acento: #077649; --acento-txt: #fff; --bien: #0a7d0a; --bien-fondo: #e3f4e3; --medio: #8a6100; --medio-fondo: #fff3d6; --alto: #a8481f; --alto-fondo: #fde8de; color-scheme: light; }
.movil-barra { display: flex; justify-content: space-between; padding: 14px 20px 10px; font-size: 13px; font-weight: 600; background: #0a191a; color: #eef4f2; }
.movil-pestanas { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--regla); }
.movil-pestanas button { border: 0; background: none; padding: 13px 4px; font-size: 14px; font-weight: 500; color: var(--tinta-3); cursor: pointer; border-bottom: 2px solid transparent; transition: color 150ms ease, border-color 150ms ease; }
.movil-pestanas button[aria-selected="true"] { color: var(--tinta); border-bottom-color: var(--acento); }
.movil-panel[hidden] { display: none; }
.movil-panel { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.movil-panel h4 { font-size: 14px; margin-top: 4px; }
.aviso-movil { border: 1px solid var(--regla); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 14px; background: #fff; }
.aviso-movil > span:not(.estado) { color: var(--tinta-3); font-size: 13px; }
.briefing { gap: 8px; }
.briefing li { font-size: 13.5px; color: var(--tinta-2); padding: 10px 12px; background: var(--superficie-2); border-radius: 10px; }
.briefing b { display: block; color: var(--tinta); }
.form-movil { display: flex; flex-direction: column; gap: 6px; }
.form-movil label { font-size: 13px; color: var(--tinta-2); margin-top: 6px; }
.form-movil input, .form-movil select, .form-movil textarea { border: 1px solid var(--regla); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; color: var(--tinta); }
.form-movil .boton { margin-top: 10px; }
.adjuntos { display: flex; gap: 8px; margin-top: 8px; }
.adjuntos span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--superficie-2); color: var(--tinta-2); }
.res-mat { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-top: 4px; }
.res-mat ul { list-style: none; padding: 0; margin: 0; width: 100%; }
.res-mat li { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--regla); }
.res-mat time { color: var(--tinta-3); }
.registro { font-size: 12px; color: var(--tinta-3); }
.error { color: #b52b2b; font-size: 13.5px; }
.exito { display: flex; gap: 8px; align-items: center; color: var(--bien); font-weight: 600; font-size: 14px; }
.exito svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.agente-notas { margin: 0; padding: 20px 0 0; list-style: none; counter-reset: nota; display: flex; flex-direction: column; gap: 22px; max-width: 52ch; }
.agente-notas li { counter-increment: nota; position: relative; padding-left: 46px; color: var(--tinta-2); font-size: 17px; line-height: 1.5; }
.agente-notas li::before { content: "0" counter(nota); position: absolute; left: 0; top: 3px; font-weight: 700; color: var(--acento); font-size: 14px; }
.agente-notas b { color: var(--tinta); }

.pie { max-width: 1200px; margin: 0 auto; padding: 22px 32px 44px; font-size: 13px; color: var(--tinta-3); }
.noscript { padding: 24px; }

/* ============ Revelado al entrar en pantalla ============ */
.anim .grafico .dibujar { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1600ms var(--ease-out); }
.anim .grafico.visto .dibujar { stroke-dashoffset: 0; }
.anim .grafico .area { opacity: 0; transition: opacity 900ms ease 500ms; }
.anim .grafico.visto .area { opacity: 1; }
.anim .grafico .anotacion { opacity: 0; transition: opacity 400ms ease 1100ms; }
.anim .grafico.visto .anotacion { opacity: 1; }
.anim .bh-valor, .anim .r-barra i, .anim .cf-barras i, .anim .apilada { transform: scaleX(0); transition: transform 900ms var(--ease-out); }
.anim .visto .bh-valor, .anim .visto .r-barra i, .anim .visto .cf-barras i, .anim .apilada.visto { transform: scaleX(1); }
.anim .visto .bh-fila:nth-child(2) .bh-valor, .anim .visto li:nth-child(2) i { transition-delay: 60ms; }
.anim .visto .bh-fila:nth-child(3) .bh-valor, .anim .visto li:nth-child(3) i { transition-delay: 120ms; }
.anim .visto .bh-fila:nth-child(4) .bh-valor, .anim .visto li:nth-child(4) i { transition-delay: 180ms; }
.anim .visto li:nth-child(5) i { transition-delay: 240ms; } .anim .visto li:nth-child(6) i { transition-delay: 300ms; } .anim .visto li:nth-child(7) i { transition-delay: 360ms; }
.anim .bloque { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.anim .bloque.visto { opacity: 1; transform: none; }
.anim .lede, .anim .dek, .anim .cifras, .anim .mando-cab, .anim .sala, .anim .jefatura, .anim .agente-envoltura { animation: aparecer 700ms var(--ease-out) both; }
.anim .dek { animation-delay: 80ms; } .anim .cifras, .anim .sala, .anim .jefatura, .anim .agente-envoltura { animation-delay: 160ms; }
@keyframes aparecer { from { opacity: 0; transform: translateY(14px); } }

/* ============ Pantallas medianas y móviles ============ */
@media (max-width: 1280px) {
  .sala { grid-template-columns: 320px minmax(0, 1fr); height: auto; }
  .p-avisos { max-height: 640px; }
  .p-mapa { min-height: 620px; }
  .p-lateral { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
}
@media (max-width: 1100px) {
  .barra { grid-template-columns: auto 1fr; }
  .municipio { display: none; }
  .navegacion { justify-self: end; }
  .j-mapa, .j-tiempos, .j-listas, .j-pendientes { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .bloque { display: block; padding: 40px 0; }
  .bloque-cab { position: static; margin-bottom: 22px; }
  .mapa-y-ranking { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifra:nth-child(3) { padding-left: 0; border-left: 0; }
  .cifra:nth-child(n + 3) { border-top: 1px solid var(--regla); }
  .sala { grid-template-columns: minmax(0, 1fr); }
  .p-mapa { order: -1; min-height: 480px; }
  .p-lateral { grid-template-columns: minmax(0, 1fr); }
  .agente-envoltura { grid-template-columns: minmax(0, 1fr); }
  .indicadores { margin-left: 0; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .barra { padding: 10px 16px; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .navegacion { justify-self: stretch; gap: 8px; }
  .marca-txt span { display: none; }
  .informe { padding: 24px 16px 56px; }
  .mando { padding: 14px 16px 32px; }
  .lede { margin-top: 28px; }
  .masthead span:last-child { display: none; }
  .cifra, .cifra + .cifra { padding: 16px 12px 16px 0; }
  .cifra:nth-child(2n) { padding-left: 14px; border-left: 1px solid var(--regla); }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .multiple:nth-child(2n) { padding-left: 0; border-left: 0; }
  .conflictivos li { grid-template-columns: 22px minmax(0, 1fr) 52px 46px; }
  .cf-barras { display: none; }
  .gran-dato { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agenda li { grid-template-columns: 64px 1fr; }
  .ag-cifra { grid-column: 2; text-align: left; }
  .atencion li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .conectores li { grid-template-columns: minmax(0, 1fr); }
  .indicadores div { padding: 0 14px 10px 0; border-left: 0; flex: 1 1 45%; }
  .indicadores dd { font-size: 24px; }
  #reloj { font-size: 28px; }
  .cinta-nota { display: none; }
  .movil { border-width: 6px; border-radius: 28px; min-height: 0; }
  .correo-kpis { grid-template-columns: repeat(2, 1fr); }
  .bh-fila { grid-template-columns: minmax(90px, 40%) 1fr auto; }
  .apilada-etq { font-size: 11.5px; }
  .pie { padding: 20px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; }
  .anim .bloque { opacity: 1; transform: none; }
  .flujo { stroke-dasharray: none; }
}

.mando:has(.agente-envoltura) { max-width: 1120px; }

/* ============ Especificación 01/12: calles, subsistemas, reglas y panel personalizable ============ */
.m3-calle { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; display: flex; flex-direction: column; align-items: center; font-size: 11.5px; line-height: 1.2; padding: 3px 8px; border-radius: 8px; background: var(--etq-fondo); border: 1px solid currentColor; transition: opacity 250ms ease; }
.m3-calle b { color: var(--m3-texto); font-weight: 600; }
.m3-calle.ok { color: var(--s1); } .m3-calle.aviso { color: #b07800; } .m3-calle.critico { color: var(--critico); }
.capas { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--capas-fondo); border: 1px solid var(--regla); pointer-events: auto; margin: 0 auto 0 14px; }
.capa-btn { border: 0; background: none; color: var(--tinta-2); font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out); }
.capa-btn:active { transform: scale(0.96); }
.capa-btn[aria-pressed="true"] { background: var(--acento); color: var(--acento-txt); }
.panel-cab.sobre { align-items: center; }
.mapa-leyenda[data-modo="incidentes"] .solo-trafico, .mapa-leyenda[data-modo="trafico"] .solo-incidentes { display: none; }
.mapa-leyenda .lg-calle { width: 16px; height: 4px; border-radius: 2px; }
.lg-calle.ok { background: #5acb94; } .lg-calle.aviso { background: #f3c04f; } .lg-calle.critico { background: #ff7b7b; }
.al-ia { font-size: 12.5px; color: var(--s3) !important; }
.alerta:has(.al-ia) { border-color: color-mix(in oklab, #4b8fe0 55%, var(--regla)); }

.mapa-calles .mc-barrio { fill: var(--superficie-2); stroke: var(--fondo); stroke-width: 3; }
.mc-calle path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mc-halo { stroke-width: 16; opacity: 0.14; }
.mc-linea { stroke-width: 5; }
.mc-flujo { stroke: #fff; stroke-width: 2; stroke-dasharray: 2 12; opacity: 0.8; animation: fluir 1.2s linear infinite; }
.mc-calle.ok path:not(.mc-flujo) { stroke: var(--s1); }
.mc-calle.aviso path:not(.mc-flujo) { stroke: #d99a00; }
.mc-calle.critico path:not(.mc-flujo) { stroke: var(--critico); }
.mc-calle.critico .mc-flujo { animation-duration: 3s; }
.mc-calle:hover .mc-halo { opacity: 0.3; }
.ranking.calles .r-barra i.ok { background: var(--s1); } .ranking.calles .r-barra i.aviso { background: #d99a00; } .ranking.calles .r-barra i.critico { background: var(--critico); }

.capas-arq { list-style: none; margin: 44px 0 0; padding: 0; border-top: 1px solid var(--regla); }
.capas-arq > li { display: grid; grid-template-columns: 64px minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; padding: 26px 0; border-bottom: 1px solid var(--regla-suave); }
.ca-num { font-size: 48px; font-weight: 800; line-height: 0.9; color: var(--acento); letter-spacing: -0.04em; }
.ca-txt h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 6px; }
.ca-txt p { color: var(--tinta-2); font-size: 15.5px; max-width: 58ch; }
.ca-piezas { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ca-piezas li { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--superficie-2); color: var(--tinta-2); }
.software { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.software li { padding: 14px 0; border-bottom: 1px solid var(--regla-suave); }
.software b { font-size: 16px; }
.software p { color: var(--tinta-2); font-size: 14px; margin-top: 3px; }
.software li.propio b { color: var(--acento); }

.tablero { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--regla); }
.tablero li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--regla-suave); }
.tablero li > i { width: 10px; height: 10px; border-radius: 50%; background: var(--bien); }
.tablero li.aviso > i { background: #d99a00; box-shadow: 0 0 0 4px color-mix(in oklab, #d99a00 25%, transparent); }
.tablero li.neutro > i { background: var(--tinta-3); }
.tablero b { font-size: 14.5px; display: block; }
.tablero div span { font-size: 12.5px; color: var(--tinta-3); }
.aviso-linea { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; font-size: 16px; }
.mini-titulo { font-size: 13px; font-weight: 600; color: var(--tinta-2); margin-bottom: 10px; }
.dos-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--regla-suave); font-size: 14px; }
.lista-simple.megafonia li { grid-template-columns: minmax(0, 1fr) auto; }
.lista-simple small { display: block; color: var(--tinta-3); font-size: 12px; }
.semaforos { display: grid; grid-template-columns: repeat(7, 28px); gap: 8px; margin-bottom: 6px; }
.semaforos i { width: 28px; height: 28px; border-radius: 50%; background: var(--s1); box-shadow: inset 0 0 0 4px color-mix(in oklab, var(--s1) 55%, var(--fondo)); }
.semaforos i.intermitente { background: #f3b400; box-shadow: inset 0 0 0 4px #ffe08a; animation: parpadeo 1.1s steps(2, jump-none) infinite; }
@keyframes parpadeo { 50% { opacity: 0.25; } }
.form-aviso { margin-top: 18px; }
.form-aviso label { font-size: 13px; color: var(--tinta-2); display: block; margin-bottom: 6px; }
.form-aviso div { display: flex; gap: 8px; }
.form-aviso input { flex: 1; min-width: 0; border: 1px solid var(--regla); border-radius: 8px; padding: 7px 10px; background: var(--superficie); font-size: 14px; }
b.malo { color: var(--alto); }
.reglas { list-style: none; margin: 0; padding: 0; }
.reglas li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 80px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--regla-suave); }
.reglas p { font-size: 14.5px; color: var(--tinta-2); }
.reglas p + p { margin-top: 4px; color: var(--tinta); font-weight: 500; }
.r-si, .r-entonces { display: inline-block; width: 70px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tinta-3); }
.r-entonces { color: var(--acento); }
.r-disparos { font-size: 24px; text-align: right; line-height: 1; }
.r-disparos small { display: block; font-size: 11px; font-weight: 400; color: var(--tinta-3); }
.reglas li:has(input:not(:checked)) div, .reglas li:has(input:not(:checked)) .r-disparos { opacity: 0.45; }
.interruptor { display: inline-flex; align-items: center; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor span { width: 36px; height: 21px; border-radius: 999px; background: var(--regla); position: relative; transition: background-color 180ms ease; }
.interruptor span::after { content: ""; position: absolute; width: 17px; height: 17px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 180ms var(--ease-out); }
.interruptor input:checked + span { background: var(--acento); }
.interruptor input:checked + span::after { transform: translateX(15px); }
.interruptor input:focus-visible + span { outline: 2px solid var(--acento); outline-offset: 2px; }

/* Mi panel */
.informe.ancho { max-width: 1320px; }
.panel-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 36px 0 22px; }
.lede.pequena { font-size: clamp(30px, 3.6vw, 48px); margin: 0 0 12px; }
.panel-herr { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.plantillas { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--superficie-2); }
.chip { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--tinta-2); cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); }
.chip.mas { background: var(--superficie); box-shadow: inset 0 0 0 1px var(--regla); }
@media (hover: hover) and (pointer: fine) { .chip.mas:hover { box-shadow: inset 0 0 0 1px var(--acento); color: var(--acento); } }
.boton[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); }
.catalogo { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border: 1px dashed var(--regla); border-radius: var(--radio); font-size: 13.5px; color: var(--tinta-2); }
.catalogo[hidden] { display: none; }
.catalogo > div { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.rejilla-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; grid-auto-flow: dense; }
.widget { background: var(--superficie); border: 1px solid var(--regla); border-radius: var(--radio); padding: 16px 18px 18px; min-width: 0; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgb(10 25 26 / 0.04); }
.widget.t-s { grid-column: span 1; } .widget.t-m { grid-column: span 2; } .widget.t-l { grid-column: span 4; }
.w-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; }
.w-cab h2 { font-size: 13px; font-weight: 700; color: var(--tinta-2); letter-spacing: 0.01em; }
.w-herr { display: none; gap: 4px; }
.editando .w-herr { display: flex; }
.w-btn { border: 0; background: var(--superficie-2); color: var(--tinta-2); border-radius: 7px; height: 26px; min-width: 26px; padding: 0 8px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; transition: transform 140ms var(--ease-out), background-color 160ms ease; }
.w-btn:active { transform: scale(0.94); }
.w-btn svg { width: 14px; height: 14px; fill: currentColor; }
.w-asa { cursor: grab; touch-action: none; }
.arrastrando .w-asa { cursor: grabbing; }
.editando .widget { border-style: dashed; }
.widget.arrastrando { box-shadow: 0 18px 40px -12px rgb(10 25 26 / 0.35); border-color: var(--acento); border-style: solid; z-index: 2; }
.widget.recien { animation: aparecer 420ms var(--ease-out) both; }
.w-num { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.w-num small { font-size: 14px; font-weight: 500; color: var(--tinta-3); letter-spacing: 0; margin: 0 6px 0 4px; }
.w-nota { font-size: 13px; color: var(--tinta-3); }
.widget .spark { max-width: none; }
.w-avisos { list-style: none; margin: 0; padding: 0; }
.w-avisos li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--regla-suave); font-size: 13px; }
.w-avisos li span b { display: block; font-size: 13.5px; }
.w-avisos time { font-size: 12px; color: var(--tinta-3); }

@media (max-width: 1100px) {
  .rejilla-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.t-l, .widget.t-m { grid-column: span 2; }
  .tablero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capas-arq > li { grid-template-columns: 52px minmax(0, 1fr); }
  .ca-piezas { grid-column: 2; }
}
@media (max-width: 760px) {
  .rejilla-panel { grid-template-columns: minmax(0, 1fr); }
  .widget.t-s, .widget.t-m, .widget.t-l { grid-column: auto; }
  .tablero, .software, .dos-col { grid-template-columns: minmax(0, 1fr); }
  .reglas li { grid-template-columns: 44px minmax(0, 1fr); }
  .r-disparos { grid-column: 2; text-align: left; }
  .capas { margin-left: 0; }
  .panel-cab.sobre > span { display: none; }
}

.boton-tema { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--regla); background: var(--superficie); color: var(--tinta-2); display: grid; place-items: center; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 160ms ease; }
.boton-tema:active { transform: scale(0.94); }
.boton-tema svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.boton-tema[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); }
.lado-barra { display: flex; align-items: center; gap: 14px; }
