/* BioR-Pathogen Shared CSS v5.0 — Premium Scientific Platform */

/* ===== NAVIGATION ===== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: var(--bior-glass-bg);
  backdrop-filter: blur(var(--bior-glass-blur));
  -webkit-backdrop-filter: blur(var(--bior-glass-blur));
  border-bottom: 1px solid var(--bior-border-subtle);
  transition: all var(--bior-duration-normal) var(--bior-ease);
}
.nav-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bior-primary), var(--bior-primary-dark));
  color: #fff; font-size: 14px;
  box-shadow: 0 2px 8px rgba(var(--bior-primary-rgb), 0.25);
}
.nav-brand-text { font-size: 16px; font-weight: 700; color: var(--bior-text-primary); letter-spacing: -0.02em; }
.nav-brand-accent { color: var(--bior-primary); }
.nav-links-desktop { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: var(--bior-radius-md);
  font-size: 13px; font-weight: 500; color: var(--bior-text-muted);
  text-decoration: none; transition: all var(--bior-duration-normal) var(--bior-ease);
  position: relative;
}
.nav-link:hover { color: var(--bior-text-primary); background: var(--bior-bg-elevated); }
.nav-link.active-page { color: var(--bior-primary); background: rgba(var(--bior-primary-rgb), 0.08); font-weight: 600; }
.nav-more { position: relative; }
.nav-more-btn {
  padding: 8px 14px; border-radius: var(--bior-radius-md);
  font-size: 13px; font-weight: 500; color: var(--bior-text-muted);
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--bior-duration-normal) var(--bior-ease);
}
.nav-more-btn:hover { color: var(--bior-text-primary); background: var(--bior-bg-elevated); }
.nav-more-btn i { font-size: 10px; transition: transform var(--bior-duration-normal) var(--bior-ease); }
.nav-more.open .nav-more-btn i { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: var(--bior-radius-lg); padding: 8px;
  box-shadow: var(--bior-shadow-lg); min-width: 220px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--bior-duration-normal) var(--bior-ease);
}
.nav-more.open .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--bior-radius-md);
  font-size: 13px; color: var(--bior-text-secondary); text-decoration: none;
  transition: all var(--bior-duration-fast) var(--bior-ease);
}
.nav-dropdown-item i { width: 16px; text-align: center; color: var(--bior-text-faint); font-size: 12px; }
.nav-dropdown-item:hover { background: var(--bior-bg-elevated); color: var(--bior-text-primary); }
.nav-dropdown-item:hover i { color: var(--bior-primary); }
.nav-dropdown-item.active { color: var(--bior-primary); background: rgba(var(--bior-primary-rgb), 0.06); font-weight: 600; }
.nav-dropdown-item.active i { color: var(--bior-primary); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-theme-btn, .nav-github-btn {
  width: 36px; height: 36px; border-radius: var(--bior-radius-md);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bior-border-default); background: var(--bior-bg-card);
  color: var(--bior-text-muted); cursor: pointer; font-size: 14px;
  transition: all var(--bior-duration-normal) var(--bior-ease); text-decoration: none;
}
.nav-theme-btn:hover, .nav-github-btn:hover {
  border-color: var(--bior-primary); color: var(--bior-primary);
  background: rgba(var(--bior-primary-rgb), 0.05);
}
.nav-mobile-toggle {
  display: none; width: 36px; height: 36px; border-radius: var(--bior-radius-md);
  align-items: center; justify-content: center;
  border: 1px solid var(--bior-border-default); background: var(--bior-bg-card);
  color: var(--bior-text-muted); cursor: pointer; font-size: 16px;
}
@media (max-width: 1024px) {
  .nav-links-desktop { display: none; }
  .nav-mobile-toggle { display: flex; }
}

/* Mobile Menu */
.mobile-menu {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 29;
  background: var(--bior-bg-card); border-bottom: 1px solid var(--bior-border-default);
  box-shadow: var(--bior-shadow-lg);
  max-height: 0; overflow: hidden; transition: max-height 0.4s var(--bior-ease);
}
.mobile-menu.open { max-height: calc(100vh - 64px); overflow-y: auto; }
.mobile-menu-inner { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--bior-radius-md);
  font-size: 14px; color: var(--bior-text-secondary); text-decoration: none;
  transition: all var(--bior-duration-fast) var(--bior-ease);
}
.mobile-nav-link i { width: 20px; text-align: center; color: var(--bior-text-faint); font-size: 13px; }
.mobile-nav-link:hover { background: var(--bior-bg-elevated); color: var(--bior-text-primary); }
.mobile-nav-link.active { background: rgba(var(--bior-primary-rgb), 0.08); color: var(--bior-primary); font-weight: 600; }
.mobile-nav-link.active i { color: var(--bior-primary); }

/* ===== PAGE MAIN ===== */
.page-main { padding-top: 64px; min-height: 100vh; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bior-bg-section);
  border-top: 1px solid var(--bior-border-subtle);
  padding: 64px 0 32px;
}
.footer-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand { }
.footer-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-bottom: 16px; }
.footer-desc { font-size: 13px; line-height: 1.7; color: var(--bior-text-muted); max-width: 300px; }
.footer-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bior-text-primary); margin-bottom: 16px; }
.footer-links-group { display: flex; flex-direction: column; gap: 10px; }
.footer-link { font-size: 13px; color: var(--bior-text-muted); text-decoration: none; transition: color var(--bior-duration-fast) var(--bior-ease); display: flex; align-items: center; gap: 6px; }
.footer-link:hover { color: var(--bior-primary); }
.footer-link i { width: 14px; }
.footer-bottom { padding-top: 32px; border-top: 1px solid var(--bior-border-subtle); text-align: center; }
.footer-bottom p { font-size: 12px; color: var(--bior-text-faint); }

/* ===== TYPOGRAPHY & UTILITIES ===== */
.mono { font-family: var(--bior-font-mono); }
.gradient-text {
  background: linear-gradient(135deg, var(--bior-primary) 0%, #2563eb 50%, var(--bior-special) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.gradient-bg {
  background: var(--bior-bg-page);
  position: relative;
}
.gradient-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(var(--bior-primary-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.glass { background: var(--bior-glass-bg); backdrop-filter: blur(var(--bior-glass-blur)); border: 1px solid var(--bior-glass-border); }
.glow-hover { transition: all var(--bior-duration-normal) var(--bior-ease); }
.glow-hover:hover { box-shadow: var(--bior-shadow-glow); transform: translateY(-3px); }
.pulse-dot { animation: biorPulse 2s infinite; }
.counter { font-variant-numeric: tabular-nums; }

/* ===== PAGE HERO HEADERS ===== */
.page-hero {
  padding: 6rem 0 5rem; position: relative; overflow: hidden;
  background: var(--bior-bg-page);
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 20%, rgba(var(--bior-primary-rgb), 0.03) 0%, transparent 60%);
  z-index: 0;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero .hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--bior-radius-pill); padding: 6px 16px;
  margin-bottom: 1.5rem; font-size: 11px; font-weight: 600;
  font-family: var(--bior-font-mono); letter-spacing: 0.06em;
}
.page-hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.1; letter-spacing: -0.03em; }
.page-hero .hero-subtitle { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--bior-text-secondary); max-width: 640px; margin: 0 auto 1.5rem; line-height: 1.7; font-weight: 400; }
.page-hero .hero-desc { font-size: 14px; color: var(--bior-text-muted); max-width: 560px; margin: 0 auto; line-height: 1.8; }

