/* ── TOMORROW.IO DESIGN TOKENS ─────────────────────────────────────── */
:root, [data-color-theme="classic"] {
  --bg-0: #06051e;
  --bg-1: #131224;
  --bg-2: #1e2036;
  --bg-3: #2b2949;
  --bg-4: #3b3a5e;
  --content-1: #f4f4f4;
  --content-2: #a8a8a8;
  --content-3: #888888;
  --content-4: #575757;
  --border-0: #56546e;
  --border-1: #43415e;
  --border-2: #302f4f;
  --accent: #0072f5;
  --accent-hover: #0f7fff;
  --accent-deemphasized: rgba(0,114,245,0.18);
  --highlight: rgb(150,147,212);
  --highlight-selected: rgba(150,147,212,0.12);
  --bg-success: #4dceb0;
  --bg-warning: #ff705c;
  --brand-gradient: linear-gradient(90deg, #ff705c, #ec7172 17%, #ba74ac 53%, #7479ff);
  --sev-0: #8fa8ff;
  --sev-1: #ffb345;
  --sev-2: #fe782c;
  --sev-3: #ff5449;
  --sev-4: #ce0025;
  --shadow-card: 0 3px 12px rgba(0,0,0,0.40);
  --topbar-h: 48px;
  --bottom-panel-h: 214px;
  --right-panel-w: 360px;
  --side-nav-w: 58px;
}

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

html, body {
  height: 100%; width: 100%;
  font-family: "Muli", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 20px;
  background: var(--bg-0);
  color: var(--content-1);
  overflow: hidden;
}

button { cursor: pointer; font-family: inherit; }
input  { font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(170,170,170,0.28); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(170,170,170,0.45); }

/* ── APP SHELL ─────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--side-nav-w) 1fr;
  height: 100vh; overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border-2);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 2px;
  position: relative; z-index: 20;
  overflow: hidden; width: var(--side-nav-w);
}
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--brand-gradient);
}
.sidebar-logo {
  width: 30px; height: 30px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-btn {
  width: 34px; height: 34px; border-radius: 4px; border: none;
  background: transparent; color: var(--content-3);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s; position: relative;
  flex-shrink: 0; overflow: hidden;
}
.nav-btn:hover { background: var(--bg-3); color: var(--content-2); }
.nav-btn.active { background: var(--highlight-selected); color: var(--highlight); }
.nav-btn.active::before {
  content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px;
  width: 2px; background: var(--highlight); border-radius: 0 2px 2px 0;
}
.nav-btn svg { width: 17px; height: 17px; }
.nav-badge {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px;
  background: var(--sev-3); border-radius: 50%; border: 1.5px solid var(--bg-1);
}
.sidebar-spacer { flex: 1; }

/* ── MAIN ──────────────────────────────────────────────────────────── */
.main {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--bottom-panel-h);
  height: 100vh; overflow: hidden;
}

/* ── ZONE 1: TOP BAR ───────────────────────────────────────────────── */
.topbar {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center;
  padding: 0 10px; gap: 6px;
  position: relative; z-index: 10; overflow: hidden;
}
.topbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--brand-gradient); opacity: 0.45;
}

/* Funnel icon */
.topbar-filter-btn {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: transparent; color: var(--content-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.1s, color 0.1s;
}
.topbar-filter-btn:hover { background: var(--bg-3); color: var(--content-2); }
.topbar-filter-btn svg { width: 13px; height: 13px; }

/* Pill location tabs */
.topbar-tabs {
  display: flex; align-items: center; gap: 4px;
  flex: 1; overflow: hidden; min-width: 0;
}
.topbar-tab {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 20px; padding: 0 6px 0 11px; height: 27px;
  font-size: 11px; font-weight: 600; color: var(--content-2);
  cursor: pointer; flex-shrink: 0; max-width: 210px;
  white-space: nowrap; overflow: hidden;
  transition: background 0.1s, border-color 0.1s;
}
.topbar-tab:hover { background: var(--bg-3); border-color: var(--border-0); }
.topbar-tab.active { background: var(--bg-3); border-color: var(--border-0); color: var(--content-1); }
.topbar-tab-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tab-close {
  flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; border: none;
  background: transparent; color: var(--content-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; transition: background 0.1s, color 0.1s; padding: 0;
}
.topbar-tab-close:hover { background: rgba(255,255,255,0.1); color: var(--content-2); }
.topbar-add-tab {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: transparent; color: var(--content-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; transition: color 0.1s;
}
.topbar-add-tab:hover { color: var(--content-2); }

.bar-sep { width: 1px; height: 18px; background: var(--border-1); flex-shrink: 0; }

.bar-right { margin-left: auto; display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.live-clock {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 11px; color: var(--content-3); letter-spacing: 0.2px;
}

.alert-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,84,73,0.10); border: 1px solid rgba(255,84,73,0.28);
  border-radius: 4px; padding: 0 9px; height: 26px;
  font-size: 10px; font-weight: 700; color: var(--sev-3);
  letter-spacing: 0.4px; text-transform: uppercase;
}

.pulse-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.3; transform:scale(0.7); }
}

