/* =========================================================
   STORY MODE — CLEAN VERSION
   ========================================================= */

/* =========================================================
   1) STORY LAYOUT
   ========================================================= */

.main-layout.story-layout {
  grid-template-columns: 1fr !important;
}

.main-layout.story-layout .sidebar-left,
.main-layout.story-layout .sidebar-right {
  display: none !important;
}

.main-layout.story-layout .map-area {
  position: relative;
  width: 100%;
  height: auto;
  min-height: auto;
  overflow: hidden;
  border-radius: var(--radius);
}

.main-layout.story-layout #map {
  width: 100%;
  height: 100%;
  filter: saturate(0.85) contrast(1.05) brightness(0.95);
}


/* =========================================================
   2) STORY MAP OVERLAY
   ========================================================= */

.story-map-overlay {
  position: absolute;
  inset: 0;
  z-index: 420;
  pointer-events: none;

  background:
    radial-gradient(
      ellipse at center,
      transparent 40%,
      rgba(10, 18, 42, 0.35) 100%
    ),
    linear-gradient(
      180deg,
      rgba(10, 18, 42, 0.25) 0%,
      transparent 25%,
      transparent 75%,
      rgba(10, 18, 42, 0.30) 100%
    );

  mix-blend-mode: multiply;
}

.story-map-overlay.hidden {
  display: none !important;
}

.story-map-overlay.story-overlay-switching {
  background:
    radial-gradient(
      ellipse at center,
      rgba(8, 15, 35, 0.35) 0%,
      rgba(8, 15, 35, 0.82) 100%
    ),
    linear-gradient(
      180deg,
      rgba(8, 15, 35, 0.65),
      rgba(8, 15, 35, 0.80)
    );

  transition: background 0.40s ease;
}


/* =========================================================
   3) STORY SWITCHER
   ========================================================= */

.story-switcher {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 6px;
  border-radius: 999px;

  background: rgba(10, 18, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.story-switcher.hidden {
  display: none !important;
}

.story-switcher-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;

  background: transparent;
  color: rgba(235, 245, 255, 0.80);

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;

  cursor: pointer;
  transition: all 0.22s ease;
}

.story-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.story-switcher-btn.active {
  background: rgba(255, 255, 255, 0.96);
  color: #0d1b3e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   4) STORY SCROLL CONTAINER
   ========================================================= */

.story-scrolly {
  position: absolute;
  inset: 0;
  z-index: 500;

  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;

  pointer-events: auto;
  scroll-behavior: smooth;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.story-scrolly::-webkit-scrollbar {
  display: none;
}

.story-scrolly.hidden {
  display: none !important;
}

.story-scrolly-inner {
  width: 100%;
  min-height: 100%;
  padding: calc(var(--story-h, 100vh) * 0.12) 0 calc(var(--story-h, 100vh) * 0.22);
}

.story-scrolly.story-is-switching {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}


/* =========================================================
   5) STORY PANELS
   ========================================================= */

.story-panel {
  min-height: calc(var(--story-h, 100vh) * 0.86);

  display: flex;
  align-items: center;
  justify-content: flex-end;

  padding-left: clamp(24px, 5vw, 90px);
  padding-right: clamp(24px, 6vw, 110px);

  box-sizing: border-box;
}

.story-panel-card {
  pointer-events: auto;
  position: relative;

  /* smaller horizontally */
  width: min(27vw, 470px);
  max-width: 470px;

  /* taller vertically */
  min-height: 390px;

  /* more vertical padding, less horizontal padding */
  padding: clamp(34px, 2.4vw, 48px) clamp(20px, 1.5vw, 30px);
  border-radius: clamp(18px, 1.5vw, 28px);

  background: rgba(10, 18, 42, 0.18);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.15) 100%
  );

  border: 1px solid rgba(255, 255, 255, 0.12);

  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;

  opacity: 0.25;
  transform: translateY(60px) scale(0.97);

  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    background 0.4s ease;

  will-change: opacity, transform;
}
.story-panel-card::before {
  content: '\2304';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);

  font-size: 18px;
  font-weight: 700;
  color: rgba(56, 189, 248, 0.6);
  opacity: 0.7;
}

