/* ==========================================================================
   Intellijen Map · Peta Sebaran MSISDN
   Custom layer on top of Tailwind: glass panels, form controls, MapLibre skin.
   ========================================================================== */

:root {
  --panel-bg: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(15, 23, 42, 0.1);
  --panel-shadow: 0 18px 45px -18px rgba(15, 23, 42, 0.28);
  --accent: #0ea5e9;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(15, 23, 42, 0.1);
}

.dark {
  --panel-bg: rgba(0, 0, 0, 0.62);
  --panel-border: rgba(255, 255, 255, 0.11);
  --panel-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.65);
  --accent: #38bdf8;
  --card-bg: rgba(0, 0, 0, 0.62);
  --card-border: rgba(255, 255, 255, 0.1);
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  text-rendering: optimizeLegibility;
}

.login-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.92);
  padding: 1.5rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 100%;
  padding: 0.25rem 0.5rem 0.25rem 0.375rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
  transition: opacity 0.12s ease;
}

.selected-chip__x {
  display: grid;
  place-items: center;
  height: 0.875rem;
  width: 0.875rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.625rem;
  line-height: 1;
}

.selected-chip:hover .selected-chip__x {
  background: rgba(0, 0, 0, 0.4);
}

.link-row {
  border-radius: 0.5rem;
  border: 1px solid rgba(250, 204, 21, 0.25);
  background: rgba(250, 204, 21, 0.08);
  padding: 0.5rem 0.625rem;
  font-size: 0.625rem;
}

/* ------------------------------- panels ---------------------------------- */

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
}

.panel-glass {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
}

.panel--hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(1.25rem);
  pointer-events: none;
}

/* right rail — stack cards di kanan */
.right-rail {
  position: fixed;
  z-index: 35;
  top: 5.5rem;
  right: 0.75rem;
  bottom: 1rem;
  display: flex;
  width: min(19.5rem, calc(100vw - 1.5rem));
  flex-direction: column;
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s;
}

.right-rail.panel--hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(1.25rem);
  pointer-events: none;
}

.right-rail__stack {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
}

.side-card {
  flex-shrink: 0;
  padding: 0.75rem;
}

.side-card__scroll {
  max-height: 9rem;
  overflow-y: auto;
}

.right-rail .panel.panel-glass {
  background: var(--card-bg);
  border-color: var(--card-border);
}

#layer-card {
  border-color: var(--card-border);
  background: var(--card-bg);
}

.section-card {
  border-radius: 0.875rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  padding: 0.75rem;
}

/* kelompok tersimpan */
.groups-section {
  margin: 0;
  border-color: var(--card-border);
  background: var(--card-bg);
  box-shadow: none;
}

/* filter panel (bagian bawah right rail) */
.filter-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.filter-panel__head {
  flex-shrink: 0;
  border-bottom: 1px solid var(--panel-border);
}

.filter-panel__body {
  flex: 1;
  min-height: 0;
}

/* kelompok tersimpan — chips */
.group-save-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  background: rgba(100, 116, 139, 0.12);
  padding: 0.3125rem 0.5rem 0.3125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(71 85 105);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dark .group-save-chip {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.14);
  color: rgb(203 213 225);
}

.group-save-chip:hover {
  background: rgba(100, 116, 139, 0.2);
}

.dark .group-save-chip:hover {
  background: rgba(148, 163, 184, 0.22);
}