/* Hero accent decorations */
.hero-decoration { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.04; pointer-events: none; }
.hero-decoration-1 { width: 400px; height: 400px; top: -100px; right: -100px; background: var(--bior-primary); }
.hero-decoration-2 { width: 300px; height: 300px; bottom: -80px; left: -80px; background: var(--bior-info); }
.hero-decoration-3 { width: 250px; height: 250px; top: 40%; left: 60%; background: var(--bior-special); }

/* ===== CONTENT SECTIONS ===== */
.content-section { padding: 5rem 0; }
.content-section .section-header { text-align: center; margin-bottom: 3rem; }
.content-section .section-badge { display: inline-block; font-size: 11px; font-family: var(--bior-font-mono); color: var(--bior-primary); letter-spacing: 0.08em; font-weight: 600; margin-bottom: 0.75rem; }
.content-section .section-title { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 800; color: var(--bior-text-primary); margin-bottom: 1rem; letter-spacing: -0.02em; }
.content-section .section-desc { color: var(--bior-text-muted); max-width: 560px; margin: 0 auto; line-height: 1.8; font-size: 14px; }
.section-dark { background: var(--bior-bg-section); }
.section-elevated { background: var(--bior-bg-section); }

/* ===== ENHANCED CARDS ===== */
.enhanced-card {
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: var(--bior-radius-xl); transition: all .35s var(--bior-ease);
  position: relative; overflow: hidden;
}
.enhanced-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--bior-primary), var(--bior-info)); opacity: 0; transition: opacity .35s; }
.enhanced-card:hover { box-shadow: var(--bior-shadow-lg); transform: translateY(-3px); border-color: var(--bior-border-primary); }
.enhanced-card:hover::before { opacity: 1; }

/* KPI Cards */
.kpi-card {
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: var(--bior-radius-lg); padding: 1.5rem; text-align: center;
  transition: all .3s var(--bior-ease); position: relative; overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--bior-shadow-md); }
.kpi-card .kpi-value { font-size: 1.75rem; font-weight: 800; font-family: var(--bior-font-mono); line-height: 1; letter-spacing: -0.02em; }
.kpi-card .kpi-label { font-size: 11px; color: var(--bior-text-muted); margin-top: 0.5rem; font-weight: 500; }

/* ===== TAB BUTTONS ===== */
.tab-btn {
  transition: all var(--bior-duration-normal) var(--bior-ease);
  padding: 10px 18px; border-radius: var(--bior-radius-md);
  font-size: 13px; font-weight: 500; color: var(--bior-text-muted);
  border: 1px solid transparent; cursor: pointer; background: none;
}
.tab-btn:hover { color: var(--bior-text-primary); background: var(--bior-bg-elevated); }
.tab-btn.active { background: rgba(var(--bior-primary-rgb), 0.08); color: var(--bior-primary); font-weight: 600; border-color: var(--bior-border-primary); }

/* ===== SCROLL ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--bior-ease), transform 0.6s var(--bior-ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.stagger-children > .stagger-child { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--bior-ease), transform .5s var(--bior-ease); }
.stagger-children.visible > .stagger-child { opacity: 1; transform: translateY(0); }
.stagger-children.visible > .stagger-child:nth-child(1) { transition-delay: .05s; }
.stagger-children.visible > .stagger-child:nth-child(2) { transition-delay: .1s; }
.stagger-children.visible > .stagger-child:nth-child(3) { transition-delay: .15s; }
.stagger-children.visible > .stagger-child:nth-child(4) { transition-delay: .2s; }
.stagger-children.visible > .stagger-child:nth-child(5) { transition-delay: .25s; }
.stagger-children.visible > .stagger-child:nth-child(6) { transition-delay: .3s; }
.stagger-children.visible > .stagger-child:nth-child(7) { transition-delay: .35s; }
.stagger-children.visible > .stagger-child:nth-child(8) { transition-delay: .4s; }

/* Page transition */
.page-content { animation: pageIn 0.4s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: var(--z-modal,50); display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-overlay.show { display: flex; }
@media print { nav,.modal-overlay,button,.nav-theme-btn { display: none !important; } body { background: white !important; } }

/* ===== ARCHITECTURE DIAGRAM ===== */
.arch-container { position: relative; }
.sample-journey { display: flex; align-items: center; gap: 0; margin-bottom: 24px; overflow-x: auto; padding: 8px 0; }
.journey-step { display: flex; align-items: center; gap: 0; }
.journey-node { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--bior-radius-pill); font-size: 11px; font-weight: 600; cursor: pointer; transition: all .3s; white-space: nowrap; border: 1.5px solid transparent; }
.journey-node:hover,.journey-node.active { transform: scale(1.05); box-shadow: var(--bior-shadow-md); }
.journey-arrow { width: 28px; display: flex; align-items: center; justify-content: center; position: relative; }
.journey-arrow::before { content: ''; width: 20px; height: 2px; border-radius: 1px; position: absolute; }
.journey-arrow::after { content: ''; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid; position: absolute; right: 2px; }
.journey-arrow.animated::before { animation: flowPulseH 2s ease-in-out infinite; }
@keyframes flowPulseH { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.arch-layer { border-radius: var(--bior-radius-xl); padding: 24px; position: relative; transition: all .35s var(--bior-ease); cursor: pointer; border-left: 5px solid transparent; overflow: hidden; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); }
.arch-layer:hover { box-shadow: var(--bior-shadow-md); transform: translateY(-2px); }
.arch-layer-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.arch-layer-num { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0; }
.arch-node { padding: 14px 16px; border-radius: var(--bior-radius-md); transition: all .3s; cursor: pointer; border: 1px solid var(--bior-border-subtle); background: var(--bior-bg-elevated); }
.arch-node:hover { box-shadow: var(--bior-shadow-sm); transform: translateY(-1px); border-color: var(--bior-border-primary); }
.arch-flow-connector { position: relative; display: flex; flex-direction: column; align-items: center; padding: 4px 0; overflow: visible; min-height: 52px; }
.arch-flow-svg { width: 200px; height: 48px; overflow: visible; }
.arch-flow-path { fill: none; stroke-width: 2.5; stroke-dasharray: 6 4; animation: dashFlow 1.5s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -20; } }
.arch-flow-label { font-size: 10px; font-family: var(--bior-font-mono); letter-spacing: 0.5px; padding: 3px 14px; border-radius: 12px; white-space: nowrap; }

/* Scorecard */
.scorecard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.scorecard-cell { padding: 14px; border-radius: var(--bior-radius-lg); text-align: center; transition: all .3s; cursor: pointer; }
.scorecard-cell:hover { transform: translateY(-2px); box-shadow: var(--bior-shadow-md); }
.scorecard-score { font-size: 28px; font-weight: 800; line-height: 1; }
.scorecard-label { font-size: 10px; margin-top: 6px; }

/* Traceability matrix */
.trace-matrix { overflow-x: auto; }
.trace-matrix table { width: 100%; border-collapse: separate; border-spacing: 0; }
.trace-matrix th { padding: 10px 8px; font-size: 10px; text-align: center; }
.trace-matrix td { padding: 6px; text-align: center; }
.trace-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; transition: all .2s; cursor: pointer; }
.trace-dot:hover { transform: scale(1.15); }

/* Timeline */
.timeline-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--bior-primary), var(--bior-info), var(--bior-special)); }
@media (max-width: 768px) { .timeline-line { left: 24px; } }

/* Pillar cards */
.pillar-card { transition: all var(--bior-duration-normal) var(--bior-ease); }
.pillar-card:hover { box-shadow: var(--bior-shadow-lg); transform: translateY(-3px); }

