#radar3dCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #0b0f18;
  touch-action: none;
}

.radar-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 42px);
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(95, 113, 127, .8);
  border-radius: 5px;
  background: #0b1117;
}

.radar-view-switch button {
  min-width: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(95, 113, 127, .55);
  border-radius: 0;
  background: transparent;
  color: #96a4ae;
  font-size: 11px;
  font-weight: 700;
}

.radar-view-switch button:last-child { border-right: 0; }
.radar-view-switch button.active { background: var(--accent); color: #04110f; }
.radar-view-switch button:disabled { cursor: not-allowed; opacity: .38; }
.radar-view-switch.single-mode { grid-template-columns: 42px; }

.radar3d-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(7, 11, 14, .88);
}

.radar3d-loading[hidden] { display: none; }

.radar3d-loading-card {
  width: min(360px, calc(100% - 40px));
  padding: 18px 20px;
  border: 1px solid rgba(86, 112, 122, .75);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: rgba(12, 18, 23, .96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .34);
}

.radar3d-loading-card strong { display: block; margin-bottom: 7px; font-size: 14px; }
.radar3d-loading-card span { color: #9eabb3; font-size: 11px; line-height: 1.6; }

.radar3d-hud {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  width: min(310px, calc(100% - 24px));
  border: 1px solid rgba(86, 103, 116, .72);
  border-radius: 5px;
  background: rgba(8, 13, 18, .88);
  backdrop-filter: blur(9px);
}

.radar3d-hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(86, 103, 116, .45);
}

.radar3d-hud-head-status { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 10px; }
.radar3d-hud-head strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.radar3d-hud-head span { flex: 0 0 auto; color: var(--accent-2); font-size: 10px; }
.radar3d-hud-toggle {
  display: inline-flex;
  width: 30px;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3b4a55;
  border-radius: 4px;
  color: var(--accent-2);
  background: #151d24;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.radar3d-hud.is-collapsed .radar3d-hud-head { border-bottom: 0; }
.radar3d-hud.is-collapsed .radar3d-hud-body { display: none; }
.radar3d-view-target {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  border-bottom: 1px solid rgba(86, 103, 116, .45);
  color: #a9b5bc;
  font-size: 10px;
}
.radar3d-view-target select {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 3px 7px;
  border: 1px solid #3b4a55;
  border-radius: 4px;
  background: #111a21;
  color: #e7edef;
  font-size: 11px;
}
.radar3d-hud-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 7px; }

.radar3d-hud-actions button {
  min-width: 0;
  min-height: 32px;
  padding: 4px 5px;
  border: 1px solid #3b4a55;
  border-radius: 4px;
  background: #151d24;
  color: #d9e1e5;
  font-size: 10px;
}

