/* Inter is self-hosted as a variable font (see app.html / index.html @font-face).
   Removed: @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
   Saved ~12 KB transfer + 1 render-blocking cross-origin request. */

/* ================================================================
   Scouq - Glass Design System (Premium Rewrite)
   ================================================================ */

/* ----------------------------------------------------------------
   1. Custom Properties (Light / Dark)
   ---------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Keyboard focus ring token (used by :focus-visible rule) */
  --focus-ring: #ffcd33;

  /* Expanded pane max content width: applied to scrollable content columns */
  --expanded-max-width: 1440px;

  /* glass - neutral premium */
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
  --glass-blur: blur(20px) saturate(1.3);

  /* inner elements */
  --glass-inner-bg: rgba(0, 0, 0, 0.035);
  --glass-inner-border: 1px solid rgba(0, 0, 0, 0.06);

  /* text */
  --text-primary: #000000;
  --text-muted: rgba(0, 0, 0, 0.45);
  --text-label: rgba(0, 0, 0, 0.35);
  --text-label-strong: rgba(0, 0, 0, 0.62);

  /* icon */
  --icon-color: rgba(0, 0, 0, 0.4);

  /* stage colors */
  --offer: #16a34a;
  --underwrite: #555555;
  --watchlist: #ca8a04;
  --pass: #dc2626;

  /* accent - black in light mode */
  --accent: #000000;
  --accent-subtle: rgba(0, 0, 0, 0.06);

  /* surfaces */
  --body-bg: #f5f5f5;
  --map-bg: #eaeaea;
  --input-bg: rgba(0, 0, 0, 0.04);
  --input-border: 1px solid rgba(0, 0, 0, 0.08);
  --divider: rgba(0, 0, 0, 0.07);

  /* active / hover */
  --hover-bg: rgba(0, 0, 0, 0.04);
  --active-card-bg: rgba(0, 0, 0, 0.05);
  --active-card-border: rgba(0, 0, 0, 0.15);

  /* hot strategy */
  --hot-bg: rgba(22, 163, 74, 0.06);
  --hot-border: rgba(22, 163, 74, 0.18);

  /* radii */
  --r-sidebar: 16px;
  --r-panel: 12px;
  --r-button: 8px;
  --r-input: 8px;
  --r-cell: 8px;
  --r-badge: 4px;

  /* transition */
  --theme-transition: 200ms ease;

  /* network/shared surface tokens */
  --surface: #f4f4f5;
  --border: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Keyboard focus ring token (brand yellow for consistency) */
  --focus-ring: #ffcd33;

  --glass-bg: rgba(14, 14, 14, 0.92);
  --glass-border: 1px solid rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.45);

  --glass-inner-bg: rgba(255, 255, 255, 0.05);
  --glass-inner-border: 1px solid rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-label: rgba(255, 255, 255, 0.35);
  --text-label-strong: rgba(255, 255, 255, 0.65);

  --icon-color: rgba(255, 255, 255, 0.45);

  /* accent - white in dark mode */
  --accent: #ffffff;
  --accent-subtle: rgba(255, 255, 255, 0.07);
  --underwrite: #888888;

  --body-bg: #000000;
  --map-bg: #000000;
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: 1px solid rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.07);

  --hover-bg: rgba(255, 255, 255, 0.07);
  --active-card-bg: rgba(255, 255, 255, 0.08);
  --active-card-border: rgba(255, 255, 255, 0.15);

  --hot-bg: rgba(22, 163, 74, 0.12);
  --hot-border: rgba(22, 163, 74, 0.22);

  /* network/shared surface tokens */
  --surface: #1a1a1c;
  --border: rgba(255, 255, 255, 0.1);
}


/* ----------------------------------------------------------------
   1c. Semantic color variables (consolidated)
   ---------------------------------------------------------------- */
:root {
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger:  #ef4444;
  --color-info:    #3b82f6;

  /* score palette (bg tints for dark mode) */
  --score-hot-bg:   rgba(22, 163, 74, 0.12);
  --score-warm-bg:  rgba(100, 100, 100, 0.12);
  --score-watch-bg: rgba(245, 158, 11, 0.12);
  --score-cold-bg:  rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] {
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-success: #22c55e;
}


/* ----------------------------------------------------------------
   1b. Glass Style Variants
   ---------------------------------------------------------------- */

/* "frosted" = premium frosted glass, heavy blur */
[data-glass="frosted"] {
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-blur: blur(20px) saturate(1.3);
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"][data-glass="frosted"] {
  --glass-bg: rgba(14, 14, 14, 0.94);
}

/* "solid" = opaque, no blur */
[data-glass="solid"] {
  --glass-bg: #ffffff;
  --glass-blur: none;
  --glass-border: 1px solid rgba(0, 0, 0, 0.12);
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"][data-glass="solid"] {
  --glass-bg: #141414;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}


/* ----------------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--theme-transition), color var(--theme-transition);
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

button:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
  border-radius: var(--r-button);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}


/* ----------------------------------------------------------------
   3. Map
   ---------------------------------------------------------------- */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--map-bg);
}

.maplibregl-canvas {
  outline: none;
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-logo {
  display: none !important;
}


/* ----------------------------------------------------------------
   4. Glass Utility
   ---------------------------------------------------------------- */
.glass {
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition:
    background var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition);
}


/* ----------------------------------------------------------------
   5. Floating Sidebar
   ---------------------------------------------------------------- */
.investor-console {
  position: fixed;
  z-index: 18;
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: min(360px, calc(100vw - 24px));
  border-radius: var(--r-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(-100% - 20px));
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1), width 350ms cubic-bezier(0.22, 1, 0.36, 1), background var(--theme-transition);
}

.sidebar-open .investor-console {
  transform: translateX(0);
}

.sidebar-expanded .investor-console {
  width: calc(100vw - 32px);
}

/* Mini sidebar - icon-strip mode */
.sidebar-mini .investor-console {
  transform: translateX(0);
  width: 54px;
  overflow: hidden;
}

.sidebar-mini .sidebar-content {
  overflow: hidden;
  padding: 0;
}

.sidebar-mini .console-header {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px 0 10px;
  margin-bottom: 0;
  border-bottom: none;
}

.sidebar-mini .header-nav {
  flex-direction: column;
  gap: 2px;
}

.sidebar-mini .header-actions {
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

/* In mini mode hide the expand btn (sidebarClose becomes expand) */
.sidebar-mini .header-icon-btn:not(#sidebarClose) {
  display: none;
}

.sidebar-mini .tab-panel {
  display: none !important;
}

.sidebar-mini .sidebar-toggle {
  display: none;
}

/* Tooltip appears on the right in mini mode */
.sidebar-mini [data-tooltip]::after {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

/* Resize drag handle */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-resize-handle::after {
  content: "";
  display: block;
  width: 3px;
  height: 32px;
  border-radius: 4px;
  background: var(--glass-border-color, rgba(255,255,255,0.12));
  opacity: 0;
  transition: opacity 180ms ease;
}

.sidebar-resize-handle:hover::after,
.sidebar-resizing .sidebar-resize-handle::after {
  opacity: 1;
}

.sidebar-resizing {
  user-select: none;
  cursor: ew-resize !important;
}

.sidebar-resizing .investor-console {
  transition: none !important;
}

/* Sidebar content area */
.sidebar-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .sidebar-content {
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Tab panels */
.tab-panel {
  display: none;
  animation: tabFadeIn 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-panel.active {
  display: block;
}

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

/* Discover tab */
.discover-intro {
  margin-bottom: 16px;
}

.discover-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.discover-search-wrap {
  display: flex;
  gap: 6px;
  position: relative;
}

.discover-search-wrap input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--r-input);
  background: var(--input-bg);
  border: var(--input-border);
  color: var(--text-primary);
  font-size: 13px;
  transition: box-shadow 150ms ease;
}

.discover-search-wrap input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-subtle);
}
.discover-search-wrap input:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 1px;
}

.discover-search-wrap button {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-input);
  background: var(--accent);
  color: var(--body-bg);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, transform 100ms ease;
}

.discover-search-wrap button:active {
  transform: scale(0.96);
}

/* Scout suggestions */
.scout-suggestions {
  margin-top: 16px;
}
.scout-section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.scout-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.scout-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.scout-chip:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--active-card-border);
}
.scout-chip svg {
  width: 11px;
  height: 11px;
  opacity: 0.5;
}
.scout-recent-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.scout-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 150ms ease;
}
.scout-recent-item:hover {
  background: var(--hover-bg);
}
.scout-recent-item svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.scout-recent-item small {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
}

/* Analysis empty state */
.analysis-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}
.analysis-empty-state p {
  font-size: 13px;
  margin-top: 10px;
}
.analysis-empty-state small {
  font-size: 11px;
  opacity: 0.6;
}

/* Tab panel header */
.tab-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}

.tab-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.tab-panel-subtitle {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  padding: 3px 0 8px;
  opacity: 0.8;
  width: 100%;
  flex-basis: 100%;
  order: 100;
}
.tab-panel-header .tab-panel-subtitle {
  padding-bottom: 0;
  margin-top: -4px;
}

.tools-hub-playbook-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  margin: 0 0 12px;
  border: var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.empty-state svg {
  opacity: 0.22;
  margin-bottom: 2px;
}

.empty-state p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 10px;
}

.empty-state small {
  display: block;
  font-size: 11px;
  color: var(--text-label);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 220px;
}

/* AI reasoning panel */
.ai-reasoning {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
}

.ai-reasoning:empty {
  display: none;
}

.ai-reasoning h4 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ai-reasoning p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}

.ai-reasoning .ai-loading {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Settings grid */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setting-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 14px 0 6px;
}

.setting-group-label:first-child {
  padding-top: 0;
}


/* ----------------------------------------------------------------
   6. Sidebar Header (horizontal nav + actions)
   ---------------------------------------------------------------- */
.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--icon-color);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 120ms ease;
  position: relative;
}

.nav-icon:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.nav-icon:active {
  transform: scale(0.93);
}

.nav-icon.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Tooltip on hover */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(30, 30, 30, 0.9);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 100;
}

[data-theme="dark"] [data-tooltip]::after {
  background: rgba(60, 60, 60, 0.92);
  color: rgba(255, 255, 255, 0.88);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.header-icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--icon-color);
  transition: background 150ms ease, color 150ms ease, transform 120ms ease;
}

.header-icon-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.header-icon-btn:active {
  transform: scale(0.92);
}

.header-icon-btn:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
}


/* ----------------------------------------------------------------
   7. Sidebar Toggle (hamburger, visible when closed)
   ---------------------------------------------------------------- */
.sidebar-toggle {
  position: fixed;
  z-index: 20;
  left: 14px;
  top: 14px;
  display: grid;
  gap: 3.5px;
  place-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-panel);
  cursor: pointer;
  transition: opacity 200ms ease, background var(--theme-transition);
}

.sidebar-open .sidebar-toggle {
  opacity: 0;
  pointer-events: none;
}

.sidebar-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 4px;
  background: var(--text-primary);
  opacity: 0.5;
}


/* ----------------------------------------------------------------
   8. Filter Pills
   ---------------------------------------------------------------- */
/* Feed toolbar */
.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.feed-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filters-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}
.filters-toggle-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.filters-toggle-btn:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}
.filters-toggle-btn:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
}
.filters-toggle-btn.active {
  background: var(--active-card-bg);
  color: var(--text-primary);
  border-color: var(--active-card-border);
}
.filter-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.deal-count-badge {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  font-family: ui-monospace, 'SF Mono', monospace;
  white-space: nowrap;
}
.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background 150ms ease;
}
.sort-pill:hover {
  background: var(--hover-bg);
}
.sort-pill svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}
.sort-pill select {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  height: auto;
}

/* Full filter view */
.filter-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: filterSlideIn 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes filterSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.filter-view-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.filter-view-header h3 {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.filter-view-clear {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}
.filter-view-clear:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}
.filter-view-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}
.filter-group {
  margin-bottom: 18px;
}
.filter-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--divider);
}
.filter-section {
  margin-bottom: 10px;
}
.filter-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-label-strong);
  margin-bottom: 5px;
}
.filter-select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 150ms ease;
}
.filter-select:focus {
  outline: none;
  border-color: var(--active-card-border);
}
.filter-select:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 1px;
}
.filter-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  transition: border-color 150ms ease;
  box-sizing: border-box;
}
.filter-input:focus {
  outline: none;
  border-color: var(--active-card-border);
}
.filter-input:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 1px;
}
.filter-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.filter-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filter-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-range-row input[type="range"] {
  flex: 1;
  height: auto;
  border: none;
  background: none;
  padding: 0;
}
.filter-range-value {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 20px;
  text-align: right;
}
.filter-view-footer {
  flex-shrink: 0;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
.filter-apply-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--body-bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: opacity 150ms ease, transform 120ms ease;
}
.filter-apply-btn:hover {
  opacity: 0.88;
}
.filter-apply-btn:active {
  transform: scale(0.97);
  opacity: 0.82;
}
.filter-apply-btn:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
  opacity: 0.9;
}

/* Profile panel */
.profile-panel {
  padding-top: 8px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}


/* ----------------------------------------------------------------
   9. Selected Property Card
   ---------------------------------------------------------------- */
.selected-card {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 12px;
  margin-bottom: 12px;
  transition: background var(--theme-transition);
}

.selected-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.selected-top h2 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.selected-top p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}


/* ----------------------------------------------------------------
   10. Stage Badge
   ---------------------------------------------------------------- */
.stage {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.15px;
  flex-shrink: 0;
}

.stage.make_offer { background: var(--offer); }
.stage.underwrite { background: var(--underwrite); }
.stage.watchlist  { background: var(--watchlist); }
.stage.pass       { background: var(--pass); }
.stage.scout      { background: var(--glass-inner-bg); color: var(--text-muted); border: var(--glass-inner-border); }


/* ----------------------------------------------------------------
   11. Score Strip & Metric Cells
   ---------------------------------------------------------------- */
.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.score-strip div,
.metric-cell {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 8px 10px;
  transition: background 150ms ease, border-color 150ms ease;
}

.score-strip div:hover,
.metric-cell:hover {
  background: var(--hover-bg);
}

.score-strip span,
.metric-cell span {
  display: block;
  color: var(--text-label);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.score-strip strong,
.metric-cell strong {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}


/* ----------------------------------------------------------------
   12. Strategy Radar (2x2 grid)
   ---------------------------------------------------------------- */
.strategy-radar {
  margin-top: 10px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.strategy-card {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 9px 10px;
  transition: background 150ms ease, border-color 150ms ease;
}

.strategy-card:hover {
  background: var(--hover-bg);
}

.strategy-card span {
  display: block;
  color: var(--text-label);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.strategy-card strong {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.strategy-card small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}

.strategy-card.hot {
  background: var(--hot-bg);
  border-color: var(--hot-border);
}

.strategy-card.hot:hover {
  background: var(--hot-bg);
  border-color: rgba(22, 163, 74, 0.3);
}


/* ----------------------------------------------------------------
   14. Analysis Blocks (collapsible)
   ---------------------------------------------------------------- */
.analysis-block {
  margin-top: 8px;
  border-top: 1px solid var(--divider);
  padding-top: 8px;
}

.analysis-block summary,
.analysis-block span {
  display: block;
  color: var(--text-label);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.analysis-block p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}


/* ----------------------------------------------------------------
   14b. Score Range Filter
   ---------------------------------------------------------------- */


/* ----------------------------------------------------------------
   14c. Search Status
   ---------------------------------------------------------------- */
.search-status {
  position: fixed;
  z-index: 17;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-muted);
  font-size: 11px;
  pointer-events: none;
  transition: background var(--theme-transition);
}

.search-status:empty {
  display: none;
}


/* ----------------------------------------------------------------
   15. Deal Feed
   ---------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 6px;
}

.section-header h3 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-label);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.section-header span {
  color: var(--text-label);
  font-size: 11px;
  font-weight: 400;
  font-family: ui-monospace, 'SF Mono', monospace;
}

/* ----------------------------------------------------------------
   Deal of the Day card
   ---------------------------------------------------------------- */
.dotd-card {
  margin: 4px 0 8px;
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.dotd-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-label);
}

.dotd-dismiss {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-label);
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.dotd-dismiss:hover { color: var(--text-primary); }

.dotd-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.dotd-pitch {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dotd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.dotd-chips {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dotd-score-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.dotd-price-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.dotd-open-btn {
  padding: 4px 12px;
  font-size: 12px;
}

.deal-list {
  display: grid;
  gap: 3px;
}

.deal-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 10px;
  border-radius: var(--r-button);
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 200ms ease, border-color 200ms ease, padding-left 200ms ease, transform 120ms ease, opacity 300ms ease;
  animation: cardSlideIn 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.deal-card:hover {
  background: var(--hover-bg);
  border-left-color: rgba(255,255,255,0.2);
  padding-left: 12px;
}

[data-theme="dark"] .deal-card:hover {
  border-left-color: rgba(255,255,255,0.15);
}

.deal-card:active {
  transform: scale(0.98);
}

.deal-card.active {
  background: var(--active-card-bg);
  border-color: var(--active-card-border);
  border-left-color: var(--accent);
  padding-left: 12px;
}

.deal-card-info {
  min-width: 0;
}

.deal-card-info h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.deal-card-info p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Score badge - rounded pill */
.deal-card-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

/* Score badge backgrounds - subtle tinted pills */
.deal-card-score.score-hot   { background: rgba(22,163,74,0.12);  color: #16a34a; }
.deal-card-score.score-warm  { background: rgba(120,120,120,0.12); color: var(--text-muted); }
.deal-card-score.score-watch { background: rgba(245,158,11,0.12);  color: #f59e0b; }
.deal-card-score.score-cold  { background: rgba(239,68,68,0.12);   color: #ef4444; }

[data-theme="dark"] .deal-card-score.score-hot   { background: rgba(22,163,74,0.18);  color: #4ade80; }
[data-theme="dark"] .deal-card-score.score-warm  { background: rgba(150,150,150,0.12); color: rgba(255,255,255,0.55); }
[data-theme="dark"] .deal-card-score.score-watch { background: rgba(245,158,11,0.18);  color: #fbbf24; }
[data-theme="dark"] .deal-card-score.score-cold  { background: rgba(239,68,68,0.18);   color: #f87171; }

/* Bare score colors for non-badge usages */
.score-hot   { color: #16a34a; }
.score-warm  { color: var(--underwrite); }
.score-watch { color: #f59e0b; }
.score-cold  { color: #ef4444; }

/* Strategy tag - subtle inline pill */
.deal-card-strategy {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-label);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}


/* ----------------------------------------------------------------
   16. Empty State (duplicate override - see section 5)
   ---------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  text-align: center;
}


/* ----------------------------------------------------------------
   17. Search Trigger (compact pill, opens Cmd+K)
   ---------------------------------------------------------------- */
.search-trigger {
  position: fixed;
  z-index: 16;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  transition: background var(--theme-transition), color 150ms ease, transform 200ms ease;
}

.sidebar-open .search-trigger {
  left: 50%;
  transform: translateX(-50%);
}

.search-trigger:hover {
  color: var(--text-primary);
}

.search-trigger:active {
  transform: translateX(-50%) scale(0.97);
}

.search-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.search-trigger span {
  white-space: nowrap;
}

.search-trigger kbd {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Mobile menu button - bottom-left on mobile */
.mobile-menu-btn {
  position: fixed;
  z-index: 16;
  bottom: 20px;
  left: 14px;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  color: var(--icon-color);
}


/* ----------------------------------------------------------------
   18. (Search suggestions moved to Cmd+K modal)
   ---------------------------------------------------------------- */

.search-suggestion-item:hover,
.search-suggestion-item.highlighted {
  background: var(--hover-bg);
}

.search-suggestion-item h4 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.search-suggestion-item p {
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 1px;
}


/* ----------------------------------------------------------------
   19. Top-Right Map Controls
   ---------------------------------------------------------------- */
.map-hud {
  position: fixed;
  z-index: 15;
  right: 14px;
  top: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
}
/* In expanded mode the sidebar spans the full viewport, so lift the HUD above it
   so Explore/Satellite/Fit-view stay reachable: same surface as sidebar mode. */
body.sidebar-expanded .map-hud {
  z-index: 22;
}
/* Map controls are irrelevant when the sidebar is expanded (map is hidden) */
body.sidebar-expanded .map-mode-toggle,
body.sidebar-expanded #fitPinsBtn {
  display: none;
}

/* map mode segmented control */
.map-mode-toggle {
  display: flex;
  border-radius: var(--r-button);
  padding: 3px;
  overflow: hidden;
}

.map-mode-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: calc(var(--r-button) - 2px);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.map-mode-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.map-mode-btn:active {
  transform: scale(0.96);
}

.map-mode-btn.active {
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0,0,0,0.06);
}

[data-theme="dark"] .map-mode-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* pin button */
.pin-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-button);
  cursor: pointer;
  color: var(--icon-color);
  transition: background var(--theme-transition), color 150ms ease, transform 120ms ease;
}

.pin-btn:hover {
  color: var(--text-primary);
}

.pin-btn:active {
  transform: scale(0.93);
}

.pin-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}


/* ----------------------------------------------------------------
   20. Deal Markers (MapLibre HTML markers)
   ---------------------------------------------------------------- */
.deal-pin {
  width: 14px;
  height: 14px;
  position: relative;
  cursor: pointer;
  transition: transform 200ms ease;
}
.deal-pin:hover { transform: scale(1.4); }
.deal-pin-dot {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
}
.deal-pin-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
}
.deal-pin.selected .deal-pin-ring {
  opacity: 1;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
  animation: pinPulse 1.6s ease-in-out infinite;
}
@keyframes pinPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
}
.deal-pin.hot .deal-pin-dot { background: var(--offer); }
.deal-pin.warm .deal-pin-dot { background: var(--underwrite); }
.deal-pin.watch .deal-pin-dot { background: var(--watchlist); }
.deal-pin.cold .deal-pin-dot { background: var(--pass); }

/* Scout pins */
.scout-pin {
  width: 12px;
  height: 12px;
  position: relative;
  cursor: pointer;
  transition: transform 200ms ease;
}
.scout-pin:hover { transform: scale(1.3); }
.scout-pin-dot {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--underwrite);
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}


/* ----------------------------------------------------------------
   21. Map Popup (glass card - MapLibre)
   ---------------------------------------------------------------- */
.glassy-popup .maplibregl-popup-content {
  overflow: hidden;
  border-radius: var(--r-panel);
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 0;
  max-width: 280px;
  font-family: 'Inter', ui-sans-serif, sans-serif;
  transition: background var(--theme-transition);
}

.glassy-popup .maplibregl-popup-tip {
  border-top-color: var(--glass-bg);
  transition: border-color var(--theme-transition);
}

.glassy-popup .maplibregl-popup-close-button {
  display: none;
}

.map-popup {
  padding: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 40px);
}

[data-theme="dark"] .map-popup {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 40px);
}

.popup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-popup h3 {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.map-popup p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.popup-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.popup-metrics span {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 7px 6px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.popup-metrics small {
  display: block;
  color: var(--text-label);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}

.popup-expand-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--accent);
  font-family: 'Inter', ui-sans-serif, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}

.popup-expand-btn:hover {
  background: var(--hover-bg);
}

.popup-expand-btn:active {
  transform: scale(0.97);
}


/* ----------------------------------------------------------------
   22. MapLibre Overrides
   ---------------------------------------------------------------- */
.maplibregl-map {
  font-family: 'Inter', ui-sans-serif, sans-serif;
}

.maplibregl-ctrl-attrib {
  border-radius: 8px 0 0 0;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  color: var(--text-muted) !important;
  font-size: 10px;
  padding: 2px 6px;
}

.maplibregl-ctrl-attrib a {
  color: var(--text-muted) !important;
}

.maplibregl-ctrl-bottom-right {
  right: 16px !important;
  bottom: 16px !important;
}

.maplibregl-ctrl-group {
  border: var(--glass-border) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  box-shadow: var(--glass-shadow) !important;
}

.maplibregl-ctrl-group button {
  background: transparent !important;
  color: var(--text-muted) !important;
  border: none !important;
  border-bottom: 1px solid var(--divider) !important;
  width: 34px !important;
  height: 34px !important;
  transition: background 150ms ease, color 150ms ease;
}

.maplibregl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.maplibregl-ctrl-group button:hover {
  background: var(--hover-bg) !important;
  color: var(--text-primary) !important;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: opacity(0.5);
  transition: filter 150ms ease;
}

.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
  filter: opacity(0.85);
}

/* hide maplibre logo */
.maplibregl-ctrl-logo {
  display: none !important;
}

.bar-fill.offer     { background: var(--offer); }
.bar-fill.underwrite { background: var(--underwrite); }
.bar-fill.watchlist  { background: var(--watchlist); }
.bar-fill.pass       { background: var(--pass); }


/* ----------------------------------------------------------------
   24. Quick Actions
   ---------------------------------------------------------------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.quick-actions button {
  height: 32px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}

.quick-actions button:hover {
  background: var(--hover-bg);
}

.quick-actions button:active {
  transform: scale(0.96);
}

.guardrail.danger {
  border-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.06);
}

[data-theme="dark"] .guardrail.danger {
  background: rgba(239, 68, 68, 0.1);
}


/* ----------------------------------------------------------------
   26. Chips
   ---------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-badge);
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}


/* ----------------------------------------------------------------
   27. Form Controls
   ---------------------------------------------------------------- */
label {
  display: grid;
  gap: 4px;
  color: var(--text-label);
  font-size: 11px;
  font-weight: 400;
}

select,
input[type="search"],
input[type="text"] {
  width: 100%;
  height: 34px;
  border: var(--input-border);
  border-radius: var(--r-input);
  background: var(--input-bg);
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 400;
  transition: background var(--theme-transition), border-color var(--theme-transition);
}

select:focus,
input[type="search"]:focus,
input[type="text"]:focus {
  border-color: var(--active-card-border);
  outline: none;
}
select:focus-visible,
input[type="search"]:focus-visible,
input[type="text"]:focus-visible,
input[type="number"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 1px;
}

input[type="range"] {
  accent-color: var(--accent);
}

.filter-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}


/* ----------------------------------------------------------------
   28. Scout Badge
   ---------------------------------------------------------------- */
.scout-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-badge);
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}

.shortcut {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-badge);
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  font-family: ui-monospace, 'SF Mono', monospace;
}

.kpi {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 8px 10px;
  transition: background 150ms ease;
}

.kpi:hover {
  background: var(--hover-bg);
}

.kpi span {
  display: block;
  color: var(--text-label);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi strong {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}


/* ----------------------------------------------------------------
   30. (reserved)
   ---------------------------------------------------------------- */


/* ----------------------------------------------------------------
   31. Map Vignette (subtle edge fade)
   ---------------------------------------------------------------- */
.map-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 120% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.06) 80%, rgba(0, 0, 0, 0.14) 100%);
}

[data-theme="dark"] .map-vignette {
  background:
    radial-gradient(ellipse 120% 120% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.18) 75%, rgba(0, 0, 0, 0.35) 100%);
}


/* ----------------------------------------------------------------
   32. Monospace Numbers (utility class)
   ---------------------------------------------------------------- */
.mono {
  font-family: ui-monospace, 'SF Mono', monospace;
}


/* ----------------------------------------------------------------
   33. Responsive - Mobile (max-width: 768px)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {

  /* sidebar becomes full-screen overlay */
  .investor-console {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    padding: 16px 14px;
    z-index: 40;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar-open .investor-console,
  .overlay-open .investor-console {
    transform: translateY(0);
    border-radius: 0;
  }

  /* sidebar toggle hidden on mobile, bottom bar has menu */
  .sidebar-toggle {
    display: none;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .search-trigger span {
    display: none;
  }

  .search-trigger kbd {
    display: none;
  }

  /* top-right controls - smaller on mobile */
  .map-hud {
    top: 10px;
    right: 10px;
    gap: 4px;
  }

  .map-mode-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .pin-btn {
    width: 32px;
    height: 32px;
  }

  /* popup adjustments */
  .glassy-popup .maplibregl-popup-content {
    max-width: 240px !important;
  }

  /* sort pill: meet 30px critical tap-target floor */
  .sort-pill {
    height: 30px;
    min-height: 30px;
  }
  .sort-pill select {
    min-height: 30px;
    height: 30px;
  }
}

/* ----------------------------------------------------------------
   34. Responsive - Tablet (769px to 1024px)
   ---------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .investor-console {
    width: min(300px, calc(100vw - 24px));
  }
}


/* ----------------------------------------------------------------
   35. Overlay State (mobile full-screen panel)
   ---------------------------------------------------------------- */
body.overlay-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"].overlay-open::before {
  background: rgba(0, 0, 0, 0.4);
}


/* ----------------------------------------------------------------
   36. Animations & Transitions
   ---------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.selected-card {
  animation: fadeIn 200ms ease;
}

/* smooth theme transitions on all glass elements */
.glass,
.investor-console,
.search-trigger,
.map-mode-toggle,
.pin-btn,
.sidebar-toggle,
.map-hud,
.filters-toggle-btn,
.filter-select,
.stage,
.deal-card,
.score-strip div,
.metric-cell,
.strategy-card,
.guardrail,
.chip,
.glassy-popup .maplibregl-popup-content {
  transition:
    background var(--theme-transition),
    border-color var(--theme-transition),
    color var(--theme-transition),
    box-shadow var(--theme-transition);
}


/* ----------------------------------------------------------------
   37. Print (minimal)
   ---------------------------------------------------------------- */
@media print {
  .map-vignette,
  .search-trigger,
  .map-hud,
  .sidebar-toggle,
  #map {
    display: none;
  }

  .investor-console {
    position: static;
    width: 100%;
    transform: none;
    border-radius: 0;
    backdrop-filter: none;
    background: #fff;
    box-shadow: none;
    border: none;
  }
}


/* ----------------------------------------------------------------
   38. Cmd+K Search Modal
   ---------------------------------------------------------------- */
.cmd-k-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 96px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  animation: cmdkFadeIn 120ms ease;
}

[data-theme="dark"] .cmd-k-overlay {
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cmd-k-overlay.hidden {
  display: none;
}

@keyframes cmdkFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cmdkSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-k-modal {
  width: 100%;
  max-width: 560px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--glass-shadow), 0 12px 48px rgba(0, 0, 0, 0.08);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  animation: cmdkSlideUp 180ms cubic-bezier(0.2, 0.9, 0.3, 1);
  transition:
    background var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition);
}

[data-theme="dark"] .cmd-k-modal {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--glass-shadow), 0 16px 56px rgba(0, 0, 0, 0.2);
}

.cmd-k-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--divider);
}

.cmd-k-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.6;
}

.cmd-k-modal input {
  flex: 1;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.2px;
  outline: none;
}

.cmd-k-modal input::placeholder {
  color: var(--text-muted);
}

.cmd-k-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

[data-theme="dark"] .cmd-k-results {
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cmd-k-section {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  opacity: 0.7;
}

.cmd-k-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 80ms ease;
}

.cmd-k-result-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.cmd-k-result-item.highlighted {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .cmd-k-result-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cmd-k-result-item.highlighted {
  background: rgba(255, 255, 255, 0.08);
}

.cmd-k-result-item:active {
  background: var(--active-card-bg);
}

.cmd-k-result-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--icon-color);
}

.cmd-k-result-text {
  flex: 1;
  min-width: 0;
}

.cmd-k-result-text h4 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-k-result-text p {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-k-result-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cmd-k-result-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
}

.cmd-k-result-score {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

.cmd-k-result-meta {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-family: ui-monospace, 'SF Mono', monospace;
}

.cmd-k-geo-item {
  opacity: 0.7;
  border-top: 1px solid var(--divider);
  margin-top: 4px;
  padding-top: 10px;
  border-radius: 0 0 10px 10px;
}

.cmd-k-geo-item:hover,
.cmd-k-geo-item.highlighted {
  opacity: 1;
}

.cmd-k-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 14px;
  border-top: 1px solid var(--divider);
  color: rgba(0, 0, 0, 0.4);
  font-size: 11px;
}

[data-theme="dark"] .cmd-k-footer {
  color: rgba(255, 255, 255, 0.4);
}

.cmd-k-footer kbd {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 10px;
  margin: 0 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}


/* ----------------------------------------------------------------
   39. Settings Section (sidebar)
   ---------------------------------------------------------------- */
.settings-section {
  margin-top: 12px;
  border-top: 1px solid var(--divider);
  padding-top: 8px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

.settings-header h3 {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.settings-header .chevron {
  width: 12px;
  height: 12px;
  color: var(--icon-color);
  transition: transform 200ms ease;
}

.settings-header.open .chevron {
  transform: rotate(180deg);
}

.settings-body {
  display: none;
  padding: 4px 0 8px;
}

.settings-body.open {
  display: block;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row > span {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
}

.setting-row label {
  display: inline;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
}

.setting-row select {
  width: auto;
  min-width: 90px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-size: 11px;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.setting-row .setting-input {
  width: auto;
  min-width: 130px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-size: 11px;
  text-align: right;
  color: var(--text-primary);
}

.setting-row .setting-input:focus {
  outline: none;
  border-color: var(--active-card-border);
}
.setting-row .setting-input:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 1px;
}

.setting-row .setting-description {
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 1px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 10px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  transition: background 200ms ease, border-color 200ms ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 200ms ease, background 200ms ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: var(--body-bg);
}

/* Settings select dropdown */
.settings-select {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 90px;
  text-align: right;
}

/* Settings option group */
.settings-group {
  margin-top: 6px;
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  overflow: hidden;
}

.settings-group .setting-row {
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
}

.settings-group .setting-row:last-child {
  border-bottom: none;
}


/* ----------------------------------------------------------------
   40. Deal Focus Mode
   ---------------------------------------------------------------- */
.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.focus-overlay.hidden {
  display: none;
}

body.focus-active .investor-console,
body.focus-active .search-trigger,
body.focus-active .search-status,
body.focus-active .map-hud {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.focus-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 92;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-primary);
  pointer-events: all;
  transition: transform 120ms ease;
}

.focus-close:hover {
  transform: scale(1.08);
}

.focus-panel {
  width: 100%;
  max-width: 720px;
  max-height: 55vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 28px 28px 24px;
  pointer-events: all;
  animation: focusSlideUp 350ms cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -4px 32px rgba(0, 10, 40, 0.1), 0 -16px 64px rgba(0, 10, 40, 0.06);
}

[data-theme="dark"] .focus-panel {
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.3), 0 -16px 64px rgba(0, 0, 0, 0.2);
}

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

.focus-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.focus-header-left h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.focus-header-left p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.focus-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.focus-score {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
}

.focus-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.focus-metric {
  padding: 12px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
}

.focus-metric label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.focus-metric span {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.focus-strategies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.focus-strategy {
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  transition: border-color 150ms ease;
}

.focus-strategy.recommended {
  background: var(--hot-bg);
  border-color: var(--hot-border);
}

.focus-strategy h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.strat-rec-star {
  display: inline-flex;
  align-items: center;
  color: var(--accent, #3b82f6);
  flex-shrink: 0;
}

.focus-strategy .strat-value {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.focus-strategy .strat-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.focus-strategy .strat-explain {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px solid var(--divider);
  padding-top: 6px;
}

.focus-reasons {
  margin-bottom: 16px;
}

.focus-reasons h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.focus-reasons p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.focus-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-size: 12px;
  color: var(--text-muted);
}

.focus-contact strong {
  color: var(--text-primary);
  font-weight: 500;
}


/* ----------------------------------------------------------------
   41. Autocomplete Dropdown (Discover tab)
   ---------------------------------------------------------------- */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.visible { display: block; }
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider);
  transition: background 120ms ease;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active { background: var(--hover-bg); }
.autocomplete-item.active { outline: none; }
.autocomplete-item small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Groups text filter */
.groups-search-wrap {
  padding: 0 0 10px;
}
.groups-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 120ms ease;
}
.groups-search-input::placeholder { color: var(--text-muted); }
.groups-search-input:focus { border-color: var(--accent); }


/* ----------------------------------------------------------------
   42. Sidebar Deal Detail View
   ---------------------------------------------------------------- */
.detail-back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-back-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  cursor: pointer;
  color: var(--text-primary);
  transition: background 120ms ease;
  flex-shrink: 0;
}