/* Function cards */
.fn-card { border-radius: var(--bior-radius-xl); padding: 24px; transition: all var(--bior-duration-normal) var(--bior-ease); border: 1px solid var(--bior-border-default); background: var(--bior-bg-card); position: relative; overflow: hidden; }
.fn-card:hover { box-shadow: var(--bior-shadow-md); transform: translateY(-2px); }
.fn-card-innovation { border-left: 4px solid; }
.fn-card .fn-layers { display: flex; gap: 4px; flex-wrap: wrap; }
.fn-card .fn-layer-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.fn-tech-tag { font-size: 10px; padding: 3px 10px; border-radius: var(--bior-radius-pill); font-family: var(--bior-font-mono); }
.fn-kpi { text-align: center; padding: 10px; border-radius: var(--bior-radius-md); }
.fn-flow-diagram { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 12px; border-radius: var(--bior-radius-md); }
.fn-flow-step { padding: 5px 12px; border-radius: var(--bior-radius-pill); font-size: 10px; font-weight: 600; white-space: nowrap; }
.fn-flow-arrow { color: var(--bior-text-faint); font-size: 12px; }

/* ===== CLASSIFICATION CARDS ===== */
.classification-card { transition: all .4s var(--bior-ease); }
.classification-card .class-card-inner { transition: all .35s var(--bior-ease); }
.classification-card .class-card-inner:hover { box-shadow: var(--bior-shadow-lg); transform: translateY(-3px); }
.classification-filter { padding: 8px 18px; border-radius: var(--bior-radius-pill); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .3s; border: 1px solid var(--bior-border-default); background: var(--bior-bg-card); color: var(--bior-text-muted); display: inline-flex; align-items: center; }
.classification-filter:hover { border-color: var(--bior-primary); color: var(--bior-primary); }
.classification-filter.active { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.25); }

/* ===== THREAT PAGE ===== */
.threat-alert-box { border-radius: var(--bior-radius-xl); padding: 2rem; position: relative; overflow: hidden; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); }
.threat-alert-box::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: linear-gradient(to bottom, #d97706, #ea580c); border-radius: 4px 0 0 4px; }

/* Gap page split panels */
.gap-panel { border-radius: var(--bior-radius-xl); padding: 1.75rem; position: relative; overflow: hidden; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); }
.gap-panel-missing::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: #dc2626; }
.gap-panel-existing::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: var(--bior-primary); }

/* Methodology cards */
.method-card { background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); border-radius: var(--bior-radius-xl); padding: 1.75rem; transition: all .3s var(--bior-ease); }
.method-card:hover { box-shadow: var(--bior-shadow-md); }
.method-card h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* Vision strategy cards */
.vision-strategy-card { border-radius: var(--bior-radius-xl); padding: 2rem; position: relative; overflow: hidden; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); transition: all .4s var(--bior-ease); }
.vision-strategy-card:hover { box-shadow: var(--bior-shadow-lg); transform: translateY(-3px); }

/* Benchmark compare button */
.compare-action-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border-radius: var(--bior-radius-md); font-size: 13px; font-weight: 600; background: rgba(var(--bior-primary-rgb), 0.08); color: var(--bior-primary); border: 1px solid var(--bior-border-primary); cursor: pointer; transition: all .3s; }
.compare-action-btn:hover { background: rgba(var(--bior-primary-rgb), 0.15); transform: translateY(-1px); box-shadow: var(--bior-shadow-glow); }

/* ===== AI SCIENCE MODULE ===== */
.ai-chat-container { border-radius: var(--bior-radius-xl); overflow: hidden; border: 1px solid var(--bior-border-default); background: var(--bior-bg-card); box-shadow: var(--bior-shadow-sm); }
.ai-chat-messages { max-height: 600px; min-height: 300px; overflow-y: auto; padding: 1.5rem; scroll-behavior: smooth; }
.ai-chat-messages::-webkit-scrollbar { width: 6px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(var(--bior-primary-rgb), 0.15); border-radius: 3px; }
.ai-msg { display: flex; gap: 12px; margin-bottom: 1.5rem; animation: msgIn .4s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.ai-msg-avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, var(--bior-primary), var(--bior-primary-dark)); color: #fff; font-size: 14px; }
.ai-msg-avatar-user { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.ai-msg-content { flex: 1; min-width: 0; }
.ai-msg-name { font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--bior-primary); display: flex; align-items: center; gap: 8px; }
.ai-model-badge { font-size: 9px; padding: 2px 8px; border-radius: var(--bior-radius-pill); background: rgba(var(--bior-primary-rgb), 0.08); color: var(--bior-primary); font-family: var(--bior-font-mono); font-weight: 600; }
.ai-msg-text { font-size: 14px; line-height: 1.7; color: var(--bior-text-secondary); }
.ai-msg-text p { margin-bottom: 0.75rem; }
.ai-msg-text ul,.ai-msg-text ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.ai-msg-text li { margin-bottom: 0.35rem; font-size: 13px; }
.ai-msg-text strong { color: var(--bior-text-primary); font-weight: 700; }
.ai-chat-input-area { padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--bior-border-subtle); background: var(--bior-bg-elevated); }
.ai-chat-input-row { display: flex; gap: 8px; }
.ai-input-wrapper { flex: 1; display: flex; align-items: flex-end; gap: 8px; border-radius: var(--bior-radius-lg); border: 2px solid var(--bior-border-default); padding: 8px 12px; transition: border-color .3s; background: var(--bior-bg-card); }
.ai-input-wrapper:focus-within { border-color: var(--bior-primary); box-shadow: 0 0 0 3px rgba(var(--bior-primary-rgb), 0.08); }
.ai-input-wrapper textarea { flex: 1; border: none; outline: none; background: transparent; font-family: var(--bior-font); font-size: 14px; color: var(--bior-text-primary); resize: none; line-height: 1.5; max-height: 150px; }
.ai-input-wrapper textarea::placeholder { color: var(--bior-text-faint); }
.ai-input-wrapper button { width: 36px; height: 36px; border-radius: 10px; background: var(--bior-primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .3s; flex-shrink: 0; font-size: 14px; }
.ai-input-wrapper button:hover { background: var(--bior-primary-dark); transform: scale(1.05); }
.ai-input-wrapper button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.ai-chat-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-hint { font-size: 11px; padding: 6px 14px; border-radius: var(--bior-radius-pill); background: var(--bior-bg-card); color: var(--bior-text-secondary); cursor: pointer; transition: all .2s; border: 1px solid var(--bior-border-default); font-weight: 500; }
.ai-hint:hover { border-color: var(--bior-primary); color: var(--bior-primary); transform: translateY(-1px); }
.ai-thinking { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ai-thinking-dots { display: flex; gap: 5px; }
.ai-thinking-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--bior-primary); animation: thinkBounce 1.4s ease-in-out infinite; }
.ai-thinking-dots span:nth-child(2) { animation-delay: .2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes thinkBounce { 0%,80%,100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }
.ai-briefing-output { font-size: 14px; line-height: 1.8; color: var(--bior-text-secondary); }
.ai-briefing-output h3 { font-size: 1.1rem; font-weight: 800; color: var(--bior-text-primary); margin: 1.5rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--bior-border-subtle); }
.ai-briefing-output h4 { font-size: 1rem; font-weight: 700; color: var(--bior-text-primary); margin: 1.25rem 0 0.5rem; }
.quick-analysis-card { position: relative; transition: all .35s var(--bior-ease); }
.quick-analysis-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--bior-primary), var(--bior-info)); opacity: 0; transition: opacity .3s; border-radius: 0 0 var(--bior-radius-xl) var(--bior-radius-xl); }
.quick-analysis-card:hover::after { opacity: 1; }
.threat-explorer-card { position: relative; transition: all .35s var(--bior-ease); }
.threat-explorer-card:hover { border-color: var(--bior-border-primary); }

