:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --ink: #1d2522;
  --muted: #66736e;
  --line: #d8ddd8;
  --accent: #0d7c66;
  --accent-strong: #085f4f;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(20, 32, 27, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.map-pane {
  position: relative;
  min-width: 0;
  height: 100vh;
  background: #dfe7df;
}

#map {
  position: absolute;
  inset: 0;
}

.topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand,
.actions,
.filters {
  pointer-events: auto;
}


.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(20, 32, 27, 0.08);
  transition: all 0.3s ease;
}

.brand:hover {
  border-color: var(--accent-light);
  box-shadow: 0 12px 40px rgba(20, 32, 27, 0.12);
  transform: translateY(-1px);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 124, 102, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-text strong span {
  color: var(--accent);
}

.brand-text .brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

.actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 124, 102, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(25, 37, 34, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.icon-button:hover {
  background: #fff;
  border-color: var(--accent-light);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.primary-link:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 16px rgba(13, 124, 102, 0.3);
  transform: translateY(-1px);
}


.filters {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 80px; /* Raised a bit to not overlap with map controls if any */
  z-index: 20;
  display: none; /* Hidden by default */
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(100px, 0.7fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(25, 37, 34, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.filters.is-open {
  display: grid;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.filters.is-gated {
  position: relative;
  overflow: hidden;
}

.filters.is-gated > *:not(.gate-overlay) {
  filter: blur(5px);
  pointer-events: none;
  opacity: 0.6;
}

.gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s;
}

.gate-overlay:hover {
  background: rgba(255, 255, 255, 0.5);
}

.gate-text {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(13, 124, 102, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.filters label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.filters input,
.filters select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
}

.result-count {
  min-width: 76px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eef4ef;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.ai-pane {
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.pane-top {
  flex: 0 0 auto;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(0, 255, 136, 0.15);
  overflow-y: auto;
  background: #0d1117;
  transition: max-height 0.3s ease;
}


.intel-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 6px;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.slider-header-title {
  display: flex;
  flex-direction: column;
}

.slider-header-title strong {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
}

.slider-header-title .eyebrow {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(0, 255, 136, 0.6);
  text-transform: uppercase;
  font-weight: bold;
}

.toggle-slider-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 255, 136, 0.8);
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-slider-btn:hover {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.4);
  color: #00FF88;
}

.intel-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 18px 10px;
  background: transparent;
}

.intel-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.intel-tab-btn:hover {
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.3);
  color: rgba(0, 255, 136, 0.9);
}

.intel-tab-btn.active {
  background: rgba(0, 255, 136, 0.14);
  border-color: rgba(0, 255, 136, 0.5);
  color: #00FF88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.15), inset 0 0 8px rgba(0, 255, 136, 0.05);
}

.intel-tab-content {
  display: none;
  width: 100%;
}

.intel-tab-content.active {
  display: block;
  animation: tabFadeIn 0.3s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-intel-slider.is-collapsed {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 18px !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}

.ai-intel-slider {
  display: block;
  padding: 8px 18px 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

.intel-card {
  flex: 0 0 280px;
  max-width: 85vw; /* Responsive constraint */
  scroll-snap-align: start;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(20, 32, 27, 0.08);
  margin: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.intel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #00FF88);
  opacity: 0.8;
}

.intel-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(13, 124, 102, 0.12);
  cursor: pointer;
}

.intel-card.is-active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.1), 0 12px 40px rgba(13, 124, 102, 0.15);
}

.intel-card.is-active::after {
  content: 'SELECTED';
  position: absolute;
  top: 12px; right: 12px;
  font-size: 8px; font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.buyer-brief,
.shortlist-panel {
  /* margin: 12px 18px 0; Removed for slider */
}

.shortlist-panel.is-hidden {
  display: none;
}

.buyer-brief-header,
.shortlist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 255, 136, 0.6);
}

/* eyebrow trong vùng sáng (messages, chat) */
.selected-card .eyebrow {
  color: var(--accent-strong);
}

.buyer-brief-header strong,
.shortlist-header strong {
  display: block;
  font-size: 15px;
  color: rgba(255,255,255,0.88);
}

.buyer-brief-body,
.shortlist-body {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.6);
}

.buyer-brief-body.is-muted,
.shortlist-body.is-muted {
  color: rgba(255,255,255,0.35);
}

.ghost-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 999px;
  background: rgba(0, 255, 136, 0.07);
  color: rgba(0, 255, 136, 0.8);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ghost-button:hover {
  border-color: rgba(0, 255, 136, 0.6);
  background: rgba(0, 255, 136, 0.12);
  color: #00FF88;
  background: #f4fbf8;
}

.buyer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.buyer-reasoning {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.buyer-reasoning-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mission-heading {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mission-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
}

.mission-tag:hover {
  transform: translateY(-1px);
}

.mission-tag-explicit {
  background: #f0fdf4;
  color: var(--accent-strong);
  border-color: var(--accent-light);
  box-shadow: 0 2px 6px rgba(13, 124, 102, 0.05);
}

.mission-tag-inferred {
  background: #f8fafc;
  color: #475569;
  border: 1.5px dashed var(--line);
}

.mission-tag-inferred:hover {
  background: #fff;
  border-color: var(--accent-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tag-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
  margin-left: 2px;
}

.tag-action-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  color: #1e293b;
}

.tag-action-btn.confirm {
  background: rgba(13, 124, 102, 0.1);
  color: var(--accent-strong);
}

.tag-action-btn.confirm:hover {
  background: var(--accent);
  color: #fff;
}

.tag-action-btn.deny {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tag-action-btn.deny:hover {
  background: #ef4444;
  color: #fff;
}

.tag-action-btn.remove {
  background: rgba(0, 0, 0, 0.04);
  color: #64748b;
}

.tag-action-btn.remove:hover {
  background: #cbd5e1;
  color: #334155;
}

.shortlist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortlist-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.shortlist-item:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(13, 124, 102, 0.08);
}

.shortlist-item.is-active {
  border-color: var(--accent);
  background: #f3fbf7;
}

.shortlist-rank {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.shortlist-main strong,
.shortlist-main span {
  display: block;
}

.shortlist-main strong {
  font-size: 14px;
}

.shortlist-meta,
.shortlist-summary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.shortlist-score {
  text-align: right;
  min-width: 58px;
}

.shortlist-score strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.shortlist-score span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.pane-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #080c12;
  border-top: 1px solid rgba(0,255,136,0.08);
}

.assistant-header {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}

.assistant-header h1 {
  line-height: 1.25;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.14);
}

.is-hidden {
  display: none !important;
}

.dna-radar {
  position: absolute;
  bottom: 80px;
  right: 16px;
  z-index: 30;
  width: 540px;
  display: grid;
  grid-template-columns: 120px 1fr; /* Smaller SVG column */
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 4px 20px;
  padding: 6px 16px; /* Very tight padding */
  background: rgba(255, 255, 255, 0.02); /* Almost zero alpha */
  backdrop-filter: blur(16px); /* More blur to compensate transparency */
  border: none; /* No border for seamless look */
  border-radius: 16px;
  box-shadow: none;
  transition: all 0.4s ease;
}
.dna-radar.is-collapsed {
  width: auto;
  min-width: 280px;
  grid-template-columns: 1fr;
  padding-bottom: 10px;
}

.dna-radar-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.dna-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dna-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.dna-tool-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dna-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.dna-tool-btn.is-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.dna-collapse-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.dna-collapse-btn:hover {
  color: var(--accent);
}

.radar-svg {
  grid-row: 2;
  grid-column: 1;
}

.dna-legend {
  grid-row: 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr; /* Split legend into two columns */
  gap: 4px 16px;
  padding: 0;
}

.dna-disclaimer {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 8.5px;
  color: var(--ink);
  line-height: 1.2;
  opacity: 0.6;
}

.compare-panel {
  position: absolute;
  bottom: 80px;
  right: 610px; /* Positioned further left because radar is wider */
  z-index: 30;
  width: 400px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.dna-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
  line-height: 1;
}

.dna-score span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.cmp-meta-row td {
  padding: 4px 8px !important;
  font-size: 11px !important;
  color: var(--muted);
}
.cmp-addr {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 10px;
}
.cmp-divider td {
  height: 1px;
  background: var(--line);
  padding: 0 !important;
  margin: 8px 0;
}

.radar-svg {
  display: block;
}

.dna-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px; /* Slightly smaller */
  color: var(--ink);
  line-height: 1.1;
}

