/* The locator page, in aegis's clothes. Every colour, radius and type setting below is aegis's own
   (apps/web/tailwind.config.ts, apps/web/src/app/globals.css, admin/layout.tsx, Sidebar.tsx + Brand.tsx), so a link
   from the control room looks like it came from the control room. Two things differ on purpose, for a cheap phone
   held in the sun: every control is at least 48 px tall, and type is a size up (aegis's text-sm 14 px is 16 px here,
   which also keeps iOS from zooming into the name field). Dark mode follows the phone, with aegis's dark surfaces.
   Two layouts share all of it: the mobile recovery view (.rv, a responder's link) and the desktop operator view (.op). */

:root {
  /* aegis's brand (tailwind.config.ts) */
  --ink: #0b0d10;
  --ink-soft: #15181c;
  --steel: #8b95a1;
  --gold-100: #f5ecd2;
  --gold-200: #e9d59b;
  --gold-300: #d9bb63;
  --gold-400: #cba23c;
  --gold-500: #bd8f2a;
  --gold-600: #9c7320;
  --gold-700: #7a591a;
  /* light: aegis's slate page and white cards (globals.css) */
  --page: #f8fafc;                 /* slate-50 */
  --text: #0f172a;                 /* slate-900 */
  --text-2: #334155;               /* slate-700 */
  --muted: #64748b;                /* slate-500 */
  --card: #ffffff;
  --card-line: #e2e8f0;            /* slate-200 */
  --field-line: #cbd5e1;           /* slate-300 */
  --header: #ffffff;
  --header-line: #e2e8f0;
  --primary-bg: var(--ink);
  --primary-hover: #000000;
  --primary-text: #ffffff;
  --secondary-bg: #ffffff;
  --secondary-hover: #f8fafc;
  --secondary-text: #334155;
  --secondary-line: #cbd5e1;
  --input-bg: #ffffff;
  --input-text: #0f172a;
  --placeholder: #94a3b8;          /* slate-400 */
  --warn-bg: #fffbeb; --warn-line: #fde68a; --warn-text: #92400e;       /* amber-50 / 200 / 800 */
  --final-bg: #fff1f2; --final-line: #fecdd3; --final-text: #be123c;    /* rose-50 / 200 / 700 */
  --live: #10b981;                 /* aegis's "Live" green (live-map-draw.ts) */
  --amber: #b45309;                /* amber-700: a word getting old */
  --red: #be123c;                  /* rose-700: a word too old */
  --sheet-shadow: 0 -4px 16px rgba(15, 23, 42, 0.12);
  --chip-enroute-bg: #dbeafe; --chip-enroute-text: #1d4ed8;        /* aegis's RESPONDER_LOOK, as tints */
  --chip-arrived-bg: #dcfce7; --chip-arrived-text: #15803d;
  --chip-stopped-bg: #f1f5f9; --chip-stopped-text: #475569;
  --chip-sharing-bg: #cffafe; --chip-sharing-text: #0e7490;
  --map-bg: #e2e8f0;
  --map-btn-bg: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* aegis's dark skin (globals.css .dark overrides) */
    --page: #0b0d10;
    --text: #e7ebf0;
    --text-2: #c2c9d2;
    --muted: #8b95a1;
    --card: #15181c;
    --card-line: rgba(255, 255, 255, 0.1);
    --field-line: rgba(255, 255, 255, 0.15);
    --header: #15181c;
    --header-line: rgba(255, 255, 255, 0.08);
    --primary-bg: rgba(255, 255, 255, 0.1);
    --primary-hover: rgba(255, 255, 255, 0.2);
    --primary-text: #ffffff;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --secondary-hover: rgba(255, 255, 255, 0.1);
    --secondary-text: #e2e8f0;
    --secondary-line: rgba(255, 255, 255, 0.15);
    --input-bg: #15181c;
    --input-text: #f1f5f9;
    --placeholder: #64748b;
    --warn-bg: rgba(245, 158, 11, 0.12); --warn-line: rgba(245, 158, 11, 0.3); --warn-text: #fcd34d;
    --final-bg: rgba(244, 63, 94, 0.12); --final-line: rgba(244, 63, 94, 0.3); --final-text: #fda4af;
    --map-bg: #20242b;
    --map-btn-bg: #15181c;
    --amber: #fbbf24;
    --red: #fda4af;
    --sheet-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    --chip-enroute-bg: rgba(37, 99, 235, 0.2); --chip-enroute-text: #93c5fd;
    --chip-arrived-bg: rgba(22, 163, 74, 0.2); --chip-arrived-text: #86efac;
    --chip-stopped-bg: rgba(255, 255, 255, 0.08); --chip-stopped-text: #cbd5e1;
    --chip-sharing-bg: rgba(8, 145, 178, 0.2); --chip-sharing-text: #67e8f9;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  /* aegis's console wears a 2 px gold line along its top edge (admin/layout.tsx) */
  border-top: 2px solid var(--gold-500);
}

