:root {
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-white: rgba(255, 255, 255, 0.2);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --orange: #f97316;
  --red: #ef4444;
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --blue: #3b82f6;
  --yellow: #eab308;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #000;
  color: #fff;
}

/* ─── MAP ─────────────────────────────────────────────────────────── */
#map { position: fixed; inset: 0; width: 100%; height: 100%; }

/* ─── GLASS ───────────────────────────────────────────────────────── */
.liquid-glass {
  background: rgba(4, 6, 16, 0.68);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 4px 32px rgba(0,0,0,0.45);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.08) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ─── LOADING ─────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: #000; z-index: 9999;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.5rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-spinner { position: relative; width: 80px; height: 80px; }
.loading-progress { width: 180px; height: 2px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-top: -8px; }
.loading-progress-bar { height: 100%; background: linear-gradient(90deg, var(--emerald), var(--cyan)); border-radius: 2px; animation: loadBar 2.2s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes loadBar { from { width: 0; } to { width: 100%; } }
.spinner-ring { position: absolute; border: 2px solid transparent; border-radius: 50%; animation: spin 1.5s linear infinite; }
.spinner-ring:nth-child(1) { inset: 0; border-top-color: var(--emerald); }
.spinner-ring:nth-child(2) { inset: 12px; border-right-color: var(--cyan); animation-duration: 2s; animation-direction: reverse; }
.spinner-ring:nth-child(3) { inset: 24px; border-bottom-color: var(--orange); animation-duration: 2.5s; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { font-size: .8125rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; letter-spacing: .05em; }

/* ─── TOP BAR ─────────────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; border-radius: 100px; white-space: nowrap;
}
.nav-logo { font-size: 1rem; font-weight: 700; letter-spacing: .04em; }
.nav-logo .accent { color: var(--emerald); }
.top-subtitle { font-size: .8rem; color: var(--text-muted); }
.top-controls { display: flex; gap: 6px; margin-left: 4px; }
.btn-icon {
  padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,0.07); border: 1px solid var(--border-subtle);
  color: var(--text-muted); font-size: .75rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-icon.active { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: var(--emerald); }

/* ─── DRAW HINT BANNER ────────────────────────────────────────────── */
.draw-hint-banner {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 100px;
  background: rgba(59,130,246,0.18); border: 1px solid rgba(59,130,246,0.4); white-space: nowrap;
}
.draw-hint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse-dot 1.2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(0.7); } }
.draw-hint-banner span { font-size: .78rem; color: var(--text-secondary); }
.btn-finish-draw {
  padding: 4px 12px; border-radius: 20px; background: var(--emerald); border: none;
  color: #000; font-size: .72rem; font-weight: 700; cursor: pointer; transition: background .2s;
}
.btn-finish-draw:hover { background: #059669; }
.btn-cancel-draw { background: none; border: none; color: var(--text-muted); font-size: .9rem; cursor: pointer; transition: color .2s; padding: 2px 4px; line-height: 1; }
.btn-cancel-draw:hover { color: var(--red); }

/* ─── SCROLLBAR STANDARDS ─────────────────────────────────────────── */
.analysis-body, .congress-log {
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── PANELS & CARDS ──────────────────────────────────────────────── */
.filter-panel { position: fixed; top: 50%; left: 16px; transform: translateY(-50%); z-index: 200; border-radius: var(--radius-lg); padding: 14px; width: 178px; display: flex; flex-direction: column; gap: 7px; }
.panel-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; padding-bottom: 1px; }
.layer-list { display: flex; flex-direction: column; gap: 2px; }
.layer-btn { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-md); background: transparent; border: 1px solid transparent; color: var(--text-muted); font-size: .78rem; font-family: 'Inter', sans-serif; cursor: pointer; transition: all .2s; text-align: left; width: 100%; }
.layer-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.layer-btn.active { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: var(--emerald); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-multi { background: conic-gradient(var(--red) 0 90deg, var(--orange) 90deg 180deg, var(--blue) 180deg 270deg, var(--emerald) 270deg); }
.panel-divider { height: 1px; background: var(--border-subtle); margin: 1px 0; }

.btn-draw { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: var(--radius-md); background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: var(--blue); font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-draw:hover { background: rgba(59,130,246,0.22); }
.btn-draw.drawing { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: var(--red); }

.btn-congress { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: var(--radius-md); background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: var(--emerald); font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.btn-congress:hover { background: rgba(16,185,129,0.22); box-shadow: 0 0 14px rgba(16,185,129,0.18); }
.btn-congress:disabled { opacity: .5; cursor: not-allowed; }
.btn-congress svg { width: 12px; height: 12px; flex-shrink: 0; }
.btn-spinner { width: 12px; height: 12px; border: 2px solid rgba(16,185,129,0.3); border-top-color: var(--emerald); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }

.vending-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.vending-stats.visible { opacity: 1; transform: none; pointer-events: all; }
.vstat { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 5px 4px; }
.vstat-val { font-family: 'JetBrains Mono', monospace; font-size: .88rem; font-weight: 700; color: var(--cyan); }
.vstat-lab { font-size: .5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }

.legend-panel { position: fixed; bottom: 24px; left: 16px; z-index: 200; border-radius: var(--radius-lg); padding: 12px 14px; min-width: 165px; }
.legend-title { font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }
#legend-content { display: flex; flex-direction: column; gap: 5px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .6875rem; color: var(--text-secondary); }
.legend-color { width: 20px; height: 5px; border-radius: 3px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;}

/* ─── AI PANELS ───────────────────────────────────────────────────── */
.analysis-panel { position: fixed; top: 72px; right: 16px; z-index: 200; border-radius: var(--radius-lg); width: 360px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; overflow: hidden; }
.analysis-header { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.analysis-header-left { display: flex; align-items: center; gap: 6px; }
.analysis-icon { font-size: .95rem; }
.analysis-title { font-size: .78rem; font-weight: 600; color: var(--blue); }
.analysis-photo-wrap { height: 140px; background: rgba(0,0,0,0.4); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.analysis-photo-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.analysis-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.analysis-section-label { font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.metric-card { background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 10px; }
.metric-label { font-size: .56rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 3px; }
.metric-value { font-family: 'JetBrains Mono', monospace; font-size: .95rem; font-weight: 700; }
.metric-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width 1s ease; width: 0; }

.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 6px 0; }
.typing-indicator span:not(:last-child) { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: typingDot 1.2s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

.suggestion-card { background: rgba(0,0,0,0.25); border: 1px solid var(--border-subtle); border-left: 3px solid; border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 5px; opacity: 0; animation: fadeSlideIn .4s ease forwards; }
.suggestion-card.priority-high   { border-left-color: var(--red); }
.suggestion-card.priority-medium { border-left-color: var(--orange); }
.suggestion-card.priority-low    { border-left-color: var(--emerald); }
.suggestion-head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.suggestion-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; color: var(--text-secondary); }
.suggestion-title { font-size: .73rem; font-weight: 600; flex: 1; line-height: 1.3; }
.suggestion-badge { font-size: .48rem; padding: 2px 6px; border-radius: 99px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.suggestion-badge.high   { background: rgba(239,68,68,.2);  color: var(--red); }
.suggestion-badge.medium { background: rgba(249,115,22,.2); color: var(--orange); }
.suggestion-badge.low    { background: var(--emerald-glow); color: var(--emerald); }
.suggestion-desc { font-size: .665rem; color: var(--text-secondary); line-height: 1.55; }
.suggestion-meta { margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.suggestion-tag { font-size: .57rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 7px; border-radius: 20px; }

/* ─── AI CHAT ─────────────────────────────────────────────────────── */
.ai-chat-history { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.ai-msg { font-size: 0.72rem; padding: 8px 10px; border-radius: 8px; line-height: 1.4; animation: fadeSlideIn 0.3s ease forwards; }
.ai-msg.user { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); align-self: flex-end; color: #fff; max-width: 90%; }
.ai-msg.bot { background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); align-self: flex-start; color: var(--text-secondary); width: 100%; }
.ai-chat-input-wrapper { display: flex; gap: 6px; }
.ai-chat-input-wrapper input { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 8px 10px; color: #fff; font-size: 0.75rem; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.2s; }
.ai-chat-input-wrapper input:focus { border-color: var(--blue); }
.ai-chat-input-wrapper button { background: var(--blue); border: none; border-radius: 6px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; transition: background 0.2s; }
.ai-chat-input-wrapper button:hover { background: #2563eb; }

/* ─── POPUPS & MARKERS ────────────────────────────────────────────── */
.congress-popup { position: fixed; top: 72px; right: 16px; z-index: 200; border-radius: var(--radius-lg); padding: 14px; width: 340px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; gap: 10px; border:1px solid rgba(255,255,255,.14); background:rgba(3,7,18,.76); }
.popup-header { display: flex; justify-content: space-between; align-items: center; padding-bottom:4px; }
.popup-title { font-size: .82rem; font-weight: 700; color: var(--emerald); }
.btn-close { width:28px; height:28px; display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,.06); border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-muted); font-size: .82rem; font-weight: 700; cursor: pointer; transition: all .2s; line-height: 1; padding: 0; }
.btn-close:hover { color: var(--text-primary); background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.35); }
.agents-strip { display: flex; flex-direction: column; gap: 4px; }
.ai-agent { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); transition: all .3s; }
.ai-agent.thinking { border-color: var(--emerald); background: rgba(16,185,129,0.08); }
.ai-agent.done     { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.04); }
.agent-avatar { width: 26px; height: 26px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agent-avatar.urban     { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.agent-avatar.nutrition { background: linear-gradient(135deg,var(--emerald),#059669); }
.agent-avatar.equity    { background: linear-gradient(135deg,var(--blue),#2563eb); }
.agent-info { display: flex; flex-direction: column; gap: 1px; }
.agent-name   { font-size: .7rem; font-weight: 600; }
.agent-status { font-size: .56rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.ai-agent.thinking .agent-status, .ai-agent.done .agent-status { color: var(--emerald); }
.congress-log { flex: 1; overflow-y: auto; padding: 10px; background: linear-gradient(180deg,rgba(0,0,0,.35),rgba(255,255,255,.025)); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); font-family: 'JetBrains Mono', monospace; font-size: .6875rem; line-height: 1.7; min-height: 150px; max-height: 280px; }
.log-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 110px; color: var(--text-muted); text-align: center; gap: 10px; font-size: .7rem; }
.pulse-ring { width: 26px; height: 26px; border: 2px solid var(--emerald); border-radius: 50%; animation: pulse-ring 2s ease-in-out infinite; }
@keyframes pulse-ring { 0%, 100% { transform: scale(.8); opacity: .8; } 50% { transform: scale(1.15); opacity: .2; } }
.log-entry { margin-bottom: 4px; animation: fadeSlideIn .35s ease forwards; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.03); }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.log-entry .timestamp   { color: var(--text-muted); margin-right: 4px; }
.log-entry .agent-tag   { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: .49rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.log-entry .agent-tag.urban     { background: rgba(139,92,246,.2);  color: #a78bfa; }
.log-entry .agent-tag.nutrition { background: var(--emerald-glow);  color: var(--emerald); }
.log-entry .agent-tag.equity    { background: rgba(59,130,246,.2);  color: var(--blue); }
.log-entry .agent-tag.system    { background: rgba(255,255,255,.1); color: var(--text-secondary); }
.log-entry .message { color: var(--text-secondary); }

/* ─── OVERRIDES & MARKERS ─────────────────────────────────────────── */
.maplibregl-ctrl-group { background: rgba(0,0,0,0.58) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; border: 1px solid var(--border-subtle) !important; border-radius: var(--radius-md) !important; box-shadow: none !important; }
.maplibregl-ctrl-group button { background-color: transparent !important; color: var(--text-secondary) !important; }
.maplibregl-ctrl-group button:hover { background-color: rgba(255,255,255,0.08) !important; color: #fff !important; }
.maplibregl-ctrl-bottom-right { bottom: 28px; right: 12px; }
.maplibregl-ctrl-bottom-left  { bottom: 28px; left: 204px; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,0.5) !important; color: var(--text-muted) !important; font-size: 9px !important; }
.maplibregl-ctrl-attrib a { color: var(--text-muted) !important; }
.maplibregl-popup-content { background: rgba(4,6,18,0.88) !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; border: 1px solid var(--border-subtle) !important; border-radius: var(--radius-lg) !important; color: #fff !important; font-family: 'Inter', sans-serif !important; padding: 0 !important; box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important; }
.maplibregl-popup-tip { display: none !important; }
.maplibregl-popup-close-button { color: var(--text-muted) !important; font-size: 14px !important; top: 6px !important; right: 8px !important; }
.maplibregl-popup-close-button:hover { color: #fff !important; background: transparent !important; }

.popup-body { padding: 14px 16px; min-width: 200px; }
.popup-heading { font-size: 13px; font-weight: 700; margin-bottom: 4px; display:flex; align-items:center; gap:6px;}
.popup-tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 99px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.popup-rows { font-size: 11px; color: #94a3b8; line-height: 1.9; }
.popup-rows .row { display: flex; justify-content: space-between; gap: 16px; }
.popup-rows .val { color: #f1f5f9; font-weight: 600; }
.popup-rows .val.highlight { color: var(--cyan); }
.popup-divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 0; }
.popup-note { font-size: 10px; color: #64748b; line-height: 1.5; }
.popup-roi { margin-top: 8px; padding: 7px 10px; background: rgba(6,182,212,.08); border: 1px solid rgba(6,182,212,.2); border-radius: 8px; }
.popup-roi.piezo { background: rgba(234,179,8,.08); border-color: rgba(234,179,8,.2); }
.popup-roi.piezo .popup-roi-value { color: var(--yellow); }
.popup-roi-label { font-size: 9px; text-transform: uppercase; letter-spacing: .07em; color: #64748b; }
.popup-roi-value { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--cyan); }
.piezo-badge { display: inline-block; font-size: 10px; padding: 1px 8px; border-radius: 99px; background: rgba(234,179,8,.15); color: var(--yellow); border: 1px solid rgba(234,179,8,.3); font-weight: 600; }

@keyframes vendPop { from { opacity: 0; filter: saturate(0.7); } to { opacity: 1; filter: saturate(1); } }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .top-bar { top: 8px; left: 8px; right: 8px; transform: none; border-radius: var(--radius-lg); gap: 10px; }
  .top-subtitle { display: none; }
  .filter-panel { top: auto; bottom: 16px; left: 8px; right: 8px; transform: none; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 5px; }
  .panel-label, .panel-divider { display: none; }
  .layer-list { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .layer-btn { flex: 1; min-width: 80px; justify-content: center; font-size: .68rem; }
  .btn-draw, .btn-congress { width: auto; font-size: .68rem; padding: 6px 10px; }
  .legend-panel { bottom: 110px; left: 8px; }
  .analysis-panel, .congress-popup { top: 58px; right: 8px; left: 8px; width: auto; max-height: 58vh; }
  .vending-stats { display: none; }
}

.map-marker-container { width:38px; height:38px; position:relative; display:flex; align-items:center; justify-content:center; pointer-events:auto; }
.custom-map-marker { line-height:1; }
.maplibregl-marker:has(.map-marker-container) { will-change: transform; transition: none !important; }

.intervention-marker {
  width: 48px; height: 48px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  appearance:none; -webkit-appearance:none; padding:0;
  border: 1px solid rgba(255,255,255,.45);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--marker-color), white 18%), var(--marker-color) 58%, rgba(0,0,0,.78));
  color:#fff; font-size:22px; cursor:pointer;
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--marker-color), transparent 76%), 0 18px 38px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.35);
  animation: markerReveal .45s ease both, markerPulse 2.8s .5s ease-in-out infinite;
}
.intervention-marker:hover { filter: brightness(1.14); }
@keyframes markerReveal { from { opacity:0; filter:saturate(.6); } to { opacity:1; filter:saturate(1); } }
@keyframes markerPulse { 0%,100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--marker-color), transparent 78%), 0 18px 38px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 0 0 13px color-mix(in srgb, var(--marker-color), transparent 90%), 0 22px 46px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.38); } }

.study-panel {
  position: fixed; z-index: 500; top: 72px; left: 210px; right: 18px; bottom: 18px;
  border-radius: var(--radius-lg); display:flex; flex-direction:column; overflow:hidden;
  background: rgba(3, 7, 18, .78);
  border: 1px solid rgba(255,255,255,.13);
}
.study-top { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border-subtle); background:linear-gradient(90deg,rgba(255,255,255,.06),rgba(255,255,255,.015)); }
.study-top h2 { font-size:1.32rem; line-height:1.15; margin-top:4px; }
.study-content { overflow:auto; padding:18px; display:flex; flex-direction:column; gap:14px; }
.study-hero { display:grid; grid-template-columns:64px 1fr; gap:16px; align-items:center; padding:18px; border:1px solid color-mix(in srgb, var(--accent), transparent 62%); background:linear-gradient(135deg,color-mix(in srgb, var(--accent), transparent 82%),rgba(255,255,255,.035)); border-radius:14px; }
.premium-hero { min-height:150px; align-items:end; }
.premium-hero h3 { font-size:1.45rem; margin-bottom:7px; }
.study-icon { width:64px; height:64px; border-radius:16px; display:flex; align-items:center; justify-content:center; background:var(--accent); font-size:32px; box-shadow:0 16px 34px color-mix(in srgb, var(--accent), transparent 72%); }
.study-place { color:var(--text-muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:4px; }
.study-hero p, .study-section p, .study-section li { color:var(--text-secondary); font-size:.82rem; line-height:1.55; }
.study-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.study-kpi, .study-section { background:linear-gradient(180deg,rgba(255,255,255,.065),rgba(255,255,255,.025)); border:1px solid var(--border-subtle); border-radius:12px; padding:14px; }
.study-kpi span { display:block; color:var(--text-muted); font-size:.62rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:6px; }
.study-kpi strong { font-size:1.02rem; line-height:1.3; }
.study-section h3 { font-size:.88rem; margin-bottom:10px; color:#fff; }
.study-section ul { padding-left:18px; display:grid; gap:5px; }
.study-columns { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.before-after { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.scenario { min-height:220px; border-radius:12px; overflow:hidden; position:relative; background:#111827; border:1px solid var(--border-subtle); }
.scenario img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.scenario span { position:absolute; left:10px; bottom:10px; padding:4px 8px; background:rgba(0,0,0,.58); border-radius:99px; font-size:.72rem; }
.fallback-before { background:linear-gradient(135deg,#404040,#737373 45%,#27272a); }
.fallback-before::before { content:"Aparcamiento duro, baja sombra y recorrido poco legible"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; color:#e5e7eb; text-align:center; background:repeating-linear-gradient(45deg,rgba(255,255,255,.05) 0 12px,transparent 12px 24px); }
.fallback-after { background:linear-gradient(135deg,#0f5132,#22c55e 45%,#67e8f9); }
.fallback-after::before { content:"Bosque urbano, rutas activas, deporte libre y drenaje sostenible"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; color:#052e16; font-weight:700; text-align:center; background:radial-gradient(circle at 25% 35%,rgba(255,255,255,.35),transparent 18%),radial-gradient(circle at 70% 55%,rgba(255,255,255,.22),transparent 22%); }
.projection-chart { width:100%; height:160px; background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.018)); border-radius:12px; padding:10px; overflow:visible; }
.premium-chart { border:1px solid var(--border-subtle); }
.evidence-pills { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.evidence-pills span { font-size:.64rem; color:#fff; background:rgba(255,255,255,.08); border:1px solid var(--border-subtle); padding:5px 8px; border-radius:999px; }
.impact-bars { display:grid; gap:10px; }
.impact-row { display:grid; grid-template-columns:minmax(120px,1fr) 44%; gap:10px; align-items:center; color:var(--text-secondary); font-size:.76rem; }
.impact-track { height:8px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; }
.impact-track i { display:block; height:100%; border-radius:999px; }
.roadmap { display:grid; gap:10px; }
.roadmap div { display:grid; grid-template-columns:82px 1fr; gap:10px; align-items:start; }
.roadmap strong { color:#fff; font-family:'JetBrains Mono',monospace; }
.roadmap span { color:var(--text-secondary); font-size:.78rem; line-height:1.45; }
.funding-stack { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.funding-stack div { min-height:74px; border-radius:10px; background:rgba(255,255,255,.055); border:1px solid var(--border-subtle); display:flex; flex-direction:column; justify-content:center; align-items:center; }
.funding-stack span { color:var(--text-muted); font-size:.62rem; text-transform:uppercase; letter-spacing:.07em; }
.funding-stack strong { font-size:1.25rem; margin-top:4px; }
.overview-hero { display:grid; grid-template-columns:1fr 150px; gap:18px; align-items:center; min-height:190px; padding:20px; border-radius:16px; background:linear-gradient(135deg,rgba(16,185,129,.18),rgba(59,130,246,.12),rgba(249,115,22,.08)); border:1px solid rgba(255,255,255,.14); }
.overview-hero h3 { font-size:1.65rem; line-height:1.15; max-width:780px; margin:6px 0 10px; }
.overview-hero p { color:var(--text-secondary); line-height:1.55; max-width:780px; }
.overview-score { width:132px; height:132px; border-radius:50%; background:rgba(0,0,0,.38); border:1px solid rgba(255,255,255,.18); display:flex; flex-direction:column; justify-content:center; align-items:center; box-shadow:inset 0 0 40px rgba(16,185,129,.18); }
.overview-score span { font-size:3rem; font-weight:800; color:#fff; line-height:1; }
.overview-score small { color:var(--text-muted); text-transform:uppercase; font-size:.58rem; letter-spacing:.08em; margin-top:6px; }
.overview-cards { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; }
.overview-card { border:1px solid color-mix(in srgb,var(--accent),transparent 58%); background:linear-gradient(180deg,color-mix(in srgb,var(--accent),transparent 88%),rgba(255,255,255,.035)); color:#fff; border-radius:12px; padding:12px; text-align:left; cursor:pointer; min-height:132px; display:flex; flex-direction:column; gap:8px; }
.overview-card span { font-size:1.55rem; }
.overview-card strong { font-size:.82rem; line-height:1.25; }
.overview-card small { color:var(--text-secondary); line-height:1.35; }

@media (max-width: 768px) {
  .study-panel { top:58px; left:8px; right:8px; bottom:96px; }
  .study-grid, .study-columns, .before-after, .overview-hero, .overview-cards { grid-template-columns:1fr; }
  .overview-score { width:110px; height:110px; }
}

/* ─── MISSING KEYFRAMES (referenced in script) ────────────────────── */
@keyframes piezoGlow {
  0%,100% { box-shadow: 0 0 8px rgba(234,179,8,0.4), 0 2px 8px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 0 7px rgba(234,179,8,0.14), 0 0 22px rgba(234,179,8,0.5), 0 2px 8px rgba(0,0,0,0.5); }
}
@keyframes markerBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ─── STUDY PANEL — SLIDE-IN ANIMATION ───────────────────────────── */
.study-panel {
  opacity: 0;
  transform: translateY(18px) scale(0.978);
  transition: opacity 0.38s ease, transform 0.44s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}
.study-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ─── CHART LINE DRAW ANIMATION ───────────────────────────────────── */
.projection-line {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: drawLine 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.chart-dot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: dotPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes dotPop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── SECTION STAGGERED ENTRANCE ──────────────────────────────────── */
.study-hero {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.46s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: 0.04s;
}
.study-panel.open .study-hero { opacity: 1; transform: none; }

.study-grid .study-kpi {
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 0.38s ease, transform 0.44s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.2s;
  cursor: default;
}
.study-panel.open .study-grid .study-kpi          { opacity: 1; transform: none; }
.study-panel.open .study-grid .study-kpi:nth-child(1) { transition-delay: 0.12s; }
.study-panel.open .study-grid .study-kpi:nth-child(2) { transition-delay: 0.2s; }
.study-panel.open .study-grid .study-kpi:nth-child(3) { transition-delay: 0.28s; }
.study-kpi:hover { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04)); }

.overview-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.36s ease, transform 0.42s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.study-panel.open .overview-card { opacity: 1; transform: translateY(0); }
.study-panel.open .overview-card:nth-child(1) { transition-delay: 0.18s; }
.study-panel.open .overview-card:nth-child(2) { transition-delay: 0.26s; }
.study-panel.open .overview-card:nth-child(3) { transition-delay: 0.34s; }
.study-panel.open .overview-card:nth-child(4) { transition-delay: 0.42s; }
.study-panel.open .overview-card:nth-child(5) { transition-delay: 0.50s; }
.overview-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent), transparent 52%);
  border-color: color-mix(in srgb, var(--accent), transparent 32%) !important;
}

/* ─── ANIMATED IMPACT BARS ────────────────────────────────────────── */
.impact-track i {
  width: 0 !important;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.study-panel.open .impact-track i { width: var(--w, 70%) !important; }

/* ─── ROADMAP STAGGER ─────────────────────────────────────────────── */
.roadmap > div {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.38s ease, transform 0.44s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.study-panel.open .roadmap > div              { opacity: 1; transform: none; }
.study-panel.open .roadmap > div:nth-child(1) { transition-delay: 0.22s; }
.study-panel.open .roadmap > div:nth-child(2) { transition-delay: 0.37s; }
.study-panel.open .roadmap > div:nth-child(3) { transition-delay: 0.52s; }

/* ─── FUNDING STACK STAGGER ───────────────────────────────────────── */
.funding-stack > div {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.study-panel.open .funding-stack > div              { opacity: 1; transform: none; }
.study-panel.open .funding-stack > div:nth-child(1) { transition-delay: 0.25s; }
.study-panel.open .funding-stack > div:nth-child(2) { transition-delay: 0.35s; }
.study-panel.open .funding-stack > div:nth-child(3) { transition-delay: 0.45s; }

/* ─── OVERVIEW SCORE PULSE ────────────────────────────────────────── */
@keyframes scoreGlow {
  0%,100% { box-shadow: inset 0 0 40px rgba(16,185,129,.18); }
  50%      { box-shadow: inset 0 0 65px rgba(16,185,129,.34), 0 0 26px rgba(16,185,129,.16); }
}
.overview-score { animation: scoreGlow 3.5s ease-in-out infinite; }

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 9000; display: flex; flex-direction: column; align-items: center;
  gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: 100px;
  background: rgba(3,7,18,0.94); border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-size: .76rem; font-weight: 500; color: #fff; white-space: nowrap;
  animation: toastIn 0.4s cubic-bezier(0.22,0.61,0.36,1) forwards;
}
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
@keyframes toastIn {
  from { opacity:0; transform:translateY(14px) scale(.94); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity:0; transform:translateY(8px) scale(.94); }
}

/* ─── CLOSE BUTTON — proper × icon via CSS ────────────────────────── */
.btn-close svg { display: block; }

/* ─── INTERVENTION MARKER — SVG centered ─────────────────────────── */
.intervention-marker svg { display: block; pointer-events: none; }

/* ─── MAP MARKER SVG INSIDE DOM markers ──────────────────────────── */
.vend-marker svg, .piezo-marker svg { display: block; pointer-events: none; }


/* ═══════════════════════════════════════════════════════════════════════
   ██████  PREMIUM VISUAL UPGRADE — HACKATHON EDITION  ██████
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── CINEMATIC MAP VIGNETTE ──────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0,0,0,0.62) 100%);
  pointer-events: none;
  z-index: 4;
}

/* ─── GLASS UPGRADE — richer backdrop ────────────────────────────── */
.liquid-glass {
  background: rgba(2, 4, 14, 0.74) !important;
  backdrop-filter: blur(22px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 8px 40px rgba(0,0,0,0.55) !important;
}

/* ─── LOGO — animated gradient shimmer ───────────────────────────── */
.nav-logo {
  background: linear-gradient(100deg, #e2e8f0 0%, #10b981 28%, #06b6d4 52%, #8b5cf6 72%, #e2e8f0 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 6s ease-in-out infinite;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}
.nav-logo .accent { -webkit-text-fill-color: transparent; }
@keyframes logoShimmer {
  0%,100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* ─── TOP BAR — sharper pill ─────────────────────────────────────── */
.top-bar {
  border: 1px solid rgba(255,255,255,0.11) !important;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 12px 40px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.12) !important;
}
.top-subtitle {
  font-size: .68rem !important;
  color: rgba(255,255,255,0.3) !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
}
.btn-icon { letter-spacing: 0.04em !important; font-size: .7rem !important; }

/* ─── PANEL LABEL ─────────────────────────────────────────────────── */
.panel-label {
  font-size: .55rem !important;
  color: rgba(255,255,255,0.28) !important;
  letter-spacing: 0.16em;
}

/* ─── LAYER BUTTONS — per-color accent states ────────────────────── */
.layer-btn { font-size: .76rem !important; letter-spacing: 0.01em; transition: all .18s ease !important; }
.layer-btn[data-layer="vulnerabilidad"]:hover { background:rgba(239,68,68,.1) !important; border-color:rgba(239,68,68,.3) !important; color:#ef4444 !important; }
.layer-btn[data-layer="vulnerabilidad"].active { background:rgba(239,68,68,.13) !important; border-color:rgba(239,68,68,.38) !important; color:#ef4444 !important; box-shadow:0 0 12px rgba(239,68,68,.1) !important; }
.layer-btn[data-layer="termico"]:hover { background:rgba(249,115,22,.1) !important; border-color:rgba(249,115,22,.3) !important; color:#f97316 !important; }
.layer-btn[data-layer="termico"].active { background:rgba(249,115,22,.13) !important; border-color:rgba(249,115,22,.38) !important; color:#f97316 !important; box-shadow:0 0 12px rgba(249,115,22,.1) !important; }
.layer-btn[data-layer="alimentario"]:hover { background:rgba(16,185,129,.1) !important; border-color:rgba(16,185,129,.3) !important; color:var(--emerald) !important; }
.layer-btn[data-layer="caminabilidad"]:hover { background:rgba(59,130,246,.1) !important; border-color:rgba(59,130,246,.3) !important; color:var(--blue) !important; }
.layer-btn[data-layer="caminabilidad"].active { background:rgba(59,130,246,.13) !important; border-color:rgba(59,130,246,.38) !important; color:var(--blue) !important; box-shadow:0 0 12px rgba(59,130,246,.1) !important; }
.layer-btn[data-layer="piezo"]:hover { background:rgba(234,179,8,.1) !important; border-color:rgba(234,179,8,.3) !important; color:var(--yellow) !important; }
.layer-btn[data-layer="piezo"].active { background:rgba(234,179,8,.13) !important; border-color:rgba(234,179,8,.38) !important; color:var(--yellow) !important; }

/* ─── BTN CONGRESS — hover glow ──────────────────────────────────── */
.btn-congress:not(:disabled):hover { box-shadow: 0 0 18px rgba(16,185,129,0.28), 0 0 0 2px rgba(16,185,129,0.12) !important; }

/* ─── VSTAT ───────────────────────────────────────────────────────── */
.vstat { background: rgba(255,255,255,0.03) !important; border: 1px solid rgba(255,255,255,0.07) !important; }
.vstat-val { font-size: 1rem !important; color: var(--emerald) !important; text-shadow: 0 0 12px rgba(16,185,129,0.4); }

/* ─── METRIC CARDS ────────────────────────────────────────────────── */
.metric-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.065), rgba(255,255,255,0.018)) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 10px !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.25s ease !important;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  pointer-events: none;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important; }
.metric-label { font-size: .55rem !important; letter-spacing: 0.1em; }
.metric-value { font-size: 1.08rem !important; }
.metric-bar { height: 4px !important; margin-top: 8px !important; border-radius: 4px !important; }
.metric-bar-fill { border-radius: 4px !important; box-shadow: 0 0 6px currentColor; }

/* ─── SUGGESTION CARDS ────────────────────────────────────────────── */
.suggestion-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  position: relative;
}
.suggestion-card:hover { transform: translateY(-1px); }
.suggestion-card.priority-high:hover   { box-shadow: -3px 0 0 var(--red),    0 4px 16px rgba(239,68,68,.12) !important; }
.suggestion-card.priority-medium:hover { box-shadow: -3px 0 0 var(--orange), 0 4px 16px rgba(249,115,22,.12) !important; }
.suggestion-card.priority-low:hover    { box-shadow: -3px 0 0 var(--emerald),0 4px 16px rgba(16,185,129,.12) !important; }
.suggestion-title { font-size: .75rem !important; font-weight: 700 !important; }
.suggestion-badge { font-size: .5rem !important; padding: 2px 7px !important; }

/* ─── ANALYSIS PANEL ──────────────────────────────────────────────── */
.analysis-header { background: linear-gradient(90deg, rgba(59,130,246,.1), rgba(59,130,246,.025)) !important; }
.analysis-icon { font-size: 1rem !important; }
.analysis-title { font-size: .8rem !important; color: #60a5fa !important; letter-spacing: 0.01em; }

/* ─── AI CHAT ─────────────────────────────────────────────────────── */
.ai-msg.user { background: rgba(59,130,246,.18) !important; }
.ai-chat-input-wrapper input { border-radius: 8px !important; background: rgba(255,255,255,.04) !important; }
.ai-chat-input-wrapper button { border-radius: 8px !important; background: #3b82f6 !important; }

/* ─── CONGRESS POPUP ──────────────────────────────────────────────── */
.congress-popup {
  border: 1px solid rgba(255,255,255,.1) !important;
  background: rgba(2,5,16,.82) !important;
}
.popup-title { font-size: .84rem !important; letter-spacing: 0.02em; }

@keyframes agentThinking {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0);   border-color: rgba(16,185,129,.35); }
  50%      { box-shadow: 0 0 0 4px rgba(16,185,129,.1); border-color: rgba(16,185,129,.65); }
}
.ai-agent.thinking { animation: agentThinking 1.5s ease-in-out infinite !important; }
.ai-agent.done { border-color: rgba(16,185,129,.28) !important; }

.agent-avatar { border-radius: 8px !important; width: 30px !important; height: 30px !important; }
.agent-name   { font-size: .72rem !important; font-weight: 600; letter-spacing: 0.01em; }

.congress-log {
  background: rgba(0,0,0,.45) !important;
  border-color: rgba(255,255,255,.06) !important;
  font-size: .68rem !important;
}
.log-entry .timestamp { color: rgba(255,255,255,.22) !important; }
.log-entry .message   { color: rgba(255,255,255,.72) !important; }

/* ─── STUDY PANEL UPGRADE ─────────────────────────────────────────── */
.study-panel {
  border-top: 2px solid var(--panel-accent, var(--emerald)) !important;
  background: rgba(2,5,16,.84) !important;
}
.study-top {
  background: linear-gradient(90deg, rgba(255,255,255,.055), rgba(255,255,255,.01)) !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  padding: 16px 22px !important;
}
.study-top h2 {
  font-size: 1.18rem !important;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,.72));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.analysis-section-label { font-size: .56rem !important; color: rgba(255,255,255,.3) !important; letter-spacing: 0.14em; }

/* Study section headers with extending rule */
.study-section h3 {
  font-size: .68rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,.4) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px !important;
}
.study-section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.1), transparent);
}

/* Study section cards */
.study-section {
  background: linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.014)) !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  transition: border-color .22s ease;
}
.study-section:hover { border-color: rgba(255,255,255,.12) !important; }
.study-section p, .study-section li { font-size: .8rem !important; line-height: 1.65 !important; }
.study-section ul { gap: 7px !important; }
.study-section li::marker { color: rgba(255,255,255,.3); }

/* Study KPI — centred + stronger hierarchy */
.study-kpi {
  text-align: center;
  padding: 20px 14px !important;
  position: relative;
  overflow: hidden;
}
.study-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.24), transparent);
}
.study-kpi span  { font-size: .57rem !important; display: block; margin-bottom: 8px !important; color: rgba(255,255,255,.38) !important; letter-spacing: 0.1em; }
.study-kpi strong {
  font-size: 1.08rem !important;
  line-height: 1.3 !important;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.7) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ─── STUDY HERO ──────────────────────────────────────────────────── */
.study-hero {
  position: relative;
  overflow: hidden;
}
.study-hero::after {
  content: '';
  position: absolute;
  top: -80%; right: -15%;
  width: 340px; height: 340px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #10b981), transparent 55%), transparent 70%);
  pointer-events: none;
}
.study-icon {
  width: 58px !important; height: 58px !important;
  border-radius: 14px !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 12px 28px rgba(0,0,0,.45), 0 0 24px var(--accent, transparent) !important;
}
.study-place { font-size: .68rem !important; letter-spacing: 0.1em; }
.premium-hero h3 { font-size: 1.3rem !important; font-weight: 800; letter-spacing: -0.01em; }

/* ─── OVERVIEW HERO — animated grid overlay ──────────────────────── */
.overview-hero {
  background: linear-gradient(135deg,
    rgba(16,185,129,.22) 0%,
    rgba(59,130,246,.15) 40%,
    rgba(139,92,246,.1) 70%,
    rgba(249,115,22,.07) 100%) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  min-height: 175px !important;
  position: relative;
  overflow: hidden;
}
.overview-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  border-radius: inherit;
  pointer-events: none;
}
.overview-hero::after {
  content: '';
  position: absolute;
  top: -50%; right: -8%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(16,185,129,.16), transparent 70%);
  pointer-events: none;
}
.overview-hero h3 {
  font-size: 1.42rem !important;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.overview-hero p { font-size: .82rem !important; color: rgba(255,255,255,.55) !important; }

/* ─── OVERVIEW SCORE — spinning conic border ─────────────────────── */
.overview-score {
  position: relative;
  isolation: isolate;
  animation: scoreGlow 3.5s ease-in-out infinite !important;
}
.overview-score::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) 0%, #06b6d4 30%, #8b5cf6 60%, var(--emerald) 100%);
  animation: rotateBorder 6s linear infinite;
  z-index: -1;
}
.overview-score::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #020810;
  z-index: -1;
}
@keyframes rotateBorder { to { transform: rotate(360deg); } }
.overview-score span { font-size: 2.8rem !important; font-weight: 900 !important; letter-spacing: -0.03em !important; }
.overview-score small { font-size: .54rem !important; letter-spacing: 0.1em; color: rgba(255,255,255,.38) !important; }

/* ─── OVERVIEW CARDS ──────────────────────────────────────────────── */
.overview-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), transparent 82%), color-mix(in srgb, var(--accent), transparent 92%), rgba(255,255,255,.02)) !important;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 52%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: all 0.22s cubic-bezier(0.22,0.61,0.36,1) !important;
}
/* Icon box for emoji */
.overview-card > span:first-child {
  width: 40px; height: 40px;
  background: color-mix(in srgb, var(--accent), transparent 80%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 62%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}
.overview-card strong { font-size: .82rem !important; line-height: 1.3 !important; font-weight: 700; }
.overview-card small  { font-size: .68rem !important; color: rgba(255,255,255,.45) !important; }

/* ─── PROJECTION CHART — area fill via gradient ───────────────────── */
.projection-chart {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent) !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.06) !important;
}

