/* Find Me, in the Family Hub console look: dark only, one set of tokens. */
:root {
  color-scheme: dark;
  --bg: #0e0e10;
  --bar: #131316;
  --panel: #17171b;
  --panel2: #212127;
  --hover: #1d1d22;
  --line: #2a2a31;
  --tx: #e7e7ea;
  --tx2: #9b9ba4;
  --muted: #6d6d76; /* never for text under 24px: the contrast fails */
  --accent: #2f7bf5;
  --accent-hi: #4a8df7;
  --sel: #1e3a68;
  --sel-tx: #cfe0ff;
  --ok: #34c38f;
  --ok-bg: #12291f;
  --warn: #e8a838;
  --warn-bg: #33270f;
  --bad: #f0616a;
  --bad-bg: #3a1619;
  --left: 216px;
  --top: 40px;
  --font: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--tx); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 20px; font-weight: 600; }
h2, h3 { margin: 0; font-size: 14px; font-weight: 600; }
p { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.fine { color: var(--tx2); }
.small { font-size: 12px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 6px 10px; border-radius: 6px; background: var(--sel); color: var(--sel-tx); }
.skip:focus { top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Controls */
.control, select, input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--tx); min-width: 0;
}
input[type="number"] { width: 56px; }
select[multiple] { height: auto; padding: 4px; }
input[type="range"] { accent-color: var(--accent); }
.btn { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--tx); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--tx2); }
.btn-ghost:hover { color: var(--tx); background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); }
.btn-danger { color: var(--bad); }
.pill { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 5px; background: var(--panel2); color: var(--tx2); white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-sel { background: var(--sel); color: var(--sel-tx); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status { color: var(--warn); min-height: 1.3em; }

/* Shell */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar { height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 12px 0 10px; background: var(--bar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wordmark { font-weight: 600; font-size: 14px; }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.topnav a { padding: 4px 10px; border-radius: 6px; color: var(--tx2); }
.topnav a:hover { text-decoration: none; color: var(--tx); }
.topnav a[aria-current="page"] { background: var(--sel); color: var(--tx); }
.topbar .email { font-size: 12px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.body { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.sidebar { width: var(--left); padding: 10px 8px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); background: var(--bg); }
.sidebar section { display: flex; flex-direction: column; gap: 2px; }
.sidebar h2 { margin: 0 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: var(--tx2); }
.sidebar .head { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
.sidebar .head h2 { margin: 0; }
.sidebar .head a { color: var(--tx2); display: inline-flex; padding: 0; }
.side-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--tx); border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.side-row:hover { background: var(--hover); text-decoration: none; }
.side-row[aria-current="true"] { background: var(--sel); }
.side-row .label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-row .count { color: var(--tx2); }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 18px 22px 40px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lede { color: var(--tx2); margin-top: 2px; }
.footer { padding: 10px 22px; font-size: 11.5px; color: var(--tx2); border-top: 1px solid var(--line); background: var(--bar); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--tx2); }

/* Sign in */
.sign-in { max-width: 420px; margin: 60px auto; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 12px; }
.sign-in h1 { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; color: var(--tx2); font-size: 12px; }
.field > input, .field > select { color: var(--tx); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
fieldset.field { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 0; gap: 4px; }
fieldset.field label { color: var(--tx); display: flex; align-items: center; gap: 6px; }
legend { padding: 0 4px; color: var(--tx2); }

/* Filters */
/* One row of controls, wrapping as whole groups; a label is muted text beside its input. */
.filters { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; }
.filter-group { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--tx2); white-space: nowrap; }
.filters select, .filters input, .filters .btn { height: 28px; border: 1px solid var(--line); border-radius: 5px; }
.filters input[type="checkbox"] { height: auto; border: 0; margin: 0; }
.filters .search { flex: 1; min-width: 180px; }
.filters .near-place { width: 180px; }

/* Map */
.map-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.map { height: 380px; background: var(--bar); }
.map-small { height: 240px; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; list-style: none; margin: 0; }
.legend label { display: inline-flex; align-items: center; gap: 5px; }
.legend .note { color: var(--tx2); }
/* Swatches are shaped here and coloured inline from pins.js, the one palette. */
.swatch { display: inline-block; border-radius: 50%; margin-right: 2px; }
.swatch.filled { width: 14px; height: 14px; border: 2px solid var(--bar); }
.swatch.hollow { width: 10px; height: 10px; background: var(--bar); border: 2px solid currentColor; }
.swatch.dashed { width: 12px; height: 12px; border: 2px dashed currentColor; }
.legend .key { display: inline-flex; align-items: center; gap: 2px; }
.maplibregl-popup-content { background: var(--panel); color: var(--tx); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.45 var(--font); max-width: 280px; }
.maplibregl-popup-tip { border-top-color: var(--line) !important; }
.maplibregl-popup-content p { margin: 2px 0; }
.maplibregl-popup-close-button { color: var(--tx2); }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button { background: var(--panel) !important; filter: invert(1) hue-rotate(180deg); }

/* Case groups */
.group { display: flex; flex-direction: column; gap: 6px; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-head h2 { font-size: 14px; }
.group-head .count { color: var(--tx2); font-size: 12px; }
.group.first_48h .group-head h2, .group.first_48h .chevron { color: var(--bad); }
.group.within_7d .group-head h2, .group.within_7d .chevron { color: var(--accent-hi); }
.group-box { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.group-bar { width: 4px; flex: none; }
.group.first_48h .group-bar { background: var(--bad); }
.group.within_7d .group-bar { background: var(--accent); }
.group-table { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 12px; }
.case-row, .case-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 110px 110px 92px 70px; gap: 8px; align-items: center; }
.case-head { font-size: 11.5px; color: var(--tx2); padding: 8px 0 4px; border-bottom: 1px solid var(--line); }
.case-head .status-col { text-align: center; }
.case-row { min-height: 36px; border-bottom: 1px solid var(--line); list-style: none; }
.case-row:hover { background: var(--hover); }
.case-row:last-of-type { border-bottom: 0; }
.case-row .person { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row .person .age { font-weight: 400; color: var(--tx2); }
.case-row .place { color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row .status { justify-self: stretch; text-align: center; min-height: 0; }
.case-row .source { justify-self: start; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.case-row .since.unknown { color: var(--tx2); }
.case-row .open { color: var(--tx2); justify-self: end; display: inline-flex; align-items: center; gap: 4px; }
.case-row.found { color: var(--tx2); }
.cases { margin: 0; padding: 0; }
.empty { color: var(--tx2); padding: 10px 0; }
.group-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 8px; border-top: 1px solid var(--line); }
.mix { display: flex; height: 6px; width: 180px; border-radius: 3px; overflow: hidden; }
.mix span { flex: 1; }
.mix .amber { background: var(--bad); }
.mix .active { background: var(--accent); }
.mix .unconfirmed { background: var(--warn); }
.mix .found_safe, .mix .resolved { background: var(--ok); }
.mix .found_deceased { background: var(--tx2); }
@media (max-width: 760px) {
  .case-row, .case-head { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 90px 70px; }
  .case-head .since-col, .case-head .open-col, .case-row .since, .case-row .open { display: none; }
}

/* Watches and alerts */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.watch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.watch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.watch.off { opacity: .55; }
.watch h4 { margin: 0; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.watch .meta { flex: 1 1 100%; color: var(--tx2); font-size: 12px; }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.alert { display: grid; grid-template-columns: 150px minmax(0, 2fr) minmax(0, 3fr) 92px; gap: 8px; align-items: center; min-height: 36px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
.alert:hover { background: var(--hover); }
.alert time { color: var(--tx2); font-size: 12px; }
.alert .why { color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert .delivery { justify-self: end; }
@media (max-width: 760px) {
  .alert { grid-template-columns: 1fr; gap: 2px; }
  .alert .delivery { justify-self: start; }
}

/* Basemap switcher, in the legend strip */
.legend .basemaps { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { height: 26px; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--tx2); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--tx); background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--sel); color: #cfe0ff; }
.maplibregl-ctrl-attrib { background: rgb(19 19 22 / 80%) !important; color: var(--tx2); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--tx2); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