/* the DEV strip — aegis's, exactly (apps/web/src/app/layout.tsx); only dev's page carries it */
.dev-strip {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 2147483647;
  pointer-events: none;
  background: #b91c1c; color: #fff;
  font: 700 11px/16px system-ui, sans-serif; letter-spacing: 0.04em;
  padding: 1px 10px; border-radius: 0 0 6px 6px; white-space: nowrap;
}

/* ── the header: emblem, "World Risk", and what this page is ── */
.top {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
}
.emblem { display: block; height: 40px; width: auto; flex: none; }
.brand { display: flex; flex-direction: column; min-width: 0; }
.wordmark { font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; font-size: 18px; line-height: 1.5rem; color: var(--ink); }
.wordmark .gold { color: var(--gold-400); }
.subtitle { margin-top: 2px; font-size: 10px; line-height: 14px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--steel); }
@media (prefers-color-scheme: dark) { .wordmark { color: #ffffff; } }

.boot-body { max-width: 720px; margin: 0 auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* ── aegis's components (globals.css @layer components), touch-sized ── */
.card {
  margin: 12px 16px;
  border-radius: 12px;                        /* rounded-xl */
  border: 1px solid var(--card-line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.label {                                       /* text-xs font-medium uppercase tracking-wide text-slate-500 */
  margin: 0;
  font-size: 12px; line-height: 16px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.025em;
  color: var(--muted);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 8px 14px;                           /* py-2 px-3.5 */
  border: 1px solid transparent;
  border-radius: 8px;                          /* rounded-lg */
  font: 500 16px/1.25 var(--font);
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold-300); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--primary-bg); color: var(--primary-text); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-gold { background: var(--gold-500); color: var(--ink); }
.btn-gold:hover:not(:disabled) { background: var(--gold-600); }
.btn-secondary { background: var(--secondary-bg); color: var(--secondary-text); border-color: var(--secondary-line); }
.btn-secondary:hover:not(:disabled) { background: var(--secondary-hover); }
.btn-big { min-height: 56px; font-size: 17px; font-weight: 600; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;                           /* px-3 py-2 */
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--input-text);
  font: 16px/1.25 var(--font);
  outline: none;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--gold-400); box-shadow: 0 0 0 2px var(--gold-100); }
@media (prefers-color-scheme: dark) { .input:focus { box-shadow: 0 0 0 2px rgba(189, 143, 42, 0.3); } }

.status {
  margin: 12px 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 17px; font-weight: 600;
}
.status[data-kind="warn"] { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.status[data-kind="final"] { background: var(--final-bg); color: var(--final-text); border-color: var(--final-line); font-size: 19px; }

/* ── the map (public/map.js); each view gives it its size ── */
.map {
  position: relative;
  overflow: hidden;
  background: var(--map-bg);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.map:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-300); }
.map-tiles { position: absolute; inset: 0; }
.map-tile {
  position: absolute; left: 0; top: 0;
  width: 256px; height: 256px;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
}
.map-tile-failed { visibility: hidden; }
/* road routes: a white casing under a line in the unit's colour (the colour is the path's own stroke attribute) */
.map-routes { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: visible; }
.map-route-casing { fill: none; stroke: #ffffff; stroke-opacity: 0.85; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.map-route-line { fill: none; stroke-width: 4; stroke-opacity: 0.95; stroke-linecap: round; stroke-linejoin: round; }
.map-route-casing.map-route-mine { stroke-width: 9; }
.map-route-line.map-route-mine { stroke-width: 5.5; }
/* the vehicle: a dark disc ringed in aegis's gold with a truck on it; a green ring pulses out while it is live */
.map-vehicle {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--gold-400);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.map-vehicle-icon { position: relative; width: 20px; height: 20px; fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-vehicle-pulse { position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--live); opacity: 0; }
.map-vehicle[data-live] .map-vehicle-pulse { animation: vehicle-pulse 2s ease-out infinite; }
@keyframes vehicle-pulse { 0% { transform: scale(1); opacity: 0.85; } 100% { transform: scale(2.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map-vehicle[data-live] .map-vehicle-pulse { animation: none; opacity: 0.7; } }
/* the responder: a live unit as aegis draws one (TripMap's dot: a colour ringed in white), in aegis's blue-600 */
.map-me {
  position: absolute; left: 0; top: 0; z-index: 4;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25), 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.map-acc {
  position: absolute; left: 0; top: 0; z-index: 3;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  border: 1.5px solid rgba(37, 99, 235, 0.5);
  pointer-events: none;
}
/* other response units: small dots in their colour, ringed in white */
.map-units { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.map-unit {
  position: absolute; left: 0; top: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.map-unit[data-faded], .map-unit-tag[data-faded] { opacity: 0.5; }
/* a name chip beside a dot, as aegis labels a tracker on its maps */
.map-tag {
  position: absolute; left: 0; top: 0; z-index: 4;
  padding: 0 4px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.92); color: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  font: 600 11px/18px var(--font); white-space: nowrap;
  pointer-events: none;
}
.map-controls {
  position: absolute; right: 10px; top: 10px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
}
.map-btn {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  background: var(--map-btn-bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  font: 500 15px/1 var(--font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.map-btn:disabled { opacity: 0.45; }
.map-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold-300); }
.map-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.map-layer {
  position: absolute; left: 10px; top: 10px; z-index: 6;
  width: auto; min-width: 96px; padding: 0 14px;
}
.map-fit {
  position: absolute; left: 10px; bottom: 26px; z-index: 6;
  width: auto; padding: 0 16px; font-weight: 600;
}
.map-attribution {
  position: absolute; right: 0; bottom: 0; z-index: 6;
  max-width: 100%;
  padding: 2px 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.82);
  color: #1e293b;
  border-top-left-radius: 6px;
}
.map-attribution a { color: inherit; }

/* ── the vehicle's words ── */
.note { margin: 0 0 10px; font-size: 16px; color: var(--text-2); overflow-wrap: anywhere; white-space: pre-line; }
.coords {
  display: block; width: 100%;
  min-height: 48px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px dashed var(--field-line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 600 18px/1.2 var(--mono);
  text-align: left;
  cursor: pointer;
}
.coords:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold-300); }
.meta { margin: 4px 0; font-size: 15px; color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── shared by the views ── */
.card-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.12); color: #047857;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.live-badge[data-stale] { background: var(--warn-bg); color: var(--warn-text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.live-badge[data-stale] .live-dot { background: #f59e0b; }
@media (prefers-color-scheme: dark) { .live-badge { color: #6ee7b7; } }
.chip {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 999px;
  font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap;
  background: var(--chip-sharing-bg); color: var(--chip-sharing-text);
}
.chip[data-status="enroute"] { background: var(--chip-enroute-bg); color: var(--chip-enroute-text); }
.chip[data-status="arrived"] { background: var(--chip-arrived-bg); color: var(--chip-arrived-text); }
.chip[data-status="stopped"] { background: var(--chip-stopped-bg); color: var(--chip-stopped-text); }
.chip-kind[data-live="1"] { background: rgba(16, 185, 129, 0.14); color: #047857; }
.chip-kind[data-live="0"] { background: var(--chip-stopped-bg); color: var(--chip-stopped-text); }
@media (prefers-color-scheme: dark) { .chip-kind[data-live="1"] { color: #6ee7b7; } }
[data-old] { color: var(--amber) !important; font-weight: 600; }
.rv-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 7;
  max-width: calc(100% - 140px);
  margin: 0; padding: 6px 14px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  font-size: 14px; font-weight: 600; text-align: center;
}

/* dev's red strip sits over the top edge: the headers make room for it */
.dev-strip ~ .boot .top, .dev-strip ~ .rv .rv-top, .dev-strip ~ .op .op-top { padding-top: max(20px, env(safe-area-inset-top)); }

/* ── THE MOBILE RECOVERY VIEW: a full-screen map, a slim header, a bottom sheet ── */
body.rv-on, body.op-on { min-height: 0; }
body.rv-on { overflow: hidden; }
.rv {
  position: fixed; left: 0; right: 0; top: 2px; bottom: 0;   /* under the 2 px gold line */
  display: flex; flex-direction: column;
  background: var(--page);
}
.rv-top {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: max(6px, env(safe-area-inset-top)) 12px 6px;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
}
.rv-emblem { display: block; height: 30px; width: auto; }
.rv-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; font-size: 15px; color: var(--text); }
.rv-top .live-badge { margin-left: auto; }
.rv-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rv-map-wrap { position: relative; flex: 1; min-height: 160px; }
.rv-map { position: absolute; inset: 0; }
.rv-map .map-attribution { bottom: 14px; }
.rv-map .map-fit { bottom: 30px; }
.rv-sheet {
  position: relative; z-index: 8;
  flex: none;
  max-height: 70%;
  overflow-y: auto;
  margin-top: -14px;                         /* over the map's edge, as a sheet sits */
  padding: 0 16px max(14px, env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--sheet-shadow);
}
.rv-grip {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 26px; margin: 0; padding: 0;
  border: 0; background: transparent; cursor: pointer;
}
.rv-grip-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--field-line); }
.rv-grip:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold-300); border-radius: 8px; }
.rv-label { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.rv-note { margin: 2px 0 0; font-size: 15px; }
/* collapsed, the note keeps to two lines: the map is the point of this view */
.rv-sheet[data-collapsed] .rv-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.rv-route { margin: 6px 0 0; font-size: 21px; line-height: 1.25; font-weight: 700; color: var(--text); }
.rv-pos { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.rv-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.rv-me { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.rv-more { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--secondary-line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  min-height: 48px; border: 0; margin: 0;
  background: var(--secondary-bg); color: var(--secondary-text);
  font: 600 16px/1.2 var(--font); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--secondary-line); }
.seg-btn[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-text); }
/* aegis's dark primary is a faint white wash — too faint to say which one you are: the chosen one goes light */
@media (prefers-color-scheme: dark) { .seg-btn[aria-pressed="true"] { background: #e7ebf0; color: var(--ink); } }
.seg-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold-300); }
.rv .actions { margin: 0; }
.rv .meta { margin: 0; font-size: 14px; }

/* the cover: nothing of the vehicle shows until the phone shares its position */
.gate {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
  background: var(--page);
  overflow-y: auto;
}
.gate-card {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 18px;
  border-radius: 12px; border: 1px solid var(--card-line);
  background: var(--card); box-shadow: var(--shadow-sm);
}
.gate-emblem { display: block; height: 44px; width: auto; align-self: flex-start; }
.gate-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--text); }
.gate-text { margin: 0; font-size: 16px; color: var(--text-2); }

/* ── THE DESKTOP OPERATOR VIEW: aegis's top bar, a large map, a panel of everyone ── */
.op { display: flex; flex-direction: column; min-height: calc(100vh - 2px); }
.op-top {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 24px;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
}
.op-top .emblem { height: 36px; }
.op-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.op-left { font-size: 14px; color: var(--muted); white-space: nowrap; }
.op-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
  height: calc(100vh - 62px);
}
.op-map-wrap { position: relative; min-height: 0; }
.op-map { position: absolute; inset: 0; }
.op-panel { overflow-y: auto; border-left: 1px solid var(--card-line); background: var(--page); padding: 4px 0 16px; }
.op-card { padding: 14px 16px; }
.op-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.op-label { margin: 0 0 4px; font-size: 20px; line-height: 1.25; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.op-pos { margin: 4px 0; font-size: 14px; color: var(--muted); }
.op-card .coords { font-size: 15px; min-height: 40px; padding: 8px 10px; }
.op-card .meta { font-size: 13px; }
.op-empty { margin: 4px 0; font-size: 15px; color: var(--muted); }
.op-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.op-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 10px 0; border-top: 1px solid var(--card-line);
}
.op-row:first-child { border-top: 0; }
.op-row[data-status="stopped"] { opacity: 0.7; }
.op-swatch { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--card-line); }
.op-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.op-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.op-unit { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.op-unit-name { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.op-road { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.op-line { margin: 0; font-size: 13px; color: var(--muted); }
.op-age[data-age="amber"] { color: var(--amber); font-weight: 600; }
.op-age[data-age="red"] { color: var(--red); font-weight: 700; }
.op-show { align-self: center; }
/* narrow screens: the panel under the map */
@media (max-width: 900px) {
  .op-body { display: flex; flex-direction: column; height: auto; }
  .op-map-wrap { height: 60vh; min-height: 320px; flex: none; }
  .op-panel { border-left: 0; overflow: visible; }
  .op-top { padding: 8px 16px; flex-wrap: wrap; }
}

/* the copy fallback's textarea: in the document, never seen */
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

@media (min-width: 720px) {
  .top { padding-left: 24px; padding-right: 24px; }      /* px-6, as aegis's header */
}
