/* The shell's stylesheet.
 *
 * Palette carried over from the three tools so the merged app does not look
 * like a fourth thing: same background, same muted grey, same blue.
 *
 * Each tool's own view keeps its own styles, appended below this file's blocks
 * when it is migrated in -- so a change here cannot silently reflow the map. */

:root {
  /* Deeper and cooler than the old near-grey, so the gold has something to sit
     on. The three surface steps are deliberately close together -- a panel that
     announces itself with contrast fights the data it is holding. */
  --bg: #090d13;
  --panel: #111823;
  --panel-2: #18202c;
  --panel-3: #1e2835;
  --line: #222d3d;
  --line-soft: #1a2432;
  --text: #e9edf4;
  --muted: #8c99ac;
  --faint: #5d6a7d;

  /* Gold. The identity colour, used for exactly three things: what is SELECTED,
     what is PRIVILEGED, and the brand itself. Spending it on anything else is
     what turns an accent into wallpaper. */
  --accent: #e0b44c;
  --accent-soft: rgba(224, 180, 76, .14);
  --accent-line: rgba(224, 180, 76, .34);
  --accent-ink: #1a1403;

  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --info: #5b9dff;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* One shadow, used everywhere something floats. Several slightly different
     shadows is the fastest way to make a dark UI look assembled rather than
     designed. */
  --shadow: 0 14px 34px rgba(0, 0, 0, .5);

  /* Map marker colours, separate from the UI's semantic ones so a colour mode
     can change what the DATA looks like without restyling every button. This
     separation is also why the gold above could be swapped in at all: none of
     it reaches the map. */
  --unit: #5b9dff;
  --civ: #4ade80;
  --down: #f87171;
}

/* Colour-blind safe: Okabe-Ito. Blue and yellow stay distinct under every
   common deficiency, where the default blue/green pair is weaker. */
body[data-palette="cb"] {
  --unit: #56b4e9;
  --civ: #f0e442;
  --down: #cc79a7;
}

/* Lightness only, for full colour blindness or a mono printout. */
body[data-palette="mono"] {
  --unit: #ffffff;
  --civ: #8a919c;
  --down: #4a4f57;
}

/* Screen-reader-only label text. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.palette select {
  padding: .3rem .4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}

* { box-sizing: border-box; }

/* The `hidden` attribute has to WIN, and this is not a nicety.
 *
 * `[hidden] { display: none }` comes from the browser's own stylesheet, which
 * loses to any author rule that sets display -- and .gate, .shell, .view and
 * .panel all do. So `node.hidden = true` from JS had no visible effect: the
 * login card and the app rendered at the same time, one under the other, and it
 * looked exactly like being stuck on the login page. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

code {
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

/* -- Buttons -------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #06101f; font-weight: 600; }
.button.ghost { background: transparent; }

/* -- The gate ------------------------------------------------------------- */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.gate-card {
  max-width: 26rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
}
.gate-card h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
.gate-card p { margin: 0 0 1.5rem; }

/* -- Shell ---------------------------------------------------------------- */
.shell { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: 0 0 auto;
}

.brand { font-weight: 700; letter-spacing: .02em; }
.brand span { color: var(--accent); }

.tabs { display: flex; gap: .25rem; flex: 1 1 auto; }

