:root {
  --bg:#130E16;
  --surface:#211823;
  --surface-elev:#352435;
  --surface-hover:#422D42;
  --border:rgba(237,155,190,0.14);
  --border-strong:rgba(237,155,190,0.28);
  --top-edge:rgba(246,204,223,0.14);
  --ink:#F4EAF0;
  --muted:#BDA8B8;
  --muted-soft:#927D8E;
  --rose:#ED9BBE;
  --rose-soft:#F6CCDF;
  --rose-deep:#D87AA2;
  --hp-green:#4ADE80;
  --hp-yellow:#FACC15;
  --hp-red:#F87171;
  --serif:'Newsreader', Georgia, serif;
  --sans:'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-weight:400;
  font-size:14.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

h1, h2, h3 {
  font-weight:600;
  margin:0;
  line-height:1.2;
  color:var(--ink);
}

strong { font-weight:600; color:var(--rose-soft); }

button, input {
  font-family:var(--sans);
  font-weight:500;
}

button:focus-visible, input:focus-visible, summary:focus-visible {
  outline:2px solid var(--rose);
  outline-offset:2px;
}

.mono {
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
}

.page {
  max-width:1440px;
  margin:0 auto;
  padding:14px 22px 36px;
}

/* Header */
.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}

.brand {
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
}
.brand-mark { align-self:center; flex-shrink:0; }
.wordmark {
  font-family:var(--serif);
  font-size:27px;
  font-weight:500;
  letter-spacing:-0.015em;
  color:var(--ink);
}
.brand-sep { color:var(--border-strong); }
.tagline {
  margin:0;
  font-family:var(--serif);
  font-style:italic;
  font-size:15.5px;
  font-weight:400;
  color:var(--muted);
}

.topbar-actions {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.mode-switch {
  display:inline-flex;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
  overflow:hidden;
}
.mode-switch button {
  appearance:none;
  border:none;
  background:transparent;
  height:36px;
  padding:0 15px;
  font-size:13.5px;
  font-weight:500;
  color:var(--muted);
  cursor:pointer;
  transition:background 130ms ease, color 130ms ease;
}
.mode-switch button:hover { color:var(--ink); background:var(--surface-elev); }
.mode-switch button.active {
  background:var(--surface-elev);
  color:var(--ink);
  box-shadow:inset 0 -2px 0 var(--rose);
}

/* De-Bulked 40-42px Warm Rose-Plum Buttons (Solid Single-Color Rose Primary) */
.btn {
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:36px;
  padding:0 14px;
  border:none;
  border-radius:8px;
  background:var(--surface-elev);
  color:var(--ink);
  font-size:13.5px;
  font-weight:500;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:inset 0 1px 0 rgba(246,204,223,0.1);
  transition:background 120ms ease, color 120ms ease, transform 75ms ease;
}
.btn:hover:not(:disabled) { background:var(--surface-hover); }
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn.btn-sm { height:32px; padding:0 11px; font-size:12.5px; border-radius:7px; }
.btn.btn-icon { width:36px; padding:0; }
.btn.btn-quiet {
  background:var(--surface);
  color:var(--muted);
  box-shadow:inset 0 1px 0 rgba(246,204,223,0.08);
}
.btn.btn-quiet:hover:not(:disabled) { color:var(--ink); background:var(--surface-elev); }
.btn.primary {
  background:var(--rose);
  color:#130E16;
  font-weight:600;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.34), 0 4px 12px rgba(10,4,12,0.38);
}
.btn.primary:hover:not(:disabled) { background:var(--rose-soft); }
.btn.primary:active:not(:disabled) { transform:translateY(1px); background:var(--rose-deep); }
.btn.btn-play-main {
  height:40px;
  min-width:92px;
  padding:0 20px;
  font-size:14px;
  border-radius:8px;
}
.transport-btns .btn {
  height:40px;
  padding:0 14px;
  font-size:13.5px;
  border-radius:8px;
}
#btn-duel-lock, #btn-duel-next {
  height:42px;
  padding:0 20px;
  font-size:14px;
  border-radius:8px;
}
.btn:disabled {
  background:#271D29;
  color:#796775;
  box-shadow:none;
  cursor:not-allowed;
}

.seg {
  display:inline-flex;
  border:1px solid var(--border-strong);
  border-radius:7px;
  background:var(--bg);
  overflow:hidden;
}
.seg button {
  appearance:none;
  border:none;
  background:transparent;
  height:28px;
  padding:0 11px;
  font-size:12.5px;
  color:var(--muted);
  cursor:pointer;
  transition:background 120ms ease, color 120ms ease;
}
.seg button:hover { color:var(--ink); background:var(--surface-elev); }
.seg button.active {
  background:var(--surface-elev);
  color:var(--ink);
  box-shadow:inset 0 -2px 0 var(--rose);
}