.icon-btn {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: transparent; color: var(--content-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn svg { width: 15px; height: 15px; }

.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: white;
  font-size: 9px; font-weight: 900; letter-spacing: 0.3px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}

/* ── ZONE 2: CONTENT AREA ──────────────────────────────────────────── */
.content-area {
  display: flex;
  overflow: hidden; min-height: 0; height: 100%;
}

/* ── MAP PANEL ─────────────────────────────────────────────────────── */
.map-panel { flex: 1; min-width: 0; height: 100%; background: #dde8ec; position: relative; overflow: hidden; isolation: isolate; }

#leaflet-map { width: 100%; height: 100%; }

/* Light map — dark controls for contrast */
.leaflet-control-attribution {
  background: rgba(255,255,255,0.8) !important;
  color: #666 !important; font-size: 9px !important;
}
.leaflet-control-attribution a { color: #444 !important; }
.leaflet-bar {
  border: 1px solid rgba(0,0,0,0.2) !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18) !important;
}
.leaflet-bar a {
  background: var(--bg-1) !important; color: var(--content-2) !important;
  border-bottom: 1px solid var(--border-1) !important;
  width: 26px !important; height: 26px !important;
  line-height: 26px !important; font-size: 14px !important;
}
.leaflet-bar a:hover { background: var(--bg-3) !important; }
.leaflet-bar a:first-child { border-radius: 4px 4px 0 0 !important; }
.leaflet-bar a:last-child  { border-radius: 0 0 4px 4px !important; border-bottom: none !important; }

/* Bottom-left map toolbar */
.map-bl-tools {
  position: absolute; bottom: 36px; left: 12px;
  display: flex; align-items: center; gap: 2px;
  background: var(--bg-1); border: 1px solid var(--border-1);
  border-radius: 6px; padding: 4px;
  z-index: 5; box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.mbt-btn {
  width: 26px; height: 26px; border-radius: 3px; border: none;
  background: transparent; color: var(--content-3);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.mbt-btn:hover { background: var(--bg-3); color: var(--content-2); }
.mbt-btn.active { background: var(--accent-deemphasized); color: var(--accent); }
.mbt-btn svg { width: 13px; height: 13px; }
.mbt-sep { width: 1px; height: 16px; background: var(--border-1); margin: 0 1px; }

.map-loading-text {
  position: absolute; bottom: 14px; left: 12px;
  font-size: 10px; color: #666;
  font-family: "Roboto Mono", monospace;
  z-index: 4; pointer-events: none;
  animation: fadeOut 1.5s ease 2s forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

/* Risk scale gradient */
.map-scale-wrap {
  position: absolute; bottom: 40px; right: 50px;
  z-index: 5; pointer-events: none;
}
.map-scale-bar-gradient {
  width: 96px; height: 5px; border-radius: 3px;
  background: linear-gradient(to right, #0072f5, #4dceb0, #ffb345, #fe782c, #ce0025);
  margin-bottom: 3px;
}
.map-scale-labels {
  display: flex; justify-content: space-between;
  font-size: 8px; color: #555; font-weight: 700;
  font-family: "Roboto Mono", monospace;
}

/* ── RIGHT PANEL ───────────────────────────────────────────────────── */
.right-panel {
  width: var(--right-panel-w); flex-shrink: 0;
  background: var(--bg-1);
  border-left: 1px solid var(--border-2);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}

.rp-loc-header {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border-2); flex-shrink: 0;
}
.rp-pin-svg { width: 12px; height: 12px; flex-shrink: 0; }
.rp-loc-name {
  font-size: 12px; font-weight: 700; color: var(--content-1);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-more-btn {
  width: 20px; height: 20px; border-radius: 3px; border: none;
  background: transparent; color: var(--content-4);
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s; flex-shrink: 0;
}
.rp-more-btn:hover { background: var(--bg-3); color: var(--content-2); }

.rp-weather {
  padding: 16px 12px 14px;
  border-bottom: 1px solid var(--border-2);
  flex-shrink: 0; text-align: center;
}
.rp-weather-icon { font-size: 26px; line-height: 1; display: block; margin-bottom: 6px; }
.rp-temp { font-size: 32px; font-weight: 900; letter-spacing: -1px; line-height: 1; color: var(--content-1); margin-bottom: 4px; }
.rp-condition { font-size: 12px; font-weight: 600; color: var(--content-2); margin-bottom: 2px; }
.rp-wind { font-size: 11px; color: var(--content-3); }

.rp-section {
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--border-2); flex-shrink: 0;
}
.rp-section-title { font-size: 12px; font-weight: 700; color: var(--content-1); margin-bottom: 3px; }
.rp-section-sub { font-size: 11px; color: var(--content-3); line-height: 1.4; }

.rp-insights-card {
  margin: 10px 10px 14px;
  padding: 10px 11px 10px 13px;
  border-left: 3px solid #c084fc;
  background: rgba(192,132,252,0.06);
  border-radius: 0 5px 5px 0; flex-shrink: 0;
}
.rp-insights-label {
  font-size: 8.5px; font-weight: 700; color: #c084fc;
  letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 6px;
}
.rp-insights-body { font-size: 11px; color: var(--content-2); line-height: 1.5; }

.rp-ask-gale-btn {
  display: flex; align-items: center; gap: 5px;
  margin-top: 10px; padding: 0 10px; height: 26px;
  background: var(--accent-deemphasized);
  border: 1px solid rgba(0,114,245,0.3);
  border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.1px;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;  justify-content: center;
}
.rp-ask-gale-btn:hover {
  background: rgba(0,114,245,0.26);
  border-color: rgba(0,114,245,0.5);
}

/* Risk bars (used in future risk view) */
.rbar { margin-bottom: 8px; }
.rbar:last-child { margin-bottom: 0; }
.rbar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 11px; }
.rbar-name { font-weight: 700; }
.rbar-score { font-family: "Roboto Mono", monospace; font-size: 10px; font-weight: 500; }
.rbar-track { height: 3px; background: var(--border-2); border-radius: 2px; overflow: hidden; }
.rbar-fill { height: 100%; border-radius: 2px; transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1); }

/* ── ZONE 3: BOTTOM PANEL (GANTT) ──────────────────────────────────── */
.bottom-panel {
  background: var(--bg-0); border-top: 1px solid var(--border-2);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}

/* Tab bar row */
.bp-tabbar {
  display: flex; align-items: center; height: 38px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-1);
  padding: 0 10px 0 0; gap: 4px;
}

.bp-back-btn {
  height: 38px; padding: 0 12px;
  background: transparent; border: none; border-right: 1px solid var(--border-2);
  color: var(--content-3); font-size: 12px;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.1s; flex-shrink: 0;
}
.bp-back-btn:hover { color: var(--content-1); }

.bp-tabs { display: flex; gap: 0; align-items: stretch; margin-left: 4px; }
.bp-tab {
  padding: 0 14px; height: 38px;
  display: flex; align-items: center;
  font-size: 13px; color: var(--content-3);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.1s; margin-bottom: -1px;
}
.bp-tab.active { color: var(--content-1); font-weight: 700; border-bottom-color: var(--accent); }
.bp-tab:hover:not(.active) { color: var(--content-2); }

.bp-tab-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }

.bp-log-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 9px; height: 26px;
  background: transparent; border: 1px solid var(--border-1);
  border-radius: 4px; font-family: inherit; font-size: 11px; color: var(--content-2);
  transition: border-color 0.1s, color 0.1s;
}
.bp-log-btn:hover { border-color: var(--border-0); color: var(--content-1); }
.bp-log-btn svg { width: 11px; height: 11px; }

