/* Estilos principales. Nombre estable; la versión se controla con ?v=. */
:root{
    --bg:#0f1417;
    --panel:#161d23;
    --panel-2:#1d262d;
    --line:#2b353d;
    --text:#e7ecef;
    --muted:#8a97a1;
    --copper:#e8935a;
    --accent:#f2a65a;
    --copper-dim:#8a5636;
    --teal:#57c7b8;
    --warn:#e2574c;
    --ok:#6fbf73;
  }
  html[data-theme="light"]{
    --bg:#f3f6f8;
    --panel:#ffffff;
    --panel-2:#eaf0f3;
    --line:#c7d3da;
    --text:#172229;
    --muted:#5f707a;
    --copper:#c85f1d;
    --accent:#d66c27;
    --copper-dim:#db9a70;
    --teal:#087c70;
    --warn:#bd342f;
    --ok:#247c3c;
  }
  html[data-theme="contrast"]{
    --bg:#000000;
    --panel:#090909;
    --panel-2:#141414;
    --line:#806d00;
    --text:#ffffff;
    --muted:#e0e0e0;
    --copper:#ffd60a;
    --accent:#ffdf33;
    --copper-dim:#a88e00;
    --teal:#29ffd6;
    --warn:#ff5a55;
    --ok:#61ff8b;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;background:var(--bg);color:var(--text);overflow-x:hidden;}
  body{
    font-family:'IBM Plex Sans', sans-serif;
    -webkit-font-smoothing:antialiased;
    min-height:100vh;
  }
  .app{max-width:1280px;margin:0 auto;padding:20px 20px 60px;}
  @media (max-width:520px){ .app{padding:14px 12px 60px;} }

  /* ---- Header ---- */
  header.top{
    display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;justify-content:space-between;
    padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid var(--line);
  }
  .brand{display:flex;flex-direction:column;gap:4px;}
  .brand .eyebrow{
    font-family:'IBM Plex Mono',monospace;font-size:11px;letter-spacing:.14em;
    color:var(--copper);text-transform:uppercase;
  }
  .brand h1{
    font-family:'IBM Plex Sans',sans-serif;font-weight:700;font-size:26px;margin:0;
    letter-spacing:-.01em;
  }
  .logo-texto{
    font-family:'Inter','Segoe UI',sans-serif!important;
    font-size:28px!important;
    line-height:1.1;
    letter-spacing:-.5px!important;
    user-select:none;
  }
  .logo-buscador{color:#2d3748;font-weight:500;font-style:normal;}
  .logo-pluz{color:#d97706;font-weight:800;font-style:italic;}
  html:not([data-theme="light"]) .logo-buscador{color:#e7ecef;}
  html[data-theme="contrast"] .logo-buscador{color:#fff;}
  html[data-theme="contrast"] .logo-pluz{color:#ffd60a;}
  .brand .sub{color:var(--muted);font-size:13px;margin-top:2px;}

  .company-selector-shell{display:flex;flex-direction:column;gap:2px;min-width:190px;max-width:230px;}
  .company-selector-shell>span{font-size:8px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;}
  .company-selector{display:grid;grid-template-columns:1fr 1.25fr;gap:2px;padding:2px;background:var(--panel-2);border:1px solid var(--line);border-radius:9px;}
  .company-selector button{display:flex;align-items:center;justify-content:center;gap:3px;min-height:30px;padding:4px 6px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer;}
  .company-selector button[hidden]{display:none!important;}
  .company-selector-shell[hidden]{display:none!important;}
  .company-selector button b{font-size:10px;white-space:nowrap;}
  .company-selector button small{font:10px 'IBM Plex Mono',monospace;opacity:.78;}
  .company-selector button.active{background:var(--panel);border-color:var(--copper);color:var(--text);box-shadow:0 2px 8px rgba(0,0,0,.12);}
  .company-selector button:focus-visible{outline:3px solid var(--accent);outline-offset:2px;}
  .company-active-note{font-size:11px;color:var(--muted);}
  .company-active-note strong{color:var(--teal);}
  .company-selector-tool.in-more-tools{flex:0 0 220px;align-self:stretch;justify-content:center;padding:5px 7px;border:1px dashed var(--line);border-radius:10px;background:var(--panel);}

  @media (max-width:520px){
    .logo-texto{font-size:27px!important;}
    .company-selector-shell{width:100%;max-width:none;min-width:0;order:0;align-self:center;}
    .company-selector-tool{padding:7px;}
  }

  .stats{display:flex;gap:10px;flex-wrap:wrap;}
  .stat{
    background:var(--panel);border:1px solid var(--line);border-radius:8px;
    padding:8px 14px;min-width:96px;text-align:center;
  }
  .stat b{
    display:block;font-family:'IBM Plex Mono',monospace;font-size:18px;color:var(--teal);
  }
  .stat span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;}
  .theme-switcher{min-width:150px;align-self:flex-end;}
  .theme-switcher label{margin:0 0 5px;}
  .theme-switcher select{padding:7px 9px;font-size:12px;}
  .desktop-settings-group{
    display:flex;align-items:flex-end;gap:12px;margin-left:auto;
  }

  @media (max-width:860px){
    .desktop-settings-group{display:contents;}
  }

  /* ---- Breaker Tabs ---- */
  .tabs{display:flex;gap:10px;margin-bottom:18px;flex-wrap:wrap;}
  .section-nav-toggle{display:none;}
  .breaker{
    display:flex;align-items:center;gap:10px;background:var(--panel);
    border:1px solid var(--line);border-radius:10px;padding:8px 16px 8px 10px;
    cursor:pointer;user-select:none;transition:border-color .15s ease, background .15s ease;
    flex:1 1 auto;min-width:130px;
  }
  .breaker:hover{border-color:var(--copper-dim);}
  .breaker:focus-visible{outline:3px solid var(--accent);outline-offset:2px;}
  .breaker.active{background:var(--panel-2);border-color:var(--copper);}
  .switch{
    width:30px;height:16px;border-radius:8px;background:#0c1114;border:1px solid var(--line);
    position:relative;flex:none;
  }
  .switch::after{
    content:'';position:absolute;top:2px;left:2px;width:10px;height:10px;border-radius:50%;
    background:var(--muted);transition:all .18s ease;
  }
  .breaker.active .switch{border-color:var(--copper-dim);}
  .breaker.active .switch::after{left:16px;background:var(--copper);box-shadow:0 0 8px var(--copper);}
  .breaker .label{font-family:'IBM Plex Sans',sans-serif;font-weight:600;font-size:14px;}
  .breaker .count{font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--muted);}

  /* ---- Layout ---- */
  .view{display:none;}
  .view.active{display:grid;grid-template-columns:300px 1fr;gap:18px;}
  @media (max-width:860px){ .view.active{grid-template-columns:1fr;} }

  .panel{
    background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px;
    min-width:0;
  }
  .panel h2{
    font-family:'IBM Plex Sans',sans-serif;font-size:13px;letter-spacing:.06em;
    text-transform:uppercase;color:var(--muted);margin:0 0 12px;
  }
  label{display:block;font-size:11px;color:var(--muted);margin:12px 0 6px;text-transform:uppercase;letter-spacing:.05em;}
  label:first-of-type{margin-top:0;}
  input[type=text], select{
    width:100%;background:var(--panel-2);border:1px solid var(--line);border-radius:6px;
    color:var(--text);padding:9px 10px;font-family:'IBM Plex Mono',monospace;font-size:13px;
    outline:none;
  }
  input[type=text]:focus, select:focus{border-color:var(--copper);}
  .hint{font-size:11px;color:var(--muted);margin-top:6px;line-height:1.4;}
  .btn{
    margin-top:14px;width:100%;background:var(--copper);border:none;color:#161006;
    font-family:'IBM Plex Sans',sans-serif;font-weight:600;font-size:13px;
    padding:10px;border-radius:6px;cursor:pointer;letter-spacing:.02em;
  }
  .btn:hover{filter:brightness(1.08);}
  .btn.secondary{
    background:transparent;border:1px solid #e8935a;color:var(--text);margin-top:8px;
  }

  .results-panel{display:flex;flex-direction:column;gap:14px;min-width:0;}
  .result-meta{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted);}
  .result-meta b{color:var(--teal);font-family:'IBM Plex Mono',monospace;}
  #view-seds .result-meta{flex-wrap:wrap;gap:8px 12px;}

  /* Estilo global unico para los botones de accion de los mapas (Abrir/Cerrar
     mapa, Ruta, Centrar mapa, Ver mapa poligonal, Leyenda, Capas/Radios):
     antes cada uno tenia su propia altura, relleno y forma (algunos con
     fondo solido, otros solo borde), lo que se veia inconsistente. Ahora
     todos comparten el mismo tamano y forma, tanto en la vista chica como
     a pantalla completa. El color de fondo de "activo" (aria-pressed o
     aria-expanded) no lleva !important para que se siga viendo cual esta
     encendido. */
  .map-complete-shell .map-complete-actions :is(.map-complete-location,.map-complete-center,.map-complete-button,.sed-feeder-zone-toggle,.map-filter-toggle,.map-legend-toggle){
    box-sizing:border-box!important;display:inline-flex;align-items:center;justify-content:center;
    min-width:0!important;min-height:36px!important;height:36px!important;margin:0!important;
    padding:7px 12px!important;border:1px solid var(--accent);border-radius:8px!important;
    background:transparent;color:var(--text);font:700 11px/1.2 'IBM Plex Sans',sans-serif!important;
    text-decoration:none;white-space:nowrap;box-shadow:none;
  }
  .map-complete-shell .map-complete-actions :is(.map-complete-location,.map-complete-center,.map-complete-button,.sed-feeder-zone-toggle,.map-filter-toggle,.map-legend-toggle):hover{
    background:color-mix(in srgb,var(--accent) 13%,transparent);
  }
  .map-complete-shell .map-complete-actions .sed-feeder-zone-toggle[aria-pressed="true"]{border-color:var(--copper);background:color-mix(in srgb,var(--copper) 18%,var(--panel));color:var(--text);}
  .map-complete-shell .map-complete-actions .map-filter-toggle[aria-expanded="true"],
  .map-complete-shell .map-complete-actions .map-legend-toggle[aria-expanded="true"]{background:var(--accent);color:#fff;}

  @media(max-width:640px){
    /* En celular el boton "Ver mapa poligonal" se oculta: el mapa ya es
       chico y ese boton ocupaba espacio valioso en la barra de acciones. */
    .map-complete-shell .map-complete-actions .sed-feeder-zone-toggle{display:none!important;}
  }

  .sed-feeder-prefix-results{display:grid;gap:10px;margin:10px 0 14px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);}
  .sed-feeder-prefix-results.hidden{display:none;}
  .sed-feeder-prefix-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--text);font-size:12px;}
  .sed-feeder-prefix-heading span{color:var(--muted);font-size:11px;}
  .sed-feeder-prefix-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px;}
  .sed-feeder-prefix-button{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:42px;padding:8px 10px;border:1px solid var(--accent);border-radius:9px;background:transparent;color:var(--text);font:700 12px/1.2 'IBM Plex Sans',sans-serif;cursor:pointer;}
  .sed-feeder-prefix-button:hover,.sed-feeder-prefix-button:focus-visible{background:color-mix(in srgb,var(--accent) 10%,transparent);}
  .sed-feeder-prefix-button span{color:var(--muted);font:600 10px/1.2 'IBM Plex Mono',monospace;}
  @media(max-width:520px){.sed-feeder-prefix-heading{align-items:flex-start;flex-direction:column;gap:3px}.sed-feeder-prefix-list{grid-template-columns:repeat(2,minmax(0,1fr))}.sed-feeder-prefix-button{min-height:44px}}
  .compare-time-meta,.compare-selected-action{display:none;}
  .warn-banner{
    background:#2a1c14;border:1px solid var(--warn);color:#f0b6ae;font-size:12px;
    padding:8px 12px;border-radius:6px;display:none;
  }

  table{width:100%;min-width:560px;border-collapse:collapse;font-size:12.5px;}
  thead th{
    text-align:left;font-family:'IBM Plex Mono',monospace;font-size:10.5px;color:var(--muted);
    text-transform:uppercase;letter-spacing:.05em;padding:6px 8px;border-bottom:1px solid var(--line);
    position:sticky;top:0;background:var(--panel);white-space:nowrap;
  }
  tbody td{padding:7px 8px;border-bottom:1px solid var(--line);font-family:'IBM Plex Mono',monospace;white-space:nowrap;}
  tbody tr:hover{background:var(--panel-2);cursor:pointer;}
  .table-scroll{max-height:340px;overflow:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:8px;}
 .maplink{display:inline-block;background:var(--copper);color:#161006;text-decoration:none;border:0;border-radius:5px;padding:5px 8px;font-family:'IBM Plex Sans',sans-serif;font-weight:700;font-size:11px;line-height:1.1;white-space:nowrap;}
  .maplink:hover{background:#f2a36e;color:#161006;filter:none;}

  #view-seds .table-scroll{background:var(--panel);}
  #view-seds .sed-results-table{width:100%;min-width:860px;table-layout:fixed;}
  #view-seds .sed-results-table th,
  #view-seds .sed-results-table td{padding:8px 5px;vertical-align:middle;font-size:10px;}
  #view-seds .sed-results-table th{padding:8px 5px;font-size:9px;}
  #view-seds .sed-results-table th:nth-child(1){width:8%;}
  #view-seds .sed-results-table th:nth-child(2){width:7%;}
  #view-seds .sed-results-table th:nth-child(3){width:23%;}
  #view-seds .sed-results-table th:nth-child(4){width:8%;}
  #view-seds .sed-results-table th:nth-child(5){width:8%;}
  #view-seds .sed-results-table th:nth-child(7){width:78px;}
  #view-seds .sed-results-table th:nth-child(8){width:58px;}
  #view-seds .sed-results-table th:nth-child(9){width:14%;}
  #view-seds .sed-results-table th:nth-child(3),
  #view-seds .sed-results-table td:nth-child(3),
  #view-seds .sed-results-table th:nth-child(6),
  #view-seds .sed-results-table td:nth-child(6),
  #view-seds .sed-results-table th:nth-child(9),
  #view-seds .sed-results-table td:nth-child(9){white-space:normal;overflow-wrap:anywhere;line-height:1.3;}
  #view-seds .sed-results-table th:nth-child(7),
  #view-seds .sed-results-table th:nth-child(8),
  #view-seds .sed-results-table td:nth-child(7),
  #view-seds .sed-results-table td:nth-child(8){text-align:center;}
  #view-seds .sed-results-table .maplink{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;max-width:100%;min-height:32px;padding:7px 3px;overflow:hidden;border-radius:7px;font-size:9px;text-align:center;}
  .sed-mobile-meta{display:none;}
  .sed-company-cell{font-weight:800;}
  .sed-company-lari{color:#2563eb;}
  .sed-company-pa{color:#dc2626;}
  .sed-company-cobra,.sed-company-cobra-nch,.sed-company-cobra-ch{color:#9333ea;}

  @media (max-width:640px){
    /* En celular, los datos nuevos se resumen dentro de la celda SED:
       tipo de construcción y empresa. */
    #view-seds .sed-results-table{min-width:0!important;width:100%;}
    #view-seds .sed-results-table th:nth-child(2),#view-seds .sed-results-table td:nth-child(2),
    #view-seds .sed-results-table th:nth-child(3),#view-seds .sed-results-table td:nth-child(3),
    #view-seds .sed-results-table th:nth-child(4),#view-seds .sed-results-table td:nth-child(4),
    #view-seds .sed-results-table th:nth-child(5),#view-seds .sed-results-table td:nth-child(5),
    #view-seds .sed-results-table th:nth-child(6),#view-seds .sed-results-table td:nth-child(6),
    #view-seds .sed-results-table th:nth-child(9),#view-seds .sed-results-table td:nth-child(9){display:none;}
    #view-seds .sed-results-table th:nth-child(1){width:auto;}
    #view-seds .sed-results-table th:nth-child(7){width:76px;}
    #view-seds .sed-results-table th:nth-child(8){width:48px;}
    #view-seds .sed-results-table td:first-child{white-space:normal;width:auto;}
    #view-seds .sed-results-table td:nth-child(7),#view-seds .sed-results-table td:nth-child(8){padding:7px 3px;}
    #view-seds .sed-results-table td:nth-child(7) .maplink,#view-seds .sed-results-table td:nth-child(8) .maplink{width:100%;min-height:38px;padding:7px 4px;font-size:9px;}
    .sed-mobile-meta{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px;}
    .sed-mobile-meta span{display:inline-flex;padding:4px 6px;border:1px solid currentColor;border-radius:999px;font:700 9px/1.2 'IBM Plex Sans',sans-serif;}
    .sed-type-badge{color:var(--muted);}
    #view-seds .table-scroll{overflow-x:hidden;}
  }

  @media (min-width:641px) and (max-width:1250px){
    /* En PC compacto el panel de búsqueda reduce el ancho disponible.
       Se conserva la dirección y se priorizan siempre las dos acciones. */
    #view-seds .sed-results-table{width:100%;min-width:0!important;}
    #view-seds .sed-results-table th:nth-child(9),
    #view-seds .sed-results-table td:nth-child(9){display:none;}
    #view-seds .sed-results-table th:nth-child(1){width:8%;}
    #view-seds .sed-results-table th:nth-child(2){width:7%;}
    #view-seds .sed-results-table th:nth-child(3){width:24%;}
    #view-seds .sed-results-table th:nth-child(4){width:8%;}
    #view-seds .sed-results-table th:nth-child(5){width:8%;}
    #view-seds .sed-results-table th:nth-child(7){width:78px;}
    #view-seds .sed-results-table th:nth-child(8){width:58px;}
    #view-seds .table-scroll{overflow-x:hidden;}
  }

  #map-seds, #map-postes, #map-estructuras, #map-compare, #map-suministros, #map-infrastructure{
    height:380px;border-radius:8px;border:1px solid var(--line);background:var(--panel-2);
  }
  @media (max-width:520px){
    #map-seds, #map-postes, #map-estructuras, #map-compare, #map-suministros, #map-infrastructure{ height:280px; }
  }
  #compare-matrix table{min-width:100%;}
  #compare-matrix th, #compare-matrix td{
    padding:6px 9px;border:1px solid var(--line);text-align:center;white-space:nowrap;
  }
  #compare-matrix thead th{position:static;background:var(--panel-2);}
  textarea{outline:none;}
  textarea:focus{border-color:var(--copper) !important;}

  .empty{color:var(--muted);font-size:12px;padding:20px;text-align:center;}
  .poste-adjacent-action{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
  .poste-adjacent-action .btn{margin-top:0}.btn:disabled{cursor:not-allowed;opacity:.46;filter:none}
  .poste-adjacent-panel[hidden]{display:none}.poste-adjacent-panel{margin-top:0}
  .poste-code-label{padding:3px 6px!important;border:1px solid var(--line)!important;border-radius:5px!important;background:color-mix(in srgb,var(--panel) 92%,transparent)!important;color:var(--text)!important;box-shadow:0 2px 7px rgba(0,0,0,.35)!important;font:700 10px/1.25 'IBM Plex Mono',monospace!important;text-align:center!important}

  @media (min-width:641px) and (max-width:860px){
    .stats{display:none!important;}
    #view-seds .sed-results-table{min-width:0!important;}
    .section-nav{margin-bottom:14px;}
    .section-nav-toggle{
      display:block;width:100%;margin:0 0 8px;padding:10px 12px;border:1px solid var(--line);
      border-radius:8px;background:var(--panel);color:var(--text);font:700 13px 'IBM Plex Sans',sans-serif;
    }
    .section-nav .tabs{margin-bottom:0;}
    .section-nav.is-collapsed .breaker:not(.active){display:none;}
    .section-nav.is-collapsed .breaker.active{flex-basis:100%;}
    .compare-time-meta{display:inline;}
    .compare-selected-action:not(.hidden){
      display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:8px;
      z-index:500;padding:10px 12px;border:1px solid var(--copper);border-radius:8px;
      background:var(--panel);box-shadow:0 5px 18px rgba(0,0,0,.28);
    }
    .compare-selected-action span{min-width:0;font:700 12px 'IBM Plex Mono',monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    #view-comparar .result-meta{flex-wrap:wrap;gap:8px;}
  }
  @media (pointer:coarse) and (max-width:1024px){
    .stats{display:none!important;}
  }
  .poste-code-label::before{display:none!important}.poste-code-label small{color:var(--teal);font-size:8px;font-weight:600}
  .consulta-adjacent-action{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
  .consulta-adjacent-action .btn{margin-top:0}.consulta-adjacent-panel[hidden]{display:none}.consulta-adjacent-panel{margin-top:0}
  .supply-code-label{padding:3px 6px!important;border:1px solid var(--line)!important;border-radius:5px!important;background:color-mix(in srgb,var(--panel) 92%,transparent)!important;color:var(--text)!important;box-shadow:0 2px 7px rgba(0,0,0,.35)!important;font:700 10px/1.25 'IBM Plex Mono',monospace!important;text-align:center!important}
  .supply-code-label::before{display:none!important}.supply-code-label small{color:var(--teal);font-size:8px;font-weight:600}
  footer{max-width:760px;margin:24px auto 0;padding:14px 12px 18px;border-top:1px solid var(--line);color:color-mix(in srgb,var(--text) 78%,var(--muted));font-size:12px;font-weight:600;text-align:center;line-height:1.55}
  footer span{display:block}.footer-note{margin-top:3px;color:var(--muted);font-size:10.5px;font-weight:400}
  footer .visit-counter{display:inline-flex;align-items:center;gap:5px;margin-top:9px;padding:5px 11px;border:1px solid var(--line);border-radius:999px;background:var(--panel-2);color:var(--muted);font-size:11px;font-weight:600}footer .visit-counter b{color:var(--accent);font:700 12px 'IBM Plex Mono',monospace}
  html.is-app-webview footer{margin-bottom:max(24px,env(safe-area-inset-bottom,0px));padding-bottom:max(18px,env(safe-area-inset-bottom,0px))}
  ::-webkit-scrollbar{width:8px;height:8px;}
  ::-webkit-scrollbar-thumb{background:var(--line);border-radius:4px;}

  /* ---- WhatsApp floating button ---- */
  .wa-dock{display:contents}
  .wa-float{
    position:fixed;right:16px;bottom:16px;z-index:2100;
    width:50px;height:50px;border:2px solid #fff;border-radius:50%;
    background:#25D366;display:flex;align-items:center;justify-content:center;
    box-shadow:0 4px 14px rgba(0,0,0,.45);text-decoration:none;
    transition:transform .15s ease, box-shadow .15s ease;
  }
  .wa-float:hover{transform:scale(1.08);box-shadow:0 6px 20px rgba(0,0,0,.5);}
  .wa-float svg{width:25px;height:25px;fill:#fff;}
  .wa-label{
    position:fixed;right:76px;bottom:31px;z-index:2100;display:block;
    background:var(--panel-2);border:1px solid var(--line);color:var(--text);
    padding:6px 10px;border-radius:6px;font-size:11px;white-space:nowrap;
    opacity:0;pointer-events:none;transition:opacity .15s ease;
  }
  .wa-float:hover + .wa-label{opacity:1;}
  .wa-close{
    position:fixed;right:10px;bottom:61px;z-index:2101;display:block;
    width:20px;height:20px;border-radius:50%;
    background:var(--panel-2);border:1px solid var(--line);color:var(--muted);
    font-size:13px;line-height:18px;text-align:center;cursor:pointer;padding:0;
    font-family:'IBM Plex Sans',sans-serif;
  }
  .wa-close:hover{color:var(--warn);border-color:var(--warn);}
  .wa-dock.is-minimized .wa-label{display:none!important}
  .wa-dock.is-minimized .wa-float{right:10px;bottom:10px;width:38px;height:38px;opacity:.88}
  .wa-dock.is-minimized .wa-float svg{width:20px;height:20px}
  .wa-dock.is-minimized .wa-close{right:5px;bottom:42px;width:18px;height:18px;line-height:16px}

  @media(max-width:900px){
    .wa-dock,
    .wa-dock.is-minimized{
      display:flex;
      position:static;
      align-items:center;
      justify-content:center;
      gap:8px;
      width:100%;
      margin-top:10px;
    }
    .wa-dock .wa-float,
    .wa-dock.is-minimized .wa-float{
      position:static;
      width:42px;
      height:42px;
      flex:0 0 42px;
      opacity:1;
      transform:none;
    }
    .wa-dock .wa-label{
      position:static;
      display:block;
      max-width:min(240px,calc(100vw - 122px));
      padding:6px 9px;
      opacity:1;
      white-space:normal;
      pointer-events:auto;
    }
    .wa-dock .wa-close,
    .wa-dock.is-minimized .wa-close{
      position:static;
      width:30px;
      height:30px;
      flex:0 0 30px;
      font-size:17px;
      line-height:28px;
    }
    .wa-dock.is-minimized{width:auto}
  }
  html[data-theme="light"] .switch{background:#d9e2e7;}
  html[data-theme="light"] .btn{color:#fff;}
  html[data-theme="light"] .btn.secondary{color:var(--text);}
  html[data-theme="light"] .maplink{color:#fff;}
  html[data-theme="contrast"] .btn,html[data-theme="contrast"] .maplink{color:#000;}
  html[data-theme="contrast"] .btn.secondary{color:var(--text);}
  html[data-theme="contrast"] *:focus-visible{outline:3px solid var(--accent);outline-offset:2px;}

  .leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--panel);color:var(--text);}
  .leaflet-popup-close-button{color:var(--text)!important;}

  /* ---- Seguridad ---- */
  #view-seguridad.active{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;align-items:start;
  }
  .safety-hero{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.75fr);gap:18px;align-items:center;border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:linear-gradient(135deg,var(--panel),color-mix(in srgb,var(--accent) 9%,var(--panel)))}
  .safety-hero h2{margin:8px 0!important;color:var(--text)!important;font-size:20px!important;text-transform:none!important;letter-spacing:0!important}.safety-hero p{max-width:780px;margin:0;color:var(--muted);font-size:13px;line-height:1.65}.version-badge{display:inline-flex;padding:5px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 16%,transparent);border:1px solid var(--accent);color:var(--accent);font:700 10px/1 'IBM Plex Mono',monospace;letter-spacing:.08em}.safety-alert{display:grid;gap:5px;padding:14px;border-left:4px solid var(--warn);border-radius:7px;background:color-mix(in srgb,var(--warn) 10%,var(--panel-2))}.safety-alert b{font-size:13px;color:var(--text)}.safety-alert span{color:var(--muted);font-size:12px;line-height:1.5}
  .safety-section{min-width:0;overflow:hidden}.safety-section h2{line-height:1.35}.safety-checklist{display:grid;gap:9px;margin:0;padding:0;list-style:none}.safety-checklist li{display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:start;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.safety-checklist>li>span{display:grid;place-items:center;width:34px;height:34px;border-radius:7px;background:color-mix(in srgb,var(--teal) 15%,transparent);color:var(--teal);font:700 11px 'IBM Plex Mono',monospace}.safety-checklist div{display:grid;gap:3px}.safety-checklist b{font-size:13px}.safety-checklist small{color:var(--muted);font-size:12px;line-height:1.4}
  .procedures-panel{grid-column:1/-1}.procedure-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.procedure-heading .safety-intro{margin-bottom:0}.procedure-count{flex:none;padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel-2);color:var(--muted);font:700 11px 'IBM Plex Mono',monospace}.procedure-filters{display:grid;grid-template-columns:minmax(190px,.7fr) minmax(240px,1.3fr);gap:12px;margin:16px 0}.procedure-filters label{display:grid;gap:6px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.procedure-filters select,.procedure-filters input{width:100%;min-height:42px;padding:9px 11px;border:1px solid var(--line);border-radius:7px;background:var(--panel-2);color:var(--text);font:500 13px inherit}.procedure-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:560px;overflow:auto;padding-right:4px}.procedure-card{display:flex;min-width:0;flex-direction:column;gap:8px;padding:13px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.procedure-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.procedure-code{color:var(--accent);font:700 11px 'IBM Plex Mono',monospace}.procedure-area{max-width:55%;overflow:hidden;color:var(--muted);font-size:10px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.procedure-card h3{margin:0;font-size:13px;line-height:1.4}.procedure-card p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.procedure-link{align-self:flex-start;margin-top:auto;color:var(--accent);font-size:12px;font-weight:700;text-decoration:none}.procedure-link:hover{text-decoration:underline}.procedure-unavailable{margin-top:auto;color:var(--muted);font-size:11px}.procedure-note,.procedure-empty{margin:12px 0 0;color:var(--muted);font-size:11px;line-height:1.5}.procedure-empty{grid-column:1/-1;padding:18px;text-align:center;border:1px dashed var(--line);border-radius:8px}
  .concepts-panel,.work-stages-panel,.form-guide-panel,.waste-panel{grid-column:1/-1}.concept-flow{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:stretch}.concept-flow article{display:grid;align-content:start;gap:7px;padding:14px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}.concept-flow article b{font-size:14px}.concept-flow p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.concept-flow small{color:var(--text);font-size:11.5px;line-height:1.45}.concept-tag{width:max-content;padding:4px 7px;border-radius:5px;font:700 10px 'IBM Plex Mono',monospace}.concept-tag.danger{background:rgba(226,87,76,.16);color:#ff8279}.concept-tag.risk{background:rgba(242,166,90,.16);color:var(--accent)}.concept-tag.control{background:rgba(87,199,184,.16);color:var(--teal)}.flow-arrow{display:grid;place-items:center;color:var(--accent);font-size:22px}.example-line{display:grid;gap:4px;margin-top:11px;padding:11px;border-left:3px solid var(--teal);background:color-mix(in srgb,var(--teal) 7%,var(--panel-2));font-size:12px}.example-line span{color:var(--muted);line-height:1.5}
  .work-stages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.work-stages article{display:grid;grid-template-columns:32px minmax(0,1fr);gap:9px;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}.work-stages>article>span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--accent);color:#171006;font:700 13px 'IBM Plex Mono',monospace}.work-stages b{font-size:13px}.work-stages p{margin:4px 0 0;color:var(--muted);font-size:11.5px;line-height:1.45}
  .form-guide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.form-guide article{padding:11px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.form-guide b{font-size:12.5px;color:var(--text)}.form-guide p{margin:5px 0 0;color:var(--muted);font-size:11.5px;line-height:1.5}.fill-warning{display:grid;gap:4px;margin-top:10px;padding:11px;border:1px solid color-mix(in srgb,var(--warn) 55%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--warn) 7%,var(--panel));font-size:12px}.fill-warning span{color:var(--muted);line-height:1.5}
  .waste-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.waste-grid article{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.bin-icon{position:relative;width:28px;height:31px;flex:none;border:2px solid var(--bin-border,var(--bin));border-radius:3px 3px 6px 6px;background:var(--bin)}.bin-icon::before{content:'';position:absolute;left:-4px;top:-6px;width:32px;height:5px;border-radius:3px;background:var(--bin);border:1px solid var(--bin-border,var(--bin))}.waste-grid b{display:block;font-size:12.5px}.waste-grid small{display:block;margin-top:2px;color:var(--muted);font-size:11px;line-height:1.35}.safety-source{display:inline-block;margin-top:11px;color:var(--accent);font-size:12px;font-weight:700;text-decoration:none}
  .hazard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.hazard-card{display:grid;grid-template-columns:34px minmax(0,1fr);gap:9px;padding:11px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.hazard-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--warn) 14%,transparent);font-size:17px}.hazard-card b{font-size:13px}.hazard-card p{margin:4px 0 0;color:var(--muted);font-size:11.5px;line-height:1.45}.ppe-list{display:flex;flex-wrap:wrap;gap:8px}.ppe-list span{padding:7px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel-2);color:var(--text);font-size:11.5px}.emergency-panel{border-color:color-mix(in srgb,var(--warn) 45%,var(--line))}.emergency-steps{display:grid;gap:8px;margin:0;padding:0;counter-reset:emergency;list-style:none}.emergency-steps li{counter-increment:emergency;display:grid;grid-template-columns:30px minmax(0,1fr);gap:2px 9px;padding:9px 10px;border-bottom:1px solid var(--line)}.emergency-steps li::before{content:counter(emergency);grid-row:1/3;display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:var(--warn);color:#fff;font:700 12px 'IBM Plex Mono',monospace}.emergency-steps b{font-size:12.5px}.emergency-steps span{color:var(--muted);font-size:11.5px;line-height:1.4}
  .electrical-magnitudes-panel{grid-column:1/-1}.electrical-magnitudes-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.electrical-magnitude{--magnitude-color:var(--accent);display:grid;grid-template-columns:58px minmax(0,1fr);gap:12px;padding:14px;border:1px solid color-mix(in srgb,var(--magnitude-color) 55%,var(--line));border-radius:11px;background:color-mix(in srgb,var(--magnitude-color) 6%,var(--panel-2))}.electrical-magnitude.current{--magnitude-color:#63b334}.electrical-magnitude.resistance{--magnitude-color:#d97706}.electrical-magnitude.power{--magnitude-color:#7c4bb3}.magnitude-symbol{display:grid;place-items:center;width:54px;height:54px;border:3px solid var(--magnitude-color);border-radius:50%;color:var(--magnitude-color);font:800 27px 'IBM Plex Mono',monospace}.magnitude-content{display:grid;gap:8px;min-width:0}.magnitude-content h3{margin:0;color:var(--magnitude-color);font-size:16px;text-transform:uppercase;letter-spacing:.03em}.magnitude-content p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.magnitude-content dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0}.magnitude-content dl div{display:grid;gap:2px;padding:7px;border:1px solid var(--line);border-radius:7px;background:var(--panel)}.magnitude-content dt{color:var(--muted);font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.magnitude-content dd{margin:0;color:var(--text);font-size:11.5px;line-height:1.35}.magnitude-formula{justify-self:start;padding:7px 11px;border:1px solid color-mix(in srgb,var(--magnitude-color) 55%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--magnitude-color) 12%,var(--panel));color:var(--text);font:800 15px 'IBM Plex Mono',monospace}
  .quick-contacts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.quick-contact{display:grid;gap:4px;padding:13px;border:1px solid var(--line);border-radius:10px;background:var(--panel-2);text-decoration:none;color:var(--text)}.quick-contact strong{font:800 28px 'IBM Plex Mono',monospace;color:var(--accent)}.quick-contact span{font-size:12px}.electric-first-aid .emergency-steps li{grid-template-columns:54px minmax(0,1fr);padding:13px 10px}.electric-first-aid .emergency-steps li::before{width:48px;height:48px;font-size:22px}.electric-first-aid .emergency-steps b{font-size:14px}.electric-first-aid .emergency-steps span{font-size:12px}.emergency-warning{margin:0 0 10px;padding:10px 12px;border-left:4px solid var(--danger);background:color-mix(in srgb,var(--danger) 10%,var(--panel));font-weight:700}.emergency-note{margin:10px 0 0;color:var(--muted);font-size:11.5px;line-height:1.45}
  @media(max-width:900px){#view-seguridad.active{grid-template-columns:minmax(0,1fr)}.safety-hero,.concepts-panel,.work-stages-panel,.form-guide-panel,.waste-panel,.procedures-panel,.electrical-magnitudes-panel{grid-column:1}.safety-hero{grid-template-columns:minmax(0,1fr)}.concept-flow,.electrical-magnitudes-grid{grid-template-columns:minmax(0,1fr)}.flow-arrow{transform:rotate(90deg)}.work-stages{grid-template-columns:repeat(2,minmax(0,1fr))}.waste-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-contacts{grid-template-columns:repeat(2,minmax(0,1fr))}}
  @media(max-width:520px){
    #view-seguridad.active{width:100%;grid-template-columns:minmax(0,1fr)!important;gap:12px}
    #view-seguridad>*{grid-column:1!important;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
    #view-seguridad .safety-hero,#view-seguridad .safety-section{padding:13px}
    #view-seguridad .hazard-grid,#view-seguridad .work-stages,#view-seguridad .form-guide,#view-seguridad .waste-grid,#view-seguridad .procedure-filters,#view-seguridad .procedure-list,#view-seguridad .resource-grid{grid-template-columns:minmax(0,1fr)}
    #view-seguridad .procedure-heading,#view-seguridad .procedure-card-top{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
    #view-seguridad .procedure-count{justify-self:start}
    #view-seguridad .procedure-list{max-height:none;overflow:visible;padding-right:0}
    #view-seguridad .procedure-area{max-width:100%;white-space:normal}
    #view-seguridad .procedure-code,#view-seguridad .procedure-area,#view-seguridad .procedure-card h3,#view-seguridad .procedure-card p,#view-seguridad .procedure-link,#view-seguridad .safety-intro{overflow-wrap:anywhere;word-break:normal}
    #view-seguridad select,#view-seguridad input{max-width:100%;min-width:0;box-sizing:border-box}
    #view-seguridad .formula-box .f{font-size:17px;overflow-wrap:anywhere}
    #view-seguridad .electrical-magnitude{grid-template-columns:46px minmax(0,1fr);gap:9px;padding:11px}
    #view-seguridad .magnitude-symbol{width:44px;height:44px;font-size:22px}
    #view-seguridad .magnitude-content dl{grid-template-columns:minmax(0,1fr)}
    #view-seguridad .ppe-list{display:grid;grid-template-columns:minmax(0,1fr)}
    #view-seguridad .ppe-list span{border-radius:7px}
    #view-seguridad .emergency-steps li{padding-inline:4px}
  }
  .formula-box{
    background:var(--panel-2);border:1px solid var(--line);border-radius:8px;
    padding:14px;text-align:center;margin:10px 0;
  }
  .formula-box .f{font-family:'IBM Plex Mono',monospace;font-size:20px;color:var(--teal);letter-spacing:.03em;}
  .formula-box .f-note{font-size:11px;color:var(--muted);margin-top:4px;}
  .var-list{font-size:12.5px;color:var(--text);line-height:1.9;}
  .var-list b{color:var(--copper);font-family:'IBM Plex Mono',monospace;}
  /* ---- Buscador de suministros ---- */
  #view-suministros .consulta-types,#view-postes .consulta-types,#view-estructuras .consulta-types{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px;}
  #view-suministros .consulta-type,#view-postes .consulta-type,#view-estructuras .consulta-type{background:var(--panel-2);border:1px solid var(--line);color:var(--muted);padding:9px 8px;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;text-align:center;}
  #view-suministros .consulta-type:hover,#view-postes .consulta-type:hover,#view-estructuras .consulta-type:hover{border-color:var(--copper-dim);color:var(--text);}
  #view-suministros .consulta-type.active,#view-postes .consulta-type.active,#view-estructuras .consulta-type.active{background:rgba(232,147,90,.13);border-color:var(--copper);color:var(--copper);}
  #consulta-status{min-height:18px;margin-top:10px;font-size:12px;line-height:1.4;}
  #consulta-status.loading{color:var(--copper);} #consulta-status.error{color:var(--warn);} #consulta-status.ok{color:var(--ok);}
  #consulta-result{display:none;} #consulta-result.show{display:block;}
  .consulta-fields{border:1px solid var(--line);border-radius:8px;overflow:hidden;max-height:345px;overflow-y:auto;}
  .consulta-field{display:flex;justify-content:space-between;gap:12px;padding:8px 10px;border-bottom:1px solid var(--line);font-family:'IBM Plex Mono',monospace;font-size:11.5px;}
  .consulta-field:last-child{border-bottom:0;}.consulta-field:nth-child(odd){background:var(--panel-2);}.consulta-field b{color:var(--muted);font-weight:500;}.consulta-field span{text-align:right;overflow-wrap:anywhere;}
.safety-intro{color:var(--muted);font-size:13px;line-height:1.55;margin:0 0 14px}.resource-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.resource-card{display:flex;flex-direction:column;gap:6px;min-height:110px;padding:13px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2);color:var(--text);text-decoration:none}.resource-card:hover{border-color:var(--accent)}.resource-card span,.resource-card em{font-size:12px;color:var(--muted);font-style:normal}.resource-card em{color:var(--accent);margin-top:auto;font-weight:700}@media(max-width:640px){.resource-grid{grid-template-columns:1fr}}

#view-utilitarios.active{grid-template-columns:minmax(0,1fr);gap:14px}
#view-utilitarios>*{grid-column:1;min-width:0}
.technical-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:linear-gradient(135deg,var(--panel),color-mix(in srgb,var(--accent) 9%,var(--panel)))}
.technical-hero h2{margin:8px 0!important;color:var(--text)!important;font-size:20px!important;text-transform:none!important;letter-spacing:0!important}
.technical-hero p{max-width:800px;margin:0;color:var(--muted);font-size:13px;line-height:1.6}
.technical-source-link{flex:none;width:auto!important;min-width:190px;margin:0!important;text-align:center;text-decoration:none}
.technical-library{min-width:0}
.technical-breaker-tool{display:grid;gap:16px;min-width:0;border-color:color-mix(in srgb,var(--line) 82%,var(--accent));background:var(--panel)}
.technical-breaker-heading{align-items:flex-start}.technical-breaker-heading h2{margin:8px 0 4px;font-size:18px}.technical-breaker-heading .safety-intro{max-width:820px;margin:0}
.technical-section-label{display:flex;align-items:center;gap:8px;color:var(--muted);font:700 10px 'IBM Plex Mono',monospace;letter-spacing:.07em}.technical-section-label::before{content:'';width:4px;height:17px;border-radius:3px;background:var(--accent)}
.technical-official-badge{flex:none;padding:7px 10px;border:1px solid color-mix(in srgb,var(--teal) 50%,var(--line));border-radius:999px;background:color-mix(in srgb,var(--teal) 8%,var(--panel));color:var(--teal);font:700 10px 'IBM Plex Mono',monospace;text-decoration:none;white-space:nowrap}.technical-official-badge:hover{background:color-mix(in srgb,var(--teal) 14%,var(--panel))}
.technical-breaker-layout{display:grid;grid-template-columns:minmax(300px,.62fr) minmax(0,1.55fr);gap:12px}
.technical-breaker-controls,.technical-breaker-result{min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--panel-2)}
.technical-breaker-controls{display:grid;align-content:start;gap:13px;margin:0;padding:15px}.technical-breaker-controls label,.technical-breaker-controls legend{display:grid;gap:7px;color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.technical-breaker-controls fieldset{min-width:0;margin:0;padding:0;border:0}.technical-breaker-controls fieldset legend{margin-bottom:7px}
.technical-readonly-control,.technical-breaker-controls select{display:flex;align-items:center;width:100%;min-height:43px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--bg) 55%,var(--panel-2));color:var(--text);font:700 13px 'IBM Plex Sans',sans-serif}.technical-breaker-controls select{cursor:pointer}
.technical-breaker-types{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;border:1px solid var(--line);border-radius:9px;background:color-mix(in srgb,var(--bg) 55%,var(--panel-2))}.technical-breaker-types button{min-height:36px;padding:7px 10px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted);font:700 12px 'IBM Plex Sans',sans-serif;cursor:pointer}.technical-breaker-types button.active{border-color:color-mix(in srgb,var(--accent) 58%,var(--line));background:color-mix(in srgb,var(--accent) 13%,var(--panel));color:var(--accent)}.technical-breaker-types button:focus-visible,.technical-breaker-controls select:focus-visible,.technical-official-badge:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.technical-breaker-no-estimate{margin:0;padding:10px 11px;border-left:3px solid var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--panel));color:var(--muted);font-size:11px;line-height:1.5}.technical-breaker-no-estimate b{color:var(--text)}
.technical-breaker-result{display:grid;grid-template-columns:minmax(170px,.48fr) minmax(0,1.52fr);overflow:hidden}
.technical-breaker-rating{display:grid;place-items:center;align-content:center;gap:7px;min-height:255px;padding:18px;border-right:1px solid var(--line);background:radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 60%),color-mix(in srgb,var(--bg) 48%,var(--panel))}.technical-breaker-rating>span{color:var(--muted);font:700 9px 'IBM Plex Mono',monospace;letter-spacing:.08em}.technical-breaker-rating>strong{color:var(--text);font:800 52px/1 'IBM Plex Sans',sans-serif}.technical-breaker-rating>strong small{color:var(--accent);font-size:21px}.technical-breaker-rating>em{padding:6px 9px;border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:999px;background:color-mix(in srgb,var(--accent) 10%,var(--panel));color:var(--accent);font:700 10px 'IBM Plex Sans',sans-serif;font-style:normal;white-space:nowrap}
.technical-breaker-result-copy{display:grid;align-content:center;gap:12px;padding:19px}.technical-breaker-result-copy h3{margin:0 0 4px;font-size:17px;line-height:1.25}.technical-breaker-result-copy>div>p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.technical-breaker-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0}.technical-breaker-facts>div{min-width:0;padding:10px;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--bg) 52%,var(--panel-2))}.technical-breaker-facts dt{margin-bottom:5px;color:var(--muted);font:700 8px 'IBM Plex Mono',monospace;letter-spacing:.08em;text-transform:uppercase}.technical-breaker-facts dd{margin:0;color:var(--text);font-size:12px;font-weight:700;overflow-wrap:anywhere}
.technical-breaker-location{display:flex;align-items:center;gap:10px;margin:0;padding:10px 11px;border:1px solid color-mix(in srgb,var(--teal) 40%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--teal) 7%,var(--panel));color:var(--muted);font-size:11px;line-height:1.45}.technical-breaker-location b{color:var(--teal)}.technical-breaker-location strong{color:var(--text)}.technical-breaker-icon{position:relative;width:25px;height:34px;flex:none;border:2px solid var(--teal);border-radius:4px}.technical-breaker-icon::before{content:'';position:absolute;left:6px;right:6px;top:6px;height:9px;border-radius:2px;background:var(--teal)}.technical-breaker-icon::after{content:'';position:absolute;left:6px;right:6px;bottom:6px;height:2px;background:var(--teal);box-shadow:0 -5px 0 var(--teal)}
.technical-breaker-reference{display:grid;gap:10px}.technical-breaker-reference-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.technical-breaker-reference-head h3{margin:0;font-size:14px}.technical-breaker-reference-head span{color:var(--muted);font:700 9px 'IBM Plex Mono',monospace;letter-spacing:.05em}.technical-breaker-table-wrap{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:9px}.technical-breaker-table{width:100%;border-collapse:collapse;font-size:11.5px}.technical-breaker-table th{padding:9px 11px;background:color-mix(in srgb,var(--bg) 55%,var(--panel));color:var(--muted);font:700 8px 'IBM Plex Mono',monospace;letter-spacing:.07em;text-align:left;text-transform:uppercase}.technical-breaker-table td{padding:10px 11px;border-top:1px solid var(--line);color:var(--text)}.technical-breaker-table tbody tr:nth-child(even){background:color-mix(in srgb,var(--panel-2) 72%,var(--panel))}.technical-breaker-table tbody tr.selected{background:color-mix(in srgb,var(--accent) 9%,var(--panel))}.technical-breaker-table td b{display:inline-flex;padding:4px 7px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:999px;background:color-mix(in srgb,var(--accent) 9%,var(--panel));color:var(--accent);font-size:10px}
.technical-breaker-warning{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;margin:0;padding:10px 11px;border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--accent) 6%,var(--panel));font-size:10.5px;line-height:1.5}.technical-breaker-warning b{color:var(--accent)}.technical-breaker-warning span{color:var(--muted)}
.technical-document-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.technical-document-card{display:flex;min-width:0;flex-direction:column;gap:8px;padding:13px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}
.technical-document-card:hover{border-color:var(--accent)}
.technical-document-card .technical-category{align-self:flex-start;padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,var(--panel));color:var(--accent);font:700 10px 'IBM Plex Mono',monospace}
.technical-document-card h3{margin:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.technical-document-card small{color:var(--muted);font-size:11px}
.technical-document-card a{align-self:flex-start;margin-top:auto;color:var(--accent);font-size:12px;font-weight:700;text-decoration:none}
.technical-document-card a:hover{text-decoration:underline}
.technical-examples-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.technical-example-card{display:flex;min-width:0;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}
.technical-example-card>span{color:var(--accent);font:700 10px 'IBM Plex Mono',monospace;letter-spacing:.05em}
.technical-example-card h3{margin:0;font-size:14px}.technical-example-card p{margin:0;color:var(--text);font-size:12.5px;line-height:1.55}
.technical-example-card small{color:var(--muted);font-size:11px;line-height:1.45}.technical-example-card .magnitude-formula{margin-top:auto}
.technical-example-card .example-line{margin:2px 0 0}.technical-example-card.safety-example{border-color:color-mix(in srgb,var(--accent) 42%,var(--line))}
.law-examples-heading{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.law-examples-heading h3{margin:0 0 6px;color:var(--text);font-size:15px}.law-examples-heading .safety-intro{margin-bottom:10px}
.law-examples-grid .technical-example-card{border-left:3px solid var(--accent)}
.technical-reference-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.technical-reference-card{display:flex;min-width:0;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}
.technical-reference-card>span{display:flex;align-items:center;gap:9px;color:var(--accent);font:700 10px 'IBM Plex Mono',monospace;letter-spacing:.05em}.technical-reference-card>span::before{content:'';width:10px;height:10px;flex:none;border:2px solid var(--accent);border-radius:50%;background:color-mix(in srgb,var(--accent) 16%,var(--panel));box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 10%,transparent)}.technical-reference-card h3{margin:0;font-size:14px}
.technical-reference-card ul,.technical-reference-card ol{display:grid;gap:6px;margin:0;padding-left:19px;color:var(--text);font-size:12px;line-height:1.5}.technical-reference-card .magnitude-formula{margin-top:auto}
.reference-example{display:grid;gap:4px;margin-top:auto;padding:10px 11px;border-left:3px solid var(--accent);border-radius:7px;background:color-mix(in srgb,var(--accent) 8%,var(--panel));font-size:11.5px;line-height:1.5}.reference-example b{color:var(--accent);font-size:10px;letter-spacing:.05em;text-transform:uppercase}.reference-example span{color:var(--text)}.reference-example small{color:var(--muted)}.reference-symbol-line span{font:700 13px 'IBM Plex Mono',monospace;overflow-wrap:anywhere}
#view-utilitarios .electrical-magnitudes-panel{grid-column:1}
@media(max-width:1000px){.technical-document-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){
  #view-utilitarios.active{width:100%;gap:12px}
  #view-utilitarios>*{width:100%;max-width:100%;box-sizing:border-box}
  .technical-hero{display:grid;padding:13px}
  .technical-source-link{width:100%!important;min-width:0}
  .technical-breaker-tool{padding:13px}.technical-breaker-heading{display:grid;gap:9px}.technical-official-badge{justify-self:start;max-width:100%;white-space:normal;line-height:1.35}.technical-breaker-layout{grid-template-columns:minmax(0,1fr)}.technical-breaker-result{grid-template-columns:minmax(0,1fr)}.technical-breaker-rating{min-height:185px;border-right:0;border-bottom:1px solid var(--line)}.technical-breaker-result-copy{padding:14px}.technical-breaker-facts{grid-template-columns:minmax(0,1fr)}.technical-breaker-reference-head{display:grid;gap:5px}.technical-breaker-table-wrap{overflow:visible;border:0}.technical-breaker-table,.technical-breaker-table tbody{display:grid;gap:8px}.technical-breaker-table thead{display:none}.technical-breaker-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel-2)!important}.technical-breaker-table td{display:grid;gap:4px;min-width:0;padding:9px 10px;border-top:0;border-bottom:1px solid var(--line)}.technical-breaker-table td:nth-child(odd){border-right:1px solid var(--line)}.technical-breaker-table td:nth-last-child(-n+2){border-bottom:0}.technical-breaker-table td::before{content:attr(data-label);color:var(--muted);font:700 8px 'IBM Plex Mono',monospace;letter-spacing:.06em;text-transform:uppercase}.technical-breaker-table tr.selected{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent)}.technical-breaker-warning{grid-template-columns:minmax(0,1fr)}
  .technical-document-list,#view-utilitarios .procedure-filters,#view-utilitarios .electrical-magnitudes-grid,#view-utilitarios .resource-grid,.technical-examples-grid,.technical-reference-grid{grid-template-columns:minmax(0,1fr)}
  #view-utilitarios .electrical-magnitude{grid-template-columns:46px minmax(0,1fr);gap:9px;padding:11px}
  #view-utilitarios .magnitude-symbol{width:44px;height:44px;font-size:22px}
  #view-utilitarios .magnitude-content dl{grid-template-columns:minmax(0,1fr)}
}

