/* Station health: a link on the GPS Uplift header opens a full station
   health table in a dialog. Matches gps-station-dialog's look (uplift3d.css)
   and the app's shared theme tokens, so it drops into both themes untouched. */

.gps-header-links { display:flex;align-items:center;gap:14px;flex:none; }
.gps-health-link {
  font:600 11px var(--font-ui);
  color:var(--magma);
  background:transparent;
  border:1px solid var(--line-strong);
  border-radius:6px;
  padding:7px 12px;
  cursor:pointer;
  white-space:nowrap;
}
.gps-health-link:hover { background:var(--bg-raised);border-color:var(--magma); }
.gps-health-link:focus-visible { outline:2px solid var(--magma);outline-offset:2px; }

.gps-health-dialog {
  width:min(1180px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  box-sizing:border-box;
  overflow:auto;
  padding:22px;
  border:1px solid var(--line-strong);
  border-radius:12px;
  background:var(--bg-raised);
  color:var(--ink);
  box-shadow:0 20px 80px #0008;
}
.gps-health-dialog::backdrop { background:#061017b8; }
.gps-health-dialog :focus-visible { outline:2px solid var(--magma);outline-offset:2px; }

.gps-health-header { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px; }
.gps-health-header h2 { font-size:20px;margin:2px 0 5px; }
.gps-health-header p { color:var(--ink-soft);font-size:12px;margin:0; }
#gpsHealthClose { flex:none;width:40px;height:40px;border:1px solid var(--line-strong);border-radius:6px;color:var(--ink);background:var(--bg);font-size:26px;cursor:pointer; }

.gps-health-summary {
  display:flex;flex-wrap:wrap;gap:10px 20px;
  padding:12px 16px;margin-bottom:14px;
  border:1px solid var(--line);border-radius:10px;background:var(--bg);
  font:12px var(--font-ui);color:var(--ink-soft);
}
.gps-health-summary strong { color:var(--ink);font:600 13px var(--font-mono); }
.gps-health-summary .hs-healthy strong { color:var(--magma); }
.gps-health-summary .hs-stale strong { color:var(--sulphur); }
.gps-health-summary .hs-noisy strong { color:var(--sulphur); }
.gps-health-summary .hs-nodata strong { color:var(--ink-faint); }

.gps-health-toolbar { display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:12px; }
.gps-health-toolbar input[type=search] {
  flex:1 1 200px;min-width:160px;padding:8px 11px;
  background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:6px;font-size:12px;
}
.gps-health-filter { display:flex;align-items:center;gap:8px;font-size:11px;color:var(--ink-faint); }
.gps-health-filter select { padding:7px 9px;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:6px;font-size:12px; }

.gps-health-table-wrap { border:1px solid var(--line);border-radius:10px;overflow:auto;max-height:52vh; }
table.gps-health-table { width:100%;border-collapse:collapse;font:12px var(--font-mono); }
.gps-health-table thead th {
  position:sticky;top:0;z-index:1;
  background:var(--bg-sunken);color:var(--ink-faint);
  text-align:left;padding:9px 12px;font:600 10px var(--font-ui);letter-spacing:.04em;
  border-bottom:1px solid var(--line-strong);cursor:pointer;white-space:nowrap;
}
.gps-health-table thead th:hover { color:var(--ink); }
.gps-health-table thead th.sorted::after { content:' \25BE'; color:var(--magma); }
.gps-health-table thead th.sorted.asc::after { content:' \25B4'; }
.gps-health-table tbody td { padding:8px 12px;border-bottom:1px solid var(--line);white-space:nowrap; }
.gps-health-table tbody tr:last-child td { border-bottom:0; }
.gps-health-table tbody tr.gh-row { cursor:pointer; }
.gps-health-table tbody tr.gh-row:hover td { background:var(--bg); }
.gps-health-table td.gh-station { font-weight:600;color:var(--ink); }
.gps-health-table td.gh-region { color:var(--ink-soft);text-transform:capitalize; }

.gh-badge { display:inline-flex;align-items:center;gap:5px;font:600 10px var(--font-ui);padding:3px 8px;border-radius:99px;white-space:nowrap; }
.gh-badge.gh-healthy { color:var(--magma);background:color-mix(in srgb, var(--magma) 16%, transparent); }
.gh-badge.gh-stale { color:var(--sulphur);background:color-mix(in srgb, var(--sulphur) 18%, transparent); }
.gh-badge.gh-noisy { color:var(--sulphur);background:color-mix(in srgb, var(--sulphur) 18%, transparent); }
.gh-badge.gh-no_data { color:var(--ink-faint);background:color-mix(in srgb, var(--ink-faint) 16%, transparent); }

.gh-map-yes { color:var(--magma); }
.gh-map-no { color:var(--ink-faint); }
.gh-reason { display:block;font:10px var(--font-ui);color:var(--ink-faint);white-space:normal;max-width:220px; }
.gh-override { font:10px var(--font-ui);color:var(--fjord);white-space:normal;max-width:200px; }
.gh-offsets { font:11px var(--font-mono);color:var(--ink-soft); }

#gpsHealthNote { margin-top:12px; }

@media(max-width:700px) {
  .gps-health-dialog { padding:14px; }
  .gps-health-header h2 { font-size:17px; }
  .gps-health-summary { font-size:11px;gap:8px 14px;padding:10px 12px; }
  .gps-health-table-wrap { max-height:60vh; }
  table.gps-health-table { font-size:11px; }
  .gps-health-table thead th, .gps-health-table tbody td { padding:7px 8px; }
}

/* Keeps the GPS panel header from widening on narrow/mobile screens: the
   masthead is already tight at 390px, and this button sits inside the GPS
   tab's own content header, not the masthead, but should still stay compact
   and wrap under the title rather than force horizontal scroll. */
@media(max-width:760px) {
  .gps-header-links { gap:8px;flex-wrap:wrap; }
  .gps-health-link { font-size:10px;padding:6px 9px; }
}
