/* =========================================================
   SEMAR8 — gaya aplikasi (dipindah dari <style> di index.html)
   ========================================================= */

:root {
  /* Font UI satu sumber; fallback bila Inter belum/ tidak termuat */
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Tombol & input tidak mewarisi font secara default */
button, input, select, textarea {
  font-family: inherit;
}

html, body, #map {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: var(--font-ui);
background: #f6f8fa;
}
#map { z-index:1; }
.ol-popup {
position: absolute;
min-width: 200px;
max-width: 370px;
background: linear-gradient(135deg, #f6f8fa 80%, #dde8fa 100%);
border-radius: 14px;
border: 1.6px solid #b5c0d0;
box-shadow: 0 6px 32px rgba(0,56,180,0.16), 0 2px 8px #e6eaf5;
padding: 6px 6px;
z-index: 100000;
font-size: 13.5px;
color: #205471;
transition: box-shadow 0.2s;
line-height: 1.65;
overflow: hidden;
}
/* ======================================================
   POPUP UTAMA
   ====================================================== */

.ol-popup {
  min-width: 320px;
  width: max-content;
  max-width: min(420px, calc(100vw - 28px));

  border-radius: 14px;
  overflow: hidden;

  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  border: 1px solid #d9e3ee;
  background: #fff;
}

.ol-popup .popup-title,
.ol-popup-title {
  font-size: 20px;
  font-weight: 700;
  color: #1b62c2;
  line-height: 1.25;
  padding-right: 26px;
  word-break: normal;
  overflow-wrap: break-word;
}

.ol-popup .popup-body,
.ol-popup-body,
#popup-content {
  max-height: 60vh;
  overflow-y: auto;
}
/* ======================================================
   ISI POPUP
   ====================================================== */

.popup-attr-table {
  display: flex;
  flex-direction: column;
}

.popup-attr-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 8px 12px;

  align-items: start;
  padding: 8px 0;

  border-bottom: 1px solid #edf2f7;
}

.popup-attr-row:last-child {
  border-bottom: none;
}

.popup-attr-key {
  font-weight: 700;
  color: #1b62c2;
  line-height: 1.35;
}

.popup-attr-val {
  color: #334155;
  line-height: 1.4;

  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ======================================================
   POPUP CLOSE BUTTON
   ====================================================== */

.ol-popup .popup-close {
  position: relative;

  flex: 0 0 28px;
  width: 28px;
  height: 28px;

  margin-left: 10px;
  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;

  cursor: pointer;

  transition:
    background .15s ease,
    transform .15s ease;
}


/* garis silang 1 */
.ol-popup .popup-close::before,

/* garis silang 2 */
.ol-popup .popup-close::after {
  content: "";

  position: absolute;

  top: 50%;
  left: 50%;

  width: 14px;
  height: 2px;

  border-radius: 2px;

  background: #ef4444;

  transform-origin: center;
}


.ol-popup .popup-close::before {
  transform:
    translate(-50%, -50%)
    rotate(45deg);
}


.ol-popup .popup-close::after {
  transform:
    translate(-50%, -50%)
    rotate(-45deg);
}


/* hover */
.ol-popup .popup-close:hover {
  background:
    #fee2e2;

  transform:
    scale(1.08);
}


/* merah sedikit lebih gelap saat hover */
.ol-popup .popup-close:hover::before,
.ol-popup .popup-close:hover::after {
  background:
    #dc2626;
}


/* saat diklik */
.ol-popup .popup-close:active {
  transform:
    scale(.94);
}


/* hilangkan outline jelek,
   tetapi tetap accessible saat keyboard */
.ol-popup .popup-close:focus {
  outline: none;
}


.ol-popup .popup-close:focus-visible {
  box-shadow:
    0 0 0 3px rgba(239,68,68,.18);
}

#streetview-container {
  display: none; /* awalnya hidden */
  width: 50%;
  height: 100%;
  float: right;
}

body.split-active #streetview-container {
  display: block;
}

body.split-active #map {
  width: 50%;
  float: left;
}

body.full-map #map {
  width: 100%;
}

body.sv-portrait.split-active #map {
  width: 100%;
  height: 50%;
  float: none;
}

body.sv-portrait.split-active #streetview-container {
  display: block;
  width: 100%;
  height: 50%;
  float: none;
}

/* LANDSCAPE (hp miring & desktop): eksplisit kiri-kanan full tinggi */
body.sv-landscape.split-active #map {
  width: 50%;
  height: 100%;
  float: left;
}

body.sv-landscape.split-active #streetview-container {
  display: block;
  width: 50%;
  height: 100%;
  float: right;
}

#osm-search-panel {
  position: absolute;
  top: 70px;
  right: 36px;
  z-index: 1201;
  max-width: 280px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#osm-search-results .osm-search-item {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #eee;
  margin-bottom: 4px;
  cursor: pointer;
}