.public-announcement[hidden]{display:none!important}.public-announcement{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;margin:10px 8px;padding:14px 16px;border:1px solid #b8ddc7;border-left:5px solid #1b8b4b;border-radius:12px;background:#f1fbf5;color:#17372a;box-shadow:0 3px 12px rgba(20,80,50,.07)}.public-announcement-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#d9f3e3;font-size:21px}.public-announcement-copy{min-width:0}.public-announcement-copy span{display:block;color:#1b7b46;font-size:.68rem;font-weight:900;letter-spacing:.12em}.public-announcement-copy strong{display:block;margin:2px 0 3px;font-size:1rem}.public-announcement-copy p{margin:0;color:#405b4c;line-height:1.35}.public-announcement-button{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 14px;border-radius:9px;background:#168b47;color:#fff!important;font-weight:800;text-decoration:none;white-space:nowrap}.public-announcement-button:hover{background:#11753b}@media(max-width:640px){.public-announcement{grid-template-columns:auto 1fr;margin:8px;padding:12px}.public-announcement-button{grid-column:1/-1;width:100%}}
.public-announcement-button[hidden]{display:none!important}.public-announcement-copy small{display:block;margin:0 0 4px;color:#60778a;font-weight:800}.public-announcement[data-priority="important"]{border-color:#e4bd75;border-left-color:#d47a0c;background:#fff8e7;color:#553a13}.public-announcement[data-priority="important"] .public-announcement-icon{background:#f9e7bf}.public-announcement[data-priority="important"] .public-announcement-copy span{color:#a65c00}.public-announcement[data-priority="urgent"]{border-color:#e5a7a2;border-left-color:#ba2b25;background:#fff0ee;color:#6f211c}.public-announcement[data-priority="urgent"] .public-announcement-icon{background:#f7d8d5}.public-announcement[data-priority="urgent"] .public-announcement-copy span{color:#a52d26}.public-announcement[data-priority="urgent"] .public-announcement-button{background:#ba2b25}
.maintenance-notice[hidden]{display:none!important}.maintenance-notice{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:13px;margin:10px 8px;padding:13px 16px;border:1px solid #e4bd75;border-left:5px solid #d47a0c;border-radius:12px;background:#fff8e7;color:#553a13;box-shadow:0 3px 12px rgba(130,80,10,.08)}.maintenance-notice-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#f9e7bf;font-size:21px}.maintenance-notice-copy{min-width:0}.maintenance-notice-copy span{display:block;color:#a65c00;font-size:.68rem;font-weight:900;letter-spacing:.12em}.maintenance-notice-copy strong{display:block;margin:2px 0 3px;font-size:1rem}.maintenance-notice-copy p{margin:0;color:#6c5738;line-height:1.4}@media(max-width:640px){.maintenance-notice{margin:8px;padding:12px}}
.maintenance-lock[hidden]{display:none!important}.maintenance-lock{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;min-height:100dvh;padding:20px;background:linear-gradient(145deg,#eef3f7,#f9fbfc);color:#173247}.maintenance-lock-card{width:min(560px,100%);padding:clamp(28px,6vw,52px);border:1px solid #cad8e2;border-top:6px solid #d47a0c;border-radius:20px;background:#fff;text-align:center;box-shadow:0 24px 70px rgba(16,42,61,.18)}.maintenance-lock-icon{display:grid;place-items:center;width:72px;height:72px;margin:0 auto 16px;border-radius:50%;background:#fff1d2;font-size:34px}.maintenance-lock-card>span{color:#c06c05;font-size:.72rem;font-weight:900;letter-spacing:.2em}.maintenance-lock-card h1{margin:10px 0 12px;font-size:clamp(1.6rem,5vw,2.35rem);line-height:1.12}.maintenance-lock-card p{margin:0 auto 18px;max-width:46ch;color:#566c7b;font-size:clamp(1rem,2.7vw,1.15rem);line-height:1.55}.maintenance-lock-card small{color:#78909f;font-weight:700}html.maintenance-locked,html.maintenance-locked body{overflow:hidden!important}

/* Estado de conexión compacto: solo se expande cuando requiere atención. */
.connection-status {
  --connection-color: var(--ok);
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}
.connection-status-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--connection-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--connection-color) 16%, transparent);
}
.connection-status-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.connection-status-copy b { font-size: 12px; white-space: nowrap; }
.connection-status-copy span { display: none; color: var(--muted); font-size: 11px; line-height: 1.35; }
.connection-status button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.connection-status button[hidden] { display: none; }
.connection-status[data-state="offline"] { --connection-color: var(--warn); }
.connection-status[data-state="saved"] { --connection-color: var(--teal); }
.connection-status[data-state="pending"] { --connection-color: var(--accent); }
.connection-status[data-state="online"] { display: none; }
.connection-status:not([data-state="online"]) {
  border-color: color-mix(in srgb, var(--connection-color) 48%, var(--line));
  background: color-mix(in srgb, var(--connection-color) 8%, var(--panel));
}
.connection-status:not([data-state="online"]) .connection-status-copy span { display: block; }
.connection-status-classic { align-self: flex-end; }
.connection-status-lite {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px auto;
  padding: 7px 10px;
  border-radius: 999px;
}
.connection-status-lite:not([data-state="online"]) {
  width: 100%;
  border-radius: 11px;
}

@media (max-width: 860px) {
  header.top > .connection-status-classic {
    order: 5;
    width: 100%;
    align-self: stretch;
  }
  .connection-status:not([data-state="online"]) button { margin-left: auto; }
}
/* Resultados múltiples y proximidad de suministros */
.consulta-results-list{display:grid;gap:7px;margin:8px 0}.consulta-result-item{display:grid;grid-template-columns:1fr auto;gap:2px;text-align:left;padding:10px;border:1px solid var(--line);border-radius:7px;background:var(--panel-2);color:var(--text);cursor:pointer}.consulta-result-item:hover{border-color:var(--accent)}.consulta-result-item span{font-size:12px;color:var(--muted)}.consulta-result-item small{grid-column:2;grid-row:1/3;align-self:center;color:var(--accent);font-weight:700}.consulta-near-panel{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}.consulta-near-panel h3{margin:0 0 10px;font-size:13px;color:var(--text)}.consulta-near-panel .btn{margin-top:10px}
.supply-location-conflict{padding:16px;border:1px solid #e19a58;border-radius:12px;background:color-mix(in srgb,var(--panel) 92%,#fff3e7);box-shadow:0 8px 24px rgba(77,47,22,.08)}
.supply-location-conflict h3{margin:0 0 6px;font-size:18px;color:var(--text)}
.supply-location-conflict>p{margin:0 0 14px;color:var(--muted);line-height:1.45}
.supply-location-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.supply-location-choice{display:grid;gap:5px;width:100%;padding:14px;text-align:left;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);cursor:pointer}
.supply-location-choice:hover,.supply-location-choice:focus-visible{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 18%,transparent)}
.supply-location-choice strong{font-size:17px;color:var(--accent)}
.supply-location-choice span{font-size:13px}
.supply-location-choice small{font-size:11px;color:var(--muted)}
@media(max-width:640px){.supply-location-choices{grid-template-columns:1fr}.supply-location-conflict{padding:13px}.supply-location-choice{min-height:92px}}
.consulta-pin{background:transparent!important;border:0!important}.consulta-pin span{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;font-size:19px;box-shadow:0 2px 8px rgba(0,0,0,.45);border:2px solid #fff}.consulta-pin-supply span{background:#ffd166}.consulta-pin-sed span{background:#39c38a;color:#08291d}

.consulta-pin-poste span{background:#ffd166}.table-scroll table{min-width:0}.table-scroll th,.table-scroll td{padding:8px 7px}

.panel h2::before{content:'';display:inline-block;width:4px;height:.85em;margin-right:8px;border-radius:2px;background:var(--accent)}
.content-review,.content-sources{margin:8px 0 0;color:var(--muted);font-size:11.5px;line-height:1.55}.content-sources a{color:var(--accent);font-weight:700;text-decoration:none}.content-sources a:hover{text-decoration:underline}

/* Postes: mapa principal con selección progresiva tipo AppSheet. */
#view-postes .poste-map-stage{position:relative;margin:10px 0 14px}
#view-postes #map-postes{height:520px;min-height:360px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel-2)}
.poste-map-legend{position:absolute;z-index:500;left:12px;bottom:40px;display:flex;gap:12px;align-items:center;padding:8px 11px;border:1px solid rgba(15,20,23,.12);border-radius:10px;background:rgba(255,255,255,.92);box-shadow:0 5px 18px rgba(15,20,23,.13);color:#26323a;font-size:12px;font-weight:700;backdrop-filter:blur(5px)}
.poste-map-legend span{display:flex;align-items:center;gap:6px;white-space:nowrap}
.poste-legend-dot{width:12px;height:12px;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px rgba(15,20,23,.18)}
.poste-legend-main{background:#16a34a}
.poste-legend-near{background:#ec168c}
.poste-map-help{margin:8px 2px 0;text-align:center}
.poste-map-popup{min-width:150px;line-height:1.5}
.poste-map-popup b{color:#d65f12}
.poste-location-actions{display:grid;grid-template-columns:repeat(2,max-content);gap:5px;align-items:center}.poste-location-actions .maplink{margin:0;padding:5px 7px;font-size:10px}
.poste-selected-action{display:none}.poste-selected-action:not(.hidden){display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--copper);border-radius:9px;background:var(--panel);box-shadow:0 4px 14px rgba(0,0,0,.16)}.poste-selected-copy{display:grid;gap:3px;min-width:0}.poste-selected-copy b{color:var(--text);font:700 12px 'IBM Plex Mono',monospace}.poste-selected-copy span{overflow:hidden;color:var(--muted);font-size:11px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.poste-selected-copy .poste-selected-kicker{color:var(--text);font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.poste-selected-action .maplink{box-sizing:border-box;flex:none;min-width:118px;min-height:36px;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:7px 12px;border:1px solid var(--accent);border-radius:7px;background:transparent!important;color:var(--text)!important;text-indent:0!important;font:700 11px/1.2 'IBM Plex Sans',sans-serif!important;opacity:1!important;visibility:visible!important}
.poste-attendance-alert{display:grid;gap:3px;margin-top:7px;padding:9px 11px;border:1px solid #d97706;border-left-width:4px;border-radius:8px;background:color-mix(in srgb,#f59e0b 13%,var(--panel));white-space:normal}.poste-attendance-alert.hidden{display:none}.poste-selected-copy .poste-attendance-alert-label{color:#b45309;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:normal}.poste-selected-copy .poste-attendance-alert b{color:#92400e;font:800 12px/1.35 'IBM Plex Sans',sans-serif}.poste-selected-copy .poste-attendance-alert span:last-child{color:var(--text);font-size:12px;font-weight:700;white-space:normal}.poste-map-attendance-alert{margin-top:8px;padding:7px 8px;border:1px solid #d97706;border-radius:6px;background:#fffbeb;color:#92400e;font-weight:800;line-height:1.35}.lite-post-attendance-alert{grid-column:1/-1;display:grid;gap:3px;padding:9px 10px;border:1px solid #d97706;border-left-width:4px;border-radius:8px;background:color-mix(in srgb,#f59e0b 13%,var(--panel));color:var(--text)}.lite-post-attendance-alert .lite-post-attendance-label{color:#b45309;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.lite-post-attendance-alert b{color:#92400e;font-size:12px}.lite-post-attendance-alert span:last-child{font-size:12px;font-weight:700}
.poste-live-control{max-width:250px;padding:7px 10px;border:1px solid rgba(15,20,23,.16);border-radius:8px;background:rgba(255,255,255,.94);box-shadow:0 3px 12px rgba(15,20,23,.16);color:#26323a;font:700 10px/1.35 'IBM Plex Mono',monospace}.poste-live-control[data-state="loading"]{border-color:#d65f12;color:#b84c08}.poste-live-control[data-state="loading"]::after{content:'';display:block;width:100%;height:3px;margin-top:6px;border-radius:3px;background:linear-gradient(90deg,transparent,#d65f12,transparent);background-size:200% 100%;animation:live-progress 1.05s linear infinite}.poste-live-control[data-state="error"]{border-color:#b42318;color:#b42318}.poste-live-retry{display:block;width:100%;margin-top:6px;padding:5px 7px;border:1px solid currentColor;border-radius:6px;background:#fff;color:#b42318;font:700 10px 'IBM Plex Sans',sans-serif;cursor:pointer}@keyframes live-progress{to{background-position:-200% 0}}.poste-live-tooltip{padding:3px 5px!important;border:1px solid #ec168c!important;border-radius:5px!important;background:rgba(255,255,255,.94)!important;color:#172027!important;box-shadow:0 2px 7px rgba(0,0,0,.2)!important;font:700 9px/1.15 'IBM Plex Mono',monospace!important}.poste-live-tooltip::before{display:none!important}.poste-live-tooltip-main{border-color:#16a34a!important;color:#166534!important}
.map-complete-shell:not(.is-fullscreen) .poste-live-control{display:none}
@media(max-width:520px){.poste-selected-action:not(.hidden){align-items:stretch;flex-direction:column}.poste-selected-copy span{white-space:normal}.poste-selected-action .maplink{width:100%}.poste-location-actions{grid-template-columns:1fr}.poste-location-actions .maplink{justify-content:center;text-align:center}}
.poste-results-details{margin-top:10px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2);overflow:hidden}
.poste-results-details summary{padding:10px 13px;color:var(--muted);font-size:12px;font-weight:700;cursor:pointer;user-select:none}
.poste-results-details[open] summary{border-bottom:1px solid var(--line);color:var(--text)}
.poste-results-details .table-scroll{margin:0;border:0;border-radius:0}

@media (max-width:760px){
  #view-postes #map-postes{height:430px;min-height:430px;border-radius:10px}
  .poste-map-legend{left:8px;right:8px;bottom:38px;justify-content:center;gap:16px;padding:7px 9px;font-size:11px}
  #view-postes .results-panel>.table-scroll{margin-top:10px}
}

/* Selector agrupado de alimentadores */
#view-seds .sed-feeder-prefix-results {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}
#view-seds .sed-feeder-prefix-results.hidden { display: none; }
#view-seds .sed-feeder-prefix-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
#view-seds .sed-feeder-prefix-heading b {
  color: var(--text);
  font: 700 14px/1.3 'IBM Plex Sans', sans-serif;
}
#view-seds .sed-feeder-prefix-heading span {
  color: var(--muted);
  font: 500 11px/1.35 'IBM Plex Sans', sans-serif;
  text-align: right;
}
#view-seds .sed-feeder-prefix-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
#view-seds .sed-feeder-prefix-button.result-action-button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px !important;
  border-color: var(--accent) !important;
  border-radius: 10px !important;
  background: var(--panel-2) !important;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .06);
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
#view-seds .sed-feeder-prefix-button.result-action-button:hover,
#view-seds .sed-feeder-prefix-button.result-action-button:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
  transform: translateY(-1px);
}
#view-seds .sed-feeder-prefix-button b {
  color: var(--text);
  font: 700 13px/1.2 'IBM Plex Mono', monospace;
  letter-spacing: .01em;
}
#view-seds .sed-feeder-prefix-button span {
  flex: none;
  padding: 4px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
  color: var(--muted);
  font: 700 10px/1 'IBM Plex Mono', monospace;
  white-space: nowrap;
}
@media (max-width: 520px) {
  #view-seds .sed-feeder-prefix-results { padding: 12px; }
  #view-seds .sed-feeder-prefix-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  #view-seds .sed-feeder-prefix-heading span { text-align: left; }
  #view-seds .sed-feeder-prefix-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view-seds .sed-feeder-prefix-button.result-action-button { min-height: 48px; padding: 8px 9px !important; }
}
#view-gridexplorer h2::before{content:'⌁'}#map-gridexplorer{height:460px;margin-top:14px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.grid-search-panel{align-self:start;background:linear-gradient(145deg,var(--panel),color-mix(in srgb,var(--accent) 4%,var(--panel)))}.grid-intro{margin:-3px 0 15px;color:var(--muted);font-size:12px;line-height:1.5}.grid-actions{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:8px;margin-top:14px}.grid-actions .btn{margin:0}.grid-legend-title{margin-top:17px;padding-top:13px;border-top:1px solid var(--line);color:var(--muted);font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.grid-legend{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:10px;color:var(--muted);font-size:11px}.grid-legend span{display:flex;align-items:center;gap:7px;padding:7px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel-2)}.grid-dot{width:9px;height:9px;flex:none;border-radius:50%;background:#888;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 10%,transparent)}.grid-dot.poste{background:#3b82f6}.grid-dot.pmi{background:#8b5cf6}.grid-dot.pf{background:#06b6d4}.grid-dot.rc{background:#ef4444}.grid-dot.ps{background:#22c55e}#view-gridexplorer .maplink{color:#fff;font-weight:700;text-decoration:none;padding:7px 10px;box-shadow:0 2px 8px rgba(0,0,0,.22)}@media(max-width:520px){#map-gridexplorer{height:340px}.grid-actions{grid-template-columns:1fr}#view-gridexplorer .maplink{padding:8px 11px;font-size:12px}}
.grid-dot.sed{background:#f59e0b}

/* Reglas de oro: orden fijo y numeracion visible en cualquier pantalla. */
.gold-rules{display:grid;gap:10px;margin:0;padding:0;list-style:none}.gold-rule{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:start;padding:11px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}.gold-number{display:grid;place-items:center;width:30px;height:30px;border:2px solid #fff;border-radius:50%;background:#f2a65a;color:#101416;box-shadow:0 2px 8px rgba(0,0,0,.55);font:700 15px/1 'IBM Plex Mono',monospace}.gold-rule div{display:grid;gap:4px;min-width:0}.gold-rule b{color:var(--text);font-size:14px}.gold-rule span:not(.gold-number){color:var(--muted);font-size:13px;line-height:1.45}@media(max-width:480px){.gold-rule{grid-template-columns:30px minmax(0,1fr);gap:8px;padding:10px}.gold-number{width:28px;height:28px;font-size:14px}}


.hidden{display:none}
.centered-link{text-align:center;text-decoration:none}
.table-scroll-220{max-height:220px}
.table-scroll-200{max-height:200px}
.section-divider-label{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.compact-inline-button{width:auto;margin:0;padding:6px 12px;font-size:12px}
.compare-input{width:100%;background:var(--panel-2);border:1px solid var(--line);border-radius:6px;color:var(--text);padding:9px 10px;font-family:Consolas,'Courier New',monospace;font-size:13px;resize:vertical}
.status-warning{color:var(--warn)}
.subsection-heading{margin-top:6px!important}
.compare-matrix-box{overflow-x:auto;font-family:Consolas,'Courier New',monospace;font-size:11.5px}
.bin-blue{--bin:#1677d2}.bin-white{--bin:#f5f5f5;--bin-border:#98a3aa}.bin-yellow{--bin:#f2c94c}.bin-brown{--bin:#82502d}.bin-gray{--bin:#737b82}.bin-red{--bin:#d83232}.bin-black{--bin:#15191c}
.formula-hint{margin-top:12px}.formula-compact{padding:10px}.formula-small{font-size:16px}
:root{
  --bg:#f3f6f8;--panel:#ffffff;--panel-2:#eaf0f3;--line:#c7d3da;--text:#172229;--muted:#5f707a;
  --copper:#c85f1d;--accent:#d66c27;--copper-dim:#db9a70;--teal:#087c70;--warn:#bd342f;--ok:#247c3c;
}
html[data-theme="dark"]{
  --bg:#0f1417;--panel:#161d23;--panel-2:#1d262d;--line:#2b353d;--text:#e7ecef;--muted:#8a97a1;
  --copper:#e8935a;--accent:#f2a65a;--copper-dim:#8a5636;--teal:#57c7b8;--warn:#e2574c;--ok:#6fbf73;
}
.mobile-result-anchor{scroll-margin-top:12px}
.mobile-new-search{display:none}
@media(max-width:760px){
  .mobile-new-search{
    position:sticky;top:8px;z-index:520;display:flex;align-items:center;justify-content:center;
    width:100%;min-height:42px;margin:0 0 10px;padding:8px 12px;border:1px solid var(--accent);
    border-radius:8px;background:color-mix(in srgb,var(--panel) 94%,transparent);color:var(--text);
    box-shadow:0 4px 14px rgba(0,0,0,.18);backdrop-filter:blur(6px);
    font:700 12px/1.2 'IBM Plex Sans',sans-serif;cursor:pointer
  }
  .mobile-new-search::before{content:'↑';margin-right:7px;color:var(--accent);font-size:15px}
  #consulta-result,#consulta-adjacent-panel,#sed-near-panel,#poste-near-panel{scroll-margin-top:12px}
  #consulta-geoloc-status,#sed-geoloc-status,#poste-geoloc-status{min-height:32px;font-size:12px}
  .table-scroll-220{max-height:42vh}
}

#map-infrastructure{
  height:460px;
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}
.infrastructure-controls,.grid-layer-controls{align-self:start}
.grid-layer-controls{
  display:grid;
  gap:8px;
  margin-top:16px;
  padding-top:2px;
}
.grid-layer-controls label{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:8px 9px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--panel-2);
  color:var(--text);
  font-size:12px;
}
.grid-layer-controls input{width:auto;margin:0}
.result-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
}
.table-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:6px 10px;
  border:1px solid var(--accent);
  border-radius:6px;
  background:var(--accent);
  color:#fff;
  font:inherit;
  font-size:11px;
  font-weight:700;
  line-height:1.2;
  text-decoration:none;
  cursor:pointer;
}
.table-action+ .table-action{
  background:transparent;
  color:var(--accent);
}
.table-action:disabled,.table-action.is-disabled{
  opacity:.45;
  cursor:not-allowed;
}
@media(max-width:760px){
  #map-infrastructure{height:340px}
  .result-actions{min-width:125px}
  .table-action{width:100%}
}

/* Mapas en pantalla completa */
/* Espacio seguro para navegadores y WebView que dibujan bajo las barras del sistema. */
body{
  padding-top:env(safe-area-inset-top,0px);
  padding-right:env(safe-area-inset-right,0px);
  padding-left:env(safe-area-inset-left,0px);
}
.wa-float{bottom:max(16px,calc(env(safe-area-inset-bottom,0px) + 10px))}
.wa-label{bottom:max(31px,calc(env(safe-area-inset-bottom,0px) + 25px))}
.wa-close{bottom:max(61px,calc(env(safe-area-inset-bottom,0px) + 55px))}

.map-complete-shell{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.map-complete-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:7px 9px;border-bottom:1px solid var(--line);background:var(--panel)}
.map-complete-title{min-width:0;color:var(--text);font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-complete-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none}
.map-complete-location{box-sizing:border-box;min-height:36px;display:none;align-items:center;justify-content:center;padding:7px 12px;border:1px solid var(--accent);border-radius:7px;background:transparent;color:var(--text);text-decoration:none;font:700 11px/1.2 'IBM Plex Sans',sans-serif;white-space:nowrap}
.map-complete-location.hidden{display:none}
.map-complete-location:not(.hidden){display:inline-flex}
/* "Ruta" solo debe verse cuando hay un elemento seleccionado (se le quita
   .hidden por JS via __setMapSelectedLocation), y "Centrar mapa" solo
   cuando el mapa esta abierto a pantalla completa. Esto tiene que ganarle
   a la regla que unifica el tamano/forma de todos los botones (mas abajo),
   que por error los mostraba siempre. */
.map-complete-shell .map-complete-actions .map-complete-location.hidden{display:none!important}
.map-complete-shell:not(.is-fullscreen) .map-complete-actions .map-complete-center{display:none!important}
.map-complete-button{box-sizing:border-box;min-height:36px;padding:7px 12px;border:1px solid var(--accent);border-radius:7px;background:transparent;color:var(--text);font:700 11px/1.2 'IBM Plex Sans',sans-serif;cursor:pointer;white-space:nowrap}
.map-complete-locate{position:absolute;right:14px;bottom:16px;z-index:850;box-sizing:border-box;width:48px;height:48px;padding:0;border:1px solid rgba(0,0,0,.12);border-radius:50%;background:#fff;color:#4285f4;font:900 27px/1 Arial,sans-serif;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.3);display:grid;place-items:center}
.map-complete-locate:hover{background:#f4f7fb;color:#2f70d8}.map-complete-locate:disabled{opacity:.78;cursor:wait}
/* Mismo icono de "centrar en mi ubicacion" (circulo con cruz) que usa el
   mapa de Redes, para que todos los mapas se vean iguales. */
.map-complete-locate svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.map-complete-locate svg circle:last-child{fill:currentColor;stroke:none}
.map-complete-button:hover{background:color-mix(in srgb,var(--accent) 13%,transparent)}
.map-complete-center{box-sizing:border-box;width:auto!important;min-height:36px;margin:0!important;padding:7px 12px!important;border:1px solid var(--accent)!important;border-radius:7px!important;background:transparent!important;color:var(--text)!important;font:700 11px/1.2 'IBM Plex Sans',sans-serif!important;white-space:nowrap}
.map-complete-center:hover{border-color:var(--accent)!important}
.map-complete-shell>#map-seds,
.map-complete-shell>#map-postes,
.map-complete-shell>#map-estructuras,
.map-complete-shell>#map-compare,
.map-complete-shell>#map-suministros,
.map-complete-shell>#map-infrastructure,
.map-complete-shell>#map-gridexplorer{border:0;border-radius:0}

body.map-complete-open{overflow:hidden}
.map-complete-shell.is-fullscreen{position:fixed;inset:0;z-index:3000;display:grid;grid-template-rows:auto minmax(0,1fr);border:0;border-radius:0;background:var(--bg)}
.map-complete-shell.is-fullscreen>.map-complete-toolbar{padding:max(8px,env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) 8px max(10px,env(safe-area-inset-left,0px))}
.map-complete-shell.is-fullscreen>#map-seds,
.map-complete-shell.is-fullscreen>#map-postes,
.map-complete-shell.is-fullscreen>#map-estructuras,
.map-complete-shell.is-fullscreen>#map-compare,
.map-complete-shell.is-fullscreen>#map-suministros,
.map-complete-shell.is-fullscreen>#map-infrastructure,
.map-complete-shell.is-fullscreen>#map-gridexplorer{width:100%;height:100%!important;border:0;border-radius:0}

@media(max-width:520px){
  .map-complete-shell.is-fullscreen>.map-complete-toolbar{align-items:center;flex-direction:row}
  .map-complete-shell.is-fullscreen .map-complete-title{flex:1}
  .map-complete-shell.is-fullscreen .map-complete-actions{gap:6px;width:auto}
  .map-complete-shell.is-fullscreen .map-complete-location{padding:7px 9px}
  .map-complete-shell.is-fullscreen .map-complete-button{width:auto}
  .map-complete-shell.is-fullscreen .map-complete-locate{right:max(16px,env(safe-area-inset-right,0px));bottom:max(18px,env(safe-area-inset-bottom,0px))}

  /* Barra de acciones del mapa chico (sin pantalla completa): una sola
     grilla prolija de 2 columnas para Ruta/Centrar mapa/Leyenda/Capas/
     Abrir mapa. Si queda un boton impar al final, ocupa el ancho completo
     de su fila en vez de quedar flotando de un lado (asi se evita el
     desorden que se veia antes). Ver tambien el bloque @media(max-width:520px)
     mas abajo, que es el que efectivamente manda (viene despues en el
     archivo) y usa esta misma grilla. */
  .map-complete-toolbar{align-items:stretch;flex-direction:column}
}


/* Versión Lite */
:root {
  --lite-violet: #5746e9;
  --lite-violet-dark: #4032c7;
  --lite-ink: #1f2340;
  --lite-muted: #6f7387;
  --lite-line: #dfe3ef;
  --lite-surface: rgba(255, 255, 255, 0.96);
}

.mode-switcher {
  min-width: 120px;
  align-self: flex-end;
}

.mode-switcher label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-switcher select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: 600 12px/1.2 "IBM Plex Sans", sans-serif;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#lite-shell {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  background: #dde4ee;
  color: var(--lite-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

html[data-ui="classic"] #lite-shell {
  display: none !important;
}

html[data-ui="lite"] body {
  overflow: hidden;
  background: #dde4ee;
}

html[data-ui="lite"] .app,
html[data-ui="lite"] .wa-float,
html[data-ui="lite"] .wa-label,
html[data-ui="lite"] .wa-close {
  display: none !important;
}

#lite-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #dde4ee;
}

.lite-search-card {
  position: absolute;
  z-index: 500;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(720px, calc(100% - 30px));
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(112, 118, 150, 0.18);
  border-radius: 30px;
  background: var(--lite-surface);
  box-shadow: 0 12px 38px rgba(32, 38, 72, 0.24);
  backdrop-filter: blur(12px);
}

.lite-search-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 54px;
  gap: 6px;
  align-items: center;
  min-height: 70px;
  padding: 7px 9px 4px 12px;
}

.lite-icon-button,
.lite-search-button {
  display: grid;
  place-items: center;
  border: 0;
  color: var(--lite-violet);
  cursor: pointer;
}

.lite-icon-button {
  width: 44px;
  height: 44px;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

#lite-query {
  min-width: 0;
  height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--lite-line);
  outline: 0;
  background: transparent;
  color: var(--lite-ink);
  font-size: clamp(18px, 4vw, 25px);
  letter-spacing: 0.01em;
}

#lite-query::placeholder {
  color: #85899c;
}

.lite-search-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--lite-violet);
  color: #fff;
  box-shadow: 0 5px 15px rgba(87, 70, 233, 0.35);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.lite-search-button:active,
