html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      overflow: hidden;
      font-family: Arial, sans-serif;
    }
    
    #map {
      flex-grow: 1;
      height: 100%;
    }

    .navbar {
      position: relative;
      z-index: 3000;
      background-color: #862810; /*DEV COLOR scheme*/
      color: white;
      padding: 10px 15px;
      font-size: 18px;
    }
    
    #main-container {
      display: flex;
      height: calc(100vh - 40px); /* Adjust based on navbar height */
      width: 100vw;
    }

    .sidebar {
      width: 300px;
      padding: 10px;
      background-color: #f8f9fa;
      box-sizing: border-box;
      border-right: 1px solid #ccc;
      overflow-y: auto;
    }
    
    .sidebar h2 {
      margin-top: 20px;
      margin-bottom: 10px;
      padding: 10px 0 10px 10px; /* Top, Right, Bottom, Left padding */
      font-size: 14px;
      color: white;
      background-color: #862810;
      border-bottom: 1px solid #ccc;
    
      /* Vertically center text */
      display: flex;
      align-items: center;
    }
    
    .layer-toggle label {
      display: block;
      margin-bottom: 2px;
      cursor: pointer;
    }
    
    .bridge-subgroup {
      margin-left: 1.5em;
      font-size: 0.8em;
      display: flex;
      flex-direction: column;
      gap: 0.0em;
    }
    
    .model-time {
      padding: 8px;
      font-size: 13px;
      background-color: #D0D7DE;
      border: 1px solid #ddd;
      border-radius: 10px;
    }
    
    .legend-line {
      display: inline-block;
      width: 20px;
      height: 4px;
      margin-right: 6px;
      vertical-align: middle;
      background-color: red;
    }
    
    .legend-box {
      display: inline-block;
      width: 12px;
      height: 12px;
      margin-right: 6px;
      vertical-align: middle;
      background-color: #01c4ff; /* Flood blue */
      opacity: 0.57;             /* Slight transparency */
      border: 1px solid #333;
    }
    .legend {
      background: white;
      padding: 10px;
      line-height: 1.5;
      border-radius: 5px;
      box-shadow: 0 0 5px rgba(0,0,0,0.3);
    }

    .legend i {
      width: 16px;
      height: 16px;
      float: left;
      margin-right: 8px;
      opacity: 0.7;
    }
    
    .osm-layer .leaflet-tile {
      filter: grayscale(100%) brightness(100%);
    }
    
    .legend-color {
      display: inline-block;
      width: 12px;
      height: 12px;
      margin-right: 6px;
      border-radius: 50%;
      vertical-align: middle;
      border: 1px solid #333;
    }
    .legend-lwc-icon {
      display: inline-flex;
      width: 18px;
      height: 18px;
      margin-right: 6px;
      vertical-align: middle;
      color: inherit;
      align-items: center;
      justify-content: center;
    }
    .legend-lwc-icon svg {
      width: 18px;
      height: 18px;
      display: block;
      overflow: visible;
    }
    .legend-lwc-icon .lwc-road-halo {
      stroke: #ffffff;
      stroke-width: 4;
      stroke-linecap: round;
    }
    .legend-lwc-icon .lwc-road {
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
    }
    .legend-lwc-icon .lwc-arch-halo {
      fill: currentColor;
      stroke: #ffffff;
      stroke-width: 4;
      stroke-linejoin: round;
    }
    .legend-lwc-icon .lwc-arch {
      fill: currentColor;
      stroke: #1f2937;
      stroke-width: 2;
      stroke-linejoin: round;
    }
    .legend-lwc-clear { color: #8fdc6b; }
    .legend-lwc-overtopped { color: #db1e2a; }
    .lwc-symbol-icon {
      background: transparent;
      border: 0;
    }
    .lwc-symbol-svg {
      display: block;
      width: 24px;
      height: 24px;
      overflow: visible;
    }

    .leaflet-tooltip.county-name-label {
      background: transparent;
      border: 0;
      box-shadow: none;
      color: #1f2937;
      font-size: 11px;
      font-weight: 600;
      line-height: 1.1;
      padding: 0;
      white-space: nowrap;
      pointer-events: none;
      text-shadow:
        -1px -1px 0 #ffffff,
         1px -1px 0 #ffffff,
        -1px  1px 0 #ffffff,
         1px  1px 0 #ffffff;
    }
    .leaflet-tooltip-left.county-name-label:before,
    .leaflet-tooltip-right.county-name-label:before,
    .leaflet-tooltip-top.county-name-label:before,
    .leaflet-tooltip-bottom.county-name-label:before {
      display: none;
    }
    
    /* Specific colors for each classification */
    .legend-overtopped {
      background-color: #000000;
    }
    
    .legend-critical {
      background-color: #954aa2;
    }
    
    .legend-high {
      background-color: #db1e2a;
    }
    
    .legend-moderate {
      background-color: #faff39;
    }
    
    .legend-low {
      background-color: #8fdc6b;
    }
    
    .flooded-table {
      display: flex;
      margin-left: 2.5em;
      flex-direction: column;
      max-width: 400px;
      font-family: sans-serif;
      font-size: 0.75rem;
    }
    
    .flooded-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 2px 2px;
    }
    
    .flooded-row:nth-child(odd) {
      background-color: #f9f9f9;
    }
    
    .flooded-row:nth-child(even) {
      background-color: #e9e9e9;
    }
    
    .flooded-left {
      display: flex;
      align-items: center;
      gap: 6px;
      flex: 1;
    }
    
    .flooded-right {
      text-align: right;
      font-weight: bold;
    }
    
    .flooded-length-box {
      font-size: 0.75rem;
      padding: 4px 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      background-color: #f9f9f9;
      display: inline-block;
      margin: 16px auto 0; /* Top margin for spacing */
      text-align: center;
    }
    
    .flooded-length-container {
      text-align: center;
    }
    
    #info-modal {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.6);
      z-index: 3000;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 10px;
      box-sizing: border-box;
      overflow: auto;  /* allow scroll if needed */
    }
    
    .modal-content {
      background: #fff;
      padding: 16px;
      border-radius: 8px;
      width: 100%;
      max-width: 660px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      font-family: Arial, sans-serif;
      font-size: 13px;
      line-height: 1.5;
      position: relative;
      box-sizing: border-box;
      max-height: 90vh;         /* prevent full screen overflow */
      overflow-y: auto;         /* scroll content if needed */
    }
    
    .modal-banner {
      width: 100%;
      height: auto;
      border-radius: 4px;
      margin-bottom: 12px;
      display: block;
    }
    
    .modal-title {
      margin-top: 0;
      font-size: 16px;
      text-align: center;
      color: white;
      background-color: #862810;
      padding: 10px;
      border-radius: 4px;
    }
    
    .modal-button {
      margin-top: 10px;
      padding: 5px 12px;
      font-size: 13px;
    }
    
    #sidebar.flyout {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 300px;
        background: #f0f0f0;
        overflow-y: auto;
        transition: transform 0.3s ease-in-out;
        z-index: 1500;
        padding: 10px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.3);
      }
    
      #sidebar.flyout.collapsed {
        transform: translateX(-100%);
      }
    
      .toggle-button {
        position: absolute;
        top: 10px;
        right: -25px;
        width: 25px;
        height: 30px;
        background-color: #ccc;
        border: none;
        cursor: pointer;
        z-index: 1600;
        padding: 0;
      }
      /* --- Mode selector control --- */
      .leaflet-control.mode-control {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.12);
        padding: 8px 10px;
        font: 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      }
      .mode-control label {
        display: block;
        font-weight: 600;
        margin-bottom: 4px;
        color: #1f2937; /* slate-800-ish */
      }
      .mode-control select {
        width: 100%;
        border: 1px solid #e5e7eb;  /* light gray */
        border-radius: 6px;
        padding: 6px 8px;
        background: #fff;
        cursor: pointer;
      }
      .mode-control select:focus {
        outline: none;
        border-color: #2563eb;       /* blue-600-ish */
        box-shadow: 0 0 0 3px rgba(37,99,235,.15);
      }
    
    @media (max-width: 480px) {
      .modal-content {
        padding: 12px;
        font-size: 12px;
      }
    
      .modal-title {
        font-size: 14px;
        padding: 8px;
      }
    
      .modal-button {
        font-size: 12px;
        padding: 4px 10px;
      }
    }
    
    @media (max-width: 500px) {
      #info-button {
        display: none;
      }
    }
    
    .sidebar.collapsed {
      display: none;
    }
    
    .leaflet-control-custom button {
      background: white;
      border: none;
      font-size: 18px;
      padding: 6px 10px;
      border-radius: 4px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }
    
    .leaflet-control-custom button:hover {
      background: #f0f0f0;
    }
    
    @media (max-width: 1200px) {
      .navbar {
        font-size: 18px;  /* Smaller font for medium screens */
      }
    }
    
    @media (max-width: 480px) {
      .navbar {
        font-size: 14px;  /* Even smaller font for very small screens */
      }
    }