#osm-search-results .osm-search-item:hover {
  background: #f0f0f0;
}

  /* Overlay login */
  #auth-overlay{
    position:fixed; inset:0;
    background:linear-gradient(120deg,#eef3ff,#f8fbff);
    display:flex; align-items:flex-start; justify-content:center;
    padding-top:60px; z-index: 99999;
  }
  .auth-card{
    width:340px; background:#fff; border:1px solid #d9e1ef; border-radius:14px;
    box-shadow:0 10px 30px rgba(0,30,160,.12); padding:18px;
  }
  .auth-card h3{margin:6px 0 12px 0; color:#0d47a1}
  .auth-foot{font-size:12px;color:#567;margin-top:10px}
  /* Badge login (atas‑tengah, biru) */
.role-badge{
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    z-index: 999;
    background:#0d47a1; color:#fff; padding:6px 10px; border-radius:999px; font-size:12px;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
    display:flex; align-items:center; gap:8px; white-space:nowrap;
  }
  .role-badge .btn-out{
    background:#fff; color:#1a73e8; border:1px solid #b5c0d0;
    border-radius:999px; padding:4px 10px; font-size:12px; cursor:pointer;
  }
    #role-badge button {
  background: #fff;
  color: #1a73e8;
  border: 1px solid #d0e0ff;
  border-radius: 999px;   /* lebih bulat */
  padding: 2px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#role-badge button:hover {
  background: #e8f0fe;
  transform: scale(1.05);
}

.card{ border:1px solid #e0e6f2; border-radius:12px; background:#fff; }
  .card-header{ padding:10px 12px; background:#f8fafc; border-bottom:1px solid #edf2ff; color:#0d47a1; border-radius:12px 12px 0 0; }
  .card-body{ padding:12px; }
  .row{ margin:8px 0; }
  .row input{ width:100%; padding:8px; border:1px solid #cbd5e1; border-radius:8px; }
  .btn-primary{ background:#1a73e8; color:#fff; border:none; border-radius:10px; padding:8px 12px; cursor:pointer; }
  .btn-ghost{ background:#fff; color:#1a73e8; border:1px solid #cbd5e1; border-radius:10px; padding:8px 12px; cursor:pointer; }
  .muted{ color:#6b7280; font-size:12px; }
.layer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
    align-items: start;
    background: #f6f8fa;
    border-radius: 12px;
    padding: 14px 12px 10px;
  }
.layer-row {
    display:flex; align-items:center;
    margin-bottom:7px; font-size:12px;
  }
  .layer-row input[type="checkbox"]{ margin-right:6px; }
  .rekap-icon{ cursor:pointer; margin-right:6px; line-height:0; font-size:15px; }
.accordion-panel {
  position: absolute;
  top: 70px;             /* pas di bawah dropdown */
  left: 36px;            /* sejajarkan dengan dropdown */
  width: 390px;          /* samakan dengan select-area */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;

  background: rgba(255,255,255,0.96);
  border: 1.5px solid #bbb;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
}

.accordion-panel .acc-body {
  font-size: 12px;   /* perkecil ukuran teks isi */
  line-height: 1.4;  /* rapat tapi tetap enak dibaca */
}

.accordion-panel .acc-body label,
.accordion-panel .acc-body summary {
  font-size: 12px;   /* khusus label dan summary */
}
.acc-item { border-bottom: 1.5px solid #e8eaf0; }
.acc-header {
padding: 10px 18px;
font-size: 15px;
font-weight: 600;
color: #175a8a;
cursor: pointer;
background: none;
user-select: none;
transition: background 0.15s;
border-radius: 10px 10px 0 0;
}
.acc-header.active,
.acc-header:hover {
background: #e9f4ff;
}
.acc-body {
padding: 12px 18px 14px 18px;
display: none;
background: none;
animation: fadeIn 0.22s;
}
@keyframes fadeIn {
from { opacity:0; transform:translateY(12px);}
to { opacity:1; transform:translateY(0);}
}
.filter-form-row {
display: flex;
align-items: flex-end;
gap: 10px;
margin-bottom: 10px;
}
.filter-form-row > div { flex: 1; }
.filter-form-row label {
font-weight: 400;
margin-bottom: 6px;
display: block;
color: #1a237e;
letter-spacing: 0.02em;
}
.filter-form-row select {
width: 100%;
padding: 8px 12px;
border-radius: 7px;
border: 1.2px solid #b5c0d0;
font-size: 14px;
background: #f8fafc;
margin-bottom: 0;
margin-top: 2px;
transition: border 0.2s;
}
.filter-form-row select:focus {
border: 1.5px solid #1a73e8;
outline: none;
}
.filter-form-row button {
height: 38px;
padding: 0 14px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
background: linear-gradient(90deg, #1a73e8 60%, #64b5f6 100%);
color: white;
border: none;
border-radius: 7px;
cursor: pointer;
box-shadow: 0 2px 8px rgba(26,115,232,0.08);
transition: background 0.2s;
}
.filter-form-row button[title="Bersihkan semua layer"] {
background: #fff;
border: 1.5px solid #b5c0d0;
color: #1a73e8;
}
.filter-form-row button:hover {
background: linear-gradient(90deg, #1565c0 60%, #42a5f5 100%);
}
.acc-body label {
margin-bottom: 8px;
margin-top: 3px;
font-size: 13.5px;
font-weight: 500;
color: #222;
display: flex;
align-items: center;
gap: 7px;
cursor: pointer;
}
.acc-body input[type="checkbox"] {
accent-color: #1a73e8;
width: 16px;
height: 16px;
margin-right: 4px;
}
#upload-box {
background:rgba(255,255,255,0.98);
border:1px solid #b5c0d0;
border-radius:12px;
box-shadow:0 1.5px 8px #eaf0fa;
padding:11px 7px 7px 7px;
margin-bottom: 7px;
width:100%;
max-width:97%;
font-family: var(--font-ui);
}
.upload-layer-row {
display:flex;
align-items:center;
background:rgba(240,246,255,0.92);
border-radius:11px;
margin-bottom:6px;
padding:6px 11px 6px 8px;
box-shadow:0 0.5px 2.5px #f0f2fa;
transition:background 0.2s;
}
.upload-layer-row:hover {
background:rgba(221,235,255,0.98);
}
.upload-layer-toggle {
width:21px;height:21px;display:flex;align-items:center;justify-content:center;
border-radius:50%;margin-right:11px;border:2.2px solid #b0c1d8;cursor:pointer;transition:background 0.16s, border 0.16s;
}
.upload-layer-toggle.on {background:#2ecc40;border-color:#27ae60;}
.upload-layer-toggle.off {background:#ff4f4f;border-color:#ffbdbd;}
.upload-layer-name {
flex:1;font-size:13.6px;color:#222B3A;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
margin-right:7px;
}
.upload-layer-btn {
font-size:11.3px;padding:2.5px 12px;margin-left:4px;border-radius:8px;border:1.3px solid #c5c9d3;
background:#fff;cursor:pointer;transition:background 0.13s,border 0.13s, color 0.13s;
font-weight:500;
}
.upload-layer-btn:hover {
background:#e8f3ff;border:1.3px solid #2196f3;color:#1565c0;
}
.upload-layer-btn.red {
border:1.3px solid #ffbdbd;background:#fff;color:#e53935;
}
.upload-layer-btn.red:hover {
background:#ffeaea;border:1.3px solid #f44336;color:#b71c1c;
}
#overlap-toolbox button {
font-size: 12px;
}
#overlap-toolbox .reset-btn {
background:#ff746c !important; color:#fff !important; border:1px solid #c3ccd6 !important;
font-weight:500; cursor:pointer;
transition: background 0.2s;
}
#overlap-toolbox .reset-btn:hover {
background:#ef5350 !important;
}
.rekap-modal {
display: none;
position: fixed;
z-index: 9999;
left: 0; top: 0; width: 100vw; height: 100vh;
background: rgba(40,55,80,0.17);
}
.rekap-modal-content {
background: #fff;
margin: 52px auto;
border-radius: 14px;
padding: 18px 18px 12px 18px;
border: 1px solid #e1e8ef;
max-width: 470px;
min-width: 260px;
box-shadow: 0 2px 16px 0 rgba(0,0,0,0.08);
position: absolute; /* <--- ini agar bisa di-drag */
left: 50%;
top: 18%;
transform: translate(-50%, 0);
transition: box-shadow 0.13s;
}
/* =========================================================
   REKAP HOTSPOT NRT — MODAL LEBAR
========================================================= */

.rekap-modal-content.firms-rekap-wide {
  width: 94vw !important;
  max-width: 94vw !important;
  min-width: 900px;
  max-height: 88vh;
  overflow: hidden;
}
.rekap-modal-close {
  color: #666;
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  margin-top: -8px;
  margin-right: -7px;
  background: none;
  border: none;
  outline: none;
  transition: color 0.13s;
}
.rekap-modal-close:hover { color: #f44336; }

/* ✅ Tombol download rekap */
.rekap-download-btn {
  float: right;
  margin-top: -6px;
  margin-right: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.3px solid #2ecc71;
  background: #eafff2;
  color: #0a7f3e;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rekap-download-btn:hover {
  background: #2ecc71;
  color: #fff;
}

/* Gaya baru untuk ringkasan total di modal */
.rekap-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  text-align: center;
}
.rekap-summary-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}
.rekap-summary-item .label {
  font-size: 12px;
  color: #475569;
  margin-bottom: 2px;
}
.rekap-summary-item .value {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}
.rekap-modal-title {
font-size: 1.08em;
font-weight: 600;
margin-bottom: 7px;
user-select: none;
cursor: move;
color: #205471;
letter-spacing: 0.01em;
}
.rekap-table-scroll {
max-height: 200px;    /* Untuk 5 baris, sesuaikan jika mau beda */
overflow-y: auto;
overflow-x: auto;
border-radius: 8px;
background: #fff;
box-shadow: 0 1px 6px #e5e7eb;
margin-top: 6px;
}
/* Efek sorot untuk baris tabel yang bisa di-zoom */
.rekap-highlight-row {
  background-color: #e3f2fd !important;
  font-weight: bold;
}

/* =========================================================
   TABEL DI MODAL REKAP — satu gaya untuk semua rekap
   (rekap per layer, gabungan, overlap, tumpang tindih KHDPK).
   CSS mengalahkan atribut border="1" bawaan tabel.
========================================================= */
.rekap-modal-content {
  max-width: min(640px, calc(100vw - 24px));
}
#rekap-modal-body table {
  width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
}
#rekap-modal-body th,
#rekap-modal-body td {
  border: 0;
  border-bottom: 1px solid #edf1f6;
  padding: 6px 8px;
  vertical-align: top;
}
#rekap-modal-body th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #cbd5e1;
}
#rekap-modal-body tbody tr:nth-child(even),
#rekap-modal-body table > tr:nth-child(even) {
  background: #fafbfd;
}
#rekap-modal-body tr[data-idx]:hover,
#rekap-modal-body tr[data-i]:hover,
#rekap-modal-body tr[data-z]:hover,
#rekap-modal-body tr[title]:hover {
  background: #eef6ff;
}
#rekap-modal-body tfoot td {
  position: sticky;
  bottom: 0;
  background: #ecfdf3;
  border-top: 1px solid #bbf7d0;
  font-weight: 600;
}
#rekap-modal-body a.rekap-zoom-link {
  color: #0b66cc;
  text-decoration: none;
  font-weight: 600;
}
#rekap-modal-body a.rekap-zoom-link:hover {
  text-decoration: underline;
}
/* Pembungkus tabel: sudut membulat + garis tipis */
#rekap-modal-body .rekap-table-scroll,
#rekap-modal-body div[style*="overflow"] {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: none;
}

/* Header modal: judul kiri (bisa panjang, turun baris), tombol kanan.
   Tidak ada lagi tombol melayang yang menutupi judul. */
.rekap-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.rekap-modal-header .rekap-modal-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.rekap-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.rekap-modal-actions #firms-rekap-download-actions {
  position: static !important;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rekap-modal-actions .rekap-download-btn {
  float: none;
  margin: 0;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  border-width: 1px;
  border-radius: 6px;
  white-space: nowrap;
}
.rekap-modal-actions .rekap-modal-close {
  float: none;
  margin: 0;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
}