.story-panel.is-active .story-panel-card {
  opacity: 1;
  transform: translateY(0) scale(1);

  background: rgba(10, 18, 42, 0.25);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(0, 0, 0, 0.20) 100%
  );

  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.story-panel-kicker {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 14px;

  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  color: var(--accent, #0891b2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.story-panel-kicker::before {
  content: '';
  display: inline-block;

  width: 24px;
  height: 2px;

  background: currentColor;
  border-radius: 2px;

  flex-shrink: 0;
  opacity: 0.8;
}

.story-panel-title {
  margin: 0 0 14px;

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(24px, 2vw, 38px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;

  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.story-panel-text {
  margin: 0;

  font-size: clamp(14px, 1.05vw, 18px);
  line-height: 1.65;
  font-weight: 400;

  color: #d0d8e8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.story-panel-text em {
  opacity: 0.85;
}

.story-panel-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-top: 20px;
  padding: clamp(7px, 0.7vw, 10px) clamp(12px, 1vw, 18px);

  border-radius: 999px;

  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);

  color: #38bdf8;

  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}


/* =========================================================
   6) STORY PANEL MEDIA
   Image inside text card
   ========================================================= */

.story-panel-media {
  margin: 18px 0 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.story-panel-media img {
  display: block !important;

  width: 100% !important;
  height: 190px !important;
  object-fit: cover !important;

  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;

  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

.story-panel-media figcaption {
  margin-top: 8px !important;

  font-size: 11px !important;
  line-height: 1.35 !important;
  font-weight: 650 !important;

  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}


/* =========================================================
   STORY DOTS — premium small
   ========================================================= */

.story-dots {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 700;

  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 10px 8px;
  border-radius: 999px;

  background: rgba(10, 18, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;

  pointer-events: auto;
}

.story-dots.hidden {
  display: none !important;
}

.story-dot {
  width: 1px;
  height: 1px;
  padding: 0;

  border: none;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);

  cursor: pointer;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;

  opacity: 0.9;
}

.story-dot:hover {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 10px rgba(255, 255, 255, 0.12);
}

.story-dot.active {
  width: 2px;
  height: 2px;

  background: #38bdf8;
  opacity: 1;

  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.12),
    0 0 14px rgba(56, 189, 248, 0.28);
}

/* =========================================================
   8) STORY CONTROLS
   ========================================================= */

.story-controls {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1200;

  display: flex;
  align-items: center;
  gap: 8px;
}

.story-autoplay-btn,
.story-voice-toggle {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;

  background: rgba(10, 18, 42, 0.78);
  color: rgba(240, 248, 255, 0.88);

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  cursor: pointer;
  transition: all 0.22s var(--ease);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.story-autoplay-btn {
  padding: 10px 18px;
}

.story-voice-toggle {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 1200;

  padding: 9px 16px;
}

.story-autoplay-btn:hover,
.story-voice-toggle:hover {
  transform: translateY(-2px);
  background: rgba(10, 18, 42, 0.90);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.story-autoplay-btn.is-playing {
  background: rgba(8, 100, 140, 0.88);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.25);
}

.story-voice-toggle.is-off {
  background: rgba(80, 96, 130, 0.70);
  color: rgba(180, 195, 225, 0.85);
}


/* =========================================================
   GROUNDWATER LEGEND — vertical left
   ========================================================= */

.gw-figure2-legend {
  position: absolute;
  left: 28px;
  top: 120px;
  bottom: auto;
  transform: none;
  z-index: 650;

  width: 300px;
  max-width: 300px;
  max-height: calc(var(--story-h, 100vh) - 170px);

  padding: 16px 16px 14px;
  border-radius: 22px;

  background: rgba(10, 18, 42, 0.18);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.15) 100%
  );

  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);

  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;

  color: #d0d8e8;

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.3;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: none;
}