/* ===== Feedback modal polish (matches site style) ===== */
#bottomButtonFeedback {
  position: fixed;
  inset: 0;
  display: none;                /* toggled by JS */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  padding: 12px;
  box-sizing: border-box;
}

#bottomButtonFeedback .modal-content {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
  overflow: hidden;             /* so header radius shows cleanly */
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Header: same deep blue as app */
#bottomButtonFeedback .modal-title {
  margin: 0;
  padding: 10px 14px;
  background: #862810;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

/* Body spacing */
#bottomButtonFeedback form {
  padding: 14px;
}

/* Larger summary box */
#bottomButtonFeedback textarea {
  min-height: 140px;
  resize: vertical;
}

/* Focus style to match controls */
#bottomButtonFeedback input[type="text"]:focus,
#bottomButtonFeedback input[list]:focus,
#bottomButtonFeedback select:focus,
#bottomButtonFeedback textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* LEAFLET Feedback button */

.leaflet-control-feedback {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  overflow: hidden;  /* ensures button fills cleanly */
}

.leaflet-control-feedback > button {
  all: unset;               /* reset default button styles */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}
.leaflet-control-feedback > button:hover {
  background: #f3f4f6;
}
/* Position the ⚠️ just slightly above the ? button */
.leaflet-bottom.leaflet-right .leaflet-control-feedback {
  margin-bottom: 8px;  /* adjust so it sits neatly on top of the ? */
}
/* ===== Feedback modal footer & buttons (match site look) ===== */