.bp-view-btn {
  padding: 0 10px; height: 26px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 4px; font-family: inherit; font-size: 11px;
  font-weight: 700; color: var(--content-1);
  transition: background 0.1s, border-color 0.1s;
}
.bp-view-btn:hover { background: var(--bg-3); border-color: var(--border-0); }

.dw-toggle {
  display: flex; background: var(--bg-2);
  border: 1px solid var(--border-1); border-radius: 4px; overflow: hidden;
}
.dw-btn {
  padding: 0 9px; height: 24px;
  background: transparent; border: none; font-family: inherit;
  font-size: 11px; color: var(--content-3);
  transition: background 0.1s, color 0.1s;
}
.dw-btn.active { background: var(--accent); color: white; font-weight: 700; }
.dw-btn:hover:not(.active) { background: var(--bg-3); color: var(--content-2); }

/* Gantt body */
.bp-gantt { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.gantt-row { flex: 1; display: flex; overflow: hidden; min-height: 0; }

.gantt-loc-col {
  width: 130px; flex-shrink: 0;
  border-right: 1px solid var(--border-2);
  display: flex; align-items: center; padding: 0 12px;
}
.gantt-loc-label {
  font-size: 11px; font-weight: 700; color: var(--content-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gantt-blocks-area {
  flex: 1; position: relative;
  display: grid; grid-template-columns: repeat(6, 1fr);
  align-items: center; padding: 10px 0; overflow: hidden;
}
.gantt-blocks-area::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent calc(100%/6 - 1px),
    rgba(48,47,79,0.45) calc(100%/6 - 1px), rgba(48,47,79,0.45) calc(100%/6)
  );
  pointer-events: none;
}

.gantt-block {
  height: 26px; border-radius: 3px; position: relative; z-index: 1;
  background: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 3px,
    transparent 3px, transparent 9px
  );
  border: 1px solid rgba(255,255,255,0.12);
}
.gantt-block.risk-high {
  background: repeating-linear-gradient(
    45deg, rgba(254,120,44,0.14), rgba(254,120,44,0.14) 3px,
    transparent 3px, transparent 9px
  );
  border-color: rgba(254,120,44,0.28);
}
.gantt-block.risk-critical {
  background: repeating-linear-gradient(
    45deg, rgba(206,0,37,0.16), rgba(206,0,37,0.16) 3px,
    transparent 3px, transparent 9px
  );
  border-color: rgba(206,0,37,0.3);
}

