/* ========================================
   BASE STYLES - Body & global settings
   ======================================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  height: 100vh;
  font-size: 16px;
  overflow: hidden;
}

method-strong {
  color: #f7c320;
}

/* Back link to county map */
.back-to-county {
  display: inline-block;
  color: #ade4fa;
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(173, 228, 250, 0.3);
  border-radius: 3px;
  transition: all 0.2s ease;
}
.back-to-county:hover {
  color: #fff;
  border-color: #ade4fa;
  background: rgba(173, 228, 250, 0.1);
}

/* ========================================
   MAP LOGO - Top-right overlay
   ======================================== */
.map-logo {
  position: absolute;
  top: 20px;
  left: 350px;
  z-index: 10;
  pointer-events: none;
}

.map-logo img {
  display: block;
  max-width: 80px;
  height: auto;
}

/* ========================================
   SIDEBAR - Left control panel
   ======================================== */
#sidebar {
  width: 300px;
  background-color: #000;
  color: #fff;
  padding: 15px;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.25);
  z-index: 2;
  /* Always-visible thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
#sidebar::-webkit-scrollbar {
  width: 6px;
}
#sidebar::-webkit-scrollbar-track {
  background: #1a1a1a;
}
#sidebar::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}
#sidebar::-webkit-scrollbar-thumb:hover {
  background: #777;
}

#sidebar h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* Header & Introduction */
#purpose {
  font-size: 0.935em;
  line-height: 1.4;
  margin-bottom: 20px;
  color: #e6e6e6;
}

#purpose p {
  margin: 0 0 8px 0;
}

.purpose-strong {
  font-weight: 700;
  font-size: 1.05em;
  color: #f7c320;
  line-height: 1.3;
  margin: 0 0 6px 0;
  letter-spacing: 0.01em;
}

/* Report Link in intro text */
.report-link {
  color: #ade4fa;
  text-decoration: none;
  border-bottom: 1px solid rgba(173, 228, 250, 0.4);
  transition: border-color 0.2s ease;
}

.report-link:hover {
  border-bottom-color: #ade4fa;
}

/* Methodology Info Button - bottom-right on map */
.map-info-btn {
  position: absolute;
  bottom: 30px;
  right: 10px;
  z-index: 10;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.map-info-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #fff;
  transform: scale(1.1);
}

/* Request a City Section */
.request-city-text {
  font-size: 0.805em;
  color: rgba(255, 255, 255, 0.7);
  margin: 12px 0 0 0;
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(247, 195, 32, 0.08);
  border-left: 3px solid #ade4fa;
  border-radius: 0 4px 4px 0;
}

.request-city-link {
  color: #ade4fa;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 195, 32, 0.4);
  transition: border-color 0.2s ease;
}

.request-city-link:hover {
  border-bottom-color: #ade4fa;
}

/* ========================================
   METHODOLOGY POPUP - Modal overlay
   ======================================== */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.popup-content {
  background: #111;
  color: #fff;
  max-width: 600px;
  max-height: 85vh;
  padding: 20px 24px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  font-size: 0.935em;
  line-height: 1.5;
  overflow-y: auto;
}

.popup-content h4 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ade4fa;
  font-size: 1.15em;
}

.popup-note {
  margin-top: 12px;
  font-style: italic;
  color: #ade4fa;
}

#close-methodology {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px 10px;
  line-height: 1;
}

#close-methodology:hover {
  color: #ade4fa;
}

.hidden {
  display: none;
}

/* Data Sources List Styling */
.data-sources {
  margin: 10px 0 0 0;
  padding-left: 20px;
  font-size: 1.035em;
  line-height: 1.6;
}

.data-sources li {
  margin-bottom: 8px;
}

.data-sources a {
  color: #ade4fa;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.data-sources a:hover {
  border-bottom-color: #ade4fa;
}

.data-sources strong {
  color: #fff;
}

/* ========================================
   STEP HEADERS & HELPER TEXT
   ======================================== */
h3 {
  font-weight: 600;
  font-size: 1em;
  color: #f7c320;
  margin: 16px 0 5px 0;
}

.helper-text {
  font-size: 0.82em;
  color: #fff;
  margin: 2px 0 8px 0;
  line-height: 1.35;
}

/* ========================================
   STEP 1 - Municipality Dropdown
   ======================================== */
label {
  font-weight: bold;
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
}

