.pageCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.pageHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pageTitle {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.iconBtn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.iconBtn:hover {
  filter: brightness(0.98);
}

.iconBtn svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.hintPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 900;
  font-size: 12px;
}

.groupBar {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.groupBarDivider {
  width: 1px;
  height: 26px;
  background: var(--border);
  align-self: center;
  margin: 0 2px;
}

.groupToolBtn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.groupToolBtn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.groupToolBtn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.groupToolBtn .toolPlus {
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 800;
  font-size: 13px;
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.7;
}

.chip.active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent) inset;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
}

@media (max-width: 1100px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.smartmap-mapwrap {
  height: calc(100vh - 220px);
  min-height: 720px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #ddd;
  position: relative;
}

.mapLegend--bottomLeft {
  position: absolute;
  left: 16px;
  bottom: 16px;
  top: auto;
  right: auto;
  z-index: 520;
  min-width: 180px;
  max-width: min(280px, calc(100% - 32px));
}

.mapActionStack {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 520;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.mapActionStack > * {
  pointer-events: auto;
}

.mapActionStack .smartmap-mapbadge {
  position: static !important;
  inset: auto !important;
  margin: 0;
  max-width: min(260px, calc(100vw - 48px));
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.mapActionStack .mapResetBtn {
  position: static !important;
  margin: 0;
  align-self: flex-end;
}

#tilesWrap {
  width: 100%;
  height: 100%;
}

#mapCtrl,
#mapCtrlSettings {
  width: 100%;
  height: 100%;
  min-height: 540px;
}

.sidePanel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--card);
}

.sideTitle {
  font-weight: 900;
  font-size: 1.02rem;
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.checkList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.checkItem {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btnSmall {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}

.btnPrimary {
  background: color-mix(in srgb, var(--primary) 16%, var(--card));
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.stepper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.step {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  background: var(--card);
  opacity: 0.8;
}

.step.active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.selectBox {
  margin-top: 10px;
  border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.selectedList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.selItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.selLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.selName {
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.selMeta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.dragHandle {
  cursor: grab;
  opacity: 0.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.field input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
}

.drawerHead {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawerTitle {
  font-weight: 900;
}

.drawerBody {
  padding: 14px;
  overflow: auto;
  flex: 1;
}

.miniVideo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.floatingDrawer {
  position: absolute;
  right: 16px;
  bottom: 16px;
  top: auto;
  left: auto;
  width: min(500px, calc(100% - 32px));
  min-width: 320px;
  max-width: calc(100% - 32px);
  min-height: 180px;
  max-height: calc(100% - 32px);
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
  z-index: 700;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  resize: both;
}

.floatingDrawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.drawerHead--drag {
  cursor: move;
  user-select: none;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.floatingDrawer.dragging {
  transition: none;
}

.map-selection-box {
  position: absolute;
  border: 1px dashed #2563eb;
  background: rgba(37, 99, 235, 0.14);
  pointer-events: none;
  z-index: 999;
}

.map-selecting,
.map-selecting * {
  cursor: crosshair !important;
  user-select: none !important;
}

.group-cards-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .group-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .smartmap-mapwrap {
    height: 62vh;
    min-height: 420px;
  }

  .mapLegend--bottomLeft {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }

  .mapActionStack {
    top: 12px;
    right: 12px;
    align-items: stretch;
    width: auto;
    max-width: calc(100% - 24px);
  }

  .mapActionStack .smartmap-mapbadge,
  .mapActionStack .mapResetBtn {
    align-self: flex-end;
  }

  .floatingDrawer {
    right: 12px;
    bottom: 12px;
    width: min(500px, calc(100% - 24px));
    max-width: calc(100% - 24px);
    min-width: 260px;
    max-height: min(60%, calc(100% - 24px));
    resize: none;
  }
}

@media (max-width: 600px) {
  .group-cards-grid {
    grid-template-columns: 1fr;
  }
}