/* Tower and 3D overview use the same quiet slate surfaces as the siting workspace. */
#tower-view-dialog {
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  max-width: 1800px;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border, #293746);
  border-radius: 12px;
  background: var(--bg, #0b1118);
  color: var(--text, #e9eff6);
  box-shadow: 0 24px 72px #0006;
  font: 13px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
#tower-view-dialog::backdrop {background: #05090fc9; backdrop-filter: blur(3px)}
.tower-view-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #293746);
  background: var(--surface, #121c27);
}
.tower-view-header > div {min-width: 0}
.tower-view-header .tower-kicker {margin: 0 0 2px; color: var(--accent, #83ddc6); font-size: 10px; font-weight: 650; letter-spacing: .04em}
.tower-view-header h2 {margin: 0; font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.015em}
.tower-view-header p:last-child {margin: 4px 0 0; font-size: 12px; color: var(--muted, #94a4b6); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap}
#tower-view-close {flex: none; display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 7px 12px; font-size: 12px; background: var(--surface-raised, #182432); border: 1px solid var(--border, #293746); border-radius: 8px; color: var(--text, #e9eff6); box-shadow: none}
#tower-view-close:hover {background: var(--surface-hover); border-color: var(--border)}
#tower-view-close span {font-size: 21px; font-weight: 400; line-height: 1; color: var(--muted, #94a4b6)}
.tower-view-body {height: calc(100% - 80px); display: grid; grid-template-columns: minmax(0, 1fr) 330px}
.tower-map-wrap {position: relative; min-width: 0; min-height: 0; background: var(--field); overflow: hidden}
#tower-map {position: absolute; inset: 0}
#tower-view-loading {position: absolute; z-index: 5; top: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 11px 15px; border: 1px solid var(--border, #293746); border-radius: 8px; color: var(--text, #e9eff6); background: var(--surface-overlay); box-shadow: var(--shadow, 0 12px 32px #0002); line-height: 1.5; font-size: 13px}
#tower-view-camera-caption {position: absolute; z-index: 3; left: 14px; top: 14px; max-width: calc(100% - 28px); padding: 7px 10px; background: var(--surface-overlay); border: 1px solid #52657a70; border-radius: 7px; color: var(--text, #e9eff6); font-size: 11px; line-height: 1.4; pointer-events: none}
.tower-crosshair {position: absolute; z-index: 2; top: 50%; left: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 1px 2px #000)}
.tower-crosshair i {position: absolute; background: #f4f7fb; opacity: .9}
.tower-crosshair i:first-child {width: 20px; height: 1px; top: 10px; left: 0}
.tower-crosshair i:last-child {height: 20px; width: 1px; top: 0; left: 10px}
.tower-controls {min-width: 0; overflow-y: auto; padding: 18px; border-left: 1px solid var(--border, #293746); scrollbar-width: thin; scrollbar-color: #425367 transparent; background: var(--surface, #121c27)}
.tower-controls label {font-size: 12px; font-weight: 550; line-height: 1.5; margin-top: 18px; color: var(--text, #e9eff6)}
.tower-controls input, .tower-controls select {height: 38px; margin-top: 7px; border: 1px solid var(--border, #293746); border-radius: 7px; background: var(--field, #0d1620); color: var(--text, #e9eff6); font-size: 13px; box-shadow: none}
.tower-controls input:hover, .tower-controls select:hover {border-color: #44566a}
.tower-controls input:focus, .tower-controls select:focus {border-color: var(--accent, #83ddc6); outline: 2px solid var(--focus-ring); outline-offset: 1px; box-shadow: none}
.tower-controls input[type=range] {height: 22px; padding: 0; margin-top: 9px; border: 0; background: transparent; accent-color: var(--accent, #83ddc6)}
.tower-controls output {font-size: 11px; color: var(--accent-strong, #a1ead7); font-weight: 550; font-variant-numeric: tabular-nums}
.tower-controls p {font-size: 12px; line-height: 1.6; color: var(--muted, #94a4b6)}
.tower-controls button {min-height: 36px; border-radius: 8px; border: 1px solid var(--border, #293746); background: var(--surface-raised, #182432); color: var(--text, #e9eff6); font-size: 12px; font-weight: 550; letter-spacing: 0; box-shadow: none}
.tower-controls button:hover {background: var(--surface-hover); border-color: #44566a}
#tower-view-dialog button:focus-visible, #tower-view-dialog a:focus-visible {outline: 2px solid var(--accent, #83ddc6); outline-offset: 3px}
.tower-mode-switch {display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border, #293746); border-radius: 10px; background: var(--field, #0d1620)}
.tower-mode-switch button {flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 12px}
.tower-mode-switch button[aria-pressed=true] {background: var(--surface-raised, #182432); border-color: var(--accent-border); color: var(--accent-strong, #a1ead7)}
.tower-mode-switch button:hover {background: var(--surface-raised, #182432)}
#tower-view-instructions {margin: 10px 0 18px; font-size: 12px; line-height: 1.5; min-height: 36px}
#tower-view-reset {width: 100%; margin-top: 16px}
.tower-info-card {padding: 13px; margin-top: 18px; border: 1px solid var(--border-soft, #202d3b); border-radius: 10px; background: var(--field, #0d1620); font-size: 12px; line-height: 1.55; color: var(--muted, #94a4b6)}
.tower-info-card h3 {margin: 0 0 8px; font-size: 12px; color: var(--text, #e9eff6); font-weight: 650; letter-spacing: 0; text-transform: none}
.tower-info-card p {margin: 6px 0}
.tower-info-card strong {color: var(--text, #e9eff6); font-weight: 600}
.tower-height-caption {margin: 7px 0; font-size: 11px}
.tower-height-value {font-size: 23px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text, #e9eff6)}
.tower-source-note {padding-top: 17px; border-top: 1px solid var(--border-soft, #202d3b); margin-top: 20px; font-size: 11px; line-height: 1.6}
.tower-source-note strong {color: var(--text); font-size: 11px; font-weight: 600}
.tower-source-note p {font-size: 11px; line-height: 1.6; margin: 8px 0}
.tower-source-note a {color: var(--accent, #83ddc6); font-size: 11px; text-underline-offset: 3px}
.tower-source-note a:hover {color: var(--accent-strong, #a1ead7)}
.tower-data-status {padding: 10px 12px; border: 1px solid #6d5736; border-radius: 8px; background: #31291c; color: #e5c68f !important; margin: 16px 0 0; line-height: 1.55 !important; font-size: 12px !important}
.tower-data-status:empty {display: none}
#tower-view-retry {margin-top: 14px; width: 100%}
.tower-map-options {padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border-soft, #202d3b)}
.tower-map-options label:first-child {margin-top: 0}
.tower-terrain-toggle {display: flex; align-items: center; gap: 9px; font-size: 12px !important}
.tower-terrain-toggle input {appearance: auto; width: 16px; height: 16px; min-width: 16px; flex: none; margin: 0; accent-color: var(--accent, #83ddc6)}

/* Keep attribution, controls, and inspected-building information legible over imagery. */
.tower-map-wrap .maplibregl-ctrl-attrib {font: 10px/1.5 system-ui, sans-serif; color: var(--muted); background: var(--surface-overlay); border-radius: 6px 0 0 0}
.tower-map-wrap .maplibregl-ctrl-attrib a {color: var(--text)}
.tower-map-wrap .maplibregl-ctrl-group {background: var(--surface, #121c27); border: 1px solid #435469; border-radius: 8px; box-shadow: 0 4px 12px #0003; overflow: hidden}
.tower-map-wrap .maplibregl-ctrl-group button {min-height: 0; border: 0; border-radius: 0; background: var(--surface, #121c27)}
.tower-map-wrap .maplibregl-ctrl-group button+button {border-top: 1px solid var(--border, #293746)}
.tower-map-wrap .maplibregl-ctrl-group button:hover {background: var(--surface-raised, #182432)}
.tower-map-wrap .maplibregl-ctrl-icon {filter: brightness(0) invert(1); opacity: .85}
.tower-map-wrap .maplibregl-ctrl-attrib-button {min-height: 0; padding: 0; border: 0; border-radius: 0; background-color: #d9e4ee}
.tower-map-wrap .maplibregl-popup-content {padding: 15px; color: var(--text, #e9eff6); background: var(--surface, #121c27); font: 12px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; border: 1px solid #435469; border-radius: 10px; box-shadow: 0 8px 24px #0004}
.tower-map-wrap .maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .tower-map-wrap .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .tower-map-wrap .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {border-top-color: var(--surface, #121c27)}
.tower-map-wrap .maplibregl-popup-anchor-top .maplibregl-popup-tip, .tower-map-wrap .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .tower-map-wrap .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {border-bottom-color: var(--surface, #121c27)}
.tower-map-wrap .maplibregl-popup-anchor-left .maplibregl-popup-tip {border-right-color: var(--surface, #121c27)}
.tower-map-wrap .maplibregl-popup-anchor-right .maplibregl-popup-tip {border-left-color: var(--surface, #121c27)}
.tower-map-wrap .maplibregl-popup-close-button {min-height: 26px; min-width: 26px; padding: 0 5px; border: 0; border-radius: 0 9px 0 6px; color: var(--muted, #94a4b6); background: transparent; font-size: 20px; line-height: 1}
.tower-map-wrap .maplibregl-popup-close-button:hover {background: var(--surface-raised, #182432); color: var(--text, #e9eff6)}
.tower-building-popup p {line-height: 1.55; margin: 8px 0; color: var(--muted, #94a4b6)}
.tower-building-popup .tower-height-value {font-size: 23px; color: var(--text, #e9eff6)}
.tower-map-wrap .maplibregl-canvas:focus-visible {outline: 2px solid var(--accent, #83ddc6); outline-offset: -3px}
#tower-view-dialog.is-tower-mode .maplibregl-ctrl-group {display: none}

@media (max-width: 800px) {
  #tower-view-dialog {width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0}
  .tower-view-header {height: 76px; padding: 12px 14px; gap: 12px}
  .tower-view-header h2 {font-size: 18px}
  .tower-view-header p:last-child {font-size: 11px; max-width: 56vw}
  .tower-view-body {height: calc(100% - 76px); display: flex; flex-direction: column; overflow-y: auto}
  .tower-map-wrap {height: 54dvh; min-height: 280px; flex: none}
  .tower-controls {padding: 18px 16px 24px; border-left: 0; border-top: 1px solid var(--border, #293746); overflow: visible}
  .tower-mode-switch button {min-height: 38px}
  .tower-controls input, .tower-controls select {font-size: 16px; height: 40px}
  .tower-controls input[type=range] {height: 24px}
  #tower-view-close {gap: 8px; min-height: 36px; padding: 7px 10px}
  #tower-view-camera-caption {left: 10px; top: 10px; max-width: calc(100% - 20px); font-size: 10px}
  .tower-map-wrap .maplibregl-ctrl-attrib {font-size: 9px}
}
@media (max-width: 380px) {
  .tower-view-header {padding: 10px 12px}
  .tower-view-header h2 {font-size: 16px}
  .tower-view-header .tower-kicker {font-size: 9px}
  .tower-view-header p:last-child {font-size: 10px; max-width: 52vw}
  #tower-view-close {gap: 6px; font-size: 11px; padding: 6px 9px}
}
@media (prefers-reduced-motion: reduce) {
  #tower-view-dialog *, #tower-view-dialog *::before, #tower-view-dialog *::after {transition: none !important}
}

