/* GeoPortal ampm — estilos */
:root {
  color-scheme: light;
  --bg: #eceff2;
  --panel: #fbfcfd;
  --panel-2: #f1f4f7;
  --ink: #17212b;
  --ink-2: #4a5663;
  --muted: #7b8591;
  --line: #d8dee5;
  /* Azul de marca ampm (#0B2A8A, la "pm" del logo); los colores del mapa no cambian */
  --accent: #0b2a8a;
  --accent-ink: #ffffff;
  --accent-soft: #e3e9f7;
  --focus: #0b2a8a;

  --good: #0ca30c;
  --warn: #fab219;
  --crit: #d03b3b;
  --info: #2a78d6;
  --good-soft: #e2f4e2; --good-ink: #0b650b;
  --warn-soft: #fdf0d2; --warn-ink: #7d5200;
  --crit-soft: #fbe3e3; --crit-ink: #a02626;
  --info-soft: #e1ecfa; --info-ink: #1c5cab;
  --mute-soft: #e9ecef; --mute-ink: #4f5963;

  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --casing: #ffffff;
  --lim-est: #17212b; --lim-mun: #4a3aa7;
  --shadow: 0 1px 2px rgba(18, 28, 40, .08), 0 8px 24px rgba(18, 28, 40, .10);

  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1318; --panel: #151b22; --panel-2: #1c242d; --ink: #e7ecf1; --ink-2: #a9b3be;
    --muted: #7f8a96; --line: #29323c; --accent: #7fa3e8; --accent-ink: #0a1a40; --accent-soft: #16233f; --focus: #7fa3e8;
    --good-soft: #12301a; --good-ink: #5fd35f; --warn-soft: #3a2c0c; --warn-ink: #fac95a;
    --crit-soft: #3d1a1a; --crit-ink: #ff9191; --info-soft: #14283f; --info-ink: #8ab9f1;
    --mute-soft: #232b34; --mute-ink: #b3bcc6;
    --info: #3987e5; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --casing: #0e1318;
    --lim-est: #f1f4f7; --lim-mun: #b4a9f2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1318; --panel: #151b22; --panel-2: #1c242d; --ink: #e7ecf1; --ink-2: #a9b3be;
  --muted: #7f8a96; --line: #29323c; --accent: #7fa3e8; --accent-ink: #0a1a40; --accent-soft: #16233f; --focus: #7fa3e8;
  --good-soft: #12301a; --good-ink: #5fd35f; --warn-soft: #3a2c0c; --warn-ink: #fac95a;
  --crit-soft: #3d1a1a; --crit-ink: #ff9191; --info-soft: #14283f; --info-ink: #8ab9f1;
  --mute-soft: #232b34; --mute-ink: #b3bcc6;
  --info: #3987e5; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --casing: #0e1318;
  --lim-est: #f1f4f7; --lim-mun: #b4a9f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo.claro { display: none; }
  :root:not([data-theme="light"]) .brand-logo.oscuro { display: block; }
}
:root[data-theme="dark"] .brand-logo.claro { display: none; }
:root[data-theme="dark"] .brand-logo.oscuro { display: block; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Estructura */
.app {
  display: grid;
  grid-template-columns: minmax(330px, 390px) 1fr;
  grid-template-rows: auto 1fr;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
}
/* Marca: logo de ampm │ GeoPortal. En tema oscuro se usa la versión blanca del logo */
.brand { display: flex; align-items: center; gap: 10px; margin-right: 4px; color: inherit; text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-logo.oscuro { display: none; }
.brand-div { width: 1px; height: 22px; background: var(--line); }
.brand-name { font: 700 17px/1 var(--f-display); letter-spacing: -.01em; }

.tabs { display: flex; gap: 2px; background: var(--panel-2); padding: 3px; border-radius: 8px; }
.tabs button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 6px;
  font-weight: 500; color: var(--ink-2);
}
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tabs button:disabled { opacity: .45; cursor: default; }

.search { display: flex; flex: 1 1 260px; max-width: 440px; margin-left: auto; }
.search input {
  flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-right: 0;
  border-radius: 7px 0 0 7px; background: var(--panel-2);
}
.search button {
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 7px 12px; border-radius: 0 7px 7px 0; font-weight: 500;
}
.theme-btn { border: 1px solid var(--line); background: var(--panel); padding: 6px 10px; border-radius: 7px; color: var(--ink-2); }

.panel {
  overflow-y: auto; min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 18px 32px;
  display: flex; flex-direction: column; gap: 22px;
}
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

/* ---------- Panel: tipografía y bloques */
.p-head { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { margin: 0; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.p-head h1 { margin: 0; font: 600 23px/1.15 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.p-head .sub { margin: 0; color: var(--ink-2); }
.p-head .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
section.blk { display: flex; flex-direction: column; gap: 10px; }
section.blk > h2 {
  margin: 0; font: 600 12px/1.2 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
section.blk > h2 small { font: 400 12px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.demo-note {
  margin: 0; font-size: 12px; color: var(--ink-2); background: var(--panel-2);
  border: 1px dashed var(--line); padding: 8px 10px; border-radius: 8px;
}

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .l { font-size: 12px; color: var(--ink-2); }
.tile .v { font: 600 23px/1.15 var(--f-display); }
.tile .d { font-size: 12px; color: var(--muted); }
.tile.alert { box-shadow: inset 3px 0 0 var(--crit); border-radius: 0 8px 8px 0; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--chip-bg, var(--mute-soft)); color: var(--chip-ink, var(--mute-ink));
}
.st-ok { --chip-bg: var(--good-soft); --chip-ink: var(--good-ink); }
.st-warn { --chip-bg: var(--warn-soft); --chip-ink: var(--warn-ink); }
.st-crit { --chip-bg: var(--crit-soft); --chip-ink: var(--crit-ink); }
.st-info { --chip-bg: var(--info-soft); --chip-ink: var(--info-ink); }
.st-mute { --chip-bg: var(--mute-soft); --chip-ink: var(--mute-ink); }

.seg { display: flex; background: var(--panel-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 5px 8px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--panel); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Tabla de cedis */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl tr.next td { background: var(--info-soft); }

/* Lista de rutas */
.rutas { display: flex; flex-direction: column; gap: 6px; }
.ruta-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
  text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 11px;
}
.ruta-row:hover { border-color: var(--accent); }
.ruta-row .rn { font-weight: 500; }
.ruta-row .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; display: flex; gap: 2px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar i.ok { background: var(--good); }
.bar i.fail { background: var(--crit); }

.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtros button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ink-2);
}
.filtros button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Barras horizontales (motivos) */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.hbar .track { grid-column: 1 / -1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hbar .v { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Lista CP */
.cp-list { display: flex; flex-direction: column; }
.cp-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 8px 2px;
}
.cp-row:hover { background: var(--panel-2); }
.cp-row .t { font-size: 12px; color: var(--muted); }

/* Alertas */
.alertas { display: flex; flex-direction: column; gap: 6px; }
.alerta {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 11px; font-size: 13px;
}
.alerta:hover { border-color: var(--accent); }
.alerta .ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--chip-bg); color: var(--chip-ink); }

.back { align-self: flex-start; border: 0; background: transparent; color: var(--accent); padding: 0; font-weight: 500; }

/* Gráfica */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: var(--f-body); }
.chart .lbl { fill: var(--ink-2); font-size: 11.5px; font-weight: 500; font-family: var(--f-body); }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 6px; }
.tip {
  position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; z-index: 2;
}
.tip b { font-weight: 600; }
.tip .r { display: flex; align-items: center; gap: 6px; }
.tip .r i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- Controles sobre el mapa */
.capas {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 268px; max-height: calc(100% - 132px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.capas-head {
  display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent;
  padding: 10px 14px; font: 600 13px var(--f-display); letter-spacing: .02em;
}
.caret { width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-135deg); margin-top: 3px; transition: transform .15s; }
.capas-head[aria-expanded="false"] .caret { transform: rotate(45deg); margin-top: -4px; }
.capas-body { overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.glabel { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.capa { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.sw { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.sw input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.capa select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font-size: 12.5px; }
.leyenda { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); padding-left: 24px; }
.leyenda.lista span { display: flex; align-items: center; gap: 7px; }
.leyenda .sq { width: 12px; height: 12px; border-radius: 3px; background: var(--c); opacity: .8; flex: none; }
.leyenda .ln { width: 16px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.leyenda .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--casing); flex: none; }
.grad { height: 8px; border-radius: 4px; }
.grad-calor { background: linear-gradient(90deg, #fde3d3, #f6b08c, #eb6834, #b8441a, #6e250a); }
.grad-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.timebar {
  position: absolute; left: 12px; bottom: 30px; z-index: 3;
  width: min(460px, calc(100% - 140px));
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px;
}
.play {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; display: grid; place-items: center;
}
.tb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.tb-top output { font-size: 14px; font-weight: 500; color: var(--ink); }
.timebar input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0; }
.tb-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }

.toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: var(--ink); color: var(--panel); padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}

/* Marcadores */
.cedis-mk {
  display: flex; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; cursor: pointer;
}
.cedis-mk.izq { flex-direction: row-reverse; }
.cedis-mk .pin {
  width: 18px; height: 18px; border-radius: 4px; background: var(--ink); border: 3px solid var(--casing);
  box-shadow: 0 1px 4px rgba(0,0,0,.35); transform: rotate(45deg);
}
.cedis-mk .card {
  display: none; flex-direction: column; align-items: flex-start; gap: 1px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 6px 10px; font-size: 12px; color: var(--ink-2); text-align: left; white-space: nowrap;
}
.cedis-mk .card b { font: 600 14px var(--f-display); color: var(--ink); }
body[data-vista="nacional"] .cedis-mk .card { display: flex; }

.stop {
  width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font: 600 10.5px/1 var(--f-body); font-variant-numeric: tabular-nums;
  background: var(--panel); color: var(--ink); border: 2px solid var(--ink-2);
  box-shadow: 0 0 0 2px var(--casing);
}
.stop[data-st="ok"] { background: var(--good); border-color: var(--good); color: #fff; }
.stop[data-st="fail"] { background: var(--crit); border-color: var(--crit); color: #fff; }
.stop[data-next="1"] { border-color: var(--info); border-width: 3px; width: 26px; height: 26px; animation: pulso 1.6s ease-out infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 2px var(--casing), 0 0 0 2px rgba(42,120,214,.5); } 100% { box-shadow: 0 0 0 2px var(--casing), 0 0 0 12px rgba(42,120,214,0); } }
@media (prefers-reduced-motion: reduce) { .stop[data-next="1"] { animation: none; } .caret { transition: none; } }

/* Popups de MapLibre */
.maplibregl-popup-content {
  background: var(--panel); color: var(--ink); border-radius: 10px; padding: 12px 14px 10px;
  box-shadow: var(--shadow); font-family: var(--f-body); font-size: 13px;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel); }
.maplibregl-popup-close-button { color: var(--ink-2); font-size: 18px; padding: 2px 8px; }
.pop h3 { margin: 0 18px 2px 0; font: 600 15px var(--f-display); }
.pop .sub { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.pop dt { color: var(--muted); font-size: 12px; }
.pop dd { margin: 0; font-variant-numeric: tabular-nums; }
.pop .go { margin-top: 10px; border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

/* ---------- Vista de cobertura por CP */
body[data-vista="cobertura"] .grupo-op,
body[data-vista="cobertura"] .timebar,
body[data-vista="cobertura"] .cedis-mk,
body:not([data-vista="cobertura"]) .grupo-cob,
body:not([data-vista="cobertura"]) .suc-mk { display: none !important; }
.sw-l { font-weight: 500; }/* Muestra de línea de los límites (igual que en el mapa: estado sólido con halo, municipio punteado) */
.lim-ln { margin-left: auto; width: 26px; height: 3px; flex: none; border-radius: 2px; }
.lim-ln.est { background: var(--lim-est); box-shadow: 0 0 0 2px var(--casing); }
.lim-ln.mun { height: 2px; background: repeating-linear-gradient(90deg, var(--lim-mun) 0 6px, transparent 6px 10px); }
.grupo-lim .capa { border-top: 0; padding-top: 0; }
.grupo-cob[data-capa="servicio"] .solo-cob,
.grupo-cob:not([data-capa="servicio"]) .solo-serv { display: none !important; }
p.sw-l { margin: 0; }

/* Capa de días compromiso por servicio */
.dias { display: flex; flex-direction: column; gap: 4px; }
.dia-row {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; text-align: left;
  border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 7px; font-size: 12.5px;
}
.dia-row:hover { border-color: var(--line); background: var(--panel-2); }
.dia-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.dia-row .et { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.dia-row .vl { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dia-row .track { grid-column: 1 / -1; height: 7px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.dia-row .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.cob-row.activo { border-color: var(--accent); background: var(--accent-soft); }
.pop-tbl { margin-top: 2px; font-size: 12.5px; }
.pop-tbl td, .pop-tbl th { padding: 4px 6px; }
.origen-mk { display: flex; align-items: center; gap: 6px; pointer-events: none; }
.origen-mk .pt { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--casing); box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0,0,0,.35); }
.origen-mk .tx {
  font: 600 12px/1 var(--f-body); color: var(--ink); white-space: nowrap; background: var(--panel);
  padding: 4px 8px; border-radius: 6px; box-shadow: var(--shadow);
}

.filtro-ofi { display: flex; flex-direction: column; gap: 5px; }
.filtro-ofi label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.filtro-ofi select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 13.5px; width: 100%; }
.grupo-cob .capa:first-of-type { border-top: 0; padding-top: 0; }

.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.lista-ley { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; max-height: 170px; overflow-y: auto; }
.lista-ley span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lista-ley span em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-ley.una { grid-template-columns: 1fr; max-height: none; }

.stack { display: flex; gap: 2px; height: 10px; }
.stack i { display: block; height: 100%; background: var(--c); min-width: 2px; }
.stack i:first-child { border-radius: 4px 0 0 4px; }
.stack i:last-child { border-radius: 0 4px 4px 0; }
.stack-ley { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.stack-ley span { display: inline-flex; align-items: center; gap: 6px; }
.stack-ley b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.cob-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 11px;
}
.cob-row:hover { border-color: var(--accent); }
.cob-row .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cob-row .vl { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cob-row .meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.cob-row .stack { grid-column: 1 / -1; height: 6px; }
.cob-list { display: flex; flex-direction: column; gap: 6px; }
.sel-head { display: flex; align-items: center; gap: 10px; }
.sel-head .swatch { width: 16px; height: 16px; border-radius: 4px; }
.btn-sec {
  border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: 6px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.btn-sec:hover { border-color: var(--accent); color: var(--accent); }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.aviso { margin: 0; font-size: 13px; color: var(--ink-2); background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; }
.aviso code { font-family: var(--f-mono); font-size: 12px; }

.suc-mk { display: flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.suc-mk .pt { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--casing); flex: none; }
.suc-mk .tx {
  font: 600 11.5px/1 var(--f-body); color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 3px var(--casing), 0 0 3px var(--casing), 0 0 2px var(--casing);
}
.sin-etiquetas .suc-mk .tx { display: none; }
.suc-mk.tenue { opacity: .35; }

/* ---------- Pantallas angostas */
@media (max-width: 900px) {
  html, body { height: auto; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 64vh auto; height: auto; }
  .mapwrap { grid-row: 2; }
  .panel { grid-row: 3; border-right: 0; overflow: visible; padding-inline: 16px; }
  .topbar { gap: 10px; }
  .theme-btn { order: 1; margin-left: auto; }
  .tabs { order: 2; flex-basis: 100%; }
  .tabs button { flex: 1; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .capas { width: min(268px, calc(100% - 24px)); max-height: calc(100% - 150px); }
  .timebar { width: calc(100% - 24px); bottom: 44px; padding: 8px 12px; }
}