/* Date labels */
.gantt-dates-row {
  height: 28px; flex-shrink: 0; border-top: 1px solid var(--border-1); display: flex;
}
.gantt-dates-spacer { width: 130px; flex-shrink: 0; border-right: 1px solid var(--border-2); }
.gantt-dates-grid { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); }
.gantt-date-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--content-4);
  border-right: 1px solid rgba(48,47,79,0.45); white-space: nowrap;
}
.gantt-date-cell.today-date { color: var(--accent); font-weight: 700; background: rgba(0,114,245,0.05); }

/* Scrubber line + pill */
.gantt-scrubber {
  position: absolute; top: 0; bottom: 28px;
  width: 1.5px; background: var(--accent);
  z-index: 10; pointer-events: none;
}
.gantt-time-pill {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white;
  font-size: 9px; font-weight: 700; letter-spacing: 0.2px;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.gantt-scrubber-handle {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-0);
}

/* Lightning FAB */
.bp-fab {
  position: absolute; bottom: 36px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); border: none; color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,114,245,0.45);
  transition: background 0.1s, transform 0.1s; z-index: 6;
}
.bp-fab:hover { background: var(--accent-hover); transform: scale(1.08); }
.bp-fab svg { width: 15px; height: 15px; }

/* ── GALE AI DRAWER ─────────────────────────────────────────────────── */
.ai-topbar-btn.active { background: var(--accent-deemphasized); color: var(--accent); }

.ai-drawer {
  position: fixed; top: var(--topbar-h); right: 0;
  width: var(--right-panel-w); bottom: 0;
  background: var(--bg-1); border-left: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  z-index: 1000; box-shadow: -8px 0 32px rgba(0,0,0,0.5);
  transform: translateX(100%);
}
.ai-drawer.open { transform: translateX(0); }
.ai-drawer.animated { transition: transform 0.22s cubic-bezier(0.4,0,0.2,1); }