/* ─── IMPACT BARS ─────────────────────────────────────────────────── */
.impact-track { height: 10px !important; border-radius: 999px !important; }
.impact-row span { font-size: .74rem !important; }
.impact-row { gap: 12px !important; }

/* ─── ROADMAP ─────────────────────────────────────────────────────── */
.roadmap > div {
  border-left: 2px solid rgba(255,255,255,.08);
  padding-left: 14px !important;
  gap: 12px !important;
}
.roadmap strong { font-size: .8rem !important; color: var(--emerald) !important; text-shadow: 0 0 10px rgba(16,185,129,.35); }
.roadmap span { font-size: .77rem !important; color: rgba(255,255,255,.55) !important; }

/* ─── FUNDING STACK ───────────────────────────────────────────────── */
.funding-stack > div {
  min-height: 78px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease;
}
.funding-stack > div:hover { transform: translateY(-2px); }
.funding-stack > div::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%; height: 2px;
  border-radius: 0 0 4px 4px;
}
.funding-stack > div:nth-child(1)::before { background: linear-gradient(90deg, transparent, var(--emerald), transparent); }
.funding-stack > div:nth-child(2)::before { background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.funding-stack > div:nth-child(3)::before { background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.funding-stack strong { font-size: 1.5rem !important; font-weight: 900 !important; letter-spacing: -0.02em; }
.funding-stack span { font-size: .6rem !important; letter-spacing: 0.1em; }

/* ─── EVIDENCE PILLS ──────────────────────────────────────────────── */
.evidence-pills span {
  font-size: .64rem !important;
  padding: 5px 10px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: rgba(255,255,255,.65) !important;
  transition: all .2s ease;
  cursor: default;
}
.evidence-pills span:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }

/* ─── BEFORE/AFTER LABELS ─────────────────────────────────────────── */
.scenario span {
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  font-size: .68rem !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px !important;
}

/* ─── LEGEND ──────────────────────────────────────────────────────── */
.legend-panel { border: 1px solid rgba(255,255,255,.07) !important; }
.legend-title  { color: rgba(255,255,255,.28) !important; }
.legend-color  { height: 6px !important; border-radius: 4px !important; position: relative; overflow: hidden; }
.legend-color::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
.legend-item { font-size: .68rem !important; }

/* ─── INTERVENTION MARKERS — better sphere + hover ───────────────── */
.intervention-marker {
  width: 50px !important; height: 50px !important;
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--marker-color), transparent 84%),
    0 0 0 14px color-mix(in srgb, var(--marker-color), transparent 93%),
    0 20px 42px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -2px 6px rgba(0,0,0,.35) !important;
}
.intervention-marker:hover {
  filter: brightness(1.22) saturate(1.15) drop-shadow(0 0 10px color-mix(in srgb, var(--marker-color), transparent 40%));
  transition: filter .18s ease !important;
}