.gw-figure2-legend::-webkit-scrollbar {
  display: none;
}

.gwf2-row {
  margin-bottom: 12px;
}

.gwf2-row:last-child {
  margin-bottom: 0;
}

/* Top part becomes vertical */
.gwf2-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gwf2-block {
  min-width: 0;
}

.gwf2-heading {
  display: block;

  margin: 0 0 8px 0;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;

  color: #ffffff;
}

.gwf2-block .gwf2-items {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.gwf2-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.gwf2-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: rgba(248, 250, 252, 0.94);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.gwf2-swatch {
  display: inline-block;
  flex-shrink: 0;

  width: 12px;
  height: 12px;

  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Keep colors */
.gwf2-urban {
  background: #e978d5;
}

.gwf2-irrigation {
  background: #b8efaa;
}

.gwf2-climate {
  border-radius: 2px;
}

.gwf2-bwbs {
  background: #8f8f8f;
}

.gwf2-cs {
  background: #b7b7b7;
}

.gwf2-d {
  background: #ececec;
}

.gwf2-cf {
  background: #d9d9d9;
}

/* Groundwater clusters vertical cards */
.gwf2-groups,
.gwf2-symbols,
.gwf2-percents {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.gwf2-group-title,
.gwf2-group {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.gwf2-group-title {
  padding-top: 10px;
  margin-top: 4px;

  border-top: 1px solid rgba(255, 255, 255, 0.12);

  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}

.gwf2-group {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;

  padding-left: 2px;
}

.gwf2-symbol {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  font-size: 17px;
  font-weight: 700;
  line-height: 1;

  color: #d7deea;
}

.gwf2-percents .gwf2-group {
  gap: 16px;
}

.gwf2-percents span {
  font-size: 10.5px;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.82);
}

/* =========================================================
   10) BODE STORY LAYERS + LEGENDS
   ========================================================= */

.fccl-layer {
  mix-blend-mode: multiply;
  filter: contrast(1.15) saturate(1.2);
}

.bode-glow-circle {
  filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.75));
}

.fccl-legend,
.landuse-legend {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 900;

  width: 260px;
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;

  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.fccl-legend {
  padding: 14px 16px;
}

.landuse-legend {
  padding: 13px 16px;
}

.fccl-title,
.landuse-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.fccl-title {
  margin-bottom: 10px;
}

.landuse-title {
  margin-bottom: 9px;
}

.fccl-gradient {
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #fff5f0,
    #fcbba1,
    #fb6a4a,
    #cb181d,
    #67000d
  );
  margin-bottom: 8px;
}

.fccl-labels {
  display: flex;
  justify-content: space-between;

  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.landuse-item {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 7px;

  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.landuse-swatch {
  width: 15px;
  height: 15px;

  border-radius: 5px;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.landuse-swatch.forest {
  background: #22c55e;
}

.landuse-swatch.agriculture {
  background: #facc15;
}

body.dark-mode .fccl-legend,
html.dark-mode .fccl-legend,
[data-theme="dark"] .fccl-legend,
body.dark-mode .landuse-legend,
html.dark-mode .landuse-legend,
[data-theme="dark"] .landuse-legend {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  color: #e5edf8;
}

body.dark-mode .fccl-title,
html.dark-mode .fccl-title,
[data-theme="dark"] .fccl-title,
body.dark-mode .landuse-title,
html.dark-mode .landuse-title,
[data-theme="dark"] .landuse-title {
  color: #f8fafc;
}

body.dark-mode .fccl-labels,
html.dark-mode .fccl-labels,
[data-theme="dark"] .fccl-labels,
body.dark-mode .landuse-item,
html.dark-mode .landuse-item,
[data-theme="dark"] .landuse-item {
  color: #cbd5e1;
}


/* =========================================================
   11) ALBUFERA STORY CHART
   ========================================================= */

.albufera-story-chart-panel {
  display: block !important;
  position: fixed !important;

  left: 32px !important;
  top: 210px !important;
  bottom: auto !important;

  z-index: 1210 !important;

  width: 540px !important;
  height: 340px !important;

  box-sizing: border-box !important;
  padding: 14px 16px !important;

  background: rgba(10, 18, 42, 0.18) !important;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.15) 100%
  ) !important;

  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;

  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 22px !important;

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;

  color: #d0d8e8 !important;

  pointer-events: auto !important;
  overflow: hidden !important;
}

.albufera-story-chart-panel.hidden {
  display: none !important;
}

.albufera-story-chart-panel,
.albufera-story-chart-panel * {
  box-sizing: border-box !important;
}

.albufera-story-chart-panel .alb-chart-header {
  display: block !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}

.albufera-story-chart-panel .alb-chart-eyebrow {
  display: block !important;

  margin-bottom: 3px !important;

  font-size: 9px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.11em;
  text-transform: uppercase;

  color: #38bdf8 !important;
  white-space: nowrap !important;
}

.albufera-story-chart-panel .alb-chart-title {
  display: block !important;

  font-size: 17px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;

  color: #ffffff !important;
}

.albufera-story-chart-panel .alb-chart-subtitle {
  display: block !important;

  margin-top: 4px !important;

  font-size: 10.5px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;

  color: #a8b4c8 !important;
}

.albufera-story-chart-panel .alb-chart-body,
.albufera-story-chart-panel canvas {
  display: block !important;
  width: 100% !important;
  height: 250px !important;
}

.albufera-story-chart-panel .alb-chart-body {
  position: relative !important;
}


/* =========================================================
   12) ALBUFERA STORY LEGEND
   ========================================================= */

.albufera-story-legend {
  position: fixed !important;

  left: 32px !important;
  top: 565px !important;
  bottom: auto !important;

  z-index: 1200 !important;

  width: 540px !important;
  min-width: 540px !important;
  max-width: 540px !important;

  box-sizing: border-box !important;
  padding: 12px 14px 11px !important;

  background: rgba(10, 18, 42, 0.18) !important;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.15) 100%
  ) !important;

  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;

  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;

  color: #d0d8e8 !important;

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;

  pointer-events: auto !important;
  overflow: hidden !important;
}

