:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  --ink: #f4f8ff;
  --ink-dim: rgba(244, 248, 255, 0.75);
  --glass: rgba(12, 22, 41, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --accent: #68a0ff;
  --topbar-height: 76px;
  --panel-gap: 4px;
  --panel-pad: 10px;
  --panel-label-size: 12px;
  --panel-title-size: 13px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#map {
  position: absolute;
  top: var(--topbar-height);
  left: 0;
  width: 100%;
  height: calc(100% - var(--topbar-height));
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(1200px 640px at 12% -12%, rgba(0, 196, 255, 0.18), transparent 55%),
    radial-gradient(980px 560px at 88% 108%, rgba(118, 255, 122, 0.15), transparent 58%),
    linear-gradient(165deg, #040913 0%, #091629 62%, #07111f 100%);
  backdrop-filter: blur(8px);
  transition: opacity 280ms ease, visibility 280ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  width: min(92vw, 420px);
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(122, 194, 255, 0.28);
  background: linear-gradient(155deg, rgba(8, 24, 46, 0.93), rgba(7, 18, 36, 0.9));
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.loading-logo-wrap {
  width: 52px;
  height: 52px;
  margin-bottom: 0.9rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(9, 25, 48, 0.82);
  border: 1px solid rgba(144, 213, 255, 0.25);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.loading-logo {
  width: 30px;
  height: 30px;
  animation: loadingPulse 1.45s ease-in-out infinite;
}

.loading-title {
  margin: 0 0 0.3rem;
  font-size: clamp(1.05rem, 2.1vw, 1.2rem);
  letter-spacing: 0.01em;
  color: #f1f8ff;
}

.loading-message {
  margin: 0 0 0.85rem;
  min-height: 1.25rem;
  color: rgba(222, 238, 255, 0.88);
  font-size: 0.93rem;
}

.loading-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(129, 179, 225, 0.2);
}

.loading-progress-bar {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60f0ff 0%, #8aff9e 100%);
  animation: loadingSweep 1.15s cubic-bezier(0.33, 0, 0.15, 1) infinite;
}

@keyframes loadingSweep {
  0% {
    transform: translateX(-135%);
  }
  100% {
    transform: translateX(335%);
  }
}

@keyframes loadingPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(96, 240, 255, 0.1));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px rgba(96, 240, 255, 0.45));
  }
}

.prototype-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  pointer-events: none;
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.75),
    0 0 18px rgba(255, 94, 94, 0.45);
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 30px rgba(4, 9, 22, 0.45);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  padding: 2px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nur-logo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

.city-logo {
  width: auto;
  height: 42px;
  border-radius: 0;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.mit-logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.topbar p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
}

.topbar-actions,
.downloads,
.head-actions {
  display: flex;
  gap: 8px;
}

.mobile-controls-btn {
  position: absolute;
  z-index: 1350;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  min-height: 50px;
  min-width: 182px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0.01em;
  color: #ffffff;
  border: 1.5px solid rgba(214, 232, 255, 0.92);
  background: linear-gradient(145deg, rgba(42, 130, 255, 0.94), rgba(35, 196, 171, 0.9));
  box-shadow:
    0 12px 22px rgba(4, 25, 58, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.mobile-controls-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 26px rgba(4, 25, 58, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}

.mobile-controls-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(84, 175, 255, 0.45),
    0 14px 26px rgba(4, 25, 58, 0.48);
}

.mobile-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1250;
  background: rgba(2, 8, 20, 0.44);
  backdrop-filter: blur(1px);
}

.mobile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 4px;
}

.mobile-panel-title {
  margin: 0;
  font-size: 13px;
  color: #d8e6ff;
  font-weight: 600;
}

