:root {
  /* Light minimalist tech — Linear/Vercel vibe */
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-deep: #ededed;

  --fg: #0a0a0a;
  --fg-1: #171717;
  --fg-2: #262626;
  --fg-3: #737373;
  --fg-4: #a3a3a3;

  --line: #ededed;
  --line-2: #e5e5e5;
  --hair: #f0f0f0;

  /* Indigo accent — like Linear */
  --accent: #5b5bd6;
  --accent-deep: #4747c4;
  --accent-soft: #eeeeff;
  --accent-line: #d9d9f5;

  --pos: #10b981;
  --neg: #ef4444;
  --warn: #f59e0b;

  --chart-1: #5b5bd6;
  --chart-2: #0a0a0a;
  --chart-3: #a3a3a3;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;

  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------- DARK THEME ---------- */
[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elev: #141416;
  --bg-soft: #1c1c20;
  --bg-deep: #24242a;

  --fg: #fafafa;
  --fg-1: #ebebeb;
  --fg-2: #c8c8c8;
  --fg-3: #8a8a8a;
  --fg-4: #5a5a5a;

  --line: #222226;
  --line-2: #2a2a30;
  --hair: #1a1a1d;

  --accent: #7272e8;
  --accent-deep: #5757d9;
  --accent-soft: #1a1a2e;
  --accent-line: #2a2a50;

  --chart-1: #7272e8;
  --chart-2: #fafafa;
  --chart-3: #6a6a6a;
}

/* ---------- RTL (Arabic) ---------- */
html[dir="rtl"] body { font-family: 'Geist', 'Noto Naskh Arabic', Tahoma, sans-serif; }
html[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .chat-side { border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .chat-analysis { border-left: none; border-right: 1px solid var(--line); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
input, textarea, select { font-family: inherit; color: inherit; }

.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1, 'zero' 1; }

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
  margin-bottom: 8px;
}
.brand-mark {
  width: 30px; height: 30px;
  background: var(--fg);
  color: var(--bg-elev);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 15px;
  border-radius: 9px;
  letter-spacing: -0.02em;
}
.brand-name { font-weight: 600; letter-spacing: -0.015em; font-size: 14.5px; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; font-weight: 400; }

.nav-label {
  font-size: 11px;
  color: var(--fg-4);
  font-weight: 500;
  padding: 0 10px;
  margin: 14px 0 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg-soft); color: var(--fg); }
.nav-item.active {
  color: var(--fg);
  background: var(--bg-elev);
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0,0,0,0.04);
}
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 600;
  font-family: var(--mono);
}
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.75; flex-shrink: 0; color: var(--fg-3); }
.nav-item.active svg { color: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 120ms ease;
}
.user-chip:hover { background: var(--bg-soft); }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
}
.user-chip .name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.user-chip .role { font-size: 11px; color: var(--fg-3); }

.sidebar-meta {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11.5px;
  color: var(--fg-3);
}
.sidebar-meta .row { display: flex; justify-content: space-between; padding: 3px 0; }
.sidebar-meta .row b { color: var(--fg); font-weight: 600; font-family: var(--mono); }

/* ---------- MAIN ---------- */
.main { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 18px;
}
.topbar-left h1 {
  margin: 0;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg);
}
.topbar-left h1 em { font-style: normal; color: var(--fg); font-weight: 600; }
.topbar-left .path {
  font-size: 11.5px;
  color: var(--fg-3);
  margin-bottom: 2px;
  font-weight: 500;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2);
  padding: 8px 12px;
  border-radius: 12px;
  min-width: 280px;
  background: var(--bg-elev);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { background: none; border: none; outline: none; color: var(--fg); font-size: 13px; width: 100%; }
.search input::placeholder { color: var(--fg-4); }
.search .kbd { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); padding: 2px 6px; background: var(--bg-soft); border-radius: 5px; }
.search svg { color: var(--fg-4); }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--fg-2);
  position: relative;
  transition: background 120ms ease;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; border: 1.5px solid var(--bg); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); border-color: var(--line-2); }
