/* ══════════════════════════════════════════════════════════════════════════
   Pantau Titik Panas — sistem visual
   Light-clean jurnalistik: kertas hangat, tinta gelap, satu ramp api.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* tinta & permukaan */
  --ink: #14181d;
  --ink-2: #4c5763;
  --ink-3: #808b97;
  --line: #e3e7ea;
  --line-2: #eef1f3;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;

  /* ramp api — 3 kelas diskret, dipakai peta + legenda + badge */
  --fire-1: #f0b429; /* sedang        <20 MW  */
  --fire-2: #e8702a; /* kuat        20–100 MW */
  --fire-3: #b3251c; /* sangat kuat  >100 MW  */
  --fire-0: #c2cad1; /* tanpa titik           */

  /* aksen aksi */
  --accent: #c2172b;
  --accent-ink: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(20, 24, 29, 0.05), 0 1px 3px rgba(20, 24, 29, 0.04);
  --shadow-2: 0 4px 16px rgba(20, 24, 29, 0.08), 0 1px 3px rgba(20, 24, 29, 0.05);
  --shadow-3: 0 -8px 32px rgba(20, 24, 29, 0.14);

  --topbar-h: 58px;
  --trustbar-h: 40px;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

a { color: var(--accent); text-decoration-color: rgba(194, 23, 43, 0.3); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.018em; }
.muted { color: var(--ink-3); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ───────────────────────────────────────────────────────────── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 900;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  background: radial-gradient(circle at 32% 30%, var(--fire-1) 0%, var(--fire-2) 45%, var(--fire-3) 100%);
  box-shadow: 0 0 0 3px rgba(232, 112, 42, 0.12);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: -0.02em; }
.brand-text span { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }

.topbar-meta {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-meta .sep { color: var(--line); }

.dot-live {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #1f9d55;
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.16);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(31, 157, 85, 0.04); }
}
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

.topbar-actions { display: flex; gap: 8px; flex: none; }

