:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  
  --color-improving: #10b981;
  --color-stable: #f59e0b;
  --color-risk: #ef4444;
}

/* Custom Glassmorphic Leaflet Hover Tooltip */
.leaflet-custom-hover-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.65), 0 0 15px rgba(59, 130, 246, 0.15) !important;
  color: #f8fafc !important;
  padding: 8px 12px !important;
  font-family: 'Inter', sans-serif !important;
}

.leaflet-custom-hover-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.75rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-group h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.model-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  background: rgba(30, 41, 59, 0.7);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.model-select-label {
  color: var(--text-muted);
  font-weight: 500;
}

.model-select-dropdown {
  background: var(--bg-darker);
  color: var(--text-main);
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.model-select-dropdown:hover {
  border-color: #60a5fa;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  background: rgba(30, 41, 59, 0.6);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #64748b;
}

.status-dot.online {
  background-color: var(--color-improving);
  box-shadow: 0 0 8px var(--color-improving);
}

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.accent-green .metric-value { color: var(--color-improving); }
.accent-blue .metric-value { color: var(--accent-primary); }
.accent-red .metric-value { color: var(--color-risk); }

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.slider {
  position: relative;
  width: 42px;
  height: 22px;
  background-color: #334155;
  border-radius: 22px;
  transition: 0.3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider { background-color: var(--accent-primary); }
input:checked + .slider:before { transform: translateX(20px); }
.toggle-label { font-size: 0.82rem; }

/* Custom Select */
.filter-group {
  margin-top: 0.85rem;
}

.input-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.custom-select {
  width: 100%;
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
}

/* Topic Badges */
.topic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  font-family: monospace;
}

.topic-crime { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.topic-violations { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.topic-311 { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.topic-vehicles { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; }
.topic-narcotics { background: rgba(236, 72, 153, 0.2); color: #fbcfe8; }

/* Map Section */
.map-section {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-container {
  width: 100%;
  height: 100%;
  background: #0f172a;
}

/* Period Pills */
.period-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.period-pill {
  background: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-pill:hover {
  color: var(--text-main);
  background: #334155;
}

.period-pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Floating Timeline Control Bar */
.timeline-control-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 90%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 850;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.btn-play {
  min-width: 145px;
  justify-content: center;
}

.timeline-slider-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.year-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  transition: all 0.3s ease;
}

.year-badge.forecast-mode {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(6, 182, 212, 0.35));
  color: #f3e8ff;
  border: 1px solid rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
  animation: forecastPulse 2s infinite ease-in-out;
}

@keyframes forecastPulse {
  0% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
  50% { box-shadow: 0 0 16px rgba(168, 85, 247, 0.75), 0 0 24px rgba(6, 182, 212, 0.4); }
  100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
}

.forecast-tick {
  color: #c084fc;
  font-weight: 700;
}

.timeline-range {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 4px;
}

.slider-ticks span {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}

.forecast-tick {
  color: #a855f7;
}

.forecast-icon {
  font-size: 0.72rem;
  line-height: 1;
  margin-top: 1px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.speed-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.speed-btn {
  background: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.speed-btn.active {
  background: #334155;
  color: #fff;
  border-color: #64748b;
}

.map-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  z-index: 800;
  font-size: 0.78rem;
}

.map-legend h4 {
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.color-improving { background: var(--color-improving); }
.color-stable { background: var(--color-stable); }
.color-risk { background: var(--color-risk); }
.color-regressed { background: #a855f7; }

/* Pattern Card in Inspector */
.pattern-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.pattern-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pattern-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pattern-detail-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

/* Pattern Badge Themes */
.badge-improving { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-deteriorating { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-regressed { background: rgba(168, 85, 247, 0.25); color: #e9d5ff; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-high_risk { background: rgba(225, 29, 72, 0.25); color: #fda4af; border: 1px solid rgba(225, 29, 72, 0.4); }
.badge-stable { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }

/* Hex Inspector Drawer */
.hex-inspector {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 360px;
  max-height: calc(100% - 48px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  z-index: 900;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  transition: all 0.3s ease;
}

.hex-inspector.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.inspector-header h2 {
  font-size: 1rem;
  font-family: monospace;
  margin: 0.35rem 0;
}

.neighborhood-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.score-box {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.dual-score-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 0.5rem;
  margin: 0.85rem 0;
  text-align: center;
}

.score-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

.score-divider {
  width: 1px;
  height: 55px;
  background: linear-gradient(to bottom, transparent, #334155, #475569, #334155, transparent);
  margin: 0 0.2rem;
}

.score-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.score-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--color-improving);
  margin: 0.15rem 0;
}

.score-num.risk-num {
  color: #ef4444;
}

.score-sub { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }

.inspector-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.insp-metric {
  background: rgba(30, 41, 59, 0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.insp-label { font-size: 0.7rem; color: var(--text-muted); }
.insp-val { font-weight: 600; font-size: 0.95rem; margin-top: 0.1rem; }

.graph-lookup-card {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 0.85rem;
  font-size: 0.8rem;
}

.graph-lookup-card h4 {
  margin-bottom: 0.5rem;
  color: #93c5fd;
}

.graph-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.spillover-indicator {
  margin-top: 0.5rem;
  padding: 0.35rem;
  text-align: center;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-improving);
}

/* Selected Map Location Popup & Highlight */
.selected-hex-popup .leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  border: 1.5px solid #38bdf8;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.4);
  padding: 0;
}

.selected-hex-popup .leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid #38bdf8;
}

.map-selected-popup {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.map-selected-popup strong {
  font-family: monospace;
  font-size: 0.82rem;
  color: #38bdf8;
}

/* Time-Window Crime Likelihood Predictor Panel */
.time-window-panel {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
}

.time-window-card {
  margin-top: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 0.85rem;
}

.tw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.tw-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
}

.tw-range-box {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}

.tw-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.15rem;
}

.tw-range-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
}

.tw-range-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.tw-dual-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.dual-range-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

.dual-range-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  z-index: 1;
}

.dual-range-fill {
  position: absolute;
  height: 6px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  z-index: 2;
}

.dual-range-container input[type=range] {
  position: absolute;
  width: 100%;
  height: 18px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
  margin: 0;
}

.dual-range-container input[type=range]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.dual-range-container input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #7dd3fc;
}

.dual-range-container input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  cursor: pointer;
}

.tw-slider-sublabels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.tw-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.85rem;
  align-items: center;
}

.tw-slider-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.tw-highlight {
  color: #38bdf8;
  font-weight: 700;
}

.tw-slider-group input[type=range] {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.tw-filter-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.tw-pills {
  display: flex;
  gap: 0.3rem;
}

.tw-pill {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tw-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 600;
}

/* Time Likelihood Inspector Card */
.time-likelihood-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.tl-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f87171;
}

.tl-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tl-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ef4444;
  font-family: 'Outfit', sans-serif;
}

.tl-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tl-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.tl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transition: width 0.3s ease;
}

.tl-factors-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tl-factor {
  font-size: 0.72rem;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.factor-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.factor-val {
  font-weight: 700;
  color: #38bdf8;
  margin-left: auto;
  padding-left: 0.5rem;
  font-family: monospace;
  font-size: 0.75rem;
}

.tw-scenario-pills {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tw-scenario-pill {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tw-scenario-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.tw-scenario-pill.active {
  background: linear-gradient(135deg, #0284c7, #3b82f6);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}