.lite-location-button:active {
  transform: scale(0.96);
}

.lite-search-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.lite-type-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 20px 15px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.lite-type-strip::-webkit-scrollbar {
  display: none;
}

.lite-type {
  flex: 0 0 auto;
  min-width: 102px;
  padding: 5px 15px;
  border: 1px solid #6f7182;
  border-radius: 999px;
  background: #f3f4f8;
  color: #404256;
  cursor: pointer;
  font: 600 14px/1 "IBM Plex Sans", sans-serif;
  white-space: nowrap;
  scroll-snap-align: center;
}

.lite-type.active {
  border-color: #dfd4ff;
  background: #e9e0ff;
  color: #33258f;
  box-shadow: inset 0 0 0 1px rgba(87, 70, 233, 0.05);
}

.lite-recent-searches{display:flex;gap:7px;overflow-x:auto;padding:0 20px 5px;scrollbar-width:none}.lite-recent-searches:empty{display:none}.lite-recent-searches button{flex:none;padding:6px 10px;border:1px solid #d9dbea;border-radius:999px;background:#fff;color:#51546a;font:600 11px 'IBM Plex Sans',sans-serif}.lite-more-types{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 20px 12px;padding:10px;border:1px solid var(--lite-line);border-radius:12px;background:#fff}.lite-more-types[hidden]{display:none}.lite-more-types .lite-type{width:100%;min-width:0;padding:10px 8px}.lite-grid-type-select{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;padding:0 20px 13px}.lite-grid-type-select[hidden]{display:none}.lite-grid-type-select label{font-size:12px;font-weight:700;color:var(--lite-muted)}.lite-grid-type-select select,#lite-layer-preset{width:100%;padding:9px;border:1px solid var(--lite-line);border-radius:9px;background:#fff;color:var(--lite-ink)}#lite-layer-advanced{margin-top:9px}#lite-layer-advanced summary{cursor:pointer;color:var(--lite-muted);font-size:12px}.lite-result-origin{display:inline-flex;width:max-content;padding:3px 7px;border-radius:999px;background:#eef1ff;color:#4338ca;font-size:10px;font-weight:800}.lite-ambiguity-warning{margin:0 0 10px;padding:9px 10px;border-left:4px solid #f59e0b;border-radius:6px;background:#fff7df;color:#713f12;font-size:12px;line-height:1.4}#lite-recenter-button{padding:7px 9px;border:1px solid #cfd2e6;border-radius:8px;background:#fff;color:#4338ca;font-size:11px;font-weight:700}
@media(max-width:640px){#lite-types{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));overflow:visible;gap:4px;padding-left:8px;padding-right:8px}#lite-types .lite-type{min-width:0;padding:6px 3px;font-size:11px}}

.lite-diagnostics-entry{border-color:#d9d1ff!important;background:#f4f1ff!important;color:#4328a8!important;font-weight:800!important}
.classic-diagnostics-button{display:none;min-height:42px;padding:9px 13px;border:1px solid #d9d1ff;border-radius:10px;background:#f4f1ff;color:#4328a8;font:800 13px "IBM Plex Sans",sans-serif;cursor:pointer;white-space:nowrap}
.diagnostics-panel{position:fixed;inset:0;z-index:3000;display:grid;place-items:center;padding:18px;background:rgba(17,20,42,.54);backdrop-filter:blur(7px)}
.diagnostics-panel[hidden]{display:none}
.diagnostics-card{width:min(100%,460px);max-height:min(94vh,880px);overflow:auto;border-radius:28px;background:#f7f8fc;box-shadow:0 28px 80px rgba(20,15,70,.35)}
.diagnostics-head{display:grid;grid-template-columns:42px 54px 1fr;align-items:center;gap:12px;padding:24px 22px;border-radius:28px 28px 22px 22px;background:linear-gradient(135deg,#4b22bd,#6524d5);color:#fff}
.diagnostics-head button{width:40px;height:40px;border:0;background:transparent;color:#fff;font-size:42px;line-height:1;cursor:pointer}
.diagnostics-bolt{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:rgba(255,255,255,.13);font-size:28px}
.diagnostics-head h2{margin:0;font:800 27px/1.05 "IBM Plex Sans",sans-serif}.diagnostics-head p{margin:5px 0 0;color:#d8ccff;font-size:14px}
.diagnostics-body{display:grid;gap:10px;padding:18px}
.diagnostics-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;padding:10px 14px;border:1px solid #e2e4ec;border-radius:15px;background:#fff;color:#101a3d;box-shadow:0 4px 13px rgba(23,30,66,.035)}
.diagnostics-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#f2efff;color:#5127bd;font-size:22px;font-weight:800}.diagnostics-row b{font-size:14px}.diagnostics-row strong{font-size:13px;text-align:right}
.diagnostics-state{padding:6px 9px;border-radius:999px;background:#edf7f0;color:#13823b}.diagnostics-state.warning{background:#fff5db;color:#9a6100}.diagnostics-state.error{background:#feecec;color:#b42318}
.diagnostics-state.neutral{background:#f0f1f5;color:#5d6172}
.diagnostics-clear{display:flex;align-items:center;justify-content:center;gap:9px;min-height:52px;margin-top:4px;border:2px solid #5628c7;border-radius:14px;background:#fff;color:#5628c7;font:800 15px "IBM Plex Sans",sans-serif;cursor:pointer}.diagnostics-clear:disabled{opacity:.55;cursor:wait}
.diagnostics-copy{display:flex;align-items:center;justify-content:center;gap:9px;min-height:50px;border:1px solid #cfc5f4;border-radius:14px;background:#f1edff;color:#4b28ad;font:800 14px "IBM Plex Sans",sans-serif;cursor:pointer}.diagnostics-copy:disabled{opacity:.65;cursor:wait}
.diagnostics-summary{display:flex;align-items:center;gap:12px;min-height:58px;padding:10px 14px;border:1px solid #a9dfb9;border-radius:14px;background:#effaf2;color:#0c8537}.diagnostics-summary>span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#10a342;color:#fff;font-size:20px}.diagnostics-summary.warning{border-color:#f0cd78;background:#fff8e7;color:#855400}.diagnostics-summary.warning>span{background:#d99300}.diagnostics-summary.error{border-color:#efaaa5;background:#fff0ef;color:#a6241c}.diagnostics-summary.error>span{background:#c9372c}
.diagnostics-details{padding:4px 5px;color:#63677a;font-size:12px}.diagnostics-details summary{cursor:pointer;font-weight:700}.diagnostics-details div{padding:9px 0;line-height:1.45}
@media(max-width:520px){.diagnostics-panel{padding:0;place-items:stretch}.diagnostics-card{width:100%;max-height:100vh;border-radius:0}.diagnostics-head{border-radius:0 0 22px 22px;padding-top:max(22px,env(safe-area-inset-top))}.diagnostics-body{padding-bottom:max(18px,env(safe-area-inset-bottom))}}

.lite-location-button {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
  z-index: 510;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--lite-violet);
  color: #fff;
  box-shadow: 0 10px 28px rgba(45, 35, 166, 0.34);
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
}

.lite-results {
  position: absolute;
  z-index: 520;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(700px, calc(100% - 92px));
  max-height: min(48vh, 430px);
  transform: translate(-50%, calc(100% + 40px));
  overflow: hidden;
  border: 1px solid rgba(112, 118, 150, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 15px 44px rgba(32, 38, 72, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.lite-results.open {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.lite-results-grip {
  width: 52px;
  height: 5px;
  margin: 9px auto 3px;
  border-radius: 999px;
  background: #d4d7e2;
}

.lite-results-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 18px 12px;
  border-bottom: 1px solid var(--lite-line);
}

.lite-results-head > div {
  display: grid;
  gap: 3px;
}

#lite-results-kicker {
  color: var(--lite-violet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#lite-results-title {
  color: var(--lite-ink);
  font-size: 15px;
  line-height: 1.35;
}

#lite-results-close,
#lite-menu-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #eef0f6;
  color: #3c4057;
  cursor: pointer;
  font-size: 22px;
}

.lite-results-list {
  display: grid;
  gap: 10px;
  max-height: calc(min(48vh, 430px) - 84px);
  overflow: auto;
  padding: 12px 14px 16px;
}

.lite-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--lite-line);
  border-radius: 15px;
  background: #f8f9fc;
}

.lite-result-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lite-result-copy b,
.lite-result-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lite-result-copy b {
  color: var(--lite-ink);
  font-size: 15px;
}

.lite-result-copy span {
  color: var(--lite-muted);
  font-size: 12px;
}

.lite-result-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.lite-result-actions button,
.lite-result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #d6d9e5;
  border-radius: 10px;
  background: #fff;
  color: var(--lite-violet-dark);
  cursor: pointer;
  font: 700 11px/1.1 "IBM Plex Sans", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.lite-result-actions button {
  border-color: var(--lite-violet);
  background: var(--lite-violet);
  color: #fff;
}

.lite-empty {
  padding: 22px 12px 26px;
  color: var(--lite-muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

.lite-drawer {
  position: absolute;
  z-index: 560;
  inset: 0 auto 0 0;
  width: min(360px, calc(100% - 54px));
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 18px 0 50px rgba(26, 30, 60, 0.25);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

.lite-drawer.open {
  transform: translateX(0);
}

.lite-drawer-backdrop {
  position: absolute;
  z-index: 550;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(24, 27, 48, 0.38);
}

.lite-drawer-backdrop.open {
  display: block;
}

.lite-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--lite-line);
}

.lite-drawer-head > div {
  display: grid;
  gap: 4px;
}

.lite-drawer-head span {
  color: var(--lite-muted);
  font-size: 12px;
}

.lite-drawer-head b {
  color: var(--lite-ink);
  font-size: 22px;
}

.lite-drawer-primary,
.lite-drawer-action,
.lite-open-classic {
  width: 100%;
  border-radius: 11px;
  cursor: pointer;
  font: 700 13px/1.2 "IBM Plex Sans", sans-serif;
}

.lite-drawer-primary {
  margin: 16px 0;
  padding: 12px 14px;
  border: 0;
  background: var(--lite-violet);
  color: #fff;
}

.lite-drawer-section {
  display: grid;
  gap: 9px;
  padding: 17px 0;
  border-top: 1px solid var(--lite-line);
}

.lite-drawer-section > b {
  margin-bottom: 3px;
  color: var(--lite-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lite-drawer-section label {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  color: #41455b;
  font-size: 13px;
}

.lite-drawer-section input {
  width: 17px;
  height: 17px;
  accent-color: var(--lite-violet);
}

.lite-drawer-action,
.lite-open-classic {
  padding: 10px 12px;
  border: 1px solid var(--lite-line);
  background: #f8f9fc;
  color: #42465c;
  text-align: left;
}

.lite-drawer-action {
  margin-top: 5px;
  border-color: var(--lite-violet);
  color: var(--lite-violet-dark);
  text-align: center;
}

.lite-toast {
  position: absolute;
  z-index: 540;
  left: 50%;
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 94px));
  max-width: calc(100% - 44px);
  transform: translate(-50%, 12px);
  padding: 10px 15px;
  border-radius: 12px;
  background: rgba(30, 34, 58, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.lite-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

html[data-ui="lite"] .leaflet-control-zoom {
  margin-top: 150px;
  border: 0 !important;
  box-shadow: 0 6px 22px rgba(37, 41, 70, 0.2);
}

html[data-ui="lite"] .leaflet-control-zoom a {
  color: var(--lite-violet-dark);
}

html[data-ui="lite"] .leaflet-popup-content-wrapper,
html[data-ui="lite"] .leaflet-popup-tip {
  background: #fff;
  color: var(--lite-ink);
}

.lite-map-label {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #2e3150 !important;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 2px #fff, 0 0 4px #fff;
}

@media (max-width: 640px) {
  .mode-switcher {
    width: 100%;
    min-width: 0;
  }

  .lite-search-card {
    top: max(10px, env(safe-area-inset-top));
    width: calc(100% - 22px);
    border-radius: 25px;
  }

  .lite-search-row {
    grid-template-columns: 42px minmax(0, 1fr) 50px;
    min-height: 62px;
    padding: 5px 7px 2px 10px;
  }

  .lite-icon-button {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }

  #lite-query {
    height: 48px;
    font-size: 20px;
  }

  .lite-search-button {
    width: 47px;
    height: 47px;
    font-size: 30px;
  }

  .lite-type-strip {
    gap: 8px;
    padding: 7px 14px 12px;
  }

  .lite-type {
    min-width: 0;
    padding: 5px 14px;
    font-size: 13px;
  }

  .lite-results {
    width: calc(100% - 28px);
    max-height: 46vh;
    bottom: max(13px, env(safe-area-inset-bottom));
    border-radius: 21px;
  }

  .lite-results-list {
    max-height: calc(46vh - 82px);
  }

  .lite-result-card {
    grid-template-columns: 1fr;
  }

  .lite-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lite-location-button {
    right: 17px;
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 32px;
  }

  html[data-ui="lite"] .leaflet-control-zoom {
    margin-top: 135px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lite-results,
  .lite-drawer,
  .lite-toast {
    transition: none;
  }
}

.lite-cluster-count {
  align-items: center;
  background: #4f46e5;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .3);
  color: #fff;
  display: flex;
  font: 700 12px/1 system-ui, sans-serif;
  justify-content: center;
}

/* Enlaces directos */
.result-action-button {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 36px;
  margin: 0 !important;
  padding: 7px 12px !important;
  border: 1px solid var(--accent) !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--text) !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
}

.result-action-button:hover,
.result-action-button:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)) !important;
  color: var(--text) !important;
}

.direct-link-button {
  cursor: pointer;
}

.direct-link-button.is-copied {
  border-color: #16845b;
  background: #16845b;
  color: #fff;
}

#poste-selected-action .direct-link-button {
  align-self: center;
}

#lite-results .direct-link-button {
  border: 1px solid #5b43e6;
  background: transparent;
  color: #3e2f9f;
  margin-right: 8px;
}

@media (max-width: 720px) {
  .result-action-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding-inline: 8px !important;
    font-size: 10.5px !important;
  }

  .result-meta.result-link-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .result-meta.result-link-actions > span {
    grid-column: 1 / -1;
  }

  #poste-selected-action.result-link-actions:not(.hidden) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
  }

  #poste-selected-action.result-link-actions .poste-selected-copy {
    grid-column: 1 / -1;
  }

  #lite-results .result-action-button {
    min-width: 0;
    min-height: 40px;
    border-color: var(--lite-violet) !important;
    background: var(--lite-violet) !important;
    color: #fff !important;
  }
}

@media (max-width: 340px) {
  #poste-selected-action.result-link-actions:not(.hidden) {
    grid-template-columns: 1fr;
  }

  .result-meta.result-link-actions {
    grid-template-columns: 1fr;
  }
}

/* Historial y favoritos */
.saved-searches-launch {
  align-self: flex-end;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: 700 11px/1.2 'IBM Plex Sans', sans-serif;
  white-space: nowrap;
}

.saved-searches-launch:hover { border-color: var(--accent); }
.saved-searches-launch.compact { width: 100%; margin: 8px 0 0; }
.saved-searches-overlay[hidden] { display: none; }
.saved-searches-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 15, 24, .68);
  backdrop-filter: blur(4px);
}

.saved-searches-panel {
  width: min(520px, 100%);
  max-height: min(680px, 88vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  color: var(--text);
}

.saved-searches-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.saved-searches-panel header span { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.saved-searches-panel h2 { margin: 3px 0 0; font-size: 18px; }
.saved-searches-panel header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 22px; }
.saved-searches-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px; }
.saved-searches-tabs button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 700; }
.saved-searches-tabs button.active { border-color: var(--accent); color: var(--accent); }
.saved-searches-list { min-height: 160px; overflow: auto; padding: 0 14px 14px; }
.saved-search-item { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; margin-top: 8px; }
.saved-search-item a { display: grid; gap: 3px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); text-decoration: none; font: 700 12px 'IBM Plex Mono', monospace; }
.saved-search-item a span { color: var(--muted); font: 500 11px 'IBM Plex Sans', sans-serif; }
.saved-search-item button { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 21px; }
.saved-search-item button.is-favorite, .favorite-result-button.is-favorite { color: #f59e0b !important; }
.saved-searches-empty { padding: 36px 16px; color: var(--muted); text-align: center; }
.saved-searches-panel footer { padding: 12px 14px; border-top: 1px solid var(--line); }
.saved-searches-panel footer button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.favorite-result-button { margin-left: 0 !important; }

@media (max-width: 720px) {
  #saved-searches-button { width: 100%; align-self: stretch; min-height: 44px; }
  .saved-searches-overlay { align-items: end; padding: 0; }
  .saved-searches-panel { width: 100%; max-height: 84vh; border-radius: 18px 18px 0 0; }
  .saved-searches-tabs button { min-height: 46px; }
  .saved-search-item a, .saved-search-item button { min-height: 48px; }
}

/* Acciones de navegación */
.navigation-choice[hidden] { display: none; }
.navigation-choice {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 15, 24, .68);
  backdrop-filter: blur(4px);
}
.navigation-choice section { width: min(430px, 100%); padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.navigation-choice header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.navigation-choice header span { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.navigation-choice h2 { margin: 3px 0 0; font-size: 20px; }
.navigation-choice header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 22px; }
.navigation-choice p { color: var(--muted); font-size: 13px; }
.navigation-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.navigation-choice-actions a { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 800; }
.navigation-choice-actions a[data-waze] { border-color: #2e94a6; background: #2e94a6; }
@media (max-width: 520px) {
  .navigation-choice { align-items: end; padding: 0; }
  .navigation-choice section { box-sizing: border-box; width: 100%; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .navigation-choice-actions { grid-template-columns: 1fr; }
  .navigation-choice-actions a { min-height: 54px; font-size: 15px; }
}

/* PWA móvil */
.pwa-install-button[hidden] { display: none !important; }
.pwa-install-offer[hidden] { display: none !important; }
.pwa-install-offer { display: none; }
.pwa-install-floating { display: none; }
.pwa-update-banner { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; z-index: 10050; display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; gap: 10px; align-items: center; width: min(720px, calc(100% - 32px)); margin: 0 auto; padding: 12px; border: 1px solid var(--accent); border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 14px 42px rgba(0,0,0,.35); }
.pwa-update-banner[hidden] { display: none !important; }
.pwa-update-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 15%, var(--panel-2)); color: var(--accent); font-size: 25px; font-weight: 900; }
.pwa-update-banner div { display: grid; gap: 3px; min-width: 0; }
.pwa-update-banner b { font-size: 14px; }
.pwa-update-banner div span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.pwa-update-apply,.pwa-update-later { min-height: 42px; padding: 8px 13px; border: 1px solid var(--accent); border-radius: 9px; font-weight: 800; cursor: pointer; }
.pwa-update-apply { background: var(--accent); color: #111; }
.pwa-update-later { background: transparent; color: var(--text); }
.pwa-update-apply:disabled { opacity: .65; cursor: wait; }
@media (max-width: 820px) and (pointer: coarse) {
  .pwa-install-offer { position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 8500; display: flex; align-items: center; gap: 6px; }
  .pwa-install-floating { display: block; min-height: 46px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 999px; background: var(--panel); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.24); font-weight: 800; }
  .pwa-install-dismiss { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.24); font-size: 24px; line-height: 1; cursor: pointer; }
  html[data-ui="lite"] .pwa-install-offer { display: none !important; }
  html.is-standalone { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: auto; -webkit-overflow-scrolling: touch; }
  html.is-standalone body:not(.map-complete-open):not(.redes-map-open) { height: auto; min-height: 100dvh; overflow-y: visible; overscroll-behavior-y: auto; touch-action: pan-y; }
  html.is-standalone body:not(.map-complete-open):not(.redes-map-open) .app { touch-action: pan-y; }
  /* La página conserva su desplazamiento fuera del mapa. Dentro del mapa,
     Leaflet recibe los dos dedos y el toque para zoom, arrastre y selección. */
  html.is-standalone .leaflet-container { touch-action: none !important; overscroll-behavior: contain; }
  html.is-standalone #lite-shell { min-height: 100dvh; }
  .pwa-update-banner { grid-template-columns: 38px minmax(0,1fr); bottom: calc(12px + env(safe-area-inset-bottom)); padding: 11px; }
  .pwa-update-icon { width: 38px; height: 38px; font-size: 22px; }
  .pwa-update-apply,.pwa-update-later { grid-column: 1 / -1; width: 100%; min-height: 44px; }
}

/* Herramientas de resultados */
.entity-selected-action {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
}

.entity-selected-action.hidden { display: none !important; }
.entity-selected-copy { min-width: 0; display: grid; gap: 3px; }
.entity-selected-copy b { overflow: hidden; font: 700 12px/1.25 'IBM Plex Mono', monospace; text-overflow: ellipsis; white-space: nowrap; }
.entity-selected-copy span { overflow: hidden; color: var(--muted); font: 500 11px/1.3 'IBM Plex Sans', sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.entity-selected-buttons { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 9px; }
.entity-selected-buttons .result-action-button { width: 100%; }
#consulta-maps-link.toolbar-replaced { display: none !important; }

@media (max-width: 720px) {
  .entity-selected-action {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-block: 8px 10px;
    padding: 10px;
  }

  .entity-selected-copy b,
  .entity-selected-copy span { white-space: normal; }
  .entity-selected-buttons { grid-auto-flow: unset; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entity-selected-buttons .result-action-button { min-width: 0; min-height: 42px; padding-inline: 5px !important; }
}

@media (max-width: 340px) {
  .entity-selected-buttons { grid-template-columns: 1fr; }
}

/* Ajustes visuales */
/* Ajustes visuales conservadores para la base estable 2.95. */
.stats,
.breaker .count { display: none !important; }
.mobile-settings-toggle { display: none; }
.mobile-more-tools-toggle { display: none; }

.section-nav .tabs { align-items: stretch; }
.history-nav-item {
  flex: 1 1 auto;
  min-width: 120px;
  min-height: 48px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.history-nav-item::before { content: '↶'; margin-right: 7px; color: var(--accent); font-size: 17px; }

/* En escritorio se conserva el orden histórico. En celular, el DOM mantiene
   Seguridad como sexto acceso principal y no recibe estas reglas. */
@media (min-width: 861px) {
  .mobile-primary-tabs [data-tab="seds"] { order: 1; }
  .mobile-primary-tabs [data-tab="suministros"] { order: 2; }
  .mobile-primary-tabs [data-tab="postes"] { order: 3; }
  .mobile-primary-tabs [data-tab="redes"] { order: 4; }
  .mobile-primary-tabs [data-tab="comparar"] { order: 5; }
  .mobile-secondary-tools [data-tab="gridexplorer"] { order: 6; }
  .mobile-secondary-tools [data-tab="estructuras"] { order: 7; }
  .mobile-secondary-tools .history-nav-item { order: 8; }
  .mobile-primary-tabs [data-tab="seguridad"] { order: 9; }
  .mobile-secondary-tools [data-tab="utilitarios"] { order: 10; }
  .mobile-secondary-tools [data-tab="transmision"] { order: 11; }
  .mobile-secondary-tools [data-tab="gas"] { order: 12; }
}

.map-complete-shell { border-color: color-mix(in srgb, var(--line) 70%, transparent); box-shadow: none; }
.map-complete-toolbar { min-height: 42px; padding: 5px 7px; background: var(--panel-2); }
.map-complete-title { color: var(--muted); font-size: 11px; }
.map-complete-actions { gap: 6px; }
.map-complete-button {
  width: auto;
  min-width: 92px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}
.map-complete-shell.is-fullscreen .map-complete-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
  border-color: var(--accent);
  background: var(--accent);
  color: #111;
  box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.map-complete-location { min-height: 34px; padding: 6px 10px; border-color: var(--line); border-radius: 999px; }
.map-complete-center { min-height: 34px !important; padding: 6px 10px !important; border-color: var(--line) !important; border-radius: 999px !important; }
.map-complete-locate { width: 46px; height: 46px; }
.map-complete-shell .leaflet-control-zoom { overflow: hidden; border: 0; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.saved-searches-tabs { grid-template-columns: repeat(3, 1fr); }
.saved-searches-overlay { place-items: stretch end; padding: 0; background: rgba(4,15,24,.5); }
.saved-searches-panel { width: min(440px, 100%); height: 100%; max-height: none; border-radius: 16px 0 0 16px; }
.saved-searches-list { flex: 1; }

#compare-copy-route,
#compare-share-route,
#compare-route-maps { width: 100%; box-sizing: border-box; }

#grid-status[data-state="loading"]::after {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: grid-loading-progress 1.1s linear infinite;
}
#grid-status[data-state="error"] { color: var(--warn); }
@keyframes grid-loading-progress { to { background-position: -200% 0; } }

.grid-equipment-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 14px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.grid-equipment-filters legend { padding: 0 6px; color: var(--text); font-size: 12px; font-weight: 800; }
.grid-equipment-filters label { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; margin: 0; padding: 6px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); cursor: pointer; }
.grid-equipment-filters input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.grid-equipment-filters span { min-width: 0; font-size: 12px; font-weight: 800; white-space: nowrap; }
.grid-equipment-filters label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--panel)); box-shadow: inset 0 0 0 1px var(--accent); }
.grid-equipment-filters label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 2px; }
.grid-type-summary:empty { display: none; }
.grid-type-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: -5px 0 12px; color: var(--muted); font: 700 10px 'IBM Plex Mono', monospace; }
.grid-type-summary span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); }
.grid-layer-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-layer-controls > .grid-legend-title,
.grid-layer-controls > button,
.grid-layer-controls > .hint { grid-column: 1 / -1; }
.grid-layer-controls label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); }

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mobile-map-selection { display: none; }
.map-complete-shell.is-fullscreen .mobile-map-selection {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 900;
  display: block;
  width: min(520px, calc(100% - 32px));
  margin-left: auto;
  padding: 8px 14px 12px;
  transform: translateY(calc(100% + 28px));
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 12px 35px rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
  backdrop-filter: blur(10px);
}
.map-complete-shell.is-fullscreen .mobile-map-selection.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-map-selection-toggle { display: grid; place-items: center; width: 100%; min-height: 20px; margin: -3px 0 2px; padding: 5px; border: 0; background: transparent; cursor: ns-resize; }
.mobile-map-selection-grip { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); }
.mobile-map-selection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-map-selection-head > div { display: grid; gap: 2px; min-width: 0; }
.mobile-map-selection-head span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.mobile-map-selection-head b { overflow-wrap: anywhere; font-size: 15px; }
.mobile-map-selection-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 2px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--text); font-size: 25px; line-height: 1; }
.mobile-map-selection-detail { margin: 5px 56px 0 0; color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.mobile-map-selection-detail[hidden] { display: none; }
.mobile-map-selection-actions { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.mobile-map-selection.is-expanded .mobile-map-selection-actions { display: grid; }
.mobile-map-selection-route,
.mobile-map-selection-copy { box-sizing: border-box; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 10px; border: 1px solid var(--accent); border-radius: 10px; background: transparent; color: var(--text); text-align: center; text-decoration: none; font: 700 12px/1.2 'IBM Plex Sans', sans-serif; }
.hint {
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-size: 12px;
  line-height: 1.5;
}

.compare-route-order { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.compare-route-order-heading { display: grid; gap: 3px; margin-bottom: 8px; }
.compare-route-order-heading span { color: var(--muted); font-size: 11px; }
.compare-route-order-list { display: grid; gap: 6px; }
.compare-route-order-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.compare-route-order-item > b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #171006; }
.compare-route-order-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 11px 'IBM Plex Mono',monospace; }
.compare-route-order-item > div { display: flex; gap: 5px; }
.compare-route-order-item button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; }
.compare-route-order-item button:disabled { opacity: .35; cursor: default; }

@media (max-width: 860px) {
  .brand .sub { display: block; font-size: 12px; line-height: 1.35; }
  header.top { align-items: stretch; gap: 10px; }
  .mobile-more-tools-toggle { display: block; flex: 1 1 100%; min-height: 44px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 800; cursor: pointer; }
  .section-nav:not(.show-mobile-secondary) .mobile-secondary-tool,
  .section-nav:not(.show-mobile-secondary) .mobile-settings-section { display: none; }
  .section-nav.is-collapsed .mobile-more-tools-toggle { display: none; }
  .section-nav.show-mobile-secondary .mobile-secondary-tool[data-tab="seguridad"] { flex: 1 1 100%; }
  .section-nav.show-mobile-secondary .mobile-secondary-tool[data-tab="transmision"] { flex: 1 1 calc(100% - 66px); }
  .mobile-settings-section {
    display: grid;
    gap: 8px;
    flex: 0 0 56px;
    align-self: stretch;
    width: 56px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .mobile-settings-toggle {
    display: grid;
    place-items: center;
    width: 56px;
    min-height: 44px;
    height: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
  .section-nav.is-collapsed .mobile-settings-section { display: none; }
  .mobile-settings-section.mobile-settings-open { flex: 1 1 100%; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
  .mobile-settings-section.mobile-settings-open .mobile-settings-toggle { grid-column: 1 / -1; width: 56px; min-height: 44px; justify-self: end; }
  .mobile-settings-section:not(.mobile-settings-open) .theme-switcher,
  .mobile-settings-section:not(.mobile-settings-open) .mode-switcher,
  .mobile-settings-section:not(.mobile-settings-open) .classic-diagnostics-button { display: none; }
  .mobile-settings-section.mobile-settings-open .theme-switcher,
  .mobile-settings-section.mobile-settings-open .mode-switcher {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
  }
  .mobile-settings-section.mobile-settings-open .classic-diagnostics-button{display:flex;align-items:center;justify-content:center;grid-column:1 / -1;width:100%;min-height:46px}

  :where(.btn, button, input, select, textarea, summary, .table-action, .maplink, .result-action-button) { min-height: 44px; }
  .result-meta { color: color-mix(in srgb, var(--text) 78%, var(--muted)); }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .grid-equipment-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 8px; }
  .grid-equipment-filters label { padding-inline: 2px; }
  .grid-equipment-filters span { font-size: 10.5px; }

  .map-complete-shell.is-fullscreen .mobile-map-selection {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 900;
    display: block;
    padding: 8px 14px 12px;
    transform: translateY(calc(100% + 24px));
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 18px;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 0 12px 35px rgba(0,0,0,.3);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
    backdrop-filter: blur(10px);
  }
  .mobile-map-selection.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .mobile-map-selection-grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line); }
  .mobile-map-selection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .mobile-map-selection-head > div { display: grid; gap: 2px; min-width: 0; }
  .mobile-map-selection-head span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .mobile-map-selection-head b { overflow-wrap: anywhere; font-size: 15px; }
  .map-complete-shell.has-mobile-selection .map-complete-locate { bottom: 104px; }
  .map-complete-shell.is-fullscreen .mobile-map-selection { right: max(10px, env(safe-area-inset-right, 0px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); }
  .history-nav-item { min-width: 110px; min-height: 44px; }
  .section-nav.is-collapsed .history-nav-item { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Navegación móvil por pills */
.mobile-primary-tabs,
.mobile-secondary-tools { display: contents; }

@media (max-width: 860px) {
  .section-nav-toggle { display: none !important; }
  .section-nav .tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    width: 100%;
  }
  .mobile-primary-tabs {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 2px 1px 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-primary-tabs::-webkit-scrollbar { display: none; }
  .mobile-primary-tabs::after {
    content: '';
    flex: 0 0 calc(50% - 52px);
  }
  .mobile-primary-tabs .breaker {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 44px;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--panel);
    scroll-snap-align: center;
    white-space: nowrap;
  }
  .mobile-primary-tabs .breaker.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--panel));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 48%, transparent);
  }
  .mobile-primary-tabs .breaker .switch,
  .mobile-secondary-tools .breaker .switch { display: none; }
  .mobile-primary-tabs .breaker::before,
  .mobile-secondary-tools .breaker::before {
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: var(--accent);
    font: 800 17px/1 'Segoe UI Symbol', sans-serif;
  }
  .mobile-primary-tabs [data-tab="seds"]::before { content: '⚡'; }
  .mobile-primary-tabs [data-tab="suministros"]::before { content: '🔌'; }
  .mobile-primary-tabs [data-tab="postes"]::before {
    content: '';
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 21V7c0-2.2 1.8-4 4-4h5v3M5 21h6M15 6h5l-1.2 4h-2.6z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.5 11.5h2' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 21V7c0-2.2 1.8-4 4-4h5v3M5 21h6M15 6h5l-1.2 4h-2.6z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.5 11.5h2' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .mobile-primary-tabs [data-tab="redes"]::before {
    content: '';
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='6' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='19' cy='4' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='19' cy='19' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M7.5 5.6 16.5 4.4M7 7.5l10 9.5M5 8.5v7M2.5 18h5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='6' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='19' cy='4' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='19' cy='19' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M7.5 5.6 16.5 4.4M7 7.5l10 9.5M5 8.5v7M2.5 18h5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .mobile-primary-tabs [data-tab="comparar"]::before {
    content: '';
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='10' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='10' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .mobile-more-tools-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 46px;
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
  }
  .mobile-more-tools-toggle::after {
    content: '⌄';
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    transition: transform .18s ease;
  }
  .section-nav.show-mobile-secondary .mobile-more-tools-toggle::after { transform: rotate(180deg); }
  .section-nav:has(.mobile-secondary-tool.active) .mobile-more-tools-toggle { border-color: var(--accent); }

  .mobile-secondary-tools { display: none; }
  .section-nav.show-mobile-secondary .mobile-secondary-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-secondary-tools .mobile-secondary-tool,
  .mobile-secondary-tools .history-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
  }
  .mobile-secondary-tools .breaker.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  }
  .mobile-secondary-tools [data-tab="gridexplorer"]::before { content: '▦'; }
  .mobile-secondary-tools [data-tab="estructuras"]::before { content: '🗼'; }
  .mobile-secondary-tools [data-tab="seguridad"]::before { content: '🛡'; }
  .mobile-secondary-tools [data-tab="utilitarios"]::before { content: '🧰'; }
  .mobile-secondary-tools [data-tab="transmision"]::before { content: '🏭'; }
  .mobile-secondary-tools [data-tab="gas"]::before { content: '🔥'; }
  .mobile-secondary-tools .history-nav-item::before {
    content: '↶';
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-right: 7px;
    color: var(--accent);
    font-size: 17px;
  }
  .mobile-secondary-tools .mobile-settings-section {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .mobile-secondary-tools .mobile-settings-toggle { width: 100%; min-height: 44px; height: 44px; }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open { grid-column: 1 / -1; }
  .section-nav.is-collapsed .mobile-primary-tabs .breaker { display: flex; }
  .section-nav.is-collapsed .mobile-more-tools-toggle { display: flex; }
}