.group-save-chip.is-active {
  border-color: var(--chip-color, #0ea5e9);
  background: var(--chip-color, #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--chip-color, #0ea5e9) 65%, transparent);
}

.group-save-chip.is-active:hover {
  border-color: var(--chip-color, #0ea5e9);
  background: var(--chip-color, #0ea5e9);
  color: #fff;
}

.group-save-chip__name {
  overflow: hidden;
  max-width: 9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.group-save-chip__count {
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  padding: 0.0625rem 0.375rem;
  font-family: ui-monospace, monospace;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1.35;
}

.dark .group-save-chip__count {
  background: rgba(15, 23, 42, 0.25);
}

.group-save-chip.is-active .group-save-chip__count {
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
}

.groups-empty-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  border: 1.5px dashed rgba(100, 116, 139, 0.35);
  background: rgba(100, 116, 139, 0.06);
  padding: 0.75rem;
  text-align: left;
  color: rgb(71 85 105);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dark .groups-empty-card {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: rgb(203 213 225);
}

.groups-empty-card:hover {
  border-color: rgba(100, 116, 139, 0.5);
  background: rgba(100, 116, 139, 0.1);
}

.dark .groups-empty-card:hover {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.14);
}

.groups-empty-card__icon {
  display: grid;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 0.625rem;
  background: rgba(100, 116, 139, 0.14);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
}

.dark .groups-empty-card__icon {
  background: rgba(148, 163, 184, 0.18);
}

/* custom groups (legacy chips — modal) */
.group-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  padding: 0.3125rem 0.625rem 0.3125rem 0.4375rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.group-chip:hover {
  transform: translateY(-1px);
}

.group-chip.is-active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 4px 14px -4px rgba(0, 0, 0, 0.45);
}

.group-chip__dot {
  height: 0.5625rem;
  width: 0.5625rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

.group-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.03);
  padding: 0.625rem 0.75rem;
}

.dark .group-card {
  background: rgba(255, 255, 255, 0.04);
}

.group-card__swatch {
  height: 2rem;
  width: 0.375rem;
  flex-shrink: 0;
  border-radius: 999px;
}

.group-pick-row {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.4375rem 0.5rem;
  text-align: left;
  font-size: 0.6875rem;
}

.group-pick-row__check {
  width: 1rem;
  flex-shrink: 0;
  padding-top: 0.0625rem;
  font-size: 0.6875rem;
  line-height: 1.2;
}

.group-pick-row__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.group-pick-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.group-pick-row__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.group-pick-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tag-color, #64748b) 40%, transparent);
  background: color-mix(in srgb, var(--tag-color, #64748b) 12%, transparent);
  padding: 0.0625rem 0.375rem;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--tag-color, #64748b);
}

.group-pick-tag--none {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  font-weight: 500;
  color: rgb(100 116 139);
}

.dark .group-pick-tag--none {
  color: rgb(148 163 184);
}

.group-pick-row:hover {
  background: rgba(15, 23, 42, 0.06);
}

.dark .group-pick-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.group-pick-row.is-checked {
  background: rgba(14, 165, 233, 0.12);
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  display: flex;
  max-height: min(90dvh, 42rem);
  width: min(100%, 28rem);
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.125rem;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--panel-border);
  padding: 1rem 1rem 0.875rem;
}

.modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.modal-btn {
  border-radius: 0.5rem;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.04);
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: inherit;
  transition: background-color 0.12s ease;
}

.dark .modal-btn {
  background: rgba(255, 255, 255, 0.06);
}

.modal-btn:hover {
  background: rgba(15, 23, 42, 0.1);
}

.dark .modal-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.modal__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.modal__editor {
  border-top: 1px solid var(--panel-border);
  padding: 0.875rem 1rem 1rem;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 0.1rem;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}

.dark .stat-label {
  color: rgb(148 163 184);
}

/* ------------------------------- buttons --------------------------------- */

.icon-btn {
  display: grid;
  place-items: center;
  height: 2.125rem;
  width: 2.125rem;
  border-radius: 0.625rem;
  color: rgb(51 65 85);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(15, 23, 42, 0.07);
  color: rgb(15 23 42);
}

.dark .icon-btn {
  color: rgb(203 213 225);
}

.dark .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#btn-panel[aria-pressed='true'] {
  background: rgba(14, 165, 233, 0.14);
  color: rgb(3 105 161);
}

.dark #btn-panel[aria-pressed='true'] {
  background: rgba(56, 189, 248, 0.18);
  color: rgb(125 211 252);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.25rem;
}

.seg-btn {
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.05);
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(71 85 105);
  transition: all 0.15s ease;
}

.seg-btn:hover {
  background: rgba(15, 23, 42, 0.1);
}

.seg-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(14, 165, 233, 0.7);
}

.dark .seg-btn {
  background: rgba(255, 255, 255, 0.07);
  color: rgb(203 213 225);
}

.dark .seg-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dark .seg-btn.is-active {
  background: var(--accent);
  color: #04202f;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5625rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(71 85 105);
  transition: all 0.15s ease;
}

.dark .chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgb(203 213 225);
}

