@import url("fast-theme.css");
:root {
      --fast-navbar-height: 56px;
    }

/* Place search: the dialog scrolls without moving the map underneath it. */
#fast-search-dialog {
  position: fixed; inset: var(--search-top, 72px) 16px auto auto; margin: 0;
  width: min(600px, calc(100% - 32px)); max-width: none;
  max-height: var(--search-height, 80dvh); padding: 0;
  box-sizing: border-box; border: 1px solid #d6dce1; border-radius: 14px;
  background: #fff; color: #1f2937; box-shadow: 0 18px 60px #0f172a40;
  font: 14px/1.4 Arial, sans-serif; overflow: hidden;
}
#fast-search-dialog[open] { display: flex; flex-direction: column; }
#fast-search-dialog::backdrop { background: #0f172a30; }
#fast-search-dialog button { min-height: 44px; cursor: pointer; font: inherit; }
#fast-search-dialog button:focus-visible, #fast-search-input:focus-visible { outline: 3px solid var(--fast-accent); outline-offset: 2px; }
.fast-search-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 0; flex: none; }
.fast-search-header h2 { margin: 0; font-size: 19px; color: var(--fast-accent); }
#fast-search-close { width: 44px; border: 0; border-radius: 8px; background: transparent; color: #4b5563; font-size: 26px !important; }
.fast-search-field { display: flex; gap: 8px; margin: 6px 14px; flex: none; }
#fast-search-input { min-width: 0; flex: 1; min-height: 46px; padding: 10px; border: 1px solid #aab4bf; border-radius: 8px; font: 16px Arial, sans-serif; color: #1f2937; }
#fast-search-input::-webkit-search-cancel-button { display: none; }
#fast-search-clear, #fast-search-retry { border: 1px solid #d6dce1; border-radius: 8px; background: #fff; color: var(--fast-accent); padding: 0 10px; }
.fast-search-filters { display: flex; gap: 5px; padding: 2px 14px 8px; overflow-x: auto; flex: none; }
.fast-search-filters button { border: 1px solid #d6dce1; border-radius: 999px; padding: 0 12px; background: #fff; color: #374151; }
.fast-search-filters button[aria-pressed="true"] { background: var(--fast-accent); color: #fff; border-color: var(--fast-accent); }
.fast-search-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b7bdc4 transparent; min-height: 0; padding: 0 14px; flex: 1 1 auto; }
#fast-search-empty { color: #64748b; margin: 14px 0 24px; }
#fast-search-empty:empty { display: none; }
.fast-search-result { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 1px 8px; margin: 4px 0; padding: 6px 10px; border: 2px solid transparent; border-radius: 8px; box-sizing: border-box; min-height: 52px; cursor: pointer; background: #f1f5f9; }
.fast-search-result[data-kind="maintenance"] { background: #edf7ef; }
.fast-search-result[data-kind="district"] { background: #eef5ff; }
.fast-search-result[data-kind="bridge"] { background: #fff7e5; }
.fast-search-result[data-kind="osm"] { background: #f4efff; }
.fast-search-result:hover, .fast-search-result[aria-selected="true"] { border-color: var(--fast-accent); }
.fast-search-result strong, .fast-search-result small { grid-column: 2; overflow-wrap: anywhere; }
.fast-search-result small { color: #475569; font-size: 12px; }
.fast-search-result-heading { grid-column: 2; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.fast-search-result-heading strong { flex: 1 1 80px; min-width: 0; }
.fast-search-result[data-warning] { box-shadow: inset 4px 0 var(--bridge-warning-color); }
.fast-search-result[data-warning="overtopped"] { background: #f0f1f3; }
.fast-search-result[data-warning="critical"] { background: #f7eef8; }
.fast-search-result[data-warning="high"] { background: #fff0f0; }
.fast-search-result[data-warning="moderate"] { background: #ffffe5; }
.fast-search-result[data-warning="low"] { background: #f1faeb; }
.fast-search-warning { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--bridge-warning-color); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.fast-search-result[data-warning="moderate"] .fast-search-warning,
.fast-search-result[data-warning="low"] .fast-search-warning { color: #172314; }
.fast-search-badge { grid-row: 1 / 3; align-self: start; font-size: 11px; font-weight: bold; border: 1px solid #64748b40; border-radius: 5px; padding: 3px 5px; width: fit-content; }
.fast-search-footer { border-top: 1px solid #e5e7eb; background: #fafbfc; padding: 8px 14px; flex: none; color: #64748b; font-size: 11px; }
.fast-search-footer a { color: var(--fast-accent); }
#fast-search-local-status, #fast-search-osm-status { font-size: 12px; }
#fast-search-osm-status.is-loading::before { content: ''; display: inline-block; width: 10px; height: 10px; border: 2px solid #ddd; border-top-color: var(--fast-accent); border-radius: 50%; margin-right: 6px; animation: fast-search-spin .8s linear infinite; }
.fast-search-pin { filter: drop-shadow(0 2px 2px #0006); }
.fast-search-pin svg { display: block; width: 28px; height: 36px; }
.fast-search-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes fast-search-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #fast-search-osm-status.is-loading::before { animation-play-state: paused; } }
@media (max-width: 600px) {
  #fast-search-dialog { right: 8px; width: calc(100% - 16px); max-height: var(--search-height, 80dvh); border-radius: 12px; }
  .fast-search-header { padding: 4px 10px 0; }
  .fast-search-field { margin: 6px 12px; }
  .fast-search-filters { padding: 2px 12px 8px; }
  .fast-search-scroll { padding: 0 12px; }
  .fast-search-result { grid-template-columns: 88px minmax(0, 1fr); padding: 10px; }
  .fast-search-footer { padding: 8px 12px; }
}

html, body {
      margin: 0;
      padding: 0;
      height: 100%;
    }

    body {
      overflow: hidden;
      display: flex;
      flex-direction: column;
      font-family: Arial, sans-serif;
    }
    
    #map {
      flex: 1 1 auto;
      min-width: 0;
      min-height: 0;
    }

    .navbar {
      position: relative;
      z-index: 3000;
      background-color: var(--fast-accent); /* EVAL accent */
      color: white;
      padding: 10px 15px;
      font-size: 18px;
      flex: 0 0 auto;
    }

    .navbar-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      gap: 12px;
    }

    .navbar-title {
      min-width: 0;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      line-height: 1.25;
    }

    .navbar-title-text {
      font-size: inherit;
    }

    .navbar-district-abbrev {
      font-size: 0.95em;
      font-weight: 600;
      white-space: nowrap;
    }

    .time-view-nav {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      justify-self: center;
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: 7px;
      overflow: hidden;
      white-space: nowrap;
    }

    .time-view-nav button {
      appearance: none;
      -webkit-appearance: none;
      border: 0;
      border-right: 1px solid rgba(255, 255, 255, 0.45);
      background: transparent;
      color: #fff;
      min-height: 36px;
      padding: 0 15px;
      font: 700 15px/1 Arial, sans-serif;
      cursor: pointer;
    }

    .time-view-nav button[data-time-view="historic"] { --time-view-active: #6d28d9; }
    .time-view-nav button[data-time-view="lookback"] { --time-view-active: #b45309; }
    .time-view-nav button[data-time-view="now"] { --time-view-active: #047857; }
    .time-view-nav button[data-time-view="forecast"] { --time-view-active: #1d4ed8; }

    .time-view-nav button:last-child { border-right: 0; }
    .time-view-nav button:hover { background: rgba(255, 255, 255, 0.14); }
    .time-view-nav button.is-active,
    .time-view-nav button[aria-pressed="true"] {
      background: var(--time-view-active);
      color: #fff;
      box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.72);
    }
    .time-view-nav button:focus-visible {
      position: relative;
      z-index: 1;
      outline: 3px solid rgba(255, 255, 255, 0.4);
      outline-offset: -3px;
    }

    .navbar-actions-wrap {
      justify-self: end;
      margin-left: auto;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: center;
      gap: 0;
    }

    .navbar-action-status {
      position: fixed;
      top: calc(var(--fast-navbar-height) + 8px);
      right: 12px;
      max-width: min(320px, calc(100vw - 24px));
      box-sizing: border-box;
      padding: 9px 12px;
      border: 1px solid #d6dce1;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 3px 12px #0003;
      pointer-events: none;
      font-size: 12px;
      color: var(--fast-accent);
      text-align: right;
    }

    .navbar-action-status:empty {
      display: none;
    }

    .navbar-action-status.is-error {
      color: #991b1b;
    }

    .navbar-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: nowrap;
    }

    .navbar-action-btn {
      appearance: none;
      -webkit-appearance: none;
      border: 1px solid rgba(255, 255, 255, 0.72);
      background: #ffffff;
      color: var(--fast-accent);
      border-radius: 999px;
      width: 92px;
      height: 44px;
      min-height: 44px;
      flex: 0 0 auto;
      box-sizing: border-box;
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font: 600 12px/1 Arial, sans-serif;
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
      transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.02s ease;
    }

    .navbar-action-btn:hover {
      background: #f3f4f6;
    }

    .navbar-action-btn:active {
      transform: translateY(1px);
    }

    .navbar-action-btn:focus {
      outline: none;
      box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
    }

    .navbar-action-icon {
      width: 18px;
      height: 18px;
      display: block;
      flex: 0 0 auto;
    }

    .navbar-action-label {
      white-space: nowrap;
    }
    
    #main-container {
      display: flex;
      flex: 1 1 auto;
      min-height: 0;
      width: 100%;
    }

    .sidebar {
      flex: 0 0 300px;
      width: 300px;
      height: 100%;
      padding: 10px;
      background-color: #f8f9fa;
      box-sizing: border-box;
      border-right: 1px solid #ccc;
      overflow-y: auto;
    }
    
    .sidebar h2,
    .symbology-group > summary {
      margin-top: 20px;
      margin-bottom: 10px;
      padding: 10px 0 10px 10px; /* Top, Right, Bottom, Left padding */
      font-size: 14px;
      color: white;
      background-color: var(--fast-accent);
      border-bottom: 1px solid #ccc;
    
      /* Vertically center text */
      display: flex;
      align-items: center;
    }

    .symbology-group > summary { list-style: none; cursor: pointer; font-weight: 700; padding-right: 12px; min-height: 24px; }
    .symbology-group > summary::-webkit-details-marker { display: none; }
    .symbology-group > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-left: auto; }
    .symbology-group[open] > summary::after { transform: rotate(45deg); }
    .symbology-group > summary:focus-visible { outline: 3px solid var(--fast-accent-hover); outline-offset: 2px; }

    /* Keep native checkbox semantics while using the site accent. */
    input[type="checkbox"] {
      appearance: none;
      -webkit-appearance: none;
      display: inline-grid;
      place-content: center;
      vertical-align: middle;
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
      border: 1.5px solid var(--fast-accent-border);
      border-radius: 4px;
      background: #fff;
      cursor: pointer;
    }
    input[type="checkbox"]:checked,
    input[type="checkbox"]:indeterminate { background: var(--fast-accent); border-color: var(--fast-accent); }
    input[type="checkbox"]:checked::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
    input[type="checkbox"]:indeterminate::after { content: ''; width: 8px; height: 2px; background: #fff; }
    input[type="checkbox"]:focus-visible { outline: 3px solid var(--fast-accent-hover); outline-offset: 2px; }
    input[type="checkbox"]:disabled { opacity: 0.45; cursor: not-allowed; }
    @media (forced-colors: active) { input[type="checkbox"] { appearance: auto; } input[type="checkbox"]::after { display: none; } }
    
    .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,
    .leaflet-tooltip.maintenance-section-label {
      background: transparent;
      /* Shared placement reveals labels after checking both context layers. */
      visibility: hidden;
      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.maintenance-section-label {
      color: #16a34a;
    }
    .leaflet-tooltip.maintenance-section-label:before,
    .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: var(--fast-accent);
      padding: 10px;
      border-radius: 4px;
    }
    
    .modal-button {
      margin-top: 10px;
      padding: 5px 12px;
      font-size: 13px;
    }
    
    #sidebar.flyout {
        position: fixed;
        top: var(--fast-navbar-height);
        left: 0;
        height: calc(100dvh - var(--fast-navbar-height));
        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: 1279px) {
      .navbar { font-size: 16px; }
      .navbar-main {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 10px;
      }
      .navbar-action-btn { width: 44px; min-width: 44px; padding: 0; }
      .navbar-action-label { display: none; }
    }

    @media (max-width: 768px) {
      .navbar {
        padding: 8px 10px;
        font-size: 14px;
      }

      .navbar-main {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title actions" "nav nav";
        gap: 8px;
      }
      .navbar-title { grid-area: title; }
      .navbar-actions-wrap {
        grid-area: actions;
      }

      .time-view-nav {
        grid-area: nav;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
      }

      .time-view-nav button { flex: 1 0 auto; min-height: 44px; padding: 0 10px; font-size: 14px; }
    }

    @media (max-width: 600px) {
      .navbar-action-btn {
        width: 44px;
        min-width: 44px;
        padding: 0;
        justify-content: center;
      }

      .navbar-action-label {
        display: none;
      }
    }
    
    @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: var(--fast-accent);
  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 ? */
}

.fast-location-control { position: relative; background: #fff; border-radius: 8px; }
#fast-location-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: #fff; color: var(--fast-accent); cursor: pointer; }
#fast-location-btn svg { width: 22px; height: 22px; }
#fast-location-btn:hover { background: #f3f4f6; }
#fast-location-btn:focus-visible { outline: 3px solid var(--fast-accent); outline-offset: 2px; }
#fast-location-btn:disabled { opacity: .55; cursor: wait; }
.fast-location-status { position: absolute; bottom: 0; right: 54px; width: max-content; max-width: min(260px, calc(100vw - 80px)); padding: 9px 12px; box-sizing: border-box; background: #fff; color: #334155; border: 1px solid #d6dce1; border-radius: 8px; box-shadow: 0 3px 12px #0003; font: 12px/1.4 Arial, sans-serif; pointer-events: none; }
.fast-location-status:empty { display: none; }
.fast-location-status[data-error="true"] { color: #991b1b; }
/* ===== 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;
}

#bottomButtonFeedback .form-actions #feedback-survey {
  margin-right: auto;
  background: #f1b54f;
  border-color: #d9982f;
  color: #3c2b05;
}
#bottomButtonFeedback .form-actions #feedback-survey:hover {
  background: #f4c26b;
  border-color: #e0a43d;
}

/* Base button style (neutral) */
#bottomButtonFeedback .form-actions button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--fast-accent);
  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: var(--fast-accent);
  color: #ffffff;
  border-color: var(--fast-accent);
}
#bottomButtonFeedback .form-actions #feedback-submit:hover {
  background: var(--fast-accent-hover);
  border-color: var(--fast-accent-hover);
}
#bottomButtonFeedback .form-actions #feedback-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
}
#bottomButtonFeedback .form-actions #feedback-survey: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);
}

@media (max-width: 560px) {
  #bottomButtonFeedback .form-actions {
    flex-wrap: wrap;
  }

  #bottomButtonFeedback .form-actions #feedback-survey {
    margin-right: 0;
    width: 100%;
  }
}
/* Assimilated Gages icon in leaflet */
.gage-icon {
  color: purple;
  font-size: 14px;
  text-shadow: 0 0 2px white; /* optional halo for visibility */
}
.gage-assimilation-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0 22px;
  color: #4b5563;
  font-size: 11px;
}
.gage-excluded-symbol {
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 3px solid #6b7280;
  border-radius: 0;
  background: #fff;
}
.legend-color.legend-gage { border-radius: 0; }
.fast-gage-icon { background: none; border: 0; }
.fast-gage-symbol { display: block; width: 100%; height: 100%; box-sizing: border-box; border-style: solid; }

.location-share-popup .leaflet-popup-content { margin: 14px 18px; width: 240px !important; min-height: 0; }
.leaflet-popup.location-share-popup .leaflet-popup-close-button { top: 15px; right: 19px; }
.location-share-popup .location-share-coordinates { margin: 0 0 12px; color: #58626e; font-size: 12px; }
.location-share-actions { display: flex; gap: 8px; }
.location-share-actions button,
.location-share-actions a { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--fast-accent); border-radius: 7px; font: 600 13px Arial, sans-serif; text-decoration: none; cursor: pointer; color: var(--fast-accent); background: #fff; }
.location-share-actions button { background: var(--fast-accent); color: #fff; }
.location-share-popup .location-share-status { min-height: 16px; margin: 10px 0 0; color: #43564a; font-size: 12px; }
.location-share-pin { background: none; border: 0; }
.location-share-pin svg { display: block; width: 26px; height: 34px; }

/* 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.lwc-popup-host .leaflet-popup-content {
  width: auto !important;
  min-height: 0 !important;
}
.leaflet-popup-content-wrapper { overflow: visible !important; }
.popup h3,
.fast-popup-title,
.location-share-title {
  margin: 0 0 8px;
  background: var(--fast-accent);
  color: #fff;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 52px 10px 12px;
  font: 700 14px/24px Arial, sans-serif;
  border-radius: 8px;
}
.fast-popup-title { text-align: center; }
.leaflet-container a.leaflet-popup-close-button {
  top: 9px;
  right: 13px;
  width: 44px;
  height: 44px;
  color: #fff;
  font: 700 32px/44px Arial, sans-serif;
  text-align: center;
  border-radius: 6px;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus { color: #fff; background: var(--fast-accent-hover); }
.leaflet-container a.leaflet-popup-close-button:focus-visible,
.xs-sheet-close:focus-visible,
.gage-sheet-close:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.prop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.prop-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--fast-accent);
  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;
}
.leaflet-popup.bridge-warning-popup-host .bridge-warning-layout {
  /* Keep the heading/close button visible when the charts exceed the map height. */
  max-height: calc(100dvh - var(--fast-navbar-height) - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.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%;
  }
}

/* Map asset loading indicator */
.fast-muted-basemap {
  filter: grayscale(1) saturate(0) contrast(0.72) brightness(1.18);
  opacity: 0.78 !important;
}
.asset-loading-indicator {
  position: fixed;
  right: 14px;
  bottom: 30px;
  z-index: 1450;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  padding: 8px 11px;
  border: 1px solid rgba(var(--fast-accent-rgb), 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: var(--fast-accent);
  font: 700 12px/1 Arial, sans-serif;
  pointer-events: none;
}
.asset-loading-indicator[hidden] { display: none; }
.asset-loading-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.asset-loading-count {
  margin-left: auto;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.asset-loading-details {
  max-width: min(310px, 80vw);
  max-height: 180px;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: #475569;
  font: 400 11px/1.45 Arial, sans-serif;
}
.asset-loading-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--fast-accent-rgb), 0.16);
}
.asset-loading-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--fast-accent);
  transition: width 0.18s ease;
}
.asset-loading-spinner {
  display: inline-block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 2px solid rgba(var(--fast-accent-rgb), 0.25);
  border-top-color: var(--fast-accent);
  border-radius: 50%;
  animation: fast-loading-spin 0.7s linear infinite;
}
@keyframes fast-loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Gage time-series component */
.leaflet-popup.gage-popup .leaflet-popup-content-wrapper {
  max-width: 760px !important;
  border-radius: 6px;
}
.leaflet-popup.gage-popup .leaflet-popup-content {
  width: min(720px, calc(100vw - 64px)) !important;
  min-height: 0 !important;
  margin: 10px 12px;
  overflow: hidden !important;
}
.gage-chart {
  color: #172033;
  font: 13px/1.35 Arial, sans-serif;
  min-width: 0;
}
.gage-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--fast-accent);
  color: #fff;
  border-radius: 6px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 12px;
}
.gage-popup .gage-chart-header { padding-right: 52px; }
.leaflet-popup.gage-popup .leaflet-popup-close-button { top: 11px; }
.gage-chart-header h3 {
  margin: 0;
  color: #fff;
  background: none;
  padding: 0;
  font-size: 16px;
  line-height: 1.25;
}
.gage-chart-subtitle {
  margin-top: 2px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.gage-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 8px 0;
  background: #d9dde3;
  border: 1px solid #d9dde3;
}
.gage-facts span {
  min-width: 0;
  background: #fff;
  padding: 6px 8px;
  overflow-wrap: anywhere;
}
.gage-facts .gage-exclusion-reason { grid-column: 1 / -1; }
.gage-facts b {
  display: block;
  color: #5d6675;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.gage-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 0;
}
.gage-view-toggle {
  display: inline-flex;
  border: 1px solid #aab1bc;
  border-radius: 5px;
  overflow: hidden;
}
.gage-view-toggle button,
.gage-retry,
.gage-sheet-close {
  border: 0;
  background: #fff;
  color: #354052;
  min-height: 30px;
  padding: 0 9px;
  font: 600 12px/1 Arial, sans-serif;
  cursor: pointer;
}
.gage-view-toggle button + button { border-left: 1px solid #aab1bc; }
.gage-view-toggle button.is-active {
  background: var(--fast-accent);
  color: #fff;
}
.gage-usgs-link {
  color: #0c5ea8;
  font-weight: 700;
  white-space: nowrap;
}
.gage-series-controls {
  display: flex;
  align-items: center;
  gap: 5px 12px;
  flex-wrap: wrap;
  margin: 7px 0 4px;
}
.gage-series-controls label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
}
.gage-series-controls i {
  width: 13px;
  height: 3px;
  background: var(--series-color);
  display: inline-block;
}
.gage-chart-status {
  min-height: 18px;
  color: #5d6675;
  font-size: 11px;
  margin: 4px 0;
}
.gage-retry {
  min-height: 24px;
  color: #0c5ea8;
  padding: 0 4px;
  text-decoration: underline;
}
.gage-chart-canvas {
  width: 100%;
  min-height: 270px;
}
.gage-chart-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}
.gage-grid line { stroke: #e2e5e9; }
.gage-grid path { display: none; }
.gage-series-line { fill: none; }
.gage-axis-label { fill: #354052; font-size: 11px; font-weight: 700; }
.gage-chart-canvas .tick text { fill: #5d6675; font-size: 10px; }
.gage-bottom-sheet,
.xs-bottom-sheet { display: none; }

@media (max-width: 720px) {
  .leaflet-popup.gage-popup { display: none; }
  .gage-bottom-sheet,
  .xs-bottom-sheet {
    display: block;
    position: fixed;
    z-index: 3500;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78vh, 650px);
    overflow-y: auto;
    background: #fff;
    border-top: 3px solid var(--fast-accent);
    box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.22);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .gage-bottom-sheet[hidden],
  .xs-bottom-sheet[hidden] { display: none; }
  .xs-bottom-sheet {
    max-height: min(84vh, 720px);
  }
  .xs-sheet-close,
  .gage-sheet-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: 700 32px/44px Arial, sans-serif;
    cursor: pointer;
  }
  .xs-sheet-close:hover,
  .gage-sheet-close:hover { background: var(--fast-accent-hover); }
  .xs-sheet-close {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 12px;
  }
  .xs-bottom-sheet .bridge-warning-layout {
    flex-direction: column;
  }
  .xs-bottom-sheet .xs-inline-wrap,
  .xs-bottom-sheet .bridge-warning-attrs {
    flex: 1 1 auto;
    width: 100%;
  }
  .gage-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gage-chart-toolbar { align-items: flex-start; flex-direction: column; }
  .gage-view-toggle { width: 100%; }
  .gage-view-toggle button { flex: 1 1 50%; }
  .gage-chart-canvas { min-height: 240px; }
}