.albufera-story-legend,
.albufera-story-legend * {
  box-sizing: border-box !important;
}

.albufera-story-legend .alb-legend-header {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 12px !important;

  margin-bottom: 8px !important;
  padding-bottom: 7px !important;

  border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.albufera-story-legend .alb-legend-eyebrow,
.albufera-story-legend .alb-legend-note {
  display: none !important;
}

.albufera-story-legend .alb-legend-title,
.albufera-story-legend .alb-legend-subtitle,
.albufera-story-legend .alb-legend-section-title,
.albufera-story-legend .alb-legend-label {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55) !important;
}

.albufera-story-legend .alb-legend-title {
  display: block !important;

  font-size: 15.5px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;

  color: #ffffff !important;
  white-space: nowrap !important;
}

.albufera-story-legend .alb-legend-subtitle {
  display: block !important;
  flex: 1 1 auto !important;

  margin: 0 !important;

  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;

  color: rgba(255, 255, 255, 0.96) !important;
  text-align: right !important;
}

.albufera-story-legend .alb-legend-section {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px 12px !important;

  width: 100% !important;

  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.albufera-story-legend .alb-legend-section + .alb-legend-section {
  margin-top: 7px !important;
  padding-top: 7px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.albufera-story-legend .alb-legend-section-title {
  display: inline-flex !important;
  align-items: center !important;

  margin: 0 4px 0 0 !important;

  font-size: 9.5px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;

  color: #7dd3fc !important;
  white-space: nowrap !important;
}

.albufera-story-legend .alb-legend-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;

  width: auto !important;
  min-height: 22px !important;

  margin: 0 !important;
  padding: 5px 9px !important;

  border-radius: 999px !important;

  background: rgba(255, 255, 255, 0.10) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;

  clear: none !important;
  float: none !important;
}

.albufera-story-legend .alb-legend-label {
  display: inline-block !important;

  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;

  color: rgba(255, 255, 255, 0.98) !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.albufera-story-legend .alb-legend-swatch {
  display: inline-block !important;
  flex: 0 0 12px !important;

  width: 12px !important;
  height: 12px !important;

  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.20) !important;

  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25) !important;
}