.control-stack {
  position: absolute;
  top: calc(var(--topbar-height) + 10px);
  left: 14px;
  z-index: 1100;
  width: min(436px, calc(100vw - 28px));
  color: var(--ink);
  display: grid;
  gap: var(--panel-gap);
  max-height: calc(100vh - var(--topbar-height) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: auto;
  direction: rtl;
}

.control-stack > * {
  direction: ltr;
  text-align: left;
}

.control-step-panel {
  display: grid;
  gap: 6px;
  border-radius: 14px;
  padding: var(--panel-pad);
}

.drawer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.drawer-chevron {
  font-size: 15px;
  color: #9ec0ff;
  transition: transform 0.2s ease;
}

.drawer-content {
  display: grid;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease;
}

.drawer-panel.is-open > .drawer-content {
  max-height: 75vh;
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel.is-open > .drawer-content.legend-drawer-content {
  max-height: 52vh;
  overflow: auto;
}

.drawer-panel.is-open > .drawer-toggle .drawer-chevron {
  transform: rotate(180deg);
}

.control-step-toggle .control-step-title {
  margin: 0;
  flex: 1;
}

.control-step-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--panel-title-size);
  color: #d8e6ff;
}

.step-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 129, 255, 0.52);
  border: 1px solid rgba(180, 213, 255, 0.95);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.control-step-panel label {
  font-size: var(--panel-label-size);
  color: var(--ink-dim);
}

.heatmap-action-panel {
  padding: 6px;
}

.heatmap-action-panel.glass {
  border-color: transparent;
  box-shadow: none;
}

.heatmap-action-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(168, 202, 255, 0.42);
  background: rgba(56, 111, 201, 0.26);
  box-shadow: 0 4px 12px rgba(8, 22, 52, 0.28);
}

.heatmap-action-btn:hover {
  filter: brightness(1.04);
}

.heatmap-action-btn.is-active {
  border-color: rgba(164, 245, 205, 0.68);
  background: rgba(29, 153, 85, 0.34);
}

.inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heatmap-toggle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 1px 0;
  gap: 10px;
}

.checkbox-toggle {
  display: none;
}

.checkbox-label {
  flex: 1;
  font-size: 13px;
  color: var(--ink-dim);
}

.checkbox-checkmark {
  color: transparent;
  font-weight: 700;
  font-size: 12px;
  transition: all 0.15s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.08);
}

.checkbox-toggle:checked + .checkbox-label + .checkbox-checkmark {
  background: var(--accent);
  border-color: #95baff;
  color: #fff;
  transform: scale(1.06);
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

#bucketControls {
  display: grid;
  gap: 5px;
}

#bucketControls.hidden-control {
  display: none;
}

.hidden-control {
  display: none;
}

.btn-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-toggle.active-toggle {
  background: rgba(80, 129, 255, 0.48);
  border-color: rgba(180, 213, 255, 0.95);
}

select,
input[type="range"] {
  width: 100%;
}

select {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 7px 8px;
  font-size: 12px;
}

.count-badge {
  font-weight: 700;
  color: var(--accent);
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  padding: 6px 9px;
  background: rgba(80, 129, 255, 0.28);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(80, 129, 255, 0.42);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
}

.btn-close {
  background: rgba(255, 255, 255, 0.12);
  min-width: 36px;
}

.btn-icon-circle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.stats {
  margin-top: 4px;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 430;
}

.coverage-panel {
  gap: 4px;
}

.coverage-panel .stats {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.35;
}

.coverage-inspect-hint {
  margin: 1px 0 0;
  font-size: 12px;
  color: #a9cbff;
}

.elevation-click-popup .leaflet-popup-content-wrapper {
  background: rgba(10, 22, 40, 0.92);
  color: #e8f2ff;
  border: 1px solid rgba(132, 190, 255, 0.55);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.elevation-click-popup .leaflet-popup-content {
  margin: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.elevation-click-popup .leaflet-popup-tip {
  background: rgba(10, 22, 40, 0.92);
}

.shelter-selection-popup .leaflet-popup-content-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(128, 177, 255, 0.35);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.95))
    padding-box;
  box-shadow:
    0 16px 34px rgba(12, 42, 97, 0.22),
    0 4px 14px rgba(8, 28, 61, 0.16);
}

