/* DropVector web 0.22 – application pages (Live, Playback, sign-in forms).
 * Builds on dv.css tokens. Layout: a full-height chart table: top bar, a framed map
 * stage with an altitude scale, and a side rail for people and events. */

/* ---------- sign-in pages ---------- */
.dv-login-page { min-height: 100vh; display: flex; flex-direction: column; }
.lg-main { position: relative; flex: 1; display: grid; place-items: center; padding: var(--sp-7) var(--sp-4); overflow: hidden; }
.lg-map { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: .55; pointer-events: none; }
.lg-card { position: relative; width: min(480px, 100%); background-color: var(--bg); }
.lg-card-inner { padding: var(--sp-6) var(--sp-5); background: var(--panel); }
.lg-card h1 { margin-bottom: var(--sp-3); font-size: clamp(30px, 4vw, 40px); }
.lg-form { display: grid; gap: var(--sp-4); margin-top: var(--sp-5); }
.lg-code { font-family: var(--font-num); font-weight: 600; font-size: 26px; letter-spacing: .14em; text-transform: uppercase; }
.lg-key { display: flex; gap: var(--sp-2); }
.lg-key .dv-input { flex: 1; min-width: 0; }
.lg-key .dv-btn { min-height: 48px; min-width: 88px; }
.lg-activity { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-2); background: var(--bg-2); }
.lg-activity span:first-child { color: var(--text-2); font-size: var(--fs-s); }
.lg-activity .num { font-size: 20px; letter-spacing: .1em; color: var(--text-2); }
.lg-message { min-height: 1.5em; margin: 0; font-size: var(--fs-s); color: var(--text-2); }
.lg-message.is-error { color: var(--alert-text); font-weight: 600; }
.lg-note { margin: var(--sp-5) 0 0; padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }

/* ---------- app shell ---------- */
.dv-app:not(.dv-login-page) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ap-bar {
  flex: none; display: flex; align-items: center; gap: var(--sp-2) var(--sp-4); flex-wrap: wrap;
  min-height: 60px; padding: var(--sp-2) var(--sp-4); background: var(--bg); border-bottom: 1px solid var(--line);
}
.ap-brand .dv-logo-mark { width: 28px; height: 28px; }
.ap-title { display: flex; align-items: baseline; gap: var(--sp-3); min-width: 0; }
.ap-title h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.ap-code { font-size: 15px; letter-spacing: .12em; color: var(--text-2); }
.ap-conn { color: var(--text-2); }
.ap-conn[data-state="live"] { color: var(--signal); border-color: rgba(200, 255, 0, .45); }
.ap-conn[data-state="live"] .dv-dot { position: relative; }
.ap-conn[data-state="live"] .dv-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; animation: dv-pulse 1.8s ease-out infinite; }
.ap-conn[data-state="lost"], .ap-conn[data-state="expired"] { color: var(--alert-text); border-color: var(--alert); background: rgba(255, 90, 74, .12); }
.ap-counts { display: flex; gap: var(--sp-4); font-size: 14px; color: var(--text-2); }
.ap-count { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ap-count .num { color: var(--text); font-size: 18px; }
.ap-count.is-zero { opacity: .45; }
.ap-bar-end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ap-clock { font-size: 18px; color: var(--text-2); margin-right: var(--sp-2); }
.dv-btn.is-armed { background: var(--alert); border-color: var(--alert); color: #fff; }

.ap-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.ap-stage { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: var(--sp-3); padding: var(--sp-3); background: var(--bg-2); }
.ap-map-frame { min-height: 0; background-color: var(--bg); }
.ap-map { position: relative; height: 100%; background: #0d1822; }

/* map containers: 2D (Leaflet) and 3D (three.js) share the frame */
#liveMap, .pb-stage #map { position: absolute; inset: 0; background: #0d1822; }
#liveMap3d, .pb-stage #map3d { position: absolute; inset: 0; display: none; overflow: hidden; touch-action: none; background: linear-gradient(180deg, #0b1620 0%, #05080d 100%); }
#liveMap3d canvas, .pb-stage #map3d canvas { display: block; width: 100%; height: 100%; outline: none; }
.view-3d #liveMap, .pb-stage.view-3d #map { visibility: hidden; }
.view-3d #liveMap3d, .pb-stage.view-3d #map3d { display: block; }
.three-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px; color: var(--text-2); font-size: var(--fs-s); text-align: center; pointer-events: none; }
.three-loading.is-hidden { display: none; }
/* 0.23: terrain fallback notice on the 3D view (Playback) */
.three-notice { position: absolute; z-index: 3; left: 50%; top: 64px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 14px; background: rgba(13, 24, 34, .94); border: 1px solid var(--caution, #e0b341); color: var(--caution-text); font-size: var(--fs-s); pointer-events: none; }
.three-notice[hidden] { display: none; }

/* tools over the map */
.ap-tools { position: absolute; z-index: 500; top: var(--sp-3); left: var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); max-width: calc(100% - 80px); }
.ap-tools .dv-seg, .ap-tool { background: rgba(10, 19, 27, .9); }
.ap-tool svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
.ap-tool[aria-pressed="true"] { border-color: var(--target); color: var(--target-2); background: rgba(16, 36, 56, .92); }
.ap-3d-only { display: none; }
.view-3d .ap-3d-only { display: inline-flex; }
.ap-3d-panel { position: absolute; z-index: 520; top: 60px; left: var(--sp-3); width: min(340px, calc(100% - 24px)); max-height: calc(100% - 80px); overflow: auto; padding: var(--sp-4); background: rgba(13, 24, 34, .96); border: 1px solid var(--line-2); display: grid; gap: var(--sp-3); font-size: var(--fs-s); }
.ap-3d-panel:not(.is-open), .live-map-card:not(.view-3d) .ap-3d-panel, .pb-stage:not(.view-3d) .ap-3d-panel { display: none; }
.three-controls-row { display: flex; gap: 0; border: 1px solid var(--line-2); }
.three-controls-row button { flex: 1; min-height: 38px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; }
.three-controls-row button + button { border-left: 1px solid var(--line); }
.three-controls-row button.active, .three-controls-row button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.ap-3d-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); color: var(--text-2); }
.ap-3d-row .dv-select, .ap-3d-row .dv-input { width: auto; min-width: 110px; min-height: 38px; font-size: var(--fs-s); }
.ap-3d-note { margin: 0; font-size: var(--fs-xs); color: var(--text-3); }
.ap-3d-note.is-error, .three-note.is-error { color: var(--caution-text); }

/* Leaflet in night colours */
.leaflet-container { background: #0d1822; font-family: var(--font-ui); }
/* dv.css limits svg/img to max-width:100%; map panes and tiles must not be scaled by it. */
.leaflet-container .leaflet-pane svg, .leaflet-container .leaflet-pane img, .leaflet-container .leaflet-pane canvas { max-width: none !important; max-height: none !important; }
.dv-tiles-night { filter: invert(1) hue-rotate(185deg) brightness(.78) contrast(.92) saturate(.45); }
.leaflet-bar { border: 1px solid var(--line-2) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-bar a, .leaflet-bar a:hover { width: 36px !important; height: 36px !important; line-height: 34px !important; background: rgba(10, 19, 27, .92) !important; color: var(--text) !important; border-bottom-color: var(--line) !important; border-radius: 0 !important; }
.leaflet-control-layers { border: 1px solid var(--line-2) !important; border-radius: 0 !important; background: rgba(10, 19, 27, .94) !important; color: var(--text) !important; box-shadow: none !important; }
.leaflet-control-layers-toggle { width: 36px !important; height: 36px !important; background-size: 20px 20px; filter: invert(1); }
.leaflet-control-layers-expanded { padding: 8px 12px !important; font-size: 14px; }
.leaflet-control-attribution { background: rgba(10, 19, 27, .78) !important; color: var(--text-3) !important; font-size: 11px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.view-3d .leaflet-control-container { display: none; }
.leaflet-top.leaflet-right { top: 4px; right: 4px; }

/* jumper marker: arrow in identity colour, ring in phase colour */
.lv-mk { position: relative; width: 36px; height: 36px; --c: var(--target); --ph: var(--phase-ground); }
.lv-mk-ring { position: absolute; inset: 3px; border-radius: 50%; border: 2.5px solid var(--ph); background: rgba(10, 19, 27, .72); }
.lv-mk-arrow { position: absolute; inset: 7px; width: 22px; height: 22px; color: var(--c); }
.lv-mk-arrow path { fill: currentColor; stroke: #0a131b; stroke-width: 1.5; stroke-linejoin: round; }
.lv-mk.is-stale { opacity: .55; }
.lv-mk.is-stale .lv-mk-ring { border-style: dashed; border-color: var(--caution); }
.lv-mk.is-lost .lv-mk-ring { border-style: dashed; border-color: var(--alert); }
.lv-mk.is-selected .lv-mk-ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--target); }
.lv-mk.is-live .lv-mk-ring::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ph); opacity: 0; animation: dv-pulse 2.4s ease-out infinite; }
.lv-icon { overflow: visible; }
.lv-icon .lv-lbl { position: absolute; left: 40px; top: 50%; transform: translateY(calc(-50% + var(--dy, 0px))); transition: transform .25s var(--ease); }
.lv-lbl { display: inline-flex; flex-direction: column; padding: 3px 8px 4px 7px; background: rgba(10, 19, 27, .88); border-left: 3px solid var(--c); color: var(--text); white-space: nowrap; line-height: 1.15; pointer-events: none; }
.lv-lbl b { font-size: 13px; font-weight: 600; }
.lv-lbl span { font-family: var(--font-num); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.lv-lbl small { font-size: 11px; color: var(--text-2); margin-left: 3px; }
.lv-lbl.is-stale { color: var(--caution-text); }

/* selected jumper HUD */
.ap-hud { position: absolute; z-index: 510; left: var(--sp-3); bottom: var(--sp-3); width: min(320px, calc(100% - 24px)); padding: var(--sp-4); background: rgba(13, 24, 34, .95); border: 1px solid var(--line-2); border-left: 4px solid var(--c, var(--target)); }
.ap-hud-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.ap-hud-head strong { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-hud-close { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: grid; place-items: center; }
.ap-hud-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.ap-hud-alt { display: flex; align-items: baseline; gap: 8px; }
.ap-hud-alt .num { font-size: 52px; line-height: 1; letter-spacing: -.01em; }
.ap-hud-alt small { color: var(--text-2); font-size: var(--fs-s); }
.ap-hud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.ap-hud-grid div { display: flex; flex-direction: column; gap: 2px; }
.ap-hud-grid span { font-size: 12px; color: var(--text-2); }
.ap-hud-grid .num { font-size: 20px; }
.ap-hud-foot { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-3); }

.ap-phase { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.ap-phase[data-phase="climb"] { color: var(--phase-climb); }
.ap-phase[data-phase="freefall"] { color: var(--alert-text); background: rgba(255, 90, 74, .12); }
.ap-phase[data-phase="canopy"] { color: var(--signal); background: rgba(200, 255, 0, .08); }
.ap-phase[data-phase="ground"], .ap-phase[data-phase="none"] { color: var(--text-3); }
.ph-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--phase-ground); }
.ph-dot[data-phase="climb"] { background: var(--phase-climb); }
.ph-dot[data-phase="freefall"] { background: var(--phase-freefall); }
.ph-dot[data-phase="canopy"] { background: var(--phase-canopy); }

/* altitude scale beside the map */
.ap-tape { position: relative; display: flex; flex-direction: column; min-height: 0; padding: var(--sp-2) 0; border: 1px solid var(--line); background: var(--bg); }
.ap-tape-title { padding: 0 8px 8px; font-size: 11px; line-height: 1.25; color: var(--text-2); border-bottom: 1px solid var(--line); }
.ap-tape-scale { position: relative; flex: 1; margin: 12px 0 14px; }
.ap-tick { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; }
.ap-tick span { position: absolute; left: 6px; top: 0; transform: translateY(-50%); font-family: var(--font-num); font-size: 12px; color: var(--text-3); }
.ap-tick::before { content: ""; position: absolute; right: 0; top: 0; width: 14px; border-top: 1px solid var(--line-2); }
.ap-tick.is-minor::before { width: 7px; border-top-color: var(--line); }
.ap-tick.is-minor span { display: none; }
.ap-tape-marks { position: absolute; inset: 0; }
.ap-tape-l { position: absolute; left: 0; right: 0; top: 0; height: 0; transition: transform .9s linear; pointer-events: none; }
.ap-tape-mk { position: absolute; right: 0; top: 0; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; padding: 1px 5px 1px 4px; background: var(--panel-2); border-left: 3px solid var(--c); font-size: 11px; font-weight: 600; white-space: nowrap; max-width: 88px; overflow: hidden; pointer-events: auto; cursor: pointer; }
.ap-tape-mk .ph-dot { width: 7px; height: 7px; }
.ap-tape-mk.is-selected { outline: 1px solid var(--target); }
.ap-tape-mk.is-stale { opacity: .55; }
.ap-tape-band { position: absolute; right: 0; width: 4px; top: 0; height: 100%; background: var(--caution); transform-origin: top; pointer-events: none; }
.ap-tape-note { padding: 8px 8px 0; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.3; color: var(--text-2); }
.ap-tape-note .num { display: block; font-size: 18px; color: var(--text); }
.ap-tape-note.is-caution .num { color: var(--caution-text); }

/* side rail */
.ap-rail { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); }
.ap-rail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--line); }
.ap-rail-head h2 { font-size: 22px; }
.ap-sort { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; color: var(--text-2); }
.ap-sort .dv-select { min-height: 34px; width: auto; padding: 0 8px; font-size: 14px; }
.ap-alerts { display: grid; gap: 1px; background: var(--line); }
.ap-alerts:empty { display: none; }
.ap-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px var(--sp-4); background: var(--bg); font-size: 14px; line-height: 1.35; border-left: 3px solid var(--caution); color: var(--caution-text); }
.ap-alert.is-alert { border-left-color: var(--alert); color: var(--alert-text); background: rgba(255, 90, 74, .08); }
.ap-alert.is-info { border-left-color: var(--target); color: #c3cfd7; }
.ap-alert button { margin-left: auto; flex: none; }
.ap-roster { flex: 1; min-height: 0; overflow: auto; padding: var(--sp-2) 0; outline: none; }
.ap-roster-empty { padding: var(--sp-5) var(--sp-4); color: var(--text-2); font-size: var(--fs-s); }
.ap-jumper {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 0 var(--sp-3); align-items: center; width: 100%;
  padding: 10px var(--sp-4) 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left;
}
.ap-jumper:hover { background: var(--panel); }
.ap-jumper[aria-pressed="true"] { background: rgba(98, 176, 255, .1); box-shadow: inset 0 0 0 1px var(--target); }
.ap-jumper-bar { align-self: stretch; background: var(--c); }
.ap-jumper-main { min-width: 0; display: grid; gap: 4px; }
.ap-jumper-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-jumper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--text-2); }
.ap-jumper-alt { text-align: right; }
.ap-jumper-alt .num { display: block; font-size: 26px; line-height: 1; }
.ap-jumper-alt small { font-size: 11px; color: var(--text-2); }
.ap-jumper.is-stale .ap-jumper-alt .num { color: var(--caution-text); }
.ap-jumper.is-lost .ap-jumper-alt .num { color: var(--alert-text); }
.ap-jumper.is-off { opacity: .6; }
.ap-rail-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); font-size: 13px; }
.ap-rail-foot .is-error { color: var(--alert-text); }

