.aida-map-app {
  --aida-blue: #c32026;
  --aida-blue-dark: #8f1119;
  --aida-blue-soft: #fff1f2;
  --aida-green: #0c4da2;
  --aida-bg: #fcf7f7;
  --aida-border: #ecd6d8;
  --aida-text: #3d2d33;
  --aida-muted: #7d6166;
  width: 100%;
  height: var(--aida-map-height, 760px);
  min-height: 580px;
  max-height: 900px;
  display: grid;
  grid-template-rows: minmax(300px, 58%) minmax(260px, 42%);
  overflow: hidden;
  border: 1px solid var(--aida-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(143, 17, 25, .10);
  color: var(--aida-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
}
.aida-map-app *, .aida-map-app *::before, .aida-map-app *::after { box-sizing: border-box; }
.aida-map-app button, .aida-map-app input, .aida-map-app select { font: inherit; }
.aida-map-stage { position: relative; min-height: 0; background: #fdf0f1; border-bottom: 4px solid var(--aida-blue); }
.aida-map-canvas { width: 100%; height: 100%; min-height: 300px; }
.aida-map-panel { min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #fff; }
.aida-map-toolbar { padding: 12px 14px; border-bottom: 1px solid var(--aida-border); background: #fff; }
.aida-map-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.aida-map-title { margin: 0; font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.2; color: var(--aida-blue-dark); font-weight: 750; }
.aida-map-status { color: var(--aida-muted); font-size: .82rem; white-space: nowrap; }
.aida-map-controls {
  display: grid;
  grid-template-columns: minmax(145px, 180px) minmax(0, 1fr) minmax(96px, auto);
  gap: 8px;
  align-items: center;
  width: 100%;
}
.aida-map-select, .aida-map-search {
  width: 100%; height: 42px; border: 1px solid #bdcbd9; border-radius: 8px; background: #fff; color: var(--aida-text); outline: none;
}
.aida-map-select { padding: 0 34px 0 11px; color: var(--aida-blue-dark); font-weight: 700; cursor: pointer; }
.aida-map-search { padding: 0 42px 0 12px; }
.aida-map-select:focus, .aida-map-search:focus { border-color: var(--aida-blue); box-shadow: 0 0 0 3px rgba(195,32,38,.14); }
.aida-search-wrap { position: relative; min-width: 0; width: 100%; overflow: visible; }
.aida-map-clear { position: absolute; right: 5px; top: 5px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--aida-muted); cursor: pointer; font-size: 1.25rem; line-height: 1; }
.aida-map-clear:hover, .aida-map-clear:focus { background: #fff1f2; color: var(--aida-blue-dark); }
.aida-map-search-button {
  position: relative;
  z-index: 2;
  min-width: 96px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--aida-blue);
  color: #fff;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.aida-map-search-button:hover, .aida-map-search-button:focus { background: var(--aida-blue-dark); }
.aida-map-list-wrap { min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; }
.aida-map-list { min-height: 100%; }
.aida-map-row { width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid #edf1f5; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.aida-map-row:hover, .aida-map-row:focus-visible { background: #fff6f6; outline: none; }
.aida-map-row.is-active { padding-left: 10px; border-left: 4px solid var(--aida-green); background: #f1f6fd; }
.aida-map-row-copy { flex: 1 1 auto; min-width: 0; }
.aida-map-row-name { display: block; color: var(--aida-text); font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.aida-map-row-sub { display: block; margin-top: 2px; color: var(--aida-muted); font-size: .76rem; }
.aida-map-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.aida-map-link, .aida-map-secondary { min-height: 32px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; text-decoration: none !important; font-size: .72rem; line-height: 1; font-weight: 800; white-space: nowrap; }
.aida-map-link { border: 1px solid #efc7cb; background: #fff1f2; color: var(--aida-blue-dark) !important; }
.aida-map-link:hover, .aida-map-link:focus { background: var(--aida-blue); color: #fff !important; }
.aida-map-secondary { border: 1px solid #cbd5df; background: #f5f7f9; color: #46586b; cursor: pointer; }
.aida-map-secondary:hover, .aida-map-secondary:focus { background: #46586b; color: #fff; }
.aida-map-back { position: sticky; top: 0; z-index: 20; width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid #efc7cb; background: #fff1f2; color: var(--aida-blue-dark); font-weight: 800; cursor: pointer; }
.aida-map-back:hover, .aida-map-back:focus { background: #ffe4e7; }
.aida-map-empty { padding: 26px 16px; text-align: center; color: var(--aida-muted); }
.aida-map-loader { position: absolute; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.96); color: var(--aida-blue-dark); font-weight: 750; }
.aida-map-loader[hidden] { display: none; }
.aida-map-spinner { width: 34px; height: 34px; border: 4px solid #f1d7d9; border-top-color: var(--aida-blue); border-radius: 50%; animation: aida-spin .8s linear infinite; }
@keyframes aida-spin { to { transform: rotate(360deg); } }
.aida-map-error { max-width: 520px; padding: 18px; text-align: center; }
.aida-map-retry { margin-top: 10px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--aida-blue); color: #fff; font-weight: 750; cursor: pointer; }
.aida-map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 3px 12px rgba(143,17,25,.14); color: #5c4349; font-size: .75rem; }
.aida-map-legend > span { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.aida-map-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.aida-map-app .leaflet-popup-content { margin: 12px 14px; min-width: 200px; line-height: 1.4; }
.aida-popup-title { margin-bottom: 5px; color: var(--aida-blue-dark); font-size: 1.04rem; font-weight: 800; }
.aida-popup-sub { margin-bottom: 8px; color: var(--aida-muted); font-size: .78rem; }
.aida-popup-link { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border-radius: 7px; background: var(--aida-blue); color: #fff !important; text-decoration: none !important; font-size: .8rem; font-weight: 800; }
.aida-popup-link:hover, .aida-popup-link:focus { background: var(--aida-blue-dark); }
@media (max-width: 980px) {
  .aida-map-controls { grid-template-columns: minmax(140px, 170px) minmax(0, 1fr); }
  .aida-search-wrap { grid-column: 2; }
  .aida-map-search-button { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 700px) {
  .aida-map-app { height: auto; min-height: 0; max-height: none; grid-template-rows: 48vh minmax(420px, 52vh); border-radius: 10px; }
  .aida-map-stage, .aida-map-canvas { min-height: 320px; }
  .aida-map-controls { grid-template-columns: 1fr; }
  .aida-map-select,
  .aida-search-wrap,
  .aida-map-search-button { grid-column: 1; }
  .aida-map-search-button { width: 100%; padding: 0 13px; }
  .aida-map-title-row { align-items: flex-start; }
  .aida-map-status { white-space: normal; text-align: right; }
  .aida-map-row { align-items: flex-start; }
  .aida-map-actions { max-width: 46%; }
}
@media (max-width: 430px) {
  .aida-map-app { grid-template-rows: 42vh minmax(460px, 58vh); }
  .aida-map-toolbar { padding: 11px; }
  .aida-map-row { padding: 11px; flex-direction: column; }
  .aida-map-actions { width: 100%; max-width: none; justify-content: flex-start; }
  .aida-map-link, .aida-map-secondary { flex: 1 1 auto; }
  .aida-map-legend { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .aida-map-spinner { animation-duration: 1.5s; }
  .aida-map-app * { scroll-behavior: auto !important; }
}