@media (max-width: 520px) {
  .map-complete-shell:not(.is-fullscreen) .map-complete-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 10px; }
  .map-complete-shell:not(.is-fullscreen) .map-complete-title { font-size: 12px; }

  /* Grilla prolija de 2 columnas para los botones del mapa chico (Ruta,
     Centrar mapa, Leyenda, Capas/Radios, Abrir mapa). Si sobra un boton
     impar al final (ej. "Abrir mapa" solo), ocupa el ancho completo de su
     fila en vez de quedar flotando de un lado. */
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; width: 100% !important; gap: 7px !important; }
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions > * { box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; margin: 0 !important; }
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions > *:last-child:nth-child(odd) { grid-column: 1 / -1 !important; }
  .map-complete-shell:not(.is-fullscreen) .map-complete-location,
  .map-complete-shell:not(.is-fullscreen) .map-complete-center,
  .map-complete-shell:not(.is-fullscreen) .map-complete-button,
  .map-complete-shell:not(.is-fullscreen) .sed-feeder-zone-toggle,
  .map-complete-shell:not(.is-fullscreen) .map-filter-toggle,
  .map-complete-shell:not(.is-fullscreen) .map-legend-toggle { min-height: 44px !important; height: 44px; padding: 7px 8px !important; white-space: nowrap; font-size: 12px; border-radius: 10px; }

  /* Pantalla completa: la barra queda en una sola fila, y el boton de
     cerrar se ve como un circulo compacto con la "x" (ahorra espacio). */
  .map-complete-shell.is-fullscreen .map-complete-toolbar { flex-direction: row; align-items: center; }
  .map-complete-shell.is-fullscreen .map-complete-actions { width: auto; flex-wrap: wrap; justify-content: flex-end; }
  .map-complete-shell.is-fullscreen .map-complete-button { flex: 0 0 44px; width: 44px !important; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; }

  .mobile-map-selection-actions { grid-template-columns: 1fr; }
  .saved-searches-overlay { align-items: end; }
  .saved-searches-panel { width: 100%; height: auto; max-height: 84vh; border-radius: 18px 18px 0 0; }
  .saved-searches-tabs { gap: 5px; padding: 10px; }
  .saved-searches-tabs button { min-width: 0; padding: 7px 5px; font-size: 11px; }
}