/* Modal lebar untuk tabel banyak kolom (bukan FIRMS) */
.rekap-modal-content.rekap-wide {
  width: min(1100px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.rekap-modal-content.rekap-wide .rekap-modal-body {
  overflow: auto;
  min-height: 0;
}

/* Layar kecil: modal selebar layar, FIRMS tidak memaksa 900px */
@media (max-width: 900px) {
  .rekap-modal-content,
  .rekap-modal-content.firms-rekap-wide {
    min-width: 0 !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    top: 8px !important;
    margin: 0;
  }
  .rekap-summary-grid {
    grid-template-columns: 1fr;
  }
}
#cb-hazard-banjir,
#cb-hazard-longsor,
#cb-hazard-karhutla {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  transform: scale(1.1);
}
.map-tools-box {
position: absolute;
right: 28px;
bottom: 28px;
z-index: 15000;
background: #ffffff;
border: 1.5px solid #b5c0d0;
border-radius: 14px;
box-shadow: 0 4px 18px rgba(26,115,232,0.10);
padding: 8px 12px;
font-size: 13px;
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
}
.map-tools-box label {
margin-right: 6px;
font-size: 13.3px;
color: #333;
}
.map-tools-row {
display: flex;
align-items: center;
gap: 4px;
}
.map-tools-box select {
padding: 6px 10px;
border-radius: 8px;
border: 1.2px solid #b5c0d0;
font-size: 13.5px;
background: #f8fafc;
}
.map-tools-box select:focus {
border: 1.5px solid #1a73e8;
outline: none;
}
.map-tool-btn {
width: 36px;
height: 36px;
background: linear-gradient(90deg, #e3eafc 60%, #f6f8fa 100%);
color: #1976d2;
border: 1.2px solid #b5c0d0;
border-radius: 8px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 17px;
transition: background 0.2s, color 0.2s;
}
.map-tool-btn:hover {
background: #1976d2;
color: #fff;
}

/* =========================
   InaRISK Modern Legend
   ========================= */

.inarisk-legend-modern {
  font-size: 12px;
  color: #555;
}

.inarisk-legend-modern .legend-title {
  font-weight: 600;
  margin-bottom: 6px;
}

/* Gradient hijau → kuning → merah */
.inarisk-gradient {
  height: 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(
    90deg,
    #1a9850,   /* sangat rendah */
    #91cf60,
    #fee08b,   /* sedang */
    #fc8d59,
    #d73027    /* sangat tinggi */
  );
}

/* Label bawah gradient */
.inarisk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

.inarisk-note {
  font-size: 11px;
  color: #777;
  margin-top: 8px;
  line-height: 1.35;
}

/* Tambahkan di <style> atau file CSS-mu */
#upload-bucket, #upload-file {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid #b5c0d0;
  font-size: 15px;
  background: #f8fafc;
  margin-bottom: 0;
  margin-top: 2px;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(26,115,232,0.06);
}
#upload-bucket:focus, #upload-file:focus {
  border: 1.7px solid #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px #e3f0ff;
}
#upload-file {
  cursor: pointer;
  background: #f8fafc;
}
/* Modal upload compact & responsif */
/* === Modal upload: kunci isi agar tidak melebar dari kartu === */
#upload-modal-box{
  max-width: 420px !important;   /* total lebar modal */
  width: 94vw !important;
  padding: 20px 16px !important;
}

#upload-modal .card-body{
  max-width: 340px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 12px 0 0 0 !important;
  display: block;
}

/* Form & semua pembungkus ikut lebar ramping */
#upload-modal .card-body form,
#upload-modal .card-body > *,
#upload-modal .card-body .row,
#upload-modal .card-body .form-group,
#upload-modal .card-body .field,
#upload-modal .btn-primary,
#upload-modal .progress,
#upload-list{
  max-width: 340px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
  float: none !important;
  position: static !important;   /* cegah gaya lain yg absolute */
}

/* Elemen input mengikuti kontainer ramping */
#upload-modal input,
#upload-modal select,
#upload-modal textarea{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.3px solid #b5c0d0;
  font-size: 15px;
  background: #f8fafc;
  margin: 2px 0 0 0;
  transition: border .2s, box-shadow .2s;
}

/* File input biar tidak “nyodor” */
#upload-modal input[type="file"]{
  display: block !important;
}

/* Label & baris */
#upload-modal form .row{ margin: 8px 0 0 0; }
#upload-modal label{
  font-size: 14px; font-weight: 500;
  margin-bottom: 3px; display:block; color:#205471;
}

/* Tombol */
#upload-modal .btn-primary{
  border-radius: 10px;
  padding: 10px 0;
  font-size: 15px;
  margin-top: 8px;
}
#upload-modal input:focus,
#upload-modal select:focus{
  border: 1.5px solid #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px #e3f0ff;
}

/* CSS for select-area */
#select-area {
position: absolute;
top: 20px;
left: 36px;
width: 390px;
background: #ffffff;
padding: 8px 10px;
border-radius: 12px;
border: 1.5px solid #b5c0d0;
box-shadow: 0 4px 16px rgba(26,115,232,0.1);
z-index: 1100;
display: flex;
gap: 8px;
align-items: center;
}
#select-area select {
flex: 1;
padding: 7px 10px;
font-size: 13.5px;
border-radius: 7px;
border: 1.2px solid #1a73e8;
background-color: #eaf3ff;
color: #1a237e;
outline: none;
appearance: none;
}

#select-area button {
width: 36px;
height: 36px;
background-color: #1a73e8;
color: white;
border: none;
border-radius: 7px;
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 6px rgba(26,115,232,0.15);
transition: background 0.2s;
}
#select-area button:hover {
background-color: #1565c0;
}

#select-area .reset-btn {
background-color: #ffffff;
border: 1.5px solid #b5c0d0;
color: #1a73e8;
}
#select-area .reset-btn:hover {
background-color: #e0e0e0;
color: #0d47a1;
}
#legend-toggle-btn {
    width: 56px;
    height: 56px;
    padding: 6px 10px;
    font-size: 22px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);

    /* >>> INI PENTING: reset posisi lama <<< */
    position: static !important;
  }

#legend-container {
position: fixed;
top: 70px;  /* Tepat di bawah tombol toggle */
right: 28px;
z-index: 1000;
background: white;
border: 1.5px solid #ccc;
border-radius: 10px;
padding: 12px 16px;
font-size: 14px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
max-width: 250px;
}

/* === THEME PANEL (REORDERABLE) === */
#theme-panel {
  position: absolute;
  top: 80px;
  left: 36px;
  z-index: 1000;
  width: 300px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none; /* Hidden by default */
  padding: 0;
  overflow: hidden;
}
#theme-header {
  padding: 10px 14px;
  background: linear-gradient(90deg, #e3eafc 0%, #f7faff 100%);
  border-bottom: 1px solid #ddd;
  font-weight: 700;
  color: #0d47a1;
  display: flex; justify-content: space-between; align-items: center;
}
.theme-layer-item {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  transition: background 0.2s;
}
.theme-layer-item:hover { background: #f9fbfe; }
.theme-btn-move {
  cursor: pointer; border: 1px solid #ccc; background: #fff; border-radius: 4px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #555;
}
.theme-btn-move:hover { background: #eee; color: #000; }

#upload-modal-box .row { margin-top:10px; }
  #upload-modal-box input,
  #upload-modal-box select,
  #upload-modal-box button {
    width:100%;  /* biar tiap field rapat penuh ke lebar box */
  }
.upload-li {
  display:flex; align-items:center; justify-content:space-between;
  margin:3px 0; padding:4px 6px;
  border-bottom:1px solid #eee;
}
.upload-text { font-size:13.5px; color:#222; flex:1; }
.upload-meta { font-size:12px; color:#777; margin-left:6px; white-space:nowrap; }
.upload-remove {
  background:none; border:none; color:#e53935;
  font-size:16px; cursor:pointer; margin-left:8px;
  line-height:1; padding:0;
}
.upload-remove:hover { color:#b71c1c; }
#popup-content {
  font-size: 12px;   /* default 14–16 biasanya, jadi dikecilkan */
  line-height: 1.3;
}
#popup-title {
  font-size: 13px;   /* judul kalau mau agak lebih besar */
  font-weight: bold;
}
/* legend kecil rapi, tidak kena style <label> di accordion */
.tuplah-legend { display: none !important; }
.tuplah-legend .item{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:#333; }
.tuplah-chip{ display:inline-block; width:12px; height:12px; border:1px solid; border-radius:2px; }

/* noUiSlider — kompak & serasi */
#tuplah-slider.noUi-target{ border:1px solid #ccd6ea; box-shadow:none; }
#tuplah-slider.noUi-horizontal{ height:32px; padding:10px 0; }
#tuplah-slider .noUi-base{ background:#e6ebf5; border-radius:6px; }
#tuplah-slider .noUi-connects{ border-radius:6px; overflow:hidden; }
#tuplah-slider .noUi-connect{ background:#bcd5ff; }

/* handle */
#tuplah-slider .noUi-handle{
  width:16px;height:16px;border-radius:50%;border:2px solid #fff;background:#1a73e8;
  box-shadow:0 1px 4px rgba(0,0,0,.25); right:-8px; top:5px;
}
#tuplah-slider .noUi-handle:focus{ outline:none; }

/* tooltip angka → DI BAWAH handle */
#tuplah-slider .noUi-tooltip{
  background:transparent;border:0;color:#445; font-size:12px; padding:0;
  bottom:-18px; top:auto; transform:translateX(-50%);
}
#tuplah-slider { margin-bottom: 14px; }
/* Pips (6 angka tahun), sembunyikan marker titiknya tapi biarkan angkanya */
#tuplah-slider .noUi-pips { height: 6px; margin-top: 2px; }
#tuplah-slider .noUi-marker { height: 4px; background: #cfd8e3; }
#tuplah-slider .noUi-pips .noUi-value { display: none !important; }
/* ====== MODE MOBILE / PORTRAIT: split atas–bawah ====== */
@media (max-width: 768px) and (orientation: portrait) {

  html, body {
    height: 100%;
  }

  /* Map di atas, tinggi 50% */
  body.split-active #map {
    width: 100%;
    height: 50%;
    float: none;              /* hilangkan float kiri-kanan */
  }

  /* Street View di bawah, tinggi 50% */
  #streetview-container {
    float: none;
    width: 100%;
    height: 50%;
  }

  body.split-active #streetview-container {
    display: block;
  }
}