.detail-back-btn:hover {
  background: var(--hover-bg);
}

.detail-action-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.detail-icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  cursor: pointer;
  color: var(--icon-color);
  transition: background 120ms ease, color 120ms ease;
}

.detail-icon-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.detail-icon-btn.saved {
  color: var(--watchlist);
}

.detail-address {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.25;
  margin-bottom: 3px;
}

.detail-location {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.detail-metric {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 9px 10px;
  transition: background 150ms ease;
}

.detail-metric:hover {
  background: var(--hover-bg);
}

.detail-metric span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-label);
  margin-bottom: 3px;
}

.detail-metric strong {
  display: block;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.detail-prop-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-badge);
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  margin-right: 6px;
}


/* ----------------------------------------------------------------
   43. Expand Overlay (Full-screen deal detail)
   ---------------------------------------------------------------- */
/* Expand overlay - hidden until .visible is added, then animates in */
.expand-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.expand-overlay.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  animation: expandSlideUpFull 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.expand-overlay.closing {
  animation: expandSlideDownFull 240ms cubic-bezier(0.36, 0, 0.78, 0) both;
}

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

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

/* Expand header bar - fixed at top */
.expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  min-height: 56px;
}
.expand-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.expand-header-back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  cursor: pointer;
  color: var(--text-primary);
  transition: background 120ms ease;
  flex-shrink: 0;
}
.expand-header-back:hover {
  background: var(--hover-bg);
}
.expand-header-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.expand-header-center h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expand-header-center p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expand-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.expand-export-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.expand-export-btn:hover {
  background: var(--hover-bg);
}

/* Expand body - scrollable content */
.expand-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 100px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}
.expand-body::-webkit-scrollbar {
  width: 4px;
}
.expand-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}
[data-theme="dark"] .expand-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
}
.expand-body-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* Expand close button */
.expand-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 101;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 10px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  transition: background 120ms ease;
}
.expand-close:hover {
  background: var(--hover-bg);
}

/* Expand section labels */
.expand-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 28px;
}
.expand-section-label:first-child {
  margin-top: 0;
}

/* Property overview row */
.expand-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.expand-overview-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.expand-deal-score {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
}
.expand-risk-score {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}
.expand-prop-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

/* Editable metrics grid */
.expand-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.expand-metric-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  transition: background 150ms ease, border-color 150ms ease;
}
.expand-metric-card:hover {
  background: var(--hover-bg);
}
.expand-metric-card label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-label);
  margin-bottom: 4px;
}
.expand-metric-input {
  width: 100%;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  transition: border-color 150ms ease, background 150ms ease;
}
.expand-metric-input:hover {
  background: var(--hover-bg);
}
.expand-metric-input:focus {
  outline: none;
  border-color: var(--active-card-border);
  background: var(--input-bg);
}

/* Strategy cards in expand */
.expand-strategies {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.expand-strategy {
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  transition: border-color 150ms ease;
}
.expand-strategy.recommended {
  background: var(--hot-bg);
  border-color: var(--hot-border);
}
.expand-strategy h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.expand-strategy .strat-value {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.expand-strategy .strat-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.expand-strategy .strat-explain {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px solid var(--divider);
  padding-top: 6px;
}

/* AI Analysis in expand */
.expand-ai-section {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
}
.expand-ai-section h4 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.expand-ai-section p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}
.expand-ai-section .ai-loading {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Deal intelligence in expand */
.expand-intel {
  margin-top: 8px;
}
.expand-intel-block {
  margin-bottom: 10px;
}
.expand-intel-block h4 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.expand-intel-block p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
}
.expand-contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  font-size: 12px;
  color: var(--text-muted);
}
.expand-contact-card strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Actions bar - sticky at bottom */
.expand-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--divider);
  background: var(--body-bg);
  flex-shrink: 0;
}
.expand-actions-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.expand-offer-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: var(--r-button);
  background: var(--offer);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: opacity 150ms ease, transform 120ms ease;
}
.expand-offer-btn:hover {
  opacity: 0.88;
}
.expand-offer-btn:active {
  transform: scale(0.97);
  opacity: 0.82;
}
.expand-offer-btn:focus-visible {
  outline: 2px solid var(--offer);
  outline-offset: 2px;
}
.expand-watchlist-btn {
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
  white-space: nowrap;
}
.expand-watchlist-btn:hover {
  background: var(--hover-bg);
}
.expand-watchlist-btn:active {
  transform: scale(0.97);
}
.expand-watchlist-btn.saved {
  color: var(--watchlist);
}

/* Inline actions within expanded sidebar */
.expand-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}
.expand-inline-actions .expand-offer-btn {
  flex: 1;
  height: 40px;
  font-size: 13px;
}
.expand-inline-actions .expand-watchlist-btn {
  height: 40px;
  padding: 0 16px;
  font-size: 12px;
}

/* Adapt expand styles for sidebar context */
.sidebar-expanded .expand-metrics-grid {
  grid-template-columns: repeat(3, 1fr);
}
.sidebar-expanded .expand-section-label:first-of-type {
  margin-top: 18px;
}

@media (max-width: 768px) {
  .expand-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Activity Feed */

.activity-feed {
  padding: 0 16px 16px;
}

.activity-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--theme-transition), border-radius var(--theme-transition);
  animation: activityFadeIn 300ms ease both;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: var(--hover-bg);
  border-radius: 10px;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 2px;
}

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

/* Network Panel */

.network-panel {
  padding: 0 2px;
}

.network-sub-nav {
  display: flex;
  gap: 4px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}

.network-sub-btn {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}

.network-sub-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.network-sub-btn.active {
  background: var(--accent);
  color: var(--body-bg);
  border-color: var(--accent);
}

.network-compose-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 150ms ease;
}

.network-compose-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.network-thread {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms ease;
  align-items: flex-start;
}

.network-thread:hover {
  background: var(--hover-bg);
  border-radius: 8px;
}

.network-thread:last-child {
  border-bottom: none;
}

.network-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
}

.network-thread-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.network-thread-name {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.network-thread-preview {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-thread-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
}

.network-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
}

.network-role-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.network-contact-card {
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  gap: 10px;
  align-items: center;
}

.network-contact-card:last-child {
  border-bottom: none;
}

/* ---- Network Feed ---- */
.network-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms ease;
}

.feed-item:last-child { border-bottom: none; }

.feed-item:hover { background: var(--hover-bg); }

.feed-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.feed-item-body {
  flex: 1;
  min-width: 0;
}

.feed-item-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
}

.feed-item-actor {
  font-weight: 600;
}

.feed-item-action {
  color: var(--text-secondary, var(--text-muted));
}

.feed-item-target {
  font-weight: 500;
}

.feed-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Pending Requests ---- */
.pending-requests {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.pending-requests-loading {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.feed-actor-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 180px;
  max-width: 240px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.feed-actor-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feed-actor-card-headline {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.feed-actor-card-connect {
  display: block;
  width: 100%;
  padding: 6px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.feed-actor-card-connect:hover { opacity: 0.88; }

.feed-item-actor {
  cursor: pointer;
}

.feed-item-actor:hover { text-decoration: underline; }

.pending-requests-hdr {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.pending-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
}

.pending-request-row:last-child { border-bottom: none; }

.pending-request-info {
  flex: 1;
  min-width: 0;
}

.pending-request-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-request-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.pending-request-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.pending-request-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 120ms ease;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.pending-request-btn:hover {
  background: var(--hover-bg);
  border-color: var(--text-muted);
}

.pending-request-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================================================================
   INVESTORS TAB
   ================================================================ */

.investors-hdr {
  padding: 12px 16px 4px;
}
.investors-hdr h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.investors-loading {
  padding: 32px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.investors-empty {
  padding: 48px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}
.investors-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 16px;
}
.investor-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider, rgba(0,0,0,0.06));
  background: var(--glass-bg);
  transition: background 100ms ease;
}
.investor-card:hover {
  background: var(--surface-hover, rgba(0,0,0,0.03));
}
.investor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.investor-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.investor-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.investor-handle {
  font-size: 11px;
  color: var(--text-muted);
}
.investor-headline {
  font-size: 11px;
  color: var(--text-secondary, var(--text-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.investor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.investor-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-elev, rgba(0,0,0,0.06));
  color: var(--text-secondary, var(--text-muted));
  border: 1px solid var(--divider, rgba(0,0,0,0.08));
}
.investor-chip-strategy {
  background: var(--accent-subtle, rgba(99,102,241,0.08));
  color: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
}
.investor-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-top: 2px;
}
.investor-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 120ms ease, background 120ms ease;
  white-space: nowrap;
}
.investor-btn-primary {
  background: var(--accent, #6366f1);
  color: #fff;
  border-color: var(--accent, #6366f1);
}
.investor-btn-primary:hover {
  opacity: 0.85;
}
.investor-btn-disabled {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--divider, rgba(0,0,0,0.12));
  cursor: not-allowed;
  opacity: 0.7;
}

/* ---- Activity icon color for network group ---- */
.ax-icon-network {
  color: var(--accent, #6366f1);
}

.network-contact-detail {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.network-verified {
  color: var(--color-success);
  font-size: 10px;
  vertical-align: middle;
  margin-left: 2px;
}

.forum-thread {
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms ease;
}

.forum-thread:hover {
  background: var(--hover-bg);
  border-radius: 8px;
}

.forum-thread:last-child {
  border-bottom: none;
}

.forum-title {
  font-size: 13px;
  font-weight: 500;
}

.forum-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.forum-replies {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.6;
}


/* Saved Tab Enhanced + Settings */

.saved-card-strategy {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 4px;
}

.saved-card-note {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  font-style: italic;
}

.saved-note-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}

.saved-note-btn:hover {
  opacity: 1;
}

.saved-clear-btn {
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  margin-left: auto;
  transition: opacity 200ms ease, color 200ms ease, transform 200ms ease;
}

.saved-clear-btn:hover {
  opacity: 1;
  color: var(--color-danger);
  transform: translateY(-1px);
}
.saved-clear-btn:active { transform: scale(0.96); transition-duration: 80ms; }
.saved-clear-btn:focus-visible { outline: 2px solid #ffcd33; outline-offset: 2px; }

/* ================================================================
   Card-view Bulk Select: Select button, checkboxes, bulk bar, tag popover
   ================================================================ */

/* "Select" button in Saved pane toolbar */
.sd-select-btn {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  border-radius: 6px;
  color: var(--text-muted, #888);
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}
.sd-select-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary, #eee); transform: translateY(-1px); }
.sd-select-btn:active { transform: scale(0.97); transition-duration: 80ms; }
.sd-select-btn:focus-visible { outline: 2px solid #ffcd33; outline-offset: 2px; }
.sd-select-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.sd-select-btn:disabled:hover { background: var(--input-bg, rgba(255,255,255,0.05)); color: var(--text-muted, #888); transform: none; }
.sd-select-btn.sd-select-active {
  background: rgba(79,142,247,0.14);
  border-color: rgba(79,142,247,0.5);
  color: #7ab3fa;
}

/* Selection mode: subtle tint on cards, suppress hover movement */
.deal-card.sd-mode:hover { padding-left: 10px; }
.deal-card.sd-selected {
  background: rgba(79,142,247,0.10) !important;
  border-color: rgba(79,142,247,0.30) !important;
  border-left-color: rgba(79,142,247,0.60) !important;
}

/* Checkbox wrapper inside card (top-left) */
.sd-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  pointer-events: none;
}
.deal-card { position: relative; }
.sd-card-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
  accent-color: var(--accent, #4f8ef7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  appearance: auto;
}

/* Bulk action bar (glass, slides up from bottom-center - body-level so fixed is viewport-relative) */
.sd-bulk-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface, rgba(22,22,26,0.97));
  border: 1px solid var(--border, rgba(255,255,255,0.13));
  border-radius: 10px;
  box-shadow: 0 8px 36px rgba(0,0,0,0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: bottom 220ms ease, opacity 220ms ease;
  white-space: nowrap;
}
.sd-bulk-bar.sd-open {
  bottom: 20px;
  opacity: 1;
  pointer-events: auto;
}
.sd-bulk-count {
  font-size: 12px;
  color: var(--text-muted, #aaa);
  font-weight: 500;
  padding-right: 10px;
  border-right: 1px solid var(--border, rgba(255,255,255,0.08));
}
.sd-bulk-count span { color: var(--accent, #4f8ef7); font-weight: 700; }
.sd-bulk-actions { display: flex; gap: 6px; align-items: center; }

/* Tag popover */
.sd-tag-popover {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 201;
  background: var(--surface, rgba(22,22,26,0.98));
  border: 1px solid var(--border, rgba(255,255,255,0.13));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 14px;
  min-width: 240px;
  max-width: 320px;
}
.sd-tag-popover-inner { display: flex; flex-direction: column; gap: 8px; }
.sd-tag-existing { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.sd-tag-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  color: var(--text-muted, #aaa);
  cursor: pointer;
}
.sd-tag-chip:hover { background: rgba(79,142,247,0.15); color: #7ab3fa; border-color: rgba(79,142,247,0.4); }
.sd-tag-hint { font-size: 11px; color: var(--text-muted, #777); font-style: italic; }
.sd-tag-input-row { display: flex; gap: 6px; }
.sd-tag-input {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  color: var(--text-primary, #eee);
  outline: none;
}
.sd-tag-input:focus { border-color: rgba(79,142,247,0.5); }


/* Insights Dashboard */

.insights-panel {
  padding: 0 2px;
}

.insight-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  animation: insightFadeIn 300ms ease both;
}

.insight-card:nth-child(2) { animation-delay: 60ms; }
.insight-card:nth-child(3) { animation-delay: 120ms; }
.insight-card:nth-child(4) { animation-delay: 180ms; }

.insight-card-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.insight-market-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}

.insight-market-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.insight-market-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.insight-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-subtle);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.insight-market-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.insight-market-stat {
  font-size: 13px;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--text-primary);
}

.insight-market-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.insight-trend-up {
  color: var(--color-success);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.insight-trend-down {
  color: var(--color-danger);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.insight-strategy-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.insight-strategy-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  width: 68px;
  flex-shrink: 0;
}

.insight-strategy-bar-wrap {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--accent-subtle);
  overflow: hidden;
  min-width: 40px;
}

.insight-strategy-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--accent);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.insight-strategy-detail {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
  min-width: 0;
}

.insight-strategy-detail strong {
  color: var(--text-primary);
  font-weight: 600;
}

.insight-card-ai {
  border: 1px solid var(--divider);
  background: var(--glass-inner-bg);
}

.insight-ai-brief {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.insight-ai-footer {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.5;
}

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


/* ================================================================
   Fullscreen Property View - Zillow-style
   ================================================================ */

/* Sticky header - pinned at top of scroll container */
.expand-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--divider);
  min-height: 52px;
}

.expand-sticky-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.expand-sticky-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.expand-sticky-addr {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expand-sticky-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.expand-sticky-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.expand-sticky-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-badge);
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', monospace;
  letter-spacing: -0.3px;
}

.expand-sticky-score.score-hot {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.expand-sticky-score.score-warm {
  background: rgba(120, 120, 120, 0.1);
  color: var(--underwrite);
}

.expand-sticky-score.score-watch {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.expand-sticky-score.score-cold {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

[data-theme="dark"] .expand-sticky-score.score-hot {
  background: rgba(22, 163, 74, 0.18);
  color: #4ade80;
}

[data-theme="dark"] .expand-sticky-score.score-watch {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .expand-sticky-score.score-cold {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

/* Scrollable body beneath sticky header */
.expand-scroll-body {
  padding: 0 20px 40px;
}

/* Property hero */
.expand-hero {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--divider);
}

.expand-hero .stage {
  margin-bottom: 10px;
}

.expand-hero-addr {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin: 8px 0 4px;
  line-height: 1.2;
}

.expand-hero-loc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Facts row - beds/baths/sqft/lot/year */
.expand-facts-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.expand-fact {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.expand-fact strong {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  margin-right: 3px;
}

.expand-fact-sep {
  color: var(--text-label);
  font-size: 14px;
  user-select: none;
}

/* Score strip override for scroll body context */
.expand-scroll-body .score-strip {
  margin-top: 16px;
  margin-bottom: 4px;
}

/* Generic section wrapper */
.expand-section {
  padding-top: 20px;
}

/* Section header */
.expand-section-header {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}

/* Placeholder glass cards */
.expand-placeholder-card {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 20px 18px;
}

.expand-placeholder-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* Override metrics grid to 3-col in fullscreen scroll body */
.expand-scroll-body .expand-metrics-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Override strategies to 2-col grid in fullscreen scroll body */
.expand-scroll-body .expand-strategies {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Action buttons spacing inside scroll body */
.expand-scroll-body .expand-inline-actions {
  margin-top: 24px;
  padding-top: 20px;
}

/* Intel section inside scroll body */
.expand-scroll-body .expand-intel {
  margin-top: 0;
}

/* Responsive - stack on narrow viewports */
@media (max-width: 640px) {
  .expand-scroll-body .expand-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .expand-scroll-body .expand-strategies {
    grid-template-columns: 1fr;
  }
  .expand-hero-addr {
    font-size: 18px;
  }
  .expand-facts-row {
    gap: 4px;
  }
  .expand-fact strong {
    font-size: 14px;
  }
}


/* ================================================================
   Investment Calculator & Strategy Comparison - Insights Tab
   ================================================================ */

.insight-calc-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  animation: insightFadeIn 300ms ease both;
  animation-delay: 240ms;
}

.insight-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.insight-calc-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.insight-calc-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-button);
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  color: var(--text-primary);
  font-size: 13px;
  font-family: ui-monospace, 'SF Mono', monospace;
  outline: none;
  transition: border-color 150ms ease;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.insight-calc-input::-webkit-inner-spin-button,
.insight-calc-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.insight-calc-input:focus {
  border-color: var(--accent);
}

.insight-calc-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.insight-calc-btn {
  width: 100%;
  height: 36px;
  margin-top: 14px;
  border: none;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--glass-bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.insight-calc-btn:hover {
  opacity: 0.85;
}

.insight-calc-btn:active {
  opacity: 0.7;
}

.insight-calc-results {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
  display: none;
}

.insight-calc-results.visible {
  display: block;
}

.insight-calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
}

.insight-calc-result-label {
  color: var(--text-muted);
  font-weight: 500;
}

.insight-calc-result-value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 13px;
}

.insight-calc-result-value.positive {
  color: var(--color-success);
}

.insight-calc-result-value.negative {
  color: var(--color-danger);
}

/* Strategy Comparison */
.insight-strategy-compare {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.insight-strategy-col {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-button);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 200ms ease;
}

.insight-strategy-best {
  border-color: var(--color-success);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.insight-strategy-col-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.insight-strategy-col-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.insight-strategy-col-row .label {
  color: var(--text-muted);
}

.insight-strategy-col-row .value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px;
}

.insight-strategy-col-row .value.positive {
  color: var(--color-success);
}

.insight-strategy-col-row .value.negative {
  color: var(--color-danger);
}

.insight-strategy-recommended {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-success);
  margin-top: 2px;
}

.insight-strategy-not-rec {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 2px;
}

.insight-risk-low  { color: var(--color-success); }
.insight-risk-med  { color: var(--color-warning); }
.insight-risk-high { color: var(--color-danger); }

/* Strategy grid: 6 columns for full compare */
.insight-strategy-compare {
  grid-template-columns: repeat(6, 1fr);
}

.insight-strategy-best-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-success);
  border: 1px solid var(--color-success);
  border-radius: 4px;
  padding: 2px 5px;
  display: inline-block;
  margin-bottom: 2px;
}

.insight-strategy-col-extra {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: ui-monospace, 'SF Mono', monospace;
}

/* Calculator slider row */
.insight-calc-slider-row,
.insight-calc-term-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
}

.insight-calc-slider-label {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
  font-size: 11px;
}

.insight-calc-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.insight-calc-slider-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  min-width: 36px;
  text-align: right;
}

.insight-calc-select {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-button);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Responsive - 3 columns on narrower sidebar */
@media (max-width: 600px) {
  .insight-strategy-compare {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive - 2 columns on narrower sidebar */
@media (max-width: 480px) {
  .insight-strategy-compare {
    grid-template-columns: repeat(2, 1fr);
  }
  .insight-calc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Responsive - 1 column on very narrow */
@media (max-width: 340px) {
  .insight-strategy-compare {
    grid-template-columns: 1fr;
  }
  .insight-calc-grid {
    grid-template-columns: 1fr;
  }
}


/* ================================================================
   Compare Mode
   ================================================================ */

.compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  margin-left: 4px;
}

.compare-btn:hover {
  opacity: 1;
}

.compare-btn.active {
  opacity: 1;
  color: var(--accent);
}

.compare-banner {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0 6px;
  text-align: center;
  letter-spacing: -0.1px;
}

.compare-banner strong {
  color: var(--text-primary);
}

.compare-run-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  margin: 4px 0 8px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--body-bg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  border: none;
  transition: opacity 150ms;
}

.compare-run-btn:hover {
  opacity: 0.85;
}

.compare-run-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.compare-exit-btn {
  display: block;
  width: 100%;
  padding: 7px 0;
  margin: 0 0 10px;
  border-radius: var(--r-button);
  background: none;
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.compare-exit-btn:hover {
  color: var(--text-primary);
}

.deal-card.compare-selected {
  border-color: var(--accent) !important;
  background: var(--active-card-bg);
}

.deal-card .compare-check {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  font-size: 10px;
  line-height: 1;
}

.compare-mode .deal-card {
  grid-template-columns: auto 1fr auto;
}

.compare-mode .deal-card .compare-check {
  display: flex;
}

.deal-card.compare-selected .compare-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--body-bg);
}

/* Compare table */
.compare-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  overflow: hidden;
  font-size: 11px;
}

.compare-table th,
.compare-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

.compare-table tr:last-child td,
.compare-table tr:last-child th {
  border-bottom: none;
}

.compare-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-table th:first-child {
  color: var(--text-label);
  font-weight: 500;
  font-size: 10px;
  min-width: 80px;
}

.compare-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 10px;
}

.compare-table td {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.compare-winner {
  color: var(--color-success);
  background: rgba(22, 163, 74, 0.08);
}

[data-theme="dark"] .compare-winner {
  background: rgba(22, 163, 74, 0.12);
}


/* ================================================================
   Report Snapshot
   ================================================================ */

.saved-report-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  vertical-align: middle;
}

.saved-report-btn:hover {
  opacity: 1;
}

.saved-report-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-success);
  cursor: pointer;
  padding: 2px;
  opacity: 0.7;
  margin-left: 4px;
  vertical-align: middle;
  transition: opacity 150ms;
}

.saved-report-icon:hover {
  opacity: 1;
}

/* Report modal */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: reportFadeIn 200ms ease;
}

.report-modal {
  width: min(340px, 90vw);
  max-height: 70vh;
  overflow-y: auto;
  border-radius: var(--r-panel);
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 18px;
  animation: reportSlideUp 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.report-modal-header h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.report-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0.6;
}

.report-modal-close:hover {
  opacity: 1;
}

.report-modal-date {
  font-size: 10px;
  color: var(--text-label);
  margin-bottom: 10px;
}

.report-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--divider);
  border-radius: var(--r-cell);
  overflow: hidden;
  margin-bottom: 12px;
}

.report-modal-cell {
  background: var(--glass-inner-bg);
  padding: 8px 10px;
}

.report-modal-cell span {
  display: block;
  font-size: 10px;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.report-modal-cell strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.report-modal-delete {
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
}

.report-modal-delete:hover {
  opacity: 1;
  color: var(--color-danger);
}


/* ================================================================
   Unified Toast Notification System
   ================================================================ */

#toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
  width: 320px;
}

@media (max-width: 639px) {
  #toast-stack {
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    align-items: stretch;
  }
}

.sq-toast {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 320px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: pointer;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  animation: sqToastIn 200ms ease-out forwards;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 639px) {
  .sq-toast {
    width: 100%;
  }
}

.sq-toast.sq-toast-type-success {
  border-left-color: rgba(255, 255, 255, 0.6);
}

.sq-toast.sq-toast-type-info {
  border-left-color: rgba(255, 255, 255, 0.3);
}

.sq-toast.sq-toast-type-warn {
  border-left-color: #d99a3a;
}

.sq-toast.sq-toast-type-error {
  border-left-color: #c46b6b;
}

.sq-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.sq-toast-message {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 3px;
  letter-spacing: -0.1px;
}

.sq-toast-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.sq-toast-action {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  opacity: 0.7;
  letter-spacing: -0.1px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sq-toast-action:hover {
  opacity: 1;
}

.sq-toast.sq-toast-out {
  animation: sqToastOut 200ms ease-in forwards;
  pointer-events: none;
}

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

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

/* Legacy toast-container: hidden; new system uses #toast-stack injected by JS */
.toast-container {
  display: none !important;
}

@keyframes reportFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reportSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ================================================================
   Property Details / Price History / Tax / Neighborhood - Expand View
   ================================================================ */

/* ── Property Details Grid ─────────────────────────────────────── */
.expand-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.expand-detail-group {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 16px 18px 12px;
}

.expand-detail-group h5 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.expand-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider);
}

.expand-detail-row:last-child {
  border-bottom: none;
}

.expand-detail-row span {
  font-size: 13px;
  color: var(--text-muted);
}

.expand-detail-row strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Price History Table ───────────────────────────────────────── */
.expand-history-table {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  overflow: hidden;
}

.expand-history-table table {
  width: 100%;
  border-collapse: collapse;
}

.expand-history-table thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--divider);
}

.expand-history-table tbody td {
  font-size: 13px;
  padding: 10px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider);
}

.expand-history-table tbody tr:last-child td {
  border-bottom: none;
}

.expand-history-current {
  background: var(--accent-subtle);
}

.expand-history-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