.dna-legend-bar {
  flex: 1;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
}

.dna-legend-fill {
  height: 100%;
  border-radius: 2px;
}

.dna-legend-name {
  min-width: 60px;
  white-space: nowrap;
}

.dna-legend-score {
  min-width: 30px;
  text-align: right;
  font-weight: 700;
}

/* Legal metadata row */
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 4px;
  padding-left: 80px;
}

.legal-doc-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

.legal-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
}

.legal-badge--ok   { background: #d1fae5; color: #065f46; }
.legal-badge--warn { background: #fef3c7; color: #92400e; }
.legal-badge--risk { background: #fee2e2; color: #991b1b; }

.dna-legend-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.dna-legend-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.dna-legend-fill.tier-1 { background: var(--danger); }
.dna-legend-fill.tier-2 { background: var(--warn); }
.dna-legend-fill.tier-3 { background: var(--accent); }

/* Ký hiệu ▲? khi điểm đang ở ngưỡng tự động tối đa (8/10) */
.score-cap {
  font-size: 8px;
  color: var(--muted);
  margin-left: 1px;
  vertical-align: super;
  cursor: help;
}

.selected-card {
  margin: 8px 18px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 10px;
  background: rgba(0, 255, 136, 0.05);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.06);
}

.selected-card .property-summary strong {
  color: rgba(255,255,255,0.9);
}

.selected-card .property-summary div {
  color: rgba(255,255,255,0.45);
}

.selected-card .match-score small {
  color: rgba(0, 255, 136, 0.6);
}

.selected-card .match-score strong span {
  color: rgba(255,255,255,0.35);
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.match-score {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.match-score small {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.match-score strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.match-score strong span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.match-unknown-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  margin-left: auto;
  margin-top: 4px;
  animation: pulse-green 2s infinite;
}

.match-unknown-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(13, 124, 102, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(13, 124, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 124, 102, 0); }
}

.property-summary {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.insight-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

.card-actions {
  display: none;
}

/* ── CHAT MESSAGES ─────────────────────────────── */
.messages {
  flex: 1;
  padding: 20px 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scroll-behavior: smooth;
  background: #080c12;
}

/* scroll-bar dark */
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.15); border-radius: 4px; }

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
  position: relative;
}

/* user message: avatar on the right */
.message.user {
  flex-direction: row-reverse;
  align-items: flex-end;
}

/* ── Avatar ── */
.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message.assistant .message-avatar,
.message.loading .message-avatar {
  background: #0c2018;
  border: 1px solid rgba(0,255,136,0.35);
  box-shadow: 0 0 10px rgba(0,255,136,0.08);
}

.message.user .message-avatar {
  background: #111929;
  border: 1px solid rgba(80,130,255,0.3);
}

/* ── Content wrapper ── */
.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.message.user .message-content {
  align-items: flex-end;
}

/* label above AI bubble */
.message-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0,255,136,0.5);
  padding-left: 2px;
}