.shelter-selection-popup .leaflet-popup-tip {
  background: rgba(245, 250, 255, 0.98);
  box-shadow: -1px 1px 0 rgba(128, 177, 255, 0.2);
}

.shelter-selection-popup .leaflet-popup-content {
  margin: 0;
}

.shelter-selection-card {
  min-width: 240px;
  max-width: 320px;
  padding: 12px 14px;
  color: #16345f;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.shelter-selection-title {
  font-size: 17px;
  font-weight: 780;
  color: #2f5582;
  letter-spacing: 0.005em;
  line-height: 1.2;
}

.shelter-selection-kicker {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c88a8;
}

.shelter-selection-count {
  margin-top: 2px;
  font-size: 32px;
  line-height: 1.05;
  font-weight: 820;
  letter-spacing: -0.02em;
  color: #1473ff;
  text-shadow: 0 2px 10px rgba(20, 115, 255, 0.18);
}

.shelter-selection-meta {
  margin-top: 10px;
  border-top: 1px solid rgba(74, 118, 171, 0.18);
  padding-top: 8px;
}

.shelter-selection-meta-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6e89a8;
  margin-bottom: 6px;
}

.shelter-selection-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
  font-size: 12px;
}

.shelter-selection-meta-label {
  color: #6f89a7;
  font-weight: 550;
}

.shelter-selection-meta-value {
  color: #1a395f;
  font-weight: 630;
  text-align: end;
}

.legend-drawer {
  border-radius: 14px;
  color: var(--ink);
  padding: 12px;
  font-size: 13px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(194, 220, 255, 0.42);
  background: linear-gradient(165deg, rgba(13, 30, 58, 0.9), rgba(8, 20, 39, 0.86));
  box-shadow:
    0 10px 22px rgba(2, 10, 24, 0.38),
    inset 0 0 0 1px rgba(188, 216, 255, 0.12);
}

.legend-drawer-content {
  gap: 10px;
}

#app.lang-he-ui .control-stack {
  left: auto;
  right: 14px;
  direction: ltr;
}

#app.lang-he-ui .control-stack > * {
  direction: rtl;
  text-align: right;
}

#app.lang-he-ui .legend-drawer {
  direction: rtl;
  text-align: right;
}

#app.lang-he-ui .control-step-title {
  display: block;
  position: relative;
  text-align: right;
  padding-right: 30px;
  min-height: 22px;
}

#app.lang-he-ui .control-step-title .step-chip {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

#app.lang-he-ui .control-step-title .step-title-text {
  display: block;
}

#app.lang-he-ui .control-step-panel label,
#app.lang-he-ui .coverage-inspect-hint,
#app.lang-he-ui .stats,
#app.lang-he-ui .layer-controls-list label {
  text-align: right;
}

#app.lang-he-ui .heatmap-toggle-control {
  flex-direction: row-reverse;
}

#app.lang-he-ui .checkbox-label {
  text-align: right;
}

#analysisModeControls {
  gap: 6px;
}

#analysisModeControls .analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#analysisModeControls .analysis-choice {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#analysisModeControls .analysis-choice-divider {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
  padding-inline-start: 10px;
}

#analysisModeControls .analysis-choice > label {
  margin: 0;
  font-size: var(--panel-title-size);
  font-weight: 400;
  color: #c8dbff;
  letter-spacing: 0.01em;
  text-align: center;
}

#app.lang-he-ui #analysisModeControls .analysis-choice > label {
  text-align: center;
}

#analysisModeControls .mode-toggle {
  gap: 4px;
}

#analysisModeControls .btn-toggle {
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  min-height: 30px;
}