.expand-history-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
[data-theme="dark"] .expand-history-active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.expand-history-reduced {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
[data-theme="dark"] .expand-history-reduced {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.expand-history-listed {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
[data-theme="dark"] .expand-history-listed {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.expand-history-sold {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}
[data-theme="dark"] .expand-history-sold {
  background: rgba(107, 114, 128, 0.18);
  color: #9ca3af;
}

.expand-history-up {
  color: #059669;
  font-weight: 500;
  font-size: 12px;
}
[data-theme="dark"] .expand-history-up {
  color: #34d399;
}

.expand-history-down {
  color: var(--color-danger);
  font-weight: 500;
  font-size: 12px;
}
[data-theme="dark"] .expand-history-down {
  color: #f87171;
}

/* ── Tax & Financial Grid ──────────────────────────────────────── */
.expand-finance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.expand-finance-group {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 16px 18px 12px;
}

.expand-finance-group h5 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

/* Cash Flow Estimate spans full width */
.expand-finance-group:last-child {
  grid-column: 1 / -1;
}

.expand-cashflow-positive strong {
  color: #059669 !important;
}
[data-theme="dark"] .expand-cashflow-positive strong {
  color: #34d399 !important;
}

.expand-cashflow-negative strong {
  color: var(--color-danger) !important;
}
[data-theme="dark"] .expand-cashflow-negative strong {
  color: #f87171 !important;
}

/* ── Neighborhood Section ──────────────────────────────────────── */
.expand-neighborhood-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expand-score-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.expand-score-pill {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 16px 14px;
  text-align: center;
}

.expand-score-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.expand-score-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.expand-score-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.expand-schools-wrap {
  border-radius: var(--r-panel);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 16px 18px 12px;
}

.expand-schools-wrap h5 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.expand-school-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
}

.expand-school-row:last-child {
  border-bottom: none;
}

.expand-school-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.expand-school-rating {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 12px;
}

.expand-school-dist {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
}

.expand-map-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--r-panel);
  background: var(--accent-subtle);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.expand-map-btn:hover {
  background: var(--divider);
}

/* ── Responsive - stack grids on narrow ────────────────────────── */
@media (max-width: 640px) {
  .expand-detail-grid,
  .expand-finance-grid {
    grid-template-columns: 1fr;
  }
  .expand-score-pills {
    grid-template-columns: 1fr;
  }
  .expand-finance-group:last-child {
    grid-column: auto;
  }
}


/* ================================================================
   ANIMATION POLISH
   ================================================================ */

/* ----------------------------------------------------------------
   A1. Sidebar open/close - smooth slide with cubic-bezier
   ---------------------------------------------------------------- */
.investor-console {
  transition:
    transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1),
    width 300ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background var(--theme-transition);
  will-change: transform;
}

/* ----------------------------------------------------------------
   A2. Tab switching - fade transition for panel content
   ---------------------------------------------------------------- */
.tab-panel {
  animation: tabFadeSwitch 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ----------------------------------------------------------------
   A3. Deal card hover - subtle lift with shadow
   ---------------------------------------------------------------- */
.deal-card {
  transition:
    background 200ms ease,
    border-color 200ms ease,
    padding-left 200ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    opacity 300ms ease;
}

.deal-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .deal-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.deal-card:active {
  transform: translateY(0) scale(0.98);
}

/* ----------------------------------------------------------------
   A4. Nav icon active state - smooth color transition
   ---------------------------------------------------------------- */
.nav-icon {
  transition:
    background 180ms ease,
    color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 120ms ease;
}

.header-icon-btn {
  transition:
    background 180ms ease,
    color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 120ms ease;
}

/* ----------------------------------------------------------------
   A5. Fullscreen expand - handled in section 43
   ---------------------------------------------------------------- */

/* ----------------------------------------------------------------
   A6. Activity feed items - staggered fade-in
   ---------------------------------------------------------------- */
.activity-item {
  animation: activityStagger 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.activity-item:nth-child(1)  { animation-delay: 0ms; }
.activity-item:nth-child(2)  { animation-delay: 40ms; }
.activity-item:nth-child(3)  { animation-delay: 80ms; }
.activity-item:nth-child(4)  { animation-delay: 120ms; }
.activity-item:nth-child(5)  { animation-delay: 160ms; }
.activity-item:nth-child(6)  { animation-delay: 200ms; }
.activity-item:nth-child(7)  { animation-delay: 240ms; }
.activity-item:nth-child(8)  { animation-delay: 280ms; }
.activity-item:nth-child(9)  { animation-delay: 320ms; }
.activity-item:nth-child(10) { animation-delay: 360ms; }
.activity-item:nth-child(11) { animation-delay: 400ms; }
.activity-item:nth-child(12) { animation-delay: 440ms; }

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

/* ----------------------------------------------------------------
   A7. Network messages - slide-in from left
   ---------------------------------------------------------------- */
.network-thread {
  animation: networkSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.network-thread:nth-child(1) { animation-delay: 0ms; }
.network-thread:nth-child(2) { animation-delay: 50ms; }
.network-thread:nth-child(3) { animation-delay: 100ms; }
.network-thread:nth-child(4) { animation-delay: 150ms; }
.network-thread:nth-child(5) { animation-delay: 200ms; }
.network-thread:nth-child(6) { animation-delay: 250ms; }

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

/* Network contact cards - also stagger */
.network-contact-card {
  animation: networkSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.network-contact-card:nth-child(1) { animation-delay: 0ms; }
.network-contact-card:nth-child(2) { animation-delay: 50ms; }
.network-contact-card:nth-child(3) { animation-delay: 100ms; }
.network-contact-card:nth-child(4) { animation-delay: 150ms; }
.network-contact-card:nth-child(5) { animation-delay: 200ms; }


/* ================================================================
   RESPONSIVE - TABLET (max-width: 768px) - Enhanced
   ================================================================ */
@media (max-width: 768px) {

  /* --- Sidebar: full-width overlay sliding from left --- */
  .investor-console {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    border-radius: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .sidebar-open .investor-console,
  .overlay-open .investor-console {
    transform: translateX(0);
  }

  /* Map stays full screen behind */
  #map {
    position: fixed;
    inset: 0;
    z-index: 1;
  }

  /* Sidebar toggle becomes floating hamburger */
  .sidebar-toggle {
    display: grid;
    position: fixed;
    z-index: 20;
    left: 14px;
    top: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .sidebar-open .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
  }

  /* Mobile menu button visible */
  .mobile-menu-btn {
    display: grid;
  }

  /* Cmd+K modal: full width with less padding */
  .cmd-k-overlay {
    padding-top: 8vh;
    padding-left: 10px;
    padding-right: 10px;
  }

  .cmd-k-modal {
    max-width: 100%;
    border-radius: 14px;
  }

  .cmd-k-input-row {
    padding: 0 14px;
  }

  .cmd-k-modal input {
    height: 48px;
    font-size: 16px; /* prevent iOS zoom */
  }

  .cmd-k-results {
    max-height: 50vh;
  }

  /* Deal cards: larger touch targets */
  .deal-card {
    padding: 12px 12px;
    min-height: 52px;
  }

  .deal-card-info h3 {
    font-size: 14px;
  }

  .deal-card-info p {
    font-size: 12px;
  }

  .deal-card-score {
    font-size: 16px;
  }

  /* Fullscreen expand: single column for metrics and strategies */
  .expand-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .expand-strategies {
    grid-template-columns: 1fr !important;
  }

  .expand-scroll-body .expand-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .expand-scroll-body .expand-strategies {
    grid-template-columns: 1fr !important;
  }

  /* Score strip: shrink for mobile */
  .score-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .score-strip strong {
    font-size: 16px;
  }

  .score-strip span {
    font-size: 10px;
  }

  /* Map controls: smaller */
  .map-hud {
    top: 10px;
    right: 10px;
    gap: 4px;
  }

  .map-mode-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .pin-btn {
    width: 32px;
    height: 32px;
  }

  /* Search trigger: icon only */
  .search-trigger span {
    display: none;
  }

  .search-trigger kbd {
    display: none;
  }

  .search-trigger {
    padding: 0 12px;
    height: 36px;
  }

  /* Focus panel: full width */
  .focus-panel {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 20px;
    max-height: 65vh;
  }

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

  .focus-strategies {
    grid-template-columns: 1fr;
  }

  /* Sidebar content padding */
  .sidebar-content {
    padding: 14px 16px;
  }

  /* Tab panel headers */
  .tab-panel-header {
    padding: 4px 0 10px;
  }

  /* Popup adjustments */
  .glassy-popup .maplibregl-popup-content {
    max-width: 240px !important;
  }

  /* Filter controls: larger touch targets */
  .filter-apply-btn {
    height: 44px;
    font-size: 14px;
  }

  .filter-select,
  .filter-input {
    height: 38px;
    font-size: 13px;
  }

  /* Strategy cards in detail */
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  /* Detail metrics grid */
  .detail-metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Expand header adjustments */
  .expand-sticky-header {
    padding: 10px 14px;
  }

  .expand-scroll-body {
    padding: 0 14px 40px;
  }

  .expand-hero-addr {
    font-size: 18px;
  }

  /* Expand detail/finance grids single column */
  .expand-detail-grid,
  .expand-finance-grid {
    grid-template-columns: 1fr;
  }

  .expand-score-pills {
    grid-template-columns: 1fr;
  }
}


/* ================================================================
   RESPONSIVE - PHONE (max-width: 480px)
   ================================================================ */
@media (max-width: 480px) {

  /* --- Header nav icons: smaller gap, slightly smaller icons --- */
  .header-nav {
    gap: 1px;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
  }

  .nav-icon svg {
    width: 14px;
    height: 14px;
  }

  .header-actions {
    gap: 1px;
  }

  .header-icon-btn {
    width: 26px;
    height: 26px;
  }

  .header-icon-btn svg {
    width: 12px;
    height: 12px;
  }

  /* --- Search trigger pill: just show icon + key hint --- */
  .search-trigger {
    gap: 6px;
    padding: 0 10px;
    height: 34px;
    font-size: 12px;
  }

  .search-trigger span {
    display: none;
  }

  .search-trigger kbd {
    display: inline-flex;
    font-size: 10px;
    height: 16px;
    padding: 0 4px;
  }

  /* --- Deal cards: score stays to right of address --- */
  .deal-card {
    grid-template-columns: 1fr auto;
    gap: 6px;
    padding: 10px 10px;
  }

  .deal-card-info h3 {
    font-size: 13px;
  }

  .deal-card-score {
    font-size: 14px;
    align-self: center;
  }

  /* --- Cmd+K modal: no footer shortcuts --- */
  .cmd-k-footer {
    display: none;
  }

  .cmd-k-modal {
    border-radius: 12px;
  }

  .cmd-k-modal input {
    height: 44px;
    font-size: 16px; /* prevent iOS auto-zoom */
  }

  .cmd-k-results {
    max-height: 45vh;
    padding: 4px;
  }

  .cmd-k-result-item {
    padding: 7px 8px;
  }

  .cmd-k-overlay {
    padding-top: 5vh;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* --- Settings: full width dropdowns --- */
  .setting-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .setting-row select {
    min-width: 100%;
    text-align: left;
  }

  .setting-row .setting-input {
    min-width: 100%;
    text-align: left;
  }

  /* --- Tab panels: slightly less padding --- */
  .sidebar-content {
    padding: 10px 12px;
  }

  .tab-panel-header {
    padding: 2px 0 8px;
    margin-bottom: 8px;
  }

  /* --- Score strip: shrink font sizes --- */
  .score-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }

  .score-strip div,
  .metric-cell {
    padding: 5px 6px;
  }

  .score-strip strong {
    font-size: 14px;
  }

  .score-strip span {
    font-size: 10px;
    letter-spacing: 0.2px;
  }

  /* --- Map controls: smaller --- */
  .map-hud {
    top: 8px;
    right: 8px;
    gap: 3px;
  }

  .map-mode-toggle {
    padding: 2px;
  }

  .map-mode-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .pin-btn {
    width: 30px;
    height: 30px;
  }

  .pin-btn svg {
    width: 12px;
    height: 12px;
  }

  /* --- Fullscreen expand: all grids single column --- */
  .expand-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .expand-strategies {
    grid-template-columns: 1fr !important;
  }

  .expand-scroll-body .expand-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .expand-scroll-body .expand-strategies {
    grid-template-columns: 1fr !important;
  }

  .focus-metrics {
    grid-template-columns: 1fr;
  }

  .focus-strategies {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .detail-metrics-grid {
    grid-template-columns: 1fr;
  }

  /* --- Expand view adjustments --- */
  .expand-hero-addr {
    font-size: 18px;
  }

  .expand-hero-loc {
    font-size: 12px;
  }

  .expand-sticky-header {
    padding: 8px 12px;
    min-height: 46px;
  }

  .expand-sticky-addr {
    font-size: 12px;
  }

  .expand-scroll-body {
    padding: 0 12px 32px;
  }

  .expand-actions {
    padding: 10px 12px;
  }

  .expand-offer-btn {
    height: 40px;
    font-size: 13px;
  }

  .expand-watchlist-btn {
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  /* --- Focus panel phone --- */
  .focus-panel {
    padding: 16px 14px 16px;
    max-height: 70vh;
    border-radius: 14px 14px 0 0;
  }

  .focus-header-left h2 {
    font-size: 16px;
  }

  .focus-score {
    font-size: 24px;
  }

  /* --- Activity feed tighter --- */
  .activity-feed {
    padding: 0 8px 12px;
  }

  .activity-item {
    gap: 8px;
    padding: 10px 0;
  }

  .activity-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .activity-title {
    font-size: 12px;
  }

  .activity-detail {
    font-size: 10px;
  }

  /* --- Network panel tighter --- */
  .network-avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .network-thread {
    gap: 8px;
    padding: 8px 4px;
  }

  .network-thread-name {
    font-size: 12px;
  }

  .network-thread-preview {
    font-size: 10px;
  }

  /* --- Filter view phone --- */
  .filter-row-2col {
    grid-template-columns: 1fr;
  }

  .filter-apply-btn {
    height: 46px;
    font-size: 14px;
    border-radius: 10px;
  }

  /* --- Strategy grid single column --- */
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  /* --- Profile panel --- */
  .profile-avatar {
    width: 56px;
    height: 56px;
  }

  /* --- Mobile menu button --- */
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 18px;
  }

  /* --- Expand detail/finance grids --- */
  .expand-detail-grid,
  .expand-finance-grid {
    grid-template-columns: 1fr;
  }

  .expand-score-pills {
    grid-template-columns: 1fr;
  }
}


/* ================================================================
   Activity Feed - enhanced: filter bar, unread dots, right side
   ================================================================ */

.activity-filter-bar {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.activity-filter-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  line-height: 1.5;
}

.activity-filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.activity-filter-chip.active {
  background: var(--accent);
  color: var(--body-bg);
  border-color: var(--accent);
}

.activity-feed-list {
  padding: 0 16px 16px;
}

.activity-unread-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: var(--color-success);
  margin-top: 13px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}

.activity-unread-dot.visible {
  opacity: 1;
}

.activity-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.activity-chevron {
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity 150ms ease;
}

.activity-item:hover .activity-chevron {
  opacity: 0.8;
}

/* ================================================================
   Network Panel - enhanced: header, add btn, contact actions,
                              group cards, forum hot badge
   ================================================================ */

.network-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}

.network-panel-header .network-sub-nav {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.network-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.network-add-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.network-contact-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.network-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 150ms ease;
}

.network-action-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.network-group-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms ease;
}

.network-group-card:last-child {
  border-bottom: none;
}

.network-group-card:hover {
  background: var(--hover-bg);
  border-radius: 8px;
}

.network-group-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.network-group-join-btn {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  flex-shrink: 0;
}

.network-group-join-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.network-group-join-btn.joined {
  background: var(--accent);
  color: var(--body-bg);
  border-color: var(--accent);
}

.forum-hot-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}

/* Network contact card - 8 stagger entries */
.network-contact-card:nth-child(6)  { animation-delay: 250ms; }
.network-contact-card:nth-child(7)  { animation-delay: 300ms; }
.network-contact-card:nth-child(8)  { animation-delay: 350ms; }
.network-contact-card:nth-child(9)  { animation-delay: 400ms; }
.network-contact-card:nth-child(10) { animation-delay: 450ms; }

/* Activity filter bar items stagger */
.activity-item:nth-child(13) { animation-delay: 480ms; }
.activity-item:nth-child(14) { animation-delay: 520ms; }
.activity-item:nth-child(15) { animation-delay: 560ms; }

/* ================================================================
   NETWORK - Messaging, Contacts, Find Pros, Groups
   ================================================================ */

/* ---- Chat thread ---- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0;
}

.chat-bubbles {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 320px;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-bubble-row.me {
  align-items: flex-end;
}

.chat-bubble-row.them {
  align-items: flex-start;
}

.chat-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.sent {
  background: var(--accent);
  color: var(--body-bg);
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  padding: 0 4px;
}

.chat-input-bar {
  display: flex;
  gap: 6px;
  padding: 10px 0 0;
  border-top: 1px solid var(--divider);
  margin-top: auto;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 150ms;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--body-bg);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: opacity 150ms;
}

.chat-send-btn:hover {
  opacity: 0.85;
}

/* ---- Contacts ---- */
.contact-search-wrap {
  margin-bottom: 8px;
}

.contact-search-input {
  width: 100%;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-input);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 150ms;
}

.contact-search-input:focus {
  border-color: var(--accent);
}

.contact-search-input::placeholder {
  color: var(--text-muted);
}

.network-contact-card {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms ease;
  align-items: flex-start;
  flex-wrap: wrap;
}

.network-contact-card:hover {
  background: var(--hover-bg);
  border-radius: 8px;
}

.network-contact-card:last-child {
  border-bottom: none;
}

.network-contact-card.expanded {
  background: var(--glass-inner-bg);
  border-radius: 10px;
  border-bottom: none;
  margin-bottom: 2px;
  padding: 10px 8px;
}

.contact-detail-panel {
  width: 100%;
  padding-top: 8px;
  animation: fadeSlideDown 150ms ease both;
}

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

.contact-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--divider);
}

.contact-info-row:last-of-type {
  border-bottom: none;
}

.contact-info-label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 52px;
}

.contact-info-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

.contact-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.contact-detail-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.contact-detail-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.contact-detail-btn.accent {
  background: var(--accent);
  color: var(--body-bg);
  border-color: var(--accent);
}

.contact-detail-btn.accent:hover {
  opacity: 0.85;
}

.contact-detail-btn.danger {
  color: var(--color-danger);
  border-color: rgba(220,38,38,.25);
}

.contact-detail-btn.danger:hover {
  background: rgba(220,38,38,.07);
  border-color: var(--color-danger);
}

/* Edit form */
.contact-field-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.contact-field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-field-input {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-input);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 150ms;
}

.contact-field-input:focus {
  border-color: var(--accent);
}

.contact-field-input option {
  background: var(--body-bg);
}

.contact-edit-form {
  padding: 8px 0 4px;
}

.contact-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.contact-save-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: var(--body-bg);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 150ms;
}

.contact-save-btn:hover {
  opacity: 0.85;
}

.contact-cancel-btn {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--divider);
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms;
}

.contact-cancel-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Add contact overlay */
.add-contact-overlay {
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 20px;
  overflow-y: auto;
}

.add-contact-form {
  width: 100%;
  max-width: 360px;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--r-panel);
  padding: 20px;
  box-shadow: var(--glass-shadow);
}

.findpros-stars .star {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.3;
}

.findpros-stars .star.filled {
  color: #f59e0b;
  opacity: 1;
}

.findpros-stars .star.half {
  color: #f59e0b;
  opacity: 0.6;
}

.findpros-add-btn:hover:not(.added) {
  background: var(--accent);
  color: var(--body-bg);
  border-color: var(--accent);
}

.findpros-add-btn.added {
  color: var(--accent, #3b82f6);
  border-color: rgba(59,130,246,.35);
  cursor: default;
}

/* ---- Groups / Forum ---- */
.group-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.thread-reply {
  padding: 10px 12px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.thread-reply-input {
  width: 100%;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-input);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 150ms;
  line-height: 1.5;
}

.thread-reply-input:focus {
  border-color: var(--accent);
}

.thread-reply-input::placeholder {
  color: var(--text-muted);
}

.new-thread-form {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  animation: fadeSlideDown 150ms ease both;
}

/* ---- Forum styles (already partially exist, augment) ---- */
.forum-thread {
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 120ms;
}

.forum-thread:last-child {
  border-bottom: none;
}

.forum-thread:hover {
  background: var(--hover-bg);
  border-radius: 8px;
}

.forum-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.forum-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.forum-replies {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---- network-content layout fix for chat ---- */
.network-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ================================================================
   REDUCED MOTION - Respect user preferences
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ================================================================
   SEARCH & DISCOVER ENHANCEMENTS
   ================================================================ */

/* ----------------------------------------------------------------
   A. Enhanced Search Status Bar
   ---------------------------------------------------------------- */
#searchStatus {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 14px;
  max-width: 380px;
  pointer-events: auto;
}

#searchStatusText {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-status-clear {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease;
}

[data-theme="dark"] .search-status-clear {
  background: rgba(255, 255, 255, 0.12);
}

.search-status-clear:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}


/* ----------------------------------------------------------------
   B. Cmd+K Recent item
   ---------------------------------------------------------------- */
.cmd-k-result-icon--recent {
  opacity: 0.65;
}

.cmd-k-result-meta--recent {
  font-size: 10px;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--text-muted);
  opacity: 0.6;
}


/* ----------------------------------------------------------------
   C. Autocomplete grouping & highlight
   ---------------------------------------------------------------- */
.autocomplete-group-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  opacity: 0.7;
  pointer-events: none;
}

.autocomplete-item--deal,
.autocomplete-item--city {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-main {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.autocomplete-highlight {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}

[data-theme="dark"] .autocomplete-highlight {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}


/* ----------------------------------------------------------------
   D. Discover / Scout tab panel
   ---------------------------------------------------------------- */
.discover-panel {
  padding: 14px 16px 20px;
}

.discover-header {
  margin-bottom: 14px;
}

.discover-header h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  margin-bottom: 3px;
}

.discover-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Polish scout-chip to glass pill style */
.scout-chip {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scout-chip:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .scout-chip:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Recent searches item subtle slide */
.scout-recent-item {
  transition: background 120ms ease, padding-left 100ms ease;
}

.scout-recent-item:hover {
  padding-left: 14px;
}

/* Scout button loading state */
#discoverSearchBtn.loading {
  opacity: 0.7;
  cursor: wait;
}

/* Popular Markets grid */
.discover-markets-section {
  margin-bottom: 12px;
}

.popular-markets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.popular-market-btn {
  background: var(--card-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  letter-spacing: 0.1px;
  line-height: 1.3;
}

.popular-market-btn:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.1));
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.popular-market-btn:active {
  transform: scale(0.96);
}

[data-theme="light"] .popular-market-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .popular-market-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
}

/* Discover search counter */
.discover-search-counter {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.1px;
}

.discover-search-counter.counter-exhausted {
  color: #dc2626;
}


/* ----------------------------------------------------------------
   E. Cmd+K modal - extra polish
   ---------------------------------------------------------------- */
.cmd-k-input-row {
  height: 54px;
  padding: 0 20px;
}

.cmd-k-section:first-child {
  padding-top: 8px;
}

.cmd-k-result-item.highlighted .cmd-k-result-icon {
  background: var(--hover-bg);
}

.cmd-k-geo-item {
  margin: 4px 6px 0;
}

.cmd-k-footer {
  opacity: 0.65;
}

.cmd-k-results {
  max-height: 400px;
}


/* ================================================================
   VISUAL POLISH - Final micro-refinements layer
   ================================================================ */

/* ── Sidebar toggle hover states ───────────────────────────────── */
.sidebar-toggle:hover {
  transform: scale(1.05);
}
.sidebar-toggle:active {
  transform: scale(0.94);
}

/* ── Detail back / icon buttons active ─────────────────────────── */
.detail-back-btn:active,
.detail-icon-btn:active {
  transform: scale(0.92);
}

/* ── Focus panel scrollbar ─────────────────────────────────────── */
.focus-panel { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }
.focus-panel::-webkit-scrollbar { width: 6px; }
.focus-panel::-webkit-scrollbar-track { background: transparent; }
.focus-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.focus-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Filter view body scrollbar ───────────────────────────────── */
.filter-view-body { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.08) transparent; }
.filter-view-body::-webkit-scrollbar { width: 6px; }
.filter-view-body::-webkit-scrollbar-track { background: transparent; }
.filter-view-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 4px; }
.filter-view-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.16); }
[data-theme="dark"] .filter-view-body { scrollbar-color: rgba(255,255,255,0.08) transparent; }
[data-theme="dark"] .filter-view-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .filter-view-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Expand body scrollbar dark mode ───────────────────────────── */
.expand-body { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.08) transparent; }
.expand-body::-webkit-scrollbar { width: 6px; }
.expand-body::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] .expand-body { scrollbar-color: rgba(255,255,255,0.1) transparent; }
[data-theme="dark"] .expand-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
[data-theme="dark"] .expand-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Section label consistency ─────────────────────────────────── */
.filter-group-label,
.setting-group-label,
.expand-section-label {
  color: var(--text-label);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Filter label reset (no uppercase) ─────────────────────────── */
.filter-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

/* ── Chip refinement ───────────────────────────────────────────── */
.chip {
  font-weight: 500;
  border: var(--glass-inner-border);
}

/* ── Insight card hover ────────────────────────────────────────── */
.insight-card {
  transition: background 150ms ease, border-color 150ms ease;
}
.insight-card:hover {
  border-color: var(--active-card-border);
}

/* ── Focus close active ────────────────────────────────────────── */
.focus-close:active {
  transform: scale(0.88);
}

/* ── Sidebar glass depth in dark mode ──────────────────────────── */
[data-theme="dark"] .investor-console {
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    0 8px 32px rgba(0,0,0,0.55),
    inset 0 0.5px 0 rgba(255,255,255,0.055);
}

/* ── Map HUD edge spacing ───────────────────────────────────────── */
.map-hud {
  right: 16px;
  top: 16px;
}

/* ── Search trigger text opacity ────────────────────────────────── */
[data-theme="dark"] .search-trigger {
  color: rgba(255,255,255,0.38);
}
[data-theme="dark"] .search-trigger:hover {
  color: rgba(255,255,255,0.82);
}

/* ── Popup score badge ─────────────────────────────────────────── */
.popup-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.popup-score.score-hot   { background: rgba(22,163,74,0.14);  color: #16a34a; }
.popup-score.score-warm  { background: rgba(120,120,120,0.12); color: var(--text-muted); }
.popup-score.score-watch { background: rgba(245,158,11,0.14);  color: #f59e0b; }
.popup-score.score-cold  { background: rgba(239,68,68,0.14);   color: #ef4444; }
[data-theme="dark"] .popup-score.score-hot   { background: rgba(22,163,74,0.2);  color: #4ade80; }
[data-theme="dark"] .popup-score.score-watch { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-theme="dark"] .popup-score.score-cold  { background: rgba(239,68,68,0.2);  color: #f87171; }

/* ── Semantic value color utilities ─────────────────────────────── */
.value-positive, .text-positive { color: var(--color-success) !important; }
.value-negative, .text-negative { color: var(--color-danger)  !important; }
.value-warning,  .text-warning  { color: var(--color-warning)  !important; }

/* ── Button active states ───────────────────────────────────────── */
.expand-header-back:active { transform: scale(0.92); }
.expand-export-btn:active  { transform: scale(0.96); }
.compare-run-btn:active    { transform: scale(0.97); }
.insight-calc-btn:active   { transform: scale(0.97); }

/* ── Filter badge neutral (green reserved for score-hot pin only) ── */
.filter-badge { background: rgba(255,255,255,0.18); }

/* ── Saved card strategy pill ───────────────────────────────────── */
.saved-card-strategy { font-size: 10px; font-weight: 600; letter-spacing: 0.4px; }

/* ── Forum hot badge ────────────────────────────────────────────── */
.forum-hot-badge {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ── Deal card price value ──────────────────────────────────────── */
.deal-card-price {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ── Network thread improved hover ──────────────────────────────── */
.network-thread:hover {
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -4px;
  margin-right: -4px;
}

/* ── Insight strategy col hover ─────────────────────────────────── */
.insight-strategy-col {
  transition: border-color 150ms ease, background 150ms ease;
}
.insight-strategy-col:hover {
  background: var(--hover-bg);
}

/* ================================================================
   INSIGHTS TAB - NEW COMPREHENSIVE SECTIONS
   ================================================================ */

/* Section labels */
.insight-section-label {
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 20px 0 8px;
}
.insight-section-label:first-child {
  margin-top: 4px;
}

/* ----------------------------------------------------------------
   PORTFOLIO SUMMARY CARD
   ---------------------------------------------------------------- */
.insight-portfolio-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 4px;
  animation: insightFadeIn 280ms ease both;
}

.insight-portfolio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 16px;
}

.insight-portfolio-stat {
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--divider);
}
.insight-portfolio-stat:last-child {
  border-right: none;
}

.insight-portfolio-stat-value {
  font-size: 18px;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.insight-portfolio-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.insight-portfolio-dist-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.insight-portfolio-dist {
  display: flex;
  gap: 3px;
  border-radius: 6px;
  overflow: hidden;
  height: 28px;
  margin-bottom: 14px;
}

.insight-dist-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dist-color, #3b82f6);
  min-width: 28px;
  transition: flex 300ms ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.insight-dist-pill:hover {
  filter: brightness(1.1);
}

.insight-dist-pill-name {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 4px;
  line-height: 1;
}
.insight-dist-pill-pct {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1;
}

.insight-portfolio-dist-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 14px;
  font-style: italic;
}

.insight-portfolio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.insight-portfolio-footer-note {
  font-size: 11px;
  color: var(--text-muted);
}

.insight-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.insight-export-btn:hover {
  background: var(--accent-subtle);
}
.insight-export-btn:active {
  transform: scale(0.97);
}

/* ----------------------------------------------------------------
   MARKET PULSE GRID
   ---------------------------------------------------------------- */
.insight-pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

.insight-pulse-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 10px;
  padding: 12px 10px 10px;
  animation: insightFadeIn 280ms ease both;
  min-width: 0;
}
.insight-pulse-card:nth-child(2) { animation-delay: 40ms; }
.insight-pulse-card:nth-child(3) { animation-delay: 80ms; }
.insight-pulse-card:nth-child(4) { animation-delay: 120ms; }
.insight-pulse-card:nth-child(5) { animation-delay: 160ms; }

.insight-pulse-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-pulse-value {
  font-size: 16px;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-pulse-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.insight-pulse-trend-up {
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
  flex-shrink: 0;
}

.insight-pulse-trend-down {
  font-size: 10px;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
  flex-shrink: 0;
}

.insight-pulse-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------------------
   STRATEGY COMPARISON - 6-CARD GRID
   ---------------------------------------------------------------- */
.insight-strat6-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 4px;
}

.insight-strat6-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 12px;
  padding: 14px 13px 12px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 80ms ease;
  animation: insightFadeIn 280ms ease both;
  position: relative;
}
.insight-strat6-card:hover {
  background: var(--accent-subtle);
  transform: translateY(-1px);
}
.insight-strat6-card.insight-strat6-active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent);
}

.insight-strat6-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.insight-strat6-roi {
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  margin-bottom: 7px;
}

.insight-strat6-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.insight-strat6-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.insight-strat6-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.insight-strat6-meta-label {
  color: var(--text-muted);
}

.insight-strat6-bar-wrap {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--accent-subtle);
  overflow: hidden;
  margin-bottom: 5px;
}

.insight-strat6-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--text-primary);
  opacity: 0.5;
  transition: width 500ms ease;
}

.insight-strat6-count {
  font-size: 10px;
  color: var(--text-muted);
}
.insight-strat6-count strong {
  color: var(--text-primary);
}

.insight-strat6-count-none {
  font-style: italic;
  opacity: 0.7;
}

/* ----------------------------------------------------------------
   AI DEAL BRIEF SECTION
   ---------------------------------------------------------------- */
.insight-ai-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 4px;
}

.insight-ai-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 12px;
  padding: 14px;
  animation: insightFadeIn 280ms ease both;
  transition: background 150ms ease;
}
.insight-ai-card:hover {
  background: var(--accent-subtle);
}
.insight-ai-card:nth-child(2) { animation-delay: 60ms; }
.insight-ai-card:nth-child(3) { animation-delay: 120ms; }

.insight-ai-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.insight-ai-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  flex-shrink: 0;
}

.insight-ai-dot-blue   { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.insight-ai-dot-green  { background: rgba(22, 163, 74, 0.15);  color: #16a34a; }
.insight-ai-dot-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.insight-ai-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.insight-ai-card-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.insight-ai-cta {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  border: var(--glass-inner-border);
  background: transparent;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}
.insight-ai-cta:hover {
  background: var(--accent-subtle);
}
.insight-ai-cta:active {
  transform: scale(0.97);
}

.insight-ai-footer-row {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 2px 0;
  opacity: 0.7;
}

/* ----------------------------------------------------------------
   CALCULATOR HELPERS
   ---------------------------------------------------------------- */
.insight-calc-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-style: italic;
}

.insight-strat-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   RESPONSIVE - Pulse grid and strat6 grid on narrow sidebar
   ---------------------------------------------------------------- */
@media (max-width: 400px) {
  .insight-portfolio-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .insight-pulse-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .insight-strat6-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ================================================================
   Profile Panel - Investor Command Center
   ================================================================ */

/* Wipe the old minimal styles - new ones below override fully */
.profile-panel {
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Identity Card ---- */
.prof-identity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px 20px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-panel);
  text-align: center;
  margin: 12px 16px 0;
}

.prof-identity-card.hidden { display: none; }

.prof-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.prof-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.2;
}

.prof-email-display {
  font-size: 12px;
  color: var(--text-muted);
}

.prof-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.prof-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(0,0,0,0.07);
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

[data-theme="dark"] .prof-role-badge {
  background: rgba(255,255,255,0.09);
}

.prof-market-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 400;
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-muted);
}

.prof-since {
  font-size: 11px;
  color: var(--text-label);
  margin-top: 2px;
}

.prof-edit-btn {
  margin-top: 10px;
  padding: 0 18px;
  min-height: 36px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--glass-bg);
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}

.prof-edit-btn:hover { opacity: 0.75; }

[data-theme="dark"] .prof-edit-btn {
  background: var(--accent);
  color: var(--body-bg);
}

/* ---- Section Cards ---- */
.prof-section-card {
  margin: 0 16px;
  padding: 16px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-panel);
}

.prof-card-header {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-label);
  margin-bottom: 14px;
}

.prof-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.prof-card-header-row .prof-card-header {
  margin-bottom: 0;
}

.prof-sub-header {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-label);
  margin: 14px 0 8px;
  letter-spacing: 0.3px;
}

/* ---- Edit Form ---- */
.prof-edit-form {
  margin: 0 16px;
  padding: 16px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-panel);
}

.prof-edit-form.hidden { display: none; }

.prof-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.prof-field-row label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-label);
  letter-spacing: 0.3px;
}

.prof-field-input {
  background: var(--input-bg);
  border: var(--input-border);
  border-radius: var(--r-input);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.prof-field-input:focus {
  outline: none;
  border-color: rgba(0,0,0,0.25);
}

[data-theme="dark"] .prof-field-input:focus {
  border-color: rgba(255,255,255,0.25);
}

.prof-form-btns {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.prof-save-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--glass-bg);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.prof-save-btn:hover { opacity: 0.75; }

[data-theme="dark"] .prof-save-btn {
  background: var(--accent);
  color: var(--body-bg);
}

.prof-cancel-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--r-button);
  background: transparent;
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.prof-cancel-btn:hover { background: var(--hover-bg); }

/* ---- Net Worth ---- */
.prof-nw-total {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.prof-nw-total-label {
  font-size: 11px;
  color: var(--text-label);
  margin-top: 3px;
  margin-bottom: 14px;
}

.prof-nw-bar-wrap {
  margin-bottom: 14px;
}

.prof-nw-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  gap: 1px;
  background: var(--glass-inner-bg);
  margin-bottom: 10px;
}

.prof-nw-bar-seg {
  height: 100%;
  min-width: 2px;
  transition: width 0.3s ease;
  border-radius: 0;
}

.prof-nw-bar-seg:first-child { border-radius: 4px 0 0 4px; }
.prof-nw-bar-seg:last-child  { border-radius: 0 4px 4px 0; }

.prof-nw-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prof-nw-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}

.prof-nw-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prof-nw-legend-val {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.prof-nw-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--divider);
  padding-top: 14px;
}