.s2-panel{
  position: fixed;
  top: 72px;          /* geser turun dari header */
  right: 14px;
  width: 220px;
  z-index: 250000;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
  overflow: hidden;
  user-select: none;
}
.s2-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 8px 10px;
  background: #0f172a;
  color:#fff;
  font-size: 12px;
  cursor: move; /* draggable */
}
.s2-actions{ display:flex; gap:6px; }
.s2-actions button{
  border:none; cursor:pointer;
  width:24px; height:22px;
  border-radius:8px;
  background: rgba(255,255,255,.15);
  color:#fff; font-size: 13px; line-height: 1;
}
.s2-actions button:hover{ background: rgba(255,255,255,.25); }

.s2-body{ padding: 10px; display:block; }
.s2-row{ display:flex; flex-direction:column; gap:4px; margin-bottom: 8px; }
.s2-row label{ font-size:11px; color:#334155; }
.s2-row input[type="number"],
.s2-row select{
  font-size:12px;
  padding:6px 8px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  outline:none;
}
.s2-inline{ display:flex; gap:8px; align-items:center; }
.s2-inline input[type="range"]{ flex:1; }

.s2-pill{
  font-size:11px;
  padding:3px 7px;
  border-radius:999px;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  color:#0f172a;
  min-width:44px;
  text-align:center;
}
.s2-status{
  margin-top:6px;
  font-size:11px;
  color:#64748b;
  border-top:1px solid #eef2f7;
  padding-top:8px;
}
/* =========================================================
   SENTINEL AOI STATISTICS
   ========================================================= */

.s2-aoi-card{
  margin-top:10px;
  padding:9px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}

.s2-aoi-select{
  width:100%;
  box-sizing:border-box;
  margin-top:5px;
  padding:6px 8px;
  font-size:11px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#0f172a;
  outline:none;
}

.s2-aoi-controls{
  display:flex;
  gap:6px;
  margin-top:7px;
}

.s2-aoi-temp{
  margin-top:7px;
}

.s2-aoi-temp .s2-aoi-small-btn{
  margin-top:6px;
}

.s2-aoi-small-btn{
  flex:1;
  padding:6px 8px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#334155;
  font-size:11px;
  cursor:pointer;
}

.s2-aoi-small-btn:hover{
  background:#f1f5f9;
}

.s2-aoi-hint{
  margin-top:7px;
  font-size:10px;
  line-height:1.4;
  color:#64748b;
}

.s2-aoi-stats-btn{
  margin-top:8px;
}

.s2-aoi-result{
  margin-top:9px;
  padding:8px;
  border:1px solid #e2e8f0;
  border-radius:9px;
  background:#fff;
  font-size:10px;
}

.s2-aoi-result-head{
  margin-bottom:7px;
  font-size:11px;
  font-weight:700;
  color:#0f172a;
}

.s2-aoi-result-meta{
  margin-bottom:7px;
  color:#64748b;
  line-height:1.45;
}

.s2-aoi-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
}

.s2-aoi-stat{
  padding:6px;
  border-radius:7px;
  background:#f8fafc;
}

.s2-aoi-stat span{
  display:block;
  margin-bottom:2px;
  color:#64748b;
  font-size:9px;
}

.s2-aoi-stat strong{
  display:block;
  color:#0f172a;
  font-size:11px;
  word-break:break-word;
}

.s2-aoi-result-note{
  margin-top:7px;
  padding-top:6px;
  border-top:1px solid #eef2f7;
  color:#64748b;
  line-height:1.4;
}
/* =========================================================
   dNBR SEVERITY
   ========================================================= */

.s2-severity{
  margin-top:9px;
  padding-top:8px;
  border-top:1px solid #e2e8f0;
}

.s2-severity-title{
  margin-bottom:7px;
  font-size:11px;
  font-weight:700;
  color:#0f172a;
}

.s2-severity-impact{
  margin-bottom:8px;
  padding:8px;
  border-radius:8px;
  background:#fff7ed;
  border:1px solid #fed7aa;
}

.s2-severity-impact span{
  display:block;
  font-size:9px;
  color:#9a3412;
}

.s2-severity-impact strong{
  display:block;
  margin-top:2px;
  font-size:13px;
  color:#7c2d12;
}

.s2-severity-impact small{
  display:block;
  margin-top:2px;
  font-size:9px;
  color:#9a3412;
}

.s2-severity-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin-bottom:8px;
}

.s2-severity-box{
  padding:6px;
  border-radius:7px;
  background:#f8fafc;
}

.s2-severity-box span{
  display:block;
  font-size:9px;
  color:#64748b;
}

.s2-severity-box strong{
  display:block;
  margin-top:2px;
  font-size:11px;
  color:#0f172a;
}

.s2-severity-box small{
  display:block;
  margin-top:1px;
  font-size:9px;
  color:#64748b;
}

.s2-severity-detail{
  margin-top:6px;
}

.s2-severity-row{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:6px;
  align-items:center;
  padding:5px 0;
  border-bottom:1px solid #f1f5f9;
  font-size:9px;
}

.s2-severity-row:last-child{
  border-bottom:none;
}

.s2-severity-row .name{
  color:#334155;
}

.s2-severity-row .area{
  font-weight:600;
  color:#0f172a;
  text-align:right;
}

.s2-severity-row .pct{
  width:45px;
  color:#64748b;
  text-align:right;
}

.s2-severity-warning{
  margin-top:7px;
  font-size:9px;
  line-height:1.4;
  color:#64748b;
}
.s2-minimized .s2-body{ display:none; }

@media (max-width: 600px) {
  .accordion-panel {
    left: 2vw;
    top: 10vw;
    width: 96vw;
    font-size: 13px;
  }
  .layer-grid{ grid-template-columns: 1fr; }
  .role-badge {
    top: 10px;
    max-width: calc(100vw - 16px);
    padding: 6px 8px;
  }

  #upload-modal .card-body {
    max-width: 98vw;
    padding: 6px 0 0 0;
  }

  #upload-modal {
    align-items: flex-start !important;
    padding-top: 10vw;
  }
} /* akhir @media (max-width: 600px) — dulu tertutup terlalu cepat */


/* Paksa overlay OL (tempat popup nempel) selalu paling atas */
.ol-overlaycontainer,
.ol-overlaycontainer-stopevent {
  z-index: 999999 !important;
}

/* Paksa popup selalu menang layer UI lain */
#popup.ol-popup,
.ol-popup {
  z-index: 1000000 !important;
  position: absolute;    /* jaga-jaga kalau rule aslinya hilang */
  pointer-events: auto;  /* biar bisa diklik */
}

.theme-btn {
  width: 36px; height: 36px;
  border: 1.5px solid #b5c0d0; border-radius: 7px;
  background: #fff; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(26,115,232,0.15);
}
.theme-btn:hover { background: #f0f4fa; }
.theme-btn.active-theme { background: #e8f0fe; border-color: #1a73e8; transform: scale(1.05); }

/* ==========================
   MODE LAYOUT CETAK DI LAYAR
   ========================== */

body.print-layout {
  background: #cfd4dc !important;
  overflow: hidden !important;
}

/* Sembunyikan UI aplikasi saat masuk mode layout */
body.print-layout #role-badge,
body.print-layout #auth-overlay,
body.print-layout #select-area,
body.print-layout #accordion-panel,
body.print-layout .accordion-panel,
body.print-layout #theme-panel,
body.print-layout #map-tools-box,
body.print-layout .map-tools-box,
body.print-layout #top-right-tools,
body.print-layout #osm-search-panel,
body.print-layout #corner-logo,
body.print-layout .ol-control,
body.print-layout .s2-panel,
body.print-layout .rekap-modal,
body.print-layout #streetview-container,
body.print-layout #cesium-split-wrap,
body.print-layout #cesium-float-ui,
body.print-layout .pov-indicator,
body.print-layout #osm-search-toggle,
body.print-layout .noUi-target,
body.print-layout #measure-result,
body.print-layout #popup {
  display: none !important;
}

/* ==========================
   TOOLBAR MODE LAYOUT
   ========================== */

#print-layout-toolbar {
  display: none;
}

body.print-layout #print-layout-toolbar {
  display: flex !important;
  position: fixed !important;
  top: 12px !important;
  right: 24px !important;
  z-index: 4000000 !important;
  gap: 8px !important;
  pointer-events: auto !important;
}

body.print-layout #print-layout-toolbar button {
  border: 1px solid #1f2937;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

body.print-layout #print-layout-toolbar button:hover {
  background: #f3f4f6;
}

/* ==========================
   HEADER / JUDUL PETA
   ========================== */

#print-header {
  display: none;
}