.count-download-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-download-row .downloads {
  margin-inline-start: auto;
  justify-content: flex-end;
}

#app.lang-he-ui .legend-drawer-toggle {
  text-align: right;
}

.legend-title {
  margin: 0;
  font-size: var(--panel-title-size);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #d5e5ff;
}

.legend-items {
  display: grid;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--panel-label-size);
  line-height: 1.4;
}

.legend-marker {
  width: 18px;
  height: 22px;
  flex-shrink: 0;
}

.legend-marker-small {
  width: 14px;
  height: 18px;
}

.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.legend-swatch-uncovered {
  background: rgba(239, 83, 80, 0.42);
  border-color: #e53935;
}

.legend-swatch-post-1992 {
  background: rgba(152, 161, 171, 0.34);
  border-color: #6f7882;
}

.legend-swatch-covered-base {
  background: rgba(116, 201, 137, 0.5);
  border-color: #237b35;
}

.legend-swatch-not-relevant {
  background: rgba(152, 161, 171, 0.34);
  border-color: #6f7882;
}

.legend-swatch-covered-selected {
  background: #60a5fa;
  border-color: #2563eb;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.legend-dot-covered {
  background: #60a5fa;
  border-color: #2563eb;
}

.legend-line {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  flex-shrink: 0;
}

.legend-line-contour {
  border-top-color: #aeb9ca;
  opacity: 0.8;
}

.legend-topography-note {
  margin: -2px 0 2px 28px;
}

.legend-topography-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -1px 0 4px 28px;
}

.legend-topography-scale-label {
  font-size: 11px;
  color: var(--ink-dim);
  min-width: 28px;
}

.legend-topography-scale-title {
  font-size: 11px;
  color: #c8dbff;
  font-weight: 600;
}

.legend-topography-scale-title:empty {
  display: none;
}

.legend-topography-scale-bar {
  display: inline-block;
  width: 78px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(90deg, hsl(230, 88%, 58%) 0%, hsl(15, 88%, 58%) 100%);
}

.layer-controls-list {
  display: grid;
  gap: 6px;
}

.legend-manage-layers {
  border-top: 1px solid rgba(181, 209, 255, 0.2);
  padding-top: 8px;
}

.legend-manage-layers-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #e2eeff;
  border-color: rgba(160, 198, 255, 0.36);
  background: rgba(77, 130, 222, 0.2);
}

.layers-modal-card {
  width: min(460px, 92vw);
  max-height: 82vh;
  overflow: hidden;
}

.legend-layer-controls-content {
  gap: 8px;
  padding-top: 6px;
}

.assumptions-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}

.assumption-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assumption-column-right {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.18);
  padding-inline-start: 10px;
}

.assumption-group-building-types {
  margin-top: auto;
}

.assumption-group-heatmap {
  margin-top: auto;
}

.assumption-group-heatmap .heatmap-action-btn {
  min-height: 38px;
  box-shadow: 0 4px 12px rgba(8, 22, 52, 0.24);
}

.assumption-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assumption-group-full {
  grid-column: 1 / -1;
}

.assumption-group-left {
  grid-column: 1;
}

.assumption-group-divider {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
  padding-inline-start: 8px;
}

.assumption-group-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #c8dbff;
  text-align: start;
  line-height: 1.2;
  letter-spacing: 0.015em;
}

.assumption-toggle {
  min-height: 24px;
}

.assumption-toggle-label {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--ink-dim);
}


.building-types-selector {
  display: grid;
  gap: 3px;
}

#buildingTypesSelector .assumption-toggle {
  gap: 6px;
  min-height: 22px;
}

#buildingTypesSelector .assumption-toggle.is-weighting-blocked {
  position: relative;
}

#buildingTypesSelector .assumption-toggle.is-weighting-blocked::after {
  content: "⛔";
  position: absolute;
  inset-inline-start: -14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.14s ease;
  pointer-events: none;
}

