/* ========================================================
   CITRINE V2 • PETA PER WILAYAH (pemilih negara/provinsi, panel ringkasan, legenda)
   ======================================================== */
#cardAttackMap .map-header { flex-wrap: wrap; gap: 8px 12px; }
.mreg-tools { flex-wrap: wrap; gap: 8px; }
.mreg-tools select.c-input { width: auto; min-width: 150px; max-width: 220px; background-color: var(--c-panel); }
.mreg-tools select.c-input:disabled { opacity: 0.45; cursor: default; }
.mreg-days { padding: 2px; gap: 2px; }
.mreg-days button { height: 26px; padding: 0 10px; font-size: 11.5px; }

/* panel ringkasan mengambang di atas peta */
.mreg-panel {
  position: absolute; top: 12px; left: 12px; z-index: 800; width: 292px; max-height: calc(100% - 24px);
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(24, 24, 26, 0.94); border: 1px solid #2e2e32; border-radius: var(--c-r-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px);
}
.mreg-panel[hidden] { display: none; }
.mreg-panel > .c-loading, .mreg-panel > .c-error { padding: 16px; }
.mreg-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 12px 0 16px; }
.mreg-head-main { flex: 1; min-width: 0; }
.mreg-kicker { font-size: 11px; color: var(--c-gold); letter-spacing: 0.2px; }
.mreg-title { margin-top: 2px; font-size: 16px; font-weight: 600; color: var(--c-text-strong); line-height: 1.25; overflow-wrap: anywhere; }
.mreg-period { margin-top: 2px; font-size: 11px; color: var(--c-faint); }
.mreg-body { padding: 12px 16px 16px; overflow-y: auto; min-height: 0; }
.mreg-body .c-label { margin: 16px 0 8px; font-size: 11.5px; }
.mreg-body .c-empty, .mreg-body .c-loading { padding: 8px 0; font-size: 12.5px; }

.mreg-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mreg-kpis.three { grid-template-columns: repeat(3, 1fr); }
.mreg-kpis > div { padding: 10px 12px; border-radius: var(--c-r); background: var(--c-panel); border: 1px solid #2a2a2d; min-width: 0; }
.mreg-kpis b { display: block; font-size: 18px; font-weight: 600; color: var(--c-text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mreg-kpis b.sm { font-size: 13px; padding-top: 4px; }
.mreg-kpis b small { font-size: 12px; font-weight: 500; color: var(--c-faint); }
.mreg-kpis span { display: block; margin-top: 2px; font-size: 11px; color: var(--c-text-3); }
.mreg-kpis > div.warn b { color: #fbbf24; }

.mreg-sent { display: flex; height: 8px; margin-top: 14px; border-radius: 99px; overflow: hidden; background: #2a2a2d; gap: 2px; }
.mreg-sent span { min-width: 0; }
.mreg-sent .neg { background: var(--c-neg); }
.mreg-sent .neu { background: #5b5b63; }
.mreg-sent .pos { background: var(--c-pos); }
.mreg-sent-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11px; color: var(--c-text-3); }
.mreg-sent-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mreg-sent-legend .c-dot:not(.neg):not(.pos) { background: #5b5b63; }

.mreg-rank {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; margin: 0 -8px; box-sizing: content-box;
  background: none; border: none; border-radius: 8px; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.mreg-rank:hover { background: #232326; }
.mreg-rank .c-rank { flex: 0 0 16px; color: var(--c-faint); }
.mreg-rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mreg-rank-name { font-size: 12.5px; color: #e4e4e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mreg-bar { height: 4px; border-radius: 99px; background: #2a2a2d; overflow: hidden; }
.mreg-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c-grad-gold, var(--c-gold)); }
.mreg-rank-val { font-size: 12px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }

.mreg-place { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; color: #d4d4d8; border-bottom: 1px solid #26262a; }
.mreg-place:last-of-type { border-bottom: none; }
.mreg-place span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mreg-place b { font-weight: 500; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.mreg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mreg-chips .c-chip b { margin-left: 4px; font-weight: 500; color: var(--c-text-3); }
.mreg-hint { margin: 14px 0 0; font-size: 11px; line-height: 1.45; color: var(--c-faint); }

/* legenda warna wilayah */
.mreg-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 700; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; background: rgba(24, 24, 26, 0.9); border: 1px solid #2e2e32;
  font-size: 10.5px; color: var(--c-text-3); pointer-events: none;
}
.mreg-legend[hidden] { display: none; }
.mreg-legend i { width: 72px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(86, 66, 30, 0.6), rgb(246, 200, 92)); }
.leaflet-tooltip.mreg-tip { font-size: 12px; line-height: 1.45; color: #e4e4e7; padding: 6px 9px; }
.leaflet-tooltip.mreg-tip b { color: var(--c-text-strong); font-weight: 600; }

@media (max-width: 760px) {
  .mreg-tools { width: 100%; }
  .mreg-tools select.c-input { flex: 1 1 140px; max-width: none; }
  .mreg-panel { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 52%; }
  .mreg-legend { display: none; }
}
.mreg-legend .mreg-src { margin-left: 6px; padding-left: 8px; border-left: 1px solid #2e2e32; color: var(--c-faint); }

/* tombol buka ringkasan (panel tertutup) */
.mreg-reopen {
  position: absolute; top: 12px; left: 12px; z-index: 800; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid #2e2e32; background: rgba(24, 24, 26, 0.92);
  color: #e4e4e7; font: inherit; font-size: 12px; cursor: pointer; backdrop-filter: blur(8px);
}
.mreg-reopen:hover { border-color: var(--c-gold-line); color: var(--c-text-strong); }
.mreg-reopen[hidden] { display: none; }
.mreg-reopen svg { width: 14px; height: 14px; color: var(--c-gold); }
.mreg-rank-name small { margin-left: 6px; font-size: 11px; color: var(--c-faint); }
.leaflet-tooltip.mreg-tip .mreg-tip-sub { color: var(--c-text-3); font-size: 11px; }


.mreg-credit { margin: 10px 0 0; font-size: 10.5px; color: var(--c-faint); }