.prof-nw-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prof-nw-row-label {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.prof-nw-input {
  width: 110px;
  text-align: right;
  background: var(--input-bg);
  border: var(--input-border);
  border-radius: var(--r-input);
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

.prof-nw-input:focus {
  outline: none;
  border-color: rgba(0,0,0,0.25);
}

[data-theme="dark"] .prof-nw-input:focus {
  border-color: rgba(255,255,255,0.25);
}

/* ---- Portfolio Stat Grid ---- */
.prof-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.prof-stat-cell {
  background: var(--glass-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-cell);
  padding: 10px 12px;
}

[data-theme="dark"] .prof-stat-cell {
  background: rgba(255,255,255,0.04);
}

.prof-stat-val {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.1;
}

.prof-stat-lbl {
  font-size: 10px;
  color: var(--text-label);
  margin-top: 3px;
  letter-spacing: 0.2px;
}

/* ---- Highlight rows ---- */
.prof-highlight-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 5px 0;
}

.prof-hl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prof-hl-green { background: #10b981; }
.prof-hl-red   { background: #ef4444; }

.prof-hl-label {
  color: var(--text-label);
  font-weight: 500;
}

.prof-hl-val {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Strategy mix bars ---- */
.prof-strat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.prof-strat-name {
  width: 80px;
  flex-shrink: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.prof-strat-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--glass-inner-bg);
  border-radius: 4px;
  overflow: hidden;
}

.prof-strat-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  opacity: 0.6;
  transition: width 0.35s ease;
  min-width: 2px;
}

.prof-strat-pct {
  width: 30px;
  text-align: right;
  color: var(--text-label);
  font-size: 11px;
  flex-shrink: 0;
}

/* ---- My Properties ---- */
.prof-add-btn {
  padding: 0 11px;
  min-height: 36px;
  border-radius: var(--r-button);
  background: var(--accent-subtle);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}

.prof-add-btn:hover { background: var(--hover-bg); }

.prof-add-prop-form {
  background: var(--glass-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-cell);
  padding: 12px;
  margin-bottom: 12px;
}

[data-theme="dark"] .prof-add-prop-form {
  background: rgba(255,255,255,0.03);
}

.prof-add-prop-form.hidden { display: none; }

.prof-prop-card {
  background: var(--glass-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-cell);
  padding: 10px 12px;
  margin-bottom: 8px;
}

[data-theme="dark"] .prof-prop-card {
  background: rgba(255,255,255,0.03);
}

.prof-prop-addr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.prof-prop-addr {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
}

.prof-prop-del {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-label);
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.prof-prop-del:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}

.prof-prop-meta {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.prof-prop-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prof-prop-meta-val {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.prof-prop-meta-lbl {
  font-size: 10px;
  color: var(--text-label);
}

.prof-green { color: #10b981; }
.prof-red   { color: #ef4444; }

.prof-prop-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  margin-top: 4px;
  font-size: 11px;
}

.prof-prop-totals-label {
  color: var(--text-label);
  font-weight: 500;
}

.prof-prop-totals-vals {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- Performance Grid ---- */
.prof-perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prof-perf-cell {
  background: var(--glass-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-cell);
  padding: 12px;
}

[data-theme="dark"] .prof-perf-cell {
  background: rgba(255,255,255,0.04);
}

.prof-perf-val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  line-height: 1.1;
}

.prof-perf-lbl {
  font-size: 10px;
  color: var(--text-label);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.prof-perf-sub {
  font-size: 10px;
  color: var(--text-label);
  margin-top: 2px;
  opacity: 0.7;
}

/* ---- Activity Grid ---- */
.prof-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prof-act-cell {
  background: var(--glass-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-cell);
  padding: 12px;
  text-align: center;
}

[data-theme="dark"] .prof-act-cell {
  background: rgba(255,255,255,0.04);
}

.prof-act-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  line-height: 1.1;
}

.prof-act-lbl {
  font-size: 10px;
  color: var(--text-label);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* ---- Referral card ---- */
.referral-card {
  margin-top: 12px;
}

.referral-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.referral-link-input {
  flex: 1;
  min-width: 0;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: default;
  outline: none;
}

.referral-copy-btn {
  flex-shrink: 0;
  appearance: none;
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.referral-copy-btn:hover {
  opacity: 0.8;
}

.referral-stats-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.referral-stat {
  font-size: 12px;
  color: var(--text-secondary);
}

.referral-stat-sep {
  font-size: 12px;
  color: var(--text-label);
}

.referral-note {
  font-size: 11px;
  color: var(--text-label);
  line-height: 1.5;
}

/* ---- Empty state ---- */
.prof-empty-note {
  font-size: 12px;
  color: var(--text-label);
  text-align: center;
  padding: 16px 0 8px;
  line-height: 1.5;
}


/* ================================================================
   Plan System
   ================================================================ */

/* ---- Settings Plan Section ---- */

.settings-plan-section {
  margin: 4px 0 8px;
}

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

.plan-status-text {
  font-size: 12px;
  color: var(--text-muted);
}

.plan-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.plan-badge-free {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
}

.plan-badge-personal {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
}

.plan-badge-professional {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
}

.plan-badge-lifetime {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
}

.plan-feature-grid {
  display: grid;
  grid-template-columns: 1fr 36px 48px 48px 44px;
  gap: 0;
  margin-bottom: 12px;
  border-radius: var(--r-cell);
  overflow: hidden;
  border: var(--glass-inner-border);
}

.plan-col-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-label);
  text-align: center;
  padding: 6px 4px;
  background: var(--glass-inner-bg);
  border-bottom: var(--glass-inner-border);
  letter-spacing: 0.3px;
}

.plan-col-header.plan-col-label {
  text-align: left;
  padding-left: 8px;
}

.plan-col-header.plan-col-personal {
  color: var(--text-primary);
}

.plan-row-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 5px 4px 5px 8px;
  border-bottom: var(--glass-inner-border);
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.plan-row-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  border-bottom: var(--glass-inner-border);
  color: var(--color-success);
}

.plan-row-cell.plan-col-personal {
  background: var(--accent-subtle);
}

.plan-row-cell.plan-cell-no {
  color: var(--text-label);
  opacity: 0.5;
}

.plan-row-label:last-of-type,
.plan-row-cell:last-of-type,
.plan-feature-grid > *:nth-last-child(-n+6) {
  border-bottom: none;
}

.plan-ctas {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.plan-upgrade-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--r-button);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  letter-spacing: 0.1px;
}

.plan-upgrade-btn:hover {
  opacity: 0.88;
}

.plan-upgrade-personal {
  background: var(--accent);
  color: var(--body-bg);
}

.plan-upgrade-prof {
  background: var(--accent);
  color: var(--body-bg);
}

.plan-upgrade-lifetime {
  background: var(--accent);
  color: var(--body-bg);
}

.plan-note {
  font-size: 10px;
  color: var(--text-label);
  text-align: center;
}


/* ---- Upgrade Modal ---- */

.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.upgrade-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.upgrade-modal {
  position: relative;
  width: 100%;
  max-width: 860px;
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.25s ease;
}

.upgrade-modal-overlay.visible .upgrade-modal {
  transform: translateY(0);
}

.upgrade-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s;
}

.upgrade-modal-close:hover {
  background: var(--hover-bg);
}

.upgrade-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.upgrade-modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upgrade-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upgrade-billing-toggle {
  display: inline-flex;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.billing-toggle-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.billing-toggle-btn.active {
  background: var(--accent);
  color: var(--glass-bg);
}

[data-theme="dark"] .billing-toggle-btn.active {
  background: var(--accent);
  color: var(--body-bg);
}

.billing-savings-pill {
  font-size: 10px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  padding: 1px 6px;
  border-radius: 10px;
}

.upgrade-plans-grid {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .upgrade-plans-grid {
    flex-wrap: wrap;
  }
  .upgrade-plan-col {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .upgrade-plans-grid {
    flex-direction: column;
  }
  .upgrade-plan-col {
    flex: none;
    width: 100%;
  }

  .upgrade-modal {
    padding: 24px 16px 20px;
    border-radius: 14px;
    max-height: 85vh;
  }

  .upgrade-modal-overlay {
    padding: 10px;
  }

  .upgrade-modal-title {
    font-size: 18px;
  }
}

.upgrade-plan-col {
  border: var(--glass-inner-border);
  border-radius: var(--r-panel);
  padding: 20px 16px 16px;
  position: relative;
  background: var(--glass-inner-bg);
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}

.upgrade-plan-featured {
  border-color: var(--active-card-border);
  background: var(--accent-subtle);
  transform: scale(1.04);
  box-shadow: 0 0 0 1px var(--active-card-border), 0 0 24px rgba(255,255,255,0.07);
  z-index: 1;
  margin-top: -4px;
  margin-bottom: -4px;
}

.upgrade-plan-badge-top {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--body-bg);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.upgrade-plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upgrade-plan-price {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.upgrade-price-amt {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.upgrade-price-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.upgrade-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upgrade-feature-list li {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}

.upgrade-feature-list li.feat-yes {
  color: var(--text-primary);
}

.upgrade-feature-list li.feat-yes::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 11px;
  height: 11px;
  background-image: url("data:image/svg+xml,%3Csvg width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.upgrade-feature-list li.feat-no {
  opacity: 0.45;
}

.upgrade-feature-list li.feat-no::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.35;
}

.upgrade-plan-current-label {
  font-size: 11px;
  color: var(--text-label);
  text-align: center;
  padding: 8px 0 0;
}

.upgrade-cta-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-button);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  letter-spacing: 0.1px;
  margin-top: auto;
}

.upgrade-cta-btn:hover {
  opacity: 0.88;
}

.upgrade-cta-personal {
  background: var(--accent);
  color: var(--body-bg);
}

.upgrade-cta-prof {
  background: var(--accent);
  color: var(--body-bg);
}

.upgrade-cta-lifetime {
  background: var(--accent);
  color: var(--body-bg);
}

.upgrade-trial-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

.upgrade-modal-note {
  font-size: 11px;
  color: var(--text-label);
  text-align: center;
}

.upgrade-plan-oneliner {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.upgrade-savings-label {
  display: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-success);
  background: rgba(34,197,94,0.12);
  padding: 2px 7px;
  border-radius: 8px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.billing-yearly-active .upgrade-savings-label {
  display: inline-block;
}

.upgrade-cta-btn:disabled,
.upgrade-cta-btn[disabled] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.upgrade-plan-current-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  border: var(--glass-inner-border);
  padding: 3px 9px;
  border-radius: 8px;
  text-align: center;
  margin-top: 8px;
}

.upgrade-compare-toggle {
  text-align: center;
  margin-bottom: 12px;
}

.upgrade-compare-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}

.upgrade-compare-toggle-btn:hover {
  color: var(--text-primary);
}

.upgrade-compare-toggle-btn .compare-chevron {
  transition: transform 0.2s;
  display: inline-block;
}

.upgrade-compare-toggle-btn.expanded .compare-chevron {
  transform: rotate(180deg);
}

.upgrade-compare-matrix {
  display: none;
  overflow-x: auto;
  margin-bottom: 16px;
}

.upgrade-compare-matrix.open {
  display: block;
}

.upgrade-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.upgrade-compare-table th,
.upgrade-compare-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.upgrade-compare-table thead th {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(255,255,255,0.02);
}

.upgrade-compare-table thead th:first-child {
  width: 40%;
}

.upgrade-compare-table th.cmp-col,
.upgrade-compare-table td.cmp-col {
  text-align: center;
  width: 15%;
}

.upgrade-compare-table td.cmp-feature {
  color: var(--text-muted);
}

.upgrade-compare-table tbody tr.cmp-group td {
  background: rgba(255,255,255,0.02);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 8px;
}

.cmp-yes { color: rgba(255,255,255,0.9); font-weight: 700; }
.cmp-no  { color: rgba(255,255,255,0.18); }
.cmp-val { color: var(--text-muted); }


/* ---- Upgrade Nudge (inline dismissible) ---- */

.upgrade-nudge-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  width: calc(100% - 40px);
  max-width: 380px;
  animation: nudge-in 0.25s ease;
}

@keyframes nudge-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.upgrade-nudge-box {
  border-radius: 16px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.nudge-icon {
  color: var(--text-muted);
  margin-bottom: 2px;
  opacity: 0.5;
}

.nudge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.nudge-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.nudge-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.nudge-upgrade-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--r-button);
  border: none;
  background: var(--accent);
  color: var(--body-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.nudge-upgrade-btn:hover {
  opacity: 0.88;
}

.nudge-dismiss-btn {
  padding: 9px 14px;
  border-radius: var(--r-button);
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.nudge-dismiss-btn:hover {
  background: var(--hover-bg);
}


/* ---- AI Insights Locked State ---- */

.insight-ai-locked {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: var(--r-panel);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.insight-ai-lock-icon {
  color: var(--text-label);
  opacity: 0.4;
  margin-bottom: 4px;
}

.insight-ai-locked-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.insight-ai-locked-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
}

/* ---- Premium Badge (lock pill for gated features) ---- */

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 2px 6px 2px 4px;
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1;
  pointer-events: none;
  opacity: 0.5;
  background: var(--glass-inner-bg);
  color: var(--text-muted);
  border: var(--glass-inner-border);
}

.premium-badge svg {
  flex-shrink: 0;
}

/* Tier colors */
.premium-badge--personal,
.premium-badge--professional,
.premium-badge--lifetime {
  background: var(--glass-inner-bg);
  color: var(--text-muted);
}

/* Nav icon badge positioning */
.nav-icon .premium-badge,
.header-icon-btn .premium-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 0;
  padding: 0;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  display: block;
  opacity: 0.35;
  background: var(--text-label);
  border: none;
}

.nav-icon,
.header-icon-btn {
  position: relative;
}

/* Tab panel header badge */
.tab-panel-header .premium-badge {
  margin-left: 6px;
}

/* Inline feature badge (buttons, labels) */
.compare-btn .premium-badge,
.insight-export-btn .premium-badge {
  margin-left: 4px;
  pointer-events: none;
}

/* Discover search button badge */
.discover-search-wrap button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Section label badge */
.insight-section-label .premium-badge {
  margin-left: 6px;
  vertical-align: middle;
}

.insight-ai-upgrade-btn {
  margin-top: 6px;
  padding: 9px 20px;
  border-radius: var(--r-button);
  border: none;
  background: var(--accent);
  color: var(--body-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.insight-ai-upgrade-btn:hover {
  opacity: 0.88;
}


/* ================================================================
   Notification Dropdown
   ================================================================ */

.notif-dropdown {
  position: fixed;
  top: 52px;
  right: 16px;
  z-index: 9000;
  width: min(360px, calc(100vw - 32px));
  max-height: 400px;
  border-radius: var(--r-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifSlideIn 180ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.notif-dropdown-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.notif-mark-all {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 120ms;
  font-family: inherit;
}

.notif-mark-all:hover {
  color: var(--text-primary);
}

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
  transition: background 120ms;
  position: relative;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--hover-bg);
}

.notif-item.unread {
  background: var(--accent-subtle);
}

.notif-item.unread:hover {
  background: var(--hover-bg);
}

.notif-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--icon-color);
}

.notif-text {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  line-height: 1.35;
}

.notif-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 10px;
  color: var(--text-label);
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-unread-dot {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-danger);
}

.notif-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-label);
  font-size: 12px;
}

@media (max-width: 480px) {
  .notif-dropdown {
    right: 8px;
    top: 48px;
    max-height: 60vh;
  }
}


/* ================================================================
   Onboarding Wizard
   ================================================================ */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onboardingFadeIn 300ms ease forwards;
}

@keyframes onboardingFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.onboarding-overlay.closing {
  animation: onboardingFadeOut 280ms ease forwards;
}

@keyframes onboardingFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.onboarding-card {
  width: 480px;
  max-width: calc(100vw - 32px);
  border-radius: 18px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 36px 32px 32px;
  overflow: visible;
  animation: onboardingCardIn 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes onboardingCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.onboarding-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.onboarding-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--divider);
  transition: background 200ms, width 200ms;
}

.onboarding-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 4px;
}

.onboarding-body {
  min-height: 240px;
}

.onboarding-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.onboarding-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.onboarding-field {
  margin-bottom: 14px;
}

.onboarding-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.onboarding-input,
.onboarding-select {
  width: 100%;
  padding: 14px 36px 14px 14px;
  min-height: 48px;
  line-height: 1.4;
  font-size: 16px;
  border-radius: var(--r-input);
  background: var(--input-bg);
  border: var(--input-border);
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border 150ms;
  -webkit-appearance: none;
  appearance: none;
}

.onboarding-input:focus,
.onboarding-select:focus {
  border-color: var(--accent);
}

.onboarding-chip-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onboarding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.onboarding-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--body-bg);
  font-size: 11px;
  font-weight: 500;
}

.onboarding-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  display: flex;
  align-items: center;
  line-height: 1;
  font-size: 13px;
}

.onboarding-chip-x:hover {
  opacity: 1;
}

.onboarding-geo-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 4px;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--r-input);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  display: none;
}
.onboarding-geo-dropdown.open {
  display: block;
}
.onboarding-geo-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 100ms ease;
  border-bottom: 1px solid var(--divider);
}
.onboarding-geo-item:last-child {
  border-bottom: none;
}
.onboarding-geo-item:hover {
  background: var(--hover-bg);
}

.onboarding-strategy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.onboarding-strategy-card {
  border-radius: var(--r-cell);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  padding: 12px 10px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  text-align: center;
}

.onboarding-strategy-card:hover {
  background: var(--hover-bg);
}

.onboarding-strategy-card.selected {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.onboarding-strategy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.onboarding-strategy-card.selected .onboarding-strategy-icon {
  color: var(--accent);
}

.onboarding-strategy-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 2px;
}

.onboarding-strategy-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.onboarding-risk-group {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.onboarding-risk-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  font-family: inherit;
}

.onboarding-risk-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.onboarding-risk-btn.selected {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--text-primary);
}

.onboarding-cta {
  width: 100%;
  margin-top: 20px;
  padding: 12px 20px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--body-bg);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: opacity 150ms;
}

.onboarding-cta:hover {
  opacity: 0.88;
}


/* ----------------------------------------------------------------
   Wave 2 UI polish: tap targets, iOS safe-area, focus rings,
   empty-state consistency, mobile sidebar overlap.
   ---------------------------------------------------------------- */

/* Raise the global search trigger above the iOS home indicator and
   keep it inside the safe-area on notched devices. */
.search-trigger {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Universal focus-visible ring for interactive controls. Brand yellow. */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
}

/* Bump icon-only buttons to a comfortable hit target on phone widths
   without breaking the crowded sidebar header layout. */
@media (max-width: 640px) {
  .nav-icon,
  .header-icon-btn {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
  }

  /* Sidebar header has 6 nav icons + 4 header icons; keep them visible
     by shrinking those buttons slightly while keeping a tappable area. */
  #sidebar .nav-icon,
  #sidebar .header-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .header-nav {
    gap: 2px;
  }

  .header-actions {
    gap: 2px;
  }

  /* Sidebar should fill the viewport on phones so content does not
     get clipped behind the map and the close button stays reachable. */
  #sidebar.investor-console,
  .investor-console.open {
    width: 100vw;
    max-width: 100vw;
  }

  /* Modal dialogs should never overflow on phone widths. */
  .modal,
  .modal-card,
  .upgrade-modal,
  .upgrade-modal-card {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  /* Search trigger sits a little higher on phones so it clears the
     home indicator and any bottom inset reliably. */
  .search-trigger {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* Tablet refinements: keep tap targets comfortable. */
@media (min-width: 641px) and (max-width: 1024px) {
  .nav-icon,
  .header-icon-btn {
    min-width: 36px;
    min-height: 36px;
  }
}

/* Empty-state polish: tighten contrast for glass backgrounds and add a
   gentle fade-in so empty tabs do not look broken. */
.empty-state {
  animation: scouq-fade-in 220ms ease-out both;
}

.empty-state p,
.empty-state small {
  color: var(--text-muted);
}

@keyframes scouq-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Prevent stray horizontal overflow on any width. Final safety net. */
html, body {
  overflow-x: hidden;
}


/* Upgrade modal: feature marked as coming-soon (not yet built) */
.feat-soon { color: #4ade80; opacity: 0.95; padding-left: 22px; position: relative; }
.feat-soon::before { content: '+'; position: absolute; left: 4px; top: -1px; color: #4ade80; font-weight: 700; }

/* ============================================================
   PWA install prompt (app + iOS sheet)
   ============================================================ */
.pwa-install-btn {
  display: none;
}
.pwa-install-btn[style*="display: none"] { display: none !important; }

.pwa-install-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  transform: translateY(140%);
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), opacity 240ms ease;
  opacity: 0;
  pointer-events: none;
}
.pwa-install-sheet.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.pwa-install-sheet-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 44px 16px 16px;
  border-radius: 16px;
  background: rgba(20, 20, 22, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color: #f5f5f5;
}
.pwa-install-illus {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f5;
}
.pwa-install-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.pwa-install-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.pwa-install-body {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(245, 245, 245, 0.78);
}
.pwa-install-icon-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  margin: 0 2px;
  color: #6ea8ff;
}
.pwa-install-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: rgba(245, 245, 245, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pwa-install-close:hover {
  color: #f5f5f5;
  background: rgba(255, 255, 255, 0.06);
}
@media (min-width: 640px) {
  .pwa-install-sheet {
    left: auto;
    right: 16px;
    bottom: 16px;
    max-width: 380px;
  }
}


/* =================================================================
   AI Analysis card (premium structured output)
   ================================================================= */

.ai-analysis-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 14px;
  padding: 18px 18px 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: ai-analysis-fade 240ms ease-out both;
}

@keyframes ai-analysis-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-analysis-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-label);
}

.ai-analysis-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--text-primary);
  border: 1px solid rgba(127, 127, 127, 0.18);
}

.ai-analysis-pill-loading {
  position: relative;
  overflow: hidden;
}
.ai-analysis-pill-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(127, 127, 127, 0.18) 50%,
    transparent 100%);
  animation: ai-shimmer 1.4s linear infinite;
}

.ai-analysis-pill-ready {
  background: rgba(46, 160, 67, 0.12);
  color: #2ea043;
  border-color: rgba(46, 160, 67, 0.3);
}

.ai-analysis-pill-error {
  background: rgba(220, 70, 70, 0.12);
  color: #d94040;
  border-color: rgba(220, 70, 70, 0.3);
}

.ai-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-analysis-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-analysis-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ai-analysis-section-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

.ai-analysis-section-body p {
  margin: 0 0 6px;
}
.ai-analysis-section-body p:last-child { margin-bottom: 0; }

.ai-analysis-section-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  padding: 1px 5px;
  background: var(--accent-subtle);
  border-radius: 4px;
}

.ai-analysis-list {
  margin: 4px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-analysis-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-analysis-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: var(--glass-bg);
  color: var(--text-primary);
  transition: background 140ms ease, transform 80ms ease, border-color 140ms ease;
}

.ai-analysis-btn:hover {
  background: var(--accent-subtle);
  border-color: rgba(127, 127, 127, 0.4);
}
.ai-analysis-btn:active { transform: translateY(1px); }
.ai-analysis-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.ai-analysis-save {
  background: var(--accent);
  color: var(--glass-bg);
  border-color: var(--accent);
}
.ai-analysis-save:hover {
  background: var(--accent);
  opacity: 0.9;
}

.ai-analysis-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 2px;
}

.ai-analysis-foot {
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed rgba(127, 127, 127, 0.22);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.ai-analysis-card-error {
  border-color: rgba(220, 70, 70, 0.3);
}

/* Skeleton + shimmer */
.ai-analysis-skeleton {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 0;
}

.ai-skel-row {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(127, 127, 127, 0.10) 0%,
    rgba(127, 127, 127, 0.22) 50%,
    rgba(127, 127, 127, 0.10) 100%);
  background-size: 200% 100%;
  animation: ai-shimmer 1.4s linear infinite;
}

.ai-skel-title {
  width: 32%;
  height: 9px;
  opacity: 0.7;
}

.ai-skel-short {
  width: 70%;
}

@keyframes ai-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ai-skel-row,
  .ai-analysis-pill-loading::after {
    animation: none;
  }
  .ai-analysis-card { animation: none; }
}


/* Empty state for the deal feed when no rows render */
.deal-list:empty {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.deal-list:empty::before {
  content: attr(data-empty-text);
  display: block;
  max-width: 320px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------
   Scouq Branded Map Pins (DOM markers)
   ---------------------------------------------------------------- */
.scouq-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-sizing: border-box;
}
.scouq-pin:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 0 4px rgba(255,255,255,0.12);
}
.scouq-pin-scouted {
  border-style: dashed;
  border-color: rgba(255,255,255,0.85);
}
.scouq-pin .scouq-pin-dot {
  position: static;
  inset: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 6px currentColor;
  background: currentColor;
  color: #6b7280;
}
.scouq-pin-dot-high   { color: #22c55e; }
.scouq-pin-dot-mid    { color: #eab308; }
.scouq-pin-dot-low    { color: #f97316; }
.scouq-pin-dot-poor   { color: #ef4444; }
.scouq-pin-dot-none   { color: #6b7280; }

/* Branded cluster (when DOM-cluster markers are used) */
.scouq-pin-cluster {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 180ms ease;
  box-sizing: border-box;
}
.scouq-pin-cluster:hover { transform: scale(1.08); }


/* ----------------------------------------------------------------
   Deal Detail Polish + Scout Toast Polish (appended)
   ---------------------------------------------------------------- */
.scout-toast-visible {
  pointer-events: auto !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
  max-width: 480px;
}
.scout-toast-visible .search-status-clear {
  pointer-events: auto;
}

.scout-popup-addr {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 8px;
  font-weight: 500;
}
.scout-badge-muted {
  color: var(--text-muted);
  opacity: 0.85;
}
.scout-popup-analyze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.scout-popup-analyze:hover {
  transform: translateY(-1px);
  background: var(--glass-bg-strong, var(--glass-bg));
}

.deal-detail-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 8px;
}
.deal-detail-address {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 600;
}
.deal-detail-sub {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 12px;
}
.deal-detail-score-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.deal-detail-score-high {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.30);
}
.deal-detail-score-mid {
  color: #854d0e;
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.30);
}
.deal-detail-score-low {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.30);
}
[data-theme="dark"] .deal-detail-score-high { color: #86efac; }
[data-theme="dark"] .deal-detail-score-mid { color: #fde68a; }
[data-theme="dark"] .deal-detail-score-low { color: #fca5a5; }

.deal-detail-rec-callout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  margin-bottom: 16px;
}
.deal-detail-rec-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deal-detail-rec-value {
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.deal-detail-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.deal-detail-action-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.deal-detail-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.deal-detail-action-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.deal-detail-action-secondary {
  color: var(--text-muted);
}

.deal-detail-section {
  padding-top: 16px;
  margin-bottom: 16px;
  border-top: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.15));
}
.deal-detail-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.deal-detail-section-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deal-detail-section-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.deal-detail-notes {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  resize: vertical;
  min-height: 60px;
}
.deal-detail-notes:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* ----------------------------------------------------------------
   Comparable Sales section
   ---------------------------------------------------------------- */
.comps-body {
  font-size: 12px;
  color: var(--text-muted);
}
.comps-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comps-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.comps-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.comps-row-addr {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comps-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.comps-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.comps-row-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.comps-row-date,
.comps-row-ppsf {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.comps-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.comps-summary {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 6px 8px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
}

/* ----------------------------------------------------------------
   Deal Q&A Section
   ---------------------------------------------------------------- */
.qa-section {
  padding-top: 16px;
  margin-bottom: 16px;
  border-top: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.15));
}
.qa-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  resize: vertical;
  min-height: 54px;
}
.qa-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.qa-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.qa-ask-btn {
  padding: 6px 14px;
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.qa-ask-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.qa-ask-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.qa-clear-link {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
}
.qa-clear-link:hover {
  color: var(--text);
}
.qa-history {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qa-pair {
  border-radius: var(--r-button);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
}
.qa-pair-q {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.qa-pair-a {
  color: var(--text-muted);
  white-space: pre-wrap;
}
.qa-thinking {
  font-size: 12px;
  color: var(--text-muted);
  animation: qa-pulse 1.5s ease-in-out infinite;
  padding: 4px 0;
}
@keyframes qa-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.qa-error {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
}
.qa-limit-msg {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* ----------------------------------------------------------------
   Settings Panel Refactor (Appearance / Investing / Notifications / Account)
   ---------------------------------------------------------------- */
.settings-grid > .setting-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 18px 2px 6px;
}
.settings-grid > .setting-group-label:first-child {
  padding-top: 4px;
}
.settings-section {
  display: flex;
  flex-direction: column;
}
.settings-section .setting-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.settings-section .setting-row:last-child {
  border-bottom: none;
}

/* Account section (badge + buttons; replaces pricing matrix) */
.settings-plan-section.settings-section {
  gap: 0;
}
.settings-plan-section .account-status-row {
  padding-top: 2px;
  border-bottom: 1px solid var(--divider);
}
.settings-plan-section .account-status-row .plan-status-text {
  color: var(--text-muted);
  font-size: 11px;
}
.settings-plan-section .account-actions-row {
  padding: 12px 0 4px;
  border-bottom: none;
  display: block;
}
.settings-plan-section .account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.account-btn:hover {
  background: rgba(255,255,255,0.08);
}
.account-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.account-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--body-bg);
}
.account-btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.05);
}
.account-btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.account-btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.account-btn-danger {
  background: rgba(220,38,38,0.15);
  color: #f87171;
  border: 1px solid rgba(220,38,38,0.3);
}
.account-btn-danger:hover {
  background: rgba(220,38,38,0.25);
  color: #fca5a5;
}
.settings-account-forms {
  margin-top: 16px;
}
.settings-account-forms .settings-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.settings-account-danger-zone {
  margin-top: 8px;
}
.settings-text-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.settings-text-input:focus {
  border-color: rgba(255,255,255,0.3);
}

/* ----------------------------------------------------------------
   Icon Rail (rail-first sidebar pattern)
   Slim 56px persistent column of icons; sole icon control surface.
   Sidebar pane (#sidebar) opens to its right when an icon is clicked.
   ---------------------------------------------------------------- */
.icon-rail {
  position: fixed;
  z-index: 19;
  top: 12px;
  left: 12px;
  width: 56px;
  /* height is content-driven, not 100vh */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-radius: var(--r-sidebar);
  /* vertical divider only spans the icon column, applied as a right border */
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), background var(--theme-transition);
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rail-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--icon-color);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}

.rail-icon:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.rail-icon:active {
  transform: scale(0.94);
}

.rail-icon.active {
  color: var(--text-primary);
  background: var(--hover-bg);
}

/* 3px left accent bar on active rail icon */
.rail-icon.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 4px;
  background: var(--accent, #f5c451);
}

/* Unread indicator dot (Activity merges notifications) */
.rail-icon[data-unread]:not([data-unread="0"]):not([data-unread=""])::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #f5c451);
  box-shadow: 0 0 0 2px var(--bg, #0a0a0a);
}

/* Sidebar shifts right of rail when open */
.investor-console {
  left: 76px;
}

/* When rail collapsed (no sidebar pane), only rail shows, map fills remaining */
body.sidebar-collapsed .investor-console {
  transform: translateX(calc(-100% - 100px));
}

/* When sidebar-open is set we already get the existing translateX(0) */

/* Drop legacy sidebar-toggle (rail replaces it) */
.sidebar-toggle { display: none !important; }

/* New pane header: title + expand + close */
.console-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.pane-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.expand-btn,
.close-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--icon-color);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}

.expand-btn:hover,
.close-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.expand-btn:active,
.close-btn:active {
  transform: scale(0.92);
}

/* Rail tooltips: positioned via JS using position:fixed so they escape clip */
.rail-tooltip {
  position: fixed;
  z-index: 10000;
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(40, 40, 40, 0.94);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
}
.rail-tooltip.visible { opacity: 1; }
[data-theme="dark"] .rail-tooltip {
  background: rgba(60, 60, 60, 0.94);
}

/* Suppress the legacy CSS pseudo tooltip on rail icons (we render via JS) */
.rail-icon[data-tooltip]::after,
.rail-icon[data-tooltip]::before {
  /* keep ::before for the active accent; only suppress tooltip ::after */
}
.rail-icon[data-tooltip]::after { content: none !important; }

/* Mobile: rail stays put; sidebar overlays */
@media (max-width: 768px) {
  .icon-rail {
    top: 8px;
    left: 8px;
    width: 52px;
  }
  /* Default collapsed position: below viewport (translateY(100%) from the earlier rule) */
  .investor-console { left: 0; }
}


/* === Global focus rings: keyboard-only via :focus-visible === */
/* Suppress the browser default ring on mouse/touch focus only for styled elements. */
/* Do NOT use a wildcard *:focus override - it strips rings from everything. */
:focus:not(:focus-visible) { outline: none; }
/* Inputs get a border highlight on focus (both mouse and keyboard). */
input:focus, textarea:focus, select:focus {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}
/* Keyboard focus ring via :focus-visible on any focusable element. */
:focus-visible {
  outline: 2px solid var(--focus-ring, #60a5fa);
  outline-offset: 2px;
}


/* Onboarding: 'Other role' free-text input revealed when role=other */
.onboarding-role-other-input {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  min-height: 48px;
  line-height: 1.4;
  font-size: 16px;
  border-radius: var(--r-input);
  background: var(--input-bg);
  border: var(--input-border);
  color: var(--text-primary);
}
.onboarding-role-other-input::placeholder { color: var(--text-muted); }


/* Dashboard map: dataviz style is already monochrome; vignette in section 31 adds focus. */


/* Brand green splash color (Scouq accent) */
:root { --scouq-green: #4ade80; --scouq-green-dim: #16a34a; --scouq-green-bg: rgba(74,222,128,0.14); }

/* '2 months free' badge inside the Yearly toggle */
.billing-savings-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #052e16;
  background: var(--scouq-green);
}

/* When the Yearly button is active, keep the pill readable (lighter bg) */
.billing-toggle-btn.active .billing-savings-pill,
.billing-toggle-btn.is-active .billing-savings-pill {
  color: #052e16;
  background: #86efac;
}


/* Sidebar hide polish: smooth scale + fade instead of brutal slide */
.investor-console {
  transition: transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1),
              opacity 200ms ease,
              filter 200ms ease;
}
body.sidebar-collapsed .investor-console {
  transform: translateX(-12px) scale(0.98);
  opacity: 0;
  filter: blur(2px);
  pointer-events: none;
}


/* Fit-view button: icon + label inline */
.pin-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; }
.pin-btn-label { font-size: 11px; font-weight: 500; color: var(--text-primary); letter-spacing: 0.01em; }


/* Feature Requests UI in Settings */
.feature-request-textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--r-input);
  background: var(--input-bg);
  border: var(--input-border);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
}
.feature-request-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.feature-request-status {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   Deals Expanded Mode (split view: map left, grid right)
   ========================================================= */
.deals-expanded { display: none; }

/* When sidebar is expanded AND deals tab is active, switch to split layout */
body.sidebar-expanded #tabDeals.active #feedView,
body.sidebar-expanded #tabDeals.active #filterView { display: none !important; }

body.sidebar-expanded #tabDeals.active .deals-expanded {
  display: grid;
  grid-template-columns: 60% 40%;
  grid-template-rows: 1fr;
  position: absolute;
  inset: 0;
  top: 56px; /* clear console header */
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* Transparent column over the map so user sees + interacts with map */
.deals-expanded-mapcol {
  background: transparent;
  pointer-events: none;
  position: relative;
}

/* Make the whole expanded sidebar transparent on the left half so the
   underlying #map shows through. The grid column re-establishes its own
   solid background. */
/* Expanded mode keeps the same glass language as sidebar mode.
   For Deals: the LEFT half (.deals-expanded-mapcol) needs to be fully transparent so
   the user can pan/click the map; the RIGHT half re-establishes glass that matches the
   sidebar's tint and blur (the sidebar's .glass background otherwise would cover the map).
   For all OTHER panes (saved/activity/insights/network/groups/settings) we keep the
   sidebar's glass background intact: no opaque --surface overrides. */
body.sidebar-expanded #sidebar.investor-console {
  /* Default: keep .glass background from base styles. Deals tab specifically opts out
     below so the map column on the left stays interactive. */
}
body.sidebar-expanded #sidebar.investor-console:has(#tabDeals.active) {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}
body.sidebar-expanded #sidebar .sidebar-content {
  background: transparent;
}
body.sidebar-expanded #tabDeals.active {
  background: transparent;
}
/* Console header in Deals expanded re-establishes glass (sidebar wrapper is transparent there) */
body.sidebar-expanded #tabDeals.active .console-header,
body.sidebar-expanded #sidebar:has(#tabDeals.active) .console-header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  z-index: 2;
}
/* For non-Deals panes the console header inherits the sidebar's glass; no extra paint. */
body.sidebar-expanded .console-header {
  position: relative;
  z-index: 2;
}

.deals-expanded-gridcol {
  display: flex;
  flex-direction: column;
  /* Match sidebar glass exactly so Deals' right column visually = the sidebar pane. */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  min-width: 0;
  overflow: hidden;
}

.deals-expanded-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.dx-toolbar-spacer { flex: 1; }
.dx-count {
  font-size: 12px;
  color: var(--text-muted, #888);
  white-space: nowrap;
}
.dx-sort select,
.dx-sort {
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
}
.dx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.dx-btn:hover:not(:disabled) {
  background: var(--input-bg-hover, rgba(255,255,255,0.08));
}
.dx-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dx-btn-primary {
  background: var(--accent, #4f8ef7);
  color: var(--body-bg, #fff);
  border-color: transparent;
}
.dx-btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.dx-btn-ghost {
  background: transparent;
  border-color: transparent;
}

.deals-expanded-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.sidebar-expanded #tabDeals.active .deals-expanded.dx-filters-hidden .deals-expanded-body {
  grid-template-columns: 0 1fr;
}
body.sidebar-expanded #tabDeals.active .deals-expanded.dx-filters-hidden .dx-filter-rail {
  display: none;
}

.dx-filter-rail {
  border-right: 1px solid var(--border, rgba(255,255,255,0.06));
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dx-filter-group { display: flex; flex-direction: column; gap: 4px; }
.dx-filter-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-label-strong);
}
.dx-input, .dx-select {
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  width: 100%;
}
.dx-filter-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dx-range-row { display: flex; align-items: center; gap: 8px; }
.dx-range-row input[type=range] { flex: 1; }
.dx-range-val { font-size: 11px; color: var(--text-muted); min-width: 24px; text-align: right; }