#buildingTypesSelector .assumption-toggle.is-weighting-blocked:hover::after {
  opacity: 0.95;
}

#buildingTypesSelector .assumption-toggle-label {
  font-size: 12.5px;
  line-height: 1.1;
}

#buildingTypesSelector .checkbox-checkmark {
  padding: 1px 4px;
  font-size: 10.5px;
}

.building-types-dropdown {
  width: min(100%, 360px);
  position: relative;
  display: grid;
  gap: 4px;
}

.building-types-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(165, 199, 255, 0.42);
  background: linear-gradient(160deg, rgba(20, 44, 82, 0.9), rgba(15, 33, 62, 0.86));
  color: var(--ink);
  padding: 6px 9px;
  font-size: 11.5px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.building-types-dropdown-toggle:hover {
  border-color: rgba(197, 220, 255, 0.7);
  background: linear-gradient(160deg, rgba(24, 53, 98, 0.92), rgba(16, 37, 70, 0.9));
}

.building-types-dropdown-toggle:focus-visible {
  outline: none;
  border-color: rgba(210, 227, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(63, 127, 255, 0.38);
}

.building-types-toggle-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
  gap: 6px;
}

#buildingTypesDropdownSummary {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-types-selected-count {
  font-size: 9.5px;
  line-height: 1;
  color: #d5e7ff;
  border: 1px solid rgba(175, 208, 255, 0.46);
  background: rgba(93, 148, 255, 0.24);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}

.building-types-dropdown-toggle .drawer-chevron {
  font-size: 13px;
}

.building-types-dropdown.is-open .building-types-dropdown-toggle .drawer-chevron {
  transform: rotate(180deg);
}

.building-types-dropdown-menu {
  position: relative;
  display: grid;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(150, 188, 255, 0.3);
  background: rgba(8, 19, 37, 0.9);
  box-shadow: inset 0 0 0 1px rgba(31, 76, 145, 0.2);
  padding: 9px;
}

.building-types-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.building-types-actions .btn {
  justify-content: center;
}

.btn-compact {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
}

.building-types-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.building-type-option {
  border: 1px solid rgba(210, 224, 245, 0.62);
  background: rgba(237, 244, 255, 0.18);
  color: #eef4ff;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.building-type-option:hover {
  border-color: rgba(221, 234, 255, 0.86);
  background: rgba(245, 250, 255, 0.26);
}

.building-type-option:focus-visible {
  outline: none;
  border-color: rgba(200, 222, 255, 0.86);
  box-shadow: 0 0 0 2px rgba(61, 123, 255, 0.36);
}

.building-type-option-check {
  display: none;
}

.building-type-option.is-selected {
  background: linear-gradient(150deg, rgba(71, 124, 231, 0.64), rgba(55, 105, 209, 0.56));
  border-color: rgba(187, 215, 255, 0.92);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(34, 88, 182, 0.26);
}

.building-type-option.is-selected .building-type-option-check {
  color: #ffffff;
  border-color: rgba(180, 213, 255, 0.95);
  background: rgba(255, 255, 255, 0.14);
}

.building-type-option.is-weighting-disabled {
  position: relative;
  opacity: 0.72;
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(214, 140, 140, 0.75);
  background:
    linear-gradient(145deg, rgba(56, 26, 26, 0.35), rgba(34, 19, 19, 0.32)),
    rgba(255, 255, 255, 0.03);
}

.building-type-option.is-weighting-disabled:hover,
.building-type-option.is-weighting-disabled:focus-visible {
  border-color: rgba(248, 173, 173, 0.9);
  box-shadow: 0 0 0 2px rgba(193, 92, 92, 0.24);
}

.building-type-option.is-weighting-disabled::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 168, 168, 0.92);
  background: rgba(76, 22, 22, 0.46);
  background-image:
    linear-gradient(135deg, transparent 43%, rgba(255, 172, 172, 0.95) 43%, rgba(255, 172, 172, 0.95) 57%, transparent 57%);
  box-shadow: inset 0 0 0 1px rgba(255, 124, 124, 0.3);
}