.albufera-story-legend .alb-legend-dot {
  display: inline-block !important;
  flex: 0 0 11px !important;

  width: 11px !important;
  height: 11px !important;

  border-radius: 999px !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;

  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.30) !important;
}

.albufera-story-legend .alb-legend-line {
  display: inline-block !important;
  flex: 0 0 20px !important;

  width: 20px !important;
  height: 0 !important;

  border-top: 3px solid currentColor !important;
  border-radius: 999px !important;
}

.albufera-story-legend .alb-legend-line.is-dashed {
  border-top-style: dashed !important;
}

.leaflet-control.albufera-story-legend {
  margin: 0 !important;
  float: none !important;
  clear: none !important;
}

.leaflet-bottom.leaflet-left {
  z-index: 1200 !important;
}

body:not(.story-theme-albufera) .albufera-story-legend,
body:not(.story-theme-albufera) .albufera-story-chart-panel {
  display: none !important;
}


/* =========================================================
   13) STORY THEMES
   ========================================================= */

body.story-theme-groundwater {
  --accent: #0891b2;
}

body.story-theme-bode {
  --accent: #16a34a;
}

body.story-theme-albufera {
  --accent: #0891b2;
}

body.story-theme-bode .story-panel-kicker {
  color: #16a34a;
}

body.story-theme-bode .story-panel-stat {
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(22, 163, 74, 0.18);
  color: #15803d;
}

body.story-theme-albufera .story-panel-card {
  width: min(28vw, 500px) !important;
  max-width: 500px !important;
  min-height: 430px !important;
}

body.story-theme-albufera .story-panel-text {
  font-size: clamp(13.5px, 0.95vw, 16px) !important;
  line-height: 1.55 !important;
}
.story-panel-stat {
  margin-top: 28px;
}


/* =========================================================
   14) FINAL STEP STYLE
   ========================================================= */

.story-panel:last-child .story-panel-card {
  background: rgba(216, 226, 247, 0.68);
  color: #0f172a;
  border-color: rgba(100, 148, 255, 0.18);
}

.story-panel:last-child .story-panel-title,
.story-panel:last-child .story-panel-text {
  color: #0f172a;
}

.story-panel:last-child .story-panel-kicker {
  color: #1a56db;
}

.story-panel:last-child .story-panel-stat {
  background: rgba(26, 86, 219, 0.10);
  color: #1a56db;
  border-color: rgba(26, 86, 219, 0.20);
}


/* =========================================================
   15) ANIMATIONS
   ========================================================= */

.gw-focus-highlight {
  pointer-events: none;
}

.gw-focus-wrap {
  width: 120px;
  height: 120px;

  display: flex;
  align-items: center;
  justify-content: center;

  transform-origin: center;

  animation:
    gwFocusIntro 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    gwFocusPulse 2.4s ease-in-out infinite;

  will-change: transform, opacity, filter;
}

.gw-focus-highlight svg {
  overflow: visible;
}

.gw-focus-rising .gw-focus-wrap {
  animation:
    gwFocusIntro 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    gwFocusPulse 2.2s ease-in-out infinite;
}

.gw-focus-declining .gw-focus-wrap {
  animation:
    gwFocusIntro 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    gwFocusPulse 2.6s ease-in-out infinite;
}

