  /* --------------------------------------------------------
     Scope: .flood-cycle-map
     Nothing here leaks into the site's existing styles.
     Card text inherits the site's Adobe Fonts (via style.css).
     DM Sans is only used on map overlay UI (month bar, badges).
     -------------------------------------------------------- */

  .flood-cycle-map {
    --fm-bg-card: #FFFFFF;
    --fm-bg-surface: #F3F2EE;
    --fm-text: #1A1A18;
    --fm-text-muted: #6B6A65;
    --fm-text-hint: #9C9B96;
    --fm-border: rgba(0,0,0,0.08);
    --fm-blue-water: #2C7BB6;
    --fm-blue-deep: #1A5276;
    --fm-radius: 10px;
    --fm-radius-lg: 14px;

    /* Inherit the site's font — Adobe Fonts via Typekit */
    color: var(--fm-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 0;
    margin: 0;
  }

  .flood-cycle-map *,
  .flood-cycle-map *::before,
  .flood-cycle-map *::after {
    box-sizing: border-box;
  }

  /* ---- Full-width map ---- */

  .fm-map-wrap {
    position: relative;
    border-radius: var(--fm-radius-lg);
    overflow: hidden;
    border: 1px solid var(--fm-border);
    background: #1a2332;
  }

  .fm-map-wrap #flood-map {
    width: 100%;
    height: 620px;
  }
  @media (max-width: 768px) {
    .fm-map-wrap #flood-map { height: 420px; }
    .fm-extent-badge { display: none; }
    .fm-map-wrap .mapboxgl-ctrl-top-right { display: none; }
    .fm-label-detail { display: none; }
    .fm-style-toggle {
      top: auto;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
    }
    .flood-cycle-map .fm-month-bar {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      height: auto;
      gap: 3px;
      padding: 4px;
      position: sticky;
      top: 0;
      z-index: 20;
    }
    .flood-cycle-map .fm-month-btn {
      flex: none;
      padding: 9px 0;
    }
  }

  /* ---- Click-to-activate overlay ---- */

  .fm-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    overflow: hidden;
    border-radius: var(--fm-radius-lg);
    cursor: pointer;
  }
  .fm-overlay picture,
  .fm-overlay img {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(6px);
    transform: scale(1.04); /* hide blur soft edges */
  }
  .fm-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px 28px;
    font-family: 'museo-sans', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    animation: fm-pulse 2.4s ease-in-out infinite;
  }
  .fm-overlay-btn:hover {
    background-color: #b84e10;
    opacity: 1;
    color: white;
  }
  @keyframes fm-pulse {
    0% {
      transform: translate(-50%, -50%) scale(1);
      box-shadow: 0 0 0 0 rgba(149, 62, 8, 0.3);
    }
    70% {
      transform: translate(-50%, -50%) scale(1.03);
      box-shadow: 0 0 10px 4px rgba(149, 62, 8, 0);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      box-shadow: 0 0 0 0 rgba(149, 62, 8, 0);
    }
  }
  .fm-overlay.hidden {
    display: none;
  }

  /* ---- Loading overlay ---- */

  .fm-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(26,35,50,0.85);
    backdrop-filter: blur(4px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }
  .fm-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .fm-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: fm-spin 0.8s linear infinite;
  }
  @keyframes fm-spin { to { transform: rotate(360deg); } }
  .fm-loading-text {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-family: 'DM Sans', sans-serif;
  }

  /* ---- Map overlay UI — DM Sans stays here ---- */

  .fm-play-btn {
    position: absolute;
    top: 16px; left: 16px;
    z-index: 10;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }
  .fm-play-btn:hover {
    background: white;
    transform: scale(1.05);
  }
  .fm-play-btn svg {
    width: 16px; height: 16px;
    fill: var(--fm-text);
  }

  .fm-extent-badge {
    position: absolute;
    top: 76px; left: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--fm-radius);
    padding: 10px 16px;
    border: 1px solid rgba(0,0,0,0.06);
    min-width: 120px;
  }
  .fm-extent-badge .fm-badge-label {
    font-size: 11px;
    color: var(--fm-text-muted);
    font-family: 'DM Sans', sans-serif;
  }
  .fm-extent-badge .fm-badge-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--fm-blue-deep);
    font-family: 'DM Sans', sans-serif;
  }

  /* ---- Style toggle ---- */

  .fm-style-toggle {
    position: absolute;
    top: 148px; left: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--fm-text);
    transition: all 0.2s;
  }
  .fm-style-toggle:hover {
    background: white;
  }
  .fm-style-toggle svg {
    width: 14px; height: 14px;
    flex-shrink: 0;
  }

  /* ---- Month bar — outside the map ---- */

  .fm-month-bar {
    display: flex;
    align-items: stretch;
    background: var(--fm-bg-card);
    border-radius: var(--fm-radius);
    padding: 3px 4px 5px;
    border: 1px solid var(--fm-border);
    margin-top: 1rem;
    height: 38px;
  }

  .fm-month-btn {
    flex: 1;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #6B6A65;
    border-radius: 7px;
    transition: background-color 0.25s ease, color 0.25s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .fm-month-btn:hover {
    color: var(--fm-text);
    background: rgba(0,0,0,0.04);
  }
  .fm-month-btn.active {
    background: var(--fm-blue-water);
    color: white;
    font-weight: 500;
  }

  /* ---- Info strip below map ---- */

  .fm-info-strip {
    margin-top: 1.25rem;
  }

  /* Row 1: month narrative + stats side by side */
  .fm-info-row-1 {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: stretch;
  }
  @media (max-width: 768px) {
    .fm-info-row-1 { grid-template-columns: 1fr; }
  }

  /* Row 2: water level | wildlife — equal height */
  .fm-info-row-2 {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
    align-items: stretch;
  }
  .fm-info-row-2 .fm-card {
    min-height: 140px; /* prevents layout jump between months */
  }
  @media (max-width: 768px) {
    .fm-info-row-2 { grid-template-columns: 1fr; }
  }

  /* ---- Cards — inherit site fonts ---- */

  .fm-card {
    background: var(--fm-bg-card);
    border-radius: var(--fm-radius-lg);
    border: 1px solid var(--fm-border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .fm-month-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
    color: var(--fm-text);
  }
  .fm-month-desc {
    font-size: 14px;
    color: var(--fm-text-muted);
    line-height: 1.7;
    margin: 0;
    min-height: 5.1em; /* 3 lines at 1.7 line-height — prevents layout jump */
  }

  /* Stats 2x2 grid */
  .fm-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .fm-stat {
    background: var(--fm-bg-surface);
    border-radius: var(--fm-radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .fm-stat-label {
    font-size: 10px;
    color: var(--fm-text-hint);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .fm-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--fm-text);
  }

  /* Section labels */
  .fm-section-label {
    font-size: 10px;
    color: var(--fm-text-hint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
  }

  /* Wildlife text */
  .fm-wildlife-text {
    font-size: 14px;
    color: var(--fm-text-muted);
    line-height: 1.7;
    margin: 0;
  }

  /* Water bar */
  .fm-water-bar-wrap { margin-top: 8px; }
  .fm-water-bar-bg {
    height: 6px;
    background: var(--fm-bg-surface);
    border-radius: 3px;
    overflow: hidden;
  }
  .fm-water-bar-fill {
    height: 100%;
    background: var(--fm-blue-water);
    border-radius: 3px;
    transition: width 0.6s ease;
  }
  .fm-water-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--fm-text-hint);
    margin-top: 4px;
  }

  /* Attribution */
  .fm-attribution {
    font-size: 10px;
    color: var(--fm-text-hint);
    margin-top: 1rem;
    text-align: right;
  }
  .fm-attribution a {
    color: var(--fm-text-muted);
  }

  /* Mapbox attribution */
  .fm-map-wrap .mapboxgl-ctrl-attrib {
    font-size: 10px !important;
  }
  /* ---- Mobile overrides ---- */

  @media (max-width: 768px) {
    .fm-extent-badge { display: none; }
    .fm-map-wrap .mapboxgl-ctrl-top-right { display: none; }
    .fm-style-toggle {
      top: auto;
      left: 50%;
      bottom: 20px;
      transform: translateX(-50%);
    }
  }