.building-type-option.is-weighting-disabled::after {
  content: attr(data-disabled-reason);
  position: absolute;
  inset-inline-start: 8px;
  bottom: calc(100% + 8px);
  background: rgba(39, 13, 13, 0.95);
  color: #ffd6d6;
  border: 1px solid rgba(247, 158, 158, 0.5);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  max-width: 170px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
  z-index: 3;
}

.building-type-option.is-weighting-disabled:hover::after,
.building-type-option.is-weighting-disabled:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.building-type-option.is-weighting-disabled .building-type-option-check {
  color: rgba(255, 188, 188, 0.7);
  border-color: rgba(243, 166, 166, 0.7);
  background: rgba(95, 24, 24, 0.33);
}

.weighting-restriction-notice {
  position: fixed;
  inset-inline-start: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  z-index: 3500;
  border-radius: 10px;
  border: 1px solid rgba(255, 180, 180, 0.5);
  background: linear-gradient(145deg, rgba(62, 21, 21, 0.96), rgba(34, 14, 14, 0.96));
  color: #ffe3e3;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
}

.weighting-restriction-notice.is-visible {
  opacity: 1;
}

.legend-hint {
  font-size: 11px;
  color: #8ab4f8;
  margin: 2px 0 0;
  padding: 0;
  opacity: 0.75;
}

.layer-controls-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-dim);
}

.legend-basemap-control {
  display: grid;
  gap: 6px;
  padding-bottom: 4px;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 18, 0.5);
}

.hidden {
  display: none;
}

.modal-card {
  width: min(760px, 92vw);
  max-height: 82vh;
  border-radius: 14px;
  color: var(--ink);
  overflow: hidden;
}

.guide-card {
  width: min(860px, 95vw);
}

.modal-head {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.guide-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.guide-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-tabs .btn {
  min-width: 110px;
}

.modal-body {
  padding: 12px;
  overflow: auto;
  max-height: calc(82vh - 58px);
  display: grid;
  gap: 8px;
}

.modal-body label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.guide-block {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.guide-block h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.guide-block p {
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-dim);
}

.guide-block ul {
  margin: 6px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.guide-block li {
  color: var(--ink-dim);
  line-height: 1.45;
}

.guide-kicker {
  margin: 0 0 8px;
  color: #c8dbff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.active-lang {
  border-color: #a5c0ff;
  background: rgba(104, 160, 255, 0.35);
}

.active-tab {
  border-color: #8cffdc;
  background: rgba(55, 190, 150, 0.3);
}

.lang-switch-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-dim);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.lang-switch-wrap span {
  color: #a9bddf;
  transition: color 0.2s ease;
}

.lang-switch-wrap span.active-lang-label {
  font-weight: 700;
}

#topLangLabelEn.active-lang-label {
  color: #ffcc6e;
}

#topLangLabelHe.active-lang-label {
  color: #5ff0d8;
}

#modalLangLabelEn.active-lang-label {
  color: #ffcc6e;
}

#modalLangLabelHe.active-lang-label {
  color: #5ff0d8;
}

.lang-toggle {
  position: relative;
  width: 42px;
  height: 22px;
  display: inline-block;
}

.lang-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.lang-toggle-slider {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ff9d57, #ffd451);
  border: 1px solid rgba(255, 219, 141, 0.95);
  border-radius: 20px;
  transition: 0.2s;
}

.lang-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #dce8ff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: 0.2s;
}