.gw-focus-stable .gw-focus-wrap {
  animation:
    gwFocusIntro 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    gwFocusPulse 3s ease-in-out infinite;
}

@keyframes gwFocusIntro {
  0% {
    opacity: 0;
    transform: scale(0.68);
    filter: blur(2px);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes gwFocusPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.09);
    filter: brightness(1.10);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}


/* =========================================================
   16) RESPONSIVE
   ========================================================= */

@media (max-width: 1300px) {
  .albufera-story-chart-panel,
  .albufera-story-legend {
    left: 24px !important;

    width: 470px !important;
    min-width: 470px !important;
    max-width: 470px !important;
  }

  .albufera-story-chart-panel {
    top: 205px !important;
    height: 315px !important;
  }

  .albufera-story-chart-panel .alb-chart-body,
  .albufera-story-chart-panel canvas {
    height: 225px !important;
  }

  .albufera-story-legend {
    top: 535px !important;
  }

  .albufera-story-legend .alb-legend-subtitle {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  .gw-figure2-legend {
    width: min(94vw, 980px);
    padding: 18px 20px 16px;
    font-size: 13px;
  }

  .gwf2-top {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gwf2-heading,
  .gwf2-group-title {
    font-size: 13px;
  }

  .gwf2-symbol {
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .story-panel {
    align-items: flex-end;
    padding-left: 20px;
    padding-right: 20px;
  }

  .story-panel-card {
    max-width: 100%;
    margin-bottom: 10vh;
  }

  .story-panel-title {
    font-size: 24px;
  }

  .story-panel-text {
    font-size: 14.5px;
  }

  .gw-figure2-legend {
    max-width: calc(100vw - 36px);
    font-size: 11px;
  }

  .gwf2-heading,
  .gwf2-group-title {
    font-size: 12px;
  }

  .gwf2-symbol {
    font-size: 16px;
  }

  .story-switcher {
    top: 72px;
    max-width: calc(100vw - 32px);
  }
}

@media (max-width: 768px) {
  .gw-figure2-legend {
    width: min(96vw, 760px);
    bottom: 16px;
    padding: 16px 16px 14px;
    font-size: 12px;
  }

  .gwf2-block .gwf2-items {
    gap: 8px 12px;
  }

  .gwf2-symbols,
  .gwf2-percents {
    gap: 16px;
  }

  .gwf2-symbol {
    font-size: 16px;
  }

  .story-switcher {
    gap: 6px;
    padding: 5px;
  }

  .story-switcher-btn {
    padding: 9px 12px;
    font-size: 12px;
  }

  .story-voice-toggle {
    top: 18px;
    left: 16px;
    font-size: 12px;
    padding: 8px 12px;
  }

  .story-dots {
    right: 12px;
  }
}

@media (max-height: 780px) {
  .albufera-story-chart-panel {
    top: 165px !important;
    height: 300px !important;
  }

  .albufera-story-chart-panel .alb-chart-body,
  .albufera-story-chart-panel canvas {
    height: 210px !important;
  }

  .albufera-story-legend {
    top: 480px !important;
  }
}

@media (max-height: 680px) {
  .albufera-story-chart-panel {
    top: 140px !important;
    height: 270px !important;
  }

  .albufera-story-chart-panel .alb-chart-body,
  .albufera-story-chart-panel canvas {
    height: 180px !important;
  }

  .albufera-story-legend {
    top: 425px !important;
  }
}
/* =========================================================
   STORY DOTS — small but visible
   Put this at the VERY END of story-mode.css
   ========================================================= */

.story-dots {
  right: 18px !important;
  gap: 10px !important;
  padding: 9px 7px !important;
}

.story-dots .story-dot {
  width: 8px !important;
  height: 8px !important;

  min-width: 8px !important;
  min-height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;

  padding: 0 !important;
  margin: 0 !important;

  border: 0 !important;
  border-radius: 999px !important;

  flex: 0 0 8px !important;

  display: block !important;
  appearance: none !important;
  -webkit-appearance: none !important;

  font-size: 0 !important;
  line-height: 0 !important;

  background: rgba(255, 255, 255, 0.36) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.13) !important;

  cursor: pointer !important;
}

.story-dots .story-dot:hover {
  transform: scale(1.18) !important;
  background: rgba(255, 255, 255, 0.65) !important;
}

.story-dots .story-dot.active {
  width: 10px !important;
  height: 10px !important;

  min-width: 10px !important;
  min-height: 10px !important;
  max-width: 10px !important;
  max-height: 10px !important;

  flex: 0 0 10px !important;

  background: #38bdf8 !important;

  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.13),
    0 0 12px rgba(56, 189, 248, 0.30) !important;
}
.gwf2-cluster-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.gwf2-cluster-card {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gwf2-cluster-card .gwf2-group-title {
  padding-top: 0;
  margin-top: 0;
  border-top: none;

  margin-bottom: 7px;
}

.gwf2-percent-line {
  display: flex;
  gap: 18px;

  margin-top: 4px;
  padding-left: 2px;

  font-size: 10.5px;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.82);
}
/* =========================================================
   STORY PANEL MEDIA — IMAGE FULL DISPLAY
   ========================================================= */

.story-panel-media {
  width: 100%;
  margin: 18px 0 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.story-panel-media img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
}

.story-panel-media.is-contain {
  padding: 8px;
  background: rgba(15, 23, 42, 0.22);
}

.story-panel-media.is-contain img {
  width: 100%;
  height: auto !important;
  max-height: 240px;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 14px;
}

.story-panel-media figcaption {
  margin-top: 8px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.86);
}
/* =========================================================
   GROUNDWATER FIGURE 3 LEGEND — vertical left
   ========================================================= */