/* ──────────────────────────────────────────────────────────── TRUSTBAR ─── */
.trustbar {
  height: var(--trustbar-h);
  display: flex; align-items: center; gap: 9px;
  padding: 0 18px;
  background: linear-gradient(90deg, #fff8ec, #fdfcfa 70%);
  border-bottom: 1px solid var(--line);
  color: #7a5312;
  position: relative; z-index: 850;
}
.trustbar .ico { width: 15px; height: 15px; flex: none; color: #c98a12; }
.trustbar p {
  margin: 0; font-size: 12.75px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trustbar strong { font-weight: 650; color: #6b4710; }

/* ────────────────────────────────────────────────────────────── LAYOUT ─── */
.layout {
  display: grid;
  grid-template-columns: 60fr 40fr;
  height: calc(100vh - var(--topbar-h) - var(--trustbar-h));
  height: calc(100dvh - var(--topbar-h) - var(--trustbar-h));
}

/* ──────────────────────────────────────────────────────────────── PETA ─── */
.map-pane { position: relative; background: #e8ebed; }
#map { position: absolute; inset: 0; }
.leaflet-container { font-family: var(--sans); background: #eaeef0; }

.map-controls {
  position: absolute; z-index: 500;
  top: 12px; left: 12px; right: 12px;
  display: flex; gap: 8px; align-items: flex-start;
  pointer-events: none;
}
.map-controls > * { pointer-events: auto; }

.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-2);
}
.seg {
  appearance: none; border: 0; background: transparent;
  font: inherit; font-size: 13px; font-weight: 550;
  color: var(--ink-2);
  padding: 6px 12px; border-radius: 7px; cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
  white-space: nowrap;
}
.seg:hover { background: var(--line-2); color: var(--ink); }
.seg.is-active { background: var(--ink); color: #fff; }

.btn {
  appearance: none; font: inherit; font-size: 13px; font-weight: 550;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px; padding: 7px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.1s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: #d3d9de; }
.btn:active { transform: translateY(1px); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-icon { box-shadow: var(--shadow-2); backdrop-filter: blur(8px); background: rgba(255, 255, 255, 0.94); }

.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  justify-content: center; width: 100%;
  padding: 11px 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(194, 23, 43, 0.25);
}
.btn-primary:hover { background: #a81324; border-color: #a81324; }
.btn-primary.is-done { background: #1f9d55; border-color: #1f9d55; }

/* filter lanjutan */
.filter-panel {
  position: absolute; z-index: 600;
  top: 58px; right: 12px; width: 262px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 14px;
  animation: pop 0.16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.field { display: block; margin-bottom: 14px; border: 0; padding: 0; }
.field > span, .field legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.field b { font-variant-numeric: tabular-nums; color: var(--ink); }
.field input[type='range'] { width: 100%; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 2px 0; }
.check input { accent-color: var(--accent); }
.filter-note { margin: 12px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

/* legenda */
.legend {
  position: absolute; z-index: 500; left: 12px; bottom: 22px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-2);
  max-width: 250px;
}
.legend-title { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 7px; }
.legend-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.legend-items li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-items i { width: 11px; height: 11px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.legend-items b { font-weight: 600; color: var(--ink); }
.legend-hint { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }

.map-loading {
  position: absolute; z-index: 600; top: 58px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12.5px;
  padding: 6px 12px; border-radius: 20px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-2);
}
.map-loading[hidden] { display: none; } /* atribut hidden vs display:flex */
.spinner {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────────────────────────────────────────── PANEL ─── */
.panel {
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;
}
.panel-scroll {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 28px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
}
.panel-scroll::-webkit-scrollbar { width: 9px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #d8dee2; border-radius: 9px; border: 3px solid var(--bg); }

.sheet-handle { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.card-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.card-head .muted { font-size: 12.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 20px;
  background: var(--line-2); color: var(--ink-2);
  white-space: nowrap;
}
.pill-live { background: rgba(194, 23, 43, 0.08); color: var(--accent); }
.pill-soon { background: var(--line-2); color: var(--ink-3); font-weight: 550; }

/* ── headline nasional ── */
.headline-card { padding: 18px; }
.headline {
  font-size: 21px; line-height: 1.28; letter-spacing: -0.025em;
  margin-bottom: 16px; text-wrap: balance;
}
.headline b { color: var(--fire-3); font-weight: 700; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden;
}
.kpi { background: var(--surface); padding: 12px 11px; }
.kpi-num {
  font-size: 27px; font-weight: 700; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.kpi-accent .kpi-num { color: var(--fire-3); }
.kpi-label { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.kpi.is-disabled { background: var(--surface-2); }
.kpi.is-disabled .kpi-num { color: var(--line); }
.hint { border-bottom: 1px dotted var(--ink-3); cursor: help; }

.top3 { display: flex; flex-direction: column; gap: 7px; margin: 14px 0 16px; }
.top3-title { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.top3-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; cursor: pointer;
  background: none; border: 0; padding: 3px 0; font-family: inherit; text-align: left; width: 100%;
  color: var(--ink);
  border-radius: 6px;
  transition: background 0.14s var(--ease);
}
.top3-row:hover { background: var(--line-2); }
.top3-rank {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #fff;
}
.top3-name { font-weight: 600; letter-spacing: -0.01em; }
.top3-val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12.5px; }

.btn-copy { margin-top: 2px; }
.copy-note { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); text-align: center; min-height: 16px; line-height: 1.35; }

/* ── tabs & ranking ── */
.tabs {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: 12px;
}
.tab {
  flex: 1; appearance: none; border: 0; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 550; color: var(--ink-2);
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.tab:hover:not(.is-disabled) { background: #eef1f3; color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow-1); }
.tab.is-disabled { color: #b6bfc7; cursor: not-allowed; }
.tab.is-disabled .pill { font-size: 9.5px; padding: 1px 5px; }
.tab-note { margin: -4px 0 12px; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0; background: none; font: inherit; text-align: left; width: 100%;
  color: var(--ink);
  transition: background 0.14s var(--ease);
}
.rank-item + .rank-item { border-top: 1px solid var(--line-2); }
.rank-item:hover { background: var(--surface-2); }
.rank-item.is-hover { background: #f0f3f5; }
/* elemen di dalam ranking adalah <span> (di dalam <button>) — paksa block */
.rank-name, .rank-bar, .rank-fill, .rank-meta, .rank-score-num, .rank-score-lbl { display: block; }
.rank-num { font-size: 12px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: center; }
.rank-body { min-width: 0; }
.rank-name { font-size: 13.75px; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 5px; }
.rank-bar { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.rank-fill { height: 100%; border-radius: 3px; transition: width 0.5s var(--ease); }
.rank-meta { margin-top: 5px; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank-meta b { color: var(--ink-2); font-weight: 600; }
.rank-score { text-align: right; }
.rank-score-num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; }
.rank-score-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 3px; }

/* ── detail provinsi ── */
.detail-card { animation: pop 0.2s var(--ease); }
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--ink-2); background: none; border: 0;
  cursor: pointer; padding: 0; margin-bottom: 12px; font-family: inherit;
}
.back-link:hover { color: var(--accent); }
.detail-title { font-size: 20px; letter-spacing: -0.025em; margin-bottom: 3px; }
.detail-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }

.ik-block { display: flex; align-items: center; gap: 14px; padding: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 14px; }
.ik-num { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ik-side { min-width: 0; }
.ik-label { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.ik-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.stat { background: var(--surface); padding: 10px 11px; }
.stat-num { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.stat-lbl { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.phase2-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 1px; background: var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.phase2-list li { background: var(--surface-2); padding: 8px 11px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.phase2-list .val { color: var(--ink-3); font-size: 11.5px; }

/* ── footer panel ── */
.panel-foot { padding: 4px 4px 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.panel-foot p { margin: 0 0 5px; }

/* ─────────────────────────────────────────────────────── POPUP LEAFLET ─── */
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow-2); border: 1px solid var(--line); padding: 0; }
.leaflet-popup-content { margin: 0; width: 264px !important; font-size: 13px; line-height: 1.45; }
.leaflet-popup-tip { border: 1px solid var(--line); }

.fp { padding: 14px; }
.fp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.fp-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fp-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; }
.fp-rows { display: grid; gap: 7px; margin-bottom: 10px; }
.fp-row { display: flex; gap: 9px; align-items: baseline; }
.fp-key { width: 62px; flex: none; font-size: 11.5px; color: var(--ink-3); }
.fp-val { font-size: 12.75px; color: var(--ink); }
.fp-conf { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; cursor: help; }
.fp-conf-2 { background: rgba(31, 157, 85, 0.1); color: #14713c; }
.fp-conf-1 { background: rgba(240, 180, 41, 0.15); color: #8a6208; }
.fp-conf-0 { background: var(--line-2); color: var(--ink-2); }
.fp details { border-top: 1px solid var(--line-2); padding-top: 8px; }
.fp summary { font-size: 11.5px; color: var(--ink-3); cursor: pointer; list-style: none; user-select: none; }
.fp summary::-webkit-details-marker { display: none; }
.fp summary::before { content: '▸ '; }
.fp details[open] summary::before { content: '▾ '; }
.fp-tech { margin: 8px 0 0; display: grid; gap: 4px; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-note { margin: 9px 0 0; font-size: 11px; color: var(--ink-3); line-height: 1.4; }

/* tooltip provinsi di choropleth */
.prov-tip {
  background: var(--ink); color: #fff; border: 0; border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow-2);
  font-variant-numeric: tabular-nums;
}
.prov-tip::before { border-top-color: var(--ink) !important; }
.prov-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.prov-tip span { color: rgba(255, 255, 255, 0.7); }

/* cluster */
.hs-cluster { background: transparent; }
.hs-cluster div {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 11.5px; font-weight: 700;
  font-family: var(--sans);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45), var(--shadow-1);
  font-variant-numeric: tabular-nums;
}

.leaflet-control-attribution { font-size: 10.5px; background: rgba(255, 255, 255, 0.85) !important; }
.leaflet-bar a { border-radius: 6px !important; }

/* ─────────────────────────────────────────────────────────── RESPONSIF ─── */
@media (max-width: 1080px) {
  .headline { font-size: 19px; }
  .kpi-num { font-size: 23px; }
}

@media (max-width: 860px) {
  body { overflow: hidden; }

  .topbar { gap: 12px; padding: 0 14px; }
  .topbar-actions { display: none; }
  .topbar-meta { font-size: 12px; }
  .trustbar { height: auto; min-height: var(--trustbar-h); padding: 8px 14px; align-items: flex-start; }
  .trustbar p { white-space: normal; font-size: 12px; }
  .trust-more { display: none; }

  .layout { display: block; height: auto; }

  .map-pane { height: 45vh; height: 45dvh; }

  /* bottom sheet 3 posisi — draggable (peek / half / full) */
  .panel {
    --sheet-peek: 152px;
    --sheet-y: calc(100% - var(--sheet-peek));
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 92dvh;
    border-left: 0;
    border-top-left-radius: 18px; border-top-right-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-3);
    z-index: 1200; /* di atas kontrol Leaflet */
    transform: translate3d(0, var(--sheet-y), 0);
    transition: transform 0.34s cubic-bezier(0.22, 0.8, 0.28, 1);
    will-change: transform;
  }
  .panel.is-dragging { transition: none; }

  .sheet-handle {
    display: block; width: 100%; padding: 11px 0 9px;
    background: none; border: 0; cursor: grab;
    flex: none;
    touch-action: none;           /* zona drag utama */
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .panel.is-dragging .sheet-handle { cursor: grabbing; }
  .sheet-handle span {
    display: block; width: 44px; height: 5px; border-radius: 3px;
    background: #c3ccd3; margin: 0 auto;
    transition: background 0.2s var(--ease), width 0.2s var(--ease);
  }
  .sheet-handle:active span, .panel.is-dragging .sheet-handle span { background: #8d979f; width: 56px; }

  .panel-scroll {
    padding: 6px 14px calc(28px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;          /* scroll dulu, drag menyusul saat mentok atas */
    flex: 1;
  }
  .panel:not(.is-full) .panel-scroll { overflow-y: hidden; touch-action: none; }

  .filter-panel { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; }
  .legend { bottom: 12px; left: 12px; padding: 8px 10px; max-width: 190px; }
  .legend-hint { display: none; }
  .map-controls { top: 10px; left: 10px; right: 10px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .segmented { max-width: 100%; }
  .seg { padding: 6px 9px; font-size: 12px; }
  .map-loading { top: 10px; left: auto; right: 10px; transform: none; }
}

@media (max-width: 400px) {
  .kpi-num { font-size: 21px; }
  .headline { font-size: 17.5px; }
  .seg { padding: 5px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