/* Estados vacíos y errores */
.feedback-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  max-width: 680px;
  margin: 8px auto;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, var(--panel-2));
  color: var(--text);
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}

.feedback-state__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
}

.feedback-state__icon svg { width: 23px; height: 23px; }
.feedback-state__copy { min-width: 0; }
.feedback-state__title {
  display: block;
  margin: 0 0 3px;
  color: var(--text);
  font: 800 14px/1.3 'IBM Plex Sans', sans-serif;
}
.feedback-state__message {
  margin: 0;
  color: var(--muted);
  font: 500 12px/1.45 'IBM Plex Sans', sans-serif;
  overflow-wrap: anywhere;
}

.feedback-state__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-state__retry {
  min-width: 118px;
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #111;
  font: 800 12px/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
}
.feedback-state__retry:hover { filter: brightness(1.06); }
.feedback-state__retry:active { transform: translateY(1px); }

[data-feedback-state="error"] > .feedback-state,
[data-feedback-state="offline"] > .feedback-state {
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
}
[data-feedback-state="error"] .feedback-state__icon,
[data-feedback-state="offline"] .feedback-state__icon {
  background: color-mix(in srgb, var(--warn) 13%, transparent);
  color: var(--warn);
}
[data-feedback-state="empty"] .feedback-state__icon {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

td.empty[data-feedback-state] { padding: 10px !important; }
.procedure-empty[data-feedback-state] { margin: 0; }
.procedure-empty[data-feedback-state] > .feedback-state { max-width: none; }

@media (max-width: 520px) {
  .feedback-state {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px 10px;
    margin: 6px auto;
    padding: 11px;
  }
  .feedback-state__icon { width: 38px; height: 38px; }
  .feedback-state__icon svg { width: 21px; height: 21px; }
  .feedback-state__actions { grid-column: 1 / -1; }
  .feedback-state__retry { width: 100%; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-state__retry:active { transform: none; }
}

/* Control de capas de Redes: respaldo crítico incluido en el CSS principal. */
.redes-layer-menu{position:relative;display:none}
.redes-map-shell.is-fullscreen .redes-layer-menu{display:block}
.redes-layers-toggle{display:none}
.redes-map-shell.is-fullscreen .redes-layers-toggle{display:inline-flex}
.redes-toolbar-button[hidden]{display:none!important}
.redes-layer-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:1200;display:grid;grid-template-columns:1fr;gap:6px;width:min(230px,calc(100vw - 20px));max-height:min(420px,70vh);overflow:auto;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 10px 28px rgba(0,0,0,.28)}
.redes-layer-panel[hidden]{display:none!important}
.redes-layer-panel>b{color:var(--text);font-size:12px}
.redes-layer-panel button{min-height:40px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2);color:var(--text);font:700 11px/1.2 'IBM Plex Sans',sans-serif;text-align:left;cursor:pointer}
.redes-layer-panel button:hover,.redes-layer-panel button.is-active{border-color:var(--accent);background:var(--accent);color:#fff}
.redes-layer-panel button:focus-visible{outline:3px solid rgba(217,119,6,.3);outline-offset:1px}
#view-redes:has(#redes-mode-overview.is-active) #redes-unifilar-toggle{display:none!important}
.redes-recenter-control{border:0!important;background:transparent!important;box-shadow:none!important}
.redes-recenter-button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid rgba(0,0,0,.14);border-radius:50%;background:#fff;color:#4285f4;box-shadow:0 2px 9px rgba(0,0,0,.3);cursor:pointer}
.redes-recenter-button:hover{background:#f6f9ff;color:#1a73e8}.redes-recenter-button:disabled{opacity:.7;cursor:wait}
.redes-recenter-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.redes-recenter-button svg circle:last-child{fill:currentColor;stroke:none}
.redes-user-person{background:transparent!important;border:0!important}
.redes-user-person span{display:grid;place-items:center;width:32px;height:32px;border:3px solid #fff;border-radius:50%;background:#1a73e8;color:#fff;box-shadow:0 2px 9px rgba(0,0,0,.38)}
.redes-user-person svg{width:21px;height:21px;fill:currentColor}
.redes-supply-square{background:transparent!important;border:0!important}
.redes-supply-square span{display:block;width:100%;height:100%;box-sizing:border-box;border:1.5px solid #fff;border-radius:2px;background:#f59e0b;box-shadow:0 1px 3px rgba(15,23,42,.5)}
.redes-map-shell.is-unifilar .redes-recenter-control{display:none}
.redes-map-shell .leaflet-container{touch-action:none!important;overscroll-behavior:contain}
@media(max-width:760px){.redes-map-shell.is-fullscreen .redes-layer-menu{width:100%}.redes-layer-panel{top:calc(100% + 6px);right:0;left:auto;width:min(250px,calc(100vw - 20px));max-height:min(390px,62vh)}}
.map-filter-menu{position:relative;display:none}
.map-complete-shell.is-fullscreen .map-filter-menu{display:block}
.map-filter-toggle{min-height:40px;padding:8px 12px;border:1px solid var(--accent);border-radius:9px;background:var(--panel);color:var(--text);font:700 11px/1.2 'IBM Plex Sans',sans-serif;cursor:pointer}
.map-filter-toggle[aria-expanded="true"]{background:var(--accent);color:#fff}
.map-filter-panel{position:absolute!important;top:calc(100% + 7px)!important;right:0!important;bottom:auto!important;left:auto!important;z-index:1400!important;display:grid!important;grid-template-columns:1fr!important;gap:6px!important;width:min(240px,calc(100vw - 20px))!important;max-width:none!important;max-height:min(430px,68vh)!important;overflow:auto!important;padding:10px!important;border:1px solid var(--line)!important;border-radius:12px!important;background:var(--panel)!important;box-shadow:0 10px 28px rgba(0,0,0,.3)!important;backdrop-filter:none!important}
.map-filter-panel[hidden]{display:none!important}
.map-filter-panel>b{margin-top:3px;color:var(--text);font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.map-filter-panel button,.map-filter-panel label{box-sizing:border-box;display:flex;align-items:center;gap:7px;width:100%;min-height:38px;margin:0;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2);color:var(--text);font:700 11px/1.2 'IBM Plex Sans',sans-serif;text-align:left;cursor:pointer}
.map-filter-panel button:hover,.map-filter-panel button.is-active,.map-filter-panel label:has(input:checked){border-color:var(--accent);background:color-mix(in srgb,var(--accent) 16%,var(--panel));color:var(--accent)}
.map-filter-panel input{width:auto!important;margin:0!important}
.grid-unifilar-active .grid-filter-menu{display:none!important}
@media(max-width:760px){.map-complete-shell.is-fullscreen .map-filter-menu{position:static}.map-filter-panel{position:fixed!important;top:max(62px,calc(env(safe-area-inset-top,0px) + 54px))!important;right:10px!important;width:min(250px,calc(100vw - 20px))!important}.map-filter-toggle{min-width:76px;padding:7px 9px}}
.map-legend-control{display:block;position:relative;z-index:1250}
.redes-map-shell .map-legend-toggle[aria-expanded="true"]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 13%,transparent);color:var(--text)}
.map-legend-panel{position:absolute;top:calc(100% + 7px);right:0;display:grid;gap:7px;min-width:170px;max-width:min(260px,calc(100vw - 24px));padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--panel);color:var(--text);box-shadow:0 9px 26px rgba(0,0,0,.28)}
.map-legend-panel[hidden]{display:none}
.map-legend-panel span{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;white-space:nowrap}
.map-legend-panel i{width:11px;height:11px;flex:none;border:2px solid #fff;border-radius:50%;background:var(--legend-color);box-shadow:0 0 0 1px rgba(15,20,23,.25)}
.map-legend-panel i.legend-square{border-radius:2px}
.map-legend-panel i.legend-triangle{width:0;height:0;border:0;border-right:7px solid transparent;border-bottom:13px solid var(--legend-color);border-left:7px solid transparent;border-radius:0;background:transparent;box-shadow:none}
@media(max-width:760px){.map-legend-panel{position:fixed;top:max(62px,calc(env(safe-area-inset-top,0px) + 54px));right:10px;max-height:68vh;overflow:auto}}

/* "Mapa/recorrido unifilar" (Redes, Estructuras MT, GridExplorer): solo
   tiene sentido en pantallas grandes (PC), donde hay espacio para el
   esquema. En celular se oculta en todos los apartados donde aparece. */
@media(max-width:760px){
  #redes-unifilar-toggle,
  #estructura-unifilar-toggle,
  #grid-unifilar-toggle{display:none!important}
}

/* Navegación móvil compacta: todos los servicios quedan visibles,
   sin pestañas cortadas y con Configuración como sexto acceso principal. */
@media (max-width: 860px) {
  .desktop-network-suffix { display: none; }
  .section-nav { margin-bottom: 12px; }
  .section-nav .tabs { gap: 9px; }
  .mobile-primary-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  .mobile-primary-tabs::after { display: none; }
  .mobile-primary-tabs .breaker {
    display: flex;
    flex: none;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 60px;
    gap: 4px;
    padding: 8px 4px;
    overflow: hidden;
    border-radius: 12px;
    text-align: center;
    white-space: normal;
  }
  .mobile-primary-tabs .breaker > div:last-child { min-width: 0; }
  .mobile-primary-tabs .breaker .label {
    overflow: hidden;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
  }
  .mobile-primary-tabs .breaker::before { margin: 0; }

  .mobile-primary-tabs .mobile-settings-section {
    display: grid !important;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 60px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .mobile-primary-tabs .mobile-settings-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 60px;
    height: 100%;
    gap: 4px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
  }
  .mobile-primary-tabs .mobile-settings-toggle::before {
    content: '🔧';
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--accent);
    font-size: 17px;
    line-height: 1;
  }
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
  }
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open .mobile-settings-toggle {
    grid-column: 1 / -1;
    min-height: 44px;
    height: 44px;
    flex-direction: row;
  }
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open .mobile-settings-toggle::before { content: '×'; }
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open .theme-switcher,
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open .mode-switcher {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
  }
  .mobile-primary-tabs .mobile-settings-section.mobile-settings-open .classic-diagnostics-button {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  .mobile-more-tools-toggle {
    border-style: solid;
    border-radius: 12px;
  }
  .section-nav.show-mobile-secondary .mobile-secondary-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-secondary-tools .mobile-secondary-tool,
  .mobile-secondary-tools .history-nav-item {
    min-height: 46px;
    overflow: hidden;
    border-radius: 11px;
  }
  .mobile-secondary-tools .label,
  .mobile-secondary-tools .history-nav-item {
    font-size: 12px;
    line-height: 1.2;
  }

  .view.active { gap: 12px; }
  .panel { padding: 14px; border-radius: 14px; }
  input[type=text], select, .compare-input { border-radius: 9px; }
  .btn { min-height: 46px; border-radius: 9px; }
}

@media (max-width: 350px) {
  .mobile-primary-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Seguridad ocupa el sexto acceso principal; Configuración vuelve al panel
   secundario y usa todo el ancho cuando está abierta. */
@media (max-width: 860px) {
  .mobile-primary-tabs [data-tab="seguridad"]::before {
    content: '🛡';
    background: none;
  }

  .mobile-secondary-tools .mobile-settings-section {
    display: grid;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .mobile-secondary-tools .mobile-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    height: 100%;
    gap: 8px;
    padding: 9px 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
  }
  .mobile-secondary-tools .mobile-settings-toggle::before {
    content: '🔧';
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: var(--accent);
    font-size: 17px;
    line-height: 1;
  }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
  }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open .mobile-settings-toggle {
    grid-column: 1 / -1;
    justify-content: center;
    justify-self: stretch;
    width: 100%;
    min-height: 44px;
    height: 44px;
    overflow: visible;
    white-space: nowrap;
  }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open .mobile-settings-toggle::before { content: '×'; }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open .theme-switcher,
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open .mode-switcher {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
  }
  .mobile-secondary-tools .mobile-settings-section.mobile-settings-open .classic-diagnostics-button {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }
}
.supply-integral-trigger {
  display: flex;
  justify-content: center;
  margin: 14px 0 4px;
}

.supply-integral-trigger[hidden],
.supply-integral-panel[hidden],
#consulta-result-meta[hidden],
#consulta-result[hidden] {
  display: none !important;
}

body.showing-integral-supply .entity-selected-action[data-map-id="map-suministros"] {
  display: none !important;
}
body.showing-integral-poste #poste-selected-action,
body.showing-integral-poste #poste-integral-trigger {
  display: none !important;
}
.poste-integral-trigger .btn {
  width: 100%;
  min-height: 38px;
}
#poste-integral-retry[hidden] { display:none!important; }

