/**
 * Unified Disasters dashboard ? hazard command center chrome
 * @see public/finance/disasters-unified.html
 */

body.du-demo-popup-active #roadRunnerLoading {
  display: none !important;
}

.du-heygen-demo-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.du-heygen-demo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
}

.du-heygen-demo-panel {
  position: relative;
  width: min(100%, 720px);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.du-heygen-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.du-heygen-demo-body {
  padding: 0;
  background: #000;
}

.du-heygen-demo-video {
  display: block;
  width: 100%;
  max-height: min(56vh, 480px);
  object-fit: contain;
  background: #000;
}

.du-heygen-demo-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

body.du-page {
  background: var(--zen-surface, #f8fafc);
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-dark, #1f2937);
  overflow-x: hidden;
  padding-bottom: 2.75rem;
}

.du-main {
  max-width: none;
  position: relative;
  z-index: 1;
}

/* ?? Loading overlay ?? */
#roadRunnerLoading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--du-hero-from) 0%, #1e293b 45%, #334155 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#roadRunnerLoading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-container {
  text-align: center;
  color: #93c5fd;
  max-width: 32rem;
  padding: 1.5rem;
}

.loading-icon-ring {
  font-size: 4rem;
  color: #60a5fa;
  margin-bottom: 1rem;
  animation: duLoadPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(96, 165, 250, 0.45));
}

@keyframes duLoadPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

.loading-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.loading-subtitle {
  font-size: 1rem;
  color: #93c5fd;
  margin-bottom: 1.5rem;
}

.data-stream {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.data-stream .data-icon {
  font-size: 1.75rem;
  color: #60a5fa;
  animation: duDataFlow 2s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 0.25s);
}

@keyframes duDataFlow {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.loading-progress-disaster {
  width: min(400px, 90vw);
  height: 8px;
  background: rgba(96, 165, 250, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}

.loading-progress-bar-disaster {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, var(--zen-primary, #4a90a4), #60a5fa);
  background-size: 200% 100%;
  animation: duProgressShimmer 2s linear infinite;
  transition: width 0.3s ease;
}

@keyframes duProgressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-top: 1rem;
}

.circuit-container {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.circuit-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  animation: duCircuitPulse 1.4s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 0.15s);
}

@keyframes duCircuitPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

/* ?? Hero band ?? */
.du-hero {
  background: linear-gradient(135deg, var(--du-hero-from) 0%, #1e3a5f 40%, var(--du-hero-to) 100%);
  color: #fff;
  padding: 1.75rem 0 1.25rem;
  margin: 0 calc(50% - 50vw) 1.5rem;
  width: 100vw;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25);
}

.du-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.du-hero h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.du-hero .du-hero-kicker {
  font-size: 0.85rem;
  opacity: 0.88;
  font-weight: 500;
}

.du-workflow-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.du-workflow-pills li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.du-workflow-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.du-workflow-pills .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
}