/* ===== INTERACTIVE DATA-FLOW VIZ ===== */
.pathogen-flow-viz { border-radius: var(--bior-radius-xl); padding: 24px; position: relative; overflow: hidden; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default); }
.pathogen-selector { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pathogen-chip { padding: 7px 16px; border-radius: var(--bior-radius-pill); font-size: 11px; font-weight: 600; cursor: pointer; transition: all .3s; border: 1.5px solid var(--bior-border-default); white-space: nowrap; background: var(--bior-bg-card); }
.pathogen-chip:hover { transform: translateY(-1px); border-color: var(--bior-border-strong); }
.pathogen-chip.active { box-shadow: var(--bior-shadow-md); }
.flow-viz-pipeline { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 12px 0; }
.flow-viz-stage { flex: 1; min-width: 140px; padding: 16px 12px; text-align: center; position: relative; transition: all .5s; }
.flow-viz-stage.active { transform: scale(1.02); }
.flow-viz-stage-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; transition: all .5s; font-size: 18px; }
.flow-viz-stage.active .flow-viz-stage-icon { box-shadow: var(--bior-shadow-md); }
.flow-viz-stage-name { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.flow-viz-stage-detail { font-size: 9px; line-height: 1.4; }
.flow-viz-arrow { width: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ===== SURVEILLANCE MAP — A+++ GOOGLE MAPS STYLE ===== */

/* Viewport: Full-bleed map container */
.smap-viewport {
  position: relative; width: 100%; height: calc(100vh - 64px); min-height: 700px;
  max-height: 900px; background: #0a0a0a; overflow: hidden;
}
.smap-fullscreen { position: fixed!important; inset: 0; z-index: 9999; height: 100vh!important; }
.smap-leaflet { position: absolute; inset: 0; z-index: 1; }

/* Glass morphism base */
.smap-glass {
  background: rgba(255,255,255,0.88); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
[data-theme="dark"] .smap-glass {
  background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.15);
}

/* ── Top Bar ── */
.smap-topbar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 100;
  pointer-events: none;
}
.smap-topbar-inner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  pointer-events: auto;
}
.smap-search-group {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.smap-logo-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 24px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  font-size: 13px; font-weight: 800; color: #0f172a;
  white-space: nowrap; flex-shrink: 0;
}
[data-theme="dark"] .smap-logo-pill { background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2); color: #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.smap-logo-pill i { color: #059669; font-size: 14px; }

.smap-search-box {
  position: relative; flex: 1; min-width: 220px; max-width: 420px;
}
.smap-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: #94a3b8; pointer-events: none; z-index: 2;
}
.smap-search-box input {
  width: 100%; padding: 9px 14px 9px 38px; border-radius: 24px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  font-size: 13px; font-family: inherit; color: #0f172a; outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.smap-search-box input:focus { border-color: #059669; box-shadow: 0 2px 16px rgba(5,150,105,0.12); }
.smap-search-box input::placeholder { color: #94a3b8; }
[data-theme="dark"] .smap-search-box input { background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2); color: #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }

.smap-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(24px);
  border-radius: 16px; border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12); overflow: hidden;
  display: none; max-height: 340px; overflow-y: auto; z-index: 200;
}
.smap-search-results.visible { display: block; }
[data-theme="dark"] .smap-search-results { background: rgba(15,23,42,0.96); border-color: rgba(100,116,139,0.2); }
.smap-search-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  cursor: pointer; transition: background .15s;
}
.smap-search-item:hover { background: rgba(5,150,105,0.06); }
.smap-search-item-icon { font-size: 14px; width: 28px; text-align: center; flex-shrink: 0; }
.smap-search-item-name { font-size: 13px; font-weight: 700; color: var(--bior-text-primary); }
.smap-search-item-sub { font-size: 11px; color: var(--bior-text-muted); }
.smap-search-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--bior-text-muted); }

/* KPI Pills (top bar) */
.smap-kpi-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto;
}
.smap-kpi-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 11px; white-space: nowrap;
}
[data-theme="dark"] .smap-kpi-pill { background: rgba(15,23,42,0.85); border-color: rgba(100,116,139,0.2); }
.smap-kpi-pill i { font-size: 11px; }
.smap-kpi-value { font-weight: 800; font-family: var(--bior-font-mono); }
.smap-kpi-label { color: var(--bior-text-muted); font-size: 10px; }

/* ── Left: Layers Panel (Simplified) ── */
.smap-layers-panel {
  position: absolute; top: 64px; left: 12px; z-index: 90;
  width: 240px; border-radius: 14px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1), opacity .25s;
  max-height: calc(100vh - 130px); overflow-y: auto;
  overflow-x: hidden;
}
[data-theme="dark"] .smap-layers-panel { background: rgba(15,23,42,0.95); border-color: rgba(100,116,139,0.15); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.smap-layers-panel.collapsed { transform: translateX(-260px); opacity: 0; pointer-events: none; }
.smap-layers-panel::-webkit-scrollbar { width: 3px; }
.smap-layers-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }

.smap-layers-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; position: sticky; top: 0; z-index: 2;
  background: rgba(255,255,255,0.97); border-bottom: 1px solid rgba(0,0,0,0.04);
}
[data-theme="dark"] .smap-layers-header { background: rgba(15,23,42,0.95); border-color: rgba(100,116,139,0.1); }
.smap-layers-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--bior-text-primary); }
.smap-layers-title i { color: #059669; font-size: 13px; }
.smap-layers-actions { display: flex; gap: 2px; }
.smap-layers-btn {
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: transparent; color: var(--bior-text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all .15s;
}
.smap-layers-btn:hover { background: rgba(5,150,105,0.08); color: #059669; }

.smap-layers-body {
  padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 0;
}

/* Simplified layer items — compact single-line rows */
.smap-layer-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 8px; cursor: pointer; transition: background .15s;
  user-select: none;
}
.smap-layer-item:hover { background: rgba(0,0,0,0.03); }
[data-theme="dark"] .smap-layer-item:hover { background: rgba(255,255,255,0.04); }
.smap-layer-item.active { background: rgba(5,150,105,0.05); }
.smap-layer-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; background: color-mix(in srgb, var(--lc) 12%, transparent);
  color: var(--lc); flex-shrink: 0;
}
.smap-layer-info { flex: 1; min-width: 0; overflow: hidden; }
.smap-layer-name { font-size: 11.5px; font-weight: 600; color: var(--bior-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smap-layer-count { display: none; }
.smap-layer-toggle-switch { flex-shrink: 0; }
.smap-toggle-track {
  width: 30px; height: 16px; border-radius: 8px;
  background: #d1d5db; position: relative; transition: background .2s;
}
[data-theme="dark"] .smap-toggle-track { background: #374151; }
.smap-toggle-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: transform .2s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.smap-layer-item.active .smap-toggle-track { background: #059669; }
.smap-layer-item.active .smap-toggle-thumb { transform: translateX(14px); }

/* Legend inside layers panel */
.smap-legend {
  padding: 10px 14px; border-top: 1px solid rgba(0,0,0,0.04);
}
[data-theme="dark"] .smap-legend { border-color: rgba(100,116,139,0.15); }
.smap-legend-title { font-size: 10px; font-weight: 700; color: var(--bior-text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.smap-legend-items { display: flex; flex-wrap: wrap; gap: 4px; }
.smap-legend-chip {
  font-size: 9px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  font-family: var(--bior-font-mono); text-transform: uppercase; letter-spacing: 0.3px;
}
.smap-lev-critical { background: rgba(220,38,38,0.08); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.smap-lev-high { background: rgba(249,115,22,0.08); color: #ea580c; border: 1px solid rgba(249,115,22,0.2); }
.smap-lev-medium { background: rgba(234,179,8,0.08); color: #ca8a04; border: 1px solid rgba(234,179,8,0.2); }
.smap-lev-low { background: rgba(34,197,94,0.08); color: #16a34a; border: 1px solid rgba(34,197,94,0.2); }

/* ── Right: Drawer Panel ── */
.smap-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 95;
  width: 380px; max-width: 90vw;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid rgba(0,0,0,0.06);
  box-shadow: -4px 0 32px rgba(0,0,0,0.08);
  transform: translateX(100%); transition: transform .35s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto; overflow-x: hidden;
}
[data-theme="dark"] .smap-drawer { background: rgba(15,23,42,0.96); border-color: rgba(100,116,139,0.15); box-shadow: -4px 0 32px rgba(0,0,0,0.35); }
.smap-drawer.open { transform: translateX(0); }
.smap-drawer-close {
  position: sticky; top: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 40px; border: none; background: transparent;
  color: var(--bior-text-muted); cursor: pointer; font-size: 14px;
  transition: color .2s;
}
.smap-drawer-close:hover { color: var(--bior-text-primary); }
.smap-drawer-content { padding: 0 20px 20px; }
.smap-drawer::-webkit-scrollbar { width: 4px; }
.smap-drawer::-webkit-scrollbar-thumb { background: rgba(5,150,105,0.15); border-radius: 2px; }

/* Drawer content elements */
.smap-d-region { }
.smap-d-header { padding-left: 14px; border-left: 4px solid var(--dcolor, #059669); margin-bottom: 16px; }
.smap-d-header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.smap-d-name { font-size: 1.15rem; font-weight: 800; color: var(--bior-text-primary); margin: 0; line-height: 1.3; }
.smap-d-threat { font-size: 9px; font-weight: 700; padding: 4px 12px; border-radius: 20px; font-family: var(--bior-font-mono); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.smap-d-subtitle { font-size: 12px; color: var(--bior-text-muted); line-height: 1.5; }
.smap-d-coord { font-size: 11px; color: var(--bior-text-faint); font-family: var(--bior-font-mono); margin-top: 4px; display: flex; align-items: center; gap: 6px; }

.smap-d-coverage { margin-bottom: 16px; }
.smap-d-coverage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--bior-text-secondary); }
.smap-d-coverage-pct { font-family: var(--bior-font-mono); font-weight: 800; }
.smap-d-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--bior-bg-elevated); overflow: hidden; }
.smap-d-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

.smap-d-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.smap-d-stat { background: var(--bior-bg-elevated); border-radius: 10px; padding: 10px 6px; text-align: center; }
.smap-d-stat-val { font-size: 1.1rem; font-weight: 800; font-family: var(--bior-font-mono); color: var(--sc); line-height: 1.2; }
.smap-d-stat-lbl { font-size: 9px; color: var(--bior-text-faint); margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.smap-d-stat-lbl i { font-size: 8px; }

.smap-d-genomic { padding: 14px; border-radius: 12px; background: rgba(5,150,105,0.04); border: 1px solid rgba(5,150,105,0.1); margin-bottom: 14px; }
.smap-d-genomic-row { display: flex; justify-content: space-between; align-items: flex-end; }
.smap-d-genomic-val { font-size: 1.3rem; font-weight: 900; font-family: var(--bior-font-mono); line-height: 1.2; }
.smap-d-genomic-lbl { font-size: 10px; color: var(--bior-text-muted); }

.smap-d-facility { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px; background: var(--bior-bg-elevated); margin-bottom: 12px; }
.smap-d-facility i { font-size: 13px; margin-top: 2px; flex-shrink: 0; }
.smap-d-facility-title { font-size: 10px; font-weight: 700; color: var(--bior-text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.smap-d-facility-name { font-size: 12px; color: var(--bior-text-primary); font-weight: 600; margin-top: 2px; line-height: 1.5; }

.smap-d-section { margin-bottom: 14px; }
.smap-d-section-title { font-size: 12px; font-weight: 700; color: var(--bior-text-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.smap-d-section-title i { font-size: 12px; }
.smap-d-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.smap-d-tag { font-size: 11px; padding: 4px 12px; border-radius: 20px; background: var(--bior-bg-elevated); color: var(--bior-text-secondary); border: 1px solid var(--bior-border-default); font-weight: 600; }
.smap-d-desc-text { font-size: 12px; color: var(--bior-text-muted); line-height: 1.7; }

.smap-d-hotspot { padding: 10px 12px; border-radius: 8px; background: var(--bior-bg-elevated); }
.smap-d-hotspot-name { font-size: 12px; font-weight: 700; }
.smap-d-hotspot-desc { font-size: 11px; color: var(--bior-text-muted); margin-top: 2px; line-height: 1.5; }

/* ── Bottom-Right: Control Buttons ── */
.smap-controls-br {
  position: absolute; bottom: 100px; right: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 6px;
}
.smap-ctrl-btn {
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  color: var(--bior-text-primary); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
[data-theme="dark"] .smap-ctrl-btn {
  background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25); color: #e2e8f0;
}
.smap-ctrl-btn:hover { background: #059669; color: #fff; box-shadow: 0 4px 16px rgba(5,150,105,0.3); }
.smap-ctrl-btn.active { background: #059669; color: #fff; }

/* Layers toggle button — always visible */
.smap-layers-toggle-btn {
  display: flex !important;
}

/* ── Bottom-Left: Map Style Switcher ── */
.smap-style-widget {
  position: absolute; bottom: 56px; left: 12px; z-index: 90;
}
.smap-style-active {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  font-size: 12px; font-weight: 700; color: var(--bior-text-primary);
  transition: box-shadow .2s;
}
[data-theme="dark"] .smap-style-active { background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2); box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.smap-style-active:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.smap-style-thumb {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #1e3a5f, #2d5a87); color: #a5c4e3;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.smap-style-label { font-size: 11px; }

.smap-style-options {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  display: none; flex-direction: column; gap: 3px;
  padding: 6px; border-radius: 14px;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(24px);
  border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  min-width: 160px;
}
.smap-style-widget.expanded .smap-style-options { display: flex; }
[data-theme="dark"] .smap-style-options { background: rgba(15,23,42,0.96); border-color: rgba(100,116,139,0.2); }
.smap-style-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--bior-text-secondary); transition: background .15s;
  text-align: left;
}
.smap-style-option:hover { background: rgba(5,150,105,0.06); }
.smap-style-option.active { background: rgba(5,150,105,0.08); color: #059669; }
.smap-style-option-icon { width: 24px; text-align: center; font-size: 13px; }

/* ── Bottom-Right: Controls ── */
.smap-controls-br {
  position: absolute; bottom: 56px; right: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 4px;
}
.smap-ctrl-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  color: var(--bior-text-secondary); cursor: pointer; font-size: 13px;
  transition: all .2s;
}
[data-theme="dark"] .smap-ctrl-btn { background: rgba(15,23,42,0.88); border-color: rgba(100,116,139,0.2); box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.smap-ctrl-btn:hover { color: #059669; box-shadow: 0 4px 16px rgba(5,150,105,0.12); }

/* ── Bottom-Center: Status Bar ── */
.smap-status-bar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 16px;
  padding: 6px 20px; border-radius: 24px;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  font-size: 11px; color: var(--bior-text-muted); white-space: nowrap;
}
[data-theme="dark"] .smap-status-bar { background: rgba(15,23,42,0.85); border-color: rgba(100,116,139,0.2); }
.smap-status-item { display: flex; align-items: center; gap: 5px; }
.smap-status-item i { font-size: 10px; color: var(--bior-text-faint); }
.smap-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.smap-status-live { background: #22c55e; box-shadow: 0 0 6px #22c55e80; animation: smapPulse 2s infinite; }
@keyframes smapPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.smap-status-coord { font-family: var(--bior-font-mono); font-size: 10px; }

/* ── Leaflet Overrides (Google Maps polish) ── */
.smap-marker-icon { background: none!important; border: none!important; }
.smap-station-marker { position: relative; display: flex; align-items: center; justify-content: center; }
.smap-station-dot {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease; cursor: pointer;
}
.smap-station-dot:hover { transform: scale(1.3)!important; }

/* Animated pulse ring for critical stations */
.smap-pulse-ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--pulse-color); opacity: 0;
  animation: smapRing 2.5s ease-out infinite;
}
@keyframes smapRing { 0% { transform: scale(0.5); opacity: 0.6; } 100% { transform: scale(2); opacity: 0; } }

/* Region label markers */
.smap-region-marker {
  background: rgba(15,23,42,0.85); backdrop-filter: blur(8px);
  border: 2px solid var(--rc); border-radius: 12px;
  padding: 6px 14px; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.smap-region-marker:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.smap-region-name { font-size: 13px; font-weight: 800; color: #f1f5f9; line-height: 1.3; letter-spacing: 0.3px; }
.smap-region-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.smap-region-threat { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.smap-region-coverage { font-size: 10px; color: #94a3b8; font-family: var(--bior-font-mono); }

/* Corridor origin markers */
.smap-corridor-origin {
  width: 34px; height: 34px; border-radius: 50%;
  background: color-mix(in srgb, var(--cc) 20%, transparent);
  border: 2px solid var(--cc); display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--cc); cursor: pointer;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--cc) 30%, transparent);
  transition: transform .2s;
}
.smap-corridor-origin:hover { transform: scale(1.1); }

/* ── Google Maps InfoWindow Styles ── */
/* Override the default Google Maps InfoWindow chrome */
.gm-style .gm-style-iw-c {
  background: #ffffff !important; border-radius: 14px !important;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05) !important;
  border: 2px solid #059669 !important; padding: 0 !important;
  min-width: 300px; max-width: 420px;
}
[data-theme="dark"] .gm-style .gm-style-iw-c {
  background: #1e293b !important; border-color: #10b981 !important;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3), 0 0 0 1px rgba(16,185,129,0.2) !important;
}
.gm-style .gm-style-iw-d { overflow: auto !important; padding: 18px 20px !important; font-size: 13px; line-height: 1.6; }
/* InfoWindow arrow / tail */
.gm-style .gm-style-iw-tc::after {
  background: #ffffff !important; border: 2px solid #059669 !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}
[data-theme="dark"] .gm-style .gm-style-iw-tc::after { background: #1e293b !important; border-color: #10b981 !important; }
/* Close button */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
  top: 8px !important; right: 10px !important;
  width: 28px !important; height: 28px !important;
  border-radius: 50% !important; transition: all .2s !important;
  opacity: 1 !important;
}
.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span {
  width: 18px !important; height: 18px !important;
  margin: 5px !important;
}
.gm-style .gm-style-iw-c button.gm-ui-hover-effect:hover {
  background: #dc2626 !important; border-radius: 50%;
}
/* Hide the outer white InfoWindow wrapper shadow to keep it clean */
.gm-style .gm-style-iw-t::after { display: none; }
/* Ensure Google Maps default chrome doesn't clip content */
.gm-style .gm-style-iw { max-width: 420px !important; }

/* ── InfoWindow inner content (shared with popup-inner classes) ── */
.smap-popup-inner { font-family: Inter, system-ui, sans-serif; min-width: 280px; }
.smap-pop-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.smap-pop-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.smap-pop-title-group { flex: 1; }
.smap-pop-name { font-weight: 800; font-size: 15px; color: var(--bior-text-primary); line-height: 1.3; }
.smap-pop-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.smap-pop-priority { font-size: 9px; padding: 2px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.smap-pop-region { font-size: 10px; color: #94a3b8; text-transform: capitalize; }
.smap-pop-desc { font-size: 12px; color: var(--bior-text-muted); line-height: 1.6; margin-bottom: 8px; }
.smap-pop-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.smap-pop-tag { font-size: 11px; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--tc) 8%, transparent); color: var(--tc); font-weight: 600; }
.smap-pop-metric { font-size: 12px; color: #64748b; margin-top: 6px; }
.smap-pop-metric-val { font-size: 16px; font-weight: 900; }
.smap-pop-coord { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--bior-border-subtle); font-size: 10px; color: #94a3b8; display: flex; align-items: center; gap: 5px; font-family: var(--bior-font-mono); }
.smap-pop-stats-row { display: flex; gap: 20px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bior-border-subtle); }
.smap-pop-stat-val { font-size: 16px; font-weight: 900; }
.smap-pop-stat-lbl { font-size: 10px; color: #94a3b8; }

/* ── Google Maps control overrides ── */
#googleMap .gmnoprint { /* keep native controls minimal */ }
#googleMap .gm-style-cc { opacity: 0.5; font-size: 9px !important; }

/* ── Station marker pulse animation (critical stations) ── */
.smap-gm-pulse {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--pc); opacity: 0;
  animation: smap-pulse-ring 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  pointer-events: none;
}
@keyframes smap-pulse-ring {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* City annotation labels (Google Maps-style) */
.smap-city-annotation {
  display: flex; align-items: center; gap: 4px;
  pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -50%);
}
.smap-city-dot {
  border-radius: 50%; background: #e2e8f0;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.smap-city-name {
  color: #f8fafc; text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 2px rgba(0,0,0,0.9);
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: 0.2px;
}
[data-theme="dark"] .smap-city-name { color: #e2e8f0; text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 3px rgba(0,0,0,0.95); }

/* ── Below-Map Intelligence Section ── */
.smap-intel-section { padding: 4rem 0 3rem; background: var(--bior-bg-page); }
.smap-intel-block { margin-bottom: 3.5rem; }
.smap-intel-header { margin-bottom: 1.5rem; text-align: center; }
.smap-intel-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 16px; border-radius: 20px; font-size: 10px;
  font-weight: 700; font-family: var(--bior-font-mono);
  text-transform: uppercase; letter-spacing: 0.8px;
  background: rgba(5,150,105,0.06); color: #059669;
  border: 1px solid rgba(5,150,105,0.12); margin-bottom: 0.75rem;
}
.smap-intel-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--bior-text-primary); margin: 0.5rem 0; letter-spacing: -0.02em; }
.smap-intel-desc { font-size: 14px; color: var(--bior-text-muted); max-width: 640px; margin: 0 auto; line-height: 1.7; }

/* Station stat cards */
.smap-stat-card {
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: 16px; padding: 20px; transition: all .3s ease;
}
.smap-stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.smap-stat-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.smap-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.smap-stat-name { font-size: 13px; font-weight: 700; color: var(--bior-text-primary); }
.smap-stat-total { font-size: 11px; color: var(--bior-text-muted); }
.smap-stat-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 14px; }
.smap-stat-num span { font-size: 1.2rem; font-weight: 800; font-family: var(--bior-font-mono); display: block; }
.smap-stat-num small { font-size: 10px; color: var(--bior-text-faint); }
.smap-stat-bar-wrap { display: flex; align-items: center; gap: 8px; }
.smap-stat-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--bior-bg-elevated); overflow: hidden; }
.smap-stat-bar-fill { height: 100%; border-radius: 3px; transition: width 1.2s ease; }
.smap-stat-pct { font-size: 11px; font-weight: 700; font-family: var(--bior-font-mono); white-space: nowrap; }

/* Corridor cards */
.smap-corridor-card {
  position: relative; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: 16px; padding: 20px; overflow: hidden;
  transition: all .3s ease;
}
.smap-corridor-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.smap-corridor-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.smap-corridor-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.smap-corridor-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.smap-corridor-title-group { flex: 1; }
.smap-corridor-name { font-size: 13px; font-weight: 700; color: var(--bior-text-primary); }
.smap-corridor-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 10px; color: var(--bior-text-faint); }
.smap-lev-badge { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; }
.smap-corridor-desc { font-size: 12px; color: var(--bior-text-muted); line-height: 1.6; margin-bottom: 12px; }
.smap-corridor-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.smap-corridor-stat-val { font-size: 14px; font-weight: 800; font-family: var(--bior-font-mono); }
.smap-corridor-stat-lbl { font-size: 10px; color: var(--bior-text-faint); }

/* Hotspot cards */
.smap-hotspot-card {
  position: relative; background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: 16px; padding: 20px; padding-left: 24px; overflow: hidden;
  transition: all .3s ease;
}
.smap-hotspot-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.smap-hotspot-accent { position: absolute; top: 0; left: 0; bottom: 0; width: 4px; }
.smap-hotspot-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.smap-hotspot-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.smap-hotspot-name { font-size: 14px; font-weight: 700; color: var(--bior-text-primary); }
.smap-hotspot-meta { font-size: 11px; color: var(--bior-text-faint); }
.smap-hotspot-desc { font-size: 12px; color: var(--bior-text-muted); line-height: 1.6; margin-bottom: 10px; }
.smap-hotspot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.smap-hotspot-tag { font-size: 10px; padding: 3px 10px; border-radius: 20px; background: rgba(5,150,105,0.06); color: #059669; font-weight: 600; font-family: var(--bior-font-mono); }
.smap-hotspot-bar { height: 4px; border-radius: 2px; background: var(--bior-bg-elevated); overflow: hidden; }
.smap-hotspot-bar-fill { height: 100%; border-radius: 2px; transition: width 1.2s ease; }

/* ── Professional Pin-Style Infrastructure Markers ── */
.smap-pin-marker {
  position: relative; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; transition: transform .2s ease, filter .2s ease;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
}
.smap-pin-marker:hover { transform: scale(1.2) translateY(-3px)!important; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4)); z-index: 9999!important; }

/* Pin head — circular icon container */
.smap-pin-head {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--pin-color);
  border: 3px solid rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.2);
}
.smap-pin-head i { font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* Pin tail — the pointer */
.smap-pin-tail {
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 10px solid rgba(255,255,255,0.95);
  margin-top: -2px; position: relative; z-index: 1;
}

/* Status badge (planned) */
.smap-pin-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #f59e0b; color: #fff; font-size: 8px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; z-index: 5;
}
.smap-pin-badge.planned { background: #94a3b8; }

/* Pin pulse animation for critical markers */
.smap-pin-pulse {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--pc); opacity: 0;
  animation: smapPinPulse 2.5s ease-out infinite;
  z-index: 0;
}
@keyframes smapPinPulse {
  0% { transform: translateX(-50%) scale(0.8); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(2.4); opacity: 0; }
}

/* Professional popup enhancements */
.smap-popup-infra .leaflet-popup-content-wrapper {
  border-color: var(--pin-color, #059669);
}
.smap-popup-infra .leaflet-popup-tip {
  border-color: var(--pin-color, #059669);
}
.smap-pop-infra-type {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
  background: color-mix(in srgb, var(--ic) 12%, transparent);
  color: var(--ic);
}
.smap-pop-infra-detail { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--bior-text-muted); margin-top: 4px; }
.smap-pop-infra-detail i { font-size: 10px; color: var(--ic); }

/* ── Categorized Layer Panel ── */
.smap-layer-category {
  margin-bottom: 4px; border-radius: 10px;
  background: rgba(0,0,0,0.015); overflow: hidden;
  transition: background .2s;
}
[data-theme="dark"] .smap-layer-category { background: rgba(255,255,255,0.02); }

.smap-layer-cat-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  cursor: pointer; user-select: none; border-radius: 12px;
  transition: all .2s;
}
.smap-layer-cat-header:hover { background: rgba(5,150,105,0.06); }

.smap-layer-cat-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
  background: rgba(5,150,105,0.08); color: #059669;
}
.smap-layer-cat-label {
  flex: 1; font-size: 11px; font-weight: 800; color: var(--bior-text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.smap-layer-cat-count {
  font-size: 9px; font-weight: 700; font-family: var(--bior-font-mono);
  padding: 2px 8px; border-radius: 10px;
  background: rgba(5,150,105,0.08); color: #059669;
  white-space: nowrap;
}
.smap-layer-cat-chevron {
  font-size: 9px; color: var(--bior-text-faint);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}
.smap-layer-cat-chevron.rotated { transform: rotate(-90deg); }

.smap-layer-cat-body {
  padding: 0 4px 4px; display: flex; flex-direction: column; gap: 2px;
  transition: max-height .3s ease, opacity .2s ease, padding .2s ease;
  max-height: 600px; opacity: 1; overflow: hidden;
}
.smap-layer-cat-body.collapsed {
  max-height: 0; opacity: 0; padding: 0 4px;
  pointer-events: none;
}

/* Category separator */
.smap-layer-category + .smap-layer-category {
  border-top: 1px solid rgba(0,0,0,0.03);
}
[data-theme="dark"] .smap-layer-category + .smap-layer-category {
  border-color: rgba(255,255,255,0.04);
}

/* ── Infrastructure Intelligence Cards (below-map) ── */
.smap-infra-stat-card {
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: 16px; padding: 20px; position: relative; overflow: hidden;
  transition: all .3s ease;
}
.smap-infra-stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }

.smap-infra-stat-card .smap-infra-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}

.smap-infra-stat-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.smap-infra-stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.smap-infra-stat-name {
  font-size: 14px; font-weight: 700; color: var(--bior-text-primary);
}
.smap-infra-stat-count {
  font-size: 11px; color: var(--bior-text-muted); margin-top: 2px;
}

.smap-infra-metric {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--bior-border-subtle);
  font-size: 12px; color: var(--bior-text-secondary);
}
.smap-infra-metric:last-child { border-bottom: none; }
.smap-infra-metric i { font-size: 11px; width: 16px; text-align: center; flex-shrink: 0; }
.smap-infra-metric strong {
  margin-left: auto; font-weight: 800; font-family: var(--bior-font-mono);
  color: var(--bior-text-primary);
}

/* Infrastructure drawer section */
.smap-d-infra-section { margin-bottom: 14px; }
.smap-d-infra-grid {

/* ── Alert Feed Styles ── */
.smap-alert-feed { display: flex; flex-direction: column; gap: 12px; }
.smap-alert-item {
  padding: 14px 16px; border-radius: 12px;
  transition: transform .2s, box-shadow .2s;
}
.smap-alert-item:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.smap-alert-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.smap-alert-header i { font-size: 14px; flex-shrink: 0; }
.smap-alert-title { font-size: 13px; font-weight: 700; color: var(--bior-text-primary); flex: 1; }
.smap-alert-time { font-size: 10px; color: var(--bior-text-faint); font-family: var(--bior-font-mono); white-space: nowrap; }
.smap-alert-body { padding-left: 24px; }
.smap-alert-region {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; color: var(--bior-text-muted);
  padding: 2px 8px; border-radius: 6px; background: var(--bior-bg-elevated);
  margin-bottom: 6px;
}
.smap-alert-region i { font-size: 9px; }
.smap-alert-desc { font-size: 12px; color: var(--bior-text-muted); line-height: 1.6; margin: 4px 0 0; }

/* ── Network Overview Stats ── */
.smap-net-stat {
  background: var(--bior-bg-card); border: 1px solid var(--bior-border-default);
  border-radius: 14px; padding: 16px; text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.smap-net-stat:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.smap-net-stat-val { font-size: 1.5rem; font-weight: 900; font-family: var(--bior-font-mono); line-height: 1.2; }
.smap-net-stat-lbl { font-size: 11px; color: var(--bior-text-muted); margin-top: 4px; font-weight: 600; }
.smap-net-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bior-bg-elevated); border: 1px solid var(--bior-border-subtle);
  font-size: 12px; color: var(--bior-text-secondary);
  transition: transform .2s;
}
.smap-net-chip:hover { transform: translateY(-1px); }
.smap-net-chip i { font-size: 13px; flex-shrink: 0; }
.smap-net-chip strong { font-family: var(--bior-font-mono); color: var(--bior-text-primary); }
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.smap-d-infra-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; background: var(--bior-bg-elevated);
  font-size: 12px;
}
.smap-d-infra-item i { font-size: 12px; flex-shrink: 0; }
.smap-d-infra-item-label { font-weight: 600; color: var(--bior-text-secondary); }
.smap-d-infra-item-val {
  margin-left: auto; font-weight: 800; font-family: var(--bior-font-mono);
  color: var(--bior-text-primary);
}

/* ===== HOME PAGE ENHANCEMENTS ===== */
.home-hero-section {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  background: var(--bior-bg-page);
}
.home-hero-section::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(var(--bior-primary-rgb), 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 80% 80%, rgba(37,99,235,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 1024px) {
  .smap-layers-panel { width: 220px; top: 56px; }
  .smap-kpi-row { display: none; }
  .smap-drawer { width: 340px; }
  .smap-infra-diamond, .smap-infra-square, .smap-infra-circle { width: 26px; height: 26px; }
  .smap-infra-hexagon { width: 28px; height: 24px; }
  .smap-infra-shield { width: 24px; height: 28px; }
  .smap-infra-triangle { border-left-width: 14px; border-right-width: 14px; border-bottom-width: 24px; }
  .smap-d-infra-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .smap-viewport { height: calc(100vh - 56px); min-height: 500px; }
  .smap-layers-panel { display: none; transform: none; opacity: 1; pointer-events: auto; }
  .smap-layers-panel.mobile-visible {
    display: block; position: absolute; top: 56px; left: 0; right: 0;
    width: 100%; max-width: 100vw; border-radius: 0 0 16px 16px;
    z-index: 200; max-height: 60vh; overflow-y: auto;
    transform: none !important; opacity: 1 !important; pointer-events: auto !important;
  }
  .smap-topbar-inner { flex-wrap: nowrap; }
  .smap-logo-pill { display: none; }
  .smap-search-box { max-width: 100%; min-width: 0; }
  .smap-kpi-row { display: none; }
  .smap-drawer { width: 100%; max-width: 100vw; }
  .smap-d-grid { grid-template-columns: repeat(2, 1fr); }
  .smap-d-infra-grid { grid-template-columns: 1fr; }
  .smap-status-bar { font-size: 9px; gap: 10px; padding: 5px 14px; }
  .smap-status-coord { display: none; }
  .smap-style-widget { bottom: 48px; }
  .smap-controls-br { bottom: 48px; }
  .smap-infra-stat-card { padding: 16px; }
  .smap-infra-stat-icon { width: 36px; height: 36px; font-size: 14px; }
  .ai-chat-messages { max-height: 400px; min-height: 200px; padding: 1rem; }
  .ai-chat-input-area { padding: 0.75rem 1rem; }
  .ai-chat-hints { display: none; }
  .ai-msg { gap: 8px; }
  .ai-msg-avatar { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
  .sample-journey { gap: 0; padding: 8px 4px; }
  .journey-node { padding: 6px 12px; font-size: 10px; }
  .scorecard-grid { grid-template-columns: repeat(3, 1fr); }
  .flow-viz-pipeline { overflow-x: auto; }
  .flow-viz-stage { min-width: 110px; }
}
@media (max-width: 480px) {
  .scorecard-grid { grid-template-columns: repeat(2, 1fr); }
  .journey-node span { display: none; }
  .journey-node { padding: 6px; border-radius: 50%; width: 32px; height: 32px; justify-content: center; }
  .smap-status-bar { gap: 6px; padding: 4px 10px; }
  .smap-style-widget { display: none; }
  .smap-infra-stat-card { padding: 14px; }
  .smap-infra-metric { font-size: 11px; padding: 6px 0; }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .3s; border: 1px solid var(--bior-border-default); background: var(--bior-bg-card); color: var(--bior-text-muted); font-size: 14px; }
.theme-toggle:hover { border-color: var(--bior-primary); color: var(--bior-primary); }

/* Close dropdown on click outside */
.nav-more { position: relative; }
body:not(:has(.nav-more:hover)) .nav-dropdown { /* handled by JS */ }

/* Section separator — ultra subtle */
section + section { border-top: none; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 12px 0; }
.breadcrumb a { color: var(--bior-text-muted); transition: color .2s; text-decoration: none; }
.breadcrumb a:hover { color: var(--bior-primary); }

/* Dim expand */
.dim-expand { transition: all .4s ease; }
.dim-expand.collapsed { max-height: 0; overflow: hidden; opacity: 0; padding: 0; }
.dim-expand.expanded { max-height: 600px; overflow: visible; opacity: 1; padding: 16px; }
.dim-chevron { transition: transform .3s; }
.dim-chevron.rotated { transform: rotate(180deg); }

/* Heatmap */
.heatmap-cell { transition: all var(--bior-duration-normal) var(--bior-ease); cursor: pointer; }
.heatmap-cell:hover { transform: scale(1.1); z-index: 10; }
.feature-check { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--bior-radius-sm); font-size: 12px; }

/* Dim trace grid (architecture) */
.dim-trace-grid { display: grid; gap: 6px; }
.dim-trace-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--bior-radius-md); transition: all .25s; cursor: pointer; }
.dim-trace-row:hover { transform: translateX(4px); background: var(--bior-bg-elevated); }
.dim-trace-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dim-trace-bar { flex: 1; height: 6px; border-radius: 3px; overflow: hidden; position: relative; background: var(--bior-bg-elevated); }
.dim-trace-fill { height: 100%; border-radius: 3px; transition: width 1.5s var(--bior-ease); }

/* Bench layer (architecture page) */
.bench-layer { border: 2px dashed var(--bior-border-default); border-radius: var(--bior-radius-xl); padding: 24px; position: relative; overflow: hidden; }
.bench-layer::before { content: 'ANALYTICAL LAYER'; position: absolute; top: -10px; left: 20px; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; padding: 0 10px; font-family: var(--bior-font-mono); color: var(--bior-text-faint); background: var(--bior-bg-page); }