.gw-figure3-legend {
  position: absolute;
  left: 28px;
  top: 120px;
  bottom: auto;
  transform: none;
  z-index: 650;

  width: 300px;
  max-width: 300px;
  max-height: calc(var(--story-h, 100vh) - 170px);

  padding: 16px 16px 14px;
  border-radius: 22px;

  background: rgba(10, 18, 42, 0.18);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.15) 100%
  );

  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);

  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;

  color: #d0d8e8;

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.3;

  overflow-y: auto;
  overflow-x: hidden;

  pointer-events: none;
  scrollbar-width: none;
}

.gw-figure3-legend::-webkit-scrollbar {
  display: none;
}

.gwf3-title {
  margin: 0 0 14px 0;

  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: #ffffff;
}

.gwf3-section {
  margin-top: 14px;
  padding-top: 12px;

  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gwf3-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.gwf3-heading {
  display: block;

  margin: 0 0 8px 0;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;

  color: #ffffff;
}

/* Soil moisture ramp */
.gwf3-ramp {
  display: grid;
  grid-template-columns: repeat(7, 1fr);

  width: 100%;
  height: 13px;

  border-radius: 999px;
  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16) inset;
}

.gwf3-ramp span {
  display: block;
}

.gwf3-ramp-labels {
  display: flex;
  justify-content: space-between;

  margin-top: 6px;

  font-size: 10px;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.82);
}

.gwf3-unit {
  margin-top: 4px;

  font-size: 10px;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.74);
}