.du-workflow-pills li.du-workflow-pill-active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.du-workflow-pills li.du-workflow-pill-active .step-num {
  background: #fff;
  color: var(--du-hero-from, #0f2744);
}

.du-hero-actions .btn {
  font-weight: 600;
}

/* Stat tiles in hero */
.du-stats-row {
  margin-top: 1.25rem;
}

.du-stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.du-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.du-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.du-stat-card--total .du-stat-icon { background: rgba(255, 255, 255, 0.2); color: #fff; }
.du-stat-card--fire .du-stat-icon { background: rgba(239, 68, 68, 0.35); color: #fecaca; }
.du-stat-card--quake .du-stat-icon { background: rgba(245, 158, 11, 0.35); color: #fde68a; }
.du-stat-card--counties .du-stat-icon { background: rgba(6, 182, 212, 0.35); color: #a5f3fc; }

.du-stat-card .stat-number {
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.du-stat-card .stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.2rem;
}

/* ?? Workspace cards ?? */
.du-page .card {
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
  background: #fff;
  overflow: hidden;
}

.du-page .card:hover {
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.08));
}

/* Gradient headers only on data panels (grid/map), not the filters form */
.du-page .du-data-panel > .card-header {
  background: linear-gradient(135deg, var(--zen-primary, #4a90a4), var(--zen-primary-hover, #3d7a8a));
  color: #fff;
  font-weight: 600;
  border-bottom: none;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
}

.du-page .du-data-panel > .card-header .text-muted {
  color: rgba(255, 255, 255, 0.82) !important;
}

/* Accordion chrome */
.du-page #disastersAccordion {
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.du-page #disastersAccordion .accordion-item {
  border: none;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}

.du-page #disastersAccordion .accordion-item:last-child {
  border-bottom: none;
}

.du-page #disastersAccordion .accordion-button {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.15rem;
  background: #f9fafb;
  color: var(--text-dark, #1f2937);
  box-shadow: none;
}

.du-page #disastersAccordion .accordion-button:not(.collapsed) {
  background: #fff;
  color: var(--zen-primary, #4a90a4);
  box-shadow: none;
}

.du-page #disastersAccordion .accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(var(--zen-primary-rgb, 74, 144, 164), 0.2);
  border-color: transparent;
}

.du-page #disastersAccordion .accordion-body {
  padding: 1rem 1.15rem 1.15rem;
  background: #fff;
}

/* Collapsible section cards (unit-tests pattern) */
.du-section-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.du-section-card {
  border-radius: 12px;
  border: 1px solid var(--zen-border, rgba(74, 144, 164, 0.18));
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.du-section-card:hover {
  box-shadow: 0 4px 14px rgba(74, 144, 164, 0.1);
  border-color: rgba(74, 144, 164, 0.28);
}

.du-section-card.du-command-deck {
  background: linear-gradient(180deg, #fff 0%, var(--zen-surface, #f8fafc) 100%);
}

.du-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: rgba(74, 144, 164, 0.06);
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: background 0.28s ease, border-color 0.28s ease;
  user-select: none;
}

.du-section-card-header:hover {
  background: rgba(74, 144, 164, 0.12);
}

.du-section-card-header[aria-expanded="true"] {
  background: rgba(74, 144, 164, 0.1);
  border-bottom-color: var(--zen-border, rgba(74, 144, 164, 0.18));
}

.du-section-card-header:focus {
  outline: none;
}

.du-section-card-header:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(var(--zen-primary-rgb, 74, 144, 164), 0.35);
  position: relative;
  z-index: 1;
}

.du-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark, #1f2937);
  flex: 1 1 auto;
  min-width: 0;
}