/* 1v1 Top-Center Compact Status Strip */
.match-strip {
  margin:12px 0 12px;
  padding:9px 16px;
  background:var(--surface);
  border-radius:10px;
  box-shadow:inset 0 1px 0 var(--top-edge), 0 6px 20px rgba(8,4,10,0.42);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.match-strip-side {
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.match-strip-side.right { justify-content:flex-end; }
.match-side-label { font-size:14px; font-weight:500; color:var(--ink); }
.match-mult {
  font-size:12px;
  font-weight:600;
  padding:2px 8px;
  border-radius:5px;
  background:var(--surface-elev);
  color:var(--rose-soft);
}
.match-strip-center {
  display:flex;
  align-items:center;
  gap:8px;
}
.match-round-badge {
  padding:3px 12px;
  border-radius:999px;
  font-size:12.5px;
  font-weight:600;
  color:var(--ink);
  background:var(--surface-elev);
}
.match-status-pill {
  padding:3px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:500;
  background:var(--bg);
  color:var(--ink);
  white-space:nowrap;
}
.match-status-pill.exploring { color:var(--rose-soft); }
.match-status-pill.shotclock {
  background:rgba(248,113,113,0.18);
  color:#FECACA;
}
.match-status-pill.shotclock.low-time {
  background:rgba(255,62,94,0.3);
  color:#FFE4E6;
  animation:lowTimePillPulse 0.85s ease-in-out infinite;
}

@keyframes lowTimePulse {
  0%, 100% {
    box-shadow:0 0 0 1.5px rgba(255,62,94,0.45), 0 0 18px rgba(255,62,94,0.28);
  }
  50% {
    box-shadow:0 0 0 2.5px rgba(255,62,94,0.88), 0 0 34px rgba(255,62,94,0.55);
  }
}
@keyframes lowTimePillPulse {
  0%, 100% { box-shadow:0 0 0 0 rgba(255,62,94,0.45); }
  50% { box-shadow:0 0 0 5px rgba(255,62,94,0.22); }
}
@keyframes viewportLowTimePulse {
  0%, 100% { box-shadow:inset 0 0 64px 8px rgba(255, 48, 86, 0.34); }
  50% { box-shadow:inset 0 0 90px 14px rgba(255, 48, 86, 0.58); }
}
.low-time-vignette {
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:1500;
  opacity:0;
  transition:opacity 180ms ease;
}
.low-time-vignette.active {
  opacity:1;
  animation:viewportLowTimePulse 0.85s ease-in-out infinite;
}
.workspace.low-time {
  border-radius:10px;
  animation:lowTimePulse 0.85s ease-in-out infinite;
}

/* 1v1 Arena Layout with Flanking Vertical Green/Yellow/Red HP Gauges */
.arena-grid {
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:12px;
  align-items:stretch;
}
.arena-grid.is-match {
  grid-template-columns:56px minmax(0, 1fr) 56px;
}

.hp-col {
  background:var(--surface);
  border-radius:10px;
  padding:12px 6px;
  box-shadow:inset 0 1px 0 var(--top-edge), 0 8px 20px rgba(8,4,10,0.42);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.hp-col-name {
  font-size:12px;
  font-weight:600;
  color:var(--ink);
  text-align:center;
}
.hp-col-num {
  font-size:12px;
  font-weight:600;
  color:var(--ink);
}
.v-hp-track {
  position:relative;
  flex:1;
  min-height:240px;
  width:20px;
  border-radius:999px;
  background:#110B14;
  box-shadow:inset 0 2px 6px rgba(0,0,0,0.72), 0 0 0 1px rgba(246,204,223,0.12);
  overflow:hidden;
}
.v-hp-trail {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  width:100%;
  height:var(--hp-pct, 100%);
  background:rgba(255,235,244,0.78);
  transition:height 760ms cubic-bezier(0.22, 1, 0.36, 1) 200ms, width 760ms cubic-bezier(0.22, 1, 0.36, 1) 200ms;
}
.v-hp-fill {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  width:100%;
  height:var(--hp-pct, 100%);
  border-radius:999px;
  transition:height 260ms cubic-bezier(0.22, 1, 0.36, 1), width 260ms cubic-bezier(0.22, 1, 0.36, 1), background-color 260ms ease;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.4);
}
.v-hp-fill.hp-green { background-color:var(--hp-green); }
.v-hp-fill.hp-yellow { background-color:var(--hp-yellow); }
.v-hp-fill.hp-red { background-color:var(--hp-red); }
.v-hp-ticks {
  position:absolute;
  inset:0;
  pointer-events:none;
  display:grid;
  grid-template-rows:repeat(4, 1fr);
}
.v-hp-ticks span {
  border-bottom:1px solid rgba(19,14,22,0.46);
}

@media (max-width:860px) {
  .arena-grid.is-match { grid-template-columns:minmax(0, 1fr); }
  .hp-col {
    flex-direction:row;
    padding:8px 12px;
  }
  .v-hp-track {
    min-height:14px;
    height:14px;
    width:auto;
    flex:1;
  }
  .v-hp-trail, .v-hp-fill {
    top:0;
    bottom:0;
    left:0;
    right:auto;
    height:100%;
    width:var(--hp-pct, 100%);
  }
  .v-hp-ticks { grid-template-rows:none; grid-template-columns:repeat(4, 1fr); }
  .v-hp-ticks span { border-bottom:none; border-right:1px solid rgba(19,14,22,0.46); }
}

.match-result {
  margin:0 0 12px;
  padding:13px 16px;
  background:var(--surface);
  border-radius:10px;
  box-shadow:inset 0 1px 0 rgba(237,155,190,0.28), 0 8px 24px rgba(8,4,10,0.45);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}
.match-result-main { display:flex; flex-direction:column; gap:4px; }
.match-result-title { font-family:var(--serif); font-size:21px; font-weight:500; color:var(--ink); }
.match-result-sub { font-size:13.5px; color:var(--muted); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.match-history {
  margin-top:6px;
  padding-top:6px;
  border-top:1px solid var(--border);
  font-size:12px;
  color:var(--muted);
  display:flex;
  flex-wrap:wrap;
  gap:4px 14px;
}
.match-result-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Atmospheric Ready Overlay (z-index 2000 strictly above isolated #map) */
.workspace-shell { position:relative; min-width:0; }
.match-ready-overlay {
  position:absolute;
  inset:0;
  z-index:2000;
  background:
    radial-gradient(circle at 50% 42%, rgba(237,155,190,0.14), rgba(19,14,22,0.96) 66%),
    #130E16;
  border-radius:10px;
  box-shadow:inset 0 1px 0 rgba(246,204,223,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  opacity:1;
  transition:opacity 220ms ease, transform 220ms ease;
}
.match-ready-overlay.withdrawing {
  opacity:0;
  transform:scale(1.012);
  pointer-events:none;
}
.match-ready-card {
  max-width:450px;
  padding:26px 30px;
  border-radius:12px;
  background:rgba(33,24,35,0.88);
  box-shadow:inset 0 1px 0 rgba(246,204,223,0.16), 0 16px 42px rgba(8,4,10,0.62);
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:13px;
}
.match-ready-title {
  font-family:var(--serif);
  font-size:32px;
  font-weight:500;
  letter-spacing:-0.015em;
  color:var(--ink);
}
.match-ready-desc {
  margin:0;
  font-size:14px;
  color:var(--muted);
  line-height:1.6;
}
.match-ready-btn {
  margin-top:4px;
  width:164px;
  height:42px;
  font-size:15px;
  border-radius:8px;
}

.match-controls {
  padding:9px 12px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  background:var(--surface);
}
.match-ctrl-group { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.match-frame-badge {
  display:inline-flex;
  align-items:center;
  padding:0 9px;
  height:32px;
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  background:var(--bg);
  border-radius:6px;
}

.match-map-footer {
  padding:9px 14px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  background:var(--surface);
}

.pane-map.duel-cursor #map { cursor:crosshair; }

.duel-you-pin {
  width:26px;
  height:26px;
  border-radius:50%;
  background:#F4EAF0;
  border:2.2px solid var(--rose);
  color:#130E16;
  font-family:var(--sans);
  font-size:10px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px rgba(237,155,190,0.38), 0 2px 8px rgba(10,4,12,0.52);
}
.duel-qualia-pin {
  width:26px;
  height:26px;
  border-radius:50%;
  background:var(--rose);
  border:2.2px solid #FFFFFF;
  color:#130E16;
  font-family:var(--sans);
  font-size:11.5px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px rgba(246,204,223,0.38), 0 2px 8px rgba(10,4,12,0.52);
}

/* Compact Single-Row Travel Postcard Strip */
.postcard-bar {
  display:flex;
  align-items:center;
  gap:12px;
  margin:10px 0 12px;
}

.postcard-strip {
  flex:1;
  min-width:0;
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 2px 4px;
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong) transparent;
}
.postcard-strip::-webkit-scrollbar { height:5px; }
.postcard-strip::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:3px; }

.postcard {
  position:relative;
  appearance:none;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:9px;
  padding:4px 10px 4px 4px;
  border:none;
  border-radius:7px;
  background:var(--surface);
  color:var(--ink);
  cursor:pointer;
  text-align:left;
  overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(246,204,223,0.06);
  transition:background 120ms ease, box-shadow 120ms ease;
}
.postcard:hover { background:var(--surface-elev); }
.postcard.active {
  background:#352435;
  box-shadow:inset 0 0 0 1.5px var(--rose-soft), 0 4px 12px rgba(237,155,190,0.18);
}
.postcard.loading { opacity:0.75; }
.postcard img {
  width:52px;
  height:36px;
  border-radius:4px;
  object-fit:cover;
  display:block;
  background:var(--bg);
}
.postcard-info { display:flex; flex-direction:column; gap:1px; min-width:0; }
.postcard-title { display:flex; align-items:center; gap:5px; font-size:12.5px; font-weight:500; color:var(--ink); white-space:nowrap; }
.postcard-sub { font-size:11.5px; color:var(--muted); white-space:nowrap; }
.postcard-actions { display:flex; gap:8px; flex-shrink:0; }

/* Locked 16x12px R2 SVG Flags */
.flag-svg, img.flag-svg {
  width:16px !important;
  height:12px !important;
  aspect-ratio:4/3 !important;
  border-radius:1.5px;
  border:0.5px solid rgba(244,234,240,0.28);
  flex:0 0 16px !important;
  display:inline-block !important;
  vertical-align:middle;
  object-fit:cover;
}
.flag-fallback {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:12px;
  border-radius:2px;
  background:var(--surface-elev);
  border:0.5px solid var(--border-strong);
  color:var(--muted);
  font-family:var(--sans);
  font-size:8px;
  line-height:1;
  flex-shrink:0;
}

/* Mobile Street | Map Switcher */
.mobile-tabs {
  display:none;
  margin-bottom:10px;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
  overflow:hidden;
}
.mobile-tabs button {
  flex:1;
  appearance:none;
  border:none;
  background:transparent;
  height:36px;
  color:var(--muted);
  font-size:13.5px;
  cursor:pointer;
}
.mobile-tabs button.active {
  background:var(--surface-elev);
  color:var(--ink);
  box-shadow:inset 0 -2px 0 var(--rose);
}

/* Synchronized 2-Column Workspace */
.workspace {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  align-items:stretch;
}
.deck-card, .transcript-card { grid-column:1 / -1; }

@media (max-width:720px) {
  .page { padding:12px 14px 32px; }
  .postcard-bar { flex-direction:column; align-items:stretch; gap:8px; }
  .postcard-actions { justify-content:flex-end; }
  .mobile-tabs { display:flex; }
  .workspace { grid-template-columns:1fr; }
  .workspace[data-mobile-view="street"] .pane-map { display:none; }
  .workspace[data-mobile-view="map"] .pane-street { display:none; }
}

.card {
  background:var(--surface);
  border:none;
  border-radius:10px;
  box-shadow:inset 0 1px 0 var(--top-edge), 0 8px 24px rgba(8,4,10,0.45);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.card-head {
  padding:10px 16px;
  border-bottom:1px solid rgba(237,155,190,0.1);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-height:46px;
}
.card-head h2 {
  font-size:15px;
  font-weight:500;
  display:flex;
  align-items:center;
  gap:6px;
}
.loc-heading {
  font-family:var(--serif);
  font-size:20px !important;
  font-weight:500 !important;
  letter-spacing:-0.01em;
}
.card-meta { font-size:12.5px; font-weight:400; color:var(--muted); }

.outcome-badges { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.dist-lead { font-size:15.5px; font-weight:600; color:var(--ink); letter-spacing:-0.01em; }
.score-sub { font-size:13.5px; font-weight:500; color:var(--rose-soft); }
.map-head-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* Interactive Street View Pane */
.photo-wrap {
  position:relative;
  background:#0D0910;
  height:clamp(290px, 44vh, 410px);
  overflow:hidden;
}
.photo-wrap.duel-interactive {
  cursor:grab;
  user-select:none;
  touch-action:none;
}
.photo-wrap.duel-interactive.dragging { cursor:grabbing; }
.photo-layer {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  pointer-events:none;
  transition:opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change:opacity, transform;
}
.pano-canvas {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:5;
  display:block;
  pointer-events:none;
}

/* Perspective-Locked On-Road 360° Street Arrows */
.road-arrows {
  position:absolute;
  left:50%;
  bottom:42px;
  width:184px;
  height:124px;
  transform:translateX(-50%);
  z-index:20;
  pointer-events:none;
  perspective:500px;
}
.road-arrows-plane {
  position:absolute;
  inset:0;
  transform-style:preserve-3d;
  transform:rotateX(58deg);
  pointer-events:none;
}
.road-arrow {
  position:absolute;
  left:50%;
  top:50%;
  width:42px;
  height:42px;
  margin:-21px 0 0 -21px;
  padding:0;
  border:none;
  border-radius:50%;
  background:rgba(19,14,22,0.58);
  color:var(--rose-soft);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  pointer-events:auto;
  box-shadow:0 0 0 1.5px rgba(237,155,190,0.68), 0 4px 12px rgba(0,0,0,0.55);
  transition:background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.road-arrow:hover {
  background:rgba(237,155,190,0.94);
  color:#130E16;
  box-shadow:0 0 0 2px #F6CCDF, 0 0 18px rgba(237,155,190,0.65);
}
.road-arrow svg {
  width:24px;
  height:24px;
  display:block;
}
.photo-wrap.dragging .photo-layer {
  transition:opacity 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* FPS Compass */
.fps-compass {
  position:absolute;
  top:8px;
  left:50%;
  transform:translateX(-50%);
  z-index:16;
  width:240px;
  height:30px;
  overflow:hidden;
  pointer-events:none;
  background:linear-gradient(90deg, rgba(19,14,22,0) 0%, rgba(19,14,22,0.82) 18%, rgba(19,14,22,0.82) 82%, rgba(19,14,22,0) 100%);
  mask-image:linear-gradient(90deg, transparent 0%, black 16%, black 84%, transparent 100%);
  -webkit-mask-image:linear-gradient(90deg, transparent 0%, black 16%, black 84%, transparent 100%);
}
.fps-compass-caret {
  position:absolute;
  top:2px;
  left:50%;
  transform:translateX(-50%);
  z-index:18;
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid var(--rose);
}
.fps-compass-tape {
  position:absolute;
  top:7px;
  left:0;
  height:21px;
  display:flex;
  align-items:flex-end;
  transition:transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fps-tick {
  width:24px;
  flex-shrink:0;
  text-align:center;
  color:rgba(244,234,240,0.74);
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
  font-size:10px;
  line-height:1;
  position:relative;
  padding-bottom:5px;
}
.fps-tick.cardinal { color:var(--ink); font-size:11px; font-weight:500; }
.fps-tick.north { color:var(--rose); font-size:11px; font-weight:600; }
.fps-tick::after {
  content:'';
  position:absolute;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:1px;
  height:4px;
  background:rgba(244,234,240,0.42);
}
.fps-tick.cardinal::after { height:6px; width:1.5px; background:rgba(244,234,240,0.9); }
.fps-heading-readout {
  position:absolute;
  top:39px;
  left:50%;
  transform:translateX(-50%);
  z-index:16;
  font-size:10.5px;
  font-weight:500;
  color:var(--ink);
  background:rgba(19,14,22,0.84);
  border:1px solid rgba(237,155,190,0.28);
  padding:1px 7px;
  border-radius:4px;
  pointer-events:none;
}

/* Corner Leaflet Street Minimap */
.minimap-box {
  position:absolute;
  bottom:10px;
  left:10px;
  z-index:16;
  width:152px;
  height:110px;
  border-radius:6px;
  overflow:hidden;
  background:#E8E6DF;
  border:1.5px solid rgba(244,234,240,0.75);
  box-shadow:0 4px 14px rgba(0,0,0,0.45);
}
#agent-minimap { width:100%; height:100%; isolation:isolate; position:relative; z-index:1; }
#agent-minimap .leaflet-control-attribution { display:none; }

/* Clickable On-Image HUD Controls */
.hud-zoom {
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  z-index:25;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.hud-nav {
  position:absolute;
  bottom:12px;
  left:50%;
  transform:translateX(-50%);
  z-index:25;
  display:flex;
  gap:8px;
}
.hud-btn {
  appearance:none;
  pointer-events:auto;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid rgba(244,234,240,0.36);
  background:rgba(19,14,22,0.78);
  color:var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(4px);
  cursor:pointer;
  transition:transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.hud-btn:hover:not(:disabled) {
  border-color:var(--rose);
  background:rgba(53,36,53,0.92);
}
.hud-btn:active:not(:disabled), .hud-btn.pressed {
  transform:scale(0.9);
  background:var(--rose);
  color:#130E16;
  border-color:var(--ink);
}
.hud-btn:disabled {
  opacity:0.34;
  cursor:not-allowed;
  border-color:rgba(244,234,240,0.18);
  background:rgba(19,14,22,0.48);
}

/* Crisp Natural Guess Map */
.map-stage {
  position:relative;
  flex:1;
  height:clamp(290px, 44vh, 410px);
  isolation:isolate;
  z-index:1;
}
#map {
  width:100%;
  height:100%;
  background:#DCE4EC;
  font-family:var(--sans);
  isolation:isolate;
  position:relative;
  z-index:1;
}
.leaflet-container { font-family:var(--sans); }
.leaflet-bar {
  border:1px solid rgba(19,14,22,0.3) !important;
  box-shadow:0 2px 8px rgba(10,4,12,0.22) !important;
  border-radius:6px !important;
  overflow:hidden;
}
.leaflet-bar a {
  background:var(--surface) !important;
  color:var(--ink) !important;
  border-bottom:1px solid var(--border) !important;
  font-weight:500 !important;
}
.leaflet-bar a:last-child { border-bottom:none !important; }
.leaflet-bar a:hover { background:var(--surface-elev) !important; color:var(--rose-soft) !important; }
.leaflet-control-attribution {
  background:rgba(33,24,35,0.86) !important;
  color:var(--muted) !important;
  font-size:10.5px !important;
  padding:2px 6px !important;
}
.leaflet-control-attribution a { color:var(--rose-soft) !important; text-decoration:none; }
.leaflet-tooltip {
  background:var(--surface);
  color:var(--ink);
  border:1px solid var(--border-strong);
  font-family:var(--sans);
  font-size:12px;
  font-weight:400;
  box-shadow:0 4px 12px rgba(0,0,0,0.38);
}

.map-legend {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  align-items:center;
  padding:8px 14px;
  font-size:12px;
  color:var(--muted);
  border-top:1px solid var(--border);
  background:var(--surface);
}
.legend-item { display:inline-flex; align-items:center; gap:6px; }
.swatch-prior {
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  background:var(--surface);
  border:1.5px solid var(--muted);
}
.swatch-active {
  width:11px;
  height:11px;
  border-radius:50%;
  display:inline-block;
  background:var(--surface);
  border:2px solid var(--rose);
}
.swatch-final {
  width:10px;
  height:10px;
  border-radius:2px;
  transform:rotate(45deg);
  display:inline-block;
  background:var(--rose-soft);
  border:1px solid var(--bg);
}
.swatch-truth {
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  background:#F87171;
  border:1.5px solid var(--ink);
}

/* Double-Ring Instrument Map Markers (Rose-Plum) */
.guess-step-pin {
  width:26px;
  height:26px;
  border-radius:50%;
  background:#211823;
  border:2.2px solid var(--rose);
  color:#F4EAF0;
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
  font-size:11px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px rgba(255,255,255,0.9), 0 0 0 4px rgba(237,155,190,0.28), 0 2px 6px rgba(10,4,12,0.45);
}
.guess-step-pin.past {
  width:20px;
  height:20px;
  font-size:10px;
  background:#211823;
  border:1.5px solid var(--muted);
  color:#F4EAF0;
  box-shadow:0 0 0 1.5px rgba(255,255,255,0.82), 0 1px 4px rgba(10,4,12,0.35);
}
.final-lock-pin {
  width:19px;
  height:19px;
  border-radius:3px;
  transform:rotate(45deg);
  background:var(--rose);
  border:1.6px solid #130E16;
  color:#130E16;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px rgba(255,255,255,0.92), 0 0 0 4px rgba(237,155,190,0.32), 0 2px 6px rgba(10,4,12,0.45);
}
.final-lock-pin svg { transform:rotate(-45deg); }
.truth-pin {
  width:22px;
  height:22px;
  border-radius:50%;
  background:#F87171;
  border:2px solid #FFFFFF;
  color:#130E16;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 3px rgba(248,113,113,0.3), 0 2px 6px rgba(10,4,12,0.45);
}

/* De-Bulked Warm Rose-Plum Transport + Sleek 6px Scrubber */
.transport-bar {
  padding:10px 16px;
  background:#2B1F2E;
  border-top:1px solid rgba(246,204,223,0.12);
  border-bottom:1px solid rgba(10,4,12,0.4);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.transport-btns {
  display:flex;
  align-items:center;
  gap:6px;
}

.scrubber-wrap {
  flex:1 1 260px;
  display:flex;
  align-items:center;
  gap:12px;
}
.step-label { font-size:13px; font-weight:500; color:var(--ink); white-space:nowrap; }
.scrubber-rail {
  flex:1;
  display:flex;
  flex-direction:column;
  gap:5px;
}
.step-scrubber {
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  height:6px;
  border-radius:999px;
  margin:0;
  cursor:pointer;
  background:linear-gradient(90deg, var(--rose) 0%, var(--rose) var(--scrubber-pct, 0%), #150F18 var(--scrubber-pct, 0%), #150F18 100%);
}
.step-scrubber::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--ink);
  border:2.5px solid var(--rose);
  box-shadow:0 0 0 2px #130E16;
  cursor:pointer;
}
.step-scrubber::-moz-range-thumb {
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--ink);
  border:2.5px solid var(--rose);
  box-shadow:0 0 0 2px #130E16;
  cursor:pointer;
}
.scrubber-ticks {
  display:flex;
  justify-content:space-between;
  padding:0 7px;
  height:6px;
}
.scrubber-tick {
  width:2px;
  height:4px;
  border-radius:1px;
  background:rgba(189,168,184,0.34);
  cursor:pointer;
}
.scrubber-tick.active {
  background:var(--rose);
  height:6px;
}

.speed-group {
  display:inline-flex;
  gap:2px;
  padding:3px;
  border-radius:8px;
  background:#19121D;
}
.speed-btn {
  appearance:none;
  border:none;
  border-radius:6px;
  background:transparent;
  height:32px;
  padding:0 10px;
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
  font-size:12.5px;
  font-weight:500;
  color:var(--muted);
  cursor:pointer;
}
.speed-btn:hover { color:var(--ink); background:var(--surface-elev); }
.speed-btn.active {
  background:var(--surface-elev);
  color:var(--rose-soft);
}

.current-reasoning {
  padding:13px 16px 14px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.cr-head { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.cr-step-title { font-size:14px; font-weight:600; color:var(--ink); }
.cr-sparkle {
  color:var(--rose-soft);
  display:inline-flex;
  animation:sparkle-pop 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sparkle-pop {
  0% { transform:scale(0.3) rotate(-35deg); opacity:0; }
  55% { transform:scale(1.25) rotate(12deg); opacity:1; }
  100% { transform:scale(1) rotate(0deg); opacity:1; }
}
.cr-body {
  margin:0;
  font-size:14px;
  font-weight:400;
  line-height:1.58;
  color:var(--ink);
  white-space:pre-wrap;
  word-break:break-word;
}

/* Compact Filled Status Labels */
.tool-pill {
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:5px;
  font-size:12px;
  font-weight:500;
  border:none;
  background:var(--surface-elev);
  color:var(--ink);
}
.tool-pill.move { background:#352435; color:var(--rose-soft); }
.tool-pill.zoom { background:#3D243A; color:var(--rose-soft); }
.tool-pill.pin { background:#452236; color:var(--rose-soft); font-weight:600; }
.tool-pill.start { background:#2D202F; color:var(--muted); }

/* Compact Chevron Transcript Disclosure */
.transcript-summary {
  list-style:none;
  padding:11px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  cursor:pointer;
  user-select:none;
  background:var(--surface);
  transition:background 120ms ease;
}
.transcript-summary::-webkit-details-marker { display:none; }
.transcript-summary:hover { background:#2A1E2D; }
.transcript-shell[open] .transcript-summary { border-bottom:1px solid var(--border); }
.transcript-shell[open] .transcript-summary .h-chevron { transform:rotate(90deg); color:var(--rose); }
.trace-head-left { display:flex; align-items:center; gap:8px; }
.trace-head-left h2 { font-size:14px; font-weight:600; color:var(--ink); }
.transcript-summary .h-chevron {
  width:16px;
  height:16px;
  color:var(--muted);
  transition:transform 140ms ease, color 140ms ease;
}
.kbd-hint { font-size:12px; color:var(--muted-soft); }

.transcript-toolbar {
  padding:8px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.harbor-timeline {
  padding:14px 16px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.h-step { display:grid; grid-template-columns:34px minmax(0, 1fr); gap:10px; align-items:start; }
.h-rail { position:relative; display:flex; flex-direction:column; align-items:center; height:100%; }
.h-rail::after {
  content:'';
  position:absolute;
  top:28px;
  bottom:-12px;
  left:50%;
  width:1px;
  transform:translateX(-50%);
  background:var(--border-strong);
}
.h-step:last-child .h-rail::after { display:none; }
.h-node {
  width:28px;
  height:28px;
  border-radius:50%;
  border:1.5px dotted var(--border-strong);
  background:var(--bg);
  color:var(--muted);
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
  font-size:11.5px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:1;
}
.h-step.active .h-node { border-color:var(--rose); background:var(--surface-elev); color:var(--ink); }
.h-step.is-final .h-node { border-style:solid; border-color:var(--rose); color:var(--rose-soft); }
.h-step.is-final.active .h-node { background:var(--rose); color:#130E16; }

.h-card { border:1px solid var(--border); border-radius:7px; background:var(--bg); overflow:hidden; }
.h-step.active .h-card { border-color:var(--rose); background:#281C2B; }
.h-card-head {
  padding:8px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  cursor:pointer;
  border-bottom:1px solid var(--border);
}
.h-head-left { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.h-step-label { font-size:13px; font-weight:500; color:var(--ink); }
.obs-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.obs-badge {
  padding:2px 7px;
  border-radius:4px;
  background:var(--surface);
  color:var(--muted);
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;
  font-size:11px;
}

.h-summary {
  list-style:none;
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  cursor:pointer;
  color:var(--muted);
  font-size:13px;
  user-select:none;
}
.h-summary::-webkit-details-marker { display:none; }
.h-summary:hover { color:var(--ink); }
.h-chevron { flex-shrink:0; color:var(--muted); transition:transform 150ms ease, color 150ms ease; }
.h-details[open] .h-chevron { transform:rotate(90deg); color:var(--rose); }
.h-preview { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.h-open-label { display:none; color:var(--muted-soft); font-size:12px; }
.h-details[open] .h-preview { display:none; }
.h-details[open] .h-open-label { display:inline; }
.h-reason-full {
  padding:0 12px 11px 32px;
  font-size:13.5px;
  line-height:1.56;
  color:var(--ink);
  white-space:pre-wrap;
  word-break:break-word;
}

/* Full-Width Expandable Location Browser Panel */
.browser-panel { margin:0 0 14px; }
.browser-head {
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.browser-head-left { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.browser-head-left h2 { font-family:var(--serif); font-size:20px; font-weight:500; }
.browser-head-right { display:flex; align-items:center; gap:10px; flex:1 1 280px; justify-content:flex-end; }
.browser-filters {
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px 28px;
  flex-wrap:wrap;
}
.browser-filter-group { display:flex; flex-direction:column; gap:6px; }
.browser-filter-group.dist-widget { flex:0 1 320px; min-width:240px; }

.search-wrap { position:relative; display:flex; align-items:center; flex:1 1 220px; max-width:340px; }
.search-icon { position:absolute; left:11px; color:var(--muted); pointer-events:none; }
#loc-search {
  width:100%;
  height:34px;
  padding:5px 30px 5px 32px;
  border:1px solid var(--border-strong);
  border-radius:7px;
  background:var(--bg);
  color:var(--ink);
  font-size:13.5px;
}
#loc-search::placeholder { color:var(--muted-soft); }
.search-clear {
  position:absolute;
  right:6px;
  width:22px;
  height:22px;
  border:none;
  border-radius:4px;
  background:transparent;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.search-clear:hover { color:var(--ink); background:var(--surface-elev); }

.filter-label { font-size:12px; color:var(--muted); }
.pill-row { display:flex; flex-wrap:wrap; gap:6px; }
.pill {
  appearance:none;
  border:none;
  background:var(--bg);
  color:var(--muted);
  border-radius:6px;
  padding:5px 11px;
  font-size:12.5px;
  font-weight:500;
  cursor:pointer;
}
.pill:hover { color:var(--ink); background:var(--surface-elev); }
.pill.active {
  background:var(--surface-elev);
  color:var(--rose-soft);
  box-shadow:inset 0 -2px 0 var(--rose);
}

/* 30-Bar Log-Scaled Miss Distance Histogram Slider */
.dist-widget { gap:5px; }
.dist-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.dist-readout-wrap { display:inline-flex; align-items:baseline; gap:8px; }
.dist-readout { font-size:12px; color:var(--ink); }
.dist-reset {
  appearance:none;
  border:none;
  background:transparent;
  padding:0;
  color:var(--rose-soft);
  font-size:12px;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}
.dist-chart { display:flex; flex-direction:column; }
.dist-hist { height:32px; display:flex; align-items:flex-end; gap:2px; padding:0 6px; }
.dist-bar {
  flex:1;
  min-height:2px;
  border-radius:1.5px 1.5px 0 0;
  background:#2E2130;
  transition:background 110ms ease, height 150ms ease;
}
.dist-bar.in-range { background:var(--rose); }
.dist-bar.in-range.high { background:var(--rose-deep); }
.dist-slider-wrap { position:relative; height:16px; display:flex; align-items:center; }
.dist-track { position:absolute; left:0; right:0; height:2px; background:var(--border-strong); border-radius:1px; }
.dist-fill { position:absolute; height:2px; background:var(--rose); border-radius:1px; left:0%; right:0%; }
.dist-range {
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:16px;
  margin:0;
  background:transparent;
  -webkit-appearance:none;
  appearance:none;
  pointer-events:none;
}
.dist-range::-webkit-slider-thumb {
  -webkit-appearance:none;
  pointer-events:all;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--surface);
  border:2px solid var(--rose);
  box-shadow:0 0 0 2px rgba(19,14,22,0.88);
  cursor:ew-resize;
}
.dist-range::-moz-range-thumb {
  pointer-events:all;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--surface);
  border:2px solid var(--rose);
  box-shadow:0 0 0 2px rgba(19,14,22,0.88);
  cursor:ew-resize;
}
.dist-range::-moz-range-track { background:transparent; border:none; }

.loc-grid-wrap { padding:14px 16px 14px; }
.thumb-grid { display:grid; grid-template-columns:repeat(6, minmax(0, 1fr)); gap:10px; }
@media (max-width:1180px) { .thumb-grid { grid-template-columns:repeat(4, minmax(0, 1fr)); } }
@media (max-width:760px) { .thumb-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

.browser-pagination {
  padding:9px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  background:var(--surface);
}
.browser-pagination.top { border-bottom:1px solid var(--border); }
.browser-pagination.bottom { border-top:1px solid var(--border); }
.page-controls { display:flex; align-items:center; gap:10px; }
.page-info { font-size:12.5px; color:var(--ink); min-width:96px; text-align:center; }

.thumb {
  position:relative;
  appearance:none;
  border:none;
  background:var(--bg);
  border-radius:7px;
  padding:0;
  overflow:hidden;
  cursor:pointer;
  text-align:left;
  color:var(--ink);
  transition:background 120ms ease, box-shadow 120ms ease;
}
.thumb:hover { background:var(--surface-elev); }
.thumb.active {
  background:#352435;
  box-shadow:inset 0 0 0 1.5px var(--rose-soft), 0 4px 12px rgba(237,155,190,0.18);
}
.thumb img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; background:var(--bg); }
.thumb-meta { padding:7px 9px 8px; display:flex; flex-direction:column; gap:3px; font-size:12px; }
.thumb-row1 { display:flex; align-items:center; gap:6px; }
.thumb-row2 { display:flex; justify-content:space-between; align-items:center; font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums; }
.thumb-c { color:var(--ink); font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* How It Works Modal (z-index 5000 above isolated Leaflet panes) */
.modal-backdrop {
  position:fixed;
  inset:0;
  z-index:4990;
  background:rgba(12,8,14,0.74);
  backdrop-filter:blur(2px);
}
.modal {
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  z-index:5000;
  width:min(540px, 92vw);
  background:var(--surface);
  border-radius:10px;
  box-shadow:inset 0 1px 0 var(--top-edge), 0 18px 48px rgba(0,0,0,0.65);
  overflow:hidden;
}
.modal-head { padding:14px 18px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-head h2 { font-family:var(--serif); font-size:21px; font-weight:500; }
.modal-body { padding:16px 18px 18px; display:flex; flex-direction:column; gap:11px; font-size:14px; line-height:1.58; color:var(--ink); }
.modal-body p { margin:0; }
.modal-note { font-size:12.5px; color:var(--muted); border-top:1px solid var(--border); padding-top:10px; }

.status-empty { padding:16px 10px; color:var(--muted); font-size:13.5px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