.dx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  align-content: start;
}
@media (max-width: 1100px) {
  .dx-grid { grid-template-columns: 1fr; }
}
.dx-card {
  position: relative;
  background: var(--card-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.dx-card:hover {
  border-color: var(--accent, #4f8ef7);
  background: var(--card-bg-hover, rgba(255,255,255,0.05));
}
.dx-card.dx-card-selected {
  border-color: var(--accent, #4f8ef7);
  box-shadow: 0 0 0 1px var(--accent, #4f8ef7) inset;
}
.dx-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.dx-card-addr {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e8e8ea);
  line-height: 1.3;
  margin: 0;
}
.dx-card-sub {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin: 2px 0 0;
}
.dx-card-score {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary, #e8e8ea);
  white-space: nowrap;
}
.dx-card-score.score-hot   { background: rgba(34,197,94,0.18);  color: #22c55e; }
.dx-card-score.score-warm  { background: rgba(234,179,8,0.18);  color: #eab308; }
.dx-card-score.score-watch { background: rgba(202,138,4,0.18);  color: #ca8a04; }
.dx-card-score.score-cold  { background: rgba(220,38,38,0.18);  color: #f87171; }
.dx-card-row {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted, #888);
  flex-wrap: wrap;
}
.dx-card-row strong {
  color: var(--text-primary, #e8e8ea);
  font-weight: 600;
}
.dx-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.dx-card-actions label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted, #888);
  cursor: pointer;
  user-select: none;
}
.dx-card-actions input[type=checkbox] { cursor: pointer; }

.dx-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #888);
  font-size: 13px;
}

/* Compare drawer */
.dx-compare-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: var(--surface, rgba(20,20,22,0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), height 280ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  z-index: 5;
  display: flex;
  flex-direction: column;
}
.dx-compare-drawer.dx-open {
  height: 320px;
  transform: translateY(0);
}
.dx-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.dx-drawer-header h3 {
  font-size: 13px;
  margin: 0;
  color: var(--text-primary, #e8e8ea);
}
.dx-drawer-actions { display: flex; gap: 6px; }
.dx-drawer-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
}
.dx-compare-col {
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.02);
  font-size: 11px;
}
.dx-compare-col .dx-cc-addr {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e8e8ea);
}
.dx-compare-col .dx-cc-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted, #888);
}
.dx-compare-col .dx-cc-row strong {
  color: var(--text-primary, #e8e8ea);
  font-weight: 600;
}
.dx-compare-col .dx-cc-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.dx-compare-ai-out {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: rgba(79,142,247,0.06);
  border: 1px solid rgba(79,142,247,0.25);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary, #e8e8ea);
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------
   Find Pros directory (Network panel)
   ------------------------------------------------------------------ */
.pros-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.pros-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pros-chip {
  appearance: none;
  background: var(--bg-elev, #1a1a1a);
  color: var(--text-secondary, #9aa0a6);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.pros-chip:hover { color: var(--text-primary, #e8e8ea); }
.pros-chip.active { background: rgba(37, 99, 235, 0.08); }
.pros-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pros-search {
  grid-column: 1 / -1;
  width: 100%;
  appearance: none;
  background: var(--bg-elev, #1a1a1a);
  color: var(--text-primary, #e8e8ea);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
}
.pros-select {
  appearance: none;
  background: var(--bg-elev, #1a1a1a);
  color: var(--text-primary, #e8e8ea);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.pros-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pros-empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--text-secondary, #9aa0a6);
  font-size: 12px;
}
.pros-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 8px;
}
.pros-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pros-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.pros-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 16px;
}
.pros-card-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pros-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pros-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e8e8ea);
}
.pros-role-badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.pros-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.3px;
}
.pros-meta {
  font-size: 11px;
  color: var(--text-secondary, #9aa0a6);
}
.pros-license {
  font-size: 10px;
  color: var(--text-tertiary, #6b7280);
  letter-spacing: 0.2px;
}
.pros-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pros-btn {
  appearance: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1px solid var(--border-color, #2a2a2e);
}
.pros-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pros-btn-ghost {
  background: transparent;
  color: var(--text-primary, #e8e8ea);
}
.pros-btn-ghost:hover { background: var(--bg-elev-hover, #222); }
.pros-btn-primary {
  background: var(--accent, #3b82f6);
  color: var(--body-bg, #fff);
  border-color: var(--accent, #3b82f6);
}
.pros-btn-primary:hover { filter: brightness(1.08); }
.pros-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}
.pros-page-btn {
  appearance: none;
  background: var(--bg-elev, #1a1a1a);
  color: var(--text-primary, #e8e8ea);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pros-page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.pros-page-label {
  font-size: 11px;
  color: var(--text-secondary, #9aa0a6);
}
.pros-compliance {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-tertiary, #6b7280);
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 6px;
  text-align: center;
}
.pros-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  appearance: none;
  background: transparent;
  color: var(--text-secondary, #9aa0a6);
  border: none;
  padding: 4px 0;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pros-back-btn:hover { color: var(--text-primary, #e8e8ea); }
.pros-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.pros-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #e8e8ea);
}
.pros-detail-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary, #9aa0a6);
}
.pros-detail-bio {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary, #e8e8ea);
  margin: 6px 0 12px;
}
.pros-detail-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-elev, #1a1a1a);
  border: 1px solid var(--border-color, #2a2a2e);
  border-radius: 8px;
  margin-bottom: 12px;
}
.pros-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}
.pros-detail-label {
  color: var(--text-tertiary, #6b7280);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.pros-detail-value {
  color: var(--text-primary, #e8e8ea);
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}
a.pros-detail-value {
  color: var(--accent, #3b82f6);
  text-decoration: none;
}
a.pros-detail-value:hover { text-decoration: underline; }

/* ================================================================
   Insights Tab (Sidebar + Expanded)
   ================================================================ */

/* Date range picker in header */
.ix-range-wrap { display: flex; align-items: center; }
.ix-range-seg {
  display: inline-flex;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.ix-range-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.ix-range-btn:hover { color: var(--text); }
.ix-range-btn.is-active {
  background: var(--accent);
  color: var(--bg, #fff);
}
body[data-theme="dark"] .ix-range-btn.is-active { color: #0a0a0a; }
body[data-theme="light"] .ix-range-btn.is-active { color: #fff; }

/* ---------- Sidebar mode (2x2 KPI grid) ---------- */
.ix-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 460px) {
  .ix-side-grid { grid-template-columns: 1fr; }
}

.ix-kpi {
  appearance: none;
  text-align: left;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  animation: insightFadeIn 280ms ease both;
}
.ix-kpi:hover { transform: translateY(-1px); border-color: rgba(0,0,0,0.12); }
body[data-theme="dark"] .ix-kpi:hover { border-color: rgba(255,255,255,0.15); }

.ix-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.ix-kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ix-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ix-kpi-delta {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.ix-delta-up { color: #10b981; background: rgba(16, 185, 129, 0.12); }
.ix-delta-down { color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.ix-delta-flat { color: var(--text-muted); background: var(--accent-subtle); }

.ix-expand-link {
  appearance: none;
  width: 100%;
  background: transparent;
  border: var(--glass-inner-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 160ms ease, border-color 160ms ease;
}
.ix-expand-link:hover { color: var(--text); }

/* ---------- Empty state hero ---------- */
.ix-empty-hero {
  padding: 36px 16px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ix-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--glass-inner-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ix-empty-hero h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.ix-empty-hero p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
}
.ix-empty-ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}
.ix-cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.ix-cta:hover { transform: translateY(-1px); background: var(--accent-subtle); }
.ix-cta svg { color: var(--text-muted); }

/* ---------- Expanded mode ---------- */
.sidebar-expanded .insights-panel {
  padding: 0 4px;
}

.ix-expanded {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 24px;
}

/* KPI strip (6 tiles) */
.ix-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 1200px) {
  .ix-kpi-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .ix-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}

.ix-row {
  display: grid;
  gap: 14px;
}
.ix-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .ix-row-2 { grid-template-columns: 1fr; }
}

.ix-card {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 14px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: insightFadeIn 320ms ease both;
  min-height: 220px;
}
.ix-card-wide { min-height: auto; }

.ix-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ix-card-h h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.ix-card-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Donut */
.ix-donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}
@media (max-width: 560px) {
  .ix-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
}
.ix-donut { width: 180px; height: 180px; }
.ix-donut-svg { width: 100%; height: 100%; }
.ix-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ix-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.ix-legend-dot { width: 10px; height: 10px; border-radius: 4px; }
.ix-legend-label { color: var(--text); }
.ix-legend-val { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ix-legend-val em { font-style: normal; color: var(--text-muted); font-size: 10px; }

/* Chart canvas */
.ix-chart { width: 100%; }
.ix-chart-svg { width: 100%; height: auto; display: block; }
.ix-heatmap-svg { width: 100%; height: auto; display: block; }

/* Activity feed */
.ix-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ix-feed-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: var(--glass-inner-border);
}
.ix-feed-item:last-child { border-bottom: none; }
.ix-feed-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  justify-self: center;
}
.ix-feed-icon-save { background: #10b981; }
.ix-feed-icon-price { background: #f59e0b; }
.ix-feed-icon-score { background: #3b82f6; }
.ix-feed-icon-info { background: var(--text-muted); }
.ix-feed-title { font-size: 13px; font-weight: 600; }
.ix-feed-desc { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.ix-feed-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ix-feed-empty {
  padding: 18px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Sidebar mode: hide range picker by default, show only when expanded */
.insights-panel { padding: 0 2px; }

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

/* =========================================================
   Saved Expanded Mode (power-mode: folder rail + table + bulk bar)
   ========================================================= */
.saved-expanded { display: none; }

/* Hide compact watchlist UI when expanded; show power-mode layout */
body.sidebar-expanded #tabSaved.active .tab-panel-header,
body.sidebar-expanded #tabSaved.active #savedEmpty,
body.sidebar-expanded #tabSaved.active #savedItems,
body.sidebar-expanded #tabSaved.active #compareResult,
body.sidebar-expanded #tabSaved.active #compareControls { display: none !important; }

body.sidebar-expanded #tabSaved.active .saved-expanded {
  display: grid;
  grid-template-columns: 240px 1fr;
  position: absolute;
  inset: 0;
  top: 56px;
  overflow: hidden;
  /* Inherit the sidebar's glass background; do not paint an opaque surface here. */
  background: transparent;
}

/* Folder rail (left) */
.saved-expanded-folders {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border, rgba(255,255,255,0.06));
  background: var(--surface-alt, rgba(255,255,255,0.02));
}
.sx-rail-section { display: flex; flex-direction: column; gap: 6px; }
.sx-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted, #888);
  padding: 0 6px 4px;
}
.sx-icon-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-muted, #aaa);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.sx-icon-btn:hover { color: var(--text-primary, #eee); background: rgba(255,255,255,0.06); }

.sx-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary, #e8e8ea);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.sx-folder-item:hover { background: rgba(255,255,255,0.04); }
.sx-folder-item.sx-active {
  background: rgba(79,142,247,0.12);
  border-color: rgba(79,142,247,0.35);
  color: var(--accent, #4f8ef7);
}
.sx-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-folder-count {
  font-size: 11px;
  color: var(--text-muted, #888);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.sx-folder-item.sx-active .sx-folder-count { background: rgba(79,142,247,0.2); color: var(--accent, #4f8ef7); }
.sx-folder-actions {
  display: none;
  gap: 2px;
  margin-left: auto;
}
.sx-folder-item:hover .sx-folder-actions { display: inline-flex; }
.sx-folder-actions .sx-icon-btn { border: none; width: 18px; height: 18px; }

.sx-tag-list, .sx-watchlist-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 4px;
}
.sx-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #ddd);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
}
.sx-tag-chip:hover { background: rgba(255,255,255,0.08); }
.sx-tag-chip.sx-active {
  background: rgba(79,142,247,0.15);
  border-color: rgba(79,142,247,0.4);
  color: var(--accent, #4f8ef7);
}
.sx-watchlist-list { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; }
.sx-watchlist-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text-primary, #ddd);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.sx-watchlist-item:hover { background: rgba(255,255,255,0.04); }
.sx-watchlist-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-watchlist-alert { font-size: 10px; color: var(--accent, #4f8ef7); }

.sx-rail-empty { font-size: 11px; color: var(--text-muted, #777); padding: 4px 8px; }

/* Main column */
.saved-expanded-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.saved-expanded-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.sx-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.sx-toolbar-spacer { flex: 0 0 8px; }
.sx-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #888);
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  flex: 0 0 auto;
}

.saved-expanded .sx-input,
.saved-expanded .sx-select {
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.saved-expanded .sx-input { width: 110px; }
.saved-expanded .sx-input-sm { width: 86px; }
.saved-expanded .sx-select { width: 128px; }
.sx-score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
}
.sx-score-label { font-size: 11px; color: var(--text-muted, #888); }
.sx-score-wrap input[type=range] { width: 110px; }
.sx-range-val { font-size: 11px; color: var(--text-muted, #888); min-width: 20px; text-align: right; }

.sx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.sx-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.sx-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sx-btn-primary {
  background: linear-gradient(135deg, #5b95f8 0%, #3a78e0 100%);
  color: #ffffff !important;
  border-color: transparent;
  font-weight: 500;
}
.sx-btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.sx-btn-ghost { background: transparent; border-color: transparent; }
.sx-btn-danger {
  background: rgba(220,80,80,0.12);
  border-color: rgba(220,80,80,0.4);
  color: #f08080;
}
.sx-btn-danger:hover:not(:disabled) { background: rgba(220,80,80,0.22); }

/* Table */
.saved-expanded-table-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}
.sx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--text-primary, #e8e8ea);
}
.sx-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface, rgba(20,20,22,0.98));
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  white-space: nowrap;
  font-weight: 600;
}
.sx-sortable { cursor: pointer; user-select: none; }
.sx-sortable:hover { color: var(--text-primary, #eee); }
.sx-sortable.sx-sorted-asc::after  { content: " \2191"; color: var(--accent, #4f8ef7); }
.sx-sortable.sx-sorted-desc::after { content: " \2193"; color: var(--accent, #4f8ef7); }
.sx-col-check { width: 36px; }
.sx-col-actions { width: 110px; }

.sx-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.04));
  vertical-align: middle;
  white-space: nowrap;
}
.sx-table tbody tr { transition: background 100ms; }
.sx-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.sx-table tbody tr.sx-row-selected { background: rgba(79,142,247,0.08); }
.sx-table tbody tr.sx-row-selected:hover { background: rgba(79,142,247,0.12); }

.sx-cell-addr { font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sx-cell-addr small { display: block; font-weight: 400; color: var(--text-muted, #888); font-size: 11px; }
.sx-score-pill {
  display: inline-block;
  min-width: 32px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #e8e8ea);
}
.sx-score-pill.sx-score-hi { background: rgba(64,180,100,0.18); color: #6fd494; }
.sx-score-pill.sx-score-md { background: rgba(220,160,60,0.18); color: #e3b15a; }
.sx-score-pill.sx-score-lo { background: rgba(220,80,80,0.18); color: #e07878; }
.sx-strategy-tag {
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-primary, #ddd);
}
.sx-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 100ms; }
.sx-table tbody tr:hover .sx-row-actions { opacity: 1; }
.sx-row-actions .sx-btn { padding: 4px 8px; font-size: 11px; }

.sx-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 60px 20px;
  color: var(--text-muted, #888);
}
.sx-empty-state p { margin: 0; font-size: 14px; color: var(--text-primary, #ddd); }
.sx-empty-state small { font-size: 12px; }
.sx-empty-state .sx-btn { margin-top: 12px; }

/* Bulk action bar (slide up from bottom) */
.sx-bulk-bar {
  position: absolute;
  left: 50%;
  bottom: -100px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface, rgba(28,28,32,0.98));
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 4;
  transition: bottom 220ms ease, opacity 220ms ease;
  opacity: 0;
  pointer-events: none;
}
.sx-bulk-bar.sx-bulk-open {
  bottom: 18px;
  opacity: 1;
  pointer-events: auto;
}
.sx-bulk-count {
  font-size: 12px;
  color: var(--text-primary, #ddd);
  font-weight: 500;
  padding-right: 6px;
  border-right: 1px solid var(--border, rgba(255,255,255,0.08));
}
.sx-bulk-count span { color: var(--accent, #4f8ef7); font-weight: 700; }
.sx-bulk-actions { display: flex; gap: 6px; }


/* =========================================================
   Network Expanded Mode - Investor Network full-screen workspace
   ========================================================= */
.network-expanded { display: none; }

/* When sidebar is expanded AND network tab is active, switch layout */
body.sidebar-expanded #tabNetwork.active #networkPanel { display: none !important; }
body.sidebar-expanded #tabNetwork.active .network-expanded {
  display: grid;
  grid-template-columns: 220px 1fr;
  position: absolute;
  inset: 0;
  top: 56px;
  /* Inherit the sidebar's glass background: expanded mode is just wider, not opaque. */
  background: transparent;
  overflow: hidden;
  z-index: 1;
}
body.sidebar-expanded #tabNetwork.active .tab-panel-header { display: none; }

.network-expanded .nx-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px;
  border-right: 1px solid var(--border, rgba(255,255,255,0.06));
  overflow-y: auto;
  min-height: 0;
}
.nx-nav-hdr {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #888);
  padding: 4px 10px 10px;
}
.nx-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #e8e8ea);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.nx-nav-item:hover { background: rgba(255,255,255,0.04); }
.nx-nav-item.active {
  background: rgba(79,142,247,0.10);
  border-color: rgba(79,142,247,0.3);
  color: #fff;
}
.nx-nav-ico { display: inline-flex; width: 18px; justify-content: center; color: var(--text-muted); }
.nx-nav-item.active .nx-nav-ico { color: var(--accent, #4f8ef7); }
.nx-nav-label { flex: 1; }
.nx-nav-badge {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted, #aaa);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.nx-nav-item.active .nx-nav-badge { background: rgba(79,142,247,0.2); color: var(--accent, #4f8ef7); }
.nx-nav-footer {
  margin-top: auto;
  font-size: 10px;
  color: var(--text-muted, #888);
  padding: 10px;
  line-height: 1.45;
  opacity: 0.7;
}

.network-expanded .nx-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 12px;
}
.nx-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.nx-detail-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}
.nx-detail-hint { font-size: 11px; color: var(--text-muted, #888); }

/* shared bits */
.nx-input {
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: inherit;
  min-width: 120px;
}
.nx-textarea { width: 100%; resize: vertical; line-height: 1.5; }
.nx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: var(--input-border, 1px solid rgba(255,255,255,0.1));
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.nx-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.nx-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.nx-btn-primary {
  background: var(--accent, #4f8ef7);
  border-color: transparent;
  color: var(--body-bg, #fff);
}
.nx-btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.nx-btn-ghost { background: transparent; }
.nx-btn-danger { color: #ef4444; }
.nx-btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.08); }

.nx-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.nx-filter-row .nx-input { flex: 1; min-width: 180px; }
.nx-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nx-chip {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  color: var(--text-muted, #aaa);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.nx-chip:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.nx-chip.active { color: var(--accent, #4f8ef7); border-color: var(--accent, #4f8ef7); }

.nx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.nx-avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.nx-role-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid;
  letter-spacing: 0.02em;
}

.nx-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-muted, #888);
  font-size: 13px;
}
.nx-empty p { margin: 0 0 4px; font-weight: 600; }
.nx-empty small { font-size: 11px; }

/* Contacts grid */
.nx-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.nx-contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.nx-contact-info { min-width: 0; }
.nx-contact-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.nx-contact-meta { font-size: 11px; color: var(--text-muted, #888); }
.nx-contact-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Messages */
.nx-messages {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  border: var(--input-border, 1px solid rgba(255,255,255,0.08));
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.nx-thread-list {
  border-right: 1px solid var(--border, rgba(255,255,255,0.06));
  overflow-y: hidden;
  background: rgba(0,0,0,0.15);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.nx-thread-list-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.nx-thread-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary, #e8e8ea);
  font-family: inherit;
}
.nx-thread-row:hover { background: rgba(255,255,255,0.03); }
.nx-thread-row.active { background: rgba(79,142,247,0.10); }
.nx-thread-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nx-thread-name { font-size: 13px; font-weight: 600; }
.nx-thread-preview {
  font-size: 11px;
  color: var(--text-muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nx-unread-badge {
  background: var(--accent, #4f8ef7);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}

.nx-thread-view { display: flex; flex-direction: column; min-height: 0; }
.nx-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.nx-thread-head-info { display: flex; flex-direction: column; }
.nx-thread-head-name { font-size: 14px; font-weight: 600; }
.nx-thread-head-role { font-size: 11px; }
.nx-stream {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
}
.nx-bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}
.nx-bubble.me {
  align-self: flex-end;
  background: var(--accent, #4f8ef7);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.nx-bubble.them {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #e8e8ea);
  border-bottom-left-radius: 4px;
}
.nx-bubble-body { word-wrap: break-word; }
.nx-bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
  align-self: flex-end;
}
.nx-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.nx-composer .nx-input { flex: 1; }

/* Find pros */
.nx-pros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.nx-pro-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nx-pro-top { display: flex; gap: 12px; }
.nx-pro-who { min-width: 0; flex: 1; }
.nx-pro-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.nx-pro-name { font-size: 13px; font-weight: 600; }
.nx-verified {
  font-size: 10px;
  color: var(--accent, #3b82f6);
  border: 1px solid rgba(59,130,246,0.45);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nx-pro-meta { font-size: 11px; color: var(--text-muted, #aaa); }
.nx-pro-lic { font-size: 10px; color: var(--text-muted, #888); margin-top: 2px; }

/* Pro rating stars (SVG-based) */
.pro-stars { display: inline-flex; align-items: center; gap: 1px; color: #f59e0b; }
.pro-stars span { display: inline-flex; align-items: center; line-height: 1; }
.nx-pro-actions { display: flex; gap: 6px; }
.nx-pro-actions .nx-btn { flex: 1; justify-content: center; }

.nx-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 6px;
}
.nx-pager-label { font-size: 11px; color: var(--text-muted, #888); }
.nx-compliance {
  padding: 10px 0 4px;
  font-size: 10px;
  color: var(--text-muted, #888);
  text-align: center;
  border-top: 1px dashed var(--border, rgba(255,255,255,0.06));
  margin-top: 8px;
}

/* Groups summary */
.nx-groups-list { display: flex; flex-direction: column; gap: 6px; }
.nx-group-row {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
}
.nx-group-row-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.nx-group-row-meta { font-size: 11px; color: var(--text-muted, #888); }

/* Intro dialog */
.nx-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.nx-dialog {
  width: min(520px, 92vw);
  background: var(--surface, #1a1a1c);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nx-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nx-dialog-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.nx-dialog-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #888);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.nx-dialog-sub { font-size: 12px; color: var(--text-muted, #aaa); margin: 0; }
.nx-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Messages: head action row (+ New Message / + New Group buttons) */
.nx-msg-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
/* Messages: search bar above thread list */
.nx-thread-search {
  padding: 8px 10px 6px;
  border-bottom: var(--input-border, 1px solid rgba(255,255,255,0.06));
}
.nx-thread-search input {
  width: 100%;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: var(--input-border, 1px solid rgba(255,255,255,0.08));
  border-radius: 6px;
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 5px 10px;
  font-family: inherit;
  outline: none;
}
/* Contact picker dialog */
.nx-picker-dialog {
  width: min(380px, 92vw);
  background: var(--glass-bg, rgba(14,14,14,0.95));
  border: var(--glass-border, 1px solid rgba(255,255,255,0.09));
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  max-height: min(480px, 80vh);
}
.nx-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: var(--input-border, 1px solid rgba(255,255,255,0.07));
}
.nx-picker-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.nx-picker-search-row {
  padding: 8px 12px;
  border-bottom: var(--input-border, 1px solid rgba(255,255,255,0.07));
}
.nx-picker-search-row input {
  width: 100%;
  background: var(--input-bg, rgba(255,255,255,0.05));
  border: var(--input-border, 1px solid rgba(255,255,255,0.08));
  border-radius: 6px;
  color: var(--text-primary, #e8e8ea);
  font-size: 12px;
  padding: 6px 10px;
  font-family: inherit;
  outline: none;
}
.nx-picker-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 6px 6px;
}
.nx-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary, #e8e8ea);
  font-family: inherit;
  font-size: 13px;
}
.nx-picker-row:hover { background: var(--hover-bg, rgba(255,255,255,0.05)); }
.nx-picker-row.selected { background: var(--accent-subtle, rgba(255,255,255,0.08)); }
.nx-picker-row-meta { font-size: 11px; color: var(--text-muted, #aaa); }
.nx-picker-empty { padding: 20px 16px; text-align: center; font-size: 12px; color: var(--text-muted, #888); }
.nx-picker-footer {
  padding: 10px 12px;
  border-top: var(--input-border, 1px solid rgba(255,255,255,0.07));
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ----------------------------------------------------------------
   Settings Nav-Pattern (sidebar index + macOS-style expanded layout)
   ---------------------------------------------------------------- */
.settings-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.settings-sidebar-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.settings-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
}
.settings-sub-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.settings-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.settings-back-btn:hover {
  background: var(--hover-bg, rgba(255,255,255,0.06));
  color: var(--text);
}
.settings-search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin: 10px 0 12px;
}
.settings-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.settings-search-input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 30px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  background: var(--input-bg, rgba(255,255,255,0.03));
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-search-input:focus {
  border-color: var(--brand-green, #14ae5c);
  box-shadow: 0 0 0 2px rgba(20, 174, 92, 0.15);
}
.settings-index {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}
.settings-nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-nav-row:hover {
  background: var(--hover-bg, rgba(255,255,255,0.05));
}
.settings-nav-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #fff);
  flex-shrink: 0;
}
[data-theme="light"] .settings-nav-row-icon {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #0a0a0a);
}
.settings-nav-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.settings-nav-row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.settings-nav-row-desc {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-nav-row-chev {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}
.settings-nav-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 8px;
  text-align: center;
}
.settings-detail {
  overflow-y: auto;
  min-height: 0;
  padding-top: 4px;
}
.settings-section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-section-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.settings-section-head p {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Keyboard list ---- */
.settings-kbd-list .setting-row {
  align-items: center;
}
.settings-kbd-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.settings-kbd-group kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--divider);
  background: var(--input-bg, rgba(255,255,255,0.04));
  color: var(--text);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.settings-kbd-hint {
  margin: 10px 2px 0;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- Downloads section ---- */
.settings-downloads-copy {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 6px 0 12px;
}
.settings-downloads-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-downloads-row .setting-input {
  flex: 1;
  min-width: 180px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--input-bg, rgba(255,255,255,0.03));
  color: var(--text);
  font-size: 12px;
}
.settings-downloads-row .setting-input:focus {
  outline: none;
  border-color: var(--brand-green, #14ae5c);
  box-shadow: 0 0 0 2px rgba(20,174,92,0.15);
}
.settings-downloads-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.settings-downloads-version {
  letter-spacing: 0.2px;
}
.settings-downloads-link {
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1px;
}
.settings-downloads-link:hover { color: var(--text); border-color: var(--text); }
.settings-downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 720px) { .settings-downloads-grid { grid-template-columns: 1fr; } }
.settings-download-card {
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-download-card[data-detected="true"] {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
}
.settings-download-glyph {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 4px;
}
.settings-download-glyph svg {
  width: 22px;
  height: 22px;
}
.settings-download-os {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.settings-download-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.settings-download-card .account-btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}

/* ---- Expanded mode: two-column ---- */
.settings-expanded-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  height: 100%;
  min-height: 0;
}
.settings-expanded-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--divider);
  overflow-y: auto;
  min-height: 0;
}
.settings-nav-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.settings-nav-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.settings-nav-rail-item:hover {
  background: var(--hover-bg, rgba(255,255,255,0.04));
}
.settings-nav-rail-item.active {
  background: rgba(20, 174, 92, 0.08);
  border-left-color: var(--brand-green, #14ae5c);
  color: var(--text);
}
.settings-nav-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(20, 174, 92, 0.08);
  color: var(--brand-green, #14ae5c);
  flex-shrink: 0;
}
.settings-nav-rail-item.active .settings-nav-rail-icon {
  background: rgba(20, 174, 92, 0.18);
}
.settings-nav-rail-label {
  font-weight: 500;
}
.settings-expanded-detail {
  overflow-y: auto;
  min-height: 0;
  padding: 0 4px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.settings-section-block-expanded {
  max-width: 720px;
}
.settings-section-block-expanded .settings-section-head h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
/* In sidebar subpage mode, the sub-header already shows the section name; hide inner h3. */
.settings-section-block-active .settings-section-head h3 { display: none; }
.settings-section-block-active .settings-section-head { margin-top: 0; }
.settings-row-highlight {
  background: rgba(20, 174, 92, 0.07);
  border-radius: 6px;
}

/* Narrow viewport: collapse expanded grid */
@media (max-width: 760px) {
  .settings-expanded-shell {
    grid-template-columns: 1fr;
  }
  .settings-expanded-nav {
    border-right: none;
    border-bottom: 1px solid var(--divider);
    padding: 0 0 10px;
  }
  .settings-expanded-detail {
    padding: 12px 4px 24px;
  }
}

/* =============================================================
   Activity Timeline (sidebar + expanded)
   ============================================================= */

.activity-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.activity-header-actions { display: flex; gap: 8px; }
.activity-mark-all {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--text-secondary, rgba(255,255,255,0.7));
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.activity-mark-all:hover {
  color: var(--text-primary, #fff);
  border-color: var(--accent, #14ae5c);
  background: rgba(20, 174, 92, 0.08);
}

.activity-feed { display: flex; flex-direction: column; }
.activity-feed.ax-mode-sidebar { padding: 4px 0 16px; }
.activity-feed.ax-mode-expanded { padding: 16px 24px 32px; max-width: 980px; margin: 0 auto; }

/* Activity skeleton */
.ax-skeleton-wrap { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.ax-skel-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; }
.ax-skel-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--glass-bg, rgba(255,255,255,0.07));
  animation: ax-shimmer 1.4s linear infinite;
}
.ax-skel-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ax-skel-line {
  height: 10px; border-radius: 6px;
  background: var(--glass-bg, rgba(255,255,255,0.07));
  animation: ax-shimmer 1.4s linear infinite;
}
.ax-skel-title { width: 100%; }
.ax-skel-sub   { width: 70%; height: 8px; }
.ax-skel-w80   { width: 80%; }
.ax-skel-w60   { width: 60%; }
.ax-skel-w40   { width: 40%; }
@keyframes ax-shimmer {
  0%   { opacity: 0.55; }
  50%  { opacity: 1; }
  100% { opacity: 0.55; }
}

/* Deal list skeleton cards */
.deal-card-skel {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; margin: 0 0 2px;
  border-radius: 10px;
  background: var(--glass-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.07));
}
.dcs-score {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  animation: ax-shimmer 1.4s linear infinite;
}
.dcs-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dcs-line {
  border-radius: 5px;
  background: rgba(255,255,255,0.07);
  animation: ax-shimmer 1.4s linear infinite;
}
.dcs-title { height: 11px; width: 80%; }
.dcs-sub   { height: 9px;  width: 55%; }
.dcs-tags  { height: 9px;  width: 40%; }

.activity-loading {
  padding: 24px 16px;
  color: var(--text-tertiary, rgba(255,255,255,0.5));
  font-size: 12px;
  text-align: center;
}

.activity-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-tertiary, rgba(255,255,255,0.5));
}
.activity-empty p { margin: 12px 0 4px; font-weight: 600; color: var(--text-secondary, rgba(255,255,255,0.75)); }
.activity-empty small { font-size: 12px; line-height: 1.4; }

.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-list.ax-sidebar { padding: 0 8px; }
.activity-list.ax-expanded { padding: 0; }

/* Row */
.activity-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease, transform 0.12s ease;
  border: 1px solid transparent;
}
.activity-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}
.activity-row:focus-visible {
  outline: 2px solid var(--accent, #14ae5c);
  outline-offset: 1px;
}
.activity-row-unread::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #14ae5c);
  box-shadow: 0 0 0 3px rgba(20,174,92,0.18);
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary, rgba(255,255,255,0.8));
  flex-shrink: 0;
}
.activity-icon.ax-icon-deals      { background: rgba(59,130,246,0.14); color: #60a5fa; }
.activity-icon.ax-icon-properties { background: rgba(59,130,246,0.14); color: #60a5fa; }
.activity-icon.ax-icon-ai         { background: rgba(168,85,247,0.16); color: #c084fc; }
.activity-icon.ax-icon-alerts     { background: rgba(245,158,11,0.16); color: #fbbf24; }
.activity-icon.ax-icon-system     { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }

.activity-body { min-width: 0; }
.activity-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.activity-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.activity-time {
  font-size: 11px;
  color: var(--text-tertiary, rgba(255,255,255,0.45));
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.activity-desc {
  font-size: 12px;
  color: var(--text-secondary, rgba(255,255,255,0.65));
  margin-top: 2px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.activity-actions {
  display: none;
  gap: 4px;
  align-items: center;
}
.activity-row:hover .activity-actions,
.activity-row:focus-within .activity-actions { display: inline-flex; }

.ax-action-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary, rgba(255,255,255,0.75));
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.ax-action-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary, #fff);
}
.ax-action-btn.ax-action-dismiss:hover {
  background: rgba(239,68,68,0.16);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.3);
}

@keyframes activityRowFlash {
  0%   { background: rgba(20,174,92,0.22); }
  100% { background: transparent; }
}
.activity-row-flash { animation: activityRowFlash 1.4s ease-out; }

/* Expanded mode extras */
.ax-filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  margin-bottom: 16px;
}
.ax-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ax-chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, rgba(255,255,255,0.7));
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.ax-chip:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary, #fff);
}
.ax-chip-active {
  background: rgba(59,130,246,0.16);
  border-color: rgba(59,130,246,0.5);
  color: #60a5fa;
}
.ax-search {
  flex: 1 1 220px;
  max-width: 320px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-primary, #fff);
  outline: none;
}
.ax-search:focus {
  border-color: var(--accent, #14ae5c);
  background: rgba(255,255,255,0.06);
}

.ax-group { margin-bottom: 20px; }
.ax-group-hdr {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary, rgba(255,255,255,0.5));
  font-weight: 600;
  padding: 8px 6px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
  display: flex;
  align-items: center;
  gap: 8px;
}
.ax-group-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary, rgba(255,255,255,0.45));
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0;
}

/* In expanded mode rows can be denser */
.ax-mode-expanded .activity-row {
  grid-template-columns: 32px 1fr auto;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
}
.ax-mode-expanded .activity-icon { width: 32px; height: 32px; }
.ax-mode-expanded .activity-title { font-size: 14px; }
.ax-mode-expanded .activity-desc { -webkit-line-clamp: 3; }

/* Activity expanded mode: hide the inner h3 (paneTitle already says Activity),
   anchor the actions to the right edge of the visible area. */
body.sidebar-expanded #tabActivity .activity-panel-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 24px;
  max-width: 980px;
  margin: 0 auto;
  /* Glass language: header floats on the sidebar's glass, no opaque surface here. */
  background: transparent;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.04));
}
body.sidebar-expanded #tabActivity .activity-panel-header h3 { display: none; }

/* Expanded layout: the tab panel itself should be a flex column so the feed scrolls naturally. */
body.sidebar-expanded #tabActivity.active {
  position: absolute;
  inset: 0;
  top: 56px;
  overflow-y: auto;
}

/* =============================================================================
   Groups full forum (gx-*) - sidebar compact + expanded 3-pane workspace
   Authored by the Groups Full Forum agent.
   ========================================================================== */

.groups-compact-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.gx-compact-topbar { display: flex; gap: 6px; align-items: center; }
.gx-compact-body { display: flex; flex-direction: column; gap: 6px; }
.gx-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted); margin: 4px 0 4px;
}
.gx-compact-group-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border: var(--glass-inner-border, 1px solid rgba(255,255,255,.06));
  background: var(--glass-inner-bg, transparent);
  border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text-primary); cursor: pointer; text-align: left;
  transition: background .12s ease, transform .12s ease;
}
.gx-compact-group-row:hover { background: var(--bg-elev-2, rgba(255,255,255,.04)); }
.gx-compact-group-name { color: var(--text-primary); }
.gx-compact-group-count { font-size: 11px; color: var(--text-muted); }

.gx-compact-recent { display: flex; flex-direction: column; gap: 6px; }
.gx-compact-thread-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left;
  background: transparent; border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.gx-compact-thread-row:hover { background: var(--bg-elev-2, rgba(255,255,255,.04)); border-color: var(--glass-inner-border-color, rgba(255,255,255,.08)); }
.gx-compact-thread-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.gx-compact-thread-meta { font-size: 11px; color: var(--text-muted); }

.gx-compact-group-hero { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.gx-compact-group-hero-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.gx-compact-group-hero-meta { font-size: 11px; color: var(--text-muted); }
.gx-compact-group-hero-desc { font-size: 12px; color: var(--text-secondary, var(--text-muted)); margin-top: 4px; line-height: 1.45; }
.gx-compact-actions { display: flex; gap: 6px; margin: 6px 0 8px; }
.gx-compact-thread-list { display: flex; flex-direction: column; gap: 6px; }
.gx-compact-thread-view { display: flex; flex-direction: column; gap: 8px; }

/* Shared button system */
.gx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; line-height: 1;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .08s ease;
}
.gx-btn:active { transform: translateY(1px); }
.gx-btn-small { padding: 6px 10px; font-size: 12px; }
.gx-btn-primary { background: var(--accent, #2563eb); color: var(--body-bg, #000); border-color: transparent; }
.gx-btn-primary:hover { filter: brightness(0.92); }
.gx-btn-primary:disabled { opacity: .55; cursor: default; }
.gx-btn-ghost {
  background: var(--glass-inner-bg, rgba(255,255,255,.03));
  border-color: var(--glass-inner-border-color, rgba(255,255,255,.1));
  color: var(--text-primary);
}
.gx-btn-ghost:hover { background: var(--bg-elev-2, rgba(255,255,255,.06)); }
.gx-btn-ghost.gx-saved { color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }

.gx-loading, .gx-empty {
  font-size: 12px; color: var(--text-muted);
  padding: 14px 0; text-align: center;
}

.gx-pill {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 600;
  letter-spacing: .4px; margin-left: 6px; vertical-align: middle;
}
.gx-pill-pinned { background: rgba(217,119,6,.16); color: #d97706; border: 1px solid rgba(217,119,6,.45); }
.gx-pill-seed { background: rgba(99,102,241,.16); color: #6366f1; border: 1px solid rgba(99,102,241,.45); }

/* Thread rows used in both compact and expanded */
.gx-thread-row {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
  background: var(--glass-inner-bg, rgba(255,255,255,.02));
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.gx-thread-row:hover { background: var(--bg-elev-2, rgba(255,255,255,.04)); border-color: var(--accent, #2563eb); }
.gx-thread-row.active { background: rgba(37,99,235,.10); border-color: var(--accent, #2563eb); }
.gx-thread-row.gx-pinned { border-color: rgba(217,119,6,.45); }
.gx-thread-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gx-thread-row-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.gx-thread-row-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gx-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; display: inline-block; }
.gx-thread-row-side { display: flex; align-items: center; gap: 6px; }
.gx-thread-row-rxs { display: flex; gap: 4px; align-items: center; }
.gx-rx-chip-mini {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: var(--glass-inner-bg, rgba(255,255,255,.05));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
  color: var(--text-secondary, var(--text-muted));
}
.gx-thread-row-rxs-total { font-size: 10px; color: var(--text-muted); margin-left: 2px; }

/* Avatars (neutral default; JS overrides with deterministic muted HSL per name) */
.gx-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #2a2d33;
  color: #e6e6e6; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; overflow: hidden; flex-shrink: 0;
}

/* Markdown styling */
.gx-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; padding: 1.5px 5px; border-radius: 4px;
  background: var(--bg-elev-2, rgba(255,255,255,.06));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
}
.gx-link { color: var(--accent, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.gx-mention { color: var(--accent, #2563eb); font-weight: 600; }
.gx-ul { padding-left: 18px; margin: 6px 0; }

/* =============================
   Expanded 3-pane workspace
   ============================= */

.gx-workspace { padding: 0; }
.gx-shell {
  display: grid;
  grid-template-columns: 240px 360px minmax(0, 680px);
  gap: 0;
  height: 100%;
  min-height: 0;
}
@media (max-width: 1180px) {
  .gx-shell { grid-template-columns: 200px 320px minmax(0, 520px); }
}
@media (max-width: 980px) {
  .gx-shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
}

.gx-col {
  min-width: 0; min-height: 0; overflow: auto;
  padding: 14px 14px 24px;
  border-right: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
  display: flex; flex-direction: column; gap: 8px;
}
.gx-col-reader { border-right: 0; }
.gx-col-head {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: var(--bg, var(--bg-base, rgba(15,15,17,.92)));
  backdrop-filter: blur(8px);
  padding: 4px 0 10px;
  z-index: 1;
}
.gx-col-title { font-size: 13px; font-weight: 600; color: var(--text-primary); letter-spacing: .2px; }

.gx-group-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid transparent;
  color: var(--text-primary); cursor: pointer; text-align: left;
  transition: background .12s ease, border-color .12s ease;
}
.gx-group-item:hover { background: var(--bg-elev-2, rgba(255,255,255,.04)); }
.gx-group-item.active {
  background: rgba(37,99,235,.10);
  border-color: var(--accent, #2563eb);
}
.gx-group-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-group-meta { font-size: 11px; color: var(--text-muted); display: inline-flex; gap: 5px; align-items: center; }
.gx-group-joined {
  display: inline-flex; padding: 1px 6px; border-radius: 999px; font-size: 10px;
  background: rgba(59,130,246,.16); color: var(--accent, #3b82f6); border: 1px solid rgba(59,130,246,.4);
}

.gx-threads-sub { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.gx-threads-sub-meta { font-size: 12px; color: var(--text-muted); }
.gx-threads-desc { font-size: 12px; color: var(--text-secondary, var(--text-muted)); line-height: 1.5; padding: 0 2px 6px; }
.gx-sort-pills { display: flex; gap: 6px; padding: 4px 0 6px; }
.gx-sort-pill {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--glass-inner-bg, rgba(255,255,255,.03));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  color: var(--text-secondary, var(--text-muted)); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.gx-sort-pill:hover { color: var(--text-primary); }
.gx-sort-pill.active { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: var(--body-bg, #000); }
.gx-threads-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 24px; }

/* Reader column */
.gx-reader { padding: 22px 28px 28px; }
.gx-reader-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; color: var(--text-muted);
  height: 100%;
}
.gx-reader-empty svg { margin-bottom: 8px; }
.gx-reader-empty p { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; }
.gx-reader-empty small { display: block; margin-top: 4px; font-size: 12px; }

.gx-reader-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gx-reader-crumbs { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.gx-reader-title { font-size: 18px; line-height: 1.3; margin: 4px 0 0; color: var(--text-primary); font-weight: 700; }
.gx-reader-actions { display: flex; gap: 6px; }

.gx-reader-author { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.gx-reader-author-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.gx-reader-author-time { font-size: 11px; color: var(--text-muted); }
.gx-reader-body {
  font-size: 14px; line-height: 1.6; color: var(--text-primary);
  padding: 14px 16px; border-radius: 12px;
  background: var(--glass-inner-bg, rgba(255,255,255,.03));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
  margin-bottom: 12px;
  white-space: normal;
}

/* Reactions strip */
.gx-rx-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.gx-rx-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: 13px;
  background: var(--glass-inner-bg, rgba(255,255,255,.03));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  color: var(--text-primary);
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.gx-rx-btn:hover { background: var(--bg-elev-2, rgba(255,255,255,.06)); }
.gx-rx-btn.active { background: rgba(37,99,235,.16); border-color: var(--accent, #2563eb); }
.gx-rx-btn:active { transform: scale(.94); }
.gx-rx-emoji { font-size: 14px; line-height: 1; }
.gx-rx-count { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.gx-rx-btn.active .gx-rx-count { color: var(--accent, #2563eb); }

/* Replies */
.gx-replies-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.gx-reply {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--glass-inner-bg, rgba(255,255,255,.02));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.06));
}
.gx-reply-head { display: flex; align-items: center; gap: 8px; }
.gx-reply-author-info { display: flex; gap: 8px; align-items: baseline; }
.gx-reply-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.gx-reply-time { font-size: 11px; color: var(--text-muted); }
.gx-reply-body { font-size: 13px; line-height: 1.6; color: var(--text-primary); }

/* Composer */
.gx-composer {
  position: sticky; bottom: 0;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-elev, rgba(20,20,24,.85));
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  display: flex; flex-direction: column; gap: 8px;
}
.gx-composer-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.gx-composer-help code { font-size: 10px; padding: 1px 4px; }
.gx-composer-tabs { display: flex; gap: 6px; }
.gx-composer-tab {
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: transparent; border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.08));
  color: var(--text-muted); cursor: pointer;
}
.gx-composer-tab.active { background: var(--bg-elev-2, rgba(255,255,255,.06)); color: var(--text-primary); }
.gx-composer-textarea {
  width: 100%; min-height: 90px; padding: 10px 12px;
  border-radius: 10px; resize: vertical;
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  background: var(--glass-inner-bg, rgba(255,255,255,.04));
  color: var(--text-primary); font-size: 13px; line-height: 1.5;
  font-family: inherit;
}
.gx-composer-textarea:focus { outline: none; border-color: var(--accent, #2563eb); }
.gx-composer-preview {
  min-height: 90px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed var(--glass-inner-border-color, rgba(255,255,255,.12));
  font-size: 13px; line-height: 1.5; color: var(--text-primary);
}
.gx-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gx-composer-hint { font-size: 11px; color: var(--text-muted); }

/* Mention dropdown */
.gx-mention-drop {
  position: relative;
  max-height: 180px; overflow: auto;
  border-radius: 8px;
  background: var(--bg-elev, rgba(20,20,24,.96));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  padding: 4px;
}
.gx-mention-item {
  width: 100%; padding: 7px 10px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 6px; color: var(--text-primary);
  font-size: 13px;
}
.gx-mention-item:hover { background: var(--bg-elev-2, rgba(255,255,255,.06)); }
.gx-mention-name { font-weight: 500; }

/* Modal for new thread */
.gx-modal-overlay {
  position: fixed; inset: 0; background: rgba(8,8,12,.55);
  backdrop-filter: blur(4px); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gx-modal {
  width: min(560px, 100%);
  background: var(--bg-elev, rgba(22,22,26,.98));
  border-radius: 16px;
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 30px 60px rgba(0,0,0,.55);
}
.gx-modal-head { display: flex; align-items: center; justify-content: space-between; }
.gx-modal-head h3 { font-size: 16px; margin: 0; color: var(--text-primary); font-weight: 600; }
.gx-modal-close {
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted); font-size: 12px;
}
.gx-modal-close:hover { color: var(--text-primary); }
.gx-modal-label { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.gx-modal-input, .gx-modal-select, .gx-modal-textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  background: var(--glass-inner-bg, rgba(255,255,255,.04));
  border: 1px solid var(--glass-inner-border-color, rgba(255,255,255,.1));
  color: var(--text-primary); font-size: 13px; font-family: inherit;
}
.gx-modal-textarea { resize: vertical; line-height: 1.5; }
.gx-modal-input:focus, .gx-modal-select:focus, .gx-modal-textarea:focus { outline: none; border-color: var(--accent, #2563eb); }
.gx-modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.gx-modal-msg { font-size: 12px; color: var(--text-muted); }


/* ----------------------------------------------------------------
   Scouq Map Pins - branded refinements (final pass)
   ---------------------------------------------------------------- */
.scouq-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-sizing: border-box;
}
.scouq-pin:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 22px rgba(0,0,0,0.55), 0 0 0 5px currentColor;
}
.scouq-pin-scouted {
  border-style: dashed;
  border-color: rgba(255,255,255,0.9);
}
/* Inner dot (filled by default) */
.scouq-pin .scouq-pin-dot {
  position: static;
  inset: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  color: #6b7280;
}
/* Scouted variant: inner dot is an open ring (border only, no fill) */
.scouq-pin-scouted .scouq-pin-dot {
  background: transparent;
  border: 2px solid currentColor;
  box-shadow: none;
}
/* Score-tier colors (current color drives both inner dot + hover glow) */
.scouq-pin-dot-high  { color: #16a34a; }
.scouq-pin-dot-warm  { color: #f59e0b; }
.scouq-pin-dot-mid   { color: #f59e0b; }
.scouq-pin-dot-low   { color: #f97316; }
.scouq-pin-dot-poor  { color: #ef4444; }
.scouq-pin-dot-none  { color: #6b7280; }

/* Cluster bubble (when used as DOM marker - GL clusters drawn via circle layer) */
.scouq-cluster {
  background: #0a0a0a;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 180ms ease;
}
.scouq-cluster-sm { width: 28px; height: 28px; font-size: 12px; }
.scouq-cluster-md { width: 36px; height: 36px; font-size: 13px; }
.scouq-cluster-lg { width: 44px; height: 44px; font-size: 14px; }
.scouq-cluster:hover { transform: scale(1.08); }

/* ----------------------------------------------------------------
   Onboarding wizard hardening (errors, chrome, mobile, polish)
   ---------------------------------------------------------------- */

.onboarding-card { position: relative; }

.onboarding-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  pointer-events: none;
}
.onboarding-chrome > * { pointer-events: auto; }
.onboarding-chrome-spacer { width: 28px; height: 28px; display: inline-block; }

.onboarding-back-btn,
.onboarding-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 120ms, color 120ms;
}
.onboarding-back-btn:hover,
.onboarding-close-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.onboarding-error {
  color: #e85f5f;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}

.onboarding-markets-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0 2px;
  font-style: italic;
}

.onboarding-role-other-wrap { margin-top: 8px; }
.onboarding-role-other-input {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  font-size: 14px;
  border-radius: var(--r-input);
  background: var(--input-bg);
  border: var(--input-border);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border 150ms, box-shadow 150ms;
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.18);
}
.onboarding-role-other-input:focus { border-color: var(--accent); }

.onboarding-skip-link {
  display: block;
  margin: 14px 0 0 auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.onboarding-skip-link:hover { color: var(--text-primary); }

.onboarding-cta:disabled,
.onboarding-cta.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.onboarding-cta:hover:not(:disabled):not(.disabled) {
  background: #16a34a;
  opacity: 1;
}

/* Completed-step dot: small checkmark inside */
.onboarding-dot.completed {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--body-bg);
}
.onboarding-dot.completed svg { width: 8px; height: 8px; display: block; }

/* Active dot pulse */
.onboarding-dot.active {
  animation: onboardingDotPulse 1.6s ease-in-out infinite;
}
@keyframes onboardingDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* Confirm dialog */
.onboarding-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 99500;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onboardingFadeIn 180ms ease forwards;
}
.onboarding-confirm-card {
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  padding: 22px 22px 18px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.onboarding-confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.onboarding-confirm-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.onboarding-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.onboarding-confirm-btn-ghost,
.onboarding-confirm-btn-primary {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--r-button);
  cursor: pointer;
  border: var(--glass-inner-border);
}
.onboarding-confirm-btn-ghost {
  background: transparent;
  color: var(--text-primary);
}
.onboarding-confirm-btn-ghost:hover { background: var(--hover-bg); }
.onboarding-confirm-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--body-bg);
  font-weight: 600;
}
.onboarding-confirm-btn-primary:hover { filter: brightness(0.88); }

/* Mobile: full-screen modal under 640px */
@media (max-width: 640px) {
  .onboarding-card {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    border-radius: 0;
    padding: 56px 20px 28px;
    box-shadow: none;
  }
  .onboarding-overlay { padding: 0; }
  .onboarding-title { font-size: 24px; }
  .onboarding-sub { font-size: 14px; }
  .onboarding-input,
  .onboarding-select,
  .onboarding-role-other-input {
    min-height: 48px;
    font-size: 16px; /* prevents iOS zoom */
    padding: 14px 16px;
  }
  .onboarding-cta {
    min-height: 48px;
    font-size: 16px;
    padding: 14px 20px;
  }
  .onboarding-strategy-grid {
    grid-template-columns: 1fr 1fr;
  }
  .onboarding-risk-btn { min-height: 44px; font-size: 12px; }
  .onboarding-chrome { top: 14px; left: 14px; right: 14px; }
}


/* =========================================================
   Mobile Responsive Deep-Pass (Wave: phone + tablet)
   Append-only block; refines earlier rules surgically.
   Targets: 390x844 (iPhone 13) and 768x1024 (iPad).
   ========================================================= */

/* ---- 1. Safe-area inset support (iOS notch / home indicator) ---- */
@supports (padding: env(safe-area-inset-bottom)) {
  .pwa-install-sheet {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ---- 2. Phone + tablet: 44px tap targets on rail + chrome ---- */
@media (max-width: 768px) {
  .icon-rail { width: 56px; }
  .rail-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }
  .investor-console { left: 68px; }

  /* Map mode toggle + Fit view: position top-right; full-height tap targets */
  .map-mode-toggle {
    top: 8px;
    right: 8px;
  }
  .map-mode-btn { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  #fitPinsBtn,
  .pin-btn {
    min-height: 36px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .pin-btn-label { white-space: nowrap; }

  /* PWA install sheet honors safe-area */
  .pwa-install-sheet {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .pwa-install-close {
    width: 44px;
    height: 44px;
    top: 4px;
    right: 4px;
  }
}

/* ---- 3. Phone: collapse "expanded" multi-pane modes to sidebar-only ----
   Two/three-pane "expanded" layouts (deals/saved/network/groups/insights)
   don't fit at 390px. Hide expanded surfaces; sidebar overlays the map. */
@media (max-width: 768px) {
  body.sidebar-expanded .deals-expanded,
  body.sidebar-expanded #dealsExpanded,
  body.sidebar-expanded .saved-expanded,
  body.sidebar-expanded #savedExpanded,
  body.sidebar-expanded .network-expanded,
  body.sidebar-expanded #networkExpanded,
  body.sidebar-expanded .insights-expanded,
  body.sidebar-expanded .groups-expanded,
  body.sidebar-expanded .forum-workspace,
  body.sidebar-expanded .groups-workspace {
    display: none !important;
  }
  body.sidebar-expanded .investor-console {
    display: flex !important;
    width: calc(100vw - 76px) !important;
    max-width: 420px;
  }
}

/* ---- 4. Tablet (641-1024): collapse multi-pane workspaces ---- */
@media (min-width: 641px) and (max-width: 1024px) {
  .forum-workspace,
  .groups-workspace {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  .forum-workspace > *,
  .groups-workspace > * {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Phone: force every multi-pane workspace to single column */
@media (max-width: 640px) {
  .forum-workspace,
  .groups-workspace,
  .deals-expanded,
  .saved-expanded,
  .network-expanded {
    grid-template-columns: 1fr !important;
  }
  .deals-expanded-mapcol { display: none !important; }
  .saved-expanded-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- 5. Modals: never overflow viewport ---- */
@media (max-width: 768px) {
  .upgrade-modal-overlay {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .upgrade-modal {
    width: 100%;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 20px 16px !important;
    box-sizing: border-box;
  }
  .upgrade-modal-close { width: 44px; height: 44px; }

  .cmd-k-overlay {
    padding: 12px;
    align-items: flex-start;
  }
  .cmd-k-modal {
    width: 100%;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .cmd-k-results {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cmd-k-input-row input { min-height: 44px; }

  .onboarding-overlay {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .onboarding-card {
    width: 100%;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    box-sizing: border-box;
  }
}

/* ---- 6. Phone: 44px tap targets across common controls ---- */
@media (max-width: 640px) {
  .upgrade-plan-cta,
  .upgrade-modal-cta,
  .billing-toggle-btn,
  .auth-modal-google,
  .auth-modal-submit,
  .auth-modal-close,
  .upgrade-modal-close,
  .settings-nav-rail button,
  .settings-nav-rail a,
  .tab-link,
  .tab-pill {
    min-height: 44px;
  }
  .modal .icon-btn,
  .modal-close,
  .glass-modal-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---- 7. Phone: charts and KPI tiles reflow ---- */
@media (max-width: 640px) {
  .insights-kpis,
  .kpi-row,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .insights-charts,
  .charts-grid,
  .insights-grid {
    grid-template-columns: 1fr !important;
  }
  .insights-chart,
  .chart-card,
  .chart-wrap,
  canvas.insights-canvas {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* ---- 8. Phone: find-pros cards stack ---- */
@media (max-width: 640px) {
  .find-pros-grid,
  .pros-grid,
  .network-pros-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---- 9. Sidebar pane width on phone in collapsed (non-expanded) mode ---- */
@media (max-width: 640px) {
  body:not(.sidebar-collapsed) .investor-console {
    width: calc(100vw - 76px) !important;
    max-width: 360px;
    right: auto;
  }
}

/* ---- 10. Settings rail subpage flow on phone ---- */
@media (max-width: 640px) {
  .settings-nav-rail {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  .settings-subpage,
  .settings-pane {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- 11. Sub-tabs scroll horizontally on phone ---- */
@media (max-width: 640px) {
  .network-subtabs,
  .forum-subtabs,
  .groups-subtabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap;
  }
  .network-subtabs > *,
  .forum-subtabs > *,
  .groups-subtabs > * {
    flex: 0 0 auto;
  }
}
/* ---- 12. Tap-target enforcement: chrome buttons across phone + tablet ---- */
@media (max-width: 1024px) {
  #sidebarExpand,
  #sidebarClose,
  .expand-btn,
  .close-btn,
  #searchTrigger,
  .search-trigger,
  #mobileMenuBtn,
  .mobile-menu-btn,
  .filters-toggle-btn,
  .map-mode-btn,
  #fitPinsBtn,
  .pin-btn,
  .pwa-install-close,
  .upgrade-cta-btn,
  .billing-toggle-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .pin-btn { padding: 8px 12px; }
  .auth-modal-close { width: 44px !important; height: 44px !important; }
}

/* Landing search button (the right-side arrow circle): 44x44 */
@media (max-width: 1024px) {
  .landing-search-btn,
  #heroSearchBtn { min-width: 44px !important; min-height: 44px !important; }
  .landing-hint { min-height: 32px; padding: 6px 10px; }
}
/* End mobile responsive deep-pass */


/* Network expanded: filter row + grid padding fixes (post-Mobile-agent regression) */
.network-expanded .nx-detail {
  padding-right: 24px;
  min-width: 0;
}
.network-expanded .nx-filter-row {
  width: 100%;
  min-width: 0;
}
.network-expanded .nx-filter-row .nx-chip-row {
  flex-wrap: wrap;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}
.network-expanded .nx-contacts-grid {
  padding-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.network-expanded .nx-detail-head {
  padding-right: 12px;
}
/* hide any orphan empty buttons in the detail head */
.network-expanded .nx-detail-head button:empty {
  display: none;
}


/* === Expanded-mode: SAME chrome as sidebar mode, just more space === */
/* Keep map HUD reachable, keep same glass surface, just more breathing room */
body.sidebar-expanded .investor-console {
  /* inherits existing glass background: no overrides */
}

/* Universal right-padding inside every expanded pane so content doesn't escape */
body.sidebar-expanded .investor-console {
  padding-right: 0;
}
body.sidebar-expanded .sidebar-content,
body.sidebar-expanded .tab-panel.active {
  padding-right: 24px;
  box-sizing: border-box;
  min-width: 0;
}

/* Tame filter rows so chips/inputs wrap rather than overflow */
body.sidebar-expanded .feed-toolbar,
body.sidebar-expanded .nx-filter-row,
body.sidebar-expanded .ax-filter-row,
body.sidebar-expanded .sx-filter-row,
body.sidebar-expanded .dx-filter-rail,
body.sidebar-expanded .filter-bar {
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 0;
}

/* Chip rows scroll horizontally if forced, but try to wrap first */
body.sidebar-expanded .nx-chip-row,
body.sidebar-expanded .ax-filter-chips,
body.sidebar-expanded .network-sub-nav {
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: visible;
}

/* Card grids never exceed viewport width */
body.sidebar-expanded .nx-contacts-grid,
body.sidebar-expanded .nx-pros-grid,
body.sidebar-expanded .dx-grid,
body.sidebar-expanded .sx-grid {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* The 'no deals match' / empty state panel shouldn't be off in a weird spot */
body.sidebar-expanded .feed-toolbar-right,
body.sidebar-expanded .deal-count-badge {
  flex-shrink: 0;
}

/* Unified expanded-mode content width cap (--expanded-max-width = 1440px).
   Each scrollable content column centres at the cap when viewport exceeds it. */
body.sidebar-expanded .network-expanded .nx-detail,
body.sidebar-expanded .saved-expanded-main,
body.sidebar-expanded .deals-expanded-gridcol,
body.sidebar-expanded .settings-expanded-detail,
body.sidebar-expanded .ix-expanded,
body.sidebar-expanded .profile-panel {
  max-width: var(--expanded-max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* ----- Web Push opt-in card (Settings -> Notifications) ----- */
.push-optin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 12px;
  background: var(--surface-2, rgba(255,255,255,0.03));
}
.push-optin-text { flex: 1; min-width: 0; }
.push-optin-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary, #fff);
}
.push-optin-sub {
  font-size: 12px;
  color: var(--text-secondary, rgba(255,255,255,0.62));
  line-height: 1.4;
}
.push-optin-card[data-state="enabled"] .push-optin-title::after {
  content: " . On";
  color: var(--accent, #4ade80);
  font-weight: 500;
}
.push-optin-card[data-state="denied"] .push-optin-title::after {
  content: " . Blocked";
  color: var(--danger, #f87171);
  font-weight: 500;
}
.push-optin-card[data-state="unsupported"] #pushOptinBtn { display: none; }
@media (max-width: 560px) {
  .push-optin-card { flex-direction: column; align-items: flex-start; }
  .push-optin-card #pushOptinBtn { width: 100%; }
}

/* ============================================================
   Accessibility utilities (WCAG 2.1 AA)
   Appended by a11y-audit agent. Safe to extend, do not remove.
   ============================================================ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100000;
  padding: 10px 14px;
  background: #0b0b0d;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  font: 600 13px/1 'Inter', system-ui, sans-serif;
  text-decoration: none;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}
/* Strong visible focus ring across interactive elements (WCAG 2.4.7). */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25);
}


/* Downloads cards stack in narrow sidebar (overflowing 3-col grid clipping the Linux card) */
.settings-downloads-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
body.sidebar-expanded .settings-downloads-grid {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 720px) {
  body.sidebar-expanded .settings-downloads-grid {
    grid-template-columns: 1fr;
  }
}
.settings-download-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ---- Default view per tab (Appearance subpage) ---- */
.default-view-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.default-view-head h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.default-view-head p {
  margin: 0;
  font-size: 12px;
  opacity: 0.65;
  line-height: 1.4;
}
.default-view-global-row {
  margin-top: 4px;
}
.default-view-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.default-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.default-view-select {
  min-width: 160px;
}

/* ---------------------------------------------------------------------------
 * Property type + stage badges (Profile -> My Properties)
 * Type-aware metrics rendered by renderProfilePanel().
 * ------------------------------------------------------------------------- */
.prop-type-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.30);
  vertical-align: middle;
}
.prop-type-pill-flip       { color: #f97316; background: rgba(249, 115, 22, 0.10); border-color: rgba(249, 115, 22, 0.35); }
.prop-type-pill-brrrr      { color: #a855f7; background: rgba(168, 85, 247, 0.10); border-color: rgba(168, 85, 247, 0.35); }
.prop-type-pill-rental     { color: #10b981; background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.35); }
.prop-type-pill-str        { color: #06b6d4; background: rgba(6, 182, 212, 0.10);  border-color: rgba(6, 182, 212, 0.35); }
.prop-type-pill-commercial { color: #eab308; background: rgba(234, 179, 8, 0.10);  border-color: rgba(234, 179, 8, 0.35); }
.prop-type-pill-land       { color: #84cc16; background: rgba(132, 204, 22, 0.10); border-color: rgba(132, 204, 22, 0.35); }
.prop-type-pill-unknown    { color: #94a3b8; background: rgba(148, 163, 184, 0.10); border-color: rgba(148, 163, 184, 0.30); }

.prop-stage-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.10);
  vertical-align: middle;
}
.prop-stage-badge.prop-stage-mid_rehab,
.prop-stage-badge.prop-stage-pre_rehab,
.prop-stage-badge.prop-stage-rehab     { color: #fbbf24; background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.30); }
.prop-stage-badge.prop-stage-listed    { color: #60a5fa; background: rgba(96, 165, 250, 0.10); border-color: rgba(96, 165, 250, 0.30); }
.prop-stage-badge.prop-stage-sold      { color: #94a3b8; background: rgba(148, 163, 184, 0.10); border-color: rgba(148, 163, 184, 0.30); }
.prop-stage-badge.prop-stage-stabilized,
.prop-stage-badge.prop-stage-refinanced,
.prop-stage-badge.prop-stage-held      { color: #10b981; background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.30); }
.prop-stage-badge.prop-stage-vacant    { color: #f87171; background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.30); }

/* Subtle accent stripe on the left edge of property cards, keyed by type. */
.prof-prop-card.prop-type-flip       { box-shadow: inset 3px 0 0 rgba(249, 115, 22, 0.55); }
.prof-prop-card.prop-type-brrrr      { box-shadow: inset 3px 0 0 rgba(168, 85, 247, 0.55); }
.prof-prop-card.prop-type-rental     { box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.55); }
.prof-prop-card.prop-type-str        { box-shadow: inset 3px 0 0 rgba(6, 182, 212, 0.55); }
.prof-prop-card.prop-type-commercial { box-shadow: inset 3px 0 0 rgba(234, 179, 8, 0.55); }
.prof-prop-card.prop-type-land       { box-shadow: inset 3px 0 0 rgba(132, 204, 22, 0.55); }

/* Slightly emphasize headline strategy-specific metrics. */
.prof-prop-meta-item.prop-metric-cap-rate .prof-prop-meta-val,
.prof-prop-meta-item.prop-metric-est-profit .prof-prop-meta-val,
.prof-prop-meta-item.prop-metric-cash-left-refi- .prof-prop-meta-val,
.prof-prop-meta-item.prop-metric-cash-left-refi .prof-prop-meta-val,
.prof-prop-meta-item.prop-metric-coc-roi .prof-prop-meta-val {
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Pro-tier features: API keys, Team seats, Branding, PDF.
   ========================================================= */

/* Shared upgrade gate inside a settings subpage. */
.pro-feature-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.pro-feature-gate-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.pro-feature-gate-title { margin: 0; font-size: 16px; font-weight: 600; }
.pro-feature-gate-body  { margin: 0; font-size: 13px; opacity: 0.78; line-height: 1.5; max-width: 60ch; }
.pro-feature-gate-cta {
  margin-top: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: #10b981;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pro-feature-gate-cta:hover { background: #0ea372; }

/* Shared modal (used by API key create / reveal, Team invite). */
.pro-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}
.pro-modal-box {
  width: min(440px, 92vw);
  padding: 22px 22px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(20, 22, 26, 0.92);
}
.pro-modal-box-wide { width: min(560px, 94vw); }
.pro-modal-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.pro-modal-body  { margin: 0 0 14px; font-size: 13px; opacity: 0.78; line-height: 1.5; }
.pro-modal-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 500; opacity: 0.8;
  margin-bottom: 14px;
}
.pro-modal-input {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 13px;
}
.pro-modal-input:focus { outline: none; border-color: var(--accent, #3b82f6); }
.pro-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* API keys */
.api-keys-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.api-keys-lede { margin: 0; font-size: 13px; opacity: 0.78; line-height: 1.55; max-width: 56ch; }
.api-keys-lede code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}
.api-keys-list { display: flex; flex-direction: column; gap: 8px; }
.api-keys-empty {
  padding: 18px; text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  font-size: 13px; opacity: 0.65;
}
.api-key-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.api-key-row-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.api-key-row-meta {
  font-size: 12px; opacity: 0.66;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.api-key-row-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}
.api-key-row-revoke {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.30);
  background: transparent;
  color: #f87171;
  font-size: 12px;
  cursor: pointer;
}
.api-key-row-revoke:hover { background: rgba(248, 113, 113, 0.10); }
.api-key-reveal {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(16, 185, 129, 0.30);
  background: rgba(16, 185, 129, 0.06);
  border-radius: 10px;
}
.api-key-reveal code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  color: #10b981;
}

/* Team seats */
.team-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.team-plan-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  margin-bottom: 8px;
}
.team-lede { margin: 0; font-size: 13px; opacity: 0.78; line-height: 1.55; max-width: 56ch; }
.team-section-h { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.6; font-weight: 600; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-empty {
  padding: 14px; text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  font-size: 13px; opacity: 0.65;
}
.team-member-row, .team-pending-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.team-member-avatar {
  width: 30px; height: 30px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(16,185,129,0.35), rgba(6,182,212,0.35));
  flex-shrink: 0;
}
.team-member-main { flex: 1; min-width: 0; }
.team-member-name { font-size: 14px; font-weight: 600; }
.team-member-owner {
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; margin-left: 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  vertical-align: middle;
}
.team-member-meta { font-size: 12px; opacity: 0.62; margin-top: 2px; }
.team-member-remove {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}
.team-member-remove:hover { background: rgba(255, 255, 255, 0.06); }

/* Branding form */
.branding-form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.branding-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 500; opacity: 0.8;
}
.branding-color {
  width: 60px; height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  cursor: pointer;
}
.branding-hint { margin: 0; font-size: 12px; opacity: 0.6; }

/* Deal-detail Export PDF button uses existing .deal-detail-action-btn styles. */
.pdf-export-btn { gap: 6px; }

/* =========================================================
   PDF Export: print stylesheet for white-label reports.
   ========================================================= */
.pdf-export-root {
  position: fixed;
  inset: 0;
  background: #fff;
  color: #111;
  z-index: -1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
body.pdf-export-printing .pdf-export-root {
  opacity: 1;
  z-index: 99999;
  pointer-events: auto;
  overflow: auto;
}
@media print {
  body.pdf-export-printing > *:not(.pdf-export-root) { display: none !important; }
  .pdf-export-root {
    position: static !important;
    opacity: 1 !important;
    z-index: auto !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111 !important;
  }
  @page { margin: 0.6in; size: letter; }
}
.pdf-export-page {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.6in 0.6in 0.4in;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: #111;
  background: #fff;
}
.pdf-export-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px solid #10b981;
}
.pdf-export-wordmark {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pdf-export-tagline {
  font-size: 11px;
  color: #555;
  margin-top: 3px;
}
.pdf-export-meta {
  font-size: 10px;
  color: #666;
  text-align: right;
}
.pdf-export-meta div:last-child { font-weight: 600; color: #111; }
.pdf-export-section { margin-bottom: 22px; }
.pdf-export-h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.pdf-export-sub {
  font-size: 13px;
  color: #555;
  margin: 0;
}
.pdf-export-h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #444;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}
.pdf-export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
}
.pdf-export-stat {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafafa;
}
.pdf-export-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 4px;
}
.pdf-export-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}
.pdf-export-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pdf-export-table td {
  padding: 7px 4px;
  border-bottom: 1px solid #eef0f3;
}
.pdf-export-table td:first-child { color: #555; width: 55%; }
.pdf-export-table td:last-child  { font-weight: 600; text-align: right; color: #111; }
.pdf-export-body { margin: 0; font-size: 12px; line-height: 1.6; color: #222; }
.pdf-export-footer {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 10px;
  color: #777;
}
.pdf-export-disclaimer { margin-top: 4px; font-style: italic; }

/* ----------------------------------------------------------------
   Profile avatar (single canonical render + click-to-upload)
   ---------------------------------------------------------------- */

/* Hide any legacy avatar block injected by other modules; the Profile
   pane only ever renders ONE avatar via .prof-avatar-wrap. */
#tabProfile .auth-profile-section { display: none !important; }

.prof-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 4px;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.prof-avatar-wrap:focus-visible {
  box-shadow: 0 0 0 2px var(--accent, #1a1a1a);
}

.prof-avatar-wrap .prof-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0;
  overflow: hidden;
  object-fit: cover;
}

/* Brand-neutral initials chip (replaces legacy green gradient). */
.prof-avatar-initials {
  background: #1a1a1a;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.06);
}

[data-theme="light"] .prof-avatar-initials {
  background: #1a1a1a;
  color: #ffffff;
}

.prof-avatar-img {
  background: var(--glass-inner-bg);
  display: block;
}

.prof-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
  text-align: center;
  padding: 0 6px;
}

.prof-avatar-wrap:hover .prof-avatar-overlay,
.prof-avatar-wrap:focus-visible .prof-avatar-overlay,
.prof-avatar-wrap.is-uploading .prof-avatar-overlay {
  opacity: 1;
}

.prof-avatar-wrap.is-uploading {
  cursor: progress;
}

.prof-photo-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.prof-photo-btn {
  appearance: none;
  border: 1px solid var(--glass-inner-border-color, rgba(0,0,0,0.12));
  background: var(--glass-inner-bg, rgba(0,0,0,0.04));
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, opacity 140ms ease;
}

.prof-photo-btn:hover { opacity: 0.85; }
.prof-photo-btn:disabled { opacity: 0.5; cursor: default; }

.prof-photo-btn-danger {
  color: #c62828;
  border-color: rgba(198,40,40,0.25);
  background: rgba(198,40,40,0.06);
}

[data-theme="dark"] .prof-photo-btn-danger {
  color: #ff8a80;
  border-color: rgba(255,138,128,0.25);
  background: rgba(255,138,128,0.08);
}

/* ---- Public profile section (handle + headline) ---- */
.prof-handle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.prof-handle-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.prof-handle-status[data-avail="true"] { color: var(--score-hot, #22c55e); }
.prof-handle-status[data-avail="false"] { color: #c62828; }


/* ================================================================
   Insights v2 - analysis cockpit (sidebar + expanded share chrome)
   ================================================================ */
.insights-v2-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}
.insights-v2-header-sub { display: flex; align-items: center; }
.insights-v2-panel { padding: 0; }

/* ---- Sidebar (compact) ---- */
.insights-v2-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 22px;
}
.insights-v2-side-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.insights-v2-kpi-tile {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.insights-v2-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.insights-v2-kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.insights-v2-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.insights-v2-side-eyebrow {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}
.insights-v2-side-tools {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.insights-v2-side-tool-btn {
  width: 100%;
  text-align: left;
  background: var(--glass-inner-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.07));
  color: var(--text);
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s, transform 0.15s;
  font: inherit;
}
.insights-v2-side-tool-btn:hover {
  border-color: rgba(99,102,241,0.45);
  transform: translateY(-1px);
}
.insights-v2-side-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.insights-v2-side-tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.insights-v2-side-open {
  margin-top: 6px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.insights-v2-side-open:hover { filter: brightness(1.08); }

/* ---- Expanded shell: rail + stage ---- */
.insights-v2-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  padding: 14px 14px 28px;
  min-height: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.insights-v2-rail {
  position: sticky;
  top: 8px;
  align-self: start;
  background: var(--glass-inner-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.07));
  border-radius: 14px;
  padding: 12px 8px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.insights-v2-rail-title {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}
.insights-v2-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.insights-v2-rail-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.insights-v2-rail-btn:hover { background: var(--glass-inner-bg-hover, rgba(255,255,255,0.06)); }
.insights-v2-rail-btn.is-active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(79,70,229,0.10));
  border-color: rgba(99,102,241,0.45);
}
.insights-v2-rail-num {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}
.insights-v2-rail-btn.is-active .insights-v2-rail-num {
  background: #6366f1;
  color: #fff;
}
.insights-v2-rail-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.insights-v2-rail-label {
  font-size: 13px;
  font-weight: 600;
}
.insights-v2-rail-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ---- Stage ---- */
.insights-v2-stage {
  background: var(--glass-inner-bg, rgba(255,255,255,0.025));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.07));
  border-radius: 14px;
  padding: 18px 20px 22px;
  min-height: 400px;
  min-width: 0;
  overflow-x: hidden;
}
.insights-v2-stage-head { margin-bottom: 14px; }
.insights-v2-stage-head h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.insights-v2-stage-head p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ---- Generic fields / inputs / actions ---- */
.insights-v2-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.insights-v2-field-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.insights-v2-field-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 7px 10px;
}
.insights-v2-field-input-wrap:focus-within {
  border-color: rgba(99,102,241,0.55);
}
.insights-v2-field-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.insights-v2-field-input::-webkit-outer-spin-button,
.insights-v2-field-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.insights-v2-field-suffix {
  font-size: 12px;
  color: var(--text-muted);
}
.insights-v2-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.insights-v2-slider strong { color: var(--text); font-weight: 600; }
.insights-v2-slider input[type=range] { width: 100%; accent-color: #6366f1; }
.insights-v2-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.insights-v2-actions-hint { font-size: 12px; color: var(--text-muted); }
.insights-v2-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.insights-v2-btn-primary:hover { filter: brightness(1.08); }
.insights-v2-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.insights-v2-btn-ghost:hover { border-color: rgba(99,102,241,0.55); }

.insights-v2-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 14px;
  width: fit-content;
  flex-wrap: wrap;
}
.insights-v2-tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.insights-v2-tab.is-active {
  background: var(--text);
  color: var(--bg);
}

/* ---- Calc grid ---- */
.insights-v2-calc-grid {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: 16px;
  min-width: 0;
}
.insights-v2-calc-inputs { min-width: 0; }
.insights-v2-calc-results { min-width: 0; }
.insights-v2-results-head {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.insights-v2-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.insights-v2-result {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 10px 12px;
}
.insights-v2-result-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.insights-v2-result-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.insights-v2-res-good .insights-v2-result-value { color: var(--text); }
.insights-v2-res-bad  .insights-v2-result-value { color: #ef4444; }
.insights-v2-result-value.ok-good { color: var(--text); }
.insights-v2-result-value.ok-bad  { color: #ef4444; }

/* ---- Playground ---- */
.insights-v2-pg-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 20px;
}
.insights-v2-pg-output { min-width: 0; }
.insights-v2-verdict {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(79,70,229,0.08));
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.45;
}
.insights-v2-bars-title {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.insights-v2-bars { display: flex; flex-direction: column; gap: 7px; }
.insights-v2-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 10px;
}
.insights-v2-bar-label { font-size: 13px; color: var(--text); }
.insights-v2-bar-track {
  background: var(--glass-inner-bg, rgba(255,255,255,0.05));
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
}
.insights-v2-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s cubic-bezier(.22,.61,.36,1);
}
.insights-v2-bar-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 70px;
  text-align: right;
}
.insights-v2-bar-value.is-neg { color: #ef4444; }

/* ---- Market intel ---- */
.insights-v2-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.insights-v2-market-card {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 14px;
}
.insights-v2-market-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.insights-v2-market-head h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.insights-v2-market-tag {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245,158,11,0.18);
  color: #f59e0b;
}
.insights-v2-market-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.insights-v2-market-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.insights-v2-market-stats span { color: var(--text-muted); }
.insights-v2-market-stats strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.insights-v2-market-stats strong.good { color: var(--text); }
.insights-v2-market-stats strong.bad { color: #ef4444; }
.insights-v2-market-spark svg { width: 100%; height: auto; display: block; }
.insights-v2-market-compare {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 14px;
}
.insights-v2-market-compare h5 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.insights-v2-compare-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.insights-v2-select, .insights-v2-input {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.10));
  color: var(--text);
  padding: 7px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}
.insights-v2-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.insights-v2-compare-col {
  background: rgba(255,255,255,0.02);
  padding: 10px;
  border-radius: 10px;
}
.insights-v2-compare-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.insights-v2-compare-kv {
  display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px;
}
.insights-v2-compare-kv span { color: var(--text-muted); }
.insights-v2-compare-kv strong { color: var(--text); font-weight: 600; }

/* ---- Live data: buzz + distress sections ---- */
.insights-v2-section { margin: 16px 0 0; }
.insights-v2-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin: 0 0 10px; }
.insights-v2-buzz-list { display: flex; flex-direction: column; gap: 6px; }
.insights-v2-buzz-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.insights-v2-buzz-name { min-width: 120px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insights-v2-buzz-bar-wrap { flex: 1; height: 4px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.insights-v2-buzz-bar { height: 100%; border-radius: 4px; }
.insights-v2-buzz-val { min-width: 36px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.insights-v2-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.insights-v2-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0 6px 8px 0; }
.insights-v2-table td { padding: 5px 6px 5px 0; border-top: 1px solid rgba(255,255,255,0.05); color: var(--text); }

/* ---- Sensitivity ---- */
.insights-v2-sens-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 20px;
}
.insights-v2-sens-output { min-width: 0; }
.insights-v2-sens-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.insights-v2-sens-card {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 12px;
}

/* ---- Distro (histogram) ---- */
.insights-v2-distro-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.insights-v2-distro-stats > div {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.insights-v2-distro-stats span {
  font-size: 11px;
  color: var(--text-muted);
}
.insights-v2-distro-stats strong {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.insights-v2-histo-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.insights-v2-histo-axis-label {
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 2px;
}
.insights-v2-histo {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  height: 220px;
  align-items: end;
  padding: 12px 12px 8px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  border-bottom: 2px solid rgba(255,255,255,0.10);
}
.insights-v2-histo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.insights-v2-histo-bar {
  width: 100%;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
  position: relative;
}
.insights-v2-histo-bar span {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
}
.insights-v2-histo-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- AI Brief ---- */
.insights-v2-brief-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.insights-v2-brief-row .insights-v2-select { min-width: 160px; }
.insights-v2-brief-row .insights-v2-input { flex: 1; min-width: 160px; }
.insights-v2-brief-out { display: flex; flex-direction: column; gap: 10px; }
.insights-v2-brief-sec {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 12px 14px;
}
.insights-v2-brief-sec h5 {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6366f1;
  margin: 0 0 6px;
}
.insights-v2-brief-sec p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

/* ---- Empty state ---- */
.insights-v2-empty {
  background: var(--glass-inner-bg, rgba(255,255,255,0.03));
  border: 1px dashed var(--glass-border, rgba(255,255,255,0.14));
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.insights-v2-empty-big { padding: 40px 24px; }
.insights-v2-empty-title { font-size: 16px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.insights-v2-empty-sub { font-size: 13px; margin-bottom: 12px; }
.insights-v2-empty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.insights-v2-chip {
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.insights-v2-chip:hover { border-color: rgba(99,102,241,0.55); }

/* ---- Scenario history table ---- */
.ix2-scenario-history {
  margin-top: 24px;
  border-top: 1px solid var(--glass-border, rgba(255,255,255,0.07));
  padding-top: 16px;
}
.ix2-scenario-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ix2-scenario-history-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.ix2-scenario-history-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.ix2-scenario-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ix2-scenario-table thead th {
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 8px 8px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.07));
}
.ix2-scenario-table tbody tr {
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.04));
}
.ix2-scenario-table tbody tr:last-child { border-bottom: 0; }
.ix2-scenario-table tbody td {
  padding: 7px 8px;
  color: var(--text);
  vertical-align: middle;
}
.ix2-scenario-kind {
  display: inline-block;
  background: var(--glass-inner-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.09));
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.ix2-scenario-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
}
.ix2-scenario-date { color: var(--text-muted); }
.ix2-scenario-del {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
}
.ix2-scenario-del:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .insights-v2-shell { grid-template-columns: 1fr; }
  .insights-v2-rail { position: static; max-height: none; }
  .insights-v2-calc-grid,
  .insights-v2-pg-grid,
  .insights-v2-sens-grid { grid-template-columns: 1fr; }
  .insights-v2-bar-row { grid-template-columns: 100px 1fr auto; }
}

/* =================================================================
   Q-UX-1: Map-first viewport search (PropStream pattern)
   ================================================================= */
.map-search-pill {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translate(-50%, 0);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--glass-bg, rgba(20, 20, 22, 0.6));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 160ms ease, transform 200ms ease;
  z-index: 60;
  animation: pill-fade-in 400ms ease both;
}
@keyframes pill-fade-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.map-search-pill.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.map-search-pill:hover { border-color: rgba(99, 102, 241, 0.55); }
.map-search-pill svg { opacity: 0.85; }

.map-lock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.map-lock-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.map-lock-track {
  position: relative;
  width: 26px;
  height: 14px;
  background: var(--glass-inner-bg, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  transition: background 140ms ease, border-color 140ms ease;
  flex-shrink: 0;
}
.map-lock-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  transition: transform 140ms ease, background 140ms ease;
}
.map-lock-checkbox:checked + .map-lock-track {
  background: rgba(99, 102, 241, 0.55);
  border-color: rgba(99, 102, 241, 0.7);
}
.map-lock-checkbox:checked + .map-lock-track .map-lock-thumb {
  transform: translateX(12px);
  background: #fff;
}
.map-lock-text { color: var(--text); }
.map-lock-hint {
  margin-left: auto;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

/* =================================================================
   Q-UX-2: cmd-K palette shortcut hints (Linear pattern)
   ================================================================= */
.cmd-k-shortcut {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  opacity: 0.55;
}
.cmd-k-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--glass-inner-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 10px;
  line-height: 1;
  color: inherit;
  font-weight: 500;
}
.cmd-k-row-hint {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 6px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 120ms ease;
}
.cmd-k-row-hint .cmd-k-kbd {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.cmd-k-hint-sep { opacity: 0.45; margin: 0 4px; }
.cmd-k-result-item:hover .cmd-k-row-hint,
.cmd-k-result-item.highlighted .cmd-k-row-hint {
  display: inline-flex;
  opacity: 0.85;
}
.cmd-k-cmd-item:hover .cmd-k-shortcut,
.cmd-k-cmd-item.highlighted .cmd-k-shortcut { opacity: 0.9; }

/* =================================================================
   Q-UX-3: Hero tile (Stessa + Robinhood pattern)
   ================================================================= */
.hero-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.hero-tile-grid--insights { grid-template-columns: 1fr; }
.hero-tile-grid--profile  { grid-template-columns: 1fr; margin-bottom: 10px; }
.hero-tile {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-inner-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  overflow: hidden;
}
.hero-tile-label {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.hero-tile-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.hero-tile-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}
.hero-sparkline {
  flex-shrink: 0;
  opacity: 0.9;
}
.hero-tile-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.hero-tile-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}
.hero-tile-pill {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 120ms ease, color 120ms ease;
}
.hero-tile-pill:hover { color: var(--text); }
.hero-tile-pill.is-active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--text);
}
.hero-tile-delta {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.hero-tile-delta--pos { color: #34d399; }
.hero-tile-delta--neg { color: #f87171; }
.hero-tile-delta-pct {
  opacity: 0.6;
  margin-left: 2px;
  font-size: 10px;
}
.hero-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---- RE-only Portfolio Overview (replaces Net Worth Tracker) ---- */
.re-portfolio-card { }
.re-portfolio-hero {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}
.re-portfolio-hero-lbl {
  font-size: 11px;
  color: var(--text-label);
  margin-top: 4px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.re-portfolio-grid {
  margin-top: 4px;
  margin-bottom: 12px;
}
.re-portfolio-cell { }
.re-portfolio-cell-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}
.re-portfolio-footer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
.re-portfolio-empty {
  padding: 18px 4px 6px;
  text-align: center;
}
.re-portfolio-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.re-portfolio-empty-btn {
  display: inline-block;
}

/* Rail Profile avatar - shows user's photo in the icon rail */
.rail-icon-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
#railProfileBtn.has-avatar {
  padding: 0;
}

/* =================================================================
   UNIFIED EMPTY STATE SYSTEM (es2)
   Single source of truth for blank panes. Same visual language for
   sidebar + fullscreen. Used by Deals, Saved, Activity, Contacts,
   Messages, Find Pros, Groups, Threads, Reports, Reports, API Keys,
   Team, Notifications.
   ================================================================= */
.es2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  min-height: 240px;
  box-sizing: border-box;
}
.es2-compact {
  min-height: 160px;
  padding: 28px 18px;
}
.es2-icon {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.25);
  margin: 0 0 16px;
  flex-shrink: 0;
}
.es2-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.es2-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 4px;
  letter-spacing: -0.1px;
}
.es2-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 20px;
  max-width: 320px;
  line-height: 1.55;
}
.es2-cta {
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent, #3b82f6);
  color: var(--body-bg, #f5f5f5);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  min-height: 44px;
  transition: filter 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.es2-cta:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
.es2-cta:active { transform: scale(0.98); transition-duration: 80ms; }
.es2-cta:focus-visible { outline: 2px solid #ffcd33; outline-offset: 2px; }
.es2-cta-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.es2-cta-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  filter: none;
}

/* =========================================================
   KEYBOARD SHORTCUT OVERLAY
   ========================================================= */

.shortcut-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: shortcutOverlayFadeIn 120ms ease;
}

.shortcut-overlay-backdrop.shortcut-overlay-hidden {
  display: none;
}

@keyframes shortcutOverlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.shortcut-overlay-card {
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow), 0 12px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: shortcutCardSlideUp 180ms cubic-bezier(0.2, 0.9, 0.3, 1);
  transition:
    background var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition);
}

@keyframes shortcutCardSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.shortcut-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--divider);
}

.shortcut-overlay-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.shortcut-overlay-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  padding: 0;
  flex-shrink: 0;
}

.shortcut-overlay-close:hover {
  background: var(--glass-inner-bg);
  color: var(--text-primary);
}

.shortcut-overlay-group-label {
  padding: 14px 20px 5px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.shortcut-overlay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  gap: 12px;
}

.shortcut-overlay-desc {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}

.shortcut-overlay-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.shortcut-overlay-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  box-sizing: border-box;
}

/* Light mode kbd overrides */
[data-theme="light"] .shortcut-overlay-kbd,
:root:not([data-theme="dark"]) .shortcut-overlay-kbd {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.shortcut-overlay-then {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 2px;
}

.shortcut-overlay-footer {
  padding: 10px 20px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--divider);
  margin-top: 8px;
}

/* Help link in icon rail */
.shortcut-help-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: background 120ms ease, color 120ms ease;
  padding: 0;
  text-decoration: none;
}
.shortcut-help-link:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* Mobile: narrow card, smaller kbd */
@media (max-width: 639px), body.mobile .shortcut-overlay-card {
  max-width: 92vw;
}
@media (max-width: 639px) {
  .shortcut-overlay-card {
    max-height: calc(100dvh - 32px);
  }
}
@media (max-width: 639px), body.mobile .shortcut-overlay-kbd {
  font-size: 11px;
}
@media (max-width: 639px), body.mobile .shortcut-overlay-title {
  font-size: 16px;
}

/* ================================================================
   First-Time UX Polish: Welcome card, search tooltip,
   first-save celebrate, first-AI ribbon, onboarding fade.
   ================================================================ */

.onboarding-overlay.closing.closing-smooth {
  animation: onboardingFadeOutSmooth 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes onboardingFadeOutSmooth {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.01); }
}
body.dashboard-fade-in { opacity: 0; transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1); }
body.dashboard-fade-in-active { opacity: 1; transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1); }

.welcome-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 98000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: welcomeCardFadeIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.welcome-card-overlay.welcome-card-out {
  animation: welcomeCardFadeOut 280ms ease forwards;
}
@keyframes welcomeCardFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes welcomeCardFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.welcome-card {
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 28px 26px 22px;
  border-radius: 18px;
  background: rgba(18, 22, 32, 0.86);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255,255,255,0.04) inset;
  position: relative;
  transform: translateY(8px) scale(0.985);
  animation: welcomeCardRise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes welcomeCardRise {
  to { transform: translateY(0) scale(1); }
}
.welcome-card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.96);
  margin-bottom: 4px;
}
.welcome-card-sub {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 18px;
}
.welcome-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.welcome-card-action {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.welcome-card-action:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}
.welcome-card-action:active { transform: translateY(1px); }
.welcome-card-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  flex: 0 0 auto;
}
.welcome-card-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.welcome-card-action-title {
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}
.welcome-card-action-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
}
.welcome-card-skip {
  position: absolute;
  bottom: 10px;
  right: 14px;
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.45);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.welcome-card-skip:hover { color: rgba(255, 255, 255, 0.75); }

.scouq-search-tip {
  position: fixed;
  z-index: 98500;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(18, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: searchTipIn 220ms ease forwards;
}
.scouq-search-tip.scouq-search-tip-out { animation: searchTipOut 200ms ease forwards; }
@keyframes searchTipIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes searchTipOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.scouq-search-tip-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
}
.scouq-search-tip-close:hover { color: rgba(255, 255, 255, 0.95); }

.first-save-celebrate {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 14px) scale(0.96);
  opacity: 0;
  z-index: 99500;
  padding: 14px 22px;
  border-radius: 14px;
  background: rgba(18, 22, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  transition: opacity 360ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.first-save-celebrate.first-save-in {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.first-save-celebrate.first-save-out {
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.99);
}
.first-save-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  margin-bottom: 2px;
}
.first-save-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
}

.first-ai-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(108, 140, 255, 0.10), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  animation: firstAiIn 260ms ease forwards;
}
.first-ai-ribbon.first-ai-ribbon-out { animation: firstAiOut 200ms ease forwards; }
@keyframes firstAiIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes firstAiOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.first-ai-ribbon-text { line-height: 1.4; }
.first-ai-ribbon-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.first-ai-ribbon-close:hover { color: rgba(255, 255, 255, 0.95); }

/* ================================================================
   FIRST-RUN UX  (Q58)
   All selectors are opt-in via JS class/id injection.
   Returning users see none of this CSS applied to any element.
   ================================================================ */

/* ---- Feature 1: Welcome banner ---- */

.fr-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 0 10px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  font-size: 12.5px;
  line-height: 1.45;
  animation: frBannerIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.fr-banner.fr-banner-out {
  animation: frBannerOut 240ms ease forwards;
}

@keyframes frBannerOut {
  to { opacity: 0; transform: translateY(-4px); }
}

.fr-banner-body {
  flex: 1;
  min-width: 0;
}

.fr-banner-title {
  color: var(--text-primary);
  font-weight: 500;
}

.fr-banner-msg {
  color: var(--text-muted);
}

.fr-banner-close {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 140ms;
}

.fr-banner-close:hover {
  color: var(--text-primary);
}

/* ---- Feature 3: Rail pulse (soft outer ring, 3 cycles) ---- */

@keyframes frRailPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.18); }
  50%  { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.0); }
}

[data-theme="light"] .fr-pulse,
[data-theme="auto"] .fr-pulse {
  animation: frRailPulseLt 900ms ease 3;
}

@keyframes frRailPulseLt {
  0%   { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.14); }
  50%  { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.0); }
}

.fr-pulse {
  animation: frRailPulse 900ms ease 3;
  border-radius: 8px;
}

/* ---- Feature 4: First-run deals empty state ---- */

.fr-deals-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
}

.fr-deals-spinner {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  animation: frSpin 1.4s linear infinite;
}

.fr-deals-spinner svg {
  width: 100%;
  height: 100%;
}

@keyframes frSpin {
  to { transform: rotate(360deg); }
}

.fr-deals-empty-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.fr-deals-empty-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Feature 5: "What's next" checklist card ---- */

.fr-checklist {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9500;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  animation: frChecklistIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.fr-checklist.fr-checklist-out {
  animation: frChecklistOut 260ms ease forwards;
}

@keyframes frChecklistOut {
  to { opacity: 0; transform: translateY(8px); }
}

.fr-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fr-checklist-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fr-checklist-close {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 140ms;
}

.fr-checklist-close:hover {
  color: var(--text-primary);
}

.fr-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fr-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.fr-checklist-item:hover .fr-checklist-label {
  color: var(--text-primary);
}

.fr-checklist-box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms, background 180ms;
}

.fr-checklist-box svg {
  width: 10px;
  height: 10px;
  color: var(--text-primary);
}

.fr-checklist-item.fr-checked .fr-checklist-box {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .fr-checklist-item.fr-checked .fr-checklist-box {
  background: rgba(0, 0, 0, 0.08);
}

.fr-checklist-label {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
  transition: color 120ms;
}

.fr-checklist-item.fr-checked .fr-checklist-label {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

/* ── Map pin hover popover ─────────────────────────────────── */
.map-pin-popover {
  position: fixed;
  z-index: 3000;
  width: 240px;
  padding: 12px 14px 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}
.map-pin-popover[hidden] { display: none; }
.map-pin-popover .mpp-arrow {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--glass-bg);
}
.map-pin-popover .mpp-addr {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 2px;
}
.map-pin-popover .mpp-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.map-pin-popover .mpp-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.map-pin-popover .mpp-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}
.map-pin-popover .mpp-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.map-pin-popover .mpp-type {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-secondary);
}
.map-pin-popover .mpp-metric {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11px;
}
.map-pin-popover .mpp-label {
  color: var(--text-muted);
}
.map-pin-popover .mpp-val {
  font-weight: 700;
}
.map-pin-popover .mpp-pos { color: #16a34a; }
.map-pin-popover .mpp-neg { color: #dc2626; }
[data-theme="dark"] .map-pin-popover .mpp-pos { color: #86efac; }
[data-theme="dark"] .map-pin-popover .mpp-neg { color: #fca5a5; }

/* ==========================================================================
   Saved searches: filter footer button + popover + settings list
   ========================================================================== */

/* Footer layout: stack apply btn + save btn vertically */
.filter-view-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-save-search-btn {
  width: 100%;
  height: 36px;
  border: var(--glass-border);
  border-radius: var(--r-button);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: background 140ms ease, color 140ms ease;
}
.filter-save-search-btn:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.filter-save-search-btn:active {
  opacity: 0.8;
}

/* Popover */
.save-search-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 600;
}
.filter-view {
  position: relative;
}
.save-search-popover-inner {
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.save-search-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: var(--glass-border);
}
.save-search-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}
.save-search-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.save-search-popover-close:hover { color: var(--text-primary); }
.save-search-popover-body {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.save-search-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.save-search-input,
.save-search-select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: var(--glass-border);
  border-radius: 6px;
  background: var(--glass-inner-bg, rgba(0,0,0,0.04));
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}
.save-search-input:focus,
.save-search-select:focus {
  border-color: var(--accent);
}
.save-search-popover-foot {
  padding: 8px 12px 10px;
}
.save-search-confirm-btn {
  height: 34px;
  font-size: 12px;
}

/* Settings Investing: saved searches subheading */
.settings-section-subhead {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 12px 0 6px;
  border-top: var(--glass-border);
  margin-top: 8px;
}

/* Saved searches list in settings */
.saved-searches-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.saved-searches-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.saved-searches-loading::before,
.saved-searches-loading::after {
  content: '';
  display: block;
  height: 36px;
  border-radius: 8px;
  background: var(--glass-inner-bg, rgba(0,0,0,0.07));
  position: relative;
  overflow: hidden;
}
.saved-searches-loading::before { width: 100%; }
.saved-searches-loading::after { width: 80%; }
.saved-searches-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}
.saved-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: var(--glass-border);
}
.saved-search-row:last-child { border-bottom: none; }
.saved-search-row-main { flex: 1; min-width: 0; }
.saved-search-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-search-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-search-sep {
  margin: 0 4px;
}
.saved-search-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.saved-search-edit-btn,
.saved-search-delete-btn {
  height: 26px;
  padding: 0 10px;
  border: var(--glass-border);
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 120ms ease, color 120ms ease;
}
.saved-search-edit-btn:hover { background: var(--glass-bg); color: var(--text-primary); }
.saved-search-delete-btn:hover { color: #dc2626; border-color: #dc2626; }
.saved-search-pause-btn { height: 26px; padding: 0 10px; border: var(--glass-border); border-radius: 6px; background: transparent; font-size: 11px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: background 120ms ease, color 120ms ease; }
.saved-search-pause-btn:hover { background: var(--glass-bg); color: var(--text-primary); }
.saved-search-row[data-paused="1"] .saved-search-row-name { opacity: 0.5; }
.saved-search-row[data-paused="1"] .saved-search-pause-btn { color: var(--accent, #ffcd33); }

/* =================================================================
   SAVED TAB SUB-TABS
   ================================================================= */
.saved-subtab-bar {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  border-bottom: var(--glass-border);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.saved-subtab {
  padding: 5px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.saved-subtab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.saved-subtab:hover:not(.active) { color: var(--text-secondary); }
.saved-subpanel { flex: 1; overflow-y: auto; min-height: 0; }

/* =================================================================
   SAVED SEARCHES PANEL (sub-tab)
   ================================================================= */
.saved-searches-panel { padding: 0 12px 12px; }
.saved-searches-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
}
.saved-searches-panel-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* =================================================================
   NOTIFICATION HISTORY PANEL
   ================================================================= */
.notif-history-panel { display: flex; flex-direction: column; height: 100%; }
.notif-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: var(--glass-border);
}
.notif-history-filter-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.notif-history-chip {
  padding: 3px 10px;
  border: var(--glass-border);
  border-radius: 20px;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.notif-history-chip.active {
  background: var(--glass-bg);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.notif-history-chip:hover:not(.active) { color: var(--text-secondary); }
.notif-history-mark-all {
  flex-shrink: 0;
  padding: 3px 10px;
  border: var(--glass-border);
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.notif-history-mark-all:hover { color: var(--text-primary); background: var(--glass-bg); }
.notif-history-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.notif-history-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.notif-history-loading {
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.nh-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: var(--glass-border);
  transition: background 100ms ease;
}
.nh-row:last-child { border-bottom: none; }
.nh-row.unread { background: rgba(255,205,51,0.04); }
.nh-row:hover { background: var(--hover-bg); }
.nh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffcd33;
  flex-shrink: 0;
  margin-top: 5px;
}
.nh-dot.read { background: transparent; }
.nh-main { flex: 1; min-width: 0; }
.nh-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nh-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.nh-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }
.nh-action-btn {
  padding: 2px 8px;
  border: var(--glass-border);
  border-radius: 4px;
  background: transparent;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 100ms ease, background 100ms ease;
}
.nh-action-btn:hover { color: var(--text-primary); background: var(--glass-bg); }

/* =================================================================
   BELL BADGE
   ================================================================= */
.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  box-sizing: border-box;
}

/* =================================================================
   NOTIFICATION PREFERENCES (Settings)
   ================================================================= */
.notif-master-row { border-bottom: var(--glass-border); margin-bottom: 4px; }
.notif-master-label { font-size: 13px; font-weight: 600; }
.notif-channels-section { padding-top: 4px; }
.notif-sms-row span { display: flex; align-items: center; gap: 6px; }
.notif-coming-soon-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--glass-bg);
  border: var(--glass-border);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}
.notif-new-user-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--glass-bg);
  border: var(--glass-border);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}
.notif-sms-wrap { display: flex; align-items: center; gap: 8px; }
.notif-sms-input {
  width: 140px;
  padding: 4px 8px;
  border: var(--glass-border);
  border-radius: 6px;
  background: var(--glass-bg);
  color: var(--text-muted);
  font-size: 11px;
}
.notif-test-section { padding-top: 8px; display: flex; align-items: center; gap: 10px; }
.notif-test-hint { font-size: 11px; color: var(--text-muted); }

/* Mobile responsive for new sections */
@media (max-width: 600px) {
  .saved-subtab-bar { padding: 6px 8px 0; }
  .saved-subtab { padding: 4px 10px; font-size: 11px; }
  .notif-history-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .notif-sms-input { width: 110px; }
  .notif-test-section { flex-direction: column; align-items: flex-start; }
}

/* =================================================================
   DEAL COMPARISON MODAL
   ================================================================= */
.compare-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}
.compare-modal-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.compare-modal {
  position: relative;
  width: 100%;
  max-width: 1100px;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}
.compare-modal-overlay:not([hidden]) .compare-modal {
  transform: translateY(0);
}
.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  gap: 12px;
}
.compare-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.compare-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: var(--glass-inner-border);
  background: var(--glass-inner-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s;
}
.compare-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.compare-modal-body {
  padding: 20px 24px 28px;
  overflow-x: auto;
}

/* Best-of row */
.compare-best-row {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.compare-best-cell {
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.compare-best-cell .cbc-label { margin-bottom: 2px; }
.compare-best-cell .cbc-winner {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Columns grid */
.compare-cols-grid {
  display: grid;
  gap: 14px;
}
.compare-col {
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--glass-inner-bg);
}
.compare-col.compare-col-best {
  outline: 1px solid #f59e0b;
  outline-offset: -1px;
}
.compare-col-photo {
  width: 100%;
  height: 100px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.compare-col-photo svg { opacity: 0.3; }
.compare-col-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.compare-col-addr {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.compare-col-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
}
.compare-col-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.compare-col-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.compare-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}
.compare-chip-score {
  border-color: var(--accent, #4f8ef7);
  color: var(--accent, #4f8ef7);
  background: rgba(79,142,247,0.08);
}
.compare-chip-best {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245,158,11,0.1);
  font-weight: 600;
}
[data-theme="dark"] .compare-chip-best { color: #fbbf24; border-color: #fbbf24; }
.compare-col-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compare-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  gap: 6px;
}
.compare-stat-row .csr-label { color: var(--text-muted); flex: 0 0 auto; }
.compare-stat-row .csr-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.compare-stat-row.csr-best .csr-val { color: #f59e0b; }
[data-theme="dark"] .compare-stat-row.csr-best .csr-val { color: #fbbf24; }
.compare-col-divider {
  height: 1px;
  background: var(--border, rgba(255,255,255,0.06));
  margin: 2px 0;
}
.compare-col-summary {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.compare-col-summary.ccs-expanded {
  display: block;
  -webkit-line-clamp: unset;
}
.compare-readmore {
  font-size: 10px;
  color: var(--accent, #4f8ef7);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-top: 2px;
}
.compare-sparkline-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* Mobile: vertical stack */
@media (max-width: 639px) {
  .compare-modal-body { padding: 12px; }
  .compare-cols-grid { grid-template-columns: 1fr; }
  .compare-best-row { grid-template-columns: 1fr; }
  .compare-col-addr {
    position: sticky;
    top: 0;
    background: var(--glass-inner-bg);
    z-index: 1;
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    margin-bottom: 4px;
  }
}
@media (min-width: 640px) {
  .compare-cols-grid { grid-template-columns: repeat(var(--compare-cols, 2), 1fr); }
  .compare-best-row { grid-template-columns: repeat(var(--compare-best-metrics, 4), 1fr); }
}

/* ================================================================
   Market Overview: "Your Markets" (Insights tab)
   ================================================================ */
.mkt-overview {
  padding: 16px 16px 0;
}
.mkt-overview-hd {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.mkt-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mkt-card {
  width: 280px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mkt-card--empty {
  opacity: 0.6;
  justify-content: center;
  min-height: 80px;
}
.mkt-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.mkt-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mkt-card-state {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.mkt-card-scanning {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.mkt-spark {
  flex-shrink: 0;
  display: block;
}
.mkt-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.mkt-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mkt-kpi-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.mkt-kpi-lbl {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.mkt-view-deals {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: var(--glass-border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  align-self: flex-start;
  transition: color 0.15s, border-color 0.15s;
}
.mkt-view-deals:hover {
  color: var(--text-primary);
  border-color: rgba(128, 128, 128, 0.4);
}
@media (max-width: 639px) {
  .mkt-cards {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .mkt-card {
    width: 100%;
  }
}

/* ---- CSV Import Modal ---- */
.csv-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: reportFadeIn 180ms ease;
}

.csv-import-modal {
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--r-panel);
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 20px;
  animation: reportSlideUp 240ms cubic-bezier(0.22,1,0.36,1);
}

.csv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.csv-modal-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.csv-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0.6;
  line-height: 1;
}

.csv-modal-close:hover { opacity: 1; }

.csv-step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.csv-step-dot {
  height: 3px;
  flex: 1;
  border-radius: 4px;
  background: var(--divider);
  transition: background 0.2s;
}

.csv-step-dot.active {
  background: var(--text-primary);
}

.csv-step-dot.done {
  background: var(--text-muted);
}

/* Step 1: Upload */
.csv-drop-zone {
  border: 1px dashed var(--glass-border-color, rgba(128,128,128,0.35));
  border-radius: var(--r-cell);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 10px;
}

.csv-drop-zone.dragover {
  background: var(--hover-bg);
}

.csv-drop-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.csv-drop-sub {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
}

.csv-file-input {
  display: none;
}

.csv-browse-btn {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: var(--r-button);
  background: var(--accent-subtle);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.csv-error-msg {
  font-size: 11px;
  color: var(--color-danger, #dc2626);
  margin-bottom: 8px;
}

.csv-preview-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
  border-radius: var(--r-cell);
  border: var(--glass-inner-border);
}

.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.csv-preview-table th {
  background: var(--glass-inner-bg);
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: var(--glass-inner-border);
  white-space: nowrap;
}

.csv-preview-table td {
  padding: 4px 8px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-preview-table tr:last-child td { border-bottom: none; }

/* Step 2: Map */
.csv-map-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
}

.csv-map-row:last-child { border-bottom: none; }

.csv-map-label {
  flex: 1;
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
}

.csv-map-req {
  font-size: 10px;
  color: var(--color-danger, #dc2626);
  margin-left: 3px;
}

.csv-map-select {
  width: 160px;
  padding: 4px 6px;
  border-radius: var(--r-button);
  background: var(--glass-inner-bg);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 11px;
  font-family: inherit;
}

/* Step 3: Confirm */
.csv-confirm-summary {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.csv-confirm-skipped {
  font-size: 11px;
  color: var(--text-muted);
}

.csv-progress-wrap {
  height: 4px;
  background: var(--divider);
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}

.csv-progress-bar {
  height: 100%;
  background: var(--text-primary);
  border-radius: 4px;
  width: 0%;
  transition: width 0.15s;
}

.csv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.csv-btn-primary {
  padding: 6px 16px;
  border-radius: var(--r-button);
  background: var(--accent-subtle);
  border: var(--glass-inner-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.csv-btn-primary:hover { background: var(--hover-bg); }
.csv-btn-primary:disabled { opacity: 0.4; cursor: default; }

.csv-btn-ghost {
  padding: 6px 12px;
  border-radius: var(--r-button);
  background: none;
  border: var(--glass-inner-border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.csv-btn-ghost:hover { color: var(--text-primary); }

/* ================================================================
   Mobile Fix Wave 6 - tap targets, bulk bar, filter, sticky CTA
   ================================================================ */

/* Fix 1: Bulk bar - now a direct body child so position:fixed is viewport-relative.
   Safe-area padding lives inside the bar's own content area. */
.sd-bulk-bar {
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* Fix 4: Mobile filter trigger (deals tab) */
.mobile-filter-trigger {
  display: none;
}
@media (max-width: 768px) {
  .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--r-button);
    background: var(--glass-inner-bg);
    border: var(--glass-inner-border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }
  .mobile-filter-trigger:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
  }
}

/* Fix 6: Cmd+K search trigger min-height 44px at mobile */
@media (max-width: 768px) {
  .search-trigger {
    min-height: 44px;
    height: auto;
  }
}

/* Fix 7: Saved Select button min-height at tablet */
@media (max-width: 1024px) {
  .sd-select-btn {
    min-height: 44px;
    padding: 0 12px;
  }
}

/* Fix 8: Calculator Share button min-height at mobile */
@media (max-width: 1024px) {
  .calc-btn--secondary {
    min-height: 44px;
  }
}

/* ================================================================
   Light theme overrides (collected)
   All hardcoded rgba(255,255,255,...) rules that have no guard
   are addressed here. Dark mode is unchanged.
   ================================================================ */

/* -- es2 empty-state system -- */
[data-theme="light"] .es2-icon { color: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .es2-title { color: rgba(0, 0, 0, 0.85); }
[data-theme="light"] .es2-sub { color: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .es2-cta-ghost {
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .es2-cta-ghost:hover { background: rgba(0, 0, 0, 0.05); }

/* -- Welcome card -- */
[data-theme="light"] .welcome-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 0 rgba(0, 0, 0, 0.04) inset;
}
[data-theme="light"] .welcome-card-title { color: rgba(0, 0, 0, 0.9); }
[data-theme="light"] .welcome-card-sub { color: rgba(0, 0, 0, 0.55); }
[data-theme="light"] .welcome-card-action {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}
[data-theme="light"] .welcome-card-action:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .welcome-card-num {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.8);
}
[data-theme="light"] .welcome-card-action-title { color: rgba(0, 0, 0, 0.88); }
[data-theme="light"] .welcome-card-action-sub { color: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .welcome-card-skip { color: rgba(0, 0, 0, 0.4); }
[data-theme="light"] .welcome-card-skip:hover { color: rgba(0, 0, 0, 0.7); }

/* -- Search tip -- */
[data-theme="light"] .scouq-search-tip {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.85);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .scouq-search-tip-close { color: rgba(0, 0, 0, 0.45); }
[data-theme="light"] .scouq-search-tip-close:hover { color: rgba(0, 0, 0, 0.8); }

/* -- First-save celebrate -- */
[data-theme="light"] .first-save-celebrate {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .first-save-title { color: rgba(0, 0, 0, 0.88); }
[data-theme="light"] .first-save-sub { color: rgba(0, 0, 0, 0.55); }

/* -- First-AI ribbon -- */
[data-theme="light"] .first-ai-ribbon {
  background: linear-gradient(90deg, rgba(108, 140, 255, 0.08), rgba(0, 0, 0, 0.02));
  border-color: rgba(0, 0, 0, 0.09);
  color: rgba(0, 0, 0, 0.78);
}
[data-theme="light"] .first-ai-ribbon-close { color: rgba(0, 0, 0, 0.4); }
[data-theme="light"] .first-ai-ribbon-close:hover { color: rgba(0, 0, 0, 0.75); }

/* -- Network: nx-chip hover -- */
[data-theme="light"] .nx-chip:hover { color: rgba(0, 0, 0, 0.85); border-color: rgba(0, 0, 0, 0.25); }

/* -- Filter badge -- */
[data-theme="light"] .filter-badge {
  background: rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.75);
}

/* -- Insight distribution pills -- */
[data-theme="light"] .insight-dist-pill-name { color: rgba(0, 0, 0, 0.85); }
[data-theme="light"] .insight-dist-pill-pct { color: rgba(0, 0, 0, 0.6); }

/* -- Compare table yes/no -- */
[data-theme="light"] .cmp-yes { color: rgba(0, 0, 0, 0.85); }
[data-theme="light"] .cmp-no { color: rgba(0, 0, 0, 0.3); }

/* -- Focus panel scrollbar -- */
[data-theme="light"] .focus-panel {
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
[data-theme="light"] .focus-panel::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); }
[data-theme="light"] .focus-panel::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }

/* -- Profile avatar initials -- */
[data-theme="light"] .prof-avatar { color: #fff; }

/* -- Stage scout badge: glass-inner-bg in light is near-transparent, text-muted handles it via
   the base rule at line 1199, no override needed. Confirmed OK. -- */

/* ================================================================
   Mobile Fix Wave 7 - bulk bar overflow, button tap targets
   ================================================================ */

/* Fix 1: Bulk bar wraps on narrow viewports so all actions stay reachable.
   white-space: nowrap is cleared; bar constrains to viewport with gutters. */
@media (max-width: 480px) {
  .sd-bulk-bar {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    white-space: normal;
    flex-wrap: wrap;
    gap: 8px;
    bottom: -100px;
  }
  .sd-bulk-bar.sd-open {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .sd-bulk-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .sd-bulk-bar .sx-btn {
    min-height: 44px;
    padding: 0 14px;
    flex-shrink: 0;
  }
}

/* ============================================================
   Live Feed panel
   ============================================================ */

.live-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-feed-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status dot: connecting / live / offline */
.live-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.live-status-dot.live-status-connecting {
  background: rgba(255,255,255,0.3);
}
.live-status-dot.live-status-live {
  background: #4ade80; /* green: only allowed for live signal dot */
  box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
  animation: live-pulse 2s ease-in-out infinite;
}
.live-status-dot.live-status-offline {
  background: rgba(255,255,255,0.18);
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* Filter chips */
.live-feed-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 10px;
}
.live-chip {
  background: var(--glass-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
  color: var(--text-secondary, rgba(255,255,255,0.65));
  border-radius: 20px;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.live-chip:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.live-chip.active {
  background: rgba(255,205,51,0.12);
  border-color: rgba(255,205,51,0.4);
  color: #ffcd33;
}

/* Offline banner */
.live-feed-offline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  margin-bottom: 10px;
}

/* Event list */
.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

/* Individual event row */
.live-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.1s ease;
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
  animation: live-slide-down 0.2s ease;
}
.live-event-row:hover {
  background: rgba(255,255,255,0.04);
}
@keyframes live-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.live-event-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  margin-top: 1px;
}
.live-event-icon.icon-new-listing {
  background: rgba(255,205,51,0.14);
  color: #ffcd33;
}
.live-event-icon.icon-distress {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}
.live-event-icon.icon-sale {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}
.live-event-icon.icon-rate {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.live-event-body {
  flex: 1;
  min-width: 0;
}
.live-event-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.live-event-meta {
  font-size: 11px;
  color: var(--text-secondary, rgba(255,255,255,0.55));
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-event-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-tertiary, rgba(255,255,255,0.35));
  margin-top: 2px;
}

/* Mobile: live feed pane collapses to bottom sheet */
@media (max-width: 768px) {
  #tabLive .live-feed-list {
    max-height: 60vh;
  }
}

/* =================================================================
   FTUX - Investor type radio buttons (Step 1 new modal)
   ================================================================= */
.ob-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text-primary);
}
.ob-brand-logo {
  opacity: 0.9;
  flex-shrink: 0;
}
.ob-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.ob-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.ob-radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  user-select: none;
}
.ob-radio-row input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ob-radio-row:hover {
  background: var(--hover-bg, rgba(255,255,255,0.06));
}
.ob-radio-row-selected {
  background: var(--accent-faint, rgba(16,185,129,0.08));
  border-color: var(--accent, #10b981);
}
.ob-radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--divider);
  flex-shrink: 0;
  transition: border-color 140ms, background 140ms;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-radio-row-selected .ob-radio-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.ob-radio-row-selected .ob-radio-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--body-bg, #0f1117);
  display: block;
}
.ob-radio-label {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

/* =================================================================
   FTUX - Priorities checkboxes (Step 3 new modal)
   ================================================================= */
.ob-check-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.ob-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  user-select: none;
}
.ob-check-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ob-check-row:hover {
  background: var(--hover-bg, rgba(255,255,255,0.06));
}
.ob-check-row-selected {
  background: var(--accent-faint, rgba(16,185,129,0.08));
  border-color: var(--accent, #10b981);
}
.ob-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--divider);
  flex-shrink: 0;
  transition: border-color 140ms, background 140ms;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}
.ob-check-row-selected .ob-check-box {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--body-bg, #0f1117);
}
.ob-check-label {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Onboarding Step 3: feature map grid */
.ob-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
  width: 100%;
}

.ob-feature-tile {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: var(--glass-border);
  cursor: default;
}

.ob-feature-tile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ob-feature-tile-use {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* =================================================================
   FTUX Tooltip
   ================================================================= */
.ftux-tooltip {
  position: fixed;
  z-index: 98000;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: ftuxTipIn 200ms ease forwards;
}
@keyframes ftuxTipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.ftux-tooltip-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ftux-tooltip-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}
.ftux-tooltip-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 1px;
  opacity: 0.6;
}
.ftux-tooltip-dismiss:hover { opacity: 1; }

/* =================================================================
   What's New Banner
   ================================================================= */
.whats-new-banner {
  position: fixed;
  bottom: 72px;
  right: 16px;
  z-index: 97000;
  width: 300px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: ftuxTipIn 240ms ease forwards;
}
.whats-new-banner.whats-new-closing {
  animation: ftuxTipOut 280ms ease forwards;
}
@keyframes ftuxTipOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(10px); }
}
.whats-new-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.whats-new-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1px;
}
.whats-new-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.6;
}
.whats-new-close:hover { opacity: 1; }
.whats-new-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.whats-new-item {
  font-size: 11.5px;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  line-height: 1.45;
  padding-left: 10px;
  position: relative;
}
.whats-new-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* =================================================================
   Map empty state overlay
   ================================================================= */
.map-empty-overlay {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  padding: 16px 20px;
  border-radius: 14px;
  text-align: center;
  min-width: 240px;
  max-width: 320px;
}
.map-empty-icon {
  display: block;
  margin: 0 auto 8px;
  opacity: 0.5;
}
.map-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.map-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

/* ==========================================================================
   CSV Bulk Export
   ========================================================================== */

/* Feed export button (deals + insights + saved tabs) */
.feed-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-button, 8px);
  background: var(--glass-inner-bg, rgba(255,255,255,0.06));
  border: var(--glass-inner-border, 1px solid rgba(255,255,255,0.1));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
  white-space: nowrap;
}
.feed-export-btn:hover {
  background: var(--hover-bg, rgba(255,255,255,0.1));
  color: var(--text-primary);
  transform: translateY(-2px);
}
.feed-export-btn:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}
.feed-export-btn:focus-visible {
  outline: 2px solid #ffcd33;
  outline-offset: 2px;
}
.feed-export-btn svg {
  flex-shrink: 0;
}

/* Export modal overlay */
.csv-export-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 480px) {
  .csv-export-modal {
    align-items: center;
  }
}
.csv-export-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
.csv-export-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 16px 16px 0 0;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: 0 -4px 40px rgba(0,0,0,0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
@media (min-width: 480px) {
  .csv-export-sheet {
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  }
}
.csv-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.csv-export-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.csv-export-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glass-inner-bg, rgba(255,255,255,0.06));
  border: var(--glass-inner-border, 1px solid rgba(255,255,255,0.1));
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}
.csv-export-close:hover {
  background: var(--hover-bg);
}
.csv-export-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.csv-export-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.csv-export-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.csv-export-radio-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.csv-export-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.csv-export-col-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}
.csv-export-col-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: var(--glass-inner-border, 1px solid rgba(255,255,255,0.08));
  border-radius: 6px;
  padding: 3px 8px;
}
.csv-export-col-item input {
  margin: 0;
}
.csv-export-maxrows-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.csv-export-input {
  width: 100px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass-inner-bg, rgba(255,255,255,0.04));
  border: var(--glass-inner-border, 1px solid rgba(255,255,255,0.12));
  color: var(--text-primary);
  font-size: 13px;
  padding: 0 10px;
}
.csv-export-tier-note {
  font-size: 11px;
  color: var(--text-muted);
}
.csv-export-upgrade-note {
  font-size: 12px;
  color: var(--color-warning, #f59e0b);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.18);
}
.csv-export-upgrade-link {
  color: inherit;
  text-decoration: underline;
  margin-left: 4px;
}
.csv-export-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.csv-export-btn-primary {
  height: 36px;
  padding: 0 18px;
  border-radius: var(--r-button, 8px);
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 150ms ease;
}
[data-theme="dark"] .csv-export-btn-primary {
  background: rgba(255,255,255,0.9);
}
.csv-export-btn-primary:hover { opacity: 0.88; }
.csv-export-btn-primary:active { opacity: 0.7; }
.csv-export-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.csv-export-status {
  font-size: 12px;
  color: var(--text-muted);
}


/* ================================================================
   CAPACITOR NATIVE MOBILE POLISH
   Scoped to body.capacitor-native to avoid any web impact.
   ================================================================ */

/* Safe area insets for notched iPhones and Android nav bar */
body.capacitor-native {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Bottom nav bar on narrow native viewports */
@media (max-width: 768px) {
  body.capacitor-native .tab-nav-rail,
  body.capacitor-native [class*="tab-rail"],
  body.capacitor-native .investor-console-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: 56px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    border-left: none;
    border-right: none;
    z-index: 50;
  }

  /* Shift main content up so it clears the bottom nav */
  body.capacitor-native #map,
  body.capacitor-native .app-shell {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

/* Minimum 44px touch targets on all interactive elements */
body.capacitor-native button,
body.capacitor-native [role="button"],
body.capacitor-native a {
  min-height: 44px;
  min-width: 44px;
}

/* Icon-only buttons that intentionally render smaller: keep appearance, enlarge hit area */
body.capacitor-native .detail-icon-btn,
body.capacitor-native .pin-btn,
body.capacitor-native .map-mode-btn {
  position: relative;
}
body.capacitor-native .detail-icon-btn::before,
body.capacitor-native .pin-btn::before,
body.capacitor-native .map-mode-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
}

/* Pull-to-refresh visual affordance on scroll containers */
body.capacitor-native .saved-list-scroll,
body.capacitor-native .activity-list,
body.capacitor-native .network-scroll {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* Map gesture handling: allow pinch-to-zoom without triggering page zoom */
body.capacitor-native #map {
  touch-action: pan-x pan-y;
}

/* Suppress text selection on interactive chrome on native */
body.capacitor-native .tab-btn,
body.capacitor-native .map-mode-btn,
body.capacitor-native .mobile-menu-btn {
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Ownership composition tool ---- */
.insights-v2-oc-section { padding: 4px 0 16px; }
.insights-v2-oc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.insights-v2-oc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.insights-v2-oc-label { font-size: 13px; min-width: 130px; color: var(--text, #e8e8e8); }
.insights-v2-oc-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.07); border-radius: 6px; overflow: hidden; }
.insights-v2-oc-bar { height: 100%; border-radius: 6px; transition: width 0.3s; }
.insights-v2-oc-pct { font-size: 12px; font-weight: 600; color: var(--text, #e8e8e8); min-width: 34px; text-align: right; }
.insights-v2-oc-note { font-size: 12px; color: var(--text-muted, #8a8a9a); margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); }

/* ---- IA: Tools Hub ---- */
.tools-hub-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.tools-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 24px;
}
@media (max-width: 480px) { .tools-hub-grid { grid-template-columns: 1fr; } }
.tools-hub-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.tools-hub-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.tools-hub-icon { color: var(--text-muted); margin-bottom: 2px; }
.tools-hub-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tools-hub-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.tools-hub-cta { font-size: 11px; font-weight: 600; color: var(--accent); margin-top: 4px; }
.tools-hub-pro-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-subtle);
  color: var(--text-muted);
  text-transform: uppercase;
}
.tools-hub-card-pro { border-color: rgba(245,196,81,0.18); }

/* ---- IA: Insights 4-section ---- */
.insights-ia-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 24px; max-width: 100%; }
.insights-ia-section {
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}
.insights-ia-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: var(--glass-border);
  font-size: 12px;
  font-weight: 600;
}
.insights-ia-section-title { flex: 1; }
.insights-ia-section-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.insights-ia-section-body { padding: 12px 14px; }
.insights-ia-intelligence-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245,196,81,0.15);
  color: #f5c451;
}
.insights-ia-intelligence-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.insights-ia-brain-link { display: inline-block; }
.insights-ia-compare-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.insights-ia-compare-pickers { display: flex; gap: 8px; margin-bottom: 12px; }
.insights-ia-market-picker { flex: 1; font-size: 12px; }
.insights-ia-compare-chart { min-height: 80px; }
.insights-rate-row { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

/* ---- Part F: Insights width fix for expanded mode ---- */
body.sidebar-expanded #tabInsights.active {
  width: calc(100vw - var(--rail-width, 56px));
  max-width: calc(100vw - var(--rail-width, 56px));
  overflow-x: hidden;
}
body.sidebar-expanded #tabInsights .insights-ia-section > * {
  max-width: 100%;
  box-sizing: border-box;
}
.insights-brain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.insights-brain-grid .brain-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 0;
  box-sizing: border-box;
}
.insights-brain-grid .brain-card h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}
.brain-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.brain-kpi {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
  box-sizing: border-box;
}
.brain-kpi .kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.brain-kpi .kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.brain-kpi .kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.brain-loading { font-size: 0.75rem; color: var(--text-muted); }
.brain-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--glass-inner-bg, rgba(0,0,0,0.10));
  border-top-color: #ffcd33;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---- Part G: hide map controls when sidebar expanded ---- */
body.sidebar-expanded #modeExplore,
body.sidebar-expanded .map-mode-toggle,
body.sidebar-expanded #fitPinsBtn {
  display: none;
}

/* ---- Insights per-property view ---- */
.insights-property-view {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}
.insights-property-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--glass-border);
  flex-shrink: 0;
}
.insights-property-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.insights-property-back-btn:hover { background: var(--glass-bg); color: var(--text-primary); }
.insights-property-address-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.insights-property-body {
  padding: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.insights-property-section {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 10px;
  padding: 14px 16px;
  box-sizing: border-box;
}
.insights-property-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.insights-property-hero .insights-property-address {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.insights-property-hero .insights-property-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.insights-property-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}
.ipkpi { display: flex; flex-direction: column; gap: 2px; }
.ipkpi-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ipkpi-val { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.insights-property-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.ipdetail { display: flex; flex-direction: column; gap: 2px; }
.ipdetail-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ipdetail-val { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.insights-property-notes { font-size: 0.82rem; color: var(--text-primary); line-height: 1.5; }
.insights-property-loading, .insights-property-error { font-size: 0.82rem; color: var(--text-muted); padding: 16px 0; }
.insights-property-cta { text-align: center; }
.insights-property-full-link {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
}

/* ---- IA: Settings collapsible sections ---- */
.settings-ia-section { border-bottom: var(--glass-border); }
.settings-ia-section:last-child { border-bottom: none; }
.settings-ia-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.settings-ia-toggle:hover { background: var(--hover-bg); }
.settings-ia-toggle-label { flex: 1; }
.settings-ia-toggle-desc { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.settings-ia-chevron {
  color: var(--text-muted);
  transition: transform 180ms ease;
  flex-shrink: 0;
}
.settings-ia-section.open .settings-ia-chevron { transform: rotate(180deg); }
.settings-ia-body { display: none; padding: 0 16px 14px; }
.settings-ia-section.open .settings-ia-body { display: block; }

/* ---- IA: Property tabs ---- */
.prop-tabs-bar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 12px 16px 0;
  border-bottom: var(--glass-border);
  scrollbar-width: none;
}
.prop-tabs-bar::-webkit-scrollbar { display: none; }
.prop-tab-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}
.prop-tab-btn:hover { color: var(--text-primary); }
.prop-tab-btn.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.prop-tab-panel { display: none; padding: 16px; }
.prop-tab-panel.active { display: block; }
.prop-section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 12px;
  padding: 4px 0;
}
.prop-section-link:hover { color: var(--text-primary); }
.prop-section-link svg { flex-shrink: 0; }

/* ---- IA: Consistent sub-page header ---- */
.subpage-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.subpage-header-back {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.subpage-header-back:hover { background: var(--hover-bg); color: var(--text-primary); }
.subpage-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}
.subpage-header-breadcrumb-sep { opacity: 0.4; }
.subpage-header-breadcrumb-current { color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subpage-header-actions { display: flex; align-items: center; gap: 6px; }
.subpage-header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border: var(--glass-border);
  background: var(--glass-inner-bg);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
  white-space: nowrap;
}
.subpage-header-action-btn:hover { background: var(--hover-bg); }

/* ---- IA: Score progressive disclosure ---- */
.deal-score-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}
.deal-score-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.deal-score-ring-svg { width: 64px; height: 64px; }
.deal-score-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.deal-score-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.deal-score-headline { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.deal-score-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 2px;
}
.deal-score-toggle:hover { color: var(--text-primary); }
.deal-score-breakdown { display: none; padding: 0 16px 12px; }
.deal-score-breakdown.visible { display: block; }
.deal-score-radar-wrap { width: 100%; max-width: 260px; margin: 0 auto 12px; }
.deal-score-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.deal-score-bar-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.deal-score-bar-label { min-width: 90px; color: var(--text-muted); }
.deal-score-bar-track { flex: 1; height: 4px; background: var(--glass-inner-bg); border-radius: 4px; overflow: hidden; }
.deal-score-bar-fill { height: 100%; border-radius: 4px; background: #f5c451; }
.deal-score-bar-val { min-width: 28px; text-align: right; font-weight: 500; }
.deal-score-why { display: none; padding: 10px 16px 4px; border-top: var(--glass-border); }
.deal-score-why.visible { display: block; }
.deal-score-why-toggle { font-size: 11px; color: var(--text-muted); background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 0; }
.deal-score-why-toggle:hover { color: var(--text-primary); }
.deal-score-why-body { margin-top: 8px; }
.deal-score-why-summary { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }

/* ---- IA: Standardized modal ---- */
.ia-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.ia-modal-overlay.visible { opacity: 1; }
.ia-modal {
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 220ms ease-out, opacity 220ms ease-out;
}
.ia-modal-overlay.visible .ia-modal { transform: scale(1); opacity: 1; }
.ia-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: var(--glass-border);
}
.ia-modal-title { font-size: 15px; font-weight: 600; flex: 1; }
.ia-modal-close { display: grid; place-items: center; width: 28px; height: 28px; border: none; background: none; color: var(--text-muted); cursor: pointer; border-radius: 6px; }
.ia-modal-close:hover { background: var(--hover-bg); color: var(--text-primary); }
.ia-modal-body { padding: 16px 18px; }
.ia-modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: var(--glass-border); }

/* ---- IA: Standardized toast ---- */
.ia-toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9800;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.ia-toast {
  pointer-events: all;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 10px;
  box-shadow: var(--glass-shadow);
  padding: 10px 14px 8px;
  min-width: 220px;
  max-width: 320px;
  font-size: 13px;
  position: relative;
  overflow: hidden;
  animation: ia-toast-in 220ms ease-out forwards;
}
.ia-toast.dismissing { animation: ia-toast-out 180ms ease-in forwards; }
@keyframes ia-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ia-toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
.ia-toast-msg { margin-bottom: 6px; }
.ia-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 0 0;
  animation: ia-toast-progress linear forwards;
}
@keyframes ia-toast-progress { from { width: 100%; } to { width: 0%; } }
.ia-toast-error .ia-toast-progress { background: var(--color-danger); }
.ia-toast-success .ia-toast-progress { background: var(--color-success); }
.ia-toast-warning .ia-toast-progress { background: var(--color-warning); }
@media (max-width: 480px) {
  .ia-toast-stack { bottom: 80px; right: 12px; left: 12px; align-items: stretch; }
}

/* ================================================================
   Recommendation Engine: banners + inline cards
   Uses glass tokens; yellow-gold accent for the highlight strip.
   ================================================================ */

.rec-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 3px solid rgba(202, 168, 70, 0.7);
  border-radius: var(--r-card, 10px);
  padding: 12px 14px;
  margin: 10px 0 12px;
  box-shadow: var(--glass-shadow);
  font-size: 13px;
  animation: rec-slide-in 200ms ease-out forwards;
}

@keyframes rec-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rec-banner-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(202, 168, 70, 0.85);
  margin-top: 1px;
}

.rec-banner-text {
  flex: 1;
  min-width: 0;
}

.rec-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-banner-body {
  font-size: 12px;
  color: var(--text-secondary, rgba(0,0,0,0.55));
  line-height: 1.4;
}

.rec-banner-ctas {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rec-banner-cta-primary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(202, 168, 70, 0.12);
  border: 1px solid rgba(202, 168, 70, 0.35);
  border-radius: 6px;
  padding: 5px 10px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}

.rec-banner-cta-primary:hover {
  background: rgba(202, 168, 70, 0.22);
}

.rec-banner-cta-dismiss {
  font-size: 11px;
  color: var(--text-secondary, rgba(0,0,0,0.45));
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.12s;
}

.rec-banner-cta-dismiss:hover {
  color: var(--text-primary);
}

/* Inline recommendation card (compact, inside sections) */

.rec-inline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.rec-inline-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 500;
}

.rec-inline-icon {
  flex-shrink: 0;
  color: var(--text-secondary, rgba(0,0,0,0.45));
}

.rec-inline-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.rec-inline-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #0070f3);
  text-decoration: none;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(0, 112, 243, 0.25);
  transition: background 0.12s;
}

.rec-inline-link:hover {
  background: rgba(0, 112, 243, 0.07);
}

@media (prefers-color-scheme: dark) {
  .rec-banner-body { color: rgba(255,255,255,0.55); }
  .rec-banner-cta-dismiss { color: rgba(255,255,255,0.4); }
  .rec-inline-icon { color: rgba(255,255,255,0.4); }
  .rec-inline-link { color: var(--accent, #60a5fa); border-color: rgba(96,165,250,0.25); }
  .rec-inline-link:hover { background: rgba(96,165,250,0.09); }
}

/* =========================================================
   sc-tabs: tab strip shared by Playbook sub-tabs and
   Profile sub-tabs. Mirrors ScouqComponents.tabs() output.
   ========================================================= */
.sc-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.08));
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sc-tabs::-webkit-scrollbar { display: none; }

.sc-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, rgba(0,0,0,0.45));
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.sc-tab:hover { background: var(--hover-bg, rgba(0,0,0,0.05)); color: var(--text-primary, #000); }
.sc-tab.sc-tab-active {
  background: var(--hover-bg, rgba(0,0,0,0.07));
  color: var(--text-primary, #000);
  font-weight: 600;
}
[data-theme="dark"] .sc-tab { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .sc-tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
[data-theme="dark"] .sc-tab.sc-tab-active { background: rgba(255,255,255,0.1); color: #fff; }

.playbook-sub-panel { padding: 4px 0 0; }

/* =========================================================
   Live Feed Widget (bottom-right, always visible)
   ========================================================= */
.live-feed-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 700;
}
.live-feed-widget-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: 20px;
  border: var(--glass-border, 1px solid rgba(0,0,0,0.08));
  background: var(--glass-bg, rgba(255,255,255,0.88));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #000);
  transition: opacity 0.15s;
  position: relative;
}
.live-feed-widget-btn:hover { opacity: 0.85; }
.live-feed-widget-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.live-feed-widget-dot-live {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
  animation: lf-pulse 2s ease-in-out infinite;
}
.live-feed-widget-dot-connecting { background: #f59e0b; }
.live-feed-widget-dot-offline { background: #ef4444; }
@keyframes lf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.live-feed-widget-label { font-size: 12px; }
.live-feed-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.live-feed-widget-drawer {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: var(--glass-border, 1px solid rgba(0,0,0,0.08));
  background: var(--glass-bg, rgba(255,255,255,0.94));
  backdrop-filter: var(--glass-blur, blur(16px));
  -webkit-backdrop-filter: var(--glass-blur, blur(16px));
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.live-feed-widget-drawer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.08));
  flex-shrink: 0;
}
.live-feed-widget-drawer-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}
.live-feed-widget-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted, rgba(0,0,0,0.4));
  padding: 2px;
  display: flex;
  align-items: center;
}
.live-feed-widget-close:hover { color: var(--text-primary, #000); }
.live-feed-widget-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
@media (max-width: 480px) {
  .live-feed-widget { bottom: 12px; right: 12px; }
  .live-feed-widget-drawer { width: calc(100vw - 24px); right: 0; }
}
[data-theme="dark"] .live-feed-widget-close:hover { color: #fff; }

/* =========================================================
   Profile sub-tab: Settings accordion
   ========================================================= */
.prof-settings-accordion-item {
  border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.07));
}
.prof-settings-accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary, #000);
  font-size: 13px;
  font-weight: 500;
}
.prof-settings-accordion-header:hover { background: var(--hover-bg, rgba(0,0,0,0.03)); }
.prof-settings-accordion-label { flex: 1; }
.prof-settings-accordion-chevron {
  color: var(--text-muted, rgba(0,0,0,0.35));
  display: flex;
  align-items: center;
  transition: transform 0.15s;
}
.prof-settings-accordion-body {
  padding: 4px 0 12px 22px;
}
[data-theme="dark"] .prof-settings-accordion-header { color: #fff; }
[data-theme="dark"] .prof-settings-accordion-header:hover { background: rgba(255,255,255,0.04); }