#view-seguridad.active { display:block; columns:1; }
#view-seguridad > .panel { break-inside:avoid; margin-bottom:16px; }
#view-seguridad > :is(.safety-hero,.procedures-panel,.concepts-panel,.work-stages-panel,.form-guide-panel,.waste-panel,.electrical-magnitudes-panel) { column-span:all; }
.contact-section-heading { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.footer-contact-group{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:9px}
footer .footer-contact-group .visit-counter{margin-top:0}
#contact-us-open{display:inline-flex;align-items:center;justify-content:center;min-height:29px;padding:5px 11px;border:1px solid var(--line);border-radius:999px;background:var(--panel-2);color:var(--muted);font-family:inherit;font-size:11px;font-weight:600;line-height:17px;text-decoration:none;cursor:pointer}
#contact-us-open:hover{border-color:var(--accent);color:var(--accent)}
#contact-us-open:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#contact-us-dialog{box-sizing:border-box;width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:14px;background:var(--panel);color:var(--text);padding:20px}
#contact-us-dialog::backdrop{background:rgba(0,0,0,.5)}
.contact-us-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.contact-us-heading h2{margin:0}
#contact-us-close{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);color:var(--text);font-size:22px;cursor:pointer}
#contact-us-dialog address{font-style:normal}#contact-us-dialog address p{display:flex;gap:14px;align-items:center;margin:0;padding:16px 0;border-bottom:1px solid var(--line)}#contact-us-dialog address p:last-child{border:0}
#contact-us-dialog svg{width:24px;height:24px;flex:none;fill:none;stroke:var(--accent);stroke-width:1.6}#contact-us-dialog address span{min-width:0;overflow-wrap:anywhere}#contact-us-dialog small{display:block;color:var(--muted);margin-bottom:5px}#contact-us-dialog a{color:var(--text)}
@media(max-width:900px) { #view-seguridad.active { columns:1; } }
#view-seguridad > .panel { min-width:0; height:auto; box-sizing:border-box; }
#view-seguridad .procedure-filters { display:grid; grid-template-columns: minmax(150px,.65fr) minmax(220px,1fr) minmax(240px,1.2fr); gap:14px; align-items:end; }
#view-seguridad .procedure-filters > * { min-width:0; margin:0; }
#view-seguridad .procedure-filters label { display:flex; flex-direction:column; gap:8px; }
#view-seguridad .procedure-filters :is(input,select) { margin:0; width:100%; min-width:0; height:48px; box-sizing:border-box; }
#view-seguridad .procedure-card { display:flex; flex-direction:column; min-width:0; height:auto; }
#view-seguridad .procedure-card :is(h3,p) { overflow-wrap:anywhere; }
#view-seguridad .procedure-card :is(.procedure-link,.procedure-unavailable) { margin-top:auto; padding-top:10px; }
#view-seguridad .procedure-list { align-items:stretch; }
@media(max-width:900px) { #view-seguridad .procedure-filters { grid-template-columns:minmax(0,1fr); } }

.supply-integral-panel {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line, #c8d6df);
  border-top: 3px solid var(--accent, #d86116);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.supply-integral-header,
.supply-integral-section-title,
.supply-integral-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supply-integral-header h2,
.supply-integral-section-title h3 {
  margin: 0;
}

.supply-integral-header h2 { font-size: 19px; }
.supply-integral-section-title h3 { font-size: 15px; }

.supply-integral-header-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.supply-integral-header-actions .btn {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 8px 13px;
  text-decoration: none;
}

.supply-integral-header-actions .supply-integral-close {
  min-width: 38px;
  padding-inline: 10px;
  font-size: 20px;
  line-height: 1;
}

.supply-integral-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #c8d6df);
  border-radius: 8px;
  background: var(--panel, #fff);
}

.supply-integral-identity b { color: var(--ink, #172f43); }
.supply-integral-identity span {
  padding: 4px 8px;
  border: 1px solid #b9dfc2;
  border-radius: 6px;
  background: #e7f6ea;
  color: #24713a;
  font-size: 11px;
  font-weight: 700;
}

.supply-integral-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--soft, #eef4f7);
  color: var(--muted, #526775);
}

.supply-integral-status.loading::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: integral-spin .8s linear infinite;
}

@keyframes integral-spin { to { transform: rotate(360deg); } }

.supply-integral-section { margin-top: 16px; }

.supply-integral-section-title {
  margin-bottom: 8px;
  color: var(--muted, #526775);
}

.supply-integral-section-title > span { font-size: 12px; }

.proximity-badge {
  padding: 4px 8px;
  border: 1px solid var(--line, #c8d6df);
  border-radius: 999px;
  background: var(--soft, #eef4f7);
}

.supply-integral-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  align-items: stretch;
}

.supply-integral-nearby {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

#supply-integral-confirmed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#poste-integral-confirmed { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.supply-integral-card {
  position: relative;
  min-width: 0;
  min-height: 78px;
  padding: 11px 12px;
  border: 1px solid var(--line, #c8d6df);
  border-radius: 8px;
  background: var(--soft, #f4f7fa);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.supply-integral-card .supply-integral-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.supply-integral-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supply-integral-card.tone-blue .supply-integral-icon {
  color: #2563eb;
  background: #e4efff;
}

.supply-integral-card.tone-orange .supply-integral-icon {
  color: #d86116;
  background: #fff0e5;
}

.supply-integral-card.tone-gray .supply-integral-icon {
  color: #667480;
  background: #eceff2;
}

.supply-integral-card.tone-yellow .supply-integral-icon {
  color: #a86d00;
  background: #fff2c8;
}

.supply-integral-card-copy {
  min-width: 0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.supply-integral-card span,
.supply-integral-card small {
  display: block;
  color: var(--muted, #526775);
  font-size: 11px;
  line-height: 1.25;
}

.supply-integral-card b {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink, #172f43);
  line-height: 1.15;
}

.supply-network-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.supply-network-item {
  padding: 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  background: var(--soft, #f4f7fa);
}

.supply-network-item.mt { color: #d14b27; }
.supply-network-item.bt { color: #7454b8; }
.supply-network-item.ap { color: #a56b00; }

.supply-integral-note {
  margin: 14px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line, #c8d6df);
  color: var(--muted, #526775);
  font-size: 12px;
}

.supply-integral-map-shell {
  position: relative;
  min-height: 340px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line, #c8d6df);
  border-radius: 9px;
  background: var(--soft, #eef4f7);
}

.supply-integral-map-shell[hidden] { display: none !important; }
.supply-integral-map-shell > .map-complete-shell {
  border: 0;
  border-radius: 0;
}
.supply-integral-map-shell #map-suministros {
  height: 340px;
  min-height: 340px;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.poste-integral-panel .supply-integral-map-shell #map-postes {
  height: 520px;
  min-height: 420px;
  border: 0;
  border-radius: 10px;
}
.poste-integral-map-label {
  padding: 3px 6px;
  border: 1px solid #738293;
  border-radius: 5px;
  background: rgba(255,255,255,.96);
  color: #172f43;
  box-shadow: 0 2px 6px rgba(23,47,67,.16);
  font: 700 10px/1.2 'IBM Plex Sans',sans-serif;
  white-space: nowrap;
}

.supply-integral-map-legend {
  position: absolute;
  top: 52px;
  left: 10px;
  z-index: 700;
  display: grid;
  gap: 7px;
  min-width: 150px;
  padding: 10px;
  border: 1px solid rgba(23,47,67,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 16px rgba(23,47,67,.15);
  color: #172f43;
  font-size: 11px;
}

.supply-integral-map-legend span { display: flex; align-items: center; gap: 7px; }
.supply-integral-map-legend i { width: 11px; height: 11px; border-radius: 50%; }
.supply-integral-map-legend .legend-supply { background: #d86116; }
.supply-integral-map-legend .legend-sed { background: #2563eb; }
.supply-integral-map-legend .legend-post { background: #6b7280; }
.supply-integral-map-legend .legend-light { background: #d9a400; }

@media (max-width: 900px) {
  .supply-integral-grid,
  .supply-integral-nearby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #supply-integral-confirmed,
  #poste-integral-confirmed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .supply-integral-panel { padding: 12px; }
  .supply-integral-header { align-items: flex-start; flex-direction: column; }
  .supply-integral-header-actions { width: 100%; }
  .supply-integral-header-actions .btn { flex: 1; }
  .supply-integral-grid,
  .supply-network-grid { grid-template-columns: 1fr; }
  #supply-integral-confirmed,
  #poste-integral-confirmed { grid-template-columns: 1fr; }
  .supply-integral-section-title { align-items: flex-start; flex-direction: column; }
  .supply-integral-map-shell,
  .supply-integral-map-shell #map-suministros { min-height: 390px; height: 390px; }
  .poste-integral-panel .supply-integral-map-shell #map-postes { min-height: 390px; height: 390px; }
  .supply-integral-map-legend { top: 48px; }
}

@media print {
  @page { size: auto; margin: 9mm; }
  body.printing-integral-sheet {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body.printing-integral-sheet > *:not(#integral-print-sheet) { display: none !important; }
  body.printing-integral-sheet > #integral-print-sheet {
    display: block !important;
    position: static !important;
    inset: auto !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #172f43 !important;
    --panel: #fff;
    --panel-2: #eef4f7;
    --text: #172f43;
    --muted: #526c7f;
    --line: #c8d6df;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  #integral-print-sheet .supply-integral-header-actions { display: none !important; }
  #integral-print-sheet :is(.supply-integral-card,.supply-network-item,.supply-integral-identity,.supply-integral-status,.supply-integral-map-shell) {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #integral-print-sheet :is(.supply-integral-grid,.supply-network-grid,.supply-integral-nearby,#supply-integral-confirmed,#poste-integral-confirmed) {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}

#integral-print-sheet{display:none}

/* Some mobile print adapters capture the screen layout before applying print media. */
body.printing-integral-sheet { margin:0!important; padding:0!important; height:auto!important; min-height:0!important; overflow:visible!important; background:#fff!important; }
body.printing-integral-sheet > *:not(#integral-print-sheet):not(#integral-print-controls) { display:none!important; }
body.printing-integral-sheet > #integral-print-sheet { display:block!important; position:static!important; inset:auto!important; width:100%!important; max-width:none!important; height:auto!important; max-height:none!important; margin:0!important; box-sizing:border-box!important; overflow:visible!important; color:#172f43!important; background:#fff!important; --panel:#fff; --panel-2:#eef4f7; --text:#172f43; --muted:#526c7f; --line:#c8d6df; }
#integral-print-controls { padding:12px; background:#fff; }
#integral-print-sheet .supply-integral-map-shell,
#integral-print-sheet .map-complete-shell { height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important; break-inside:avoid; page-break-inside:avoid; }
#integral-print-sheet .map-complete-toolbar { min-height:0!important; height:auto!important; }
#integral-print-sheet .supply-integral-map-shell { width:100%!important; max-width:var(--integral-map-shell-width,100%)!important; margin-left:auto!important; margin-right:auto!important; }
#integral-print-sheet .map-complete-actions { display:none!important; }
#integral-print-sheet .integral-print-map-frame { position:relative; width:100%; max-width:var(--print-map-width); margin:0 auto; overflow:hidden; box-sizing:content-box; break-inside:avoid; page-break-inside:avoid; }
#integral-print-sheet .integral-print-map-content { position:absolute!important; inset:0 auto auto 0!important; margin:0!important; border:0!important; border-radius:0!important; transform-origin:0 0!important; transform:scale(var(--screen-map-scale,1))!important; overflow:hidden!important; }
#integral-print-sheet .integral-print-map-content :is(.leaflet-tile,.leaflet-tile-container) { opacity:1!important; transition:none!important; animation:none!important; }
@media print {
  html { background:#fff!important; height:auto!important; min-height:0!important; }
  #integral-print-sheet .integral-print-map-frame { width:var(--print-map-width)!important; max-width:none!important; height:var(--print-map-height)!important; }
  #integral-print-sheet .integral-print-map-content { transform:scale(var(--print-map-scale))!important; }
}
#integral-print-sheet .supply-integral-header-actions { display:none!important; }
@media print { body.printing-integral-sheet > #integral-print-controls { display:none!important; } }

.action-icon{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.result-action-button:has(.action-icon),.map-complete-actions :is(a,button):has(.action-icon),.redes-toolbar-button:has(.action-icon){gap:6px}
.infrastructure-detail{padding:14px;border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:10px;background:var(--panel)}
.infrastructure-detail[hidden]{display:none!important}
.infrastructure-detail header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.infrastructure-detail header span{color:var(--accent);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.infrastructure-detail h3{margin:3px 0 0;font-size:18px}
.infrastructure-detail header button{width:38px;height:38px;border:1px solid var(--accent);border-radius:8px;background:transparent;color:var(--text);font-size:20px;cursor:pointer}
.infrastructure-detail dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0 0}
.infrastructure-detail dl div{min-width:0;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel-2)}
.infrastructure-detail dt{color:var(--muted);font-size:10px}.infrastructure-detail dd{margin:3px 0 0;overflow-wrap:anywhere;color:var(--text);font-size:12px;font-weight:750}
@media(max-width:520px){
  .map-complete-shell:not(.is-fullscreen) .map-complete-toolbar{gap:5px;padding:7px}
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions{display:flex!important;grid-template-columns:none!important;gap:6px!important;overflow-x:auto;scrollbar-width:none}
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions::-webkit-scrollbar{display:none}
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions>*{flex:0 0 auto!important;width:auto!important}
  .map-complete-shell:not(.is-fullscreen) .map-complete-actions>*:last-child:nth-child(odd){grid-column:auto!important}
  .map-complete-shell:not(.is-fullscreen) :is(.map-complete-location,.map-complete-center,.map-complete-button,.sed-feeder-zone-toggle,.map-filter-toggle,.map-legend-toggle){min-height:40px!important;height:40px!important;padding:6px 10px!important;font-size:11px!important}
  .map-legend-panel{position:fixed!important;top:auto!important;right:10px!important;bottom:max(12px,env(safe-area-inset-bottom,0px))!important;left:10px!important;box-sizing:border-box;min-width:0;max-width:none;max-height:42vh;overflow:auto;z-index:4000}
  .infrastructure-detail dl{grid-template-columns:1fr}
}

/* Barra del mapa completo en celular: una sola fila compacta. El título se
   omite porque el usuario ya conoce el mapa abierto y así no compite con Ir,
   Radios, Leyenda y Cerrar. Los mapas con controles adicionales conservan
   desplazamiento horizontal sin deformar ni apilar botones. */
@media(max-width:520px){
  .map-complete-shell.is-fullscreen>.map-complete-toolbar{
    display:block!important;
    min-height:0!important;
    padding:max(7px,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right,0px)) 7px max(8px,env(safe-area-inset-left,0px))!important;
  }
  .map-complete-shell.is-fullscreen .map-complete-title{display:none!important}
  .map-complete-shell.is-fullscreen .map-complete-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    width:100%!important;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .map-complete-shell.is-fullscreen .map-complete-actions::-webkit-scrollbar{display:none}
  .map-complete-shell.is-fullscreen .map-complete-actions>*{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
  }
  .map-complete-shell.is-fullscreen .map-complete-actions :is(.map-complete-location,.map-complete-center,.sed-feeder-zone-toggle,.map-filter-toggle,.map-legend-toggle){
    flex:0 0 auto!important;
    width:auto!important;
    min-width:64px!important;
    height:40px!important;
    min-height:40px!important;
    padding:6px 10px!important;
    border-radius:10px!important;
    font-size:11px!important;
  }
  .map-complete-shell.is-fullscreen .map-complete-actions .map-complete-button{
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0!important;
    border-radius:10px!important;
    font-size:20px!important;
  }
}