.ap-key-dialog { max-width: min(460px, 100vw - 32px); }
.ap-key-body { padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.hm-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.ap-toast { position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; background: var(--text); color: var(--bg); font-weight: 600; font-size: var(--fs-s); }

/* ---------- small screens: map on top, rail below ---------- */
@media (max-width: 980px) {
  .ap-main { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 64vh) auto; overflow: auto; }
  .dv-app:not(.dv-login-page) { overflow: auto; height: auto; min-height: 100dvh; }
  .ap-rail { border-left: 0; border-top: 1px solid var(--line); }
  .ap-roster { overflow: visible; }
  .ap-title h1 { max-width: 50vw; }
}
@media (max-width: 640px) {
  .ap-bar { padding: var(--sp-2) var(--sp-3); gap: var(--sp-2); }
  .ap-counts { order: 5; width: 100%; gap: var(--sp-3); overflow-x: auto; }
  .ap-bar-end { order: 4; width: 100%; margin-left: 0; }
  .ap-clock { margin-right: auto; }
  .ap-stage { grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; padding: 6px; }
  .ap-tape-title { padding: 0 5px 6px; font-size: 10px; }
  .ap-tape-mk { max-width: 62px; font-size: 10px; }
  .ap-tools { top: 8px; left: 8px; }
  .ap-tool { padding: 0 10px; }
  .ap-tool-label { display: none; }
  .ap-hud { left: 6px; right: 6px; bottom: 6px; width: auto; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
  .ap-hud-head { margin: 0; }
  .ap-hud-head strong { font-size: 15px; }
  .ap-hud-alt { grid-row: 1 / span 2; grid-column: 2; }
  .ap-hud-alt .num { font-size: 32px; }
  .ap-hud-alt small { display: none; }
  .ap-hud-grid { margin: 0; padding: 0; border: 0; gap: 10px; grid-template-columns: repeat(3, auto); justify-content: start; }
  .ap-hud-grid span { display: none; }
  .ap-hud-grid .num { font-size: 15px; }
  .ap-hud-foot { display: none; }
  .ap-hud-close { width: 28px; height: 28px; }
  .leaflet-control-zoom { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-tape-l { transition: none; }
  .lv-mk.is-live .lv-mk-ring::after, .ap-conn[data-state="live"] .dv-dot::after { display: none; }
}

/* ---------- playback ---------- */
.pb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr) auto; }
.pb-stage { position: relative; grid-column: 1; grid-row: 1; min-height: 0; display: flex; padding: var(--sp-3) var(--sp-3) 0; background: var(--bg-2); }
.pb-stage > .ap-map-frame { flex: 1; min-width: 0; }
.pb-dock { grid-column: 1; grid-row: 2; display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--bg-2); }
.pb-rail { grid-column: 2; grid-row: 1 / span 2; }
.dv-playback .ap-bar .dv-lang a { height: 32px; min-width: 36px; }

