:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #10b981;
  --primary-bg: #ecfdf5;
  --secondary: #0284c7;
  --accent: #f59e0b;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --text: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography Stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* State Colors */
  --color-mh: #d97706; /* Maharashtra Amber */
  --color-br: #059669; /* Bihar Emerald */
  --color-kl: #0891b2; /* Kerala Cyan */
  --color-tn: #4f46e5; /* Tamil Nadu Indigo */
}

[data-theme="dark"] {
  --dark: #f8fafc;
  --dark-light: #e2e8f0;
  --text: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --bg: #0b1120;
  --card-bg: #1e293b;
  --primary-bg: #064e3b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1010;
  padding: 0.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 45%;
  flex-shrink: 1;
  overflow: hidden;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
  flex-shrink: 0;
}

.brand-info {
  min-width: 0;
  overflow: hidden;
}

.brand-info h1 {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-info h1 span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-tag {
  font-size: 0.65rem;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: 1px solid rgba(5, 150, 105, 0.2);
  flex-shrink: 0;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.state-pills-group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.12rem 0.25rem;
  height: 32px;
  box-sizing: border-box;
}

.state-pill-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--text-muted);
  line-height: 1.2;
}

.state-pill-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.state-pill-btn.active {
  color: white;
}

.state-pill-btn[data-state="All"].active { background: #334155; }
.state-pill-btn[data-state="Maharashtra"].active { background: var(--color-mh); }
.state-pill-btn[data-state="Bihar"].active { background: var(--color-br); }
.state-pill-btn[data-state="Kerala"].active { background: var(--color-kl); }
.state-pill-btn[data-state="Tamil Nadu"].active { background: var(--color-tn); }

.header-utility-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  height: 32px;
  box-sizing: border-box;
}

.btn:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  height: 28px;
}

.btn-icon {
  padding: 0.35rem 0.55rem;
  min-width: 32px;
  justify-content: center;
}

/* ==================== VIEW NAVIGATION TABS ==================== */
.view-nav-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 65px;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.view-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.view-nav-inner::-webkit-scrollbar {
  display: none;
}

.view-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.65rem;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.view-nav-btn:hover {
  color: var(--primary);
  background: rgba(5, 150, 105, 0.04);
}

.view-nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.view-nav-btn .nav-count {
  font-size: 0.68rem;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
}

.view-nav-btn.active .nav-count {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: rgba(5, 150, 105, 0.3);
}

@media (max-width: 1180px) {
  .view-nav-btn {
    padding: 0.75rem 0.45rem;
    font-size: 0.76rem;
    gap: 0.25rem;
  }
  .view-nav-inner {
    padding: 0 0.5rem;
    gap: 0.1rem;
  }
}


/* ==================== PORTFOLIO EXECUTIVE HERO BANNER ==================== */
.portfolio-hero-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 45%, #0f766e 100%);
  border-radius: var(--radius-lg);
  color: white;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.portfolio-hero-banner::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 780px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0.35rem;
  color: #ffffff;
}

