/* ==========================================================================
   DWARAWATI — komponen Peta GIS interaktif & grafik
   ========================================================================== */
.gis {
  position: relative; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #EAF1FF, #F7F5FF); overflow: hidden;
  aspect-ratio: 16 / 10; touch-action: none; user-select: none;
}
.gis.is-fullscreen { position: fixed; inset: 12px; z-index: 200; aspect-ratio: auto; border-radius: 16px; box-shadow: var(--shadow-lg); }
.gis-stage { position: absolute; inset: 0; cursor: grab; }
.gis-stage.dragging { cursor: grabbing; }
.gis-stage svg { width: 100%; height: 100%; display: block; }
.gis .land { fill: #E7EEFF; }
.gis .grid-line { stroke: rgba(79, 70, 229, .14); stroke-width: 1; }
.gis .grid-line.major { stroke: rgba(79, 70, 229, .28); stroke-width: 1.2; }
.gis .axis-label { font-size: 11px; fill: #6B6B93; font-family: var(--font-body); }
.gis .marker { cursor: pointer; transition: r .15s ease; }
.gis .marker:hover { stroke-width: 3; }
.gis .marker-label { font-size: 11px; font-weight: 600; fill: #1B1B57; paint-order: stroke; stroke: #fff; stroke-width: 3px; font-family: var(--font-body); pointer-events: none; }

.gis-controls { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.gis-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .95); border-radius: 11px; cursor: pointer; box-shadow: var(--shadow-sm);
  font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: #2B2B63; backdrop-filter: blur(6px);
}
.gis-btn:hover { background: #fff; border-color: var(--violet-2); color: var(--violet); }
.gis-btn svg { width: 17px; height: 17px; }
.gis-zoom-level { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; gap: 8px; flex-wrap: wrap; }
.gis-chip { background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .74rem; font-weight: 600; color: #4B4B85; box-shadow: var(--shadow-sm); }
.gis-chip b { color: var(--violet); }

.gis-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 3; max-width: 260px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 12px; backdrop-filter: blur(6px);
}
.gis-legend h5 { margin: 0 0 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #4B4B85; display: flex; align-items: center; gap: 6px; }
.gis-legend ul { display: flex; flex-direction: column; gap: 3px; max-height: 172px; overflow-y: auto; }
.gis-legend li { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: #3D3D6B; }
.gis-legend button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; width: 100%; text-align: left; }
.gis-legend button:hover { color: var(--violet); }
.gis-legend button.off { opacity: .38; text-decoration: line-through; }
.gis-legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1.5px #fff; }
.gis-legend .swatch.round { border-radius: 50%; }
.gis-legend .count { margin-left: auto; color: #8A88AD; font-size: .72rem; }

.gis-scale { position: absolute; right: 12px; bottom: 12px; z-index: 3; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; box-shadow: var(--shadow-sm); }
.gis-scale .bar { height: 8px; border: 1.5px solid #2B2B63; border-top: 0; }
.gis-scale .lbl { font-size: .72rem; color: #4B4B85; text-align: center; margin-top: 2px; font-weight: 600; }
.gis-coord { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 3; background: rgba(20, 20, 63, .82); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: .72rem; font-variant-numeric: tabular-nums; }

.gis-popup {
  position: absolute; z-index: 4; width: min(300px, 78%); background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 14px 16px; transform: translate(-50%, calc(-100% - 14px));
}
.gis-popup::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.gis-popup h4 { margin: 0 0 6px; font-size: .95rem; color: #1B1B57; padding-right: 22px; }
.gis-popup .pop-close { position: absolute; top: 8px; right: 10px; border: 0; background: #F1F0FB; border-radius: 8px; cursor: pointer; padding: 2px 8px; font-size: .9rem; }
.gis-popup dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: .8rem; margin: 0 0 8px; }
.gis-popup dt { color: #6B6B93; }
.gis-popup dd { margin: 0; color: #22224F; font-weight: 500; }
.gis-popup .pop-act { display: flex; gap: 8px; flex-wrap: wrap; }
.gis-popup .pop-act a { font-size: .78rem; }
.gis-empty { display: grid; place-items: center; text-align: center; height: 100%; color: #6B6B93; font-size: .88rem; padding: 20px; }
.gis-hint { position: absolute; right: 12px; top: 12px; z-index: 2; }

.gis-legend-toggle { display: none; }
@media (max-width: 720px) {
  .gis { aspect-ratio: 4 / 3; }
  .gis-legend { max-width: calc(100% - 24px); bottom: 44px; }
  .gis-legend ul { max-height: 104px; }
  .gis-coord { display: none; }
  .gis-controls { top: 10px; right: 10px; }
}