.du-section-title > i {
  font-size: 1.05rem;
  color: var(--zen-primary, #4a90a4);
}

.du-section-heading {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.du-hotspot-filter-badge {
  font-size: 0.7rem;
  font-weight: 600;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.du-hotspot-filter-badge[role="button"] {
  cursor: pointer;
}

.du-section-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--zen-primary, #4a90a4);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.du-section-chevron {
  flex-shrink: 0;
  font-size: 1.05rem;
  color: var(--text-muted, #6b7280);
  transition: transform 0.25s ease;
}

.du-section-card-header[aria-expanded="true"] .du-section-chevron {
  transform: rotate(180deg);
}

.du-section-card-body {
  padding: 1rem 1.15rem 1.15rem;
  background: transparent;
}

.du-section-card-body.collapse:not(.show) {
  display: none;
}

/* Section sidebar nav links — layout/slide in section-sidebar-shell.css */
.section-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-sidebar-nav li {
  margin-bottom: 0.25rem;
}

.section-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-sidebar-nav a:hover {
  background: rgba(74, 144, 164, 0.1);
  color: var(--zen-primary, #4a90a4);
}

.section-sidebar-nav a.active-section {
  background: rgba(74, 144, 164, 0.12);
  color: var(--zen-primary, #4a90a4);
  font-weight: 600;
}

.section-sidebar-nav a i {
  font-size: 1rem;
  opacity: 0.85;
}

.section-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--zen-muted, #6b7280);
  text-transform: uppercase;
  padding: 0.5rem 0.65rem 0.25rem;
  margin-bottom: 0.25rem;
}

.du-section-card-hidden,
.du-nav-section.du-section-card-hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border-width: 0 !important;
  pointer-events: none;
  visibility: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.du-section-cards .du-section-card-hidden {
  margin-top: -1rem !important;
  margin-bottom: -1rem !important;
}

.du-section-card,
.du-nav-section {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

.du-section-card:not(.du-section-card-hidden),
.du-nav-section:not(.du-section-card-hidden) {
  max-height: 5000px;
  opacity: 1;
  visibility: visible;
}

/* Horizontal pills menu (disasters-webcams.html) */
.du-section-pills-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--zen-border, rgba(74, 144, 164, 0.18));
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.du-section-pills-menu--sticky {
  position: sticky;
  top: 0.5rem;
  z-index: 200;
}

.du-section-pills-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  flex-shrink: 0;
}

.du-section-pills-menu .nav-pills .nav-link {
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  padding: 0.35rem 0.8rem;
  border: 1px solid transparent;
  background: transparent;
}

.du-section-pills-menu .nav-pills .nav-link:hover {
  background: rgba(74, 144, 164, 0.08);
  color: var(--zen-primary, #4a90a4);
}

.du-section-pills-menu .nav-pills .nav-link.active {
  background: rgba(74, 144, 164, 0.14);
  color: var(--zen-primary, #4a90a4);
  border-color: rgba(74, 144, 164, 0.28);
}

.du-mocked-loans .du-loan-pills-menu {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: var(--zen-surface, #f8fafc);
}

.du-loan-panel-pills .nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.du-loan-filter-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.du-loan-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.du-loan-filter-pills--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.du-loan-pills-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  margin-right: 0.15rem;
}

.du-filter-pill {
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #fff;
  color: #1e40af;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.du-filter-pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.du-filter-pill-active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-color: #2563eb;
  color: #fff;
}

.du-command-deck-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6b7280);
}

#sourceHealthLine {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.5rem;
}

#sourceHealthLine .text-warning { color: #b45309 !important; }

.dashboard-status-banner {
  display: none;
}

.dashboard-status-banner:not(:empty) {
  display: block;
}

/* Source command deck chips */
.disaster-source-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.35rem 0;
}

.source-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem 0.55rem 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.source-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.source-chip .freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--du-fresh-off);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3);
}