/* ─── MAP CONTROLS ────────────────────────────────────────────────── */
.maplibregl-ctrl-group {
  border-radius: 12px !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button { transition: background .15s ease !important; }

/* ─── POPUP UPGRADE ───────────────────────────────────────────────── */
.maplibregl-popup-content {
  border: 1px solid rgba(255,255,255,.1) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.5) !important;
  background: rgba(2,5,16,.9) !important;
}
.popup-heading { font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0.01em; }
.popup-tag { font-size: 10px !important; letter-spacing: 0.04em; }
.popup-rows { font-size: 11.5px !important; }
.popup-roi-value { font-size: 1.15rem !important; }

/* ─── LOADING SCREEN ──────────────────────────────────────────────── */
.loading-overlay p {
  animation: textPulse 2.2s ease-in-out infinite;
  letter-spacing: 0.1em;
  font-size: .78rem !important;
}
@keyframes textPulse {
  0%,100% { opacity: .35; }
  50%      { opacity: 1; }
}
.spinner-ring:nth-child(1) { border-top-color: var(--emerald) !important; border-right-color: rgba(16,185,129,0.15) !important; border-bottom-color: rgba(16,185,129,0.15) !important; border-left-color: rgba(16,185,129,0.15) !important; }
.spinner-ring:nth-child(2) { border-right-color: var(--cyan) !important; border-top-color: rgba(6,182,212,0.15) !important; border-bottom-color: rgba(6,182,212,0.15) !important; border-left-color: rgba(6,182,212,0.15) !important; }
.spinner-ring:nth-child(3) { border-bottom-color: var(--orange) !important; border-top-color: rgba(249,115,22,0.15) !important; border-right-color: rgba(249,115,22,0.15) !important; border-left-color: rgba(249,115,22,0.15) !important; }