.radar3d-hud-actions button.active { border-color: var(--accent); color: var(--accent-2); background: #10231f; }
.radar3d-hud-actions label {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 5px;
  border: 1px solid #3b4a55;
  border-radius: 4px;
  color: #d9e1e5;
  font-size: 10px;
  white-space: nowrap;
}

.radar3d-marker-size,
.radar3d-render-scale {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 9px 8px;
  color: #a9b5bc;
  font-size: 10px;
}

.radar3d-marker-size input,
.radar3d-render-scale input { width: 100%; accent-color: var(--accent); }
.radar3d-marker-size output,
.radar3d-render-scale output { color: #e7edef; text-align: right; }

#mapPanel[data-view="3d"] .map-view-controls,
#mapPanel[data-view="3d"] .follow-toggle,
#mapPanel[data-view="3d"] .assetHint { display: none; }

.radar3d-mini-map {
  position: absolute;
  top: 64px;
  left: 50%;
  bottom: auto;
  z-index: 5;
  width: min(280px, 30vw);
  transform: translateX(-50%);
  aspect-ratio: 1.45;
  overflow: hidden;
  border: 1px solid rgba(129, 161, 176, .85);
  border-radius: 5px;
  background: rgba(6, 12, 18, .94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  touch-action: none;
}

.radar3d-mini-map.hidden { display: none; }
.radar3d-mini-map canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.radar3d-mini-map canvas.is-panning { cursor: grabbing; }
.radar3d-mini-map-drag-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  color: rgba(219, 229, 231, .9);
  background: rgba(6, 12, 18, .72);
  border-bottom: 1px solid rgba(129, 161, 176, .55);
  cursor: move;
  touch-action: none;
  user-select: none;
}
.radar3d-mini-map-drag-handle span { font-size: 12px; line-height: 1; letter-spacing: 3px; transform: rotate(90deg); }
.radar3d-mini-map.is-dragging .radar3d-mini-map-drag-handle { cursor: grabbing; }
.radar3d-mini-map-controls {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  grid-template-columns: auto 25px 46px 25px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(129, 161, 176, .82);
  border-radius: 4px;
  background: rgba(6, 12, 18, .9);
}
.radar3d-mini-map-lock { display: inline-flex; align-items: center; gap: 2px; height: 25px; padding: 0 5px; color: #dbe5e7; font-size: 10px; white-space: nowrap; cursor: pointer; }
.radar3d-mini-map-lock input { margin: 0; accent-color: #55acef; }
.radar3d-mini-map-controls button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f1f5f4;
  font: 700 17px/1 sans-serif;
  cursor: pointer;
}
.radar3d-mini-map-controls button:disabled { color: #64727a; cursor: default; }
.radar3d-mini-map-controls output { color: #dbe5e7; font-size: 10px; text-align: center; }

body.radar3d-focus-mode { overflow: hidden; }
body.radar3d-focus-mode .radar-header,
body.radar3d-focus-mode .radar-sidebar,
body.radar3d-focus-mode .map-toolbar,
body.radar3d-focus-mode .assetHint,
body.radar3d-focus-mode .preview-toolbar,
body.radar3d-focus-mode .preview-note { display: none !important; }
body.radar3d-focus-mode main.radar-layout { display: block; width: 100vw; height: 100vh; padding: 0; }
body.radar3d-focus-mode #mapPanel { width: 100vw; height: 100vh; border: 0; border-radius: 0; padding: 0; }
body.radar3d-focus-mode .radar3d-mini-map { top: 8px; }

.radar3d-section { display: none; }
.radar3d-section.visible { display: block; }
.radar3d-status-line { display: grid; gap: 5px; color: #a9b5bc; font-size: 11px; line-height: 1.45; }
.radar3d-status-line b { color: #e7edef; font-size: 12px; }

/* Version 2 3D command-deck treatment. */
#radar3dCanvas { background: #090703; filter: sepia(.08) saturate(.86); }
.radar-view-switch {
  border-radius: 0;
  border-color: #7b5b27;
  background: #120c04;
}
.radar-view-switch button { color: #bba57c; border-right-color: #59411d; }
.radar-view-switch button.active { color: #170e00; background: #ffb000; }
.radar3d-loading { background: rgba(9, 7, 3, .92); }
.radar3d-loading-card {
  border-radius: 0;
  border-color: #765522;
  border-left: 5px solid #ffb000;
  background: rgba(20, 13, 5, .97);
}
.radar3d-loading-card span { color: #bba57c; }
.radar3d-hud {
  right: 36px;
  bottom: 36px;
  width: min(360px, calc(100% - 72px));
  border-radius: 0;
  border-color: rgba(255,176,0,.62);
  border-right: 5px solid #ffb000;
  background: rgba(13, 9, 4, .93);
  box-shadow: 12px 16px 34px rgba(0,0,0,.48);
}
.radar3d-hud-head,
.radar3d-view-target { border-color: rgba(123,91,39,.64); }
.radar3d-hud-toggle { border-radius: 0; border-color: #765522; color: #ffd66b; background: #181006; }
.radar3d-hud-head strong { color: #fff0cf; letter-spacing: .06em; }
.radar3d-hud-head span { color: #ffd66b; font-family: Consolas, monospace; }
.radar3d-view-target { color: #bba57c; }
.radar3d-view-target select {
  border-radius: 0;
  border-color: #765522;
  color: #fff0cf;
  background: #120c04;
}
.radar3d-hud-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.radar3d-hud-actions button,
.radar3d-hud-actions label {
  border-radius: 0;
  border-color: #59411d;
  color: #e7d2a8;
  background: #181006;
}
.radar3d-hud-actions button.active { border-color: #ffb000; color: #ffd66b; background: #2a1b06; }
.radar3d-marker-size,
.radar3d-render-scale { color: #bba57c; }
.radar3d-marker-size output,
.radar3d-render-scale output { color: #ffd66b; font-family: Consolas, monospace; }
.radar3d-mini-map {
  top: 36px;
  left: 36px;
  width: min(310px, 34vw);
  transform: none;
  border-radius: 0;
  border-color: rgba(255,176,0,.72);
  border-left: 4px solid #ffb000;
  background: rgba(11,7,3,.96);
}
.radar3d-mini-map-drag-handle {
  color: #ffd66b;
  border-color: #59411d;
  background: rgba(28,18,6,.9);
}
.radar3d-mini-map-controls {
  border-radius: 0;
  border-color: #765522;
  background: rgba(14,9,3,.94);
}
.radar3d-mini-map-lock,
.radar3d-mini-map-controls button,
.radar3d-mini-map-controls output { color: #f7dfad; }

@media (max-width: 560px) {
  .radar3d-hud { right: 16px; bottom: 16px; width: calc(100% - 32px); }
  .radar3d-mini-map { top: 16px; left: 16px; width: min(260px, calc(100% - 96px)); }
}

@media (max-width: 560px) {
  .map-toolbar.is-collapsed + #map,
  .map-toolbar.is-collapsed ~ #radar3dCanvas { min-height: 100%; }
  .radar3d-hud { right: 8px; bottom: 8px; width: calc(100% - 16px); }
  .radar3d-hud-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .radar3d-mini-map { top: 8px; left: 8px; bottom: auto; width: min(160px, 42%); }
  .map-toolbar:not(.is-collapsed) ~ .radar3d-mini-map { top: 8px; }
  body.radar3d-focus-mode .radar3d-mini-map { top: 8px; }
}