.lang-toggle input:checked + .lang-toggle-slider {
  background: linear-gradient(135deg, #2f80ff, #41d1c7);
  border-color: rgba(170, 236, 255, 0.95);
}

.lang-toggle input:checked + .lang-toggle-slider::before {
  transform: translateX(20px);
  background: #ffffff;
}

.modal-body.methods-body .guide-block {
  background: rgba(83, 134, 255, 0.11);
  border-color: rgba(137, 171, 255, 0.35);
}

.guide-card.lang-he .guide-block {
  text-align: right;
}

.guide-card.lang-he .guide-block ul {
  padding-right: 0;
  padding-left: 0;
}

.custom-icon {
  width: 20px;
  height: 24px;
}

.recommended-icon {
  width: 16px;
  height: 20px;
}

@media (max-width: 900px) {
  .mobile-controls-btn {
    bottom: max(14px, env(safe-area-inset-bottom));
    min-width: 210px;
    min-height: 54px;
    font-size: 16px;
    padding: 13px 28px;
    border-width: 2px;
    animation: mobile-controls-pulse 1.9s ease-in-out infinite;
  }

  :root {
    --topbar-height: 58px;
    --panel-label-size: 11px;
    --panel-title-size: 12px;
  }

  .nur-logo {
    width: 32px;
    height: 32px;
  }

  .city-logo {
    width: auto;
    height: 24px;
  }

  .mit-logo {
    height: 18px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
  }
  .topbar h1 {
    font-size: 14px;
  }
  .topbar p,
  .prototype-banner {
    display: none;
  }
  .control-stack {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: min(88.8vh, 744px);
    overflow-y: auto;
    border-radius: 14px;
    background: rgba(7, 16, 34, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
    padding: 8px;
    z-index: 1300;
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.22s ease,
      opacity 0.18s ease;
  }
  #app.lang-he-ui .control-stack {
    left: 10px;
    right: 10px;
  }
  #app.mobile-controls-open .control-stack {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  #app.mobile-controls-open .mobile-controls-btn {
    display: none;
  }
  .drawer-panel.is-open > .drawer-content.legend-drawer-content {
    max-height: 34vh;
    overflow: auto;
  }
  .lang-switch-wrap {
    font-size: 11px;
    padding: 3px 8px;
  }
  .btn {
    font-size: 11px;
    padding: 5px 8px;
  }
  .btn-icon-circle {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 16px;
  }
  .heatmap-action-btn {
    min-height: 44px;
    font-size: 15px;
  }
  .guide-head-row {
    align-items: flex-start;
  }
  .guide-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .guide-tabs {
    justify-content: space-between;
  }
  .guide-tabs .btn {
    flex: 1;
    min-width: 0;
  }
  .lang-switch-wrap {
    align-self: center;
  }
  .stats {
    font-size: 11px;
    line-height: 1.35;
  }
  #analysisModeControls .analysis-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #analysisModeControls .analysis-choice-divider {
    border-inline-start: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-inline-start: 0;
    padding-top: 8px;
  }
  .assumptions-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .assumption-column-right {
    border-inline-start: 0;
    padding-inline-start: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
  }
  .assumption-group-divider {
    border-inline-start: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-inline-start: 0;
    padding-top: 8px;
  }
  .building-types-options {
    grid-template-columns: 1fr;
  }
  .count-download-row {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .count-download-row .downloads {
    width: 100%;
    margin-inline-start: 0;
  }
  .legend-row,
  .layer-controls-list label {
    font-size: var(--panel-label-size);
    line-height: 1.25;
  }
  .legend-title {
    font-size: var(--panel-title-size);
    text-transform: none;
  }
  .coverage-inspect-hint,
  .legend-hint {
    font-size: 10px;
  }
}

@keyframes mobile-controls-pulse {
  0%,
  100% {
    box-shadow:
      0 14px 26px rgba(4, 25, 58, 0.48),
      0 0 0 0 rgba(96, 198, 255, 0.34);
  }
  50% {
    box-shadow:
      0 16px 30px rgba(4, 25, 58, 0.52),
      0 0 0 8px rgba(96, 198, 255, 0);
  }
}