/* ─── DRAW HINT BANNER ────────────────────────────────────────────── */
.draw-hint-banner { backdrop-filter: blur(22px) !important; }
.btn-finish-draw { border-radius: 8px !important; font-size: .72rem !important; letter-spacing: 0.03em; }

/* ─── SCROLLBAR ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ─── CLIMATE AGENT AVATAR ────────────────────────────────────────── */
.agent-avatar.climate { background: linear-gradient(135deg, #f97316, #dc2626); }

/* ─── CONGRESS PROGRESS BAR ───────────────────────────────────────── */
.congress-progress-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px;
}
.congress-progress-bar {
  flex: 1; height: 3px; background: rgba(255,255,255,.07);
  border-radius: 3px; overflow: hidden;
  position: relative;
}
.congress-progress-bar::after {
  content: '';
  position: absolute; inset-block: 0; left: 0;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  border-radius: 3px;
  width: var(--progress, 0%);
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.congress-progress-label {
  font-size: .56rem; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); white-space: nowrap;
}

/* ─── TOP CITY SCORE ──────────────────────────────────────────────── */
.top-city-score {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
}
.tcs-label {
  font-size: .56rem; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted);
}
.tcs-val {
  font-family: 'JetBrains Mono', monospace; font-size: .82rem;
  font-weight: 700; color: var(--emerald);
  text-shadow: 0 0 10px rgba(16,185,129,.4);
  min-width: 28px;
}

/* ─── STUDY PANEL DOWNLOAD BUTTON ─────────────────────────────────── */
.btn-download {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 8px;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.28);
  color: var(--emerald); font-size: .7rem; font-weight: 600;
  cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.btn-download:hover {
  background: rgba(16,185,129,.2);
  box-shadow: 0 0 12px rgba(16,185,129,.2);
}
.btn-download svg { flex-shrink: 0; }

/* ─── AI CHAT TYPING BUBBLE ───────────────────────────────────────── */
.ai-msg.typing-bubble {
  display: flex; align-items: center; gap: 3px; padding: 10px 14px;
}
.ai-msg.typing-bubble span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}
.ai-msg.typing-bubble span:nth-child(2) { animation-delay: .2s; }
.ai-msg.typing-bubble span:nth-child(3) { animation-delay: .4s; }

/* ─── QUICK-REPLY CHIPS ───────────────────────────────────────────── */
.quick-replies {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.quick-reply {
  font-size: .62rem; padding: 3px 9px; border-radius: 20px;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.28);
  color: var(--blue); cursor: pointer; transition: all .18s ease;
  white-space: nowrap;
}
.quick-reply:hover { background: rgba(59,130,246,.22); }

/* ─── ODS BADGES ─────────────────────────────────────────────────── */
.ods-section {
  margin: 10px 0 6px;
}
.ods-label {
  font-size: .52rem; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.35); font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}