body.print-layout #print-header {
  display: block !important;
  position: fixed !important;
  top: 18px !important;
  left: 36px !important;
  right: 36px !important;
  height: 58px !important;
  z-index: 2000000 !important;
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  text-align: center !important;
  padding: 8px 180px 6px 180px !important;
  box-sizing: border-box !important;
}

body.print-layout #print-title,
body.print-layout #print-header h2 {
  font-size: 18px !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  color: #000000 !important;
  font-family: "Times New Roman", serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  outline: none;
  cursor: text;
}

body.print-layout #print-subtitle {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #000000 !important;
  margin-top: 3px !important;
  padding-top: 3px !important;
  border-top: 1px solid #000000 !important;
  font-family: "Times New Roman", serif !important;
  outline: none;
  cursor: text;
}

body.print-layout #print-title:focus,
body.print-layout #print-header h2:focus,
body.print-layout #print-subtitle:focus {
  background: #fff7cc;
  box-shadow: inset 0 0 0 1px #d97706;
}

/* ==========================
   AREA PETA MODE LAYOUT
   ========================== */

body.print-layout #map {
  position: fixed !important;
  top: 86px !important;
  left: 36px !important;
  right: 36px !important;
  bottom: 32px !important;
  width: calc(100vw - 72px) !important;
  height: calc(100vh - 118px) !important;
  border: 2px solid #000000 !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  z-index: 1000000 !important;
}

/* Supaya layer canvas dan label koordinat OpenLayers tetap muncul */
body.print-layout .ol-viewport,
body.print-layout .ol-layer,
body.print-layout canvas {
  visibility: visible !important;
}

/* ==========================
   ELEMEN KARTOGRAFI
   Arah utara, skala, legenda
   ========================== */

#print-extras {
  display: none;
}

body.print-layout #print-extras {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 2100000 !important;
  pointer-events: none !important;
}

/* Arah utara */
body.print-layout #print-north-arrow {
  position: fixed !important;
  top: 98px !important;
  right: 50px !important;
  width: 44px !important;
  text-align: center !important;
  background: rgba(255,255,255,0.92) !important;
  border: 1px solid #000000 !important;
  padding: 5px !important;
  box-sizing: border-box !important;
}

/* Skala peta */
body.print-layout #print-scale-bar-container {
  position: fixed !important;
  left: 52px !important;
  bottom: 46px !important;
  width: auto !important;
  max-width: 170px !important;
  background: rgba(255,255,255,0.94) !important;
  border: 1px solid #000000 !important;
  padding: 5px 8px !important;
  box-sizing: border-box !important;
  z-index: 2200000 !important;
}

/* Legenda memakai elemen asli aplikasi: #legend-box */
body.print-layout #legend-box {
  display: block !important;
  position: fixed !important;
  right: 52px !important;
  bottom: 46px !important;
  top: auto !important;
  left: auto !important;
  width: 220px !important;
  max-width: 220px !important;
  max-height: 42vh !important;
  overflow: auto !important;
  z-index: 2200000 !important;
  background: rgba(255,255,255,0.96) !important;
  border: 1px solid #000000 !important;
  border-radius: 0 !important;
  padding: 8px !important;
  box-shadow: none !important;
  font-size: 10.5px !important;
  color: #000000 !important;
  box-sizing: border-box !important;
}

body.print-layout #legend-box::before {
  content: "LEGENDA";
  display: block;
  font-weight: 800;
  text-align: center;
  font-size: 11px;
  border-bottom: 1px solid #000000;
  margin-bottom: 6px;
  padding-bottom: 3px;
}

body.print-layout #legend-content {
  font-size: 10.5px !important;
  color: #000000 !important;
}

body.print-layout #legend-content img {
  max-width: 190px !important;
  height: auto !important;
}

/* ==========================
   SKALA OPENLAYERS
   ========================== */

body.print-layout .ol-scale-line {
  background: transparent !important;
  position: static !important;
  padding: 0 !important;
}

body.print-layout .ol-scale-line-inner {
  border: 2px solid #000000 !important;
  border-top: none !important;
  color: #000000 !important;
  font-family: "Times New Roman", serif !important;
  font-size: 11px !important;
  font-weight: bold !important;
}

/* =========================================================
   SEMAR8 — KATALOG LAYER & WORKSPACE
   ========================================================= */

/* ---------- TOP LEVEL: KATALOG / WORKSPACE ---------- */
#acc-katalog-layer,
#acc-workspace {
  margin-bottom: 8px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.catalog-top-header,
.workspace-top-header {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 11px !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
}

.catalog-top-header { border-left: 4px solid #2563eb; }
.catalog-top-header:hover,
.catalog-top-header.active { background: #edf5ff !important; }

.workspace-top-header { border-left: 4px solid #6d5bd0; }
.workspace-top-header:hover,
.workspace-top-header.active { background: #f2f0ff !important; }

.main-menu-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #e4efff;
  font-size: 18px;
}

.workspace-main-icon { background: #ebe8ff; }

.main-menu-text {
  flex: 1;
  min-width: 0;
}

.main-menu-title {
  font-size: 13px;
  font-weight: 750;
  color: #17355b;
}

.main-menu-subtitle {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 400;
  color: #64748b;
}

.main-menu-arrow {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf2f7;
  color: #526274;
  font-size: 19px;
  transition: transform .2s ease;
}

.acc-header.active .main-menu-arrow { transform: rotate(90deg); }

/* ---------- KATALOG: KATEGORI UTAMA ---------- */
.catalog-main {
  margin: 9px 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid #dbe3ee !important;
  border-radius: 13px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,.06) !important;
}

.catalog-main > summary {
  list-style: none !important;
  margin: 0 !important;
}

.catalog-main > summary::-webkit-details-marker { display: none !important; }

.catalog-main-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  cursor: pointer;
  user-select: none;
  transition: background .18s ease;
}

.catalog-main-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 18px;
}

.catalog-main-text {
  flex: 1;
  min-width: 0;
}

.catalog-main-title {
  font-size: 12.5px;
  font-weight: 750;
  color: #172033;
  line-height: 1.2;
}

.catalog-main-subtitle {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.25;
}

.catalog-main-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
}

.catalog-main-chevron {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  transition: transform .2s ease;
}

.catalog-main[open] .catalog-main-chevron { transform: rotate(180deg); }

.catalog-main-body {
  padding: 5px 11px 12px;
  border-top: 1px solid #eef2f7;
}