/* ── AI bubble ── */
.message.assistant .message-body,
.message.loading .message-body {
  background: #0f1923;
  border: 1px solid rgba(0,255,136,0.1);
  border-left: 3px solid rgba(0,255,136,0.45);
  border-radius: 0 12px 12px 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.85);
  font-size: 13.5px;
  line-height: 1.7;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ── User bubble ── */
.message.user .message-body {
  background: #141d33;
  border: 1px solid rgba(80,130,255,0.2);
  border-radius: 12px 0 12px 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.88);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 82%;
  word-break: break-word;
}

/* ── Markdown inside AI bubble ── */
.message.assistant .message-body p,
.message.loading .message-body p { margin: 0 0 8px; }
.message.assistant .message-body p:last-child { margin-bottom: 0; }

.message.assistant .message-body h1,
.message.assistant .message-body h2,
.message.assistant .message-body h3 {
  color: #00FF88;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 14px 0 6px;
}

.message.assistant .message-body strong {
  color: rgba(0,255,136,0.95);
  font-weight: 600;
}

.message.assistant .message-body em {
  color: rgba(180,220,255,0.8);
  font-style: italic;
}

.message.assistant .message-body ul,
.message.assistant .message-body ol {
  padding-left: 20px;
  margin: 8px 0;
}

.message.assistant .message-body li {
  margin: 5px 0;
  color: rgba(255,255,255,0.82);
}

.message.assistant .message-body li::marker {
  color: rgba(0,255,136,0.5);
}

.message.assistant .message-body hr {
  border: none;
  border-top: 1px solid rgba(0,255,136,0.12);
  margin: 12px 0;
}

.message.assistant .message-body code {
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  color: #00FF88;
}

/* ── Loading state ── */
.message.loading .message-body {
  opacity: 0.75;
}

