/* Map GPS, compass, pitch (per pane) — same glass chrome as the top toolbars.
   Sit below chrome-float (12 + 44 + 12) so the export cluster can hug the right edge.
   Desktop: wrapper is display:contents so children keep independent absolute positions.
   Mobile: wrapper is a column under the avatar (fan, then controls). */
.map-side-chrome {
  display: contents;
}

.map-controls--pane {
  position: absolute;
  top: 68px;
  right: 12px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.split-pane--mirror .map-controls--pane {
  top: 68px;
  right: 12px;
  left: auto;
}

.map-control-btn {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.map-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.map-control-btn:active {
  transform: scale(0.96);
}

.map-camera-link-btn:not(.active) {
  color: rgba(255, 200, 120, 0.95);
  background: rgba(255, 170, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 80, 0.3);
}

.map-camera-link-btn:not(.active) .material-symbols-outlined {
  /* hint at broken link when uncoupled */
  opacity: 0.95;
}

.map-control-btn .material-symbols-outlined {
  font-size: 20px !important;
}

.map-compass-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-out;
}

.map-compass-needle {
  display: block;
}

.map-compass-north {
  fill: #ff6b6b;
}

.map-compass-south {
  fill: rgba(255, 255, 255, 0.34);
}

.map-axonometry-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.map-pitch-control {
  pointer-events: auto;
  width: 36px;
  border: none;
  border-radius: 11px;
  background: transparent;
  overflow: hidden;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.map-pitch-control:hover {
  background: rgba(255, 255, 255, 0.1);
}

.map-pitch-control.dragging {
  background: rgba(196, 92, 62, 0.2);
  box-shadow: inset 0 0 0 1.5px rgba(232, 160, 120, 0.55);
}

.map-pitch-face {
  position: relative;
  width: 36px;
  height: 36px;
  overflow: hidden;
}

.map-pitch-scene {
  position: absolute;
  inset: -18px 0;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.map-pitch-control.dragging .map-pitch-scene {
  transition: none;
}

.map-pitch-sky,
.map-pitch-ground {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
}

.map-pitch-sky {
  top: 0;
  background: linear-gradient(180deg, #9dcef5 0%, #b8dff7 100%);
}

.map-pitch-ground {
  bottom: 0;
  background: linear-gradient(0deg, #5c4528 0%, #7a5c38 100%);
}

.map-pitch-ladder {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.map-pitch-ladder span {
  display: block;
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
}

.map-pitch-ladder span:nth-child(1) { width: 20px; }
.map-pitch-ladder span:nth-child(2) { width: 12px; opacity: 0.55; }
.map-pitch-ladder span:nth-child(3) { width: 20px; }

.map-pitch-aircraft {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 10px;
  pointer-events: none;
  z-index: 2;
}

.map-pitch-wing {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 4px;
  height: 2px;
  background: #f8f4ea;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.map-pitch-nose {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #f8f4ea;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.4));
}

.map-pitch-label {
  display: block;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 0 4px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .map-side-chrome {
    position: absolute;
    top: 64px;
    right: 12px;
    left: auto;
    bottom: auto;
    z-index: 24;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
  }

  .map-side-chrome .style-fan {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    order: 1;
  }

  /* Wind under Kartenauswahl (style-fan), same tile size as mobile fan. */
  .map-side-chrome .wind-control--map {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    order: 2;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    pointer-events: auto;
  }

  .map-side-chrome .wind-control--map [data-wind-arrow] {
    width: 16px;
    height: 16px;
  }

  .map-side-chrome .wind-control--map [data-wind-speed] {
    font-size: 0.5rem;
  }

  .map-side-chrome .map-controls--pane:not(.hidden) {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    order: 3;
    display: none;
  }

  .map-side-chrome:has(.style-fan.open) .map-controls--pane:not(.hidden) {
    display: flex;
  }

  /* Hide wind while tilt/rotate/location toolbar is open (style-fan reveals map-controls). */
  .map-side-chrome:has(.style-fan.open) .wind-control--map {
    display: none !important;
  }
}

/* Split-mode: two upright panes */
.map-split-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
}
.map-split-icon svg { display: block; }

/* ---- Style fan (square tiles, expand left on open) ---- */
.style-fan {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.style-fan-rail {
  /* L→R: upload | other styles | current (right). Parent aligns rail to the right. */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.style-fan-tile {
  --fan-size: 52px;
  box-sizing: border-box;
  pointer-events: auto;
  position: relative;
  flex: 0 0 auto;
  width: var(--fan-size);
  height: var(--fan-size);
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  transform-origin: center center;
  transition:
    width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    min-width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.15s,
    box-shadow 0.15s;
}

.style-fan-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.style-fan-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.style-fan.open .style-fan-tile:hover .style-fan-tip,
.style-fan.open .style-fan-tile:focus-visible .style-fan-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.style-fan-tile.active {
  border-color: rgba(110, 168, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.45);
  z-index: 2;
}

/* Closed: only the active square is visible (stays right via flex-end + last child) */
.style-fan:not(.open) .style-fan-tile:not(.active) {
  width: 0;
  min-width: 0;
  opacity: 0;
  border-width: 0;
  transform: scale(0.55);
  pointer-events: none;
  box-shadow: none;
  overflow: hidden;
}

/* Collapse flex gap for hidden tiles when closed */
.style-fan:not(.open) .style-fan-rail {
  gap: 0;
}

/* Open: equal squares, shared gap from .style-fan-rail */
.style-fan.open .style-fan-tile {
  width: var(--fan-size);
  min-width: var(--fan-size);
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Stagger open animation */
.style-fan.open .style-fan-tile:nth-child(1) { transition-delay: 0.00s; }
.style-fan.open .style-fan-tile:nth-child(2) { transition-delay: 0.02s; }
.style-fan.open .style-fan-tile:nth-child(3) { transition-delay: 0.04s; }
.style-fan.open .style-fan-tile:nth-child(4) { transition-delay: 0.06s; }
.style-fan.open .style-fan-tile:nth-child(5) { transition-delay: 0.08s; }
.style-fan.open .style-fan-tile:nth-child(6) { transition-delay: 0.10s; }
.style-fan.open .style-fan-tile:nth-child(7) { transition-delay: 0.12s; }

/*
 * Upload tile: same box model as map tiles (size, radius, border width, shadow).
 * Dashed stroke + empty fill = “empty map slot”.
 */
.style-fan-tile--upload {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 55%, transparent 100%),
    var(--surface);
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

.style-fan-tile--upload .style-fan-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 1px;
  color: rgba(255, 255, 255, 0.78);
}

.style-fan-tile--upload .material-symbols-outlined {
  font-size: 22px !important;
  line-height: 1;
}

.style-fan-tile--upload:hover {
  border-color: rgba(110, 168, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.35);
  background: rgba(66, 133, 244, 0.14);
  color: #fff;
}

/* Tooltip like other tiles when open (not in-tile label) */
.style-fan-tile--upload .style-fan-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.style-fan.open .style-fan-tile--upload:hover .style-fan-tip,
.style-fan.open .style-fan-tile--upload:focus-visible .style-fan-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Small in-tile caption under icon (always visible on the empty tile) */
.style-fan-tile--upload .style-fan-upload-caption {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  line-height: 1;
}

/* Project-image checkbox: compact chip under fan when open */
#project-image-toggle-row {
  pointer-events: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.18s, max-height 0.2s;
}

.style-fan.open #project-image-toggle-row:not(.hidden) {
  pointer-events: auto;
  opacity: 1;
  max-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

#project-image-toggle-row input {
  accent-color: #6ea8ff;
  margin: 0;
}

@media (max-width: 1100px) {
  .style-fan-tile {
    --fan-size: 40px;
    border-radius: 10px;
  }
  .style-fan:not(.open) .style-fan-rail {
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: transparent;
    box-shadow: none;
  }
  .style-fan.open .style-fan-rail {
    flex-wrap: nowrap;
    max-width: none;
    justify-content: flex-end;
  }
}

/* legacy layer-options bits (kept for any remaining refs) */
.layer-options-scrim { display: none; }
.layer-options-title {
  margin: 10px 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.layer-style-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.layer-style-upload-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.layer-style-upload-btn .material-symbols-outlined {
  font-size: 18px;
}

.layer-options-toggles {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Safety: transport mute UI is always on — hide any leftover toggles */
.map-transport-toggle {
  display: none !important;
}

/* Layers dropdown on map controls */
.map-layers-wrap {
  position: relative;
  pointer-events: auto;
}

.map-layers-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  pointer-events: auto;
  width: min(220px, 70vw);
  padding: 10px 12px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  z-index: 30;
}

.map-layers-panel-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-layers-panel .switch-row {
  pointer-events: auto;
}

/* Nested per-route visibility under Navigation master toggle */
.map-layers-route-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 6px 10px;
  padding: 0 0 4px 8px;
  border-left: 2px solid var(--border);
}

.map-layers-route-list[hidden] {
  display: none !important;
}

.map-layers-route-list.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.map-layers-panel .switch-row--nested {
  font-size: 0.78rem;
  padding-block: 2px;
}

.map-layers-route-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-control-btn[aria-pressed="true"],
.map-control-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.layer-options-title {
  margin: 10px 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.layer-options-title:first-child { margin-top: 0; }

.layer-options-meta {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.layer-bg-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.layer-bg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.68rem;
  cursor: pointer;
}

.layer-bg-btn .material-symbols-outlined { font-size: 20px; }

.layer-bg-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.layer-bg-btn.active {
  border-color: var(--primary);
  background: var(--primary-muted);
  color: var(--primary);
}

.layer-style-pills .format-pill {
  font-size: 0.68rem;
  padding: 8px 4px;
}

.osm-attribution {
  position: absolute;
  bottom: 3px;
  right: 12px;
  left: auto;
  z-index: 10;
  font-size: 0.62rem;
  line-height: 1.3;
  color: var(--text-muted);
  pointer-events: none;
  max-width: calc(100% - 24px);
  text-align: right;
}

.osm-attribution a {
  color: inherit;
  pointer-events: auto;
}

/* Unified tool popovers */
.canvas-tool-popover {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

@media (min-width: 1101px) {
  .canvas-tool-popover {
    top: calc(100% + 8px);
  }
}

@media (max-width: 1100px) {
  .canvas-tool-popover {
    top: auto;
    bottom: calc(100% + 8px);
    max-height: min(46vh, 280px);
    overflow-y: auto;
    max-width: min(320px, calc(100vw - 16px));
  }

  .canvas-tool-popover--row {
    flex-wrap: wrap;
    max-width: min(320px, calc(100vw - 16px));
  }

  .canvas-tool-popover--grid .canvas-tool-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.canvas-tool-popover--row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.canvas-tool-popover--fixed {
  position: fixed;
  z-index: 80;
}

.canvas-toolbar-symbol-picks .canvas-symbol-type-popover {
  left: 0;
  transform: none;
  padding: 4px;
}

@media (min-width: 1101px) {
  .canvas-toolbar-symbol-picks .canvas-symbol-type-popover {
    top: calc(100% + 8px);
    bottom: auto;
  }
}

.canvas-tool-popover--grid .canvas-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-width: 180px;
}

.canvas-tool-pick {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.canvas-tool-pick:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.canvas-tool-pick.active {
  background: var(--primary-muted);
  border-color: var(--primary);
  color: var(--primary);
}

.canvas-tool-pick .material-symbols-outlined { font-size: 22px; }

.canvas-tool-pick-symbol {
  padding: 1px;
  background: transparent;
  border: 2px solid transparent;
  box-sizing: border-box;
}

.canvas-tb-btn.canvas-tb-symbol.canvas-tool-pick-symbol {
  padding: 1px;
}

.canvas-tool-pick-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.canvas-tool-pick-symbol.active,
.canvas-tool-pick-symbol.active:hover {
  background: transparent;
  border-color: var(--primary);
}

/* ---- Wind control (above basemap / style-fan, same tile size) ---- */
.wind-control--map {
  position: absolute;
  bottom: calc(16px + 52px + 12px + 8px);
  right: 16px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 52px;
  padding: 4px;
  border-radius: 16px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  box-sizing: border-box;
}

.wind-control--map.hidden {
  display: none !important;
}

.wind-control--map [data-wind-arrow] {
  width: 22px;
  height: 22px;
  display: block;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff);
}

.wind-control--map [data-wind-speed] {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  color: #111;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff,
     0 0 3px #fff;
  font-variant-numeric: tabular-nums;
}

/* Desktop: keep .wind-control--map absolute (parent is display:contents).
   Do NOT set position:static here — it made wind disappear on desktop.
   Mobile: .map-side-chrome sets position:static + order under style-fan. */

.wind-map-overlay {
  /* Deprecated: wind lives in corner control / mobile chrome, not map center */
  display: none !important;
}

.wind-map-overlay.hidden {
  display: none !important;
}

.wind-map-overlay [data-wind-arrow] {
  width: 36px;
  height: 36px;
  display: block;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff);
}

.wind-map-overlay [data-wind-speed] {
  font-size: 0.78rem;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    -1.2px -1.2px 0 #fff,
     1.2px -1.2px 0 #fff,
    -1.2px  1.2px 0 #fff,
     1.2px  1.2px 0 #fff,
     0 0 4px #fff,
     0 0 2px #fff;
}

@media (min-width: 1101px) {
  body.help-open:not(.split-active) .wind-control--map {
    transform: translateX(calc(-1 * var(--sheet-shift)));
  }
  body.split-active.help-open .split-pane--mirror .wind-control--map {
    transform: translateX(calc(-1 * var(--sheet-shift)));
  }
}


/* Grouped symbol toolbar buttons (spheres / vehicles / boundaries) */
.canvas-tb-btn.canvas-tb-symbol-group {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 3px;
}

.canvas-tb-symbol-group-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.canvas-tb-symbol-group-preview span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-tb-symbol-group-preview--fruw,
.canvas-tb-symbol-group-preview--fr {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  font-size: 0.55rem;
}

.canvas-tb-symbol-group-preview--fruw .fr-f,
.canvas-tb-symbol-group-preview--fr .fr-f {
  background: #d32f2f;
  color: #fff;
}
.canvas-tb-symbol-group-preview--fruw .fr-r,
.canvas-tb-symbol-group-preview--fr .fr-r {
  background: #ffd700;
  color: #000;
}
.canvas-tb-symbol-group-preview--fruw .fr-u {
  background: #5c6bc0;
  color: #fff;
}
.canvas-tb-symbol-group-preview--fruw .fr-w {
  background: #1976d2;
  color: #fff;
}

.canvas-tb-symbol-group-preview--single {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.canvas-tb-symbol-group-preview--single img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.canvas-symbol-group-popover {
  min-width: 168px;
}

.canvas-tb-btn.canvas-tb-window-toggle {
  position: relative;
}
.canvas-tb-btn.canvas-tb-window-toggle .material-symbols-outlined {
  font-size: 22px;
}
.canvas-tb-absprache-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
  box-sizing: border-box;
}

/* ── Absprachepunkte window (desktop) / bottom overlay (mobile) ── */
.absprachepunkte-panel {
  position: absolute;
  top: 72px;
  left: 12px;
  right: auto;
  z-index: 38;
  width: min(320px, 88vw);
  min-width: 0;
  max-width: min(320px, 88vw);
  max-height: min(58vh, 420px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  border-radius: 12px;
  background: var(--chrome-bg, rgba(28, 28, 32, 0.72));
  backdrop-filter: var(--chrome-blur, blur(16px));
  -webkit-backdrop-filter: var(--chrome-blur, blur(16px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  color: var(--text, #f2f2f4);
  pointer-events: auto;
}
.absprachepunkte-panel.hidden { display: none !important; }
.absprachepunkte-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.absprachepunkte-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.absprachepunkte-title {
  flex: 1;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}
.absprachepunkte-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.absprachepunkte-close:hover {
  background: rgba(255, 255, 255, 0.1);
}
.absprachepunkte-close:focus-visible {
  outline: 2px solid #003399;
  outline-offset: -2px;
}
.absprachepunkte-close .material-symbols-outlined {
  font-size: 20px;
}
.absprachepunkte-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.absprachepunkte-symbol {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.absprachepunkte-toggle {
  display: none;
}
body.absprachepunkte-placing .absprachepunkte-panel {
  top: 72px;
}

@media (max-width: 1100px) {
  .absprachepunkte-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: 33.333vh;
    height: auto;
    border-radius: 12px;
    z-index: 38;
  }
  body.absprachepunkte-placing .absprachepunkte-panel {
    top: auto;
  }
  .canvas-toolbar-draw {
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1 1 auto;
    min-width: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .canvas-toolbar-draw::-webkit-scrollbar {
    display: none;
  }
  .canvas-toolbar-draw > .canvas-toolbar-symbols {
    flex: 0 0 auto;
    min-width: max-content;
  }
  .canvas-toolbar-draw.has-scroll-start {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000);
    mask-image: linear-gradient(to right, transparent, #000 16px, #000);
  }
  .canvas-toolbar-draw.has-scroll-end {
    -webkit-mask-image: linear-gradient(to right, #000, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, #000, #000 calc(100% - 16px), transparent);
  }
  .canvas-toolbar-draw.has-scroll-start.has-scroll-end {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
}