.ods-strip {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.ods-badge {
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--ods-color) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--ods-color) 45%, transparent);
  border-radius: 8px;
  padding: 5px 10px 5px 6px;
  cursor: default;
  transition: background .18s ease, transform .15s ease;
}
.ods-badge:hover {
  background: color-mix(in srgb, var(--ods-color) 30%, transparent);
  transform: translateY(-1px);
}
.ods-num {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--ods-color);
  color: #fff; font-size: .65rem; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: -.02em;
}
.ods-title {
  font-size: .6rem; font-weight: 600; color: rgba(255,255,255,.82);
  white-space: nowrap;
}

/* ─── RADAR CHART + BEFORE/AFTER ─────────────────────────────────── */
.study-insight {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 4px;
}
.radar-wrap {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.014));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 12px 6px 10px;
  overflow: visible;
}
.radar-title {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.55); font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px; font-weight: 600;
}
.radar-svg { display: block; overflow: visible; }

.ba-chart { display: flex; flex-direction: column; gap: 11px; }
.ba-item-label {
  font-size: .68rem; color: rgba(255,255,255,.75); margin-bottom: 5px;
  font-weight: 600; letter-spacing: .01em;
}
.ba-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.ba-tag {
  font-size: .56rem; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .04em;
  color: rgba(239,68,68,.9); width: 40px; flex-shrink: 0; font-weight: 600;
}
.ba-tag.after { color: rgba(255,255,255,.4); }
.ba-track {
  flex: 1; height: 9px; border-radius: 5px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.ba-fill {
  height: 100%; border-radius: 5px;
  width: 0;
  transition: width 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.study-panel.open .ba-fill { width: var(--bw); }
.ba-val {
  font-size: .68rem; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; min-width: 42px; text-align: right; flex-shrink: 0;
}
.ba-val.good { color: var(--emerald); }
.ba-val.bad  { color: #f87171; }

@media (max-width: 768px) {
  .study-insight { grid-template-columns: 1fr; }
  .radar-wrap { flex-direction: row; gap: 10px; }
}

/* ─── PLAN TIMELINE (floating window) ────────────────────────────── */
.plan-timeline {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(180px);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  width: min(740px, calc(100vw - 320px));
  min-width: 480px;
  height: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset;
  transition: transform 0.52s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.38s ease;
}
.plan-timeline.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}
.plan-timeline.collapsed { height: 34px; overflow: hidden; }
.plan-timeline.collapsed .pt-rows { opacity: 0; pointer-events: none; }

.pt-header {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; height: 22px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding-bottom: 8px; margin-bottom: 2px;
}
.pt-title {
  font-size: .58rem; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.5); white-space: nowrap;
  flex: 1;
}
.pt-drag-hint {
  font-size: .48rem; color: rgba(255,255,255,.18);
  font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
  margin-right: auto;
}
.pt-years-track {
  flex: 1; position: relative; height: 16px;
}
.pt-year-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: .5rem; color: rgba(255,255,255,.22);
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}
.pt-year-tick::after {
  content: ''; position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 3px; background: rgba(255,255,255,.12);
}
.pt-now-line {
  position: absolute; top: -2px; height: 80px;
  width: 1.5px; background: rgba(255,165,0,.45);
  z-index: 3;
}
.pt-now-dot {
  position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: #fb923c; box-shadow: 0 0 8px rgba(251,146,60,.7);
}
.pt-now-label {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  font-size: .44rem; color: #fb923c;
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}
.pt-toggle {
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.38); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: all .18s ease; flex-shrink: 0;
  font-family: monospace;
}
.pt-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }

