/* The radar preview and the Map tab (frontend-v4 §2.1 item 9; F7 #191; b2 `quiet-laptop.png` radar
   panel, `map-phone.png`). The picture keeps the images' own shape (`--radar-ar`, from the box in Web
   Mercator) so the pin and every frame line up; frames stack and only the current one shows.
   The key's ramp is the borrowed source's colours (IEM N0Q base reflectivity: green, yellow, red),
   because those are the colours on the image; E3b's own frames move it to Friend's map tokens. */
.slot-radar.is-loading { min-height: 22rem; }
.radar { --radar-1: #3CB43C; --radar-2: #F0D21E; --radar-3: #D72828; }
.radar h2 { margin: 0 0 var(--space-2); }
.radar-open { display: block; border-radius: var(--radius-l); }
.radar-pic {
  position: relative; overflow: hidden; width: 100%; aspect-ratio: var(--radar-ar, 1.2);
  border-radius: var(--radius-l); background: var(--map-land); box-shadow: 0 0 0 1px var(--card-edge);
}
/* Frames come at the composite's native size (#376 step 2) and are scaled with whole radar bins,
   never smoothed into blobs: on a laptop backdrop or a 3x phone screen each bin is a few screen
   pixels, drawn sharp. */
/* The base map (basemap.mjs) sits under the frames in the same box, fitted to the radar's bounds and
   not interactive; with no base the flat land panel shows, as before. */
/* MapLibre's own sheet (loaded after this one) sets .maplibregl-map to position: relative, so the
   selector here is the more specific one. */
.radar-pic .radar-base { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* The Map tab once the map is live (#455): the map takes the pointer and carries the radar and the pin
   itself, so the still frames and the static pin step aside. */
.radar-pic.is-live .radar-base { pointer-events: auto; }
.radar-pic.is-live .radar-frame, .radar-pic.is-live .radar-pin { display: none; }
.radar-marker { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 3px var(--pin-ring); }
.radar-zoom-ctl { position: absolute; z-index: 1; right: var(--space-3); top: 50%; transform: translateY(-50%); display: grid; gap: var(--space-2); }
.radar-zoom-btn { min-width: var(--tap); min-height: var(--tap); padding: 0; font-size: var(--text-head); line-height: 1; background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); }
.radar-frame { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; image-rendering: pixelated; }
.radar-frame.is-on { opacity: 1; }
.radar-pin {
  position: absolute; left: calc(var(--pin-x) * 1%); top: calc(var(--pin-y) * 1%);
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--pin); box-shadow: 0 0 0 3px var(--pin-ring);
}
.radar-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.radar-play { min-width: 5.5rem; min-height: var(--tap); }
.radar-when { display: flex; flex-direction: column; flex: 1 1 8rem; min-width: 0; margin: 0; }
.radar-time { font-size: var(--text-head); font-weight: var(--weight-heavy); line-height: var(--leading-tight); }
.radar-now { font-size: var(--text-sub); color: var(--text-muted); }
.radar-sub { font-size: var(--text-sub); color: var(--text-muted); }
.radar-map { min-height: var(--tap); display: inline-flex; align-items: center; color: var(--action); font-weight: var(--weight-semibold); }
.radar-key { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; font-size: var(--text-sub); color: var(--text-muted); }
.radar-ramp { width: 4.5rem; height: 8px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--radar-1), var(--radar-2), var(--radar-3)); }
.radar-credits { margin: var(--space-2) 0 0; font-size: var(--text-small); color: var(--text-muted); }
.radar-stale { margin: 0 0 var(--space-2); font-size: var(--text-sub); color: var(--text-muted); }

/* The Map tab (#539; b2 `map-phone.png`, without its search box by Kyle's ruling): the map fills the
   stage under the header and tabs, framed on the reader's place; the key, the place's name and the
   timeline float over it. The frames are placed by the view's own numbers (--fx, --fw, --fy, radar.mjs
   `framing`) in units of the stage's width, so they stay on the base map at any screen size. */
.slot-map.is-loading { min-height: 28rem; }
.radar-stage { position: relative; height: clamp(34rem, calc(100dvh - 13rem - var(--fresh-h, 0rem)), 64rem); border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 0 0 1px var(--card-edge); }
.radar-full .radar-pic { border-radius: var(--radius-xl); }
.radar-stage .radar-pic { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; container-type: size; }
.radar-zoom .radar-frame { inset: auto; width: calc(var(--fw) * 1cqw); height: auto; left: calc(50cqw + var(--fx) * 1cqw); top: calc(50cqh + var(--fy) * 1cqw); }
.radar-zoom .radar-pin { left: 50%; top: 50%; }
.radar-stage > .radar-key { position: absolute; z-index: 1; left: var(--space-3); top: 4.25rem; max-width: calc(100% - 2 * var(--space-3)); margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); }
.radar-place { position: absolute; z-index: 1; right: var(--space-3); top: var(--space-3); max-width: 55%; margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-m); background: var(--surface); color: var(--action); font-weight: var(--weight-semibold); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); overflow-wrap: anywhere; }
.radar-stage > .radar-timeline { position: absolute; z-index: 1; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); margin: 0; box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); }
.radar-controls { position: absolute; z-index: 2; right: var(--space-3); top: 7.5rem; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.radar-ctl { min-width: var(--tap); min-height: var(--tap); background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); }
.radar-layers { display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge); }
.radar-layers[hidden] { display: none; }
.radar-layer { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); }
.radar-layer input { width: 1.25rem; height: 1.25rem; accent-color: var(--action); }
.radar-pic.hide-radar .radar-frame { visibility: hidden; }
.radar-empty { display: grid; place-items: center; }
.radar-empty p { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-m); background: var(--surface); color: var(--text); }
.radar-timeline { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-card), 0 0 0 1px var(--card-edge); }
.radar-timeline .radar-bar { margin-top: 0; }
.radar-scrub { width: 100%; min-height: var(--tap); margin: var(--space-2) 0 0; accent-color: var(--action); }
.radar-ends { display: flex; justify-content: space-between; margin: 0; font-size: var(--text-small); color: var(--text-muted); }
.radar-steps { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.radar-step { min-height: var(--tap); min-width: min(6rem, 100%); max-width: 100%; }
.radar-step:disabled { opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) { .radar-frame { transition: opacity var(--dur-fast); } }

/* Laptop (F14 #286; b2 quiet-laptop.png "the radar panel: small, bottom right, opaque; the map stays
   the picture"). The shell spans the slot over the map ground; the picture fills the ground behind
   the Today panel, keeping its own shape so the pin and the frames still line up, and the rest of
   the section is the panel at the bottom right. */
@media (min-width: 1024px) {
  .layout .slot-radar:not(.is-loading):not(.is-error) {
    display: grid; align-content: end; justify-items: end; min-height: 34rem; padding: 28px 0 84px;
    background: none; border-radius: 0; box-shadow: none;
  }
  .layout .slot-radar > * { width: min(340px, 100%); margin: 0 var(--edge, 32px) 0 0; }
  .layout .slot-radar > .error { margin-top: 0; }
  .layout .slot-radar .radar-stale { padding: var(--space-1) var(--space-3); border-radius: var(--radius-m); background: var(--surface); }
  .layout .slot-radar .radar {
    display: grid; gap: var(--space-2); padding: 12px 14px; border-radius: 20px;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-float), 0 0 0 1px var(--card-edge);
  }
  .layout .slot-radar .radar h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
  .layout .slot-radar .radar-open { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: 0; background: var(--map-land); }
  .layout .slot-radar .radar-pic { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); border-radius: 0; box-shadow: none; }
  .layout .slot-radar .radar-bar { margin-top: 0; flex-wrap: nowrap; }
  .layout .slot-radar .radar-play { min-width: 84px; border-radius: var(--radius-pill); background: var(--action); color: var(--action-label); border-color: var(--action); }
  .layout .slot-radar .radar-time { font-size: 1.375rem; }
  .layout .slot-radar .radar-key { margin: 0; padding-top: var(--space-2); border-top: 1px solid var(--line); }
  .layout .slot-radar .radar-credits { margin: 0; }
}

/* The Map tab on a laptop (#455; `needle/shots/map-laptop.png`): the map runs edge to edge under the
   masthead and fills the rest of the window, with the place box and the key stacked at the top left and
   the timeline at the bottom left, all floating over it. */
@media (min-width: 1024px) {
  main.is-map { max-width: none; padding: 0; }
  main.is-map .slot-map.is-loading { min-height: calc(100dvh - 5rem); }
  main.is-map .radar-stage { height: max(34rem, calc(100dvh - 5rem)); border-radius: 0; box-shadow: none; }
  main.is-map .radar-full .radar-pic { border-radius: 0; }
  main.is-map .radar-place { right: auto; left: var(--space-4); top: var(--space-4); }
  main.is-map .radar-stage > .radar-key { left: var(--space-4); top: 6rem; }
  main.is-map .radar-stage > .radar-timeline { left: var(--space-4); right: auto; bottom: var(--space-4); width: min(36rem, calc(100% - 2 * var(--space-4))); }
  main.is-map .radar-zoom-ctl, main.is-map .radar-controls { right: var(--space-4); }
}