.btn.primary {
  background: var(--fg);
  color: var(--bg-elev);
  border-color: var(--fg);
}
.btn.primary:hover { background: #1a1a1a; border-color: #1a1a1a; }
.btn.ghost { border: none; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }

/* ---------- CONTENT ---------- */
.content {
  padding: 24px 32px 40px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 2fr 1fr; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}
.section-head h2 {
  margin: 0;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.025em;
}
.section-head h2 em { font-style: normal; color: var(--fg); }
.section-head .sub { font-size: 12.5px; color: var(--fg-3); margin-bottom: 4px; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.card:hover { border-color: var(--line-2); }

.card-head {
  padding: 18px 20px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.card-head .sub { font-size: 11.5px; color: var(--fg-3); margin-bottom: 4px; font-weight: 500; }
.card-head h3 {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.card-head h3 em { font-style: normal; color: var(--fg); }

.card-body { padding: 0 20px 20px; }
.card-body.flush { padding: 0; }

.pill-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.pill-tabs button {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-3);
  transition: background 120ms ease, color 120ms ease;
}
.pill-tabs button:hover { color: var(--fg-2); }
.pill-tabs button.active { background: var(--bg-elev); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

/* Easy / Advanced mode switch — prominent control in the top bar */
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  margin-inline-end: 4px;
}
.mode-switch-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 0 8px 0 6px;
}
.mode-switch button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-3);
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.mode-switch button:hover { color: var(--fg-2); }
.mode-switch button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
@media (max-width: 720px) {
  .mode-switch-label { display: none; }
  .mode-switch button { padding: 6px 10px; font-size: 12px; }
}

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  text-transform: capitalize;
}
.tag.pos { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.tag.neg { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag.accent { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }
.tag.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* ---------- KPI ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  transition: border-color 120ms ease;
}
.kpi:hover { border-color: var(--line-2); }
.kpi-label {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-size: 12.5px;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 10px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--fg);
  font-feature-settings: 'tnum' 1;
  margin-bottom: 10px;
}
.kpi-value em { font-style: normal; }
.kpi-value .unit {
  font-size: 12.5px;
  color: var(--fg-3);
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0;
}
.kpi-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-4);
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
}
.kpi-delta.pos { color: #047857; background: #ecfdf5; }
.kpi-delta.neg { color: #b91c1c; background: #fef2f2; }
.kpi-spark { width: 84px; height: 22px; }

/* ---------- MAP ---------- */
.map-card { overflow: hidden; }
.map-canvas {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Leaflet container */
.lmap { position: absolute; inset: 0; z-index: 1; }
.lmap .leaflet-container {
  width: 100%; height: 100%;
  background: #f5f5f0;
  font-family: var(--sans);
  outline: none;
}
.lmap .leaflet-control-zoom {
  border: 1px solid var(--line-2) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  border-radius: 8px !important;
  overflow: hidden;
  margin: 14px !important;
}
.lmap .leaflet-control-zoom a {
  background: rgba(255,255,255,0.95) !important;
  color: var(--fg-1) !important;
  border-bottom: 1px solid var(--line) !important;
  width: 30px !important; height: 30px !important;
  line-height: 30px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}
.lmap .leaflet-control-zoom a:hover { background: var(--bg-soft) !important; }
.lmap .leaflet-control-zoom a:last-child { border-bottom: none !important; }

.lmap-pin-wrap { background: transparent; border: none; }
.lmap-pin {
  position: relative;
  width: 14px; height: 14px;
}
.lmap-pin .dot {
  display: block;
  width: 14px; height: 14px;
  background: var(--fg);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.lmap-pin.luxury .dot { background: var(--accent); }
.lmap-pin:hover { z-index: 1000; }
.lmap-pin:hover .dot { transform: scale(1.35); }
.lmap-pin.active .dot { transform: scale(1.5); box-shadow: 0 0 0 5px rgba(91,91,214,0.25), 0 2px 6px rgba(0,0,0,0.25); }
.lmap-pin .label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: opacity 140ms ease;
}
.lmap-pin:hover .label,
.lmap-pin.active .label { opacity: 1; }

.lmap-district-wrap { background: transparent; border: none; pointer-events: none; }
.lmap-district {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg-2);
  text-align: center;
  text-shadow:
    0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff,
    0 0 8px #fff, 0 0 8px #fff;
  pointer-events: none;
}

/* Map overlays (info pill, legend) need to sit above the Leaflet canvas */
.map-overlay,
.map-legend-bar { z-index: 500; }

.map-overlay {
  position: absolute; top: 16px; left: 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-3);
  line-height: 1.7;
}
.map-overlay .title { color: var(--fg); font-weight: 600; font-family: var(--sans); font-size: 12.5px; margin-bottom: 4px; letter-spacing: -0.01em; }

.map-district-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--fg-4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(255,255,255,0.9);
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
  transition: transform 140ms ease;
}
.map-pin .dot {
  width: 10px; height: 10px;
  background: var(--fg);
  border: 2px solid var(--bg-elev);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 140ms ease;
}
.map-pin.luxury .dot { background: var(--accent); }
.map-pin:hover { z-index: 5; }
.map-pin:hover .dot { transform: scale(1.3); }
.map-pin.active { z-index: 6; }
.map-pin.active .dot { transform: scale(1.4); box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.15); }
.map-pin .label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg-elev);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 140ms ease;
}
.map-pin:hover .label, .map-pin.active .label { opacity: 1; }