.chip__dot {
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.chip.is-active {
  border-color: transparent;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
}

.dark .chip.is-active {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.chip.is-active .chip__dot {
  opacity: 1;
}

/* -------------------------------- inputs --------------------------------- */

.field-label {
  margin-bottom: 0.4375rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}

.dark .field-label {
  color: rgb(148 163 184);
}

.input {
  width: 100%;
  border-radius: 0.625rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.4375rem 0.625rem;
  font-size: 0.75rem;
  color: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.dark .input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  padding-right: 1.75rem;
}

.checkbox {
  margin-top: 0.0625rem;
  height: 0.9375rem;
  width: 0.9375rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.25);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  user-select: none;
}

.dark .toggle-row {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.toggle-row__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(51 65 85);
  white-space: nowrap;
}

.dark .toggle-row__label {
  color: rgb(203 213 225);
}

.toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  height: 1.25rem;
  width: 2.125rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  height: 1rem;
  width: 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.toggle-switch:checked {
  background: var(--accent);
}

.toggle-switch:checked::after {
  transform: translateX(0.875rem);
}

/* time dock (center bottom) */
.time-dock {
  position: fixed;
  z-index: 28;
  left: 50%;
  bottom: 1rem;
  width: min(38rem, calc(100vw - 2rem));
  transform: translateX(-50%);
}

.time-dock__inner {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  border-radius: 1rem;
  padding: 0.625rem 0.875rem 0.75rem;
}

.time-dock__toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.time-dock__zoom {
  margin-left: auto;
  border-radius: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.18);
  padding: 0.375rem 0.625rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgb(180 83 9);
  transition: background-color 0.12s ease;
}

.dark .time-dock__zoom {
  color: rgb(253 230 138);
}

.time-dock__zoom:hover {
  background: rgba(245, 158, 11, 0.32);
}

.time-dock__slider {
  min-width: 0;
}

.time-hist-wrap {
  position: relative;
  height: 3.25rem;
  padding-top: 0.125rem;
}

.time-histogram {
  position: absolute;
  inset: 0 0 0.625rem;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  pointer-events: none;
}

.time-hist-bar {
  flex: 1 1 0;
  min-width: 0;
  max-height: 100%;
  border-radius: 2px 2px 0 0;
  background: rgba(14, 165, 233, 0.22);
  opacity: 0.55;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.dark .time-hist-bar {
  background: rgba(56, 189, 248, 0.28);
}

.time-hist-bar.is-active {
  opacity: 0.85;
  background: rgba(14, 165, 233, 0.45);
}

.dark .time-hist-bar.is-active {
  background: rgba(56, 189, 248, 0.55);
}

.time-hist-bar.is-dim {
  opacity: 0.18;
}

.time-dual-range {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.time-dock__labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.5625rem;
  color: rgb(100 116 139);
}

/* legend panel positioning */
.legend-panel {
  bottom: 1rem;
  left: 1rem;
  display: flex;
  width: min(19rem, calc(100vw - 2rem));
  max-height: min(calc(100dvh - 7rem), 28rem);
  flex-direction: column;
  overflow: hidden;
}

.legend-panel__head {
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
}

.legend-panel__body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.legend-panel__modes {
  flex-shrink: 0;
}

.legend-panel__items {
  flex: 1 1 auto;
  min-height: 3rem;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.legend-panel__size {
  flex-shrink: 0;
}

/* range sliders */

.single-range,
.dual-range input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}

.single-range {
  height: 1rem;
}

.single-range::-webkit-slider-runnable-track {
  height: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.dark .single-range::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.14);
}

.single-range::-webkit-slider-thumb,
.dual-range input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 0.875rem;
  width: 0.875rem;
  margin-top: -0.3125rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.45);
  cursor: pointer;
  pointer-events: auto;
}

.single-range::-moz-range-track {
  height: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.single-range::-moz-range-thumb,
.dual-range input[type='range']::-moz-range-thumb {
  height: 0.875rem;
  width: 0.875rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--accent);
  cursor: pointer;
  pointer-events: auto;
}

.dual-range {
  position: relative;
  height: 1.125rem;
}

.dual-range__track,
.dual-range__fill {
  position: absolute;
  top: 50%;
  height: 0.25rem;
  border-radius: 999px;
  transform: translateY(-50%);
}

.dual-range__track {
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.12);
}

.dark .dual-range__track {
  background: rgba(255, 255, 255, 0.14);
}

.dual-range__fill {
  background: var(--accent);
}

.dual-range input[type='range'] {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.125rem;
  margin: 0;
  pointer-events: none;
}

.dual-range input[type='range']::-webkit-slider-runnable-track {
  height: 0.25rem;
  background: transparent;
}

.dual-range input[type='range']::-moz-range-track {
  height: 0.25rem;
  background: transparent;
}

