/* Sismo Panamá · servidor (4.28): la página web.
   1. En la web no aplica (lo hace el servidor): fuentes de datos (siempre todas), segundo plano, datos y versión,
      exportar, permisos de Android, «No molestar» y «Revisado / Borrar» en las señales de un sismo.
   2. html.pc: vista para el navegador de una PC (puente.js la elige sola: ventana ancha y mouse). Secciones en una
      barra a la izquierda, el detalle del sismo al lado del mapa y de la secuencia, filtros y ajustes como panel a la
      derecha. */

.fgroup:has(#srclist), .fgroup:has(#netinfo), .fgroup:has(#sExport), .wman { display: none !important; }
/* 5.19: en la app Android (nativo.js, html.app) sí: segundo plano, permisos y «No molestar»; no: el permiso de
   notificaciones del navegador, el botón de sonido ni «datos sísmicos» en segundo plano (ya no detecta el teléfono) */
html:not(.app) .fgroup:has(#sBg), html:not(.app) .fgroup:has(#sPerms), html:not(.app) label.tgl:has(#nDnd),
html:not(.app) #nDndSt, html.app .srvperm, html.app #srvSnd, html.app #sBgLiveRow { display: none !important; }
#appSrv .arow input.search { flex: 1; min-width: 0; }
#appSrv .appok { color: var(--ok); }
#appSrv .appbad { color: var(--bad); font-weight: 600; }
#appSrv > div { margin: 4px 0; }

/* avisos del navegador (despues.js) */
.srvperm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 12.5px; }
.srvperm .st { color: var(--muted); }
.srvperm .st.ok { color: var(--ok); }
.srvperm .st.bad { color: var(--bad); }
.sndbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px); z-index: 36;
  background: var(--warn); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font: 600 13px/1.2 var(--f-body);
  box-shadow: 0 4px 14px rgb(0 0 0 / .25); cursor: pointer; }

/* ------------------------------------------------------------------ PC */
html.pc { --rail: 210px; }
html.pc body { font-size: 14.5px; }
html.pc .appbar, html.pc .fbar, html.pc main { margin-left: var(--rail); }
html.pc .appbar { padding: 10px 24px 8px; }
html.pc .appbar h1 { font-size: 19px; }
html.pc .fbar { padding: 5px 24px; }
html.pc .ibtn { cursor: pointer; }
html.pc .ibtn:hover { border-color: var(--muted); }

/* secciones: barra a la izquierda */
html.pc .nav { top: 0; bottom: 0; right: auto; width: var(--rail); display: flex; flex-direction: column; gap: 2px;
  padding: 16px 10px; border-top: 0; border-right: 1px solid var(--rule); z-index: 25; overflow-y: auto; }
html.pc .nav::before { content: "Sismo Panamá"; display: block; font: 800 13px/1 var(--f-body); letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); padding: 6px 12px 16px; }
html.pc .nav button { height: 40px; display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  padding: 0 12px; border-radius: 10px; font-size: 14px; letter-spacing: 0; text-align: left; }
html.pc .nav button svg { width: 19px; height: 19px; flex: none; }
html.pc .nav button:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); color: var(--fg); }
html.pc .nav button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 13%, transparent); }

html.pc main { max-width: none; margin-right: 0; padding: 12px 24px 28px; }
html.pc .tab { gap: 16px; }

/* resumen (4.29): a la izquierda el último sismo y los anteriores, a la derecha los valores y la tabla por día */
html.pc #t-res { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
html.pc #t-res > #errcard { grid-column: 1 / -1; }
html.pc .rescol { display: grid; gap: 16px; min-width: 0; align-content: start; }
html.pc #resR .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.pc #resR .tile b { font-size: 26px; }
html.pc #latestCard .det .dmag.big { font-size: 44px; }

/* mapa (4.31): el detalle del sismo dentro del mapa, arriba a la izquierda */
html.pc #t-map { grid-template-columns: minmax(0, 1fr); }
html.pc #mapbox > #detail { position: absolute; left: 10px; top: 10px; z-index: 4; width: min(400px, 45%); max-height: calc(100% - 20px);
  overflow: auto; margin: 0; box-shadow: 0 4px 18px rgb(0 0 0 / .22); background: color-mix(in srgb, var(--card) 96%, transparent); }
html.pc #mapbox > #detail:has(> .empty) { display: none; }
html.pc body.mapfs #mapbox > #detail { display: block; position: absolute; left: 10px; top: 10px; right: auto; bottom: auto; width: 400px; max-height: calc(100% - 20px); }
html.pc body.mapfs #mapbox > #detail:has(> .empty) { display: none; }
html.pc #mapbox > #detail .det.swp { padding: 0 26px; }