.tab {
  padding: .4rem .85rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active { color: var(--text); background: var(--panel-2); border-color: var(--line); }

.who { display: flex; align-items: center; gap: .55rem; }
.who img { border-radius: 50%; }

.badge {
  padding: .15rem .5rem;
  border: 1px solid var(--warn);
  border-radius: 999px;
  color: var(--warn);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* -- Views ---------------------------------------------------------------- */
.views { flex: 1 1 auto; min-height: 0; position: relative; }
.view { height: 100%; overflow: auto; }

.placeholder { display: grid; place-items: center; height: 100%; text-align: center; }
.placeholder h2 { margin: 0 0 .35rem; }

/* -- The panel ------------------------------------------------------------ */
.view-panel { padding: 1.25rem; max-width: 72rem; margin: 0 auto; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-head h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.panel-head p { margin: 0; }
.panel-head-actions { display: flex; gap: .4rem; flex: 0 0 auto; }

.notice {
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 1rem;
}
.notice.protected { border-left-color: var(--warn); }
.notice.warn { border-left-color: var(--bad); }
.notice strong { color: var(--warn); }

.grid-wrap { overflow-x: auto; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td {
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.grid thead th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.grid tr.group th {
  padding-top: 1.4rem;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom-color: var(--accent);
}

.cap { width: 34%; }
.cap-label { font-weight: 600; }
.cap-key { display: block; margin: .1rem 0; }
.cap-help, .cap-implies { color: var(--muted); font-size: 12px; }
.cap-implies { color: var(--warn); margin-top: .2rem; }

.roles { width: 48%; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 .35rem .35rem 0;
  padding: .2rem .25rem .2rem .55rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 13px;
}
.chip-x {
  border: 0;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.chip-x:hover { background: var(--bad); color: #1a0505; }

.add select {
  width: 100%;
  padding: .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.audit { margin-top: 2rem; }
.audit h3 { margin: 0 0 .25rem; font-size: 1rem; }
.audit p { margin: 0 0 .75rem; }
.audit .when { white-space: nowrap; color: var(--muted); }

/* -- The Map view --------------------------------------------------------- */
/* The map fills the view and the controls float over it, because a bar that
   takes height away from the map costs the thing people came for. */
.view-map { position: relative; overflow: hidden; }
.map-canvas { position: absolute; inset: 0; background: #0b0e12; }

/* Leaflet, rethemed dark.
 *
 * Its stylesheet is loaded BEFORE this one (see index.html) so these rules win
 * on order rather than on specificity. Everything below is a Leaflet class, not
 * one of ours -- the library ships a light theme and there is no option for a
 * dark one.
 *
 * The container background is the one that shows: the island does not fill the
 * viewport, so Leaflet's #ddd was the large bright surround. */
.leaflet-container {
  background: #0b0e12;
  font: inherit;
  outline-offset: 0;
}

/* Zoom and layer buttons: white squares with a grey border by default. */
.leaflet-bar,
.leaflet-control-layers {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 .3rem .8rem rgba(0, 0, 0, .4);
  background: var(--panel);
}
.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--panel);
  border-bottom-color: var(--line);
  color: var(--text);
}
.leaflet-bar a:hover { background: var(--panel-2); color: var(--accent); }
/* Leaflet greys the button out at the zoom limits; its default is near-white. */
.leaflet-bar a.leaflet-disabled {
  background: var(--panel);
  color: #4a5361;
}

.leaflet-control-layers-toggle { filter: invert(1) hue-rotate(180deg) brightness(1.2); }
.leaflet-control-layers-expanded {
  padding: .5rem .7rem;
  background: var(--panel);
  color: var(--text);
}
.leaflet-control-layers-separator { border-top-color: var(--line); }

.leaflet-control-attribution {
  background: rgba(15, 18, 22, .8);
  color: var(--muted);
  font-size: 11px;
}
.leaflet-control-attribution a { color: var(--accent); }

/* The 3D scene shares the map's box. Stacked rather than swapped so Leaflet
   keeps its pan and zoom while hidden -- rebuilding it on every toggle would
   drop the view back to the whole island each time. */
.map3d { z-index: 1; }
.map3d-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.map3d-canvas:active { cursor: grabbing; }

/* Why the 3D view looks like it does.
 *
 * A model that will not load and a tile host without CORS both produce the
 * same thing -- an empty grey plane -- and neither says anything a user would
 * see. This does. Positioned low so it does not fight the control bar. */
.map3d-status {
  position: absolute;
  left: .6rem;
  right: .6rem;
  bottom: .6rem;
  z-index: 5;
  max-width: 44rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(15, 18, 22, .92);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}
.map3d-status.warn { border-left-color: var(--warn); color: var(--text); }

/* Screen capture, in the moderation panel. */
.shot-row { margin: .6rem 0 .3rem; }
.shot-holder { margin-top: .5rem; }
.shot-holder img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.shot-holder a { margin-top: .4rem; }

.map-bar {
  position: absolute;
  top: .6rem;
  left: .6rem;
  right: .6rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 26, 33, .92);
  backdrop-filter: blur(4px);
}

.switch { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.switch-label { color: var(--muted); font-size: 13px; }

.button.alerting { border-color: var(--warn); color: var(--warn); }
.button.small { padding: .2rem .5rem; font-size: 12px; }
.button.danger { border-color: var(--bad); color: var(--bad); }
.button.danger:hover { background: var(--bad); color: #1a0505; }

.legend {
  position: absolute;
  left: .6rem;
  bottom: .6rem;
  z-index: 500;
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 26, 33, .92);
  font-size: 12px;
}
.swatch { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; }
.swatch.emergency { background: var(--unit); }
.swatch.civilian { background: var(--civ); }

/* A floating panel, used for the movement log, the ban list and the
   kick/ban form. One panel reused rather than three, because only one is ever
   open and three would be three things to keep hidden. */
.panel {
  position: absolute;
  top: 3.6rem;
  right: .6rem;
  z-index: 600;
  width: min(24rem, calc(100% - 1.2rem));
  max-height: calc(100% - 4.6rem);
  overflow: auto;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 26, 33, .97);
}
.panel .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.panel-note { margin: 0 0 .6rem; font-size: 12px; }
.panel textarea, .panel select {
  width: 100%;
  padding: .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.panel .field { display: block; margin: .6rem 0; }
.panel .field span { display: block; margin-bottom: .2rem; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .6rem; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.alerts li:last-child { border-bottom: 0; }

/* Markers. The whole box is rotated to the heading, so everything inside is
   drawn nose-up. */
/* Marker tooltips.
 *
 * Leaflet ships a white box with a dark border, which is the wrong way round
 * here and was also being fought by its own `white-space: nowrap`. The previous
 * attempt set `white-space: normal` on the lines to get line breaks, and that
 * is what produced the tall thin column: with nothing setting a width, normal
 * wrapping breaks at the narrowest opportunity -- every word onto its own line.
 *
 * Lines stay nowrap; the container takes the width of its longest line and is
 * capped, and only the one line that can be long -- the diagnostic -- is
 * allowed to wrap. */
.leaflet-tooltip.map-tip-wrap {
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .45);
  font: inherit;
  white-space: nowrap;
}
/* The little arrow, which Leaflet colours from its own palette. */
.leaflet-tooltip.map-tip-wrap.leaflet-tooltip-top::before { border-top-color: var(--line); }
.leaflet-tooltip.map-tip-wrap.leaflet-tooltip-bottom::before { border-bottom-color: var(--line); }

.map-tip { max-width: 24rem; }
.map-tip > div { white-space: nowrap; }

.tip-name { font-weight: 600; line-height: 1.35; }
.tip-sub { color: var(--muted); font-size: 12px; line-height: 1.35; }
.tip-dept {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.5;
}
.tip-down { color: var(--bad); font-size: 11px; font-weight: 700; letter-spacing: .05em; }

/* The only line allowed to wrap: it is a sentence, not a label, and it is the
   one thing somebody needs to be able to read in full. */
.tip-warn {
  white-space: normal;
  max-width: 24rem;
  margin-top: .25rem;
  color: var(--warn);
  font-size: 12px;
  line-height: 1.4;
}

/* Grouped markers: a short roster, each in its department's colour. */
.tip-member { font-size: 13px; line-height: 1.4; }
.tip-hint {
  margin-top: .3rem;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.player-marker {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  transform-origin: 50% 50%;
}
.player-marker .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--civ);
  /* A hard black ring rather than a soft shadow. The map underneath runs from
     near-white desert to near-black water, and a coloured dot on either extreme
     is either invisible or a smudge -- an opaque outline is the only thing that
     reads at every point on the map. */
  border: 1.5px solid #000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
}
.player-marker.emergency .dot { background: var(--unit); }

/* The heading cone, so a stationary ped still shows which way it is facing. */
.player-marker .cone {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid var(--civ);
  opacity: .85;
  /* A border cannot outline a CSS triangle -- it IS borders -- so the outline
     is a drop-shadow in four directions instead. */
  filter: drop-shadow(0 -1px 0 #000) drop-shadow(1px 0 0 #000)
          drop-shadow(-1px 0 0 #000);
}
.player-marker.emergency .cone { border-bottom-color: var(--unit); }

.player-marker svg {
  width: 22px;
  height: 22px;
  fill: var(--civ);
  /* Same job as the dot's border: a vehicle glyph over pale ground vanishes
     without it. paint-order lets the stroke sit behind the fill so it thickens
     the silhouette outwards rather than eating into the shape. */
  stroke: #000;
  stroke-width: 1.4;
  paint-order: stroke fill;
  stroke-linejoin: round;
}
.player-marker.emergency svg { fill: var(--unit); }
.player-marker svg .glass { fill: rgba(0, 0, 0, .45); stroke: none; }
.player-marker svg .rotor { stroke: currentColor; stroke-width: 1.4; fill: none; opacity: .5; }

/* A department's own colour, set as --dept from config.json. It beats the
   generic emergency/civilian pair, and is deliberately NOT applied to the dead
   -- "down" has to stay one colour whoever it is. */
.player-marker.has-dept .dot { background: var(--dept); }
.player-marker.has-dept .cone { border-bottom-color: var(--dept); }
.player-marker.has-dept svg { fill: var(--dept); }

.player-marker.dead { opacity: .45; }
.player-marker.dead .dot,
.player-marker.dead.has-dept .dot { background: var(--down); }
.player-marker.dead svg,
.player-marker.dead.has-dept svg { fill: var(--down); }

/* -- Stacked players ------------------------------------------------------ */
/* One badge standing in for everybody at the same spot. Round and numbered so
   it cannot be mistaken for a player marker, which is the whole point: a "4"
   should not look like a fourth person. */
.player-group {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #000;
  background: var(--unit);
  color: #06101f;
  font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
/* Coloured by the department when the whole stack shares one; mixed groups keep
   the neutral colour rather than picking an arbitrary member's. */
.player-group.has-dept { background: var(--dept); }
.player-group:hover { transform: scale(1.1); }

/* -- The History view ----------------------------------------------------- */
/* Two columns: the search on the left stays put while the detail on the right
   scrolls, because scrolling a long connection history should not take the
   search box off the screen. */
/* Positioned, because the trail panel below is absolute within it. */
.view-history { position: relative; display: grid; grid-template-columns: 22rem 1fr; height: 100%; overflow: hidden; }
@media (max-width: 60rem) { .view-history { grid-template-columns: 1fr; } }

.history-left {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.history-left input[type="search"] {
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.pane-note { margin: 0; font-size: 12px; }

.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.result { cursor: pointer; }
.result:hover .result-name { color: var(--accent); }
.result-name { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.live-dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .18);
}

.history-right { padding: 1rem 1.25rem; overflow: auto; }
.empty { display: grid; place-items: center; height: 100%; text-align: center; }

.detail-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: 1.2rem; }

.facts { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .75rem 0 1.25rem; }
.fact span { display: block; }

.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 {
  margin: 0 0 .4rem;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}
.row { padding: .25rem 0; }
/* Character rows only. `.row` is also the identifiers list and the clickable
   `.row.link` buttons, and turning all of those into flex containers changes
   layouts that were fine. */
.char-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.char-row.online .char-name { color: var(--good); }
.row.link {
  border: 0; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; padding: .25rem 0;
}
.row.link:hover { color: var(--accent); }

.day { border-bottom: 1px solid var(--line); }
.day-head {
  width: 100%;
  padding: .5rem 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.day-head::before { content: '▸ '; color: var(--muted); }
.day-head.open::before { content: '▾ '; }
.day-body { padding: 0 0 .6rem 1rem; }

.session { padding: .4rem 0; border-top: 1px dashed var(--line); }
.stint {
  display: flex; align-items: center; gap: .5rem;
  padding: .2rem 0 .2rem .8rem;
  color: var(--muted);
  font-size: 13px;
}

/* The trail sits over the detail column rather than replacing it, so closing it
   comes back to where you were in the history. */
.trail {
  position: absolute;
  inset: 1rem;
  z-index: 700;
  display: flex;
  flex-direction: column;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 26, 33, .98);
}
.trail-map { flex: 1 1 auto; min-height: 20rem; border-radius: var(--radius); background: #0b0e12; }

/* Distance / on patrol / moving / top speed / in a vehicle / samples. All of it
   derived from the speed and timestamp on each fix. */
.trail-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0 0 .6rem;
}
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.05rem; font-weight: 600; }

.speed-legend {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: .5rem;
  font-size: 12px;
}
.speed-key { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.speed-key i { width: 1rem; border-radius: 2px; }

/* -- The scrubber --------------------------------------------------------- */
.scrub {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .5rem;
  flex: 0 0 auto;
}
.scrub-range { flex: 1 1 auto; accent-color: var(--accent); }
.scrub-readout { min-width: 16rem; text-align: right; font-size: 13px; color: var(--muted); }
.scrub-readout strong { color: var(--text); }
.readout-call { font-weight: 600; }

/* The playback cursor. A ring rather than a filled dot so the track's own
   colour stays visible underneath it. */
.cursor {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .7), 0 0 8px rgba(255, 255, 255, .5);
}

/* -- The Logs view -------------------------------------------------------- */
.view-logs { display: flex; flex-direction: column; padding: 1rem; gap: .5rem; }

.logs-filters {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.logs-filters select,
.logs-filters input[type="search"],
.logs-filters input[type="date"] {
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.logs-filters input[type="search"] { min-width: 16rem; flex: 1 1 12rem; }
.dates { display: inline-flex; align-items: center; gap: .35rem; }

.chips { display: inline-flex; gap: .3rem; }
.chip {
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
/* Off is the state that has to look off. A chip that only differs by a shade
   reads as "on but dim", and people click it twice. */
.chip.on { color: var(--text); background: var(--panel-2); }
.chip.risk-high.on { border-color: var(--bad); color: var(--bad); }
.chip.risk-medium.on { border-color: var(--warn); color: var(--warn); }
.chip.risk-low.on { border-color: var(--line); color: var(--muted); }

/* The log-type filter: a button that opens a searchable checkbox list. */
.typefilter { position: relative; display: inline-block; }
.typefilter-button { min-width: 9rem; text-align: left; }
/* A filter that is doing something has to look like it, or a page showing one
   type of row reads as a page with only one type of row in it. */
.typefilter-button.on { border-color: var(--accent); color: var(--accent); }

.typefilter-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + .3rem);
  left: 0;
  width: 22rem;
  max-width: 80vw;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .45);
}
.typefilter-panel input[type="search"] {
  width: 100%;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.typefilter-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: .45rem 0 .3rem;
}

/* Capped and scrolled: the list can be hundreds long, and a panel taller than
   the window puts its own search box off screen. */
.typefilter-list { max-height: 18rem; overflow: auto; }

.typefilter-group {
  margin: .5rem 0 .2rem;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.typefilter-group.risk-high { color: var(--bad); }
.typefilter-group.risk-medium { color: var(--warn); }

.typefilter-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .3rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.typefilter-option:hover { background: var(--panel-2); }
/* The count is pushed to the right so the names stay in one column and can be
   read down; ragged counts against ragged names is unscannable. */
.typefilter-option code { flex: 1 1 auto; overflow-wrap: anywhere; }

.note { margin: 0; font-size: 12px; }

.table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }

.data { width: 100%; border-collapse: collapse; }
.data th, .data td {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }

.data td.risk { text-transform: capitalize; font-weight: 600; }
.data td.risk-high { color: var(--bad); }
.data td.risk-medium { color: var(--warn); }
.data td.risk-low { color: var(--muted); }

.empty { padding: 2rem; text-align: center; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  flex: 0 0 auto;
  padding-top: .25rem;
}

/* -- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  padding: .6rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }

/* ============================================================== chat log */

/* Shares the action log's furniture rather than a parallel set of classes:
   the filter row, the table and the empty state are the same idea and looking
   different would be a bug, not a feature. */
.view-chat { display: flex; flex-direction: column; padding: 1rem; gap: .5rem; }

.chat-filters {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.chat-filters .field { display: block; }
.chat-filters .field > span {
  display: block;
  margin-bottom: .2rem;
  color: var(--muted);
  font-size: 12px;
}
.chat-filters select,
.chat-filters input[type="search"],
.chat-filters input[type="date"] {
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.chat-filters input[type="search"] { min-width: 18rem; flex: 1 1 14rem; }
.chat-filters .check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  padding-bottom: .45rem;
}

.more { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }

/* One badge per channel. Neutral by default and coloured only for the ones
   worth spotting in a wall of speech -- colouring all thirteen would mean none
   of them stands out. */
.data .tag {
  display: inline-block;
  padding: .1rem .45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data .kind-911 { border-color: var(--bad); color: var(--bad); }
.data .kind-ad { border-color: #c9821b; color: #e0a94e; }
.data .kind-med { border-color: #1e6fd9; color: #7fb4ff; }
.data .kind-radio { border-color: #17a673; color: #6bd6ac; }
.data .kind-ooc,
.data .kind-looc,
.data .kind-gooc,
.data .kind-cmd { border-style: dashed; }

.data td.said { white-space: pre-wrap; word-break: break-word; }
.data td.who .name { font-weight: 600; }
.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data td.flag { color: var(--bad); font-weight: 600; }

/* A flagged row is the one somebody opened this page to find. */
.data tr.flagged td { background: rgba(214, 58, 58, .09); }
.data tr.flagged td:first-child { box-shadow: inset 2px 0 0 var(--bad); }

/* ------------------------------------------------------- chat flag settings */

/* In the Admin tab, but its own capability -- so it can be the only thing on
   that tab for somebody who holds chat.flags and nothing else. */
.flags {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.flags h3 { margin: 0 0 .3rem; }
.flags .field { display: block; margin: .8rem 0; }
.flags .field > span {
  display: block;
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: 12px;
}
.flags textarea,
.flags input[type="url"] {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.flags textarea { resize: vertical; min-height: 4.5rem; }
.flags .hint {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.flags-actions { display: flex; align-items: center; gap: .7rem; }

/* The Chat tab holds two lists -- what characters said, and which accounts were
   connected. Chips rather than a second tab: they share every filter but one. */
.chat-modes { display: flex; gap: .4rem; flex: 0 0 auto; }

.data .kind-join { border-color: var(--good, #4fd48a); color: #7fe0aa; }
.data .kind-leave { border-color: #e05c5c; color: #f09a9a; }
.data tr.joined td:first-child { box-shadow: inset 2px 0 0 var(--good, #4fd48a); }
.data tr.parted td:first-child { box-shadow: inset 2px 0 0 #e05c5c; }

/* ==========================================================================
 * REFRESH
 * ==========================================================================
 * Appended rather than merged into the blocks above, and that is deliberate.
 *
 * Every selector here has the same specificity as the one it replaces, so it
 * wins on ORDER alone. That means nothing above had to be hunted down and
 * edited, no `!important` was needed, and deleting this one block returns the
 * app to exactly how it looked before -- which is the property that makes a
 * restyle safe to try on a running panel.
 *
 * Three rules it follows:
 *
 *   1. GOLD IS SCARCE. It marks what is selected, what is privileged, and the
 *      brand. Nothing else. An accent spent everywhere stops being one.
 *   2. SURFACES ARE CLOSE TOGETHER. A panel that announces itself with contrast
 *      competes with the data it holds.
 *   3. NOTHING CHANGES SHAPE ON HOVER. Borders and backgrounds shift; padding,
 *      size and position do not, because a table of 50 rows that nudges under
 *      the cursor is unreadable.
 * ========================================================================== */

/* -- Page ----------------------------------------------------------------- */
/* Two very wide, very dim gold washes in opposite corners. The reference has a
   warmth at the edges that a flat fill does not; this is that, at an opacity
   where it reads as depth rather than as colour.

   `fixed` so it does not scroll with a view, and it is on BODY rather than an
   extra element so no markup had to change. */
body {
  background:
    radial-gradient(900px 620px at 100% -8%,  rgba(224, 180, 76, .055), transparent 60%),
    radial-gradient(760px 520px at -6% 108%, rgba(224, 180, 76, .04),  transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

/* Scrollbars, which are otherwise the one bright element on a dark page in
   Chromium. Kept visible rather than hidden: a list that scrolls with no sign
   that it does is a list people think is complete. */
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--panel-3);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: #2b3747; background-clip: padding-box; }

/* One focus ring for the whole app, on keyboard focus only. :focus-visible
   rather than :focus so clicking a button does not leave a ring behind it. */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* -- Top bar -------------------------------------------------------------- */
.topbar {
  gap: 1.25rem;
  padding: .6rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  /* Translucent over the page wash, so the gold at the top right carries
     through the bar instead of stopping at it. */
  background: rgba(17, 24, 35, .82);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  letter-spacing: .01em;
  flex: 0 0 auto;
}
.brand-mark { width: 22px; height: 22px; color: var(--accent); flex: 0 0 auto; }

/* The wordmark is now a span INSIDE .brand, so the original `.brand span` rule
   matches the wrapper as well as the "Ops" within it and turns the whole name
   gold.

   Order alone does not fix it: `.brand span` is (0,1,1) and a bare
   `.brand-text` is (0,1,0), so the old rule wins wherever it sits. These are
   written at (0,2,0) and (0,2,1) to outrank it rather than by deleting a rule
   further up -- keeping this block removable is worth one extra class in a
   selector. */
.brand .brand-text { font-size: 15px; color: var(--text); }
.brand .brand-text > span { color: var(--accent); }

/* -- Tabs ----------------------------------------------------------------- */
/* A pill group rather than loose buttons: the tabs are one control, and a
   container says so without a separator between each pair. */
.tabs {
  gap: .2rem;
  padding: .22rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line-soft);
  /* Sized to its tabs rather than stretched across the bar -- a pill group
     that spans the whole width stops reading as a group. `margin-right: auto`
     is what keeps the user chip pinned right without the tabs growing, which
     is the job the old `flex: 1 1 auto` was doing badly. */
  align-self: center;
  width: fit-content;
  flex: 0 0 auto;
  margin-right: auto;
}

.tab {
  padding: .38rem .95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  transition: color .14s, background-color .14s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .045); }

/* The one place a filled gold block appears. It is the answer to "where am I",
   which is the only question worth spending the accent on. */
.tab.active,
.tab.active:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 1px 10px rgba(224, 180, 76, .22);
}

/* -- Who ------------------------------------------------------------------ */
/* Scoped to the top bar. `.who` is ALSO the actor column in the logs table --
   `<td class="who">` -- and an unscoped rule here reached into every row of it.
   Nothing visible broke, because `flex` means nothing on a table cell, but it
   is the kind of overlap that bites the moment either side gains a property. */
.topbar .who { gap: .6rem; flex: 0 0 auto; }

.topbar .who img {
  border-radius: 50%;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  object-fit: cover;
}

#who-name { font-size: 13.5px; font-weight: 550; }

/* Privilege, not decoration -- the second of gold's three jobs. */
.badge {
  padding: .22rem .6rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}

.palette select {
  padding: .35rem 1.6rem .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  /* The native arrow is a different grey in every browser, so it is replaced
     with one drawn here. */
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%),
                    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.palette select:hover { color: var(--text); border-color: var(--line); }

/* -- Buttons -------------------------------------------------------------- */
.button {
  padding: .44rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .14s, border-color .14s, color .14s;
}
.button:hover { background: var(--panel-3); border-color: #2f3c4e; }
.button.ghost { background: transparent; }
.button.ghost:hover { background: var(--panel-2); }

.button.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 650;
}
.button.primary:hover { background: #ecc263; border-color: transparent; }

.button:disabled, .button[disabled] {
  opacity: .4;
  cursor: not-allowed;
  background: var(--panel-2);
  border-color: var(--line-soft);
}

/* -- Cards and surfaces --------------------------------------------------- */
/* The hairline is a translucent white rather than a solid colour, so it reads
   as an edge catching light instead of as a drawn box -- the difference
   between the reference's panels and a wireframe. */
.panel,
.gate-card,
.notice,
.flags,
.audit,
.grid-wrap,
.table-wrap,
.facts .fact,
.detail-section,
.results,
.legend,
.map-bar,
.typefilter-panel,
.shot-holder {
  border-color: rgba(255, 255, 255, .07);
}

.gate-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.gate-card h1 { letter-spacing: .01em; }

.notice {
  border-radius: var(--radius);
  background: var(--panel);
}
.notice.protected { border-left-color: var(--accent); }
.notice strong { color: var(--accent); }

/* -- Section headings ----------------------------------------------------- */
/* Micro-caps in gold. The third of its three jobs is structure: these are what
   tell you a new section started without a rule across the page. */
.detail-section h3 {
  font-size: 11px;
  letter-spacing: .09em;
  color: var(--accent);
  font-weight: 700;
}

/* -- Stat cards ----------------------------------------------------------- */
/* Was a flex row of bare label/value pairs. The reference reads them as cards,
   and it is right to: these are four separate facts, and spacing alone leaves
   it ambiguous which value belongs to which label at a glance. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: .6rem;
  margin: .9rem 0 1.4rem;
}

.facts .fact {
  padding: .7rem .85rem;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  background: var(--panel);
}
.facts .fact .small,
.facts .fact .muted {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 650;
  color: var(--faint);
}
.facts .fact > div {
  margin-top: .3rem;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* -- Tables --------------------------------------------------------------- */
.data, .grid { border-collapse: separate; border-spacing: 0; }

.data th, .grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: left;
  white-space: nowrap;
}

.data td, .grid td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

/* Hover is background only. A row that gains a border nudges every row under
   it, which in a 50-row table reads as the page twitching. */
.data tbody tr, .grid tbody tr { transition: background-color .1s; }
.data tbody tr:hover, .grid tbody tr:hover { background: rgba(255, 255, 255, .028); }
.data tbody tr:last-child td, .grid tbody tr:last-child td { border-bottom: 0; }

.data td.when, .data td.nowrap { color: var(--muted); font-variant-numeric: tabular-nums; }
.data td.num { font-variant-numeric: tabular-nums; }

/* Identifiers, licences, action paths. Monospace so a character that differs by
   one glyph is visibly different, which is the entire reason they are shown. */
code, .data td code, .mono {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  padding: .1rem .35rem;
  border-radius: 5px;
}

/* -- Risk ----------------------------------------------------------------- */
/* Was a coloured word. Low in grey next to Medium in amber relies on reading
   the text to find the colour, which is backwards -- the colour is supposed to
   be what you read first. Filled pills give each tier a shape as well as a hue,
   so the column scans without being read. */
/* The colour on the CELL is cancelled -- it is carried by the pill inside now,
   and leaving both set means the two disagree the first time one is changed. */
.data td.risk-low,
.data td.risk-medium,
.data td.risk-high { color: inherit; }

.data td.risk { white-space: nowrap; }

.risk-pill {
  display: inline-block;
  min-width: 4.2rem;
  padding: .2rem .55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-align: center;
}

.risk-low .risk-pill {
  color: #9fb0c6;
  background: rgba(159, 176, 198, .12);
  border-color: rgba(159, 176, 198, .22);
}
.risk-medium .risk-pill {
  color: var(--warn);
  background: rgba(251, 191, 36, .13);
  border-color: rgba(251, 191, 36, .28);
}
.risk-high .risk-pill {
  color: var(--bad);
  background: rgba(248, 113, 113, .14);
  border-color: rgba(248, 113, 113, .32);
}

/* The filter chips above the table use the same three tiers, so they use the
   same three colours -- a Medium chip and a Medium row that do not match is a
   small thing that makes a table feel untrustworthy. */
.chip.risk-low.on { color: #9fb0c6; background: rgba(159, 176, 198, .14); border-color: rgba(159, 176, 198, .3); }
.chip.risk-medium.on { color: var(--warn); background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .34); }
.chip.risk-high.on { color: var(--bad); background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .38); }

/* -- Chips and filters ---------------------------------------------------- */
.chip {
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color .14s, border-color .14s, color .14s;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--accent-ink); background: var(--accent); border-color: transparent; }

/* -- Inputs --------------------------------------------------------------- */
input[type="text"], input[type="search"], input[type="url"], input[type="date"],
select, textarea, .field input, .field textarea {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color .14s, background-color .14s;
}
input:hover, select:hover, textarea:hover { border-color: #2f3c4e; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--panel-2);
}
::placeholder { color: var(--faint); }

/* The native date picker icon is near-black on a dark field, so it is inverted
   into something visible. */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(.65);
  cursor: pointer;
}

/* -- Result list ---------------------------------------------------------- */
.result {
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color .14s, border-color .14s;
}
.result:hover { background: rgba(255, 255, 255, .04); }
.result.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
/* No .result-name rule here: it already sets display, gap and weight above, and
   :hover already turns it gold -- which the new palette inherits for free. */

/* -- Pager ---------------------------------------------------------------- */
.pager { gap: .4rem; padding: .6rem 0 .2rem; }
.pager .button { min-width: 2.1rem; justify-content: center; padding: .35rem .6rem; }

/* -- Live dot ------------------------------------------------------------- */
/* Breathing rather than blinking. A hard on/off in the corner of the eye reads
   as an error indicator; this reads as a heartbeat. */
.live-dot { box-shadow: 0 0 0 0 rgba(74, 222, 128, .5); animation: pulse-dot 2.2s infinite; }
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  * { transition: none !important; }
}

/* -- Toast ---------------------------------------------------------------- */
.toast {
  border-radius: var(--radius);
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, .09);
  box-shadow: var(--shadow);
}

/* -- Map ------------------------------------------------------------------ */
.map-bar, .legend, .typefilter-panel, .shot-holder {
  border-radius: var(--radius);
  background: rgba(17, 24, 35, .92);
  backdrop-filter: blur(8px);
}

/* The 2D/3D pair reads as one control rather than two buttons. */
.switch { gap: .4rem; }

/* -- Narrow --------------------------------------------------------------- */
/* The bar is three things competing for one line. Below this the tab group
   wraps to its own row rather than the brand and the user chip being squeezed
   to nothing. */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: .6rem .9rem; }
  .tabs { order: 3; width: 100%; margin-right: 0; justify-content: space-between; }
  .tab { flex: 1 1 auto; text-align: center; }
  .who { margin-left: auto; }
  #who-name { display: none; }
}

