:root {
  --panel-bg: rgba(20, 20, 20, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f2f2f2;
  --muted: rgba(255, 255, 255, 0.75);
  --danger: #ff5a5a;
  --map-control-size: 36px;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
}

.sidebar,
.settingsPanel,
.panelBody,
.panelHeader,
.wpRow,
.settingsRow input,
.wpField input {
  box-sizing: border-box;
}

#map {
  height: 100%;
  width: 100%;
}

.dropOverlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 40, 40, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  pointer-events: none;
}

.dropOverlay.visible {
  display: flex;
}

.dropOverlayBox {
  width: 260px;
  height: 260px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  background: rgba(20, 20, 20, 0.7);
  color: #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  letter-spacing: 0.2px;
}

.leftControls {
  --left-panel-width: 320px;
  --dock-width: 48px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-direction: row-reverse;
  pointer-events: none;
}

.leftButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.dockButton {
  width: var(--dock-width);
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 25, 45, 0.92);
  color: #e8f4ff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
}

.dockButtonIcon {
  width: 20px;
  height: 20px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

.dockButtonIcon--waypoints {
  width: 34px !important;
  height: 34px !important;
}

.dockButtonIcon--settings {
  width: 24px;
  height: 24px;
}

.dockButton:hover {
  background: #4db3ff;
  border-color: rgba(77, 179, 255, 0.9);
  color: #0b1f33;
  box-shadow: 0 4px 14px rgba(77, 179, 255, 0.35);
}

.dockButton:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.35);
}

.dockButton.active {
  background: #4db3ff;
  border-color: rgba(77, 179, 255, 0.9);
  color: #0b1f33;
}

.leftPanel {
  width: var(--left-panel-width);
  max-width: 92vw;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.22s ease;
}

.leftControls.collapsed .leftPanel {
  transform: translateX(calc(var(--left-panel-width) - var(--dock-width)));
}

.rightControls {
  --tools-panel-width: 230px;
  --dock-width: 48px;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: calc(var(--tools-panel-width) + var(--dock-width) + 12px);
  pointer-events: none;
  height: 0;
}

.rightButtons {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.rightControls .dockButton {
  width: var(--dock-width);
  height: 44px;
}

#ExportDockBtn {
  font-size: 12px;
  line-height: 1.1;
}

.toolsPanel,
.manipulatePanel,
.exportPanel {
  position: absolute;
  top: 0;
  left: calc(var(--dock-width) + 8px);
  width: var(--tools-panel-width);
  max-width: 88vw;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform: translateX(-105%);
  opacity: 0;
  pointer-events: none;
}