.source-chip.freshness-ok .freshness-dot {
  background: var(--du-fresh-ok);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.source-chip.freshness-warn .freshness-dot {
  background: var(--du-fresh-warn);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.source-chip.freshness-off .freshness-dot {
  background: var(--du-fresh-off);
}

.source-chip-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  margin-left: 0.15rem;
}

.source-chip-active .source-chip-count {
  background: rgba(255, 255, 255, 0.25);
}

.source-chip-db-total {
  font-size: 0.65rem;
  opacity: 0.75;
  font-weight: 500;
}

.source-chip-active {
  color: #fff;
  border-color: transparent;
}

.source-chip[data-source="fema"].source-chip-active { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.source-chip[data-source="firms"].source-chip-active { background: linear-gradient(135deg, #ef4444, #f87171); }
.source-chip[data-source="usgs"].source-chip-active { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1f2937; }
.source-chip[data-source="nws"].source-chip-active { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.source-chip[data-source="nhc"].source-chip-active { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.source-chip[data-source="gdacs"].source-chip-active { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.source-chip[data-source="floodzones"].source-chip-active { background: linear-gradient(135deg, #06b6d4, #67e8f9); }

.source-chip-link {
  text-decoration: none !important;
  color: inherit !important;
}

/* Sticky selection context */
#selectionContextStrip {
  position: sticky;
  top: 0.5rem;
  z-index: 100;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.du-nws-alert-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.du-nws-severity-badge {
  background: rgba(6, 182, 212, 0.15);
  color: #0e7490;
  font-weight: 600;
  vertical-align: middle;
}

#duNwsGridFilterStrip {
  border-color: rgba(6, 182, 212, 0.35);
}

/* Grids */
#disastersGrid.ag-theme-alpine {
  width: 100%;
  height: 520px;
}

#encompassLoansGrid.ag-theme-alpine {
  width: 100%;
  height: 360px;
}

#encompassLoansGrid .ag-row { cursor: pointer; }
#encompassLoansGrid .ag-row.ag-row-selected {
  background-color: #ecfdf5 !important;
  box-shadow: inset 4px 0 0 #059669;
}

#disastersGrid .ag-row.disaster-wildfire { background-color: #fff7ed; }
#disastersGrid .ag-row.disaster-earthquake { background-color: #fef3f2; }
#disastersGrid .ag-row.disaster-hurricane { background-color: #eff6ff; }
#disastersGrid .ag-row.disaster-flood { background-color: #f0f9ff; }
#disastersGrid .ag-row.disaster-severe { background-color: #fef2f2; }
#disastersGrid .ag-row.disaster-active {
  box-shadow: inset 4px 0 0 var(--zen-primary, #4a90a4);
  background-color: #f0f9ff !important;
}

#disastersGrid .ag-row { cursor: pointer; }
#disastersGrid .ag-row.ag-row-selected {
  background-color: #dbeafe !important;
  box-shadow: inset 4px 0 0 var(--zen-primary, #2563eb);
}

/* Source provenance badges */
.source-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
  min-width: 4.5rem;
  text-align: center;
}

.source-fema { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.source-firms { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.source-usgs { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.source-alertcalifornia { background: #fef3c7; color: #d97706; border-color: #fbbf24; }
.source-nws { background: #cffafe; color: #0e7490; border-color: #67e8f9; }
.source-nhc { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.source-gdacs { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.source-floodzones { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }

.risk-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.risk-low { background: #d1fae5; color: #065f46; }
.risk-medium { background: #fef3c7; color: #92400e; }
.risk-high { background: #fee2e2; color: #991b1b; }
.risk-critical { background: #7c2d12; color: #fee2e2; }

.du-risk-intel-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.5rem;
}

.du-hotspot-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #6b7280);
  border-bottom-width: 1px;
}

.du-hotspot-row {
  cursor: pointer;
}

.du-hotspot-row:hover,
.du-hotspot-row:focus {
  background: rgba(37, 99, 235, 0.06);
}

.du-hotspot-row--active {
  background: rgba(37, 99, 235, 0.12);
  outline: 1px solid rgba(37, 99, 235, 0.35);
}

.du-top-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
}

.du-top-event-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.du-top-event-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.25);
}

.du-top-event-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.du-top-event-meta {
  font-size: 0.75rem;
  line-height: 1.35;
}

.du-risk-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.du-risk-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.2rem;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.du-risk-legend--critical { background: #7c2d12; }
.du-risk-legend--high { background: #DC2626; }
.du-risk-legend--medium { background: #F59E0B; }
.du-risk-legend--low { background: #22C55E; }
.du-risk-legend--none { background: #94A3B8; }

/* Map + YouTube panels */
.du-map-panel .card-body,
.du-youtube-panel .card-body {
  padding: 0.75rem;
}

.du-map-panel #map {
  height: clamp(320px, 52vh, 680px);
  width: 100%;
  border-radius: 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
}

.du-youtube-panel #youtubeResults {
  max-height: clamp(320px, 52vh, 680px);
  overflow-y: auto;
  min-height: 200px;
}

.du-youtube-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #6b7280);
}

.du-youtube-empty i {
  font-size: 2.5rem;
  opacity: 0.5;
  display: block;
  margin-bottom: 0.75rem;
}

.du-youtube-skeleton {
  display: none;
  padding: 1rem;
}

.du-youtube-skeleton.is-loading {
  display: block;
}

.du-youtube-skeleton .placeholder {
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

/* Filters panel ? no nested card (was clipping / fighting accordion styles) */
.du-filters-body {
  padding: 0;
}

.du-filters-body .form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.du-filters-body .du-filters-source-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

/* Bootstrap form-select + multiple is broken ? use sized multi-select */
.du-filters-body select[multiple].form-control,
.du-filters-body select[multiple].du-filter-multiselect {
  display: block;
  width: 100%;
  min-height: 7.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
}

.du-filters-body select[multiple] option {
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.du-filters-body select[multiple] option:checked {
  background: linear-gradient(135deg, var(--zen-primary, #4a90a4), var(--zen-primary-hover, #3d7a8a));
  color: #fff;
}

.du-page .form-control:focus,
.du-page .form-select:focus {
  border-color: var(--zen-primary, #4a90a4);
  box-shadow: 0 0 0 3px rgba(var(--zen-primary-rgb, 74, 144, 164), 0.15);
}

.du-filters-body .form-control:not(select[multiple]) {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.du-page .btn-primary {
  background: var(--zen-primary, #4a90a4);
  border-color: var(--zen-primary, #4a90a4);
}

.du-page .btn-primary:hover {
  background: var(--zen-primary-hover, #3d7a8a);
  border-color: var(--zen-primary-hover, #3d7a8a);
}

#encompassLoansCard {
  animation: duSlideDown 0.4s ease;
}

@keyframes duSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  margin-top: 2rem;
  padding: 1.25rem 0 1.5rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.tool-product-credits-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.tool-product-credits-footer .credits-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #64748b;
}

.tool-product-credits-footer .credits-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.footer-meta-line {
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.du-footer-quote {
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}

.du-footer-quote:hover,
.du-footer-quote:focus-visible {
  color: #0f766e;
  outline: none;
}

.du-footer-quote--pulse {
  transform: scale(1.04);
  color: #06b6d4;
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.45);
}

.du-footer-quote--unlock {
  transform: scale(1.08);
  color: #1d4ed8;
  text-shadow: 0 0 24px rgba(37, 99, 235, 0.55), 0 0 48px rgba(6, 182, 212, 0.35);
}

/* ?? Bottom dock: data model, impact graph video, HeyGen card ?? */
.du-bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1040;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  max-width: calc(100vw - 1rem);
  padding: 0 0.25rem;
}

.du-schema-sheet-tab {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem 0.5rem;
  border: 1px solid var(--zen-border, rgba(74, 144, 164, 0.35));
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--zen-primary, #4a90a4);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.du-impact-graph-tab {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.35);
}

.du-impact-graph-tab:hover {
  background: rgba(15, 118, 110, 0.08);
}

.du-heygen-pull-card {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem 0.45rem;
  border: 1px solid #93c5fd;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(145deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: 0 -4px 20px rgba(37, 99, 235, 0.15);
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.du-heygen-pull-card:hover {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
}

.du-heygen-pull-card > .bi-camera-reels {
  font-size: 1.1rem;
}

.du-heygen-pull-card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.du-heygen-pull-card-kicker {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}

.du-heygen-pull-card-label {
  font-size: 0.78rem;
}

.du-heygen-sheet .du-heygen-studio {
  border: none;
  padding: 0;
  background: transparent;
}

.du-schema-sheet-tab:hover {
  background: rgba(74, 144, 164, 0.08);
}

.du-schema-sheet-tab-handle {
  width: 2rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(74, 144, 164, 0.35);
  margin-right: 0.15rem;
}

.du-schema-sheet-tab-chevron {
  transition: transform 0.25s ease;
}

body.du-pull-sheet-open .du-schema-sheet-tab-chevron,
body.du-pull-sheet-open .du-heygen-pull-card .du-schema-sheet-tab-chevron {
  transform: rotate(180deg);
}

.du-schema-sheet {
  position: fixed;
  inset: 0;
  z-index: 1035;
  pointer-events: none;
  visibility: hidden;
}

.du-schema-sheet.du-schema-sheet--open {
  pointer-events: auto;
  visibility: visible;
}

.du-schema-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.du-schema-sheet--open .du-schema-sheet-backdrop {
  opacity: 1;
}

.du-schema-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.du-schema-sheet--open .du-schema-sheet-panel {
  transform: translateY(0);
}

.du-schema-sheet-grab {
  flex-shrink: 0;
  width: 2.5rem;
  height: 4px;
  margin: 0.5rem auto 0;
  border-radius: 999px;
  background: #cbd5e1;
}

.du-schema-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.du-schema-sheet-body {
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.du-schema-sheet-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--zen-primary, #4a90a4);
  margin-bottom: 0.5rem;
}

.du-schema-sheet-list {
  padding-left: 1.1rem;
}

.du-schema-sheet-list li + li {
  margin-top: 0.35rem;
}

.du-schema-sheet-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.du-schema-sheet-details summary {
  cursor: pointer;
  color: var(--zen-primary, #4a90a4);
}

.du-schema-sheet-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(42vh, 360px);
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}

.du-schema-sheet-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.du-heygen-studio {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: linear-gradient(145deg, #f8fbff 0%, #eef6ff 100%);
}

.du-heygen-studio-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.du-heygen-studio-badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.du-heygen-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.du-heygen-mode label {
  font-size: 0.85rem;
  cursor: pointer;
}

.du-heygen-script {
  font-size: 0.78rem;
  line-height: 1.45;
  min-height: 7rem;
  resize: vertical;
}

.du-heygen-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbeafe;
}

.du-heygen-progress-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  animation: du-heygen-indeterminate 1.2s ease-in-out infinite;
}

@keyframes du-heygen-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.du-heygen-result {
  margin-top: 0.75rem;
}

.du-heygen-result video {
  width: 100%;
  border-radius: 10px;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

body.du-pull-sheet-open {
  overflow: hidden;
}

body.du-pull-sheet-open .du-bottom-dock {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .du-bottom-dock {
    gap: 0.1rem;
    max-width: 100vw;
  }
  .du-schema-sheet-tab,
  .du-heygen-pull-card {
    padding: 0.4rem 0.55rem 0.45rem;
    font-size: 0.72rem;
  }
  .du-schema-sheet-tab-handle {
    display: none;
  }
  .du-heygen-pull-card-label {
    display: none;
  }
  .du-hero h1 { font-size: 1.35rem; }
  .du-stats-row .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .du-section-card-header {
    padding: 0.75rem 0.9rem;
  }
  .du-hotspot-filter-badge {
    max-width: 8rem;
  }
  .du-map-panel #map,
  .du-youtube-panel #youtubeResults {
    height: clamp(280px, 48vh, 520px);
    max-height: clamp(280px, 48vh, 520px);
  }
}

@media (max-width: 576px) {
  #duClearHotspotFilter .du-clear-hotspot-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 576px) {
  #duClearHotspotFilter .du-clear-hotspot-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ?? Web crawl headline panel ?? */
.du-web-crawl-panel .card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.du-web-crawl-toggle {
  border: 0;
  box-shadow: none;
}

.du-web-crawl-toggle:hover,
.du-web-crawl-toggle:focus {
  color: inherit;
  text-decoration: none;
}

.du-web-crawl-chevron {
  transition: transform 0.25s ease;
}

.du-web-crawl-toggle[aria-expanded="true"] .du-web-crawl-chevron {
  transform: rotate(180deg);
}

.du-crawl-headline-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.du-crawl-headline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: start;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.du-crawl-headline-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.du-crawl-source-badge {
  grid-row: 1 / span 2;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}

.du-crawl-headline-link {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--zen-primary, #2563eb);
  text-decoration: none;
}

.du-crawl-headline-link:hover {
  text-decoration: underline;
}

.du-crawl-headline-meta {
  grid-column: 2;
  font-size: 0.75rem;
  color: #64748b;
}

.du-source-pull-status {
  flex: 1 1 100%;
  min-width: 12rem;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .du-source-pull-status {
    flex: 1 1 auto;
    text-align: right;
  }
}