/* ----------------------------- person rows ------------------------------- */

.person-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  text-align: left;
  transition: background-color 0.12s ease;
}

.person-row:hover {
  background: rgba(15, 23, 42, 0.06);
}

.dark .person-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.person-row.is-active {
  background: rgba(14, 165, 233, 0.14);
}

.dark .person-row.is-active {
  background: rgba(56, 189, 248, 0.18);
}

.person-row__avatar {
  display: grid;
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 0.5rem;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #fff;
}

/* ------------------------------- legend ---------------------------------- */

.legend-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.3125rem 0.625rem;
  text-align: left;
  transition: background-color 0.12s ease;
}

.legend-row:hover {
  background: rgba(15, 23, 42, 0.05);
}

.dark .legend-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.legend-row.is-muted {
  opacity: 0.35;
}

.legend-dot {
  height: 0.6875rem;
  width: 0.6875rem;
  flex-shrink: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .legend-dot {
  box-shadow: 0 0 0 1.5px rgba(15, 23, 42, 0.9), 0 1px 3px rgba(0, 0, 0, 0.5);
}

.legend-track {
  position: relative;
  flex: 1 1 auto;
  height: 0.1875rem;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
}

.dark .legend-track {
  background: rgba(255, 255, 255, 0.1);
}

.legend-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  opacity: 0.85;
  transition: width 0.3s ease;
}

.size-dot {
  display: inline-block;
  height: var(--s);
  width: var(--s);
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
  box-shadow: inset 0 0 0 1.5px rgba(100, 116, 139, 0.7);
}

.dark .size-dot {
  background: rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 0 0 1.5px rgba(148, 163, 184, 0.65);
}

/* ------------------------------ scrollbars ------------------------------- */

.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.4) transparent;
}

.scroll-thin::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-thin::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.38);
}

/* ------------------------------- maplibre -------------------------------- */

.maplibregl-ctrl-group {
  background: var(--panel-bg) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 0.75rem !important;
  box-shadow: var(--panel-shadow) !important;
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--panel-border) !important;
}

.dark .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.6);
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  background: var(--panel-bg) !important;
  border-radius: 999px !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.dark .maplibregl-ctrl-attrib a,
.dark .maplibregl-ctrl-attrib {
  color: rgb(148 163 184) !important;
}

.maplibregl-ctrl-scale {
  background: var(--panel-bg) !important;
  border-color: var(--panel-border) !important;
  border-radius: 0.25rem;
  color: inherit !important;
  font-size: 10px !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 0.875rem !important;
  background: var(--panel-bg) !important;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  overflow: hidden;
}

.maplibregl-popup-tip {
  display: none;
}

.maplibregl-popup-close-button {
  top: 0.25rem;
  right: 0.375rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: rgb(100 116 139);
}

.maplibregl-popup-close-button:hover {
  background: rgba(15, 23, 42, 0.08);
}

.dark .maplibregl-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* map hover cursor */
.map-hover .maplibregl-canvas {
  cursor: pointer;
}

/* ------------------------------ responsive ------------------------------- */

@media (max-width: 767px) {
  .app-header__card {
    max-width: calc(100vw - 5.5rem);
  }

  .app-header__card .stat-value {
    font-size: 0.78rem;
  }

  .app-header__card .stat-label {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }

  .time-dock {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 0.75rem);
  }

  .time-dock__inner {
    padding: 0.5rem 0.625rem 0.625rem;
  }

  .time-dock__toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .time-dock__zoom {
    grid-column: 1 / -1;
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .legend-panel {
    bottom: calc(9.25rem + env(safe-area-inset-bottom, 0px));
    left: 0.375rem;
    max-width: calc(100vw - 0.75rem);
    max-height: min(calc(100dvh - 12rem), 16rem);
  }

  .legend-panel__items {
    min-height: 2.5rem;
  }

  .right-rail {
    top: 4.25rem;
    right: 0.375rem;
    bottom: 1rem;
    width: min(19rem, calc(100vw - 0.75rem));
  }

  .right-rail.panel--hidden {
    transform: translateX(calc(100% + 0.75rem));
  }

  .side-card__scroll {
    max-height: 6.5rem;
  }

  .modal {
    padding: 0;
    place-items: end;
  }

  .modal__dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: 1.125rem 1.125rem 0 0;
  }
}

@media (min-width: 768px) {
  body.panel-open .legend-panel {
    max-height: min(calc(100dvh - 8rem), 22rem);
  }
}