#municipality-select {
  width: 100%;
  padding: 10px;
  margin-bottom: 4px;
  background-color: #363636;
  color: #fff;
  border: 2px solid #4a4a4a;
  font-size: 0.875em;
  cursor: pointer;
}

/* ========================================
   STEP 2 - Flood Risk & Solutions
   ======================================== */

/* Scenario Toggle Buttons */
.button-group {
  margin-bottom: 6px;
}

.button-group button {
  display: block;
  width: 100%;
  margin: 0 0 6px 0;
  background-color: #363636;
  color: #fff;
  border: 3px solid #5a5a5a;
  border-radius: 0;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.button-group button:hover {
  background-color: #454545;
  border-color: #7a7a7a;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* 2025 toggle active = matches floodplain #a5d5f1 */
#toggle-2025.active {
  background-color: #a5d5f1;
  border-color: #89c5e8;
  font-weight: bold;
  color: #000;
  box-shadow: 0 4px 8px rgba(165, 213, 241, 0.4);
}

#toggle-2025.active:hover {
  background-color: #93ccec;
  border-color: #7bbde2;
  transform: translateY(-1px);
}

/* 2050 toggle active = matches floodplain #3a7fc3 */
#toggle-2050.active {
  background-color: #3a7fc3;
  border-color: #2e6aaa;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 4px 8px rgba(58, 127, 195, 0.4);
}

#toggle-2050.active:hover {
  background-color: #3272b3;
  border-color: #275e9a;
  transform: translateY(-1px);
}

/* Blue Acres button active = teal to match parcels */
#toggle-blue-acres.active {
  background-color: #0d9488;
  border-color: #0f766e;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 4px 8px rgba(13, 148, 136, 0.4);
}

#toggle-blue-acres.active:hover {
  background-color: #0b7c72;
  border-color: #0a6b62;
  transform: translateY(-1px);
}

/* ========================================
   GEOCODER - sidebar address search
   ======================================== */
#geocoder-container {
  margin-bottom: 6px;
}

#geocoder-container .mapboxgl-ctrl-geocoder {
  width: 100% !important;
  min-width: unset !important;
  max-width: 100% !important;
  position: relative;
}

/* ========================================
   TOGGLE ALL ASSETS - on/off master switch
   ======================================== */
.toggle-all-wrap {
  margin-bottom: 8px;
}

.toggle-all-btn {
  display: block;
  width: 100%;
  margin: 0;
  background: transparent;
  color: #f7c320;
  border: 2px solid #f7c320;
  border-radius: 0;
  padding: 8px 10px;
  cursor: pointer;
  text-align: center;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.toggle-all-btn:hover {
  background: rgba(247, 195, 32, 0.15);
}

.toggle-all-btn:not(.active) {
  border-color: #5a5a5a;
  color: #999;
}

.toggle-all-btn:not(.active):hover {
  border-color: #7a7a7a;
  color: #ccc;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile toggle-all chip */
.mobile-toggle-all-wrap {
  margin-bottom: 8px;
}

.chip-toggle-all.active {
  background-color: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #000 !important;
}

/* ========================================
   CUSTOM TOOLTIPS - float over map
   ======================================== */
.tooltip-wrap .tooltip {
  display: none;
}

#floating-tooltip {
  position: fixed;
  z-index: 1000;
  width: 240px;
  background: rgba(15, 15, 15, 0.95);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  padding: 10px 14px;
  border: 1px solid #555;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#floating-tooltip.visible {
  opacity: 1;
}

/* Arrow pointing left */
#floating-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right-color: #555;
}

#floating-tooltip::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(15, 15, 15, 0.95);
}

/* ========================================
   DOWNLOAD SECTION
   ======================================== */
.download-button {
  display: inline-block;
  width: auto;
  margin: 20px 0 0 0;
  background: none;
  color: #ade4fa;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-size: 0.89em;
  font-weight: 500;
  transition: border-color 0.2s ease;
}

.download-button:hover {
  border-bottom-color: #ade4fa;
}

/* ========================================
   STEP 3 - Asset Cards with bar charts
   ======================================== */
#legend {
  margin-top: 16px;
}

#legend h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.legend-helper {
  font-size: 0.86em;
  line-height: 1.4;
  color: #fff;
  margin: 0 0 8px 0;
}

/* Bar legend key */
.bar-legend-key {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.805em;
  color: #aaa;
  justify-content: center;
}

.bar-key-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bar-key-swatch {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 2px;
}