/* Items */
.gwf3-items {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.gwf3-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: rgba(248, 250, 252, 0.94);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.gwf3-swatch {
  display: inline-block;
  flex-shrink: 0;

  width: 13px;
  height: 13px;

  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.gwf3-vineyards {
  background: #a659cf;
}

.gwf3-fruit {
  background: #d4d72f;
}

.gwf3-irrigated {
  background: #84c778;
}

/* Wells */
.gwf3-wells {
  gap: 9px;
}

.gwf3-triangle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;

  font-size: 20px;
  line-height: 1;
  color: #ef4444;
  font-weight: 900;
}

.gwf3-risk-square {
  display: inline-block;
  flex-shrink: 0;

  width: 13px;
  height: 13px;

  border-radius: 4px;
  border: 2px solid rgba(248, 250, 252, 0.82);
  background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   BODE STORY — STASSFURT FORECAST FIGURE
   smaller transparent panel
   ========================================================= */

.bode-stassfurt-forecast-panel {
  position: fixed;
  left: 34px;
  bottom: 95px;
  width: min(520px, calc(100vw - 720px));
  z-index: 880;

  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 10px 12px 9px;

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;

  pointer-events: none;
}

.bode-stassfurt-forecast-panel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bode-stassfurt-forecast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-family: Inter, sans-serif;
}

.bode-stassfurt-forecast-header span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(37, 99, 235, 0.95);
}

.bode-stassfurt-forecast-header strong {
  font-size: 0.74rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.bode-stassfurt-forecast-figure-wrap {
  width: 100%;
  overflow: hidden;

  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.bode-stassfurt-forecast-figure {
  display: block;
  width: 100%;
  height: auto;
}

.bode-stassfurt-forecast-caption {
  margin-top: 7px;
  font-family: Inter, sans-serif;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(15, 23, 42, 0.82);
}

/* =========================================================
   BODE STORY — FLOATING MINI TIME SERIES
   no large container
   ========================================================= */

/* =========================================================
   BODE STORY — SINGLE SUBPLOT TIME SERIES
   ========================================================= */

.bode-timeseries-subplot-panel {
  position: fixed;
  left: 34px;
  top: 165px;
  width: 420px;
  height: 420px;
  z-index: 880;

  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 12px 14px 14px;

  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;

  pointer-events: none;
}

.bode-timeseries-subplot-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.bode-subplot-title {
  margin-bottom: 8px;

  font-family: Inter, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.bode-subplot-canvas-wrap {
  width: 100%;
  height: calc(100% - 28px);
}

.bode-subplot-canvas-wrap canvas {
  background: transparent !important;
}
/* Albufera story image / figure */
.map-area {
  position: relative;
  overflow: visible !important;
}

#map {
  z-index: 1;
}

.albufera-story-image-panel {
  position: absolute;
  z-index: 999999 !important;

  padding: 10px;
  background: rgba(8, 18, 30, 0.38);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);

  overflow: hidden;
  pointer-events: none;
}

.albufera-story-image-panel.hidden {
  display: none !important;
}

.alb-image-body {
  padding: 0;
}

/* Step: Silla wetland photo */
.albufera-story-image-panel.is-silla-wetland {
  left: 90px;
  top: 210px;
  width: 500px;
  max-width: 500px;
}

.albufera-story-image-panel.is-silla-wetland .alb-image-body img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

/* Step: nitrate chart */
.albufera-story-image-panel.is-nitrate {
  left: 95px;
  top: 275px;
  width: 540px;
  max-width: 540px;
}

.albufera-story-image-panel.is-nitrate .alb-image-body img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: #ffffff;
}

/* Step: turbidity chart */
.albufera-story-image-panel.is-turbidity {
  left: 95px;
  top: 260px;
  width: 520px;
  max-width: 520px;
}

.albufera-story-image-panel.is-turbidity .alb-image-body img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: #ffffff;
}

.albufera-story-image-panel.is-phosphorus {
  left: 95px;
  top: 260px;
  width: 520px;
  max-width: 520px;
}

.albufera-story-image-panel.is-phosphorus .alb-image-body img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: #ffffff;
}
/* wetlands mark */
/* Wetland schematic marks */
.wetland-x-marker,
.wetland-arrow-marker {
  background: transparent;
  border: none;
}

.wetland-x {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(255, 255, 255, 0.45);
}

.wetland-arrow {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(255, 255, 255, 0.45);
}