/* /radar: light by default (a model on paper), dark with ?theme=dark */
:root {
  --bg: #f6f6f4; --bg-2: #ffffff; --paper: #ffffff; --ink: #15171a; --muted: #6b7684;
  --line: rgba(21, 23, 26, 0.12); --accent: #ff6a13; --accent-soft: rgba(255, 106, 19, 0.14);
  --stage: #f1f1ee; --chip: rgba(255, 255, 255, 0.9); --shadow: 0 10px 30px rgba(21, 23, 26, 0.14);
}
:root[data-theme="dark"] {
  --bg: #120f0d; --bg-2: #2a2320; --paper: #1d1917; --ink: #f4efe8; --muted: #a39a90;
  --line: rgba(255, 255, 255, 0.12); --accent: #ff8a3d; --accent-soft: rgba(255, 138, 61, 0.16);
  --stage: #0b0a09; --chip: rgba(18, 15, 13, 0.82); --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
html { scroll-behavior: smooth; }
a { color: var(--accent); }
button, select, input, textarea { font-family: inherit; font-size: 13px; color: var(--ink); }
.rd { display: flex; flex-direction: column; min-height: 100dvh; }

.rd-top { display: flex; align-items: center; gap: 16px; padding: 14px 20px 10px; flex-wrap: wrap; }
.rd-brand { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 2px rgba(255, 106, 19, 0.45); }
.rd-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.rd-modes { display: flex; gap: 6px; }
.rd-mode, .rd-ghost { background: var(--paper); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.rd-mode.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rd-filters { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.rd-filters select, .rd-search input { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; outline: none; }
.rd-search input { width: 190px; }
.rd-search input:focus { border-color: var(--accent); }
.rd-more { background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.rd-more:hover { filter: brightness(0.95); }

.rd-stage { position: relative; height: min(68dvh, 760px); min-height: 420px; margin: 0 20px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--stage); }
#map { position: absolute; inset: 0; z-index: 0; }
.rd-counter, .rd-legend, .rd-card, .rd-loading { z-index: 5; }
.maplibregl-ctrl-attrib { display: none; }
.rd-counter { position: absolute; top: 14px; right: 16px; text-align: right; pointer-events: none; }
.rd-when { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rd-big { font-size: clamp(28px, 5vw, 48px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rd-sub { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-legend { position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 70%; }
.rd-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.rd-chip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.rd-chip.off { opacity: 0.4; }
.rd-loading { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--stage) 70%, transparent); color: var(--muted); font-size: 14px; }

/* company card: the colour bar and the amount take the industry colour of the column */
.rd-card { --c: var(--accent); position: absolute; left: 14px; top: 14px; width: min(340px, calc(100% - 28px)); background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 12px; padding: 14px 16px 12px; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow); }
.rd-card h3 { margin: 2px 0 6px; font-size: 17px; line-height: 1.25; letter-spacing: -0.01em; padding-right: 22px; text-wrap: balance; }
.rd-card-kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rd-card-amt { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--c); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.rd-card-amt span { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.rd-card-row { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }
.rd-card-row span { color: var(--muted); min-width: 72px; }
.rd-card-people { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.rd-card-people > span { color: var(--muted); }
.rd-card-people ul { margin: 4px 0 0; padding: 0; list-style: none; }
.rd-card-people li { padding: 2px 0; }
.rd-card-people em { font-style: normal; color: var(--muted); }
.rd-card-foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.rd-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

.rd-time { display: flex; align-items: stretch; gap: 10px; margin: 10px 20px 0; height: 110px; }
.rd-play { width: 44px; border-radius: 10px; background: var(--ink); color: var(--bg); border: 0; cursor: pointer; display: grid; place-items: center; align-self: stretch; }
.rd-speed { width: 44px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-variant-numeric: tabular-nums; }
#hist { flex: 1; height: 100%; width: 100%; cursor: ew-resize; touch-action: none; }

.rd-foot { margin: 18px 20px 40px; max-width: 820px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.rd-foot strong { color: var(--ink); }
.rd-credit { font-size: 12px; }

/* request form */
.rd-ask { margin: 26px 0 22px; padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.rd-ask h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.rd-ask > p { margin: 0 0 14px; color: var(--muted); }
.rd-askform { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.rd-askform label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rd-askform label:nth-child(3), .rd-askform label:nth-child(4), .rd-askform button, .rd-askfoot { grid-column: 1 / -1; }
.rd-askform input, .rd-askform select, .rd-askform textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 14px; font-weight: 400; color: var(--ink); outline: none; resize: vertical; }
.rd-askform input:focus, .rd-askform select:focus, .rd-askform textarea:focus { border-color: var(--accent); }
.rd-submit { justify-self: start; background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700; cursor: pointer; }
.rd-submit[disabled] { opacity: 0.6; cursor: default; }
.rd-askfoot { margin: 0; font-size: 12px; color: var(--muted); }
.rd-askfoot.err { color: #d61f1f; }

@media (max-width: 720px) {
  .rd-top { gap: 10px; }
  .rd-title { width: 100%; font-size: 16px; }
  .rd-filters { margin-left: 0; width: 100%; }
  .rd-search input { width: 100%; }
  .rd-stage { margin: 0 12px; height: 62dvh; }
  .rd-time, .rd-foot { margin-left: 12px; margin-right: 12px; }
  .rd-time { height: 84px; }
  .rd-legend { max-width: calc(100% - 70px); }
  .rd-askform { grid-template-columns: 1fr; }
}