.hero-tagline {
  font-size: 0.85rem;
  color: #d1fae5;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.hero-btn-main {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #78350f !important;
  font-weight: 700 !important;
  padding: 0.55rem 1.15rem !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.hero-btn-main:hover {
  background: #d97706 !important;
  color: white !important;
  transform: translateY(-1px);
}

.hero-btn-sub {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  backdrop-filter: blur(4px);
}

.hero-btn-sub:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.hero-stats-strip {
  display: flex;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 65px;
}

.hero-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

@media (max-width: 860px) {
  .portfolio-hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats-strip {
    width: 100%;
    justify-content: space-around;
  }
}

/* ==================== VIEW TAB SWITCHING ==================== */
.view-tab {
  display: none;
}

.view-tab.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== FULLSCREEN ZERO-SCROLL GIS MAP WORKSPACE ==================== */
html.map-view-active,
body.map-view-active,
html:has(body.map-view-active),
html:has(#viewMap.active),
body:has(#viewMap.active) {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

body.map-view-active,
body:has(#viewMap.active) {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.map-view-active .header,
body:has(#viewMap.active) .header {
  padding: 0.35rem 1rem !important;
  flex-shrink: 0 !important;
}

body.map-view-active .header .brand-subtitle,
body:has(#viewMap.active) .header .brand-subtitle {
  display: none !important;
}

body.map-view-active .header-inner,
body:has(#viewMap.active) .header-inner {
  gap: 0.5rem !important;
  flex-wrap: nowrap !important;
}

body.map-view-active .view-nav-bar,
body:has(#viewMap.active) .view-nav-bar {
  flex-shrink: 0 !important;
  position: static !important;
}

body.map-view-active .view-nav-btn,
body:has(#viewMap.active) .view-nav-btn {
  padding: 0.45rem 0.55rem !important;
  font-size: 0.78rem !important;
}

body.map-view-active .main-content,
body:has(#viewMap.active) .main-content {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0.25rem 0.65rem 0.4rem !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.map-view-active #viewMap,
body:has(#viewMap.active) #viewMap {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.map-view-active .map-workspace-card,
body:has(#viewMap.active) .map-workspace-card {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
}

body.map-view-active .map-toolbar,
body:has(#viewMap.active) .map-toolbar {
  padding: 0.35rem 0.75rem !important;
  flex-shrink: 0 !important;
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border) !important;
  z-index: 10 !important;
}

body.map-view-active .full-map-container,
body:has(#viewMap.active) .full-map-container {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  position: relative !important;
  width: 100% !important;
}

body.map-view-active .full-map-container #map,
body:has(#viewMap.active) .full-map-container #map {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.map-view-active .footer,
body:has(#viewMap.active) .footer {
  display: none !important;
}

.map-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.map-toolbar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.map-quick-filters {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.map-chip {
  padding: 0.28rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.map-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.map-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.map-chip .nav-count {
  font-size: 0.65rem;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  margin-left: 2px;
}

.map-chip.active .nav-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.full-map-container {
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  position: relative;
  width: 100%;
}

.full-map-container #map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8fafc;
}

/* ==================== CHARTS OVERVIEW GRID ==================== */
.charts-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .charts-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Main Container */
.main-content {
  max-width: 1440px;
  margin: 1.25rem auto;
  padding: 0 1.25rem 3rem;
}

/* KPI Banner */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 980px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.kpi-all::before { background: #334155; }
.kpi-card.kpi-fgd::before { background: #059669; }
.kpi-card.kpi-convening::before { background: #d97706; }
.kpi-card.kpi-visit::before { background: #0891b2; }
.kpi-card.kpi-photos::before { background: #ec4899; }
.kpi-card.kpi-videos::before { background: #dc2626; }
.kpi-card.kpi-report::before { background: #4f46e5; }
.kpi-card.kpi-stakeholders::before { background: #7c3aed; }
.kpi-card.kpi-locations::before { background: #e11d48; }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.kpi-info {
  flex: 1;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Map & Analytics Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(248, 250, 252, 0.6);
}

[data-theme="dark"] .card-header {
  background: rgba(15, 23, 42, 0.4);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-card-body {
  position: relative;
  height: 540px;
  min-height: 500px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  background: #e2e8f0;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.leaflet-container {
  font-family: inherit !important;
  background-color: #f1f5f9 !important;
}

.leaflet-tile {
  visibility: inherit !important;
}

/* Map Controls Overlay */
.map-overlay-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .map-overlay-controls {
  background: rgba(30, 41, 59, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}

.map-control-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  transition: all 0.15s ease;
}

.map-control-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 0.65rem;
  align-items: center;
  pointer-events: none;
}

[data-theme="dark"] .map-legend {
  background: rgba(30, 41, 59, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Charts Panel */
.analytics-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 520px;
  overflow-y: auto;
}

.chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

.chart-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

/* ==================== PARTNER & INSTITUTIONAL ALLIANCES ==================== */
.partner-alliance-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.15rem;
}

/* Executive Partner Ribbon on Dashboard */
.executive-partner-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.ribbon-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #f1f5f9;
}

.ribbon-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ribbon-label i {
  color: var(--primary);
  font-size: 0.88rem;
}

.ribbon-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ribbon-logos-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.6rem;
  width: 100%;
}

.ribbon-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.3rem 0.35rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.ribbon-logo-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  background: #f8fafc;
}

.ribbon-logo-img-wrap {
  height: 38px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ribbon-logo-item img {
  max-height: 36px;
  max-width: 88%;
  object-fit: contain;
  filter: contrast(1.05);
}

.ribbon-logo-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
}

.ribbon-logo-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
}

.ribbon-logo-state {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  background: #f1f5f9;
  letter-spacing: 0.02em;
}

@media (max-width: 1100px) {
  .ribbon-logos-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  .ribbon-logos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Institutional Partners Dedicated View */
.partner-view-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.partner-filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.partner-filter-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.15s ease;
}

.partner-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.partner-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Partner Logo Showcase Bar in Alliance Section */
.partner-logo-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.partner-logo-showcase-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.partner-logo-showcase-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.partner-logo-showcase-item img {
  height: 38px;
  max-width: 90px;
  object-fit: contain;
}

.partner-logo-showcase-item span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.partner-badge-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  border-left: 4px solid var(--pc, var(--primary));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s ease;
  position: relative;
}

.partner-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--card-bg);
  border-color: var(--pc, var(--primary));
}

.partner-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.partner-logo-wrapper {
  width: 96px;
  height: 52px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.partner-card-logo {
  max-height: 44px;
  max-width: 86px;
  object-fit: contain;
}

.partner-state-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.partner-acronym {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.3;
}

.partner-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.48;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.spotlight-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spotlight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.spotlight-card.spot-mh { border-top-color: var(--color-mh); }
.spotlight-card.spot-br { border-top-color: var(--color-br); }
.spotlight-card.spot-kl { border-top-color: var(--color-kl); }
.spotlight-card.spot-tn { border-top-color: var(--color-tn); }

.spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.spotlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
}

.spotlight-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.spotlight-desc {
  font-size: 0.825rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.spotlight-features {
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.spotlight-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.spotlight-features li i {
  color: var(--primary);
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.spotlight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

/* ==================== PHOTO GALLERY SECTION ==================== */
.photo-gallery-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.gallery-filter-bar {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.photo-grid {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-height: 560px;
  overflow-y: auto;
}

.photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 4 / 3;
}

.photo-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.1) 80%, transparent);
  padding: 0.6rem 0.75rem 0.5rem;
  color: white;
  transition: opacity 0.2s ease;
}

.photo-title {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-venue {
  font-size: 0.68rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.photo-state-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ==================== LIGHTBOX MODAL ==================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img-wrapper {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

.lightbox-controls {
  position: absolute;
  top: 20px;
  right: 25px;
  display: flex;
  gap: 0.75rem;
  z-index: 3100;
}

.lightbox-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.lightbox-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.18);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: rgba(255,255,255,0.4);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-caption {
  color: white;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: center;
  max-width: 700px;
  padding: 0 1rem;
  line-height: 1.4;
}

.lightbox-subcaption {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ==================== MAP POPUP PHOTO PREVIEWS ==================== */
.popup-photos-strip {
  display: flex;
  gap: 4px;
  margin-bottom: 0.6rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.popup-thumb {
  width: 52px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.popup-thumb:hover {
  transform: scale(1.08);
  border-color: var(--primary);
}

/* ==================== EXPLORER TABLE ==================== */
.explorer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}

.filter-bar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrapper i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-filter {
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.data-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
  background: var(--primary-bg);
  cursor: pointer;
}

/* Executive Multi-State Scorecard Table — Fit Within Window */
.scorecard-table-container {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

@media (min-width: 1080px) {
  .scorecard-table-container {
    overflow-x: hidden; /* Zero horizontal scrollbar on standard desktop screens */
  }
}

.scorecard-table {
  width: 100%;
  font-size: 0.77rem;
  border-collapse: collapse;
}

.scorecard-table th {
  padding: 0.55rem 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  white-space: nowrap;
  background: #f8fafc;
}

.scorecard-table td {
  padding: 0.55rem 0.45rem;
  vertical-align: middle;
  line-height: 1.35;
}

.scorecard-table .cell-state {
  white-space: nowrap;
  width: 95px;
}

.scorecard-table .cell-num {
  text-align: center;
  font-weight: 700;
  width: 44px;
}

.scorecard-table .cell-media {
  text-align: center;
  width: 115px;
  white-space: nowrap;
}

.scorecard-table .cell-stk {
  text-align: center;
  width: 72px;
  white-space: nowrap;
  font-weight: 600;
}

.scorecard-table .cell-alliances {
  font-size: 0.73rem;
  color: #334155;
  line-height: 1.35;
}

.scorecard-table .cell-focus {
  font-size: 0.73rem;
  color: #475569;
  line-height: 1.35;
}

.scorecard-table .cell-actions {
  text-align: right;
  white-space: nowrap;
  width: 82px;
}

.scorecard-table .badge {
  padding: 0.15rem 0.4rem;
  font-size: 0.67rem;
}

.scorecard-table .btn-sm {
  padding: 0.2rem 0.38rem;
  font-size: 0.72rem;
  margin-left: 2px;
}

.badge-video-chip {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  margin-left: 2px;
}

.badge-photo-green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-state-mh { background: #fef3c7; color: #b45309; }
.badge-state-br { background: #d1fae5; color: #047857; }
.badge-state-kl { background: #cffafe; color: #0e7490; }
.badge-state-tn { background: #e0e7ff; color: #4338ca; }

.badge-cat {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.badge-status-completed { background: #dcfce7; color: #15803d; }
.badge-status-inprogress { background: #fef9c3; color: #a16207; }
.badge-status-scheduled { background: #e0f2fe; color: #0369a1; }
.badge-photo { background: #fce7f3; color: #be185d; }

.link-icons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.icon-btn.has-doc { color: #2563eb; }
.icon-btn.has-doc:hover { background: #2563eb; color: white; }
.icon-btn.has-video { color: #dc2626; }
.icon-btn.has-video:hover { background: #dc2626; color: white; }
.icon-btn.has-image { color: #ec4899; }
.icon-btn.has-image:hover { background: #ec4899; color: white; }
.icon-btn.has-map { color: #d97706; }
.icon-btn.has-map:hover { background: #d97706; color: white; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--dark);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.modal-value {
  font-size: 0.9rem;
  color: var(--dark);
}

.modal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal-link-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  font-size: 0.825rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.modal-link-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.custom-popup {
  padding: 0.9rem 1.1rem;
  min-width: 260px;
  max-width: 330px;
}

.custom-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.custom-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.custom-popup-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.custom-popup-desc {
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 0.7rem;
  line-height: 1.35;
}

.custom-popup-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.popup-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.popup-btn:hover {
  background: #059669;
  color: white;
  border-color: #059669;
}

/* Custom Marker Pins */
.custom-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -20px 0 0 -20px;
  box-shadow: -1px 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.custom-pin i {
  transform: rotate(45deg);
  color: white;
  font-size: 0.85rem;
}

/* ==================== STAKEHOLDER MATRIX SECTION ==================== */
.stakeholder-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.stakeholder-filter-bar {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stakeholder-grid {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  max-height: 720px;
  overflow-y: auto;
}

.stakeholder-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 4px solid #64748b;
}

.stakeholder-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stakeholder-card.state-Maharashtra { border-left-color: var(--color-mh); }
.stakeholder-card.state-Bihar { border-left-color: var(--color-br); }
.stakeholder-card.state-Kerala { border-left-color: var(--color-kl); }
.stakeholder-card.state-Tamil-Nadu { border-left-color: var(--color-tn); }

.stk-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.stk-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

.stk-designation {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.stk-occ-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  margin: 0.4rem 0 0.6rem;
  border: 1px solid #e2e8f0;
}

.stk-org-loc {
  font-size: 0.75rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stk-org-loc span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stk-desc {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.stk-insight {
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  padding: 0.6rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.76rem;
  color: #334155;
  font-style: italic;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.stk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
}

/* Video Gallery & Embeddable Player */
.video-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.video-quick-embedder {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

[data-theme="dark"] .video-quick-embedder {
  background: #1e293b;
  border-color: #334155;
}

.video-embed-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.video-embed-input-row input {
  flex-grow: 1;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  outline: none;
}

.video-embed-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.video-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.video-poster-box {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.video-poster-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.25;
  background-size: cover;
  background-position: center;
  filter: blur(2px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.video-card:hover .video-poster-bg {
  transform: scale(1.05);
  opacity: 0.4;
}

.video-play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-play-icon i {
  margin-left: 3px;
}

.video-card:hover .video-play-icon {
  transform: scale(1.12);
  background: #ef4444;
}

.video-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  z-index: 2;
}

.video-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.video-activity-name {
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.video-district {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.video-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

/* Video Modal */
.video-modal-dialog {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}

.video-embed-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
}

.video-embed-wrapper iframe,
.video-embed-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==================== FIELD STORIES & STORYMAP TRAIL ==================== */
.story-trail-card {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(940px, calc(100% - 2.5rem));
  max-width: 940px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(203, 213, 225, 0.95);
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.22), 0 4px 14px rgba(15, 23, 42, 0.08);
  padding: 0.65rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: none !important;
  overflow: visible !important;
  transition: all 0.25s ease;
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .story-trail-card {
  background: rgba(30, 41, 59, 0.97);
  border-color: rgba(51, 65, 85, 0.95);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.3);
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.story-trail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.story-trail-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.story-trail-body {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  min-height: 54px;
}

.story-trail-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 2px solid white;
}

.story-trail-content {
  flex-grow: 1;
  min-width: 0;
}

.story-trail-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.story-trail-protagonist {
  font-size: 0.78rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.story-trail-quote {
  font-family: var(--font-serif);
  font-size: 0.86rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-trail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.story-trail-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.trail-state-pills {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: nowrap;
}

.trail-pill-btn {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.trail-pill-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.trail-pill-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
  font-weight: 700;
}

.trail-pill-btn[data-state="All"].active {
  background: #059669;
  border-color: #059669;
}

.trail-pill-btn[data-state="Maharashtra"].active {
  background: var(--color-mh);
  border-color: var(--color-mh);
}

.trail-pill-btn[data-state="Bihar"].active {
  background: var(--color-br);
  border-color: var(--color-br);
}

.trail-pill-btn[data-state="Kerala"].active {
  background: var(--color-kl);
  border-color: var(--color-kl);
}

.trail-pill-btn[data-state="Tamil Nadu"].active {
  background: var(--color-tn);
  border-color: var(--color-tn);
}

/* Pulsing Leaflet Story Beacon Marker with Number and State Coloring */
.story-beacon-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--beacon-color, #f59e0b);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-beacon 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
  transition: all 0.25s ease;
  cursor: pointer;
}

.story-beacon-marker.active-beacon {
  width: 36px;
  height: 36px;
  background: #dc2626 !important;
  border: 3px solid #ffffff;
  font-size: 13px;
  font-weight: 800;
  z-index: 1000 !important;
  box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.4);
  animation: pulse-active-beacon 1.5s infinite;
}

.beacon-num {
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Pan-India Birds Eye View Drawer Graphic & Badges */
.trail-birds-eye-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 68px;
  flex-shrink: 0;
}

.birds-eye-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669, #0d9488);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.birds-eye-count-pill {
  font-size: 0.65rem;
  font-weight: 800;
  color: #047857;
  background: #d1fae5;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@keyframes pulse-beacon {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.12); box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulse-active-beacon {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1.18); box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ==================== FIELD STORIES MASTER-DETAIL WORKSPACE ==================== */
.stories-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem 1.25rem 1.25rem;
}

.stories-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stories-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.stories-workspace {
  display: flex;
  gap: 1.25rem;
  height: calc(100vh - 215px);
  min-height: 560px;
  margin-top: 0.75rem;
}

/* Master Pane: Compact Story Sidebar */
.stories-master-pane {
  width: 380px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.4rem;
  scrollbar-width: thin;
}

.stories-master-pane::-webkit-scrollbar {
  width: 5px;
}
.stories-master-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.story-master-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.story-master-item:hover {
  border-color: var(--primary);
  background: rgba(5, 150, 105, 0.03);
  transform: translateX(2px);
}

.story-master-item.active {
  border-color: var(--primary);
  border-left: 4px solid var(--primary);
  background: #f0fdf4;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.12);
}

[data-theme="dark"] .story-master-item.active {
  background: rgba(6, 78, 59, 0.3);
  border-color: var(--primary);
  border-left-color: #10b981;
}

.story-master-thumb-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f172a;
}

.story-master-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-master-state-pill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  text-align: center;
  padding: 1px 2px;
  line-height: 1.1;
  text-transform: uppercase;
}

.story-master-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-master-theme {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-master-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-master-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Detail Pane: Focused Story Reader */
.stories-detail-pane {
  flex: 1;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  scrollbar-width: thin;
}

.stories-detail-pane::-webkit-scrollbar {
  width: 6px;
}
.stories-detail-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.story-detail-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 880px;
  margin: 0 auto;
}

.story-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.story-detail-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.story-theme-badge {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.story-detail-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.story-detail-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 0.35rem;
}

.story-detail-heading {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.28;
  margin: 0;
}

.story-detail-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: -0.5rem;
}

.story-detail-quote {
  font-family: var(--font-serif);
  font-style: italic;
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #1e293b;
  margin: 0;
  position: relative;
}

[data-theme="dark"] .story-detail-quote {
  background: #1e293b;
  color: #f1f5f9;
}

.story-detail-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 0.4rem;
}

.story-detail-banner {
  position: relative;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
}

.story-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-detail-banner-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85), transparent);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

/* 4-Pillar Structured Grid */
.story-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.story-detail-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .story-detail-card {
  background: #1e293b;
}

.story-card-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.story-detail-card p {
  font-size: 0.835rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.story-detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.5rem;
}

.story-detail-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .stories-workspace {
    flex-direction: column;
    height: auto;
  }
  .stories-master-pane {
    width: 100%;
    max-height: 300px;
  }
  .story-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Detailed Long-form Story Modal */
.story-modal-dialog {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.25s ease-out;
}

.story-modal-hero {
  position: relative;
  height: 260px;
  background: #0f172a;
}

.story-modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-modal-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent);
  color: white;
}

.story-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.story-section-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

[data-theme="dark"] .story-section-box {
  background: #1e293b;
  border-color: #334155;
}

.story-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.story-section-text {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.825rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ==================== MULTI-LINGUAL SELECTOR STYLING ==================== */
.lang-selector-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.12rem 0.5rem;
  height: 32px;
  box-sizing: border-box;
}

.lang-icon {
  color: var(--primary);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.header-lang-select {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0 0.15rem;
  font-family: inherit;
}

.header-lang-select option {
  background: var(--card-bg);
  color: var(--text);
}

/* Prevent Google Translate Banner from displacing 100vh Layout */
body {
  top: 0px !important;
  position: static !important;
}

body > .skiptranslate {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
iframe.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
}

.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
}

.goog-text-highlight {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#google_translate_element,
.goog-te-gadget,
.goog-te-gadget-simple,
.skiptranslate.goog-te-gadget {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==================== CO-LED IMPLEMENTING PARTNERS SHOWCASE ==================== */
.co-lead-partners-section {
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.85) 0%, rgba(240, 249, 255, 0.85) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .co-lead-partners-section {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

.co-lead-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.co-lead-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.co-lead-section-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .co-lead-section-tag {
  background: rgba(22, 163, 74, 0.25);
  color: #86efac;
}

.co-lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.co-lead-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
}

.co-lead-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.co-lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.co-lead-logo-wrap {
  height: 48px;
  max-width: 180px;
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.co-lead-logo-wrap img {
  max-height: 40px;
  max-width: 160px;
  object-fit: contain;
}

.co-lead-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.co-lead-pill-asar {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.co-lead-pill-cag {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.co-lead-org-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.co-lead-role-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.co-lead-brief-text {
  font-size: 0.825rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 1rem;
}

.co-lead-meta-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.co-lead-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-muted);
}

.co-lead-meta-row i {
  color: var(--primary);
  width: 14px;
  margin-top: 3px;
  flex-shrink: 0;
}

.co-lead-meta-row strong {
  color: var(--dark);
}

.co-lead-btn-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: auto;
}

.co-lead-website-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

/* ==================== ACRA SYSTEMIC FRAMEWORK & CRA PILLARS ==================== */
.cra-framework-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.cra-framework-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cra-framework-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.food-chain-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.4rem 0;
  margin-bottom: 1rem;
}

.food-chain-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

[data-theme="dark"] .food-chain-step {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.food-chain-step i {
  color: var(--primary);
}

.food-chain-arrow {
  color: #94a3b8;
  font-size: 0.68rem;
}

.cra-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.cra-pillar-pill {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.cra-pillar-pill:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.cra-pillar-icon {
  font-size: 1rem;
  color: var(--primary);
  margin-top: 1px;
}

.cra-pillar-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
}

.cra-pillar-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* ==================== PRINT / DONOR BRIEF MEDIA STYLES ==================== */
@media print {
  body {
    background: white !important;
    color: #0f172a !important;
    font-size: 10pt;
  }

  .header-actions,
  .view-nav-bar,
  .map-toolbar,
  .map-overlay-controls,
  .story-trail-card,
  .footer,
  #themeToggle,
  #exportBtn,
  #printBriefBtn,
  .btn,
  #viewMap,
  #viewPhotos,
  #viewVideos,
  #viewStories,
  #viewStakeholders,
  #viewActivities,
  .charts-overview-grid {
    display: none !important;
  }

  /* Exclusively display executive summary and spotlight cards */
  #viewDashboard {
    display: block !important;
  }

  .portfolio-hero-banner {
    background: #064e3b !important;
    color: white !important;
    box-shadow: none !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hero-actions {
    display: none !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .kpi-card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 0.5rem !important;
  }

  .spotlight-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .spotlight-card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    break-inside: avoid;
    padding: 0.75rem !important;
  }

  .spotlight-footer {
    display: none !important;
  }
}

/* ==========================================================================
   DOCUMENTARY CINEMA & THEATER STYLING (THE LIVING FURROW)
   ========================================================================== */

/* Cinema Lighting Mode (Dim Lights) */
body.cinema-lights-dimmed {
  background-color: #050811 !important;
}

body.cinema-lights-dimmed .header,
body.cinema-lights-dimmed .view-nav-bar,
body.cinema-lights-dimmed .footer {
  opacity: 0.12 !important;
  pointer-events: none !important;
  filter: grayscale(90%) blur(1px) !important;
  transition: all 0.5s ease !important;
}

body.cinema-lights-dimmed #viewDocumentary {
  position: relative;
  z-index: 50;
}

body.cinema-lights-dimmed .doc-cinema-marquee {
  border-color: rgba(225, 29, 72, 0.4) !important;
  box-shadow: 0 0 50px rgba(225, 29, 72, 0.25) !important;
}

/* Feature Showcase Marquee */
.doc-cinema-marquee {
  position: relative;
  background: radial-gradient(circle at 10% 20%, rgba(225, 29, 72, 0.18), transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(5, 150, 105, 0.12), transparent 50%),
              linear-gradient(135deg, #090d16 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.2rem;
  color: #f8fafc;
  margin-bottom: 2rem;
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.doc-festival-laurels {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.doc-laurel-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  backdrop-filter: blur(4px);
}

.doc-marquee-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0.4rem 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.doc-marquee-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 1.1rem;
  letter-spacing: -0.01em;
}

.doc-marquee-synopsis {
  max-width: 900px;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin-bottom: 1.6rem;
}

.doc-marquee-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.8rem;
}

.doc-btn-play {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 0.65rem 1.4rem !important;
  border-radius: var(--radius-md) !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.45) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.doc-btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.6) !important;
}

.doc-btn-cinema {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.1rem !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.doc-btn-cinema.active {
  background: #f59e0b !important;
  color: #0f172a !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5) !important;
}

.doc-btn-ambient {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(5, 150, 105, 0.4) !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.1rem !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-btn-ambient.playing {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 0 16px rgba(5, 150, 105, 0.5) !important;
}

.doc-btn-script {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.1rem !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-btn-archive {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #7dd3fc !important;
  border: 1px solid rgba(2, 132, 199, 0.35) !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.1rem !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-specs-ribbon {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.2rem;
}

.doc-spec-pill {
  font-size: 0.8rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-spec-pill strong {
  color: #e2e8f0;
}

/* Section Headers */
.doc-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.doc-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.doc-act-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--bg);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* Acts Timeline Strip */
.doc-acts-navigator {
  margin-bottom: 2rem;
}

.doc-acts-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.75rem 0.25rem;
}

.doc-act-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  user-select: none;
}

.doc-act-card:hover {
  transform: translateY(-3px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.doc-act-card.active {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.04);
  box-shadow: 0 0 0 1px #e11d48, 0 8px 22px rgba(225, 29, 72, 0.18);
}

.doc-act-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-act-num-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e11d48;
}

.doc-act-state-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg);
}

.doc-act-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-top: 0.15rem;
}

.doc-act-timecode {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

/* Theater Main Stage (Dual Column) */
.doc-theater-stage {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  align-items: start;
}

.doc-screen-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.doc-screen-card {
  background: #090d16;
  color: #f8fafc;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.doc-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.2rem;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-screen-title-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.doc-screen-act-badge {
  background: #e11d48;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.doc-screen-state-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.doc-screen-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.doc-screen-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-screen-timecode {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.doc-screen-res-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

/* Video Viewport */
.doc-video-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

.doc-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

.doc-video-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  background: #000000;
}

.doc-video-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.4s ease, opacity 0.3s;
}

.doc-video-fallback:hover img {
  transform: scale(1.02);
  opacity: 0.95;
}

.doc-video-fallback-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.75) 100%);
  gap: 0.75rem;
}

.doc-video-play-trigger {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: white;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(225, 29, 72, 0.65);
  transition: transform 0.2s, box-shadow 0.2s;
  padding-left: 4px;
}

.doc-video-play-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px rgba(225, 29, 72, 0.85);
}

.doc-fallback-caption {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Clips Toolbar */
.doc-clips-toolbar {
  padding: 0.75rem 1.2rem;
  background: #0b1120;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.doc-clips-label {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}

.doc-clips-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.doc-clip-pill {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.doc-clip-pill:hover {
  background: #334155;
  color: #ffffff;
}

.doc-clip-pill.active {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

/* Ground Evidence B-Roll Card */
.doc-broll-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.doc-broll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.doc-broll-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.doc-broll-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 600;
}

.doc-broll-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.doc-broll-thumb-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}

.doc-broll-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.doc-broll-thumb-box:hover img {
  transform: scale(1.08);
}

.doc-broll-zoom-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}

/* Teleplay & Protagonist Column */
.doc-teleplay-column {
  display: flex;
  flex-direction: column;
}

.doc-teleplay-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.doc-teleplay-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: var(--bg);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.doc-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.doc-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.doc-meta-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-voiceover-box {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.06), rgba(5, 150, 105, 0.06));
  border-left: 4px solid var(--secondary);
  padding: 1.1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.doc-voiceover-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.doc-voiceover-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--dark);
}

/* Protagonist Spotlight */
.doc-protagonist-spotlight {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.doc-protagonist-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-protagonist-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.doc-protagonist-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-protagonist-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.doc-quote-bubble {
  margin-top: 0.75rem;
  background: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  position: relative;
}

.doc-quote-mark {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.doc-quote-en {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.doc-quote-local {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.doc-protagonist-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

/* Pillar Badge Box */
.doc-pillar-badge-box {
  background: var(--primary-bg);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
}

.doc-pillar-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.doc-pillar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.doc-pillar-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
}

/* Wall of Voices Grid */
.doc-voices-wall {
  margin-bottom: 2.5rem;
}

.doc-voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.doc-voice-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.doc-voice-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.doc-voice-card-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.doc-voice-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.doc-voice-info h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-voice-info div {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.doc-voice-quote {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
  margin-top: auto;
}

.doc-voice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
}

/* 8-Pillars Resilience Grid */
.doc-pillars-summary {
  margin-bottom: 2.5rem;
}

.doc-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.doc-pillar-item-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 4px solid var(--primary);
}

.doc-pillar-item-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
}

.doc-pillar-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-pillar-item-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Master Teleplay Script Modal */
.doc-script-modal-dialog {
  max-width: 950px;
  width: 94%;
  max-height: 90vh;
  background: #090d16;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.7);
  border: 1px solid #1e293b;
}

.doc-script-body {
  padding: 2.2rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: #cbd5e1;
  background: #090d16;
}

.doc-script-body h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-align: center;
}

.doc-script-body h2 {
  font-size: 1.15rem;
  color: #f59e0b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.4rem;
  text-transform: uppercase;
}

.doc-script-body h3 {
  font-size: 0.95rem;
  color: #38bdf8;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
}

.doc-script-body p {
  margin-bottom: 1rem;
}

.doc-script-body strong {
  color: #ffffff;
}

.doc-script-body blockquote {
  border-left: 3px solid #e11d48;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #f1f5f9;
  font-style: italic;
}

@media (max-width: 992px) {
  .doc-theater-stage {
    grid-template-columns: 1fr;
  }
  .doc-acts-strip {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .doc-cinema-marquee {
    padding: 1.5rem 1.2rem;
  }
  .doc-acts-strip {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .doc-teleplay-meta-grid {
    grid-template-columns: 1fr;
  }
}