.bar-key-2025 {
  background: #a5d5f1;
}

.bar-key-2050 {
  background: #3a7fc3;
}

/* Toggle hint */
.card-toggle-hint {
  font-size: 0.78em;
  color: #000;
  text-align: center;
  margin: 0 0 6px;
  font-weight: 600;
  padding: 6px 10px;
  background: #f7c320;
  border-radius: 0px;
  letter-spacing: 0.02em;
}

/* Card scroll wrapper — contains cards + fade + hint */
.card-scroll-wrapper {
  position: relative;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #555 #2a2a2a;
}
.card-scroll-wrapper::-webkit-scrollbar {
  width: 5px;
}
.card-scroll-wrapper::-webkit-scrollbar-track {
  background: #2a2a2a;
}
.card-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}
.card-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Fade gradient overlay at bottom of card list */
.card-scroll-fade {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, #000 90%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-top: -48px;
  z-index: 1;
}
.card-scroll-fade.hidden {
  opacity: 0;
}

/* "X more assets" badge */
.scroll-hint-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 4px;
  font-size: 0.76em;
  font-weight: 600;
  color: #f7c320;
  background: rgba(247, 195, 32, 0.08);
  border: 1px solid rgba(247, 195, 32, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
}
.scroll-hint-badge:hover {
  background: rgba(247, 195, 32, 0.15);
  border-color: rgba(247, 195, 32, 0.4);
}
.scroll-hint-badge .hint-arrow {
  animation: bounceDown 1.5s ease infinite;
}
@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.scroll-hint-badge.hidden {
  display: none;
}

/* Card container */
.card-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Individual asset card */
.asset-card {
  border: 1px solid #3a3a3a;
  border-left: 10px solid #5a5a5a;
  border-radius: 0 4px 4px 0;
  padding: 8px 10px;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.15s ease, background 0.25s ease;
  user-select: none;
  background: #2a2a2a;
}

.asset-card:hover {
  transform: translateX(2px);
  filter: brightness(1.15);
}

.asset-card-off {
  opacity: 0.35;
}

.asset-card-off:hover {
  opacity: 0.5;
}

/* Card header: emoji + title */
.card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.card-emoji {
  font-size: 0.98em;
  line-height: 1;
}

.card-title {
  font-size: 0.86em;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.2px;
}

/* Bar rows inside card */
.card-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-bar-label {
  font-size: 0.69em;
  color: #888888;
  width: 24px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 500;
}

.card-bar-track {
  flex: 1;
  height: 10px;
  background: #3a3a3a;
  border-radius: 2px;
  overflow: hidden;
}

.card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 3px;
}

.card-bar-fill.bar-2025 {
  background: #a5d5f1;
}

.card-bar-fill.bar-2050 {
  background: #3a7fc3;
}

.card-bar-count {
  font-size: 0.75em;
  color: #b0b0b0;
  width: 46px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
}

/* ========================================
   FINDING CARD OVERLAY (matches county project)
   ======================================== */
#finding-card {
  position: absolute;
  right: 60px;
  top: 140px;
  width: 310px;
  max-width: calc(100% - 72px);
  background: rgba(0, 0, 0, 0.82);
  border-left: none;
  padding: 24px 22px 24px 30px;
  z-index: 5;
  pointer-events: auto;
}

#finding-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.2em;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.2s;
}

#finding-close:hover {
  color: #fff;
}

/* Two vertical bars: 2025 floodplain (#a5d5f1) + 2050 floodplain (#3a7fc3) */
#finding-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to right, #a5d5f1 50%, #3a7fc3 50%);
}

.finding-label {
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #3a7fc3;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.finding-city-name {
  font-size: 1.32em;
  font-weight: 700;
  color: #f7c320;
  margin: 0 0 10px 0;
  letter-spacing: 0.02em;
}

.finding-text {
  font-size: 1.16em;
  line-height: 1.65;
  color: #f0f0f0;
  margin: 0;
}

.finding-text strong {
  color: #ffffff;
}

.finding-2050 {
  color: #a5d5f1;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* Hide finding card on mobile and tablet */
@media (max-width: 1024px) {
  #finding-card {
    display: none;
  }
}

/* Blue Acres stats box */
.blue-acres-stats {
  font-size: 0.82em;
  color: #d1d5db;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(13, 148, 136, 0.08);
  border-left: 3px solid #0d9488;
  border-radius: 0 4px 4px 0;
  margin-top: 6px;
}