.ai-drawer-header {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 44px;
  border-bottom: 1px solid var(--border-2); flex-shrink: 0;
}
.ai-drawer-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-deemphasized);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ai-drawer-icon svg { width: 13px; height: 13px; }
.ai-drawer-title { font-size: 13px; font-weight: 700; }
.ai-drawer-sub   { font-size: 11px; color: var(--content-3); }
.ai-drawer-live { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bg-success); animation: pulse 2s ease-in-out infinite; }
.live-lbl { font-size: 10px; font-weight: 700; color: var(--bg-success); letter-spacing: 0.5px; }
.ai-drawer-close {
  width: 26px; height: 26px; border-radius: 4px; border: none;
  background: transparent; color: var(--content-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.1s, color 0.1s; margin-left: 6px;
}
.ai-drawer-close:hover { background: var(--bg-3); color: var(--content-1); }
.ai-drawer-close svg { width: 14px; height: 14px; }

/* ── CHAT ───────────────────────────────────────────────────────────── */
.chat-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: 7px; max-width: 92%; animation: msgIn 0.18s ease; }
@keyframes msgIn {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-av {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  font-size: 9px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.msg.ai   .msg-av { background: var(--accent-deemphasized); color: var(--accent); border: 1px solid rgba(0,114,245,0.22); }
.msg.user .msg-av { background: var(--highlight-selected); color: var(--highlight); border: 1px solid rgba(150,147,212,0.22); }
.msg-bub {
  background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 3px 7px 7px 7px;
  padding: 7px 10px; font-size: 12px; line-height: 1.5; color: var(--content-1);
}
.msg.user .msg-bub {
  background: var(--highlight-selected); border-color: rgba(150,147,212,0.18);
  border-radius: 7px 3px 7px 7px;
}
.msg-bub strong { color: var(--accent); font-weight: 700; }
.msg.user .msg-bub strong { color: var(--highlight); }
.msg-bub ul { padding-left: 14px; margin-top: 4px; }
.msg-bub ul li { margin-bottom: 3px; }
.msg-bub .alert-block {
  background: var(--bg-0); border: 1px solid var(--border-1);
  border-radius: 3px; padding: 7px 9px; margin-top: 6px;
  font-family: "Roboto Mono", monospace; font-size: 10px; line-height: 1.75;
  color: var(--content-2); white-space: pre-wrap;
}
.msg-bub .copy-btn {
  display: inline-block; margin-top: 6px; padding: 2px 8px;
  background: var(--accent-deemphasized); border: 1px solid rgba(0,114,245,0.22);
  border-radius: 3px; color: var(--accent); font-family: inherit;
  font-size: 11px; font-weight: 700; cursor: pointer; transition: background 0.1s;
}
.msg-bub .copy-btn:hover { background: rgba(0,114,245,0.28); }
.typing-ind {
  display: flex; align-items: center; gap: 3px;
  padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 3px 7px 7px 7px; width: fit-content;
}
.t-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--content-3);
  animation: tdot 1.2s ease-in-out infinite;
}
.t-dot:nth-child(2) { animation-delay: 0.13s; }
.t-dot:nth-child(3) { animation-delay: 0.26s; }
@keyframes tdot {
  0%,60%,100% { transform:translateY(0); }
  30%          { transform:translateY(-4px); }
}
.chips-row {
  flex-shrink: 0; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px;
  border-top: 1px solid var(--border-2); background: var(--bg-0);
}
.chip {
  padding: 4px 9px; background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 3px; font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--content-2); cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.chip:hover { background: var(--accent-deemphasized); border-color: rgba(0,114,245,0.28); color: var(--accent); }
.chat-input-row {
  flex-shrink: 0; padding: 7px 10px; display: flex; gap: 7px; align-items: center;
  border-top: 1px solid var(--border-2); background: var(--bg-1);
}
.chat-input {
  flex: 1; height: 32px; background: var(--bg-2); border: 1px solid var(--border-1);
  border-radius: 4px; padding: 0 10px; font-size: 12px; color: var(--content-1);
  outline: none; transition: border-color 0.1s;
}
.chat-input::placeholder { color: var(--content-4); }
.chat-input:focus { border-color: var(--accent); }
.send-btn {
  width: 32px; height: 32px; background: var(--accent); border: none;
  border-radius: 4px; color: white; display: flex; align-items: center;
  justify-content: center; transition: background 0.1s; flex-shrink: 0;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn svg { width: 13px; height: 13px; }

/* ── SEVERITY UTILS ─────────────────────────────────────────────────── */
.sev-4  { color: var(--sev-4); }
.sev-3  { color: var(--sev-3); }
.sev-2  { color: var(--sev-2); }
.sev-1  { color: var(--sev-1); }
.sev-0  { color: var(--sev-0); }
.sev-ok { color: var(--bg-success); }
.fill-4  { background: var(--sev-4); }
.fill-3  { background: var(--sev-3); }
.fill-2  { background: var(--sev-2); }
.fill-1  { background: var(--sev-1); }
.fill-0  { background: var(--sev-0); }
.fill-ok { background: var(--bg-success); }
.delta-up   { color: var(--sev-3); }
.delta-down { color: var(--bg-success); }
.delta-flat { color: var(--content-3); }
.ct-4  { background: rgba(206,0,37,0.14); }
.ct-3  { background: rgba(255,84,73,0.12); }
.ct-2  { background: rgba(254,120,44,0.10); }
.ct-1  { background: rgba(255,179,69,0.09); }
.ct-0  { background: rgba(143,168,255,0.07); }
.ct-ok { background: rgba(77,206,176,0.05); }
