/* Container */
.brm-wrapper { position: relative; margin: 0 auto; max-width: 1100px; }
#brm-map { width: 100%; height: auto; min-height: 520px; }

#brm-map svg {
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.05)) drop-shadow(0 16px 30px rgba(0,0,0,.12));
  border-radius: 10px;
  overflow: visible;
}

/* States with 3D pop effect */
.brm-state {
  cursor: pointer;
  stroke: #fff; stroke-width: 1.2px;
  transition: transform .18s cubic-bezier(.2,.7,.2,1), filter .18s ease, opacity .15s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.brm-state.is-hover { transform: translateY(-1px) scale(1.02); filter: drop-shadow(0 4px 6px rgba(0,0,0,.16)) drop-shadow(0 10px 14px rgba(0,0,0,.10)); }
.brm-state.is-active{ transform: translateY(-2px) scale(1.04); filter: drop-shadow(0 8px 10px rgba(0,0,0,.18)) drop-shadow(0 18px 26px rgba(0,0,0,.16)); }
.brm-state:hover { opacity: 0.95; }

/* Focus */
#brm-map .brm-state:focus { outline: none !important; }
#brm-map .brm-state:focus-visible { outline: none !important; stroke: #0b69c7; stroke-width: 2.5px; }

/* Region palette (supports old & new names) */
.brm-state.region-East, .brm-state.region-North-East { fill: #e3f2fd !important; }    /* East */
.brm-state.region-Southeast { fill: #64b5f6 !important; }                              /* Southeast */
.brm-state.region-Central, .brm-state.region-Midwest { fill: #c5e1a5 !important; }     /* Central/Midwest */
.brm-state.region-Great-Plains { fill: #81c784 !important; }                           /* Great Plains */
.brm-state.region-West { fill: #2e7d32 !important; }                                    /* West */

/* Popout */
#brm-popout {
  --brm-accent: #64b5f6; /* default; JS sets per region */
  position: absolute;
  left: 50%; top: 20%;
  right: auto; bottom: auto;
  width: min(440px, calc(100% - 48px));
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(120%) blur(6px);
  border: 1px solid rgba(17,24,39,.06);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 8px 16px rgba(0,0,0,.08);
  padding: 18px 18px 18px 16px;
  z-index: 9999;
  transform: translate(-50%, -16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#brm-popout.brm-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

#brm-popout .brm-card { position: relative; }
#brm-popout .brm-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--brm-accent); border-radius: 20px 0 0 20px; }

.brm-card { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; text-align: left; }
.brm-photo { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: #f4f4f4; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.brm-info { min-width: 0; font: 16px/1.5 ui-sans-serif, -apple-system, Segoe UI, Roboto, Arial, sans-serif; text-align: left; }

.brm-name{ margin:0 0 4px; font-weight:700; font-size:clamp(18px,2.2vw,22px); letter-spacing:.2px; }
.brm-title{ margin:0 0 10px; color:#4b5563; font-size:15px; }
.brm-email,.brm-phone{ display:inline-block; margin:2px 12px 2px 0; text-decoration:none; color:#0b69c7; word-break:break-word; overflow-wrap:anywhere; }
.brm-email:hover,.brm-phone:hover{ text-decoration:underline; }
.brm-region{ margin-top:10px; font-weight:700; color:#111827; }

/* Close button */
.brm-close { position:absolute; top:4px; right:4px; width:44px; height:44px; display:flex; align-items:center; justify-content:center; padding:0; border:none; background:transparent; border-radius:9999px; font-size:24px; line-height:1; cursor:pointer; color:#111827; opacity:.8; z-index:2; transition:background .15s ease, opacity .15s ease, transform .08s ease; }
.brm-close:hover,.brm-close:focus-visible{ background:rgba(0,0,0,.06); opacity:1; outline:none; }
.brm-close:active{ transform:scale(0.96); }

/* Split-state pills */
.brm-choices{ display:flex; flex-wrap:wrap; gap:8px; margin:2px 0 10px; }
.brm-choice{ font:13px/1 ui-sans-serif,-apple-system,Segoe UI,Roboto,Arial,sans-serif; padding:6px 10px; border-radius:9999px; border:1px solid rgba(17,24,39,.12); background:#fff; color:#111827; cursor:pointer; }
.brm-choice:hover{ filter:brightness(0.98); }
.brm-choice.is-active{ background:var(--brm-accent); color:#fff; border-color:transparent; }

@media (max-width: 640px) {
  #brm-popout { left: 12px; right: 12px; width: auto; top: 12px; transform: none; }
  #brm-popout.brm-open { transform: none; }
  .brm-card { grid-template-columns: 1fr; text-align: left; }
  #brm-popout .brm-card::before { display: none; }
  .brm-photo { margin: 0 0 8px 0; }
}