/* transport */
.pb-transport { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.pb-transport .dv-icon-btn { width: 40px; height: 40px; }
.pb-transport .dv-icon-btn svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: square; }
.pb-transport .dv-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.pb-play { width: 48px !important; height: 48px !important; background: var(--text); border-color: var(--text); color: var(--bg); }
.pb-play svg path { fill: currentColor !important; stroke: none !important; }
.pb-play .pb-i-pause, .pb-play.is-playing .pb-i-play { display: none; }
.pb-play.is-playing .pb-i-pause { display: block; }
.pb-time { margin: 0 var(--sp-3); font-size: 24px; white-space: nowrap; }
.pb-time-sep { margin: 0 6px; color: var(--text-3); }
#timeEnd { color: var(--text-2); }
.pb-speed { margin-left: auto; }
.pb-speed button { min-width: 46px; }
.pb-speed button:disabled { opacity: .45; }

/* profile = timeline */
.pb-profile { position: relative; height: 140px; border: 1px solid var(--line); background: var(--bg); }
.pb-profile canvas { width: 100%; height: 100%; }
.pb-profile input[type="range"] { position: absolute; top: 0; bottom: 0; left: 46px; width: calc(100% - 58px); height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.pb-profile input[type="range"]:disabled { cursor: default; }
.pb-profile:focus-within { outline: 2px solid var(--target); outline-offset: 2px; }
.pb-note { margin: 0; min-height: 1.3em; font-size: var(--fs-xs); color: var(--text-3); }

/* open panel over the map */
.pb-open { position: absolute; inset: 0; z-index: 1200; display: grid; place-items: center; padding: var(--sp-4); overflow: auto; background: rgba(10, 19, 27, .74); }
.pb-open-card { width: min(780px, 100%); padding: var(--sp-5); background: var(--panel); border: 1px solid var(--line-2); }
.pb-open-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.pb-open-head h2 { font-size: clamp(26px, 3vw, 34px); }
.pb-open-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-5); margin-top: var(--sp-5); }
.pb-open-col h3 { margin-bottom: var(--sp-3); font-size: 19px; }
.pb-fields { display: grid; gap: var(--sp-3); }
.pb-fields .lg-code { font-size: 22px; }
.pb-room-info { margin: 0; font-weight: 600; }
.pb-open-or { position: relative; display: grid; place-items: center; color: var(--text-3); font-size: 14px; }
.pb-open-or::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--line); }
.pb-open-or span { position: relative; padding: 6px 0; background: var(--panel); }
.pb-file { position: relative; display: block; }
.pb-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pb-file .dv-btn { width: 100%; justify-content: center; }
.pb-file .dv-btn svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.pb-file input:focus-visible + .dv-btn { outline: 2px solid var(--target); outline-offset: 2px; }
.pb-file-note { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); }
.pb-open .lg-message { margin-top: var(--sp-3); }

/* rail: tabs and panels */
.pb-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.pb-tabs button { min-height: 50px; padding: 0 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; }
.pb-tabs button:hover { color: var(--text); }
.pb-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--signal); }
.pb-panel { flex: 1; min-height: 0; overflow: auto; display: grid; align-content: start; gap: var(--sp-4); padding: var(--sp-4); }
#pbPanel-jumpers { padding: 0 0 var(--sp-4); }
#pbPanel-jumpers .ap-roster { overflow: visible; }
.pb-counts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: 0; padding: 0 var(--sp-4); }
.pb-counts div { padding-top: 8px; border-top: 1px solid var(--line); }
.pb-counts dt { font-size: 12px; color: var(--text-2); }
.pb-counts dd { margin: 0; font-size: 20px; }
.pb-panel-title { display: flex; align-items: baseline; gap: var(--sp-2); font-size: 22px; }
.pb-panel-title .dv-muted { font-family: var(--font-ui); font-size: 14px; font-weight: 400; }
.pb-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pb-metrics > :last-child:nth-child(odd) { grid-column: span 2; }
.pb-metrics > * { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 0; background: var(--bg); color: var(--text); text-align: left; }
.pb-metrics span { font-size: 12px; color: var(--text-2); }
.pb-metrics strong { font-size: 24px; line-height: 1.1; }
.pb-metric-btn { cursor: pointer; }
.pb-metric-btn small { font-size: 12px; color: var(--target); }
.pb-metric-btn:disabled { cursor: default; }
.pb-metric-btn:disabled small { color: var(--text-3); }
.pb-metric-btn.active { box-shadow: inset 0 0 0 1px var(--target); }
.pb-hint { margin: 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); }
.pb-events { display: grid; margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0; }
.pb-ev { display: grid; grid-template-columns: 58px 1fr; gap: 2px 10px; width: 100%; padding: 10px var(--sp-4); border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.pb-ev:hover { background: var(--panel); }
.pb-ev time { grid-row: span 2; font-size: 16px; color: var(--text-2); }
.pb-ev b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pb-ev b small { font-weight: 400; font-size: 12px; color: var(--text-3); }
.pb-ev-note { grid-column: 2; font-size: 12px; line-height: 1.4; color: var(--text-3); }
.pb-ev.is-minor { opacity: .62; }
.pb-ev.is-current { box-shadow: inset 3px 0 0 var(--target); background: rgba(98, 176, 255, .07); }

/* map event marks: exit (freefall red), opening (canopy lime), landing (white ring) */
.pb-mk-icon { overflow: visible; }
.pb-mk { width: 100%; height: 100%; display: grid; place-items: center; }
.pb-mk-exit::before { content: ""; width: 13px; height: 13px; transform: rotate(45deg); background: var(--bg); border: 2.5px solid var(--phase-freefall); }
.pb-mk-open svg { width: 24px; height: 24px; }
.pb-mk-open path { fill: none; stroke: var(--phase-canopy); stroke-width: 2.4; stroke-linecap: round; }
.pb-mk-open path:first-child { stroke-width: 3; }
.pb-mk-land { border-radius: 50%; border: 2.5px solid var(--text); background: rgba(10, 19, 27, .6); }
.pb-mk-land::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.pb-mk-dot { border-radius: 50%; border: 2px solid var(--text-2); background: var(--bg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel) !important; color: var(--text) !important; border-radius: 0 !important; box-shadow: 0 0 0 1px var(--line-2) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-family: var(--font-ui); font-size: 14px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-2) !important; }
.vt-popup-title { font-weight: 600; margin-bottom: 6px; }
.vt-popup-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.vt-popup-row strong { color: var(--text); font-family: var(--font-num); }
.vt-popup-note { margin-top: 6px; font-size: 12px; color: var(--text-3); }