.rightControls.toolsOpen .toolsPanel {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

.rightControls.manipulateOpen .manipulatePanel {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

.rightControls.exportOpen .exportPanel {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

.toolsPanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawToolStrip {
  pointer-events: auto;
}

.drawVertexIcon {
  background: transparent;
  border: none;
}

.drawVertexDot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff8c00;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.drawVertexIcon--touch .drawVertexDot {
  width: 18px;
  height: 18px;
}

.shapeSlider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 25, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transform: translateX(-12px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.2s ease;
}

.rightControls.toolsOpen .shapeSlider {
  transform: translateX(0);
  opacity: 1;
}

.shapeIconButton {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(32, 50, 80, 0.95);
  color: #e8f4ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.shapeIconButton:hover {
  background: rgba(45, 70, 110, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77, 179, 255, 0.25);
}

.shapeIconButton:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.35);
}

.shapeIconButton.active {
  background: #4db3ff;
  border-color: rgba(77, 179, 255, 0.9);
  color: #0b1f33;
  box-shadow: 0 4px 14px rgba(77, 179, 255, 0.35);
}

.drawOptionsPanel {
  display: none;
  pointer-events: none;
}

.drawOptionsPanel.visible {
  display: block;
  pointer-events: auto;
}

.sidebar {
  width: 100%;
  max-width: none;
  pointer-events: auto;
}

.sidebar.collapsed {
  width: 100%;
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px 6px;
  background: rgba(15, 25, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  color: var(--text);
  pointer-events: auto;
}

.panelHeader.collapsed {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 10px 14px;
  width: fit-content;
}

.panelTitle {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.panelHint {
  font-size: 12px;
  color: var(--muted);
}

.panelHeader.collapsed .panelHint {
  display: none;
}

.panelHeader.collapsed .waypointHeaderActions {
  display: none;
}

.waypointHeaderActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panelActionBtn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.panelActionBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.panelActionBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.travelSummary {
  padding: 8px 12px;
  color: #f5f8ff;
  font-weight: 650;
  font-size: 13px;
  background: rgba(15, 25, 45, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0 0 6px 0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  position: relative;
  z-index: 2;
}

.panelBody {
  pointer-events: auto;
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 50vh;
  overflow-y: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 10px 10px;
}

.settingsBody {
  padding: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.settingsRow {
  color: var(--text);
  font-size: 14px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settingsRow.inlineRow {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settingsRow.buttonRow {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drawOptionsPanel .settingsRow.buttonRow {
  flex-wrap: nowrap;
}

.drawOptionsPanel .settingsRow.buttonRow .toolButton {
  flex: 1 1 0;
  padding: 6px 6px;
  font-size: 12px;
  min-width: 0;
  white-space: nowrap;
}

.hiddenInput {
  display: none;
}

.exportPanel .settingsRow.buttonRow {
  justify-content: center;
}

.settingsRow label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.settingsRow input {
  cursor: pointer;
}

.settingsRow input[type="number"] {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  width: 100%;
}

.settingsRow select {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  width: 100%;
  cursor: pointer;
}

.settingsRow.inlineRow input[type="number"] {
  max-width: 120px;
}

.settingsRow.inlineRow select {
  max-width: 140px;
}

.settingsLabel {
  font-size: 12px;
  color: var(--muted);
}

.settingsDivider {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 12px 0;
}

.toolSection {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolTitle {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.settingsHint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.sidebarPanel {
  pointer-events: auto;
}

.toolButton {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
}

.toolButtonIcon {
  width: 24px;
  height: 24px;
  display: block;
}

.toolButtonIcon--ellipse {
  width: 30px;
  height: 30px;
}

.toolButtonIcon .iconStroke {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.toolButtonIcon .iconDot {
  fill: #ff4d4d;
}

.toolButton:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.toolButton.secondary {
  background: rgba(255, 255, 255, 0.08);
}

.toolButton:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.emptyState {
  color: var(--muted);
  padding: 12px 14px;
  font-size: 13px;
}

.wpRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 10px;
}

.wpRow:first-child {
  border-top: none;
}

.wpRow:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wpRow.selected {
  background: rgba(77, 179, 255, 0.16);
  border-color: rgba(77, 179, 255, 0.32);
}

.wpHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wpHeaderMain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wpHeaderActions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wpDragHandle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.wpDragHandle:active {
  cursor: grabbing;
}

.wpRow.dragging {
  opacity: 0.55;
}

.wpRow.dropBefore {
  box-shadow: 0 -2px 0 rgba(77, 179, 255, 0.9);
}

.wpRow.dropAfter {
  box-shadow: 0 2px 0 rgba(77, 179, 255, 0.9);
}

.wpCaret {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.15s ease;
}

.wpRow.expanded .wpCaret {
  transform: rotate(90deg);
}

.wpIndex {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

.wpInfo {
  min-width: 0;
}

.wpLabel {
  font-weight: 700;
  font-size: 13px;
}

.wpDelete,
.wpInsert {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  min-width: 64px;
}

.wpDelete:hover,
.wpInsert:hover {
  background: rgba(255, 255, 255, 0.2);
}

.wpDetails {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 2px;
  transition: all 0.18s ease;
}

.wpRow.expanded .wpDetails {
  max-height: 600px;
  opacity: 1;
  padding: 6px 2px 4px;
}

.wpCoordsRow {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.wpFields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.wpField label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.wpField input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.wpField select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.wpField input:focus {
  border-color: rgba(77, 179, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.2);
}

.wpField select:focus {
  border-color: rgba(77, 179, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.2);
}

.wpFieldHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--muted);
}

.wpToggleWrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wpToggleWrap input {
  width: auto;
}

.wpMarker {
  --wp-marker-size: 34px;
  --wp-marker-fill: #0d6efd;
  --wp-marker-shadow: rgba(0, 0, 0, 0.35);
  width: var(--wp-marker-size);
  height: var(--wp-marker-size);
  background: transparent;
  border: none;
  overflow: visible;
}

.wpMarker.selected {
  --wp-marker-fill: #00e676;
}

.wpMarkerDrop {
  width: 100%;
  height: 100%;
  position: relative;
  transform: rotate(var(--heading, 0deg));
  transform-origin: 50% 50%;
  filter: drop-shadow(0 3px 10px var(--wp-marker-shadow));
}

.wpMarkerSvg {
  width: 100%;
  height: 100%;
  display: block;
}

.wpMarkerShape {
  fill: var(--wp-marker-fill);
  stroke: rgba(0, 0, 0, 0.8);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wpMarkerLabel {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--heading, 0deg)));
  transform-origin: 50% 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.wpAltLabel {
  position: absolute;
  top: -12px;
  right: -14px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(calc(-1 * var(--heading, 0deg)));
  transform-origin: 50% 50%;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  width: 100%;
  max-width: 760px;
  padding: 0 12px;
}

.searchBox {
  pointer-events: auto;
  width: 100%;
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  overflow: hidden;
  opacity: 0.95;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.searchRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.searchRow input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: all 0.2s ease;
}

.searchRow input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.searchRow button {
  padding: 12px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.searchRow button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.searchRow button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.searchRow button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.results {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 260px;
  overflow: auto;
  padding: 4px 0;
}

.resultItem {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.25;
  transition: background 0.15s ease;
}

.resultItem:first-child {
  border-top: none;
}

.resultItem:hover {
  background: rgba(255, 255, 255, 0.1);
}

.resultMain {
  font-size: 14px;
  font-weight: 650;
}

.resultSub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.status {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  min-width: 230px;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

.status strong {
  color: var(--text);
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #7cff7c;
  flex: 0 0 auto;
}

.status .dot.busy {
  background: #ffd24d;
}

.status .dot.err {
  background: var(--danger);
}

.attributionHint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  pointer-events: none;
  color: rgba(0, 0, 0, 0);
}

/* Style zoom controls with dark blue background */
.leaflet-control-zoom {
  opacity: 1;
  border-radius: calc(var(--map-control-size) / 2) !important;
  overflow: hidden;
  background: #0b1f33;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.leaflet-control-zoom a {
  background: #0b1f33 !important;
  color: #e8f4ff !important;
  border: none !important;
  border-radius: 0 !important;
  width: var(--map-control-size);
  height: var(--map-control-size);
  line-height: var(--map-control-size);
}

.leaflet-control-zoom-in {
  border-top-left-radius: calc(var(--map-control-size) / 2) !important;
  border-top-right-radius: calc(var(--map-control-size) / 2) !important;
}

.leaflet-control-zoom-out {
  border-bottom-left-radius: calc(var(--map-control-size) / 2) !important;
  border-bottom-right-radius: calc(var(--map-control-size) / 2) !important;
}

.leaflet-control-zoom a:hover {
  background: #143252 !important;
}

.leaflet-control-zoom a:active {
  background: #4db3ff !important;
  color: #0b1f33 !important;
}

.leaflet-control-zoom a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.35);
}

/* Position zoom controls at bottom left */
.leaflet-bottom.leaflet-left {
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.leaflet-bottom.leaflet-left .leaflet-control {
  margin: 0;
}

.homeControl {
  order: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b1f33;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: calc(var(--map-control-size) / 2);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.homeButton {
  width: var(--map-control-size);
  height: var(--map-control-size);
  border: none;
  background: #0b1f33;
  color: #e8f4ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: calc(var(--map-control-size) / 2);
}

.homeButton:hover {
  background: #143252;
}

.homeButton:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.35);
}

.homeButton.active {
  background: #4db3ff;
  color: #0b1f33;
}

.homeButtonIcon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
  transform: rotate(0deg);
}

.leaflet-control-zoom {
  order: 1;
}

.mapModeControl {
  order: 2;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 25, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.mapModeButton {
  border: none;
  background: #0b1f33;
  color: #e8f4ff;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 12px;
  min-width: 70px;
  cursor: pointer;
  letter-spacing: 0.2px;
}

.mapModeButton + .mapModeButton {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.mapModeButton:hover {
  background: #143252;
}

.mapModeButton.active {
  background: #4db3ff;
  color: #0b1f33;
}

.leaflet-bottom.leaflet-right {
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.leaflet-bottom.leaflet-right .leaflet-control {
  margin: 0;
}

.attribToggleControl {
  order: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b1f33;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  pointer-events: auto;
}

.attribToggleButton {
  width: 22px;
  height: 22px;
  border: none;
  background: #0b1f33;
  color: #e8f4ff;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.attribToggleButton:hover {
  background: #143252;
}

.attribToggleButton:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 179, 255, 0.35);
}

.leaflet-control-attribution {
  order: 0;
  background: rgba(15, 25, 45, 0.9);
  color: #e8f4ff;
  border-radius: 10px;
  padding: 0;
  font-size: 10px;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transform-origin: right center;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.22s ease,
    padding 0.2s ease;
}

#map.showAttribution .leaflet-control-attribution {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  max-width: 320px;
  padding: 4px 8px;
}

.leaflet-control-attribution a {
  color: #9fd7ff;
}

/* Mobile adjustments */
@media (max-width: 520px) {
  .leftControls {
    --left-panel-width: 280px;
    top: 8px;
    right: 8px;
  }

  .rightControls {
    top: 8px;
    left: 8px;
    --tools-panel-width: 230px;
    --dock-width: 88px;
    width: calc(var(--tools-panel-width) + var(--dock-width) + 10px);
  }

  #ExportDockBtn {
    font-size: 10px;
  }

  .topbar {
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    padding: 0;
  }
}

body.infoOpen {
  overflow: hidden;
}

.infoOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(77, 179, 255, 0.12), rgba(8, 12, 22, 0.92)),
    rgba(8, 12, 22, 0.88);
  z-index: 2200;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.infoOverlay.visible {
  display: flex;
}

.infoPanel {
  width: min(96vw, 980px);
  max-height: calc(100vh - 48px);
  background: rgba(12, 18, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.infoHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 25, 45, 0.95);
}

.infoBrand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.infoLogo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.infoTitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}

.infoSubtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

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

.infoTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 22, 0.9);
}

.infoTab {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.infoTab:hover {
  background: rgba(255, 255, 255, 0.18);
}

.infoTab.active {
  background: #4db3ff;
  color: #0b1f33;
  border-color: rgba(77, 179, 255, 0.9);
  box-shadow: 0 4px 12px rgba(77, 179, 255, 0.35);
}

.infoBody {
  padding: 16px 18px 22px;
  overflow: auto;
}

.infoTabPanel {
  display: none;
}

.infoTabPanel.active {
  display: block;
}

.infoSection {
  margin-bottom: 18px;
}

.infoSection h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

.infoText {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.infoList,
.infoSteps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.infoList li,
.infoSteps li {
  margin-bottom: 6px;
}

.infoCallout {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.infoShortcutGrid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.4fr) minmax(160px, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.infoShortcutHeader {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  font-weight: 700;
}

.infoShortcutAction {
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
}

.infoShortcutKeys {
  color: var(--muted);
  font-size: 12px;
}

.infoKbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin: 0 2px;
}

.infoCardGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.infoCard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.infoCard:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.infoFaq details {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  color: var(--muted);
}

.infoFaq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}

.infoFaq p {
  margin: 8px 0 0;
  line-height: 1.6;
  font-size: 13px;
}

.infoSocialLinks {
  display: flex;
  align-items: center;
  gap: 10px;
}

.infoIconLink {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s ease;
}

.infoIconLink:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.infoIconLink svg {
  width: 22px;
  height: 22px;
  display: block;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 760px) {
  .infoOverlay {
    padding: 12px;
  }

  .infoHeader {
    flex-direction: column;
    align-items: flex-start;
  }

  .infoHeaderActions {
    width: 100%;
  }
}