/* warna per kategori */
.catalog-main.governance > summary { background: #f3f8f4; }
.catalog-main.governance > summary:hover { background: #eaf4ec; }
.catalog-main.governance .catalog-main-icon { background: #dff0e3; }
.catalog-main.governance .catalog-main-badge { background: #e0f2e5; color: #21643a; }
.catalog-main.governance .catalog-main-chevron { background: #e4f0e7; color: #25633a; }

.catalog-main.ecosystem > summary { background: #f1faf8; }
.catalog-main.ecosystem > summary:hover { background: #e5f6f2; }
.catalog-main.ecosystem .catalog-main-icon { background: #d8f3ec; }
.catalog-main.ecosystem .catalog-main-badge { background: #dff6ef; color: #16695a; }
.catalog-main.ecosystem .catalog-main-chevron { background: #dcf1ec; color: #16695a; }

.catalog-main.climate > summary { background: #f7f8fc; }
.catalog-main.climate > summary:hover { background: #eef1f9; }
.catalog-main.climate .catalog-main-icon { background: #e3e8f7; }
.catalog-main.climate .catalog-main-badge { background: #e9edfa; color: #40538e; }
.catalog-main.climate .catalog-main-chevron { background: #e5e9f6; color: #40538e; }

.catalog-main.monitoring > summary { background: #faf7f2; }
.catalog-main.monitoring > summary:hover { background: #f6efe5; }
.catalog-main.monitoring .catalog-main-icon { background: #f5ead9; }
.catalog-main.monitoring .catalog-main-badge { background: #f8eddc; color: #805c28; }
.catalog-main.monitoring .catalog-main-chevron { background: #f3e8d8; color: #805c28; }

.catalog-main.reference > summary { background: #f4f7fb; }
.catalog-main.reference > summary:hover { background: #eaf0f8; }
.catalog-main.reference .catalog-main-icon { background: #dfe9f5; }
.catalog-main.reference .catalog-main-badge { background: #e5edf7; color: #345d85; }
.catalog-main.reference .catalog-main-chevron { background: #e2eaf4; color: #345d85; }

/* ---------- KATALOG: ISI KATEGORI ---------- */
.catalog-section { margin-top: 12px; }
.catalog-section:first-child { margin-top: 7px; }

.catalog-section-title {
  display: flex;
  align-items: center;
  margin: 0 0 7px;
  padding: 5px 8px;
  border-left: 3px solid #89a5c4;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 750;
  color: #334155;
}

.catalog-section .layer-grid {
  margin: 0;
  padding: 5px 5px 1px;
  background: transparent;
  border-radius: 0;
}

.catalog-section .layer-row {
  min-height: 24px;
  margin-bottom: 5px;
}

.catalog-slot { opacity: .62; }
.catalog-slot-text { color: #64748b; }
.catalog-slot-badge {
  margin-left: 5px;
  padding: 1px 6px;
  border: 1px solid #d1d9e6;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
}

/* ---------- WORKSPACE ---------- */
.workspace-card {
  margin: 8px 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid #dbe3ee !important;
  border-radius: 11px !important;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15,23,42,.05) !important;
}

.workspace-card > summary {
  list-style: none !important;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
  padding: 9px 11px;
  cursor: pointer;
  user-select: none;
  background: #f8fafc;
}

.workspace-card > summary::-webkit-details-marker { display: none; }
.workspace-card > summary:hover { background: #f1f5f9; }

.workspace-card-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e8edf5;
  font-size: 15px;
}

.workspace-card-text { flex: 1; min-width: 0; }
.workspace-card-title { font-size: 11.8px; font-weight: 700; color: #263447; }
.workspace-card-subtitle { margin-top: 1px; font-size: 10px; color: #64748b; }

.workspace-chevron {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8edf5;
  color: #475569;
  transition: transform .2s ease;
}

.workspace-card[open] .workspace-chevron { transform: rotate(180deg); }

.workspace-body {
  padding: 10px 11px 12px;
  border-top: 1px solid #eef2f7;
}

.workspace-tool {
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fafcff;
}
.workspace-tool:last-child { margin-bottom: 0; }
.workspace-tool-title { margin-bottom: 6px; font-size: 11px; font-weight: 700; color: #334155; }

/* ---------- RANTAI PASOK / CM2 ---------- */
.cm2-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cm2-col { flex:1 1 220px; min-width:0; }
.cm2-input,
.cm2-select {
  width:100%;
  box-sizing:border-box;
  padding:7px 8px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  font-size:12px;
  background:#fff;
}
.cm2-btnbar { display:flex; gap:7px; margin-top:9px; flex-wrap:wrap; }
.cm2-btn {
  flex:1 1 130px;
  padding:7px 9px;
  border:none;
  border-radius:8px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.cm2-primary { background:#2563eb; color:#fff; }
.cm2-secondary { background:#10b981; color:#fff; }
.cm2-danger { background:#ef4444; color:#fff; }
.cm2-ghost { background:#f1f5f9; color:#111827; border:1px solid #dbe3ee; }
#cm2-status { margin-top:7px; font-size:11px; color:#64748b; }
#cm2-q-summary .muted { color:#6b7280; }
#cm2-acc label {
  display:block;
  margin:0 0 4px;
  font-size:11px;
  font-weight:600;
  color:#334155;
}

/* =========================================================
   REKAP MONITORING - TITIK API & PENANAMAN
   ========================================================= */

.monitoring-rekap-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 10px;
  padding: 8px 10px;

  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;

  font-size: 12px;
  color: #475569;
}

.monitoring-rekap-info strong {
  color: #1e293b;
}


/* ringkasan total */
.monitoring-rekap-total {
  margin-bottom: 10px;
  padding: 10px 12px;

  background: #f0f7ff;
  border: 1px solid #d6e7fa;
  border-radius: 10px;

  text-align: center;
}

.monitoring-rekap-total-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.monitoring-rekap-total-value {
  font-size: 22px;
  font-weight: 700;
  color: #174f86;
}


/* pembungkus tabel */
.monitoring-rekap-table-wrap {
  width: 100%;
  max-height: 330px;

  overflow-x: auto;
  overflow-y: auto;

  border: 1px solid #dbe3ee;
  border-radius: 9px;

  background: #fff;
}


/* tabel */
.monitoring-rekap-table {
  width: 100%;
  border-collapse: collapse;

  font-size: 12px;
  color: #334155;
}


/* header */
.monitoring-rekap-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;

  padding: 8px 7px;

  background: #eaf2fb;
  color: #244b74;

  border-bottom: 1px solid #cbd9e8;

  font-size: 11px;
  font-weight: 700;
  text-align: center;
}


/* body */
.monitoring-rekap-table tbody td {
  padding: 7px;

  border-bottom: 1px solid #edf1f5;

  text-align: center;
}


/* tahun */
.monitoring-rekap-table tbody td:nth-child(2) {
  font-weight: 600;
}


/* zebra */
.monitoring-rekap-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.monitoring-rekap-table tbody tr:hover {
  background: #eef6ff;
}


/* footer total */
.monitoring-rekap-table tfoot td {
  padding: 8px 7px;

  background: #edf7ef;

  border-top: 2px solid #b9d7bf;

  color: #285c34;
  font-weight: 700;
  text-align: center;
}


/* kondisi kosong */
.monitoring-rekap-empty {
  padding: 18px 12px;

  text-align: center;

  color: #64748b;
  font-size: 12px;
}

/* =========================================================
   HEADER KOLOM INARISK
   ========================================================= */

.inarisk-column-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;

  margin: 6px 5px 2px;
}

.inarisk-column-header > div {
  padding: 5px 7px;

  background: #eef3f8;
  border: 1px solid #dde5ee;
  border-radius: 6px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;

  color: #475569;
  text-align: center;
}

/* =========================================================
   PERMANENT LAYER
   ========================================================= */

.upload-layer-btn.save-icon {
  padding: 2.5px 7px;
  min-width: 27px;
  font-size: 13px;
  color: #08783f;
  border-color: #a8dfbe;
  background: #f4fff8;
}

.upload-layer-btn.save-icon:hover {
  background: #ddf8e8;
  border-color: #28a866;
  color: #056534;
}


/* MODAL */

#permanent-layer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100500;
  background: rgba(25, 40, 60, 0.28);
  align-items: center;
  justify-content: center;
}

.permanent-layer-card {
  width: min(460px, calc(100vw - 30px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;

  background: #fff;
  border-radius: 14px;
  border: 1px solid #dce5ef;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);

  padding: 18px;
}

.permanent-layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.permanent-layer-title {
  font-size: 16px;
  font-weight: 700;
  color: #205471;
}

.permanent-layer-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  color: #64748b;
}

.permanent-field {
  margin-bottom: 11px;
}

.permanent-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.permanent-field input,
.permanent-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
}

.permanent-mode-box {
  padding: 9px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.permanent-mode-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  margin: 4px 0;
  cursor: pointer;
}

.permanent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}

.permanent-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #475569;
}

.permanent-status.error {
  color: #c62828;
}

.permanent-status.success {
  color: #08783f;
}

/* ======================================================
   PERMANENT LAYER — POPUP CONFIG
   ====================================================== */

.permanent-settings-icon {
  cursor: pointer;
  margin-left: 6px;
  font-size: 14px;
  opacity: .62;
  transition: opacity .15s, transform .15s;
}

.permanent-settings-icon:hover {
  opacity: 1;
  transform: rotate(25deg);
}


.popup-config-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300000;
  background: rgba(15, 23, 42, .30);
  align-items: center;
  justify-content: center;
}


.popup-config-card {
  width: min(460px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;

  background: #fff;
  border-radius: 14px;
  border: 1px solid #dbe3ee;

  box-shadow:
    0 18px 45px rgba(15,23,42,.20);

  overflow: hidden;
}


.popup-config-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  padding: 14px 16px;

  background:
    linear-gradient(
      90deg,
      #eaf2ff,
      #f8fbff
    );

  border-bottom:
    1px solid #e2e8f0;
}


.popup-config-title {
  font-size: 15px;
  font-weight: 700;
  color: #175a8a;
}


.popup-config-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}


.popup-config-close {
  border: none;
  background: none;
  color: #ef4444;
  font-size: 23px;
  cursor: pointer;
}


.popup-config-body {
  padding: 15px 16px;
  overflow-y: auto;
}


.popup-config-field {
  margin-top: 14px;
}


.popup-config-field > label,
.popup-config-field-header > label {
  display: block;
  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;
  color: #334155;
}


.popup-config-field select {
  width: 100%;
  box-sizing: border-box;

  padding: 8px 10px;

  border:
    1px solid #cbd5e1;

  border-radius: 8px;

  background: #fff;
  font-size: 12px;
}


.popup-config-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 6px;
}


.popup-config-mini-btn {
  border:
    1px solid #cbd5e1;

  background: #fff;

  border-radius: 6px;

  padding: 3px 7px;

  font-size: 10px;

  cursor: pointer;
}


.popup-config-fields {
  max-height: 260px;

  overflow-y: auto;

  border:
    1px solid #e2e8f0;

  border-radius: 9px;

  padding: 6px 9px;

  background: #f8fafc;
}

.popup-config-field-row:last-child {
  border-bottom: none;
}

.popup-config-field-row .field-name {
  overflow-wrap: anywhere;
}

.popup-config-field-row .field-badge {
  font-size: 9px;

  padding: 2px 5px;

  border-radius: 999px;

  background: #e2e8f0;

  color: #475569;
}


.popup-config-field-row .field-badge.admin {
  background: #dcfce7;
  color: #166534;
}


.popup-config-switch {
  display: flex;
  align-items: center;
  gap: 7px;

  font-size: 12px;
  color: #334155;

  cursor: pointer;
}


.popup-config-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;

  padding: 12px 16px;

  border-top:
    1px solid #e2e8f0;

  background: #f8fafc;
}

.popup-config-field-row {
  display: grid;

  grid-template-columns:
    18px
    minmax(70px, 1fr)
    auto
    minmax(115px, 1.4fr)
    auto;

  align-items: center;

  gap: 6px;

  padding: 6px 2px;

  border-bottom:
    1px solid #edf2f7;

  font-size: 11px;
}


.popup-config-alias-input {
  width: 100%;
  box-sizing: border-box;

  padding: 5px 7px;

  border:
    1px solid #cbd5e1;

  border-radius: 6px;

  background: #fff;

  font-size: 11px;
}


.popup-config-alias-input:focus {
  outline: none;

  border-color:
    #1a73e8;
}


.popup-config-order-controls {
  display: flex;

  gap: 2px;
}


.popup-config-order-btn {
  width: 23px;
  height: 23px;

  padding: 0;

  border:
    1px solid #cbd5e1;

  border-radius: 5px;

  background: #fff;

  color: #475569;

  cursor: pointer;

  font-size: 12px;
}


.popup-config-order-btn:hover {
  background:
    #eaf2ff;

  color:
    #1a73e8;
}

/* ======================================================
   POPUP HEADER — RAPI & PROPORSIONAL
   ====================================================== */

.ol-popup {
  padding: 0 !important;
  overflow: hidden;
}


/* Header */
.ol-popup .popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  padding: 11px 12px 9px 14px;

  background: linear-gradient(
    90deg,
    #f7fbff 0%,
    #eef5fd 100%
  );

  border-bottom: 1px solid #e2e8f0;
}


/* Judul */
.ol-popup #popup-title {
  flex: 1;
  min-width: 0;

  margin: 0;
  padding: 0;

  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;

  color: #1b62c2;

  overflow-wrap: break-word;
}


/* Tombol Close */
.ol-popup .popup-close {
  position: relative;

  flex: 0 0 30px;

  width: 30px;
  height: 30px;

  margin: 0;
  padding: 0;

  border: none;
  border-radius: 50%;

  background: rgba(239, 68, 68, 0.08);

  cursor: pointer;

  transition:
    background .15s ease,
    transform .15s ease;
}


/* Garis X */
.ol-popup .popup-close::before,
.ol-popup .popup-close::after {
  content: "";

  position: absolute;

  top: 50%;
  left: 50%;

  width: 13px;
  height: 2px;

  border-radius: 2px;

  background: #ef4444;

  transform-origin: center;
}


.ol-popup .popup-close::before {
  transform:
    translate(-50%, -50%)
    rotate(45deg);
}


.ol-popup .popup-close::after {
  transform:
    translate(-50%, -50%)
    rotate(-45deg);
}


/* Hover */
.ol-popup .popup-close:hover {
  background: #fee2e2;
  transform: scale(1.06);
}


.ol-popup .popup-close:hover::before,
.ol-popup .popup-close:hover::after {
  background: #dc2626;
}


/* Klik */
.ol-popup .popup-close:active {
  transform: scale(.94);
}


/* Isi popup */
.ol-popup #popup-content {
  padding: 10px 14px 12px;
}


/* Loading */
.ol-popup #popup-loading {
  padding: 10px 14px 12px;

  font-size: 12px;
  color: #64748b;
}

/* =========================================================
   LAYER STYLE — ICON + POPUP
   ========================================================= */

.layer-style-icon {
  position: relative;
  cursor: pointer;
  margin-right: 6px;
  line-height: 1;
  font-size: 15px;
  opacity: .75;
  transition: transform .15s ease, opacity .15s ease;
}

.layer-style-icon:hover {
  opacity: 1;
  transform: scale(1.13);
}

/* tanda kecil jika style temporary aktif */
.layer-style-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--layer-style-color, #94a3b8);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px #94a3b8;
  opacity: 0;
}

.layer-style-icon.has-style::after {
  opacity: 1;
}


/* POPUP */

#layer-style-popup {
  display: none;
  position: fixed;
  width: 245px;
  z-index: 3500000;

  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 12px;

  box-shadow:
    0 12px 32px rgba(15,23,42,.20);

  overflow: hidden;
}

.layer-style-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 9px 11px;

  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.layer-style-popup-title {
  min-width: 0;
}

.layer-style-popup-title strong {
  display: block;
  font-size: 12px;
  color: #334155;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-style-popup-title span {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  color: #64748b;
}

.layer-style-popup-close {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-size: 19px;
  cursor: pointer;
}

.layer-style-popup-body {
  padding: 11px;
}

.layer-style-popup-label {
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
}


/* PILIHAN WARNA */

.layer-style-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.layer-style-color {
  width: 23px;
  height: 23px;

  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;

  box-shadow:
    0 0 0 1px #cbd5e1;

  cursor: pointer;
}

.layer-style-color:hover {
  transform: scale(1.12);
}

.layer-style-color.active {
  box-shadow:
    0 0 0 2px #2563eb,
    0 0 0 4px rgba(37,99,235,.14);
}


/* CUSTOM COLOR */

.layer-style-custom {
  position: relative;

  width: 25px;
  height: 25px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #cbd5e1;
  border-radius: 7px;

  background: #fff;

  font-size: 14px;
  cursor: pointer;

  overflow: hidden;
}

.layer-style-custom input {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  opacity: 0;
  cursor: pointer;
}


/* TRANSPARANSI */

.layer-style-opacity {
  margin-top: 13px;
}

.layer-style-opacity-head {
  display: flex;
  justify-content: space-between;

  margin-bottom: 5px;

  font-size: 10.5px;
  color: #475569;
}

.layer-style-opacity input {
  width: 100%;
  margin: 0;
}


/* FOOTER */

.layer-style-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;

  margin-top: 11px;
  padding-top: 9px;

  border-top: 1px solid #eef2f7;
}

.layer-style-reset {
  padding: 5px 9px;

  border: 1px solid #cbd5e1;
  border-radius: 7px;

  background: #fff;
  color: #475569;

  font-size: 10.5px;
  cursor: pointer;
}

.layer-style-reset:hover {
  background: #f1f5f9;
}

/* ==========================
   MODE PRINT ASLI
   ========================== */

@media print {
  @page {
    size: A4 landscape;
    margin: 7mm;
  }

  html,
  body {
    width: 297mm !important;
    height: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  body.print-layout {
    background: #ffffff !important;
  }

  /* Toolbar jangan ikut tercetak */
  body.print-layout #print-layout-toolbar {
    display: none !important;
  }

  /* Pastikan UI aplikasi tetap tidak ikut print */
  body.print-layout #role-badge,
  body.print-layout #auth-overlay,
  body.print-layout #select-area,
  body.print-layout #accordion-panel,
  body.print-layout .accordion-panel,
  body.print-layout #theme-panel,
  body.print-layout #map-tools-box,
  body.print-layout .map-tools-box,
  body.print-layout #top-right-tools,
  body.print-layout #osm-search-panel,
  body.print-layout #corner-logo,
  body.print-layout .ol-control,
  body.print-layout .s2-panel,
  body.print-layout .rekap-modal,
  body.print-layout #streetview-container,
  body.print-layout #cesium-split-wrap,
  body.print-layout #cesium-float-ui,
  body.print-layout .pov-indicator,
  body.print-layout #osm-search-toggle,
  body.print-layout .noUi-target,
  body.print-layout #measure-result,
  body.print-layout #popup {
    display: none !important;
  }

  /* Header cetak */
  body.print-layout #print-header {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 20mm !important;
    z-index: 2000000 !important;
    background: #ffffff !important;
    border: 1.5pt solid #000000 !important;
    text-align: center !important;
    padding: 3mm 55mm 2mm 55mm !important;
    box-sizing: border-box !important;
  }

  body.print-layout #print-title,
  body.print-layout #print-header h2 {
    font-size: 15pt !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    color: #000000 !important;
    font-family: "Times New Roman", serif !important;
    font-weight: 700 !important;
    text-transform: uppercase;
  }

  body.print-layout #print-subtitle {
    font-size: 10pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-top: 2mm !important;
    padding-top: 1mm !important;
    border-top: 0.8pt solid #000000 !important;
    font-family: "Times New Roman", serif !important;
  }

  /* Area peta print */
  body.print-layout #map {
    position: fixed !important;
    top: 22mm !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 181mm !important;
    border: 1.5pt solid #000000 !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    z-index: 1000000 !important;
  }

  /* Elemen kartografi */
  body.print-layout #print-extras {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2100000 !important;
    pointer-events: none !important;
  }

  body.print-layout #print-north-arrow {
    position: fixed !important;
    top: 25mm !important;
    right: 5mm !important;
    width: 17mm !important;
    text-align: center !important;
    background: rgba(255,255,255,0.92) !important;
    border: 0.8pt solid #000000 !important;
    padding: 1.5mm !important;
    box-sizing: border-box !important;
  }

  body.print-layout #print-scale-bar-container {
    position: fixed !important;
    left: 5mm !important;
    bottom: 7mm !important;
    width: auto !important;
    max-width: 45mm !important;
    background: rgba(255,255,255,0.94) !important;
    border: 0.8pt solid #000000 !important;
    padding: 1mm 2mm !important;
    box-sizing: border-box !important;
    z-index: 2200000 !important;
  }

  body.print-layout #legend-box {
    display: block !important;
    position: fixed !important;
    right: 5mm !important;
    bottom: 7mm !important;
    top: auto !important;
    left: auto !important;
    width: 55mm !important;
    max-width: 55mm !important;
    max-height: 62mm !important;
    overflow: hidden !important;
    z-index: 2200000 !important;
    background: rgba(255,255,255,0.96) !important;
    border: 0.8pt solid #000000 !important;
    border-radius: 0 !important;
    padding: 2mm !important;
    box-shadow: none !important;
    font-size: 8pt !important;
    color: #000000 !important;
    box-sizing: border-box !important;
  }

  body.print-layout #legend-box::before {
    font-size: 8pt !important;
    border-bottom: 0.8pt solid #000000 !important;
    margin-bottom: 1.5mm !important;
    padding-bottom: 1mm !important;
  }

  body.print-layout #legend-content {
    font-size: 8pt !important;
    color: #000000 !important;
  }

  body.print-layout #legend-content img {
    max-width: 50mm !important;
    height: auto !important;
  }

  /* ScaleLine OpenLayers */
  body.print-layout .ol-scale-line {
    background: transparent !important;
    position: static !important;
    padding: 0 !important;
  }

  body.print-layout .ol-scale-line-inner {
    border: 1.5pt solid #000000 !important;
    border-top: none !important;
    color: #000000 !important;
    font-family: "Times New Roman", serif !important;
    font-weight: bold !important;
    font-size: 8pt !important;
  }

  /* Hilangkan efek edit/drag saat tercetak */
  body.print-layout .print-draggable:hover,
  body.print-layout .print-dragging,
  body.print-layout #print-title:focus,
  body.print-layout #print-header h2:focus,
  body.print-layout #print-subtitle:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  body.print-layout #print-title,
  body.print-layout #print-header h2,
  body.print-layout #print-subtitle,
  body.print-layout .print-draggable {
    cursor: default !important;
  }
}



/* =========================================================
   TATA LETAK RESPONSIF — panel tidak saling menimpa
   Variabel posisi dihitung js/core/ui-layout.js dari tinggi
   bar yang sedang tampil (bukan angka tetap 70/118px).
   !important diperlukan karena banyak posisi ditulis inline.
   ========================================================= */

/* Semua layar */
#cdk-area {
  top: var(--bar2-top, 80px) !important;
}
.accordion-panel,
#theme-panel {
  top: var(--panel-top, 82px) !important;
}
.accordion-panel {
  max-height: calc(100vh - var(--panel-top, 82px) - 16px);
  max-height: calc(100dvh - var(--panel-top, 82px) - 16px);
}

/* Layar HP */
@media (max-width: 640px) {

  /* Bar wilayah & CDK: selebar layar, isi boleh turun baris */
  #select-area {
    left: 8px !important;
    right: 8px !important;
    top: calc(8px + env(safe-area-inset-top)) !important;
    width: auto !important;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 6px !important;
    padding: 6px 8px !important;
  }
  #select-area select {
    flex: 1 1 120px;
    min-width: 0;
  }
  #cdk-area {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    box-sizing: border-box;
  }
  #cdk-area select {
    flex: 1;
    min-width: 0;
  }

  /* Panel: selebar layar, berhenti di atas toolbar bawah, di atas alat lain */
  .accordion-panel,
  #theme-panel,
  #osm-search-panel {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    z-index: 1800 !important;
  }
  .accordion-panel {
    max-height: calc(100dvh - var(--panel-top, 82px) - var(--bottom-reserve, 72px)) !important;
    font-size: 13px;
  }
  #osm-search-panel {
    top: var(--panel-top, 82px) !important;
  }

  /* Zoom dengan cubit; tombol +/- disembunyikan */
  .ol-zoom {
    display: none !important;
  }

  /* Alat kanan atas: bertumpuk di tepi kanan, di bawah bar */
  #top-right-tools {
    top: var(--panel-top, 82px) !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  #opacity-card {
    display: none !important;
  }

  /* Lencana pengguna: kecil, kiri bawah tepat di atas toolbar */
  #role-badge {
    top: auto !important;
    bottom: var(--bottom-reserve, 72px) !important;
    left: 8px !important;
    right: auto !important;
    transform: none !important;
    max-width: calc(100vw - 80px);
    font-size: 11px;
  }

  /* Logo (tombol mode bersih): kecil di kanan bawah, di atas toolbar */
  #corner-logo {
    top: auto !important;
    left: auto !important;
    right: 8px !important;
    bottom: var(--bottom-reserve, 72px) !important;
    transform: scale(0.5);
    transform-origin: bottom right;
  }

  /* Toolbar bawah: selebar layar, geser ke samping bila tidak muat */
  .map-tools-box,
  #map-tools-box {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    box-sizing: border-box;
    padding: 6px 8px !important;
    border-radius: 12px !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .map-tools-box::-webkit-scrollbar {
    display: none;
  }
  .map-tools-row {
    flex-wrap: nowrap;
  }
  .map-tools-row > label[for="basemap"] {
    display: none;
  }
  #basemap {
    max-width: 140px;
    flex: 0 0 auto;
  }
  .map-tool-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
  }

  /* Keterangan hak cipta peta (wajib tampil): tepat di atas toolbar */
  .ol-attribution {
    font-size: 9px;
    bottom: var(--bottom-reserve, 72px) !important;
    right: 8px !important;
  }
  #corner-logo {
    bottom: calc(var(--bottom-reserve, 72px) + 22px) !important;
  }
}