/* Footer row: light background, subtle top border, right-aligned buttons */
#bottomButtonFeedback .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 16px;
  /* border-top: 1px solid #e5e7eb; */
  /* background: #f8fafc; */
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Base button style (neutral) */
#bottomButtonFeedback .form-actions button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #862810;
  border-radius: 8px;
  padding: 8px 14px;
  font: 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .02s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
#bottomButtonFeedback .form-actions button:hover {
  background: #f3f4f6;
}
#bottomButtonFeedback .form-actions button:active {
  transform: translateY(1px);
}
#bottomButtonFeedback .form-actions button:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* Primary = Send (same blue as Flow Source control) */
#bottomButtonFeedback .form-actions #feedback-submit {
  background: #862810;
  color: #ffffff;
  border-color: #862810;
}
#bottomButtonFeedback .form-actions #feedback-submit:hover {
  background: #225C96;
  border-color: #225C96;
}
#bottomButtonFeedback .form-actions #feedback-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Make fields/labels spacing consistent with app */
#bottomButtonFeedback label {
  display: block;
  font-weight: 600;
  margin: 10px 0 6px;
  color: #1f2937;
}
#bottomButtonFeedback input[type="text"],
#bottomButtonFeedback input[list],
#bottomButtonFeedback select,
#bottomButtonFeedback textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}
#bottomButtonFeedback textarea { min-height: 160px; resize: vertical; }
#bottomButtonFeedback input:focus,
#bottomButtonFeedback select:focus,
#bottomButtonFeedback textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
/* Assimilated Gages icon in leaflet */
.gage-icon {
  color: purple;
  font-size: 14px;
  text-shadow: 0 0 2px white; /* optional halo for visibility */
}

/* Popup styling (bridge warning & others) */
.leaflet-popup-content-wrapper {
  max-width: 605px !important; /* ~10% narrower than previous */
  border-radius: 12px;
}
.leaflet-popup-content {
  width: 562px !important;    /* ~10% narrower than previous */
  max-width: 88vw !important;
  margin: 8px 12px;
  max-height: none !important;
  min-height: 420px;
  overflow: visible !important;
}
.leaflet-popup-content-wrapper { overflow: visible !important; }
.popup h3 {
  margin: 0 0 8px;
  background: #862810;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
}
.prop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.prop-table th {
  text-align: left;
  padding: 6px 8px;
  color: #0c488f;
  font-weight: 700;
  width: 42%;
}
.prop-table td {
  padding: 6px 8px;
  color: #222;
  font-weight: 600;
}
.prop-table tr:nth-child(odd) { background: #d9d9d9; }
.prop-table tr:nth-child(even) { background: #ffffff; }

/* Bridge warning popup layout */
.leaflet-popup.bridge-warning-popup-host .leaflet-popup-content-wrapper {
  max-width: 860px !important;
}
.leaflet-popup.bridge-warning-popup-host .leaflet-popup-content {
  width: 820px !important;
  max-width: calc(100vw - 48px) !important;
  min-height: 0 !important;
}
.bridge-warning-popup .bridge-warning-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.bridge-warning-popup .xs-inline-wrap {
  flex: 0 0 56%;
  margin-top: 0;
  max-width: none;
}
.bridge-warning-popup .bridge-warning-attrs {
  flex: 1 1 44%;
  min-width: 0;
}
.bridge-warning-popup .xs-inline-status {
  font-size: 12px;
  color: #555;
  margin: 0 0 8px;
}
.bridge-warning-popup .xs-inline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.bridge-warning-popup .xs-inline-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}
.bridge-warning-popup .xs-inline-card h4 {
  margin: 0 0 4px;
  font-size: 12px;
}
.bridge-warning-popup .xs-inline-svg {
  width: 100%;
  height: 190px;
  display: block;
}
@media (max-width: 900px) {
  .leaflet-popup.bridge-warning-popup-host .leaflet-popup-content {
    width: min(92vw, 620px) !important;
  }
  .bridge-warning-popup .bridge-warning-layout {
    flex-direction: column;
  }
  .bridge-warning-popup .xs-inline-wrap,
  .bridge-warning-popup .bridge-warning-attrs {
    flex: 1 1 auto;
    width: 100%;
  }
}