@media (max-width: 980px) {
  .pb-main { grid-template-columns: 1fr; grid-template-rows: minmax(380px, 58vh) auto auto; }
  .pb-rail { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--line); }
  .pb-panel { overflow: visible; }
}
@media (max-width: 640px) {
  .pb-stage { padding: 6px 6px 0; }
  .pb-dock { padding: 8px 6px; }
  .pb-speed { margin-left: 0; width: 100%; }
  .pb-speed button { flex: 1; min-width: 0; }
  .pb-time { font-size: 20px; margin: 0 4px; }
  .pb-profile { height: 120px; }
  .pb-open { position: fixed; z-index: 3000; padding: 8px; align-items: start; background: rgba(10, 19, 27, .94); }
  .pb-open-card { padding: var(--sp-4); }
  .pb-open-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .pb-open-or::before { top: 50%; bottom: auto; left: 0; right: 0; border-left: 0; border-top: 1px solid var(--line); }
  .pb-open-or span { padding: 0 10px; }
  .dv-playback .ap-bar .dv-lang { display: none; }
}

/* ---------- account ---------- */
.ac-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--sp-5); border-bottom: 1px solid var(--line); }
.ac-tabs button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-weight: 600; }
.ac-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--signal); }
.ac-tabs + .lg-form { margin-top: var(--sp-4); }
.ac-hint { font-size: var(--fs-xs); color: var(--text-3); }
.dv-account { min-height: 100vh; display: flex; flex-direction: column; }
.ac-main { flex: 1; padding-block: var(--sp-7) var(--sp-8); }
.ac-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.ac-head .dv-lead { margin-top: var(--sp-3); font-size: var(--fs-m); }
.ac-who { display: grid; justify-items: end; gap: 4px; text-align: right; }
.ac-who strong { font-family: var(--font-num); font-size: 22px; }
.ac-who form { margin-top: 6px; }
.ac-groups { display: grid; gap: var(--sp-5); }
.ac-group { border: 1px solid var(--line-2); background: var(--panel); }
.ac-group-head { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.ac-group-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.ac-group-title h2 { font-size: 28px; }
.ac-code { font-size: 14px; }
.ac-code .num { font-size: 18px; letter-spacing: .12em; }
.ac-group-meta { grid-column: 1; margin: 0; font-size: var(--fs-s); color: var(--text-2); }
.ac-group-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.ac-loads { list-style: none; margin: 0; padding: 0; }
.ac-load { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(150px, auto) minmax(160px, 1fr) auto; align-items: center; gap: var(--sp-3) var(--sp-4); padding: 10px var(--sp-5); border-bottom: 1px solid var(--line); }
.ac-load:last-child { border-bottom: 0; }
.ac-load-name { font-weight: 600; }
.ac-current { margin-left: 8px; padding: 1px 8px; border: 1px solid rgba(200, 255, 0, .45); color: var(--signal); font-size: 12px; font-weight: 600; }
.ac-load-time { color: var(--text-2); font-size: 16px; }
.ac-load-meta { font-size: 14px; color: var(--text-2); }
.ac-noloads { margin: 0; padding: var(--sp-4) var(--sp-5); }
.ac-empty .dv-neatline-inner { padding: var(--sp-6) var(--sp-5); background: var(--panel); }
.ac-file { margin: 0; font-size: var(--fs-s); }
.ac-settings { margin-top: var(--sp-8); }
.ac-settings > h2 { margin-bottom: var(--sp-4); }
.ac-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
.ac-panel { padding: var(--sp-5); border: 1px solid var(--line); background: var(--bg-2); display: grid; align-content: start; gap: var(--sp-3); }
.ac-panel h3 { font-size: 20px; }
.ac-panel p { margin: 0; }
.ac-form { display: grid; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .ac-main { padding-block: var(--sp-5) var(--sp-7); }
  .ac-who { justify-items: start; text-align: left; }
  .ac-group-head { grid-template-columns: 1fr; padding: var(--sp-4); }
  .ac-group-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .ac-load { grid-template-columns: 1fr auto; padding: 10px var(--sp-4); }
  .ac-load-time, .ac-load-meta { grid-column: 1; }
  .ac-load .dv-btn { grid-column: 2; grid-row: 1 / span 3; }
}
.ac-panel > .dv-btn { justify-self: start; }
/* web 0.35: forgotten password, email confirmation and deletion (0.34.0 features on this page) */
.ac-forgot-link { justify-self: start; border-color: transparent; padding-inline: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.ac-forgot-link:hover { border-color: transparent; color: var(--text); }
.ac-forgot-title { font-size: 22px; }
.ac-forgot-lead { margin: 0; }
.ac-form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ac-verify { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); border-left-color: var(--caution); }
.ac-verify strong { color: var(--text); }
.ac-verify-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.ac-verify-row .lg-message { min-height: 0; }

/* web 0.24 safety limits (assets/js/live-safety.js) */
.lv-mk.is-safety-caution .lv-mk-ring { border-color: var(--caution); box-shadow: 0 0 0 3px rgba(255, 178, 31, .45); }
.lv-mk.is-safety-check .lv-mk-ring { border-style: dotted; border-color: #9aa7b0; }
.lv-mk.is-safety-alarm .lv-mk-ring { border-color: var(--alert); box-shadow: 0 0 10px 4px rgba(255, 69, 54, .75); }
.lv-mk.is-safety-alarm .lv-mk-ring::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--alert); animation: dv-pulse 1.2s ease-out infinite; }
.sf-panel { border-bottom: 1px solid var(--line); background: var(--bg); }
.sf-head { display: flex; align-items: center; gap: 8px; padding: 10px var(--sp-4) 6px; font-size: 13px; }
.sf-title { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--alert-text); }
.sf-kind { color: #c3cfd7; }
.sf-sound { margin-left: auto; }
.sf-sound[aria-pressed="false"] { opacity: .7; }
.sf-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px var(--sp-4); border-left: 4px solid var(--caution); cursor: pointer; font-size: 14px; line-height: 1.35; }
.sf-row.is-alarm { border-left-color: var(--alert); background: rgba(255, 69, 54, .12); color: var(--alert-text); }
.sf-row.is-caution { color: var(--caution-text); }
.sf-row.is-check { border-left-color: #9aa7b0; color: #c3cfd7; }
.sf-row.is-new { animation: sf-flash 1s ease-in-out 4; }
.sf-main { display: grid; gap: 2px; min-width: 0; }
.sf-main strong { font-size: 15px; }
.sf-pick { font-weight: 600; color: #e9f0f4; }
.sf-pick em { font-style: normal; color: var(--caution-text); }
.sf-actions { margin-left: auto; display: flex; flex-direction: column; gap: 6px; flex: none; }
.sf-note { padding: 8px var(--sp-4); font-size: 13px; color: #c3cfd7; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sf-note.is-check { color: var(--caution-text); }
.sf-empty { padding: 6px var(--sp-4) 8px; font-size: 13px; color: #9be564; }
.sf-foot { padding: 4px var(--sp-4) 10px; font-size: 12px; color: #8796a1; }
@keyframes sf-flash { 50% { background: rgba(255, 69, 54, .35); } }
@media (prefers-reduced-motion: reduce) { .lv-mk.is-safety-alarm .lv-mk-ring::before, .sf-row.is-new { animation: none; } }

/* web 0.35.2: document pages (privacy.php) */
.dv-doc-page { min-height: 100vh; display: flex; flex-direction: column; }
.dv-doc { flex: 1; max-width: 46rem; padding-block: var(--sp-7) var(--sp-8); }
.dv-doc > .dv-muted { margin: var(--sp-3) 0 var(--sp-6); }
.dv-doc section { padding-top: var(--sp-5); margin-top: var(--sp-5); border-top: 1px solid var(--line); }
.dv-doc h2 { font-size: 26px; margin: 0 0 var(--sp-3); }
.dv-doc h3 { font-size: 18px; margin: var(--sp-4) 0 var(--sp-2); }
.dv-doc p, .dv-doc li { color: #c3cfd7; line-height: 1.6; }
.dv-doc p { margin: 0 0 var(--sp-3); }
.dv-doc ul { margin: 0 0 var(--sp-3); padding-left: 1.2em; display: grid; gap: 6px; }
.dv-doc a { color: var(--target-2); }
.dv-doc strong { color: var(--text); }