/* Chevron kartu katalog & workspace: digambar CSS (karakter ⌄ tidak ada
   di font Inter sehingga tampil seperti huruf "v"). Rotasi saat [open]
   tetap memakai aturan yang sudah ada. */
.catalog-main-chevron,
.workspace-chevron {
  font-size: 0;
}
.catalog-main-chevron::before,
.workspace-chevron::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

/* =========================================================
   LEGENDA — judul + keadaan kosong (dulu kotak putih kosong)
   ========================================================= */
#legend-box {
  border: 1px solid #dbe3ee !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(15, 76, 129, 0.12);
  font-size: 12px;
  color: #1e293b;
}
#legend-box::before {
  content: "Legenda";
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
  color: #0f4c81;
}
#legend-content:empty::before {
  content: "Belum ada layer aktif yang memiliki legenda.";
  color: #64748b;
}

/* =========================================================
   HP — legenda & modal rekap
   ========================================================= */
@media (max-width: 640px) {
  /* Legenda: panel bawah di atas toolbar, tidak menimpa panel lain */
  #legend-box {
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(var(--bottom-reserve, 72px) + 40px) !important;
    max-width: none !important;
    max-height: 32dvh !important;
    z-index: 1750 !important;
  }
  #legend-box img {
    max-width: 100% !important;
  }
  /* Panel tema: daftar di-scroll agar tidak menimpa legenda di bawah */
  #theme-list {
    max-height: 34dvh !important;
  }
}