/* secuencia: el detalle a la derecha; todo el periodo en el ancho (sin desplazarse de lado) */
html.pc #t-seq { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; }
html.pc #t-seq > .tl { grid-column: 1; grid-row: 1; }
html.pc #t-seq > #detail2 { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 112px; max-height: calc(100vh - 128px); overflow: auto; }
/* 5.68: la tabla por hora/día/mes (antes la pestaña «Por hora») debajo de la secuencia, en la misma columna */
html.pc #t-seq > #hcard { grid-column: 1; grid-row: 2; max-width: 1180px; }
html.pc #t-seq > #detail2 .det.swp { padding: 0 26px; }
html.pc #tlhint { display: none; }

/* riesgo (4.31): el detalle del lugar dentro del mapa, arriba a la izquierda (bajo VII / VIII) */
html.pc #t-risk { grid-template-columns: minmax(0, 1fr); }
html.pc #mapbox > #riskinfo { position: absolute; left: 10px; top: 48px; z-index: 4; width: min(380px, 45%); max-height: calc(100% - 140px);
  overflow: auto; margin: 0; box-shadow: 0 4px 18px rgb(0 0 0 / .22); background: color-mix(in srgb, var(--card) 96%, transparent); }
html.pc #mapbox > #riskinfo:empty { display: none; }

/* fallas (4.31): el mapa a la izquierda y los datos a la derecha */
html.pc .fcard { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); column-gap: 4px; align-items: start; }
html.pc .fcard { align-items: stretch; }
html.pc .fcard > canvas { grid-column: 1; grid-row: 1 / span 8; align-self: stretch; height: auto; min-height: 420px; width: 100%; border: 0; border-right: 1px solid var(--rule); }
html.pc .fcard > :not(canvas) { grid-column: 2; }

/* lista y top 20 (4.31): una columna más con las otras agencias y más datos */
html.pc #top .row { grid-template-columns: 58px minmax(0, 1.1fr) minmax(0, 1fr); }
html.pc #clist .crow { grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1fr); padding: 9px 4px; }
html.pc #clist .crow .rx { grid-column: 3; grid-row: 1 / span 2; }
html.pc .row .rx { min-width: 0; font-size: 12.5px; line-height: 1.45; }
html.pc .row .rx > div:first-child { overflow-wrap: anywhere; }
html.pc .row .rx > div:last-child { font-family: var(--f-data); font-size: 11.5px; color: var(--muted); }
html.pc .crow .rx { min-width: 0; font-size: 12.5px; line-height: 1.45; }
html.pc .crow .rx > div:first-child { overflow-wrap: anywhere; }
html.pc .crow .rx > div:last-child { font-family: var(--f-data); font-size: 11.5px; color: var(--muted); }
html.pc .row:hover, html.pc .crow:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }

/* señales (4.31): capa centrada sobre la página; clic fuera o Esc la cierra */
html.pc .wave { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1100px, 92vw); max-height: 90vh;
  border-radius: 16px; border: 1px solid var(--rule); padding: 14px 20px 18px;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / .5), 0 12px 40px rgb(0 0 0 / .35); }
html.pc .wave img, html.pc .wave .wn { max-width: 100%; margin: 0 auto; }
html.pc .wave .wload { max-width: 100%; margin: 14px 0 4px; }

/* listas: ancho cómodo */
html.pc #t-list, html.pc #t-top { max-width: 1180px; }
/* 5.21: «En vivo» con todo el ancho de la pantalla (las señales se estiran y se ven mejor) */
html.pc #t-live { max-width: none; }


/* filtros, ajustes y ayuda: panel a la derecha */
html.pc .sheet { left: auto; right: 0; top: 0; bottom: 0; width: min(460px, 100vw); max-height: none; border-radius: 0;
  padding: 10px 22px 18px; box-shadow: -6px 0 28px rgb(0 0 0 / .25); }
html.pc .sheet .grab { display: none; }
html.pc .sheet .actions { bottom: -18px; }
html.pc .seg button, html.pc .btn, html.pc .linkbtn, html.pc .fchip { cursor: pointer; }
html.pc .toast { left: auto; right: 24px; bottom: 24px; width: 420px; }
html.pc .sndbar { bottom: 24px; left: calc(50% + var(--rail) / 2); }
html.pc .newq { top: 110px; left: calc(50% + var(--rail) / 2); }
html.pc label.tgl:has(#nVib) { display: none; }   /* (una PC no vibra) */



/* 4.48: señales dibujadas en la página (zoom y desplazamiento) */
.wave .wv { max-width: 1100px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.wave .wv canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
.wave .wvbar { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-bottom: 1px solid var(--rule); }
.wave .wvbar button { border: 1px solid var(--rule); background: var(--bg); color: var(--fg); border-radius: 6px; min-width: 30px; padding: 2px 8px; font: 600 14px system-ui, sans-serif; cursor: pointer; }
.wave .wvbar .small { font-size: 11px; }

/* 4.57: «automático» con el mismo tono que «preliminar» (la píldora sin clase) */