.blue-acres-stats .stat-highlight {
  color: #2dd4bf;
  font-weight: 600;
}

.blue-acres-stats .stat-city {
  color: #fbbf24;
  font-weight: 600;
}

/* ========================================
   MAP CONTAINER - Mapbox GL renders here
   ======================================== */
#map {
  flex-grow: 1;
  position: relative;
}

/* ========================================
   MOBILE BOTTOM SHEET (hidden on desktop)
   ======================================== */
.mobile-sheet {
  display: none; /* shown via media query */
}

/* ========================================
   MOBILE RESPONSIVE - Phones (< 768px)
   ======================================== */
@media screen and (max-width: 768px) {
  body {
    flex-direction: column;
    font-size: 14px;
  }

  /* Hide desktop sidebar on mobile */
  #sidebar {
    display: none;
  }

  /* Map takes full screen behind sheet */
  #map {
    width: 100%;
    height: 100vh;
  }

  /* Logo positioning - smaller */
  .map-logo {
    top: 12px;
    left: 12px;
  }

  .map-logo img {
    max-width: 50px;
  }

  /* Info button above sheet toggle bar */
  .map-info-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
    bottom: 56px;
    right: 8px;
    z-index: 20;
  }

  /* Floating tooltip - smaller on mobile */
  #floating-tooltip {
    font-size: 11px;
    width: 180px;
    padding: 8px 10px;
  }

  /* Methodology popup */
  .popup { padding: 8px; }
  .popup-content {
    max-height: 85vh;
    padding: 12px 15px;
    font-size: 0.8em;
  }
  .popup-content h4 { font-size: 1.1em; margin-bottom: 8px; }
  .data-sources { font-size: 0.85em; padding-left: 15px; }
  .data-sources li { margin-bottom: 6px; }
  #close-methodology { font-size: 1.5em; padding: 5px 10px; }
  br { display: none; }

  /* ---- MOBILE BOTTOM SHEET ---- */
  .mobile-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    max-height: 50vh;
    background: #111;
    z-index: 50;
    border-top: 2px solid #f7c320;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Collapsed: slide down, only toggle bar visible */
  .mobile-sheet.collapsed {
    transform: translateY(calc(100% - 44px));
  }

  /* Expanded: fully visible */
  .mobile-sheet.expanded {
    transform: translateY(0);
  }

  /* ---- Toggle bar (always visible) ---- */
  .mobile-sheet-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    cursor: pointer;
    flex-shrink: 0;
    background: #000;
    -webkit-tap-highlight-color: transparent;
    z-index: 5;
  }

  .mobile-toggle-arrow {
    font-size: 1em;
    color: #999;
    transition: color 0.2s, transform 0.3s ease;
    line-height: 1;
  }

  .mobile-sheet-toggle:hover .mobile-toggle-arrow,
  .mobile-sheet-toggle:active .mobile-toggle-arrow {
    color: #f7c320;
  }

  /* Arrow points up when collapsed (inviting user to pull up) */
  .mobile-sheet.collapsed .mobile-toggle-arrow {
    transform: rotate(0deg);
  }

  /* Arrow points down when expanded (inviting user to close) */
  .mobile-sheet.expanded .mobile-toggle-arrow {
    transform: rotate(180deg);
  }

  .mobile-toggle-label {
    font-size: 0.85em;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
  }

  .mobile-sheet-toggle:hover .mobile-toggle-label {
    color: #f7c320;
  }

  /* ---- Collapsible body ---- */
  .mobile-sheet-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  /* Project title + description */
  .mobile-sheet-header {
    flex-shrink: 0;
    padding: 4px 14px 6px;
  }

  .mobile-sheet-title {
    font-weight: 700;
    font-size: 1.05em;
    color: #f7c320;
    margin: 0 0 3px;
    letter-spacing: 0.01em;
  }

  .mobile-sheet-desc {
    font-size: 0.85em;
    color: #bbb;
    margin: 0;
    line-height: 1.35;
  }

  /* City selector row */
  .mobile-sheet-city-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 10px;
    flex-shrink: 0;
  }

  .mobile-city-label {
    font-size: 0.85em;
    color: #f7c320;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mobile-city-select {
    flex: 1;
    padding: 9px 12px;
    background: #1a1a1a;
    color: #fff;
    border: 1.5px solid #444;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    appearance: auto;
    cursor: pointer;
  }

  /* Tabs */
  .mobile-sheet-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #333;
  }

  .mobile-tab {
    flex: 1;
    background: #1a1a1a;
    border: none;
    color: #888;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
  }

  .mobile-tab.active {
    color: #f7c320;
    border-bottom-color: #f7c320;
    background: #1e1e1e;
  }

  .mobile-tab:hover {
    color: #ccc;
  }

  /* Tab content panels */
  .mobile-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
  }
  .mobile-tab-content::-webkit-scrollbar { width: 4px; }
  .mobile-tab-content::-webkit-scrollbar-track { background: transparent; }
  .mobile-tab-content::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

  .mobile-tab-content.hidden {
    display: none;
  }

  /* ---- Key Finding (inside Layers tab) ---- */
  .mobile-finding {
    background: rgba(0, 0, 0, 0.5);
    border-left: 4px solid;
    border-image: linear-gradient(to bottom, #a5d5f1, #3a7fc3) 1;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
  }

  .mobile-finding-label {
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #3a7fc3;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .mobile-finding-text {
    font-size: 0.9em;
    line-height: 1.5;
    color: #e8e8e8;
    margin: 0;
  }

  .mobile-finding-text strong {
    color: #fff;
  }

  .mobile-finding-text .finding-2050 {
    color: #a5d5f1;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
  }

  /* ---- Step label ---- */
  .mobile-step-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #f7c320;
    margin: 0 0 8px;
  }

  /* ---- Chip toggles with descriptions ---- */
  .mobile-chip-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-chip {
    flex: 1;
    min-width: 0;
    padding: 12px 8px 10px;
    border-radius: 0;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 2px solid #444;
    background: #2a2a2a;
    color: #aaa;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .chip-label {
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .chip-desc {
    font-size: 0.68em;
    font-weight: 400;
    opacity: 0.7;
    line-height: 1.2;
  }

  .mobile-chip:active {
    transform: scale(0.96);
  }

  /* 2025 chip active */
  .mobile-chip.chip-2025.active {
    background: #a5d5f1;
    border-color: #89c5e8;
    color: #000;
    box-shadow: 0 2px 8px rgba(165, 213, 241, 0.35);
  }

  .mobile-chip.chip-2025.active .chip-desc {
    opacity: 0.6;
  }

  /* 2050 chip active */
  .mobile-chip.chip-2050.active {
    background: #3a7fc3;
    border-color: #2e6aaa;
    color: #fff;
    box-shadow: 0 2px 8px rgba(58, 127, 195, 0.35);
  }

  /* Blue Acres chip active */
  .mobile-chip.chip-ba.active {
    background: #0d9488;
    border-color: #0f766e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
  }

  /* Blue Acres stats inside sheet */
  .mobile-sheet .blue-acres-stats {
    font-size: 0.85em;
    padding: 8px 10px;
    margin-top: 2px;
  }

  /* ---- Assets tab: card list ---- */
  .mobile-asset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-asset-list .asset-card {
    padding: 8px 10px;
    border-left-width: 8px;
    border-radius: 0 6px 6px 0;
  }

  .mobile-asset-list .card-header {
    margin-bottom: 5px;
    gap: 6px;
  }

  .mobile-asset-list .card-emoji {
    font-size: 0.95em;
  }

  .mobile-asset-list .card-title {
    font-size: 0.88em;
  }

  .mobile-asset-list .card-bars {
    gap: 3px;
  }

  .mobile-asset-list .card-bar-track {
    height: 9px;
  }

  .mobile-asset-list .card-bar-label {
    font-size: 0.72em;
    width: 26px;
  }

  .mobile-asset-list .card-bar-count {
    font-size: 0.72em;
    width: 42px;
  }

  /* Download in assets tab */
  .mobile-tab-content .download-button {
    font-size: 0.88em;
    margin-top: 12px;
  }
}

/* ========================================
   TABLET PORTRAIT (768px - 1024px)
   ======================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  #sidebar {
    width: 300px;
  }

  .button-group button {
    font-size: 0.9em;
    padding: 12px;
  }

  #municipality-select {
    font-size: 0.9em;
  }

  .map-logo {
    right: 60px;
  }
}

/* ========================================
   LANDSCAPE PHONES (orientation)
   ======================================== */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .mobile-sheet {
    height: 55vh;
    max-height: 55vh;
  }

  .mobile-sheet.collapsed {
    transform: translateY(calc(100% - 44px));
  }
}