.loading-pulse {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.loading-pulse span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,255,136,0.6);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.loading-pulse span:nth-child(2) { animation-delay: 0.2s; }
.loading-pulse span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Suggestions ── */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 12px;
  background: #080c12;
}

.suggestions button {
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 999px;
  padding: 6px 12px;
  color: rgba(0,255,136,0.75);
  background: rgba(0,255,136,0.05);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}

.suggestions button:hover {
  border-color: rgba(0,255,136,0.5);
  background: rgba(0,255,136,0.1);
  color: #00FF88;
}

/* ── Chat form ── */
.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0,255,136,0.1);
  background: #0a0e14;
}

.chat-form textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(0,255,136,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.4;
  background: #0f1923;
  color: rgba(255,255,255,0.88);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form textarea::placeholder {
  color: rgba(255,255,255,0.28);
}

.chat-form textarea:focus {
  outline: none;
  border-color: rgba(0,255,136,0.45);
  box-shadow: 0 0 0 3px rgba(0,255,136,0.07);
}

.chat-form button[type="submit"] {
  background: rgba(0,255,136,0.12);
  border: 1px solid rgba(0,255,136,0.35);
  color: #00FF88;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chat-form button[type="submit"]:hover {
  background: rgba(0,255,136,0.22);
  box-shadow: 0 0 12px rgba(0,255,136,0.15);
}

.property-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.property-marker.high {
  background: var(--warn);
}

.property-marker.very-high {
  background: var(--danger);
}

.property-marker.cluster {
  background: #263a35;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 55vh 45vh;
    height: 100vh;
    overflow: hidden;
  }

  .map-pane {
    height: 55vh;
    min-height: 0;
    overflow: hidden;
  }

  .ai-pane {
    height: 45vh;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ─── Mobile Tabs Switching Layout (Version 2.2) ─── */
  .ai-pane-tabs {
    display: flex;
    background: #080c12;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
    padding: 8px 12px;
    gap: 8px;
    flex-shrink: 0;
  }

  .ai-pane-tab {
    flex: 1;
    background: #0d1520;
    border: 1px solid rgba(0, 255, 136, 0.25);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
  }

  .ai-pane-tab.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: #00FF88;
    color: #00FF88;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.08);
  }

  .mobile-hidden {
    display: none !important;
  }

  .pane-top {
    flex: 1 1 0;
    max-height: none !important;
    overflow-y: auto;
  }

  .pane-bottom {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
  }

  /* DNA Radar: bottom bar full-width */
  .dna-radar {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 60%;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    grid-template-columns: 90px 1fr;
  }

  .dna-radar.is-collapsed {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .compare-panel {
    display: none !important;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
    right: 10px;
    left: 10px;
    bottom: 10px;
  }

  .result-count {
    grid-column: 1 / -1;
  }

  .planning-menu {
    right: 10px;
    bottom: 118px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    grid-template-rows: 60vh 40vh;
  }

  .map-pane {
    height: 60vh;
  }

  .ai-pane {
    height: 40vh;
  }

  .topbar {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .brand span {
    display: none;
  }

  .filters {
    display: none;
  }

  .filters.is-open {
    display: grid;
    grid-template-columns: 1fr;
  }

  /* Ẩn orb + tiêu đề intel — chỉ giữ 3 tab buttons */
  .ai-orb-container,
  .intel-slider-header {
    display: none !important;
  }

  /* Tab buttons: compact 1 dòng */
  .intel-tabs {
    padding: 6px 10px;
    gap: 6px;
    border-bottom: 1px solid var(--line);
  }

  .intel-tab-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* selected-card: ẩn hoàn toàn trên mobile — AI chat đã đủ */
  .selected-card {
    display: none !important;
  }

  /* pane-top: chiếm trọn chiều cao khi active */
  .pane-top {
    max-height: none !important;
    overflow-y: auto;
  }

  /* pane-bottom: chat chiếm phần còn lại */
  .pane-bottom {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 6px;
    gap: 14px;
  }

  .message-avatar {
    width: 26px;
    height: 26px;
  }

  .message-label {
    display: none;
  }

  .message.assistant .message-body,
  .message.loading .message-body {
    font-size: 13px;
    padding: 9px 12px;
  }

  .message.user .message-body {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Suggestions: scroll ngang 1 hàng, không wrap */
  .suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 12px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .suggestions::-webkit-scrollbar {
    display: none;
  }

  .suggestions button {
    flex-shrink: 0;
    font-size: 11px;
    padding: 5px 10px;
    white-space: nowrap;
  }

  /* Chat form: compact */
  .chat-form {
    grid-template-columns: 1fr auto;
    padding: 8px 12px 10px;
    gap: 8px;
  }

  .chat-form textarea {
    font-size: 14px;
  }

  /* DNA Radar: thanh công cụ 1 dòng ở cuối map */
  .dna-radar {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 10px 10px 0 0;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }

  /* Khi collapsed: 1 hàng ngang duy nhất */
  .dna-radar.is-collapsed {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  /* Khi mở rộng: giới hạn chiều cao, scroll được */
  .dna-radar:not(.is-collapsed) {
    max-height: 55%;
    overflow-y: auto;
    grid-template-columns: 100px 1fr;
  }
}

/* Planning Menu Styles */
.planning-menu h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.floating-toggle-btn {
  position: absolute;
  top: 80px;
  left: 16px;
  z-index: 11;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}

.floating-toggle-btn:hover {
  background: #f0fdf4;
  border-color: var(--accent);
}

.planning-menu.active {
  display: flex;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.planning-menu {
  position: absolute;
  top: 130px; 
  left: 16px;
  z-index: 10;
  width: 260px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.planning-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}

.planning-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.1);
}

.planning-controls {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planning-controls label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.planning-controls input[type="range"] {
  width: 100%;
}

/* ─── DNA Compare ─────────────────────────────────────────────────────────── */
.dna-compare-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent-strong);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.dna-compare-btn:hover { background: #edf6f0; }
.dna-compare-btn--active { border-color: var(--warn); color: var(--warn); }
.dna-compare-btn--active:hover { background: #fef3e2; }

.compare-panel {
  margin: 6px 18px 0;
  padding: 10px 12px;
  border: 1px solid #f0c070;
  border-radius: 8px;
  background: #fffbf0;
}

.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cmp-close {
  font-size: 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 4px;
}
.cmp-close:hover { background: #f5e6c8; }

.cmp-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cmp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmp-dot--a { background: #0d7c66; }
.cmp-dot--b { background: #b45309; }

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 6px;
}
.cmp-table th { color: var(--muted); font-weight: 700; text-align: center; padding: 2px 4px; }
.cmp-table td { padding: 2px 4px; vertical-align: middle; }
.cmp-label { color: var(--muted); width: 70px; }
.cmp-a { text-align: center; color: #0d7c66; font-weight: 700; }
.cmp-b { text-align: center; color: #b45309; font-weight: 700; }
.cmp-diff { text-align: center; font-weight: 700; }
.cmp-table tfoot td { border-top: 1px solid var(--line); padding-top: 4px; }

/* ─── Modal & Auth ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  font-size: 24px; color: var(--muted);
  cursor: pointer;
}

.modal-content h2 {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 22px;
}

.modal-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 44px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: var(--accent-strong);
}

.w-100 {
  width: 100%;
}

.modal-footer {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.profile-section h3 {
  font-size: 16px;
  color: var(--accent-strong);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.profile-section p {
  font-size: 14px;
  margin-bottom: 6px;
}

/* ── AI Match Score Row ─────────────────────────────────────── */
.ai-match-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 4px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.2s;
}
.ai-match-score-row:hover {
  background: #f0faf7;
  border-color: var(--accent);
}
.ai-match-score-row.loading {
  opacity: 0.6;
}
.ai-match-score-row .match-label {
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
.ai-match-score-row .match-value {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.ai-match-score-row .match-value small {
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.7;
}
.ai-match-score-row .match-reason {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Trạng thái locked — user chưa có intent */
.ai-match-score-row.match-locked {
  background: #fafafa;
  border-color: #e0e0e0;
  cursor: default !important;
}
.ai-match-score-row.match-locked:hover {
  background: #fafafa;
  border-color: #e0e0e0;
}
.match-value--locked {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.match-reason--note {
  color: var(--muted);
  font-size: 12px;
  flex: 1;
  white-space: normal;        /* cho phép xuống dòng */
  line-height: 1.4;
  overflow: visible;
}
.match-reason--note a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Dot pulse animation for loading state */
.dot-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-pulse 1.2s infinite ease-in-out;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

/* --- TACTICAL HUD & AI ORB STYLES --- */

.ai-orb-container {
  padding: 12px 18px; /* Reduced from 24px */
  background: #0a0e14; /* Deep Tactical Navy */
  display: flex;
  align-items: center; /* Side-by-side layout */
  gap: 16px;
  border-bottom: 1px solid rgba(0, 255, 136, 0.2);
  position: relative;
  overflow: hidden;
}

.ai-orb-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.ai-orb {
  position: relative;
  width: 44px; /* Reduced from 80px */
  height: 44px;
  flex-shrink: 0;
}

.orb-core {
  position: absolute;
  inset: 8px; /* Adjusted for smaller size */
  background: radial-gradient(circle, #00FF88 0%, #008855 100%);
  border-radius: 50%;
  box-shadow: 0 0 15px #00FF88, inset 0 0 5px rgba(255,255,255,0.5);
  animation: orb-pulse 4s infinite ease-in-out;
  z-index: 2;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 50%;
  animation: orb-rotate 10s infinite linear;
}

.orb-ring::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #00FF88;
  border-radius: 50%;
  box-shadow: 0 0 10px #00FF88;
}

@keyframes orb-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: brightness(1.2); }
}

@keyframes orb-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.readiness-gauge-container {
  width: 100%;
  text-align: center;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gauge-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(0, 255, 136, 0.7);
  letter-spacing: 0.1em;
}

.intel-toggle-btn {
  background: none;
  border: none;
  color: #00FF88;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: transform 0.3s ease;
  opacity: 0.8;
}

.intel-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.intel-toggle-btn.active {
  transform: rotate(90deg);
}

.gauge-bar-wrapper {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #008855, #00FF88);
  box-shadow: 0 0 10px #00FF88;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.maturity-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00FF88;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Intel Checklist */
.intel-checklist-panel {
  margin: 0 18px 12px;
  padding: 14px;
  background: rgba(10, 14, 20, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.intel-checklist-panel.is-hidden {
  display: none;
}

.intel-checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.intel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.intel-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.intel-item.is-locked {
  opacity: 0.6;
  background: #f9f9f9;
}

.intel-item .status-icon {
  font-size: 14px;
}

.intel-item .label {
  flex: 1;
  margin: 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.intel-item .points {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}

/* Broker Handoff Nudge */
.broker-handoff-nudge {
  margin: 10px 18px;
  background: linear-gradient(135deg, #0a0e14 0%, #162131 100%);
  border: 1px solid #FFD700;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
  animation: nudge-slide-up 0.5s ease-out;
}

.broker-handoff-nudge::after {
  content: 'CONFIDENTIAL';
  position: absolute;
  top: 10px;
  right: -25px;
  transform: rotate(45deg);
  background: #FFD700;
  color: #000;
  font-size: 8px;
  font-weight: 900;
  padding: 2px 30px;
}

.broker-handoff-nudge .badge {
  display: inline-block;
  background: #FFD700;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.broker-handoff-nudge p {
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.broker-handoff-nudge .primary-btn {
  background: #FFD700;
  color: #000 !important;
  font-weight: 900;
  border: none;
  width: 100%;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes nudge-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── Dynamic Mobile Split Layout Mode (Version: 2.1) ───────────────────────── */
@media (max-width: 900px) {
  .app-shell {
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .map-pane, .ai-pane {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Chat expanded: Chat 2 parts (66.67vh), Map 1 part (33.33vh) */
  .app-shell.chat-expanded {
    grid-template-rows: 33.33vh 66.67vh !important;
  }
  .app-shell.chat-expanded .map-pane {
    height: 33.33vh !important;
  }
  .app-shell.chat-expanded .ai-pane {
    height: 66.67vh !important;
  }

  /* Map expanded: Map 2 parts (66.67vh), Chat 1 part (33.33vh) */
  .app-shell.map-expanded {
    grid-template-rows: 66.67vh 33.33vh !important;
  }
  .app-shell.map-expanded .map-pane {
    height: 66.67vh !important;
  }
  .app-shell.map-expanded .ai-pane {
    height: 33.33vh !important;
  }
}

/* Custom Popup Close Button for better mobile accessibility */
.maplibregl-popup-close-button {
  width: 38px !important;
  height: 38px !important;
  font-size: 24px !important;
  line-height: 38px !important;
  background-color: #ffffff !important;
  border-radius: 50% !important;
  border: 1.5px solid var(--line, #e2e8f0) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
  top: -16px !important;
  right: -16px !important;
  cursor: pointer !important;
  color: #1e293b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  outline: none !important;
  padding: 0 !important;
}
.maplibregl-popup-close-button:hover {
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
}