@media (max-width: 900px) {
  /* Modal rekap: tinggi maksimal layar, isi bisa di-scroll */
  .rekap-modal-content {
    max-height: calc(100dvh - 16px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 14px 12px 10px !important;
  }
  .rekap-modal-content .rekap-modal-body {
    overflow: auto;
    min-height: 0;
  }
  /* Ringkasan tetap dua kolom (kartu kecil) */
  .rekap-summary-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .rekap-summary-item .value {
    font-size: 14px;
  }
  /* Tabel lebih rapat agar kolom luas muat (tabel punya style inline
     font-size/min-width, jadi perlu !important) */
  #rekap-modal-body table {
    font-size: 11.5px !important;
    min-width: 0 !important;
  }
  #rekap-modal-body th,
  #rekap-modal-body td {
    padding: 5px 6px !important;
  }
  .rekap-modal-title {
    font-size: 15px;
  }
}

/* =========================================================
   PANEL TEMA — baris lebih rapat, tombol urut berdampingan
   ========================================================= */
.theme-layer-item {
  gap: 10px;
  padding: 8px 12px !important;
  align-items: center;
}
.theme-layer-item > div:first-child {
  flex-direction: row !important;   /* ▲▼ berdampingan (dulu bertumpuk) */
  gap: 4px !important;
}
.theme-btn-move {
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  border-radius: 6px !important;
  border: 1px solid #d5deea !important;
  background: #f8fafc !important;
  color: #475569 !important;
  cursor: pointer;
}
.theme-btn-move:hover {
  background: #e8f0fe !important;
  color: #1a56db !important;
}
/* ▲ di baris teratas & ▼ di baris terbawah tidak berguna → disembunyikan */
.theme-layer-item:first-child .theme-btn-move:first-child,
.theme-layer-item:last-child .theme-btn-move:last-child {
  visibility: hidden;
}

@media (max-width: 640px) {
  /* Tema + legenda terbuka bersamaan: peta tetap terlihat di tengah */
  #theme-list {
    max-height: 30dvh !important;
  }
  #legend-box {
    max-height: 24dvh !important;
  }
}