.pt-rows {
  display: flex; flex-direction: column; gap: 2px;
  transition: opacity .3s ease;
}
.pt-row {
  display: grid; grid-template-columns: 16px 126px 1fr; gap: 7px;
  align-items: center; cursor: pointer;
  transition: opacity .2s ease;
}
.pt-row:hover { opacity: .8; }
.pt-row-icon { font-size: 11px; text-align: center; line-height: 1; }
.pt-row-label { font-size: .62rem; color: rgba(255,255,255,.55); white-space: nowrap; font-weight: 500; }

.pt-row-track {
  position: relative; height: 10px;
  background: rgba(255,255,255,.04);
  border-radius: 3px; overflow: visible;
}
.pt-bar {
  position: absolute; top: 0; height: 100%; border-radius: 3px;
  background: var(--color); left: var(--start);
  width: 0; opacity: 0.7;
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pt-bar.show { width: var(--width); }

.pt-phase-label {
  position: absolute; top: -14px; left: var(--pos);
  transform: translateX(-50%);
  font-size: .42rem; color: rgba(255,255,255,.28);
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
  pointer-events: none;
}
.pt-phase-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  left: var(--pos); width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,.5); z-index: 2; pointer-events: none;
}

/* Close button inside timeline */
.pt-close {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.35); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; transition: all .18s ease; margin-left: 4px;
}
.pt-close:hover { background: rgba(239,68,68,.25); color: #f87171; border-color: rgba(239,68,68,.35); }

@media (max-width: 768px) {
  .plan-timeline { display: none !important; }
}