.map-legend-bar {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 11px;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 500;
}
.map-legend-bar .item { display: inline-flex; align-items: center; gap: 6px; }
.map-legend-bar .sq { width: 8px; height: 8px; background: var(--fg); border-radius: 50%; }
.map-legend-bar .sq.gold { background: var(--accent); }
.map-legend-bar .sq.out { background: var(--fg-4); }

.prop-detail {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
}
.prop-detail .img {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent-soft), #f5f5f5);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prop-detail .addr { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.prop-detail .sub { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }
.prop-detail .price { font-family: var(--mono); font-size: 18px; font-weight: 600; text-align: right; letter-spacing: -0.01em; }
.prop-detail .price-sub { font-size: 11px; color: var(--fg-4); text-align: right; margin-top: 2px; }

/* ---------- ACTIVITY ---------- */
.activity .activity-item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  align-items: center;
  transition: background 120ms ease;
}
.activity .activity-item:first-child { border-top: none; }
.activity .activity-item:hover { background: var(--bg-soft); }
.activity-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-4);
  font-weight: 500;
}
.activity-body { font-size: 13px; line-height: 1.45; }
.activity-body .who { font-weight: 600; }
.activity-body .what { color: var(--fg-3); }
.activity-body .target { color: var(--fg); font-weight: 500; }
.activity-amt { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }

/* ---------- PIPELINE BREAKDOWN ---------- */
.pipe-row { padding: 14px 20px; border-top: 1px solid var(--line); }
.pipe-row:first-child { border-top: none; }
.pipe-row .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pipe-row .n { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.pipe-row .val { font-size: 11.5px; color: var(--fg-3); font-family: var(--mono); }
.pipe-row .val b { color: var(--fg); font-weight: 600; }
.pipe-row .bar { height: 5px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.pipe-row .bar .fill { height: 100%; border-radius: 999px; transition: width 240ms ease; }

/* ---------- CHAT ---------- */
.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.chat-analysis {
  border-left: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}
.chat-side {
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-side-head { padding: 20px 20px 14px; }
.chat-side-head h3 { margin: 0; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.chat-side-head h3 em { font-style: normal; color: var(--fg); }
.chat-side-head .sub { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }

.new-thread-btn {
  margin: 0 16px 10px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: background 120ms ease, border-color 120ms ease;
}
.new-thread-btn:hover { background: var(--bg-soft); border-color: var(--accent-line); color: var(--accent); }

.thread-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.thread { padding: 11px 12px; cursor: pointer; border-radius: 10px; margin-bottom: 2px; transition: background 120ms ease; }
.thread:hover { background: var(--bg-soft); }
.thread.active { background: var(--accent-soft); }
.thread .t-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.thread .t-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.thread .t-time { font-family: var(--mono); font-size: 10px; color: var(--fg-4); }
.thread .t-prev { font-size: 11.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.active .t-title { color: var(--accent-deep); }
.thread.active .t-prev { color: var(--accent-deep); opacity: 0.7; }

.chat-main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-elev); }
.chat-head {
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-head .title-row { display: flex; align-items: center; gap: 12px; }
.ai-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}
.chat-head h3 { margin: 0; font-weight: 600; font-size: 15px; letter-spacing: -0.015em; }
.chat-head .status { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.chat-head .status::before { content: ''; width: 6px; height: 6px; background: var(--pos); border-radius: 50%; }

.chat-body { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }

.msg { display: flex; gap: 12px; max-width: 780px; }
.msg.user { flex-direction: row-reverse; margin-inline-start: auto; }
.m-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.msg.user .m-avatar { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.msg.ai .m-avatar { background: var(--fg); color: var(--bg-elev); }

.m-bubble { flex: 1; min-width: 0; }
.m-meta { font-size: 11px; color: var(--fg-4); margin-bottom: 4px; font-weight: 500; }
.msg.user .m-meta { text-align: end; }
.m-text {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  border: 1px solid var(--line);
}
.msg.user .m-text { background: var(--accent); color: #fff; border-color: var(--accent); border-start-end-radius: 4px; }
.msg.ai .m-text { border-start-start-radius: 4px; }
.m-attach { padding: 16px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }

.typing { display: inline-flex; gap: 4px; }
.typing span { width: 5px; height: 5px; background: var(--fg-4); border-radius: 50%; animation: tping 1.4s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tping { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-suggest { padding: 0 28px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-suggest button {
  font-size: 12px;
  color: var(--fg-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease;
}
.chat-suggest button:hover { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }

.chat-input { padding: 14px 28px 20px; border-top: 1px solid var(--line); }
.chat-input .wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 8px 10px 8px 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.chat-input .wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-input .tools { display: flex; gap: 2px; }
.chat-input .tool {
  width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--fg-3); border-radius: 8px;
  transition: background 120ms ease, color 120ms ease;
}
.chat-input .tool:hover { background: var(--bg-elev); color: var(--fg); }
.chat-input textarea {
  width: 100%; background: none; border: none; outline: none;
  color: var(--fg); font-size: 14px;
  resize: none;
  padding: 6px 0;
  line-height: 1.5;
  font-family: inherit;
}
.chat-input textarea::placeholder { color: var(--fg-4); }
.chat-input .send {
  width: 34px; height: 34px;
  background: var(--fg);
  color: var(--bg-elev);
  border-radius: 10px;
  display: grid; place-items: center;
  transition: background 120ms ease, opacity 120ms ease;
}
.chat-input .send:hover:not(:disabled) { background: var(--accent); }
.chat-input .send:disabled { opacity: 0.3; cursor: not-allowed; }
.chat-input .send svg { width: 15px; height: 15px; }

/* Recording strip (replaces input contents while recording) */
.chat-input .wrap.is-recording {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.chat-input .tool.rec-cancel { color: #ef4444; }
.chat-input .tool.rec-cancel:hover { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.rec-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--fg-2);
  min-width: 0;
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444;
  animation: rec-pulse 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
.rec-time {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.rec-hint {
  font-size: 12px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* Voice message bubble (audio player + collapsible transcription) */
.m-voice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
}
.msg.user .m-voice { align-items: flex-end; margin-inline-start: auto; }
.voice-player {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
}
.msg.user .voice-player {
  background: var(--accent);
  border-color: var(--accent);
  border-start-end-radius: 4px;
}
.msg.ai .voice-player { border-start-start-radius: 4px; }
.voice-player audio {
  width: 260px;
  max-width: 100%;
  height: 36px;
  display: block;
}
.msg.user .voice-player audio { filter: invert(1) hue-rotate(180deg); }
.voice-loading {
  width: 260px;
  height: 36px;
  display: grid;
  place-items: center;
}
.voice-tx-toggle {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-3);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.msg.user .voice-tx-toggle { align-self: flex-end; }
.voice-tx-toggle:not(:disabled):hover {
  background: var(--bg-soft);
  color: var(--fg);
  border-color: var(--line-2);
}
.voice-tx-toggle:disabled { cursor: default; opacity: 0.7; }
.voice-tx-toggle.is-error { color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.voice-tx-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-1);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  white-space: pre-wrap;
}
.msg.user .voice-tx-text { text-align: start; }

/* ---------- LEADS KANBAN ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  min-height: 600px;
}
.col {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  transition: background 120ms ease, border-color 120ms ease;
}
.col.drop-target { background: var(--accent-soft); border-color: var(--accent-line); }
.col-head { margin-bottom: 12px; }
.col-head .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.col-head .name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.col-head .name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-4); }
.col-head .count { font-family: var(--mono); font-size: 11px; color: var(--fg-3); background: var(--bg-elev); padding: 2px 7px; border-radius: 999px; font-weight: 600; border: 1px solid var(--line); }
.col-head .value { font-family: var(--mono); font-size: 11px; color: var(--fg-3); margin-bottom: 6px; }
.col-head .bar { height: 3px; background: var(--bg-elev); border-radius: 999px; overflow: hidden; }
.col-head .bar .fill { height: 100%; border-radius: 999px; transition: width 240ms ease; }

.col-body { display: flex; flex-direction: column; gap: 8px; }

.lead-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.lead-card:hover { border-color: var(--line-2); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.lead-card.dragging { opacity: 0.4; transform: rotate(-1deg); }
.lead-card .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.lead-card .name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 2px; }
.lead-card .addr { font-size: 11.5px; color: var(--fg-3); }
.lead-card .price { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.lead-card .price .cur { font-size: 10.5px; color: var(--fg-4); font-weight: 500; margin-right: 4px; }

.lead-card .score {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--fg-4);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.lead-card .score.hot { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.lead-card .score .bar { display: inline-flex; gap: 2px; }
.lead-card .score .bar i {
  display: block; width: 3px; height: 7px; background: var(--line-2); border-radius: 1px;
}
.lead-card .score .bar i.on { background: var(--fg); }
.lead-card .score.hot .bar i.on { background: var(--warn); }

.lead-card .foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--fg-3);
}
.lead-card .avatars { display: flex; align-items: center; gap: 6px; }
.lead-card .avatars .a {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 600;
}

/* ---------- ANALYTICS ---------- */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.metric-strip .m {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.metric-strip .m:last-child { border-right: none; }
.metric-strip .label { font-size: 11.5px; color: var(--fg-3); margin-bottom: 6px; font-weight: 500; }
.metric-strip .val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-feature-settings: 'tnum' 1;
}
.metric-strip .val em { font-style: normal; }
.metric-strip .delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

/* ---------- SETTINGS ---------- */
.settings {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  max-width: 880px;
}
.settings-nav { display: flex; flex-direction: column; gap: 1px; }
.settings-nav button {
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  border-radius: 9px;
  transition: background 120ms ease, color 120ms ease;
}
.settings-nav button:hover { background: var(--bg-soft); color: var(--fg); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent-deep); }

.setting-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.setting-row .label p { margin: 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.setting-row .control input, .setting-row .control select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-elev);
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.setting-row .control input:focus, .setting-row .control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toggle {
  width: 38px; height: 22px;
  background: var(--line-2);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 140ms ease;
}
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 140ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

.theme-picker { display: flex; gap: 8px; }
.theme-tile {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.theme-tile:hover { background: var(--bg-soft); }
.theme-tile.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.theme-tile .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-2); }

/* ---------- TWEAKS PANEL ---------- */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px;
  width: 280px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.02);
  z-index: 100;
  display: none;
  overflow: hidden;
}
.tweaks-panel.open { display: block; }
.tweaks-panel .head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-panel .head h4 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.tweaks-panel .close {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--fg-3);
  border-radius: 6px;
  font-size: 18px;
}
.tweaks-panel .close:hover { background: var(--bg-soft); color: var(--fg); }
.tweaks-panel .body { padding: 14px 16px; }
.tweak-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
}
.tweak-row .lab { font-size: 13px; color: var(--fg-2); font-weight: 500; }

/* ---------- VIEW WRAPPER ---------- */
.view { opacity: 0; animation: fadeIn 220ms ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- SPINNER ---------- */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.lg { width: 38px; height: 38px; border-width: 3px; }
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  width: 100%;
}

/* ============================================================
   RESPONSIVE — drawer sidebar, stacked layouts
============================================================ */
.mobile-menu-btn,
.mobile-close-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-btn:hover,
.mobile-close-btn:hover { background: var(--bg-soft); }
.mobile-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  animation: mfade 0.2s ease;
}
.mobile-backdrop.active { display: block; }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Tablet / mid (≤1024px) ---------- */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  }
  html[dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  html[dir="rtl"] .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-flex; }
  .mobile-close-btn { display: inline-flex; }

  .topbar { padding: 14px 18px; gap: 12px; }
  .topbar-left h1 { font-size: 20px; }

  .cols-2,
  .cols-3,
  .cols-2-3 { grid-template-columns: 1fr; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .card-head { flex-wrap: wrap; }
  .card-head h3 { font-size: 14px; }

  .content { padding: 16px 14px 22px; }

  /* Chat shell: stack thread list above conversation, hide analysis */
  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .chat-side {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 220px;
  }
  .chat-analysis { display: none; }
}

/* ---------- iPad landscape and small laptops (1025-1440px): hide analysis panel ---------- */
@media (min-width: 1025px) and (max-width: 1440px) {
  .chat-shell {
    grid-template-columns: 280px 1fr;
  }
  .chat-analysis { display: none; }
}

/* ---------- Phone (≤720px) ---------- */
@media (max-width: 720px) {
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .topbar-left h1 { font-size: 17px; }
  .sidebar { width: 86vw; }

  .kpi-row { grid-template-columns: 1fr; gap: 10px; }
  .content { padding: 14px 12px 20px; }
  .card-head { padding: 14px 14px 10px; gap: 8px; }
  .card-head .pill-tabs { font-size: 11px; }
  .map-canvas { aspect-ratio: 4 / 5; }
  .map-overlay { padding: 8px 10px; font-size: 9.5px; }
  .map-legend-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px 10px;
    font-size: 10px;
    bottom: 8px; left: 8px; right: 8px;
  }

  /* Chat: stack thread list above conversation */
  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .chat-side {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 240px;
  }
}

/* ============================================================
   Lead-appears tutorial popup + pulse highlight on the new card
   ============================================================ */
.lead-tutorial-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: lead-tutorial-fade 220ms ease-out;
}
.lead-tutorial-modal {
  width: 100%; max-width: 520px;
  background: var(--bg-1, #fff);
  color: var(--fg, #111);
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 32px 96px -24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  animation: lead-tutorial-pop 360ms cubic-bezier(0.2,0.8,0.2,1);
}
.lead-tutorial-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 99px;
  background: var(--accent-soft, rgba(59,130,246,0.10));
  color: var(--accent, #3b82f6);
  margin-bottom: 18px;
}
.lead-tutorial-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
  animation: lead-tutorial-dot 1.2s ease-in-out infinite;
}
.lead-tutorial-title {
  font-size: 26px; font-weight: 500; letter-spacing: -0.4px;
  margin: 0 0 14px;
  color: var(--fg, #111);
}
.lead-tutorial-body {
  font-size: 14.5px; line-height: 1.6;
  color: var(--fg-2, #555);
  margin: 0 0 26px;
}
.lead-tutorial-body strong { color: var(--accent, #3b82f6); font-weight: 600; }
.lead-tutorial-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}
@keyframes lead-tutorial-fade { from {opacity:0;} to {opacity:1;} }
@keyframes lead-tutorial-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes lead-tutorial-dot {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.4); opacity: 0.55;}
}
.lead-card.is-pulsing {
  position: relative; z-index: 5;
  animation: lead-card-pulse 1.6s ease-out 3;
  border-color: var(--accent, #3b82f6) !important;
}
@keyframes lead-card-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.7); }
  70%  { box-shadow: 0 0 0 16px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* Captured-data preview chip inside the tutorial modal */
.lead-tutorial-preview {
  display: flex; flex-direction: column;
  gap: 8px;
  margin: 0 0 26px;
  padding: 16px 18px;
  background: var(--bg-2, rgba(0,0,0,0.03));
  border: 1px solid var(--line, rgba(0,0,0,0.06));
  border-radius: 12px;
}
.lead-tutorial-preview-row {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 13.5px;
}
.lead-tutorial-preview-label {
  flex: 0 0 90px;
  font-family: var(--mono, monospace);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-3, #999);
}
.lead-tutorial-preview-value {
  flex: 1; min-width: 0;
  color: var(--fg, #111);
  font-weight: 500;
  word-break: break-word;
}
