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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f3f4f6;
}

a {
  color: #6ABF4B;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #1e293b;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
  z-index: 100;
}
.navbar-admin {
  background: #312e81;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.navbar-brand-logo {
  height: 32px;
  max-width: 160px;
  flex-shrink: 0;
  object-fit: contain;
}
.navbar-logo {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.navbar-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}
.navbar-logo-divider {
  font-weight: 300;
  opacity: 0.4;
  font-size: 1.25rem;
}
.navbar-logo-app {
  font-weight: 600;
}
.navbar-logo-brand {
  display: none;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
}
.nav-link:hover {
  color: #fff;
  text-decoration: none;
}
.nav-user {
  color: #94a3b8;
  font-size: 0.8125rem;
}
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
}

/* =============================================
   SIDEBAR & APP LAYOUT
   ============================================= */
.app-layout {
  display: flex;
  min-height: calc(100vh - 49px); /* viewport minus navbar height */
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border-right: 1px solid #334155;
  transition: width 0.2s ease;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar--expanded {
  width: 220px;
}
html.sb-collapsed .sidebar--expanded {
  width: 56px;
}
.sidebar--collapsed {
  width: 56px;
}

/* Toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: none;
  border-bottom: 1px solid #334155;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s;
}
.sidebar-toggle:hover {
  color: #fff;
  background: #334155;
}
.sidebar-toggle-icon {
  flex-shrink: 0;
}

/* Navigation links */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  color: #fff;
  background: #334155;
  text-decoration: none;
}
.sidebar-link--active {
  color: #6ABF4B;
  background: rgba(106, 191, 75, 0.08);
  border-left-color: #6ABF4B;
}
.sidebar-link--active:hover {
  color: #6ABF4B;
  background: rgba(106, 191, 75, 0.12);
}

/* Icon sizing */
.sidebar-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.sidebar-icon-wrapper {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

/* Unread badge on icon */
.sidebar-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1;
}

/* Labels (hidden when collapsed) */
.sidebar-label {
  transition: opacity 0.2s ease;
  overflow: hidden;
}
.sidebar--collapsed .sidebar-label {
  opacity: 0;
  width: 0;
}
.sidebar--expanded .sidebar-label {
  opacity: 1;
}

/* Collapsed state - center icons */
.sidebar--collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  border-left-width: 0;
  gap: 0;
}
.sidebar--collapsed .sidebar-toggle {
  padding-left: 0;
  padding-right: 0;
}

/* Admin divider (inline in sidebar-nav, after Portfolio) */
.sidebar-admin-divider {
  border-top: 1px solid #334155;
  margin: 0.5rem 0;
}

/* Tooltip on collapsed sidebar */
.sidebar--collapsed .sidebar-link {
  position: relative;
}
.sidebar--collapsed .sidebar-link::after {
  content: attr(title);
  display: none;
}
.sidebar--collapsed .sidebar-link:hover .sidebar-label {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 1;
  width: auto;
  background: #1e293b;
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-left: 8px;
  z-index: 200;
  pointer-events: none;
}

/* Main content area */
.app-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

/* Flash Messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.flash-notice {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.flash-alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: #6ABF4B;
  color: #fff;
}
.btn-primary:hover {
  background: #5AA637;
}
.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}
.btn-secondary:hover {
  background: #d1d5db;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table thead {
  background: #f8fafc;
}
.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.table-wrapper {
  overflow-x: auto;
}

/* Change indicators */
.change-positive {
  color: #059669;
}
.change-negative {
  color: #dc2626;
}
.change-neutral {
  color: #6b7280;
}

/* Outlier indicator for anomalous data weeks */
.outlier-row {
  background: #fffbeb;
}
.outlier-flag {
  color: #d97706;
  font-size: 1rem;
  text-align: center;
  cursor: help;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.status-mapping {
  background: #e0e7ff;
  color: #3730a3;
}
.status-processing {
  background: #dbeafe;
  color: #1e40af;
}
.status-completed {
  background: #d1fae5;
  color: #065f46;
}
.status-failed {
  background: #fee2e2;
  color: #991b1b;
}
.status-cancelled {
  background: #fef3c7;
  color: #92400e;
}
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.role-admin {
  background: #ede9fe;
  color: #5b21b6;
}
.role-user {
  background: #e0e7ff;
  color: #3730a3;
}

/* Become User button */
.btn-become {
  background: #7c3aed;
  color: #fff;
}
.btn-become:hover {
  background: #6d28d9;
}

/* Become User modal */
.become-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.become-modal {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.become-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.become-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: #1e293b;
}
.become-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.become-modal-close:hover {
  color: #475569;
}
.become-modal-desc {
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.become-modal-field {
  margin-bottom: 1.25rem;
}
.become-modal-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.375rem;
}
.become-modal-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.become-modal-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.become-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Impersonation banner */
.impersonation-banner {
  background: #7c3aed;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  z-index: 100;
}
.impersonation-return-btn {
  background: #fff;
  color: #7c3aed;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.impersonation-return-btn:hover {
  background: #ede9fe;
}

/* Cards */
.chart-card, .data-table-card, .form-card, .import-details {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
.chart-card.compact {
  padding: 0.75rem 1rem;
  margin-bottom: 0;
}
.chart-card h3, .data-table-card h3 {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}
.chart-wrapper {
  position: relative;
  height: 260px;
}

/* Timeline Selector */
.timeline-selector {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.timeline-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  text-decoration: none;
  transition: all 0.15s;
}
.timeline-btn:hover {
  background: #e2e8f0;
  color: #334155;
  text-decoration: none;
}
.timeline-btn.active {
  background: #6ABF4B;
  color: #fff;
}

/* Market Report Cards */
.market-reports {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.market-report-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex: 1 1 0;
  min-width: 0;
  max-width: 380px;
  container-type: inline-size;
  cursor: grab;
  transition: box-shadow 0.2s, opacity 0.2s;
}
.market-report-card:active {
  cursor: grabbing;
}
.market-report-card.dragging {
  opacity: 0.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.market-report-card.drop-before {
  box-shadow: -4px 0 0 0 #6ABF4B, 0 1px 3px rgba(0, 0, 0, 0.08);
}
.market-report-card.drop-after {
  box-shadow: 4px 0 0 0 #6ABF4B, 0 1px 3px rgba(0, 0, 0, 0.08);
}
.report-header {
  margin-bottom: 0.75rem;
}
.report-header-top {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}
.report-geo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.report-geo-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
  min-width: 0;
}
.report-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
}
.report-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}
/* Classification badges row */
.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}
.report-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.375rem;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.report-badge-label {
  font-weight: 500;
  opacity: 0.65;
  margin-right: 0.125rem;
}
.report-market-sellers {
  background: #fef2f2;
  color: #dc2626;
}
.report-market-balanced {
  background: #fffbeb;
  color: #d97706;
}
.report-market-buyers {
  background: #f0fdf4;
  color: #16a34a;
}
.report-market-na {
  background: #f8fafc;
  color: #94a3b8;
}
.report-distress-low {
  background: #fef2f2;
  color: #dc2626;
}
.report-distress-moderate {
  background: #fffbeb;
  color: #d97706;
}
.report-distress-high {
  background: #f0fdf4;
  color: #16a34a;
}
.report-investor-low {
  background: #eff6ff;
  color: #2563eb;
}
.report-investor-moderate {
  background: #fffbeb;
  color: #d97706;
}
.report-investor-high {
  background: #f0fdf4;
  color: #16a34a;
}
.report-cashflow-low {
  background: #fef2f2;
  color: #dc2626;
}
.report-cashflow-moderate {
  background: #fffbeb;
  color: #d97706;
}
.report-cashflow-high {
  background: #f0fdf4;
  color: #16a34a;
}
.report-true-rank-hyper_competitive {
  background: #fef2f2;
  color: #dc2626;
}
.report-true-rank-competitive {
  background: #fff7ed;
  color: #ea580c;
}
.report-true-rank-sweet_spot {
  background: #f0fdf4;
  color: #16a34a;
}
.report-true-rank-over_supply {
  background: #fffbeb;
  color: #d97706;
}
.report-true-rank-hyper_over_supply {
  background: #eff6ff;
  color: #2563eb;
}

/* Explore page */
.explore-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.explore-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.explore-parent-row {
  background: #f0fdf4;
  font-weight: 600;
}
.explore-parent-row td {
  border-bottom: 2px solid #6ABF4B;
}
.explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.explore-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.explore-filter-input {
  padding: 0.4rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  min-width: 220px;
  outline: none;
  transition: border-color 0.15s;
}
.explore-filter-input:focus {
  border-color: #6ABF4B;
  box-shadow: 0 0 0 2px rgba(106,191,75,0.15);
}
.explore-filter-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  background: #fff;
  outline: none;
  cursor: pointer;
}
.explore-filter-select:focus {
  border-color: #6ABF4B;
}
.explore-selection-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hero stat: prominent median price */
.report-hero {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  margin-bottom: 0.125rem;
}
.report-hero-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.report-hero-label {
  font-size: 0.625rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* P25-P75 price range bar */
.report-price-range {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.125rem;
}
.report-range-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #cbd5e1, #94a3b8, #cbd5e1);
  border-radius: 1px;
}
.report-range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.5625rem;
  color: #94a3b8;
  margin-bottom: 0.625rem;
}

/* Secondary hero (rent) - slightly smaller than sale price hero */
.report-hero-secondary {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}
.report-hero-secondary .report-hero-value {
  font-size: 1.1rem;
}

/* Rent range bar — teal accent to distinguish from sale price */
.report-range-bar-rent {
  background: linear-gradient(90deg, #99f6e4, #2dd4bf, #99f6e4);
}

/* Gross Rent Yield row */
.report-yield-row {
  margin-top: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: #f0fdf4;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.report-yield-label {
  font-size: 0.5625rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: block;
}
.report-yield-values {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}
.report-yield-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #16a34a;
  line-height: 1.2;
}
.report-yield-item small {
  font-size: 0.5625rem;
  font-weight: 400;
  color: #94a3b8;
  text-transform: uppercase;
}
.report-yield-primary {
  font-size: 0.9375rem;
  font-weight: 700;
}

/* Compact stat grid */
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
  margin-bottom: 0.25rem;
}
.report-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}
.report-grid-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}
.report-grid-label {
  font-size: 0.5625rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Trend indicators */
.trend-indicator {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-left: 0.25rem;
  white-space: nowrap;
}
.trend-up {
  color: #16a34a;
}
.trend-down {
  color: #dc2626;
}
.trend-neutral {
  color: #6b7280;
}

.report-as-of {
  font-size: 0.625rem;
  color: #94a3b8;
  margin: 0.5rem 0 0;
  text-align: right;
}
/* Child geographies (MSA → Cities, City → Zips) */
.report-children {
  margin-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.5rem;
}
.report-children-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  padding: 0.25rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.report-children-toggle::-webkit-details-marker {
  display: none;
}
.report-children-toggle::before {
  content: "\25B6";
  font-size: 0.5rem;
  transition: transform 0.15s;
}
details[open] > .report-children-toggle::before {
  transform: rotate(90deg);
}
.report-children-sort {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.375rem;
  padding-bottom: 0.25rem;
}
.report-sort-label {
  font-size: 0.5625rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-right: 0.125rem;
}
.report-sort-btn {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.1s;
}
.report-sort-btn:hover {
  border-color: #cbd5e1;
  color: #334155;
}
.report-sort-btn.active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}
.report-children-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 0.375rem;
}
.report-child-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 0.375rem;
}
.report-child-row:last-child {
  border-bottom: none;
}
.report-child-name {
  font-size: 0.6875rem;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.report-child-pop {
  color: #94a3b8;
  font-size: 0.625rem;
  margin-left: 0.25rem;
  white-space: nowrap;
}
.report-child-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.report-child-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  flex-shrink: 0;
  text-align: center;
  min-width: 1.5rem;
}
.report-child-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.report-child-add:hover {
  background: #6ABF4B;
  border-color: #6ABF4B;
  color: #fff;
}
.report-child-added {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #059669;
  font-size: 0.6875rem;
  flex-shrink: 0;
}
/* When cards get narrow (4-5 cards side-by-side), wrap child rows to 2 lines:
   Row 1: name + population, Row 2: badges + add button */
@container (max-width: 280px) {
  .report-child-row {
    flex-wrap: wrap;
  }
  .report-child-name {
    flex: 0 0 100%;
  }
}
@media (max-width: 768px) {
  .market-reports {
    flex-direction: column;
  }
  .market-report-card {
    max-width: 100%;
  }
  .report-header {
    min-height: auto;
  }
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-wrapper {
    height: 220px;
  }
}

/* Dashboard */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Centered search hero (no data state) */
.search-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
}
.search-hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}
.search-hero-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.75rem;
  text-align: center;
}
.search-box-centered {
  max-width: 500px;
  width: 100%;
}
.search-box-centered .search-input-wrapper {
  display: flex;
}
.search-box-centered input {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}
.search-box-centered .search-btn {
  font-size: 1rem !important;
  padding: 0.75rem 1.25rem !important;
}

/* Selected Geographies */
.selected-geographies {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}
.geo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.geo-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}
.geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  background: #f8fafc;
  border: 2px solid;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s, background 0.2s;
  max-width: 220px;
}
.geo-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.geo-chip:hover {
  background: #f1f5f9;
}
.geo-chip-inactive {
  opacity: 0.35;
  background: #f3f4f6;
}
.geo-chip-inactive:hover {
  opacity: 0.5;
}
.geo-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.geo-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  padding: 0 0.125rem;
}
.geo-chip-remove:hover {
  color: #dc2626;
}
.geo-chip-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.25rem 0.375rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.geo-chip-clear:hover {
  color: #dc2626;
  background: #fef2f2;
}
.geo-chip-limit {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}
/* Max geography toast notification */
.max-geo-notice {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1e293b;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}
.max-geo-notice.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.table-geo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.375rem;
}
.already-selected {
  opacity: 0.5;
}
.already-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  color: #94a3b8;
}

/* Search */
.search-section {
  margin-bottom: 0;
}
.search-box {
  position: relative;
  min-width: 280px;
  max-width: 420px;
}
.search-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.125rem;
  color: #374151;
}
.search-input-wrapper {
  display: flex;
  gap: 0;
}
.search-box input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px 0 0 8px;
  font-size: 0.8125rem;
  transition: border-color 0.15s;
}
.search-box input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
  z-index: 1;
}
.search-btn {
  border-radius: 0 8px 8px 0 !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.8125rem !important;
  white-space: nowrap;
  border: 2px solid #6ABF4B;
  margin-left: -2px;
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 2px;
}
.search-group-header {
  padding: 0.375rem 0.875rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
}
.search-result-item {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-result-item:hover,
.search-result-item.highlighted {
  background: #f0fdf0;
}
.search-result-item:last-child {
  border-bottom: none;
}
.geo-type-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #e0e7ff;
  color: #3730a3;
  flex-shrink: 0;
  min-width: 2.25rem;
  text-align: center;
}
.geo-type-msa {
  background: #ede9fe;
  color: #5b21b6;
}
.geo-type-city {
  background: #dbeafe;
  color: #1e40af;
}
.geo-type-county {
  background: #fef3c7;
  color: #92400e;
}
.geo-type-zip {
  background: #d1fae5;
  color: #065f46;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
}
.form-control {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
}
.form-control:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 2px rgba(106, 191, 75, 0.15);
}
.form-hint {
  display: block;
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.75rem;
}
.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}
.form-errors {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #991b1b;
}
.form-errors ul {
  margin: 0.5rem 0 0 1.25rem;
}

/* CSV Instructions */
.csv-instructions {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.csv-instructions h3 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.csv-instructions p {
  font-size: 0.8125rem;
  color: #374151;
  margin-bottom: 0.25rem;
}
.csv-instructions code {
  display: block;
  background: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* Import Details */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
}
.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* Progress Bar */
.progress-section {
  margin-bottom: 1.5rem;
}
.progress-section h3 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.progress-bar-container {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar {
  height: 100%;
  background: #6ABF4B;
  border-radius: 9999px;
  transition: width 0.3s;
}
.progress-section p {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Error Log */
.error-section h3 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.error-log {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.refresh-hint {
  font-size: 0.8125rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 1rem;
}

/* Import Monitor */
.import-monitor {
  margin-top: 1.5rem;
}
.import-monitor h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.progress-bar-lg {
  height: 1rem;
  margin-bottom: 1rem;
}
.progress-bar-animated {
  background: linear-gradient(90deg, #6ABF4B 0%, #4ade80 50%, #6ABF4B 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.import-monitor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 0.75rem;
}
.monitor-stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.monitor-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.monitor-stat-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

/* Rebuild Status Card (index page) */
.rebuild-status-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

/* Geography export links */
.geo-export-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
}
.geo-export-label {
  color: #475569;
  font-weight: 500;
}
.geo-export-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.geo-export-link:hover { text-decoration: underline; }

/* Mapping-page: unreadable file banner */
.mapping-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #7f1d1d;
}
.mapping-error-banner strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}
.mapping-error-banner p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: #7f1d1d;
  line-height: 1.5;
}
.mapping-error-hint {
  color: #991b1b !important;
}
.mapping-error-raw {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.mapping-error-raw summary {
  cursor: pointer;
  color: #991b1b;
}
.mapping-error-raw pre {
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.4rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: #0f172a;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Import-from-URL form */
.url-import-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.url-import-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.url-import-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  white-space: nowrap;
}
.url-import-input {
  flex: 1 1 320px;
  min-width: 240px;
  padding: 0.5rem 0.7rem;
  font-size: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.url-import-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.url-import-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.75rem 0 0;
  line-height: 1.5;
}

/* FreedomSoft Data Request tracking */
.data-request-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
}
.data-request-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
  padding-top: 0.1rem;
}
.data-request-banner-title {
  font-size: 1rem;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 0.25rem;
}
.data-request-banner-meta {
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.5;
}
.data-request-banner-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.data-request-banner-actions form {
  margin: 0;
}
.request-actions {
  white-space: nowrap;
}
.request-actions form {
  display: inline-block;
  margin: 0 0.25rem 0 0;
}
.request-raw-details { display: block; margin-top: 0.5rem; }
.request-raw-details summary { cursor: pointer; color: #0066ff; font-size: 0.75rem; user-select: none; }
.request-raw-body { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 4px; margin-top: 0.4rem; max-width: 600px; max-height: 500px; overflow: auto; }
.request-raw-body strong { display: block; margin-top: 0.5rem; margin-bottom: 0.2rem; color: #cbd5e1; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.request-raw-body strong:first-child { margin-top: 0; }
.request-raw-body code, .request-raw-body pre { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; color: #e2e8f0; }
.request-raw-body pre { background: #1e293b; padding: 0.5rem; border-radius: 3px; margin: 0; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.data-request-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.data-request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.data-request-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}
.data-request-count {
  font-size: 0.75rem;
  color: #64748b;
}
.data-request-empty {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  padding: 0.75rem 0;
}
.data-request-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-request-table th,
.data-request-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.data-request-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.request-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.request-status-pending {
  background: #f1f5f9;
  color: #475569;
}
.request-status-sent {
  background: #fef3c7;
  color: #92400e;
}
.request-status-received {
  background: #dcfce7;
  color: #166534;
}
.request-status-failed {
  background: #fee2e2;
  color: #991b1b;
}
.request-substatus {
  font-size: 0.7rem;
  color: #92400e;
  margin-top: 0.35rem;
}
.request-meta {
  font-size: 0.75rem;
  color: #64748b;
}
.request-error {
  color: #991b1b;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.4;
}
.request-import-link {
  color: #2563eb;
  text-decoration: none;
}
.request-import-link:hover { text-decoration: underline; }
.rebuild-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.rebuild-status-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}
.rebuild-status-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-bottom: 0.75rem;
}
.rebuild-status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

/* Upload Progress */
.upload-progress-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.upload-progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}
.upload-progress-details {
  font-size: 0.8125rem;
  color: #64748b;
}
.upload-file-meta {
  display: block;
  font-size: 0.8125rem;
  color: #475569;
  font-weight: 500;
  margin-top: 0.375rem;
}
.upload-status {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}
.upload-status-active {
  color: #0369a1;
  font-weight: 500;
}
.upload-status-success {
  color: #15803d;
  font-weight: 500;
}
.upload-status-error {
  color: #dc2626;
  font-weight: 500;
}

/* Active Import Banner */
.import-active-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdfa 100%);
  border-bottom: 2px solid #6ABF4B;
  font-size: 0.8125rem;
}
.import-active-banner-icon {
  font-size: 1.125rem;
  animation: spin-slow 3s linear infinite;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.import-active-banner-text {
  flex: 1;
  color: #334155;
}
.import-active-banner-link {
  flex-shrink: 0;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #fff;
  transition: background 0.15s;
}
.import-active-banner-link:hover {
  background: #dcfce7;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

/* Admin Page */
.admin-page h1 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}
.user-actions form {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Column Mapping */
.mapping-subtitle {
  margin-bottom: 1.5rem;
  color: #374151;
  font-size: 0.875rem;
}
.mapping-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #e2e8f0;
}
.mapping-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.mapping-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .mapping-row {
    grid-template-columns: 1fr;
  }
}
.mapping-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}
.mapping-select {
  max-width: 100% !important;
}
.mapping-match {
  font-size: 0.6875rem;
  color: #059669;
  font-weight: 500;
  white-space: nowrap;
}
.required-star {
  color: #dc2626;
}
.mapping-preview {
  margin-top: 1.5rem;
}

/* Auth pages (login, forgot password, reset password) */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 2.5rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #f0fdf4;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: #64748b;
}

.auth-flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.auth-flash p { margin: 0; }
.auth-flash p + p { margin-top: 0.25rem; }

.auth-flash-notice {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-flash-alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot-link {
  font-size: 0.8rem;
  color: #6ABF4B;
  font-weight: 500;
}

.auth-forgot-link:hover {
  color: #59a83e;
  text-decoration: underline;
}

.auth-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  color: #1f2937;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.auth-input::placeholder {
  color: #9ca3af;
}

.auth-input:focus {
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
  background: #fff;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #6ABF4B;
  cursor: pointer;
}

.auth-remember-label {
  font-size: 0.85rem;
  color: #4b5563;
  cursor: pointer;
}

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: #6ABF4B;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.25rem;
}

.auth-btn:hover {
  background: #59a83e;
}

.auth-btn:active {
  transform: scale(0.99);
}

.auth-instructions {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.auth-back-link {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.auth-back-link a {
  font-size: 0.85rem;
  color: #6ABF4B;
  font-weight: 500;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-footer p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .auth-title { font-size: 1.3rem; }
}

/* Market Finder */
.mf-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.mf-header-left {
  flex: 1;
  min-width: 0;
}
.market-finder h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.mf-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 0;
}
.mf-header-search {
  flex-shrink: 0;
}
.mf-search-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
}
@media (max-width: 768px) {
  .mf-header {
    flex-direction: column;
    align-items: stretch;
  }
  .mf-header-search .search-box {
    max-width: 100%;
  }
}
.mf-form {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
.mf-templates {
  margin-bottom: 0.75rem;
}
.mf-templates-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.mf-templates-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.mf-template-clear {
  margin-left: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.25rem 0.375rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.mf-template-clear:hover {
  color: #dc2626;
  background: #fef2f2;
}
.mf-template-wrap {
  position: relative;
}
.mf-template-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  color: #f8fafc;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
  pointer-events: none;
}
.mf-template-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}
.mf-template-wrap:hover .mf-template-tooltip {
  display: block;
}
/* Prevent first tooltip from overflowing left edge */
.mf-template-wrap:first-child .mf-template-tooltip {
  left: 0;
  transform: none;
}
.mf-template-wrap:first-child .mf-template-tooltip::after {
  left: 2rem;
}
/* Prevent last tooltip from overflowing right edge */
.mf-template-wrap:last-of-type .mf-template-tooltip {
  left: auto;
  right: 0;
  transform: none;
}
.mf-template-wrap:last-of-type .mf-template-tooltip::after {
  left: auto;
  right: 2rem;
}
.mf-template-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  border: 2px solid #d1d5db;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.mf-template-btn:hover {
  border-color: #6ABF4B;
  background-color: #f0fdf4;
  box-shadow: 0 1px 4px rgba(106, 191, 75, 0.15);
  color: #1e293b;
  text-decoration: none;
}
.mf-template-btn-active,
.mf-template-btn-active:hover {
  border-color: #6ABF4B;
  background-color: #6ABF4B;
  color: #fff;
  box-shadow: 0 1px 4px rgba(106, 191, 75, 0.3);
}
.mf-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mf-top-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
}
.mf-top-row .mf-section-scope {
  padding-top: 0;
  padding-right: 1.25rem;
  border-right: 1px solid #e5e7eb;
}
.mf-top-row .mf-section-rankby {
  padding-top: 0;
  padding-left: 1.25rem;
  flex: 1;
  min-width: 0;
}
.mf-section {
  padding: 0.625rem 0;
}
.mf-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}
.mf-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
/* Highlight the active movement dropdown */
.mf-movement-select.active {
  border-color: #6ABF4B;
  background: #f0fdf0;
}
.mf-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 1;
  min-width: 0;
}
.mf-field label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.mf-select {
  padding: 0.5rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  background: #fff;
  cursor: pointer;
  min-width: 100px;
  width: 100%;
}
.mf-select:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.mf-multiselect {
  position: relative;
}
.mf-multiselect-toggle {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1.75rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}
.mf-multiselect-toggle.has-selections {
  border-color: #6ABF4B;
  background-color: #f0fdf4;
}
.mf-multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  margin-top: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 160px;
}
.mf-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  color: #1e293b;
  transition: background-color 0.1s;
}
.mf-multiselect-option:hover {
  background-color: #f1f5f9;
}
.mf-multiselect-option input[type="checkbox"] {
  accent-color: #6ABF4B;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.mf-input {
  padding: 0.5rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  background: #fff;
  min-width: 80px;
  width: 100%;
}
.mf-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.mf-input::-webkit-outer-spin-button,
.mf-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.mf-input[type=number] {
  -moz-appearance: textfield;
}
.mf-population {
  color: #64748b;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.mf-separator {
  align-self: flex-end;
  padding-bottom: 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mf-field-submit {
  margin-left: auto;
}
.mf-btn {
  padding: 0.5rem 1.5rem !important;
  font-size: 0.875rem !important;
  white-space: nowrap;
}
/* Market Finder Alert Banner */
.mf-alerts-banner {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid #6ABF4B;
  margin-bottom: 1rem;
  overflow: hidden;
}
.mf-alerts-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #fafff8;
  border-bottom: 1px solid #ecfccb;
}
.mf-alerts-banner-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #166534;
}
.mf-alerts-banner-count {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}
.mf-alerts-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mf-alerts-dismiss-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
}
.mf-alerts-dismiss-btn:hover {
  color: #374151;
  text-decoration: underline;
}
.mf-alerts-view-all {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6ABF4B;
  text-decoration: none;
}
.mf-alerts-view-all:hover {
  text-decoration: underline;
}
.mf-alerts-banner-list {
  padding: 0;
}
.mf-alerts-banner-item {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.mf-alerts-banner-item:last-child {
  border-bottom: none;
}
.mf-alerts-banner-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.125rem;
}
.mf-alerts-banner-alert-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}
.mf-alerts-banner-time {
  font-size: 0.625rem;
  color: #94a3b8;
}
.mf-alerts-banner-summary {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mf-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.mf-results-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}
.mf-results-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mf-selection-count {
  font-size: 0.75rem;
  color: #6ABF4B;
  font-weight: 600;
  white-space: nowrap;
}
.mf-table {
  table-layout: auto;
  min-width: 1100px;
}
.mf-table .mf-check {
  width: 2rem;
  text-align: center;
  padding: 0.375rem 0.25rem;
}
.mf-table th,
.mf-table td {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.mf-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #6ABF4B;
}
.mf-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.mf-table .mf-rank {
  width: 2rem;
  text-align: center;
  font-weight: 700;
  color: #6ABF4B;
}
.mf-table .mf-market {
  font-weight: 500;
  min-width: 180px;
}
.mf-table .mf-population {
  min-width: 80px;
}
.report-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: calc(10px + 0.375rem);
}
.report-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.6rem;
  font-weight: 600;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.report-action-btn:hover {
  background: #334155;
  color: #fff;
}
.report-action-btn svg { flex-shrink: 0; }
.report-validate-btn {
  background: #dbeafe;
  color: #2563eb;
}
.report-validate-btn:hover {
  background: #2563eb;
  color: #fff;
}
@container (max-width: 260px) {
  .report-action-label { display: none; }
  .report-action-btn { padding: 0.2rem 0.3rem; gap: 0; }
}
.mf-type-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.15rem 0.375rem;
  border-radius: 999px;
  white-space: nowrap;
}
.mf-type-sellers { background: #fef2f2; color: #dc2626; }
.mf-type-balanced { background: #fffbeb; color: #d97706; }
.mf-type-buyers { background: #f0fdf4; color: #16a34a; }
.mf-type-na { background: #f8fafc; color: #94a3b8; }
.mf-distress-low { background: #fef2f2; color: #dc2626; }
.mf-distress-moderate { background: #fffbeb; color: #d97706; }
.mf-distress-high { background: #f0fdf4; color: #16a34a; }
.mf-investor-low { background: #f0fdf4; color: #16a34a; }
.mf-investor-moderate { background: #fffbeb; color: #d97706; }
.mf-investor-high { background: #eff6ff; color: #2563eb; }
.mf-rent-low { background: #fef2f2; color: #dc2626; }
.mf-rent-moderate { background: #fffbeb; color: #d97706; }
.mf-rent-high { background: #f0fdf4; color: #16a34a; }
.mf-true-rank-hyper_competitive { background: #fef2f2; color: #dc2626; }
.mf-true-rank-competitive { background: #fff7ed; color: #ea580c; }
.mf-true-rank-sweet_spot { background: #f0fdf4; color: #16a34a; }
.mf-true-rank-over_supply { background: #fffbeb; color: #d97706; }
.mf-true-rank-hyper_over_supply { background: #eff6ff; color: #2563eb; }
.mf-confidence-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.mf-confidence-high { background: #f0fdf4; color: #16a34a; }
.mf-confidence-moderate { background: #eff6ff; color: #2563eb; }
.mf-confidence-low { background: #fefce8; color: #ca8a04; }
/* Non-conforming row: metric direction doesn't match Rank By selection */
.mf-row-nonconforming {
  background: #fffbeb;
}
.mf-nonconforming-flag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.8125rem;
  color: #d97706;
  cursor: help;
  vertical-align: middle;
}
.mf-section-divider td {
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border-top: 2px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
.mf-divider-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
@media (max-width: 768px) {
  .mf-top-row {
    flex-direction: column;
  }
  .mf-top-row .mf-section-scope {
    padding-right: 0;
    border-right: none;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #e5e7eb;
  }
  .mf-top-row .mf-section-rankby {
    padding-left: 0;
  }
  .mf-controls-row {
    flex-direction: column;
  }
  .mf-separator {
    display: none;
  }
  .mf-field-submit {
    margin-left: 0;
    width: 100%;
  }
  .mf-btn {
    width: 100%;
  }
  .mf-select {
    min-width: unset;
    width: 100%;
  }
  .mf-input {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }
}

/* Population Summary */
.pop-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.pop-summary-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pop-summary-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}
.pop-summary-label {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-right: 0.5rem;
}

/* Population matching */
.match-summary {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.match-stat {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.match-stat-good { background: #d1fae5; color: #065f46; }
.match-stat-warn { background: #fef3c7; color: #92400e; }
.match-stat-info { background: #e0e7ff; color: #3730a3; }

.match-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.match-exact { background: #d1fae5; color: #065f46; }
.match-normalized { background: #dbeafe; color: #1e40af; }
.match-fuzzy { background: #fef3c7; color: #92400e; }
.match-none { background: #fee2e2; color: #991b1b; }

.match-row-exact td { background: #f0fdf4; }
.match-row-normalized td { background: #eff6ff; }
.match-row-fuzzy td { background: #fffbeb; }
.match-row-none td { background: #fef2f2; }

.match-confirmed {
  font-size: 0.8125rem;
  color: #065f46;
  font-weight: 500;
}
.match-asis {
  font-size: 0.8125rem;
  color: #6b7280;
}
.match-select {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  min-width: 200px;
  max-width: 100%;
}

/* Population filter tabs */
.pop-filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #e5e7eb;
}
.pop-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.pop-filter-tab:hover {
  color: #1f2937;
  text-decoration: none;
}
.pop-filter-tab.active {
  color: #6ABF4B;
  border-bottom-color: #6ABF4B;
}
.pop-filter-count {
  font-size: 0.75rem;
  background: #e5e7eb;
  color: #374151;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}
.pop-filter-tab.active .pop-filter-count {
  background: #dcfce7;
  color: #166534;
}

/* Application Settings */
.settings-form {
  max-width: 600px;
}
.settings-section {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
.settings-section h2 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.settings-hint {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 1rem;
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.logo-preview-image {
  flex-shrink: 0;
  background: #1e293b;
  padding: 0.5rem;
  border-radius: 6px;
}
.logo-preview-image img {
  height: 40px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}
.logo-filename {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
}
.logo-filesize {
  font-size: 0.75rem;
  color: #6b7280;
}
.logo-remove {
  margin-left: auto;
  font-size: 0.8125rem;
  color: #dc2626;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-control-file {
  font-size: 0.875rem;
}
.form-actions {
  padding-top: 0.5rem;
}

/* My Markets */
.my-markets {
}
.my-markets-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.my-markets-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.my-markets-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
}
.my-markets-btn-icon {
  font-weight: 700;
  font-size: 1.05em;
  margin-right: 0.125rem;
}
.my-markets-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.my-markets-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.my-markets-stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #6ABF4B;
}
.my-markets-stat-label {
  font-size: 0.8125rem;
  color: #6b7280;
}
.my-markets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.saved-search-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.15s, transform 0.15s;
  border-left: 3px solid #e2e8f0;
}
.saved-search-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
  border-left-color: #6ABF4B;
}
.saved-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f0fdf0;
  color: #6ABF4B;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.saved-search-main {
  flex: 1;
  min-width: 0;
}
.saved-search-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  display: inline-block;
}
.saved-search-name:hover {
  color: #6ABF4B;
  text-decoration: none;
}
.saved-search-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #94a3b8;
}
.saved-search-meta::before {
  display: none;
}
.saved-search-count {
  font-weight: 600;
  color: #6ABF4B;
  background: #f0fdf0;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
}
.saved-search-geos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.625rem;
}
.saved-search-geo-tag {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
  transition: background 0.15s;
}
.saved-search-geo-msa {
  background: #ede9fe;
  color: #5b21b6;
}
.saved-search-geo-city {
  background: #dbeafe;
  color: #1e40af;
}
.saved-search-geo-county {
  background: #fef3c7;
  color: #92400e;
}
.saved-search-geo-zip {
  background: #d1fae5;
  color: #065f46;
}
.saved-search-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.25rem;
}
.saved-search-delete {
  background: none;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.saved-search-delete:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}
.saved-search-unavailable {
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: default;
  font-size: 0.75rem;
}
/* Empty State */
.my-markets-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.my-markets-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0fdf0 0%, #dcfce7 100%);
  color: #6ABF4B;
  margin-bottom: 1.5rem;
}
.my-markets-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}
.my-markets-empty-desc {
  font-size: 0.9375rem;
  color: #6b7280;
  max-width: 420px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}
.my-markets-empty-cta {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
}
.my-markets-empty p {
  margin-bottom: 0.5rem;
}

/* Save Search Inline Form */
.save-search-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.save-search-form {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.save-search-input {
  padding: 0.25rem 0.5rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.75rem;
  width: 180px;
  transition: border-color 0.15s;
}
.save-search-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.save-search-feedback {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
}
@media (max-width: 768px) {
  .my-markets-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  .my-markets-summary {
    flex-direction: column;
    gap: 0.5rem;
  }
  .saved-search-card {
    flex-direction: column;
    padding: 1rem;
  }
  .saved-search-icon {
    display: none;
  }
  .saved-search-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .save-search-inline {
    flex-wrap: wrap;
  }
  .my-markets-empty {
    padding: 3rem 1.5rem;
  }
}

/* =============================================
   ALERTS
   ============================================= */

/* Alerts Page */
.alerts-page {
}
.alerts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.alerts-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.alerts-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alerts-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alerts-btn-icon {
  font-weight: 700;
  font-size: 1.05em;
  margin-right: 0.125rem;
}
.alerts-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  margin-left: 0.375rem;
}

/* Alerts Summary */
.alerts-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.alerts-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.alerts-stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}
.alerts-stat-active {
  color: #6ABF4B;
}
.alerts-stat-label {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Alert Card */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.alert-card-wrapper {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid #6ABF4B;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.alert-card-wrapper:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.alert-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.alert-card-wrapper:has(.alert-card-disabled) {
  border-left-color: #d1d5db;
  opacity: 0.7;
}
.alert-card-wrapper:has(.alert-card-disabled):hover {
  opacity: 0.85;
}
.alert-card-status {
  flex-shrink: 0;
  padding-top: 0.125rem;
}
.alert-card-main {
  flex: 1;
  min-width: 0;
}
.alert-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.alert-card-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}
.alert-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
}
.alert-meta-unread {
  color: #dc2626;
  font-weight: 600;
  background: #fef2f2;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
}
.alert-meta-item {
}
.alert-meta-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.alert-meta-status-evaluating {
  color: #2563eb;
  background: #eff6ff;
}
.alert-meta-status-clear {
  color: #6b7280;
  background: #f3f4f6;
}
.alert-meta-status-failed {
  color: #dc2626;
  background: #fef2f2;
}
.alert-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.25rem;
}
.alert-delete-btn {
  background: none;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.alert-delete-btn:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Toggle Switch */
.alert-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.alert-toggle {
  display: inline-flex;
  align-items: center;
  width: 2.5rem;
  height: 1.375rem;
  border-radius: 999px;
  padding: 0.125rem;
  transition: background 0.2s;
  position: relative;
}
.alert-toggle-on {
  background: #6ABF4B;
}
.alert-toggle-off {
  background: #d1d5db;
}
.alert-toggle-knob {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.alert-toggle-on .alert-toggle-knob {
  transform: translateX(1.125rem);
}

/* Logic Badge */
.alert-logic-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.alert-logic-all {
  background: #dbeafe;
  color: #1e40af;
}
.alert-logic-any {
  background: #fef3c7;
  color: #92400e;
}

/* Condition Pills (in card preview) */
.alert-conditions-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}
.alert-condition-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.75rem;
}
.condition-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.condition-type-price_change {
  background: #dcfce7;
  color: #166534;
}
.condition-type-inventory_change {
  background: #dbeafe;
  color: #1e40af;
}
.condition-pill-text {
  color: #374151;
}
.condition-pill-scope {
  color: #94a3b8;
  font-size: 0.6875rem;
}
.condition-connector {
  font-size: 0.625rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.125rem 0.375rem;
  background: #f3f4f6;
  border-radius: 4px;
}

/* Conditions displayed inline on card */
.alert-card-conditions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.alert-card-conditions .alert-expanded-logic {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
}

/* === Alert Details Section (below card) === */
.alert-details-section {
  border-top: 1px solid #f1f5f9;
}
.alert-details-section[open] .alert-expand-chevron {
  transform: rotate(180deg);
}
.alert-details-toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  padding: 0.625rem 1.5rem;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.alert-details-toggle::-webkit-details-marker {
  display: none;
}
.alert-details-toggle:hover {
  color: #374151;
  background: #f8fafc;
}
.alert-expand-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.alert-details-body {
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.alert-expanded-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alert-expanded-logic {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.alert-expanded-conditions {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* === Alert Results by Date === */
.alert-dates-section {
  border-top: 1px solid #f1f5f9;
  padding: 0.75rem 1.5rem 1rem;
}
.alert-dates-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.alert-dates-count {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.alert-dates-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.alert-date-entry {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}
.alert-date-entry[open] {
  border-color: #d1d5db;
}
.alert-date-entry[open] .alert-expand-chevron {
  transform: rotate(180deg);
}
.alert-date-unread {
  border-color: #93c5fd;
  background: #fafbff;
}
.alert-date-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.alert-date-header::-webkit-details-marker {
  display: none;
}
.alert-date-header:hover {
  background: #f8fafc;
}
.alert-date-text {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.alert-date-badge {
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: #3b82f6;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.alert-date-summary {
  color: #6b7280;
  font-size: 0.6875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.alert-date-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  margin-left: auto;
}
.alert-date-delete-btn:hover {
  color: #dc2626;
  background: #fef2f2;
}
.alert-date-body {
  padding: 0 0.75rem 0.75rem;
}
.alert-date-no-details {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
  margin: 0;
}

/* Alert Status Text */
.alert-status-text {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Empty State */
.alerts-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.alerts-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0fdf0 0%, #dcfce7 100%);
  color: #6ABF4B;
  margin-bottom: 1.5rem;
}
.alerts-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}
.alerts-empty-desc {
  font-size: 0.9375rem;
  color: #6b7280;
  max-width: 420px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}
.alerts-empty-cta {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
}

/* =============================================
   ALERT BUILDER (New/Edit Form)
   ============================================= */
.alert-builder {
  max-width: 720px;
}
.alert-form {
}

/* Builder Sections */
.alert-builder-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}
.alert-builder-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0;
}
.alert-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #6ABF4B;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}
.alert-step-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}
.alert-builder-content {
  padding: 0.75rem 1.25rem 1.25rem;
}

/* Name Input */
.alert-name-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}
.alert-name-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}

/* Logic Selector */
.alert-logic-selector {
  display: flex;
  gap: 0.75rem;
}
.alert-logic-option {
  flex: 1;
  cursor: pointer;
}
.alert-logic-option input[type="radio"] {
  display: none;
}
.alert-logic-option-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.15s;
}
.alert-logic-option input[type="radio"]:checked + .alert-logic-option-card {
  border-color: #6ABF4B;
  background: #f0fdf0;
}
.alert-logic-option:hover .alert-logic-option-card {
  border-color: #6ABF4B;
}
.alert-logic-option-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
}
.alert-logic-option input[type="radio"]:checked + .alert-logic-option-card .alert-logic-option-badge {
  background: #6ABF4B;
  color: #fff;
}
.alert-logic-option-text {
  font-size: 0.8125rem;
  color: #374151;
}

/* Logic Section (inline, shown with 2+ conditions) */
.alert-logic-section {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #f0f4ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
}
.alert-logic-inline-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Conditions List */
.alert-conditions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Condition Card */
.alert-condition-card {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  overflow: visible;
  transition: border-color 0.15s;
}
.condition-card-header {
  border-radius: 6px 6px 0 0;
}
.alert-condition-card:hover {
  border-color: #cbd5e1;
}
.condition-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.condition-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.condition-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.condition-remove-btn:hover {
  color: #dc2626;
  background: #fef2f2;
}
.condition-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Condition Rows */
.condition-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.condition-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 5rem;
  flex-shrink: 0;
}
.condition-field {
  flex: 1;
  min-width: 0;
}
.condition-field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.condition-select {
  padding: 0.4375rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  background: #fff;
  cursor: pointer;
  max-width: 100%;
}
.condition-select:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}

/* Alert condition — checkbox groups for from_states / to_states / price_bands */
.condition-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.35rem 0;
}
.condition-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s, background 0.1s;
}
.condition-checkbox:hover {
  border-color: #94a3b8;
}
.condition-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #6ABF4B;
  cursor: pointer;
  margin: 0;
}
.condition-checkbox:has(input[type="checkbox"]:checked) {
  border-color: #6ABF4B;
  background: #f0fdf4;
  color: #14532d;
  font-weight: 500;
}
.condition-help {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}
.condition-help em {
  font-style: italic;
  color: #374151;
  font-weight: 500;
}
.condition-threshold-wrapper {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.condition-threshold-prefix {
  position: absolute;
  left: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  pointer-events: none;
}
.condition-threshold-input {
  padding: 0.4375rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  width: 8rem;
}
.condition-threshold-prefix + .condition-threshold-input,
.condition-threshold-wrapper:has(.condition-threshold-prefix) .condition-threshold-input {
  padding-left: 1.5rem;
}
.condition-threshold-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.condition-threshold-input::-webkit-outer-spin-button,
.condition-threshold-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.condition-threshold-input[type=number] {
  -moz-appearance: textfield;
}
.condition-weeks-input {
  padding: 0.4375rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.8125rem;
  width: 4.5rem;
  text-align: center;
}
.condition-weeks-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.condition-weeks-input::-webkit-outer-spin-button,
.condition-weeks-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.condition-weeks-input[type=number] {
  -moz-appearance: textfield;
}
.condition-weeks-suffix {
  font-size: 0.8125rem;
  color: #6b7280;
}
.condition-geo-select {
  min-width: 10rem;
}
.condition-geo-specific {
  flex: 1;
  min-width: 0;
}

/* Threshold suffix (% label) — positioned on the right */
.condition-threshold-suffix-label {
  position: absolute;
  right: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  pointer-events: none;
}
.condition-threshold-suffix-label + .condition-threshold-input,
.condition-threshold-wrapper:has(.condition-threshold-suffix-label) .condition-threshold-input {
  padding-right: 1.75rem;
}

/* Geography Search in Conditions */
.condition-geo-search-wrapper {
  position: relative;
  width: 100%;
  min-width: 14rem;
}
.condition-geo-search-input {
  width: 100%;
}
.condition-geo-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 0.25rem;
}
.condition-geo-result-header {
  padding: 0.375rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.condition-geo-result-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s;
}
.condition-geo-result-item:hover,
.condition-geo-result-item.highlighted {
  background: #f0fdf0;
  color: #166534;
}
.condition-geo-no-results {
  color: #94a3b8;
  cursor: default;
  font-style: italic;
}
.condition-geo-no-results:hover {
  background: transparent;
  color: #94a3b8;
}

/* Selected geo chip */
.condition-geo-selected {
  display: flex;
  align-items: center;
}
.condition-geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem 0.375rem 0.75rem;
  background: #f0fdf0;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #166534;
}
.condition-geo-chip-name {
  font-weight: 500;
}
.condition-geo-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0 0.125rem;
  border-radius: 3px;
  transition: all 0.15s;
}
.condition-geo-chip-remove:hover {
  color: #dc2626;
  background: #fef2f2;
}

/* Geography Scope Selector */
.condition-geo-scope-selector {
  margin-top: 0.625rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.condition-geo-scope-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.condition-geo-scope-options {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.condition-geo-scope-option {
  cursor: pointer;
}
.condition-geo-scope-option input[type="radio"] {
  display: none;
}
.condition-geo-scope-option-card {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 0.8125rem;
  color: #374151;
  transition: all 0.15s;
}
.condition-geo-scope-option input[type="radio"]:checked + .condition-geo-scope-option-card {
  border-color: #6ABF4B;
  background: #f0fdf0;
  color: #166534;
}
.condition-geo-scope-option-card:hover {
  border-color: #cbd5e1;
}
.condition-geo-scope-option input[type="radio"]:checked + .condition-geo-scope-option-card:hover {
  border-color: #6ABF4B;
}
.condition-geo-scope-option-text {
  font-weight: 500;
}

/* Add Condition Button */
.alert-add-condition {
  width: 100%;
  padding: 0.625rem;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #6b7280;
  transition: all 0.15s;
  background: #fff;
}
.alert-add-condition:hover {
  border-color: #6ABF4B;
  color: #6ABF4B;
  background: #f0fdf0;
}

/* Submit Actions */
.alert-builder-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.25rem;
}
.alert-submit-btn {
  padding: 0.625rem 2rem !important;
  font-size: 0.9375rem !important;
}

/* =============================================
   ALERT DETAIL (Show Page)
   ============================================= */
.alert-detail-section {
  margin-bottom: 1.5rem;
}
.alert-detail-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-detail-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Condition Detail Cards */
.alert-conditions-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.alert-condition-detail-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 600px;
}
.condition-detail-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.condition-detail-type-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.condition-detail-desc {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.25rem;
}
.condition-detail-scope {
  font-size: 0.8125rem;
  color: #6b7280;
}
.condition-detail-connector {
  display: flex;
  justify-content: center;
  padding: 0.125rem 0;
}

/* Notification Cards */
.alert-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.alert-notification-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid #e2e8f0;
}
.alert-notification-unread {
  border-left-color: #6ABF4B;
  background: #fafff8;
}
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.notification-alert-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1f2937;
}
.notification-time {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}
.notification-summary {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
}
.notification-details-toggle {
  margin-top: 0.5rem;
}
.notification-details-label {
  font-size: 0.75rem;
  color: #6ABF4B;
  cursor: pointer;
  font-weight: 500;
}
.notification-details-label:hover {
  text-decoration: underline;
}
.notification-details-body {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
}
.notification-detail-group {
  margin-bottom: 0.5rem;
}
.notification-detail-group:last-child {
  margin-bottom: 0;
}
.notification-detail-condition {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.375rem;
}
.notification-market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
}
.notification-market-name {
  color: #374151;
}
.notification-market-change {
  font-weight: 600;
  font-size: 0.75rem;
}

/* No notifications */
.alert-no-notifications {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Alert Runner - Run Now Button & Status */
.alert-card-actions-wrapper {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}
.alert-run-status-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 1.5rem;
  background: #f0fdf4;
}
.alert-run-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.alert-run-status-running {
  color: #6b7280;
}
.alert-run-status-running .alert-run-gear {
  color: #2563eb;
}
.alert-run-status-complete {
  color: #059669;
}
.alert-run-status-matched {
  color: #059669;
}
.alert-run-status-warning {
  color: #d97706;
}
.alert-run-status-error {
  color: #dc2626;
}
.alert-run-text {
  line-height: 1;
}
.alert-run-summary {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.4;
}
.alert-run-gear {
  flex-shrink: 0;
}
.alert-run-check {
  flex-shrink: 0;
}
.alert-run-timer {
  font-weight: 400;
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-left: 0.125rem;
}
.alert-run-nav-hint {
  font-size: 0.6875rem;
  color: #94a3b8;
  line-height: 1.3;
}
.alert-run-btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}
/* Detailed run results */
.alert-run-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.375rem;
  width: 100%;
}
.alert-run-cond {
  border-radius: 6px;
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.4;
}
.alert-run-cond-matched {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.alert-run-cond-clear {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.alert-run-cond-header {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.alert-run-cond-status {
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.alert-run-cond-matched .alert-run-cond-status {
  color: #059669;
}
.alert-run-cond-clear .alert-run-cond-status {
  color: #059669;
}
.alert-run-cond-desc {
  color: #374151;
}
.alert-run-cond-geos {
  margin-top: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.alert-run-geo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0;
}
.alert-run-geo-name {
  color: #1f2937;
  font-weight: 500;
}
.alert-run-geo-change {
  color: #6b7280;
  font-size: 0.6875rem;
  white-space: nowrap;
}
.alert-run-geo-more {
  color: #94a3b8;
  font-size: 0.6875rem;
  font-style: italic;
}
/* Alert results table — mirrors Market Finder selection pattern */
.alert-results-scroll {
  max-height: 360px;
  overflow-y: auto;
}
.alert-results-table-wrap {
  margin-top: 0.5rem;
}
.alert-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  flex-wrap: wrap;
}
.alert-results-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
}
.alert-results-cond-desc {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
}
.alert-results-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.alert-results-overflow {
  font-size: 0.6875rem;
  color: #94a3b8;
  font-style: italic;
  padding: 0.25rem 0;
}

/* Alert results filters (State / Parent MSA / Min population) */
.alert-results-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  flex-wrap: wrap;
}
.alert-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.alert-filter-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.alert-filter-select,
.alert-filter-input {
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #0f172a;
  min-width: 160px;
}
.alert-filter-input {
  min-width: 120px;
  font-variant-numeric: tabular-nums;
}
.alert-filter-input-wide {
  min-width: 200px;
  font-variant-numeric: normal;
}

/* Checkbox dropdown filter (native <details>-based) */
.checkbox-filter {
  position: relative;
}
.checkbox-filter-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.65rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font-size: 0.8125rem;
  color: #0f172a;
  user-select: none;
  min-width: 160px;
  justify-content: space-between;
}
.checkbox-filter-summary::-webkit-details-marker { display: none; }
.checkbox-filter[open] .checkbox-filter-summary {
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.checkbox-filter-head {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.checkbox-filter-value {
  color: #475569;
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkbox-filter-value--active {
  color: #166534;
  font-weight: 600;
}
.checkbox-filter-arrow {
  color: #94a3b8;
  transition: transform 0.15s ease;
}
.checkbox-filter[open] .checkbox-filter-arrow {
  transform: rotate(180deg);
}
.checkbox-filter-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.2);
  z-index: 50;
  padding: 0.5rem;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}
.checkbox-filter-panel-wide { min-width: 320px; }
.checkbox-filter-topbar {
  display: flex;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.checkbox-filter-search {
  flex: 1;
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  min-width: 0;
}
.checkbox-filter-search:focus {
  outline: none;
  border-color: #6ABF4B;
}
.checkbox-filter-clear {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-filter-clear:hover { background: #e2e8f0; }
.checkbox-filter-items {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.checkbox-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: #0f172a;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}
.checkbox-filter-item:hover {
  background: #f8fafc;
}
.checkbox-filter-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #6ABF4B;
  cursor: pointer;
  flex-shrink: 0;
}
.alert-filter-select:focus,
.alert-filter-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106, 191, 75, 0.15);
}
.alert-results-table {
  table-layout: auto;
  width: 100%;
}
.alert-results-table th,
.alert-results-table td {
  padding: 0.35rem 0.35rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.alert-results-table .ar-check {
  width: 2rem;
  text-align: center;
  padding: 0.3rem 0.25rem;
}
.alert-results-table .ar-rank {
  width: 2rem;
  text-align: center;
  font-weight: 700;
  color: #059669;
}
.alert-results-table .ar-market {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
  width: 100%;
}
.alert-results-table .ar-change {
  text-align: right;
  font-size: 0.6875rem;
  color: #6b7280;
  white-space: nowrap;
}
.btn-xs {
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.alert-run-cond-reason {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  line-height: 1.4;
  padding-top: 0.125rem;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spinning {
  animation: spin 1.5s linear infinite;
}
.alert-show-run-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alerts-header-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-show-last-run {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Run Now / Backtest Results */
.alert-backtest-section {
  margin-bottom: 1.5rem;
}
.alert-backtest-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.alert-backtest-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.alert-backtest-icon-found {
  background: #fef3c7;
  color: #d97706;
}
.alert-backtest-icon-monitoring {
  background: #d1fae5;
  color: #059669;
}
.alert-backtest-subtitle {
  color: #6b7280;
  font-size: 0.8125rem;
  margin: 0;
}
.alert-backtest-found {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.alert-backtest-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.alert-backtest-result-group {
  background: #fff;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  border: 1px solid #fde68a;
}
.alert-backtest-result-group .notification-detail-condition {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.5rem;
}
.alert-backtest-result-group .notification-market-row {
  padding: 0.25rem 0;
}
.alert-backtest-empty {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 2rem 2.5rem;
  text-align: center;
}
.alert-backtest-empty-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #065f46;
  margin: 0.75rem 0 0.5rem;
}
.alert-backtest-empty-text {
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0 0 0.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.alert-backtest-empty-encourage {
  color: #059669;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0;
}

/* =============================================
   NOTIFICATION DRAWER (Slide-out Panel)
   ============================================= */

/* Navbar bell button */
.navbar-bell {
  position: relative;
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.navbar-bell:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.navbar-bell-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translate(25%, -25%);
}

/* Overlay */
.notif-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.notif-drawer-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Drawer panel */
.notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #f8fafc;
  z-index: 200;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.notif-drawer--open {
  transform: translateX(0);
}
.notif-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
}
.notif-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}
.notif-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.notif-drawer-mark-read {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  padding: 0.3rem 0.625rem;
  cursor: pointer;
  transition: all 0.15s;
}
.notif-drawer-mark-read:hover {
  border-color: #6ABF4B;
  color: #166534;
  background: #f0fdf0;
}
.notif-drawer-clear-all {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  padding: 0.3rem 0.625rem;
  cursor: pointer;
  transition: all 0.15s;
}
.notif-drawer-clear-all:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: #fef2f2;
}
.notif-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.notif-drawer-close:hover {
  color: #1f2937;
  background: #f1f5f9;
}
.notif-drawer-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0.25rem 0 0;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

/* Scrollable body */
.notif-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.notif-drawer-loading {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-size: 0.875rem;
}
.notif-drawer-error {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
  font-size: 0.875rem;
}

/* Empty state */
.notif-drawer-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.notif-drawer-empty svg {
  margin-bottom: 0.75rem;
}
.notif-drawer-empty p {
  font-weight: 600;
  font-size: 1rem;
  color: #64748b;
  margin: 0 0 0.25rem;
}
.notif-drawer-empty span {
  font-size: 0.8125rem;
}

/* Footer */
.notif-drawer-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* Notification cards inside drawer */
.notif-card {
  background: #fff;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  border-left: 3px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.notif-card--unread {
  border-left-color: #6ABF4B;
  background: #fafff8;
}
.notif-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.notif-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1f2937;
}
.notif-card-time {
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
}
.notif-card-summary {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
}

/* Link to alert results from drawer card */
.notif-card-link {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6ABF4B;
  text-decoration: none;
}
.notif-card-link:hover {
  text-decoration: underline;
  color: #5aad3d;
}


/* Navbar menu button: phones only, opens the sidebar */
.navbar-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -8px 4px -8px -10px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
}

/* Responsive - Sidebar: hidden off-canvas, slides in from the menu button */
@media (max-width: 768px) {
  .navbar-menu {
    display: flex;
  }
  .sidebar,
  html.sb-collapsed .sidebar--expanded {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 260px;
    max-width: 85vw;
    overflow-y: auto;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
    box-shadow: 2px 0 12px rgba(0,0,0,0.25);
  }
  html .sidebar.sidebar--mobile-open {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar-backdrop.sidebar-backdrop--visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(15, 23, 42, 0.5);
  }
  .sidebar-link {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
  .app-main {
    width: 100%;
  }
  .navbar {
    position: sticky;
    top: 0;
  }
}

/* Responsive - Alerts */
@media (max-width: 768px) {
  .alerts-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  .alerts-summary {
    flex-direction: column;
    gap: 0.5rem;
  }
  .alert-card {
    flex-direction: column;
    padding: 1rem;
  }
  .alert-card-status {
    order: -1;
  }
  .alert-card-actions-wrapper {
    width: 100%;
    align-items: flex-end;
  }
  .alert-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .alert-details-toggle {
    padding: 0.5rem 1rem;
  }
  .alert-details-body {
    padding: 0 1rem 0.75rem;
  }
  .alert-dates-section {
    padding: 0.5rem 1rem 0.75rem;
  }
  .alert-date-header {
    flex-wrap: wrap;
  }
  .alert-date-summary {
    white-space: normal;
  }
  .alert-run-status-area {
    padding: 0.5rem 1rem;
  }
  .alert-show-run-row {
    flex-wrap: wrap;
  }
  .alert-logic-selector {
    flex-direction: column;
  }
  .condition-row {
    flex-direction: column;
    align-items: stretch;
  }
  .condition-label {
    min-width: unset;
  }
  .alert-builder-actions {
    flex-direction: column;
  }
  .alert-submit-btn {
    width: 100%;
  }
  .alerts-empty {
    padding: 3rem 1.5rem;
  }
}

/* =============================================
   PORTFOLIO TRACKER
   ============================================= */
/* ── Portfolio Page Layout ─────────────────────────────── */
.portfolio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.portfolio-header-left { flex: 1; min-width: 0; }
.portfolio-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.portfolio-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}
.pf-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Summary Cards ─────────────────────────────────────── */
.pf-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pf-summary-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pf-summary-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.pf-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}
.pf-positive { color: #16a34a; }
.pf-negative { color: #dc2626; }

/* ── Tab Navigation ────────────────────────────────────── */
.pf-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}
.pf-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.pf-tab:hover {
  color: #334155;
}
.pf-tab--active {
  color: #6ABF4B;
  border-bottom-color: #6ABF4B;
}
.pf-tab svg {
  opacity: 0.7;
}
.pf-tab--active svg {
  opacity: 1;
}
.pf-tab-panel[hidden] {
  display: none;
}

/* ── Metrics Row ───────────────────────────────────────── */
.pf-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.pf-metric-pill {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.pf-metric-pill-label {
  color: #6b7280;
  font-weight: 500;
}
.pf-metric-pill-value {
  font-weight: 700;
  color: #1f2937;
}

/* ── Charts ────────────────────────────────────────────── */
.pf-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pf-chart-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pf-chart-card--full {
  grid-column: 1 / -1;
}
.pf-chart-card--full canvas {
  height: 320px !important;
}
.pf-charts-row--full {
  grid-template-columns: 1fr;
}
.pf-chart-card--half {
  grid-column: 1 / -1;
  max-width: 500px;
}
.pf-chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}
.pf-chart-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  margin-left: 0.5rem;
}
.pf-chart-card canvas {
  width: 100% !important;
  height: 280px !important;
}

/* ── Properties Table ──────────────────────────────────── */
.pf-table-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-top: 0.5rem;
}
.pf-table-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}
.pf-table-wrapper {
  overflow-x: auto;
}
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.pf-table th {
  background: #f8fafc;
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.pf-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.pf-table tbody tr:hover {
  background: #f8fafc;
}
.pf-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pf-property-cell {
  min-width: 180px;
  max-width: 260px;
}
.pf-property-link {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  text-decoration: none;
  color: inherit;
}
.pf-property-link:hover {
  text-decoration: none;
}
.pf-property-link:hover strong {
  color: #6ABF4B;
}
.pf-property-street {
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  display: block;
}
.pf-property-location {
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
}
.pf-type-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  white-space: nowrap;
}
.pf-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}
.pf-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s;
}
.pf-action-btn:hover {
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
}
.pf-action-btn--danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* ── Empty State ───────────────────────────────────────── */
.pf-empty {
  background: #fff;
  border-radius: 8px;
  padding: 4rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pf-empty-icon {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}
.pf-empty-title {
  font-size: 1.25rem;
  color: #374151;
  margin-bottom: 0.5rem;
}
.pf-empty-text {
  color: #6b7280;
  font-size: 0.875rem;
  max-width: 400px;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── Property Detail Page ──────────────────────────────── */
.pf-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pf-detail-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pf-detail-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pf-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pf-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.pf-detail-row:last-child {
  border-bottom: none;
}
.pf-detail-row dt {
  font-size: 0.8125rem;
  color: #6b7280;
}
.pf-detail-row dd {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1f2937;
  text-align: right;
}
.pf-detail-row--highlight {
  background: #f0fdf4;
  margin: 0 -1.25rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #dcfce7;
}
.pf-detail-row--separator {
  border-top: 2px solid #e5e7eb;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}
.pf-detail-row--total {
  border-top: 2px solid #e5e7eb;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}
.pf-detail-row--total dt {
  font-weight: 700;
  color: #1f2937;
}

/* ── Market Trend Indicators ──────────────────────────── */
.pf-market-adjusted {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.125rem;
}
.pf-market-label {
  font-size: 0.625rem;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pf-market-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1f2937;
}
.pf-market-adj-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}
.pf-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  line-height: 1;
}
.pf-trend-up {
  color: #16a34a;
  background: #f0fdf4;
}
.pf-trend-down {
  color: #dc2626;
  background: #fef2f2;
}
.pf-trend-flat {
  color: #6b7280;
  background: #f3f4f6;
}
.pf-no-data {
  color: #cbd5e1;
  font-size: 0.75rem;
}
.pf-market-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.pf-market-banner--up {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.pf-market-banner--up .pf-market-banner-icon {
  color: #16a34a;
}
.pf-market-banner--down {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.pf-market-banner--down .pf-market-banner-icon {
  color: #dc2626;
}
.pf-market-banner--flat {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
}
.pf-market-banner--flat .pf-market-banner-icon {
  color: #6b7280;
}
.pf-market-banner-icon {
  flex-shrink: 0;
}
.pf-market-banner-weeks {
  color: inherit;
  opacity: 0.7;
}

/* ── Status Badges ───────────────────────────────────── */
.pf-status-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.25rem;
}
.pf-status-badge--sold {
  background: #fef3c7;
  color: #92400e;
}
.pf-status-badge--paid-off {
  background: #f0fdf4;
  color: #166534;
}

/* ── Property Form ─────────────────────────────────────── */
.pf-form {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pf-form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #991b1b;
  font-size: 0.8125rem;
}
.pf-form-errors strong {
  display: block;
  margin-bottom: 0.5rem;
}
.pf-form-errors ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}
.pf-form-errors li {
  margin-bottom: 0.25rem;
}
.pf-fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.pf-legend {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}
.pf-legend-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: #94a3b8;
}
.pf-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.pf-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.pf-field--full {
  grid-column: 1 / -1;
}
.pf-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pf-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}
.pf-input:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106,191,75,0.15);
}
.pf-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1f2937;
  background: #fff;
  width: 100%;
  cursor: pointer;
}
.pf-select:focus {
  outline: none;
  border-color: #6ABF4B;
  box-shadow: 0 0 0 3px rgba(106,191,75,0.15);
}
.pf-input-prefix {
  position: relative;
  display: flex;
  align-items: center;
}
.pf-prefix {
  position: absolute;
  left: 0.75rem;
  color: #6b7280;
  font-size: 0.875rem;
  pointer-events: none;
}
.pf-input--prefixed {
  padding-left: 1.5rem;
}
.pf-input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}
.pf-suffix {
  position: absolute;
  right: 0.75rem;
  color: #6b7280;
  font-size: 0.875rem;
  pointer-events: none;
}
.pf-input--suffixed {
  padding-right: 2rem;
}
.pf-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ── Portfolio Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .pf-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pf-detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .pf-header-actions {
    width: 100%;
  }
  .pf-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pf-charts-row {
    grid-template-columns: 1fr;
  }
  .pf-field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pf-metrics-row {
    gap: 0.375rem;
  }
  .pf-table {
    font-size: 0.75rem;
  }
  .pf-table th, .pf-table td {
    padding: 0.5rem;
  }
}
@media (max-width: 480px) {
  .pf-summary-grid {
    grid-template-columns: 1fr;
  }
  .pf-field-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   HEAT MAP
   ============================================= */
.map-page {
}
.map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.map-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.map-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
}
.map-controls {
  margin-bottom: 1rem;
}
.map-controls-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.map-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.map-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.map-field-search {
  min-width: 280px;
  max-width: 420px;
}
.map-field-search .search-box {
  max-width: 100%;
}
.map-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.25rem;
}
.map-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s;
}
.map-search-result-item:hover {
  background: #f0fdf0;
  color: #166534;
}
.map-search-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.map-search-badge-msa {
  background: #ede9fe;
  color: #5b21b6;
}
.map-search-badge-city {
  background: #dbeafe;
  color: #1e40af;
}
.map-search-no-results {
  padding: 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-style: italic;
}

/* Map container */
.map-body {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  background: #fff;
}
.map-container {
  height: 560px;
  width: 100%;
  z-index: 1;
}
/* Glow effect on heat markers */
.heat-marker {
  filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 2px currentColor);
  transition: filter 0.2s;
}
.heat-marker:hover {
  filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 20px currentColor);
}

/* Loading overlay */
.map-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.map-loading p {
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}
.map-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6ABF4B;
  border-radius: 50%;
  animation: map-spin 0.8s linear infinite;
}
@keyframes map-spin {
  to { transform: rotate(360deg); }
}
/* Progress bar for geocoding */
.map-loading-progress {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.75rem;
  width: 220px;
}
.map-loading-progress-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.map-loading-progress-fill {
  height: 100%;
  width: 0%;
  background: #6ABF4B;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.map-loading-progress-pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  min-width: 2.5rem;
  text-align: right;
}

/* Empty state overlay */
.map-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  z-index: 400;
}
.map-empty-state p {
  color: #64748b;
  font-size: 0.9375rem;
  margin-top: 1rem;
  max-width: 360px;
  text-align: center;
  line-height: 1.5;
}

/* Legend */
.map-legend {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0.5rem 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: left 240ms ease-out, transform 240ms ease-out;
}

/* When the Data Centers project slider is open on the right, hide
   the legend entirely. The user is focused on one specific
   project; the stage key below is noise, and the previous "shift
   left" didn't eliminate the overlap on every screen width. The
   legend returns the moment the slider closes. */
.map-legend.map-legend--slider-open {
  display: none !important;
}
.map-legend-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.map-legend-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.map-legend-gradient {
  width: 180px;
  height: 12px;
  border-radius: 6px;
}
.map-legend-gradient-price {
  background: linear-gradient(to right, #dc2626, #fb7143, #fef0b9, #4ade80, #059669);
}
.map-legend-gradient-inventory {
  background: linear-gradient(to right, #dc2626, #fb7143, #fef0b9, #38bdf8, #2563eb);
}
.map-legend-value {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.map-legend-tiers {
  display: flex;
  gap: 2px;
  align-items: stretch;
}
.map-legend-tier {
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-align: center;
  min-width: 70px;
}

/* Data Centers legend: stage chips double as filters */
.map-legend-tiers.dc-chips {
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.dc-chip {
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, filter 0.15s;
}
.dc-chip--off {
  opacity: 0.3;
  filter: grayscale(0.6);
  text-decoration: line-through;
}
.dc-chip-count {
  opacity: 0.85;
  font-weight: 700;
  margin-left: 2px;
}
.dc-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 0.25rem;
}
.dc-quick-btn {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.dc-quick-btn--on {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}
.dc-quick-btn--reset {
  border-style: dashed;
}
.dc-hint {
  font-size: 0.625rem;
  color: #94a3b8;
}
@media (max-width: 640px) {
  .map-legend:has(.dc-chips) {
    left: 8px;
    right: 8px;
    transform: none;
    padding: 0.5rem;
  }
  .dc-chip {
    min-width: 0;
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
  }
  .dc-quick-btn {
    padding: 0.45rem 0.75rem;
  }
}

/* Market popup — appears when a user clicks an MSA dot */
.maplibregl-popup.market-popup-wrapper .maplibregl-popup-content {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.25);
  min-width: 260px;
}
.market-popup {
  font-family: inherit;
}
.market-popup-head {
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fafafa;
}
.market-popup-tier {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.market-popup-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}
.market-popup-stats {
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.market-popup-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.market-popup-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.market-popup-stat-value {
  font-size: 0.925rem;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* Data-center project popup — wider, more readable layout for the
   Data Centers map layer. Project popups carry more content than
   market popups (address, summary, scan action) so they get their
   own class with roomier sizing and a different stat layout. */
.maplibregl-popup.gs-dc-popup-wrapper .maplibregl-popup-content {
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 36px -8px rgba(0,0,0,0.28);
  min-width: 320px;
  max-width: 420px;
}
.gs-dc-popup {
  font-family: inherit;
  color: #0f172a;
  line-height: 1.4;
}
.gs-dc-popup-head {
  padding: 1rem 1.1rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.gs-dc-popup-stage {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 3px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.gs-dc-popup-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}
.gs-dc-popup-market {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 500;
}
.gs-dc-popup-stats {
  padding: 0.75rem 1.1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.gs-dc-popup-stat {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.875rem;
}
.gs-dc-popup-stat-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gs-dc-popup-stat-value {
  color: #0f172a;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.gs-dc-popup-summary {
  margin: 0.25rem 1.1rem 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
}
.gs-dc-popup-caveat {
  margin: 0 1.1rem 0.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
}
.gs-dc-popup-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
  flex-wrap: wrap;
}
.gs-dc-popup-actions > * { flex: 1 1 auto; }
.gs-dc-popup-scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}
.gs-dc-popup-scan-btn:hover { background: #1d4ed8; }
.gs-dc-popup-market-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}
.gs-dc-popup-market-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.gs-dc-popup-form { margin: 0; display: contents; }

/* Data-center project slider — right-side slide-in panel used in
   place of a MapLibre popup for the Data Centers layer. Longer
   summaries, addresses, and action rows fit cleanly instead of
   clipping at the pin's edge. */
.gs-dc-slider {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -8px 0 24px -8px rgba(15,23,42,0.18);
  transform: translateX(100%);
  transition: transform 240ms ease-out;
  /* Above .map-legend (z-index 500) so the legend never covers the
     slider's bottom actions, even in the rare case where the
     JS-driven hide class fails to attach. */
  z-index: 600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}
.gs-dc-slider.gs-dc-slider--open {
  transform: translateX(0);
}
.gs-dc-slider-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #475569;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  z-index: 2;
}
.gs-dc-slider-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.gs-dc-slider-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0;
  color: #0f172a;
  font-family: inherit;
  line-height: 1.5;
}
.gs-dc-slider .gs-dc-popup-head {
  padding: 1.5rem 2.75rem 1rem 1.25rem;
}
.gs-dc-slider .gs-dc-popup-stats {
  padding: 1rem 1.25rem 0.75rem;
}
.gs-dc-slider .gs-dc-popup-summary {
  margin: 0.5rem 1.25rem 0.75rem;
}
.gs-dc-slider .gs-dc-popup-caveat {
  margin: 0 1.25rem 0.75rem;
}
.gs-dc-slider .gs-dc-popup-actions {
  padding: 1rem 1.25rem 1.25rem;
}
@media (max-width: 640px) {
  /* Full-width panel on narrow screens so there's room to read. */
  .gs-dc-slider { width: 100%; }
}

/* Toast — lightweight ephemeral notice (missing coords, feature-not-ready, etc.) */
.map-toast {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90%;
  text-align: center;
}
.map-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Info panel */
.map-info-panel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  z-index: 500;
  max-width: 280px;
}
.map-info-panel-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.map-info-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.5rem;
}
/* Clickable toggle stats */
.map-info-toggle {
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s;
  user-select: none;
}
.map-info-toggle:not(.active) {
  opacity: 0.35;
}
.map-info-toggle:hover {
  opacity: 1;
  border-color: #e2e8f0;
}
.map-info-toggle.active {
  opacity: 1;
  border-color: #cbd5e1;
  background: rgba(241, 245, 249, 0.6);
}
.map-info-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}
.map-info-rising {
  color: #10aa3c;
}
.map-info-dropping {
  color: #e61e32;
}
.map-info-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.map-info-divider {
  width: 1px;
  background: #e2e8f0;
  align-self: stretch;
}

/* Popup styles */
.map-popup {
  min-width: 200px;
}
.map-popup-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.375rem;
}
.map-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.125rem 0;
  font-size: 0.75rem;
}
.map-popup-label {
  color: #6b7280;
}
.map-popup-value {
  font-weight: 600;
  color: #1f2937;
}
.map-popup-positive {
  color: #10aa3c;
}
.map-popup-negative {
  color: #e61e32;
}
.map-popup-market-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.375rem;
}
.map-popup-market-sellers {
  background: #fef2f2;
  color: #991b1b;
}
.map-popup-market-balanced {
  background: #fef3c7;
  color: #92400e;
}
.map-popup-market-buyers {
  background: #dbeafe;
  color: #1e40af;
}

/* Geocode banner */
.map-geocode-banner {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #fde68a;
  text-align: center;
}
.map-geocode-banner code {
  background: rgba(0,0,0,0.08);
  padding: 0.1rem 0.375rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .map-controls-row {
    flex-direction: column;
  }
  .map-field-search {
    min-width: unset;
  }
  .map-container {
    height: 400px;
  }
  .map-info-panel {
    position: relative;
    top: auto;
    right: auto;
    max-width: 100%;
    border-radius: 0 0 10px 10px;
    box-shadow: none;
    border-top: 1px solid #e2e8f0;
  }
  .map-legend {
    bottom: 0.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   EDUCATION DRAWER
   ═══════════════════════════════════════════════════════════════════ */
.edu-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.edu-drawer-overlay--visible {
  opacity: 1;
  visibility: visible;
}
.edu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: #f8fafc;
  z-index: 200;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.edu-drawer--open {
  transform: translateX(0);
}
.edu-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
}
.edu-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}
.edu-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.edu-drawer-close:hover {
  color: #1f2937;
  background: #f1f5f9;
}
.edu-drawer-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0.25rem 0 0;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.edu-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
}
.edu-drawer-section {
  margin-bottom: 1.25rem;
}
.edu-drawer-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.625rem;
}
a.edu-drawer-link,
.edu-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: 10px;
  text-decoration: none;
  color: #1f2937;
  transition: background 0.15s;
  margin-bottom: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}
a.edu-drawer-link:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.edu-drawer-link--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.edu-drawer-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eff6ff;
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.edu-drawer-link-content {
  flex: 1;
  min-width: 0;
}
.edu-drawer-link-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.125rem;
}
.edu-drawer-link-desc {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}
.edu-drawer-link-arrow {
  color: #94a3b8;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   GUIDE PAGE
   ═══════════════════════════════════════════════════════════════════ */
.guide-page {
  max-width: 100%;
  padding: 0 0 3rem;
}
.guide-container {
  max-width: 860px;
  margin: 0 auto;
}
.guide-nav-back {
  margin-bottom: 1rem;
}
.guide-back-link {
  font-size: 0.875rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.guide-back-link:hover {
  text-decoration: underline;
}

/* Hero */
.guide-hero {
  text-align: center;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-bottom: 3px solid #059669;
  border-radius: 12px;
  color: #fff;
  margin-bottom: 2rem;
}
.guide-hero-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.375rem;
}
.guide-hero-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  opacity: 0.9;
  margin: 0 0 1rem;
}
.guide-hero-intro {
  font-size: 0.9375rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Sections */
.guide-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.guide-section--final {
  text-align: center;
}
.guide-section-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem;
}

/* Steps */
.guide-step {
  margin-bottom: 2rem;
}
.guide-step-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.guide-step-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.75rem;
}
.guide-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.5rem;
}

/* Settings grid */
.guide-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.guide-settings-grid--compact {
  gap: 0.375rem;
}
.guide-setting {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}
.guide-setting-label {
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.guide-setting-value {
  color: #1e293b;
  font-weight: 500;
}

/* Callouts */
.guide-goal {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  margin: 0.75rem 0;
}
.guide-callout {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  margin: 0.75rem 0;
}
.guide-tip {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  margin: 0.75rem 0;
}

/* Lists */
.guide-ol, .guide-ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
}
.guide-ol li, .guide-ul li {
  margin-bottom: 0.25rem;
}
.guide-h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.5rem 0 0.75rem;
}
.guide-h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #334155;
  margin: 1.25rem 0 0.5rem;
}

/* Color helpers */
.guide-up {
  color: #16a34a;
  font-weight: 600;
}
.guide-down {
  color: #dc2626;
  font-weight: 600;
}

/* Tables */
.guide-table-wrapper {
  overflow-x: auto;
  margin: 0.75rem 0;
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.guide-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}
.guide-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}
.guide-table tbody tr:hover {
  background: #f8fafc;
}

/* Interpretation blocks */
.guide-interpret-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.guide-interpret {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8125rem;
}
.guide-interpret-green {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.guide-interpret-amber {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.guide-interpret-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* Search cards */
.guide-search-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.guide-search-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.75rem;
}
.guide-search-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-search-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.guide-search-card-question {
  font-size: 0.8125rem;
  color: #64748b;
  font-style: italic;
  margin: 0.125rem 0 0;
}
.guide-search-card-result {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8125rem;
  color: #475569;
}

/* Dashboard preview */
.guide-dashboard-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.guide-preview-header {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.625rem;
}
.guide-preview-badges {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}
.guide-preview-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
}
.guide-preview-badge--green {
  background: #f0fdf4;
  color: #16a34a;
}
.guide-preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.guide-preview-stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.guide-preview-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guide-preview-stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

/* Strategy grid */
.guide-strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.guide-strategy-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
}
.guide-strategy-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.625rem;
}

/* Check and X lists */
.guide-check-list {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.guide-check-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.25rem;
}
.guide-check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}
.guide-check-list--summary {
  display: inline-block;
  text-align: left;
}
.guide-x-list {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.guide-x-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.25rem;
}
.guide-x-list li::before {
  content: "\2717";
  position: absolute;
  left: 0;
  color: #dc2626;
  font-weight: 700;
}

/* FAQ */
.guide-faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.guide-faq-q {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem;
}
.guide-faq-item p {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

/* Tips columns */
.guide-tips-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.guide-tips-do {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 1rem;
}
.guide-tips-do h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #166534;
  margin: 0 0 0.5rem;
}
.guide-tips-avoid {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 1rem;
}
.guide-tips-avoid h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 0.5rem;
}

/* Next steps grid */
.guide-next-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.guide-next-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
}
.guide-next-card h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem;
}

/* Footer nav */
.guide-footer-nav {
  text-align: center;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.guide-footer-nav p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.375rem 0;
}
.guide-footer-nav a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.guide-footer-nav a:hover {
  text-decoration: underline;
}

/* Table of contents */
.guide-toc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.guide-toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.75rem;
}
.guide-toc-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  line-height: 2;
}
.guide-toc-list a {
  color: #3b82f6;
  text-decoration: none;
}
.guide-toc-list a:hover {
  text-decoration: underline;
}

/* Scenario prices */
.guide-scenario-prices {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
}

/* Guide responsive */
@media (max-width: 768px) {
  .guide-settings-grid {
    grid-template-columns: 1fr;
  }
  .guide-strategy-grid {
    grid-template-columns: 1fr;
  }
  .guide-tips-columns {
    grid-template-columns: 1fr;
  }
  .guide-next-grid {
    grid-template-columns: 1fr;
  }
  .guide-preview-stats {
    grid-template-columns: 1fr;
  }
  .guide-hero-title {
    font-size: 1.5rem;
  }
}

/* Rental Listings Section */
.report-rent-source {
  text-align: center;
  margin-top: 0.25rem;
}
.report-rent-source small {
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
}
.report-rental-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}
.report-rental-bedrooms .report-rental-percentiles {
  font-size: 0.75rem;
  color: #475569;
  white-space: nowrap;
}
.report-rental-bedrooms .report-rental-percentiles strong {
  color: #0f172a;
}

/* =============================================
   PAGE LOADING OVERLAY
   ============================================= */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(241, 245, 249, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.page-loading-overlay.visible {
  opacity: 1;
}
.page-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 3rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.page-loading-spinner {
  animation: page-spin 1.2s linear infinite;
  color: #6ABF4B;
}
@keyframes page-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.page-loading-text {
  font-size: 1rem;
  font-weight: 500;
  color: #475569;
  letter-spacing: 0.01em;
  min-width: 180px;
  text-align: center;
}
.page-loading-text-enter {
  animation: page-loading-sweep 0.35s ease both;
}
@keyframes page-loading-sweep {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================= */
/* GridSignal                                                        */
/* ================================================================= */
/* .gs-page is a naked wrapper like .market-finder / .portfolio-page —
   it inherits width + padding from the parent .container so GridSignal
   lives in the exact same gutter as the rest of the app. */
.gs-page { }
.gs-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; gap: 1rem; }
.gs-page-header h1 { font-size: 1.75rem; margin: 0 0 0.25rem; }
.gs-subtitle { color: #64748b; margin: 0; font-size: 0.95rem; }
.gs-back-link { font-size: 0.85rem; color: #475569; text-decoration: none; display: inline-block; margin-bottom: 0.4rem; }
.gs-back-link:hover { color: #0f172a; }

.gs-explorer-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 1rem; }
.gs-filter-form label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #475569; }
.gs-filter-form select { padding: 0.3rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px; }
.gs-explorer-count { font-size: 0.875rem; color: #64748b; }

.gs-explorer-table th.num, .gs-explorer-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.gs-jurisdiction-link { font-weight: 600; color: #0f172a; text-decoration: none; }
.gs-jurisdiction-link:hover { color: #0066ff; }
.gs-row-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.1rem; }

.gs-score { font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 4px; display: inline-block; min-width: 2.5rem; }
.gs-score--low { background: #fee2e2; color: #991b1b; }
.gs-score--moderate { background: #fef3c7; color: #854d0e; }
.gs-score--high { background: #dcfce7; color: #166534; }
.gs-score--very_high { background: #bbf7d0; color: #14532d; }
.gs-score-empty { color: #94a3b8; font-style: italic; }

.gs-score-cards { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.gs-score-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; }
.gs-score-card--opportunity { background: linear-gradient(135deg, #f8fafc, #e2e8f0); border-color: #cbd5e1; }
.gs-score-card--opportunity.gs-score-card--very_high { background: linear-gradient(135deg, #bbf7d0, #86efac); border-color: #4ade80; }
.gs-score-card--opportunity.gs-score-card--high { background: linear-gradient(135deg, #dcfce7, #bbf7d0); border-color: #86efac; }
.gs-score-card--opportunity.gs-score-card--moderate { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #fcd34d; }
.gs-score-card--opportunity.gs-score-card--low { background: linear-gradient(135deg, #fee2e2, #fecaca); border-color: #fca5a5; }
.gs-score-card-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; font-weight: 600; margin-bottom: 0.5rem; }
.gs-score-card-value { font-size: 2.5rem; font-weight: 700; line-height: 1; color: #0f172a; }
.gs-score-card-footnote { font-size: 0.75rem; color: #64748b; margin-top: 0.5rem; line-height: 1.4; }

.gs-section { margin-top: 2rem; }
.gs-section h2 { font-size: 1.1rem; margin: 0 0 0.75rem; color: #0f172a; }
.gs-empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.gs-empty-state--inline { padding: 1.5rem 1rem; }
.gs-empty-inline { color: #94a3b8; font-style: italic; }

.gs-score-events { list-style: none; padding: 0; margin: 0; }
.gs-score-events li { display: grid; grid-template-columns: 1fr 1.5fr 3fr 1fr; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid #f1f5f9; align-items: center; font-size: 0.875rem; }
.gs-score-event-score { font-weight: 600; color: #0f172a; }
.gs-score-event-delta { font-variant-numeric: tabular-nums; }
.gs-score-event-delta.positive { color: #16a34a; }
.gs-score-event-delta.negative { color: #dc2626; }
.gs-score-event-reason { color: #334155; }
.gs-score-event-time { color: #94a3b8; font-size: 0.75rem; text-align: right; }

.gs-signal-list { list-style: none; padding: 0; margin: 0; }
.gs-signal { border: 1px solid #e2e8f0; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; background: #ffffff; }
.gs-signal--polarity-1 { border-left: 4px solid #16a34a; }
.gs-signal--polarity-0 { border-left: 4px solid #94a3b8; }
.gs-signal--polarity--1 { border-left: 4px solid #dc2626; }
.gs-signal-header { display: flex; gap: 1rem; font-size: 0.85rem; margin-bottom: 0.5rem; align-items: center; flex-wrap: wrap; }
.gs-signal-type { font-weight: 700; color: #0f172a; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.78rem; background: #f1f5f9; padding: 0.1rem 0.5rem; border-radius: 3px; }
.gs-signal-confidence { color: #64748b; }
.gs-signal-confidence.high { color: #16a34a; font-weight: 600; }
.gs-signal-strength, .gs-signal-date { color: #94a3b8; }
.gs-evidence { background: #f8fafc; border-left: 3px solid #cbd5e1; padding: 0.5rem 0.75rem; margin: 0.4rem 0 0; font-size: 0.875rem; color: #334155; font-style: italic; }
.gs-evidence-footer { margin-top: 0.4rem; font-size: 0.75rem; font-style: normal; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gs-evidence-footer a { color: #0066ff; text-decoration: none; }
.gs-evidence-doc { color: #475569; }
.gs-evidence-link { padding: 0.15rem 0.5rem; background: #eff6ff; border-radius: 3px; font-weight: 600; }
.gs-evidence-link:hover { background: #dbeafe; text-decoration: none; }
.gs-match-badge { font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 3px; }
.gs-match--exact { background: #dcfce7; color: #166534; }
.gs-match--ws { background: #dbeafe; color: #1e40af; }
.gs-match--loose { background: #fef3c7; color: #854d0e; }
.gs-match--none { background: #fee2e2; color: #991b1b; }
.gs-evidence-chunk { margin-top: 0.5rem; font-size: 0.75rem; font-style: normal; }
.gs-evidence-chunk summary { cursor: pointer; color: #0066ff; user-select: none; }
.gs-evidence-chunk summary:hover { color: #0052cc; }
.gs-evidence-chunk-text { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 4px; margin-top: 0.4rem; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.7rem; white-space: pre-wrap; max-height: 400px; overflow: auto; }

.gs-project-list { list-style: none; padding: 0; margin: 0; }
.gs-project { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; }
.gs-project-stage { background: #f1f5f9; padding: 0.1rem 0.4rem; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; margin: 0 0.5rem; }

@media (max-width: 900px) {
  .gs-score-cards { grid-template-columns: 1fr 1fr; }
}

/* GridSignal admin pages */
.admin-page { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
.admin-page-header { margin-bottom: 1.25rem; }
.admin-page-header h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
.admin-stat-row { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 0.75rem 1rem; display: flex; flex-direction: column; font-size: 0.8rem; color: #475569; min-width: 110px; }
.admin-stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; margin-bottom: 0.25rem; }
.admin-error-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.gs-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.gs-admin-grid section { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 1rem 1.25rem; }
.gs-admin-grid h2 { font-size: 1rem; margin: 0 0 0.75rem; }
.data-table-compact th, .data-table-compact td { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
.gs-health { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.gs-health--ok { background: #dcfce7; color: #166534; }
.gs-health--stale { background: #fef3c7; color: #854d0e; }
.gs-health--failing { background: #fee2e2; color: #991b1b; }
.gs-health--unknown { background: #f1f5f9; color: #475569; }
.gs-error-cell { color: #991b1b; font-size: 0.8rem; max-width: 260px; }
.gs-coverage-cell { font-size: 0.75rem; min-width: 180px; }

/* Admin jurisdiction health dashboard — per-row status badges */
.admin-stat--healthy .admin-stat-value { color: #166534; }
.admin-stat--attention .admin-stat-value { color: #854d0e; }
.admin-stat--broken .admin-stat-value { color: #991b1b; }
.admin-stat--idle .admin-stat-value { color: #64748b; }

.gs-health-table th { background: #f8fafc; }
.gs-health-row--broken { background: #fff1f2; }
.gs-health-row--attention { background: #fffbeb; }
.gs-health-row-sub { font-size: 0.7rem; color: #94a3b8; margin-top: 0.1rem; }

.gs-health-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.gs-health-badge--broken    { background: #fee2e2; color: #991b1b; }
.gs-health-badge--attention { background: #fef3c7; color: #854d0e; }
.gs-health-badge--healthy   { background: #dcfce7; color: #166534; }
.gs-health-badge--idle      { background: #f1f5f9; color: #64748b; }

.gs-health-action-cell { white-space: nowrap; }
.gs-health-action-cell form { display: inline-block; margin: 0 0.25rem 0 0; }
.gs-health-no-action { font-size: 0.75rem; color: #94a3b8; }
.gs-coverage-counts { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.2rem; }
.gs-coverage-counts span { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-weight: 600; white-space: nowrap; font-size: 0.7rem; }
.gs-coverage-extracted { background: #dbeafe; color: #1e40af; }
.gs-coverage-filtered { background: #f1f5f9; color: #475569; }
.gs-coverage-failed { background: #fee2e2; color: #991b1b; }
.gs-coverage-pending { background: #fef3c7; color: #854d0e; }
.gs-coverage-when { color: #94a3b8; font-size: 0.7rem; }
.gs-coverage-empty { color: #94a3b8; font-style: italic; }
.gs-signals-cell { text-align: right; font-variant-numeric: tabular-nums; }
.gs-signals-count { color: #166534; font-size: 1rem; }
.gs-signals-zero { color: #cbd5e1; }

/* Admin per-source derived status badges — user-oriented replacement
   for the raw source.health column. */
.gs-source-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.gs-source-status--live     { background: #dcfce7; color: #166534; }
.gs-source-status--running  { background: #dbeafe; color: #1e40af; }
.gs-source-status--analyzed { background: #f1f5f9; color: #475569; }
.gs-source-status--error    { background: #fee2e2; color: #991b1b; }
.gs-source-status--setup    { background: #fef3c7; color: #854d0e; }
.gs-source-status--no-data  { background: #f8fafc; color: #94a3b8; }

/* Document audit view — DocumentRelevance verdict + linked signals. */
.gs-audit-verdict {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.gs-audit-verdict--pass { background: #dcfce7; color: #14532d; }
.gs-audit-verdict--fail { background: #fef3c7; color: #854d0e; }
.gs-audit-matches { margin-top: 0.75rem; font-size: 0.85rem; }
.gs-audit-matches h4 { margin: 0 0 0.4rem; font-size: 0.85rem; color: #475569; }
.gs-audit-matches ul { margin: 0; padding-left: 1.25rem; }
.gs-audit-matches li { margin-bottom: 0.25rem; }
.gs-audit-match-code {
  display: inline-block;
  margin: 0 0.2rem 0.2rem 0;
  padding: 0.1rem 0.4rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  color: #334155;
}
.gs-audit-help { font-size: 0.8rem; color: #475569; margin: 0.5rem 0; }
.gs-audit-text-details { margin-top: 0.5rem; font-size: 0.75rem; }
.gs-audit-text-details summary { cursor: pointer; color: #0066ff; user-select: none; }
.gs-audit-signals { list-style: none; padding: 0; margin: 0; }
.gs-audit-signals li {
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-left: 3px solid #16a34a;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.gs-error-text { word-break: break-word; margin-bottom: 0.3rem; }
.gs-error-dismiss {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gs-error-dismiss:hover { background: #e2e8f0; color: #334155; }
.gs-error-cell form { display: inline; margin: 0; }
.gs-action-cell { white-space: nowrap; }
.gs-action-cell form { display: inline-block; margin: 0 0.25rem 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.gs-admin-chunk { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.gs-admin-chunk-header { font-size: 0.8rem; color: #475569; margin-bottom: 0.5rem; }
.gs-admin-chunk-flag { background: #dcfce7; color: #166534; padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.5rem; font-size: 0.7rem; font-weight: 600; }
.gs-admin-chunk-flag--relevant { background: #dcfce7; color: #166534; }
.gs-admin-chunk-flag--notrelevant { background: #fef3c7; color: #854d0e; }
.gs-admin-chunk-verdict { background: #f1f5f9; border-left: 3px solid #0066ff; padding: 0.6rem 0.8rem; margin: 0.4rem 0; font-size: 0.8rem; color: #334155; }
.gs-admin-chunk-verdict ul { margin: 0.3rem 0 0 1.25rem; padding: 0; }
.gs-admin-chunk-verdict code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; }
.gs-admin-chunk-verdict em { color: #475569; }
.gs-admin-chunk-matches { font-size: 0.75rem; color: #334155; background: #f8fafc; border-left: 3px solid #cbd5e1; padding: 0.4rem 0.6rem; margin-bottom: 0.4rem; font-family: ui-monospace, SFMono-Regular, monospace; word-break: break-word; }
.gs-admin-chunk-text { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 4px; font-size: 0.75rem; font-family: ui-monospace, SFMono-Regular, monospace; max-height: 240px; overflow: auto; white-space: pre-wrap; margin: 0; }
@media (max-width: 900px) {
  .gs-admin-grid { grid-template-columns: 1fr; }
}

/* Forecasting UI */
.gs-project-link { font-weight: 600; color: #0066ff; text-decoration: none; }
.gs-project-link:hover { text-decoration: underline; }
.gs-project-description { color: #475569; font-size: 0.95rem; line-height: 1.5; margin: -0.5rem 0 1rem; }
.gs-forecast-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.gs-forecast-meta { font-size: 0.8rem; color: #64748b; }
.gs-forecast-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.gs-forecast-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; }
.gs-forecast-card-title { font-size: 0.85rem; color: #475569; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.gs-forecast-card-value { font-size: 2rem; font-weight: 700; color: #0f172a; margin-top: 0.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.gs-forecast-card-range { font-size: 0.8rem; color: #64748b; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.gs-forecast-card-unit { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; margin-top: 0.1rem; letter-spacing: 0.05em; }
.gs-forecast-card-footnote { font-size: 0.75rem; color: #475569; line-height: 1.4; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #f1f5f9; }
.gs-forecast-card-empty { color: #94a3b8; font-style: italic; font-size: 0.875rem; }
.gs-forecast-card-details { margin-top: 0.75rem; font-size: 0.8rem; }
.gs-forecast-card-details summary { cursor: pointer; color: #0066ff; user-select: none; }
.gs-forecast-card-details summary:hover { color: #0052cc; }
.gs-forecast-card-details-body { background: #f8fafc; border-radius: 4px; padding: 0.75rem; margin-top: 0.5rem; }
.gs-forecast-formula { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; color: #0f172a; background: #ffffff; padding: 0.4rem 0.6rem; border-radius: 3px; margin-bottom: 0.5rem; overflow-x: auto; }
.gs-forecast-narrative { color: #334155; margin-bottom: 0.5rem; line-height: 1.4; }
.gs-forecast-inputs-used ul { margin: 0.3rem 0 0.5rem 1rem; padding: 0; }
.gs-forecast-inputs-used code { font-size: 0.7rem; }
.gs-forecast-card-confidence { font-size: 0.75rem; color: #64748b; margin-top: 0.5rem; }
.gs-forecast-inputs .num { text-align: right; font-variant-numeric: tabular-nums; }
.gs-input-class { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, monospace; }
.gs-input-class--observed { background: #dcfce7; color: #166534; }
.gs-input-class--estimated { background: #fef3c7; color: #854d0e; }
.gs-input-class--forecast { background: #e0e7ff; color: #3730a3; }
.gs-input-class--inferred { background: #f1f5f9; color: #475569; }
.admin-subnav { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.admin-subnav-link { padding: 0.4rem 0.75rem; background: #f1f5f9; color: #475569; border-radius: 4px; text-decoration: none; font-size: 0.85rem; }
.admin-subnav-link:hover { background: #e2e8f0; }
.admin-subnav-link--active { background: #0066ff; color: #ffffff; }
.admin-subnav-link--active:hover { background: #0052cc; }
.admin-form-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem 1.5rem; max-width: 640px; }
.admin-form-help { font-size: 0.875rem; color: #475569; line-height: 1.5; margin-bottom: 1rem; }
.admin-assumption-group { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.admin-assumption-group h2 { font-size: 1rem; margin: 0 0 0.75rem; font-family: ui-monospace, SFMono-Regular, monospace; color: #0f172a; }

/* Full-ingest progress panel */
.rebuild-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.rebuild-stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 0.5rem 0.75rem; }
.rebuild-stat-label { display: block; font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem; }
.rebuild-stat-value { font-size: 1.1rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.rebuild-step-text { font-size: 0.85rem; color: #334155; margin-top: 0.75rem; font-style: italic; }
.rebuild-failure-samples { margin-top: 0.75rem; font-size: 0.8rem; }
.rebuild-failure-samples summary { cursor: pointer; color: #991b1b; }
.rebuild-failure-samples ul { margin: 0.5rem 0 0 1.25rem; padding: 0; max-height: 200px; overflow-y: auto; }
.rebuild-failure-samples code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; color: #991b1b; }
.rebuild-failure-samples small { color: #64748b; font-size: 0.7rem; word-break: break-all; }
.rebuild-error-block { margin-top: 0.75rem; padding: 0.75rem; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; color: #991b1b; font-size: 0.85rem; }
.rebuild-error-block[hidden] { display: none; }
.status-pending { background: #e5e7eb; color: #374151; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-completed { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* GridSignal pipeline panel */
.gs-pipeline-panel { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.gs-pipeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.gs-pipeline-header h3 { font-size: 1rem; margin: 0; }
.gs-pipeline-key { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 3px; }
.gs-pipeline-key--ok { background: #dcfce7; color: #166534; }
.gs-pipeline-key--missing { background: #fee2e2; color: #991b1b; }
.gs-pipeline-key--neutral { background: #f1f5f9; color: #64748b; }
.gs-pipeline-keys { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gs-pipeline-fingerprint { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: #475569; margin-bottom: 0.75rem; }
.gs-pipeline-fingerprint code { font-family: ui-monospace, SFMono-Regular, monospace; color: #0f172a; }
.gs-state-banner { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; }
.gs-state-banner--rich { flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 1rem 1.25rem; }
.gs-state-banner--rich form { margin: 0; }
.gs-state-banner-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.gs-state-banner-headline { flex: 1; color: #0f172a; font-size: 0.9rem; }
.gs-state-banner-headline strong { font-size: 1.05rem; }
.gs-state-banner-note { font-size: 0.75rem; color: #475569; font-style: italic; }
.gs-state-banner-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(30, 64, 175, 0.15);
}
.gs-state-banner-breakdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #1e40af;
  margin-right: 0.25rem;
}
.gs-state-banner-chip {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: #ffffff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.gs-state-banner-chip:hover { background: #eff6ff; border-color: #93c5fd; text-decoration: none; }
.gs-state-banner-chip strong { font-weight: 600; }
.gs-state-banner-chip--more { background: transparent; border-color: transparent; color: #64748b; cursor: default; }
.gs-state-banner-label { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; padding: 0.25rem 0.6rem; border-radius: 4px; white-space: nowrap; }
.gs-state-banner-text { color: #0f172a; line-height: 1.5; }
.gs-state-banner--pending { background: #dbeafe; }
.gs-state-banner--pending .gs-state-banner-label { background: #1e40af; color: #ffffff; }
.gs-state-banner--neutral { background: #f1f5f9; }
.gs-state-banner--neutral .gs-state-banner-label { background: #475569; color: #ffffff; }
.gs-state-banner--ok { background: #dcfce7; }
.gs-state-banner--ok .gs-state-banner-label { background: #166534; color: #ffffff; }
.rebuild-cancel-row { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.rebuild-cancel-row form { margin: 0; }
.rebuild-cancel-help { font-size: 0.75rem; color: #64748b; flex: 1; min-width: 220px; }

/* GridSignal admin: SOURCES section + DEBUG & RECOVER collapsible */
.gs-section-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.gs-section-header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.gs-section-header h2 { font-size: 1.15rem; margin: 0; }
.gs-section-help { font-size: 0.85rem; color: #475569; line-height: 1.5; margin: 0 0 0.75rem; }

.gs-debug-section { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; margin-top: 1rem; }
.gs-debug-section[open] { background: #ffffff; }
.gs-debug-summary { cursor: pointer; padding: 0.9rem 1.25rem; user-select: none; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.gs-debug-summary:hover { background: #f1f5f9; border-radius: 8px; }
.gs-debug-summary-title { font-weight: 700; font-size: 1rem; color: #0f172a; }
.gs-debug-summary-hint { color: #64748b; font-size: 0.8rem; }
.gs-debug-body { padding: 0.5rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.gs-debug-block { padding-top: 1rem; border-top: 1px solid #f1f5f9; }
.gs-debug-block:first-child { border-top: none; padding-top: 0.5rem; }
.gs-debug-block h3 { font-size: 0.95rem; margin: 0 0 0.4rem; color: #0f172a; display: flex; align-items: center; gap: 0.5rem; }
.gs-debug-help { font-size: 0.8rem; color: #475569; line-height: 1.5; margin: 0 0 0.75rem; }
.gs-debug-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.gs-debug-actions form { margin: 0; }
.gs-debug-block--danger { background: #fef2f2; border-left: 3px solid #fca5a5; padding: 1rem; border-radius: 4px; border-top: none; }
.gs-debug-block--danger h3 { color: #991b1b; }
.gs-debug-danger-tag { background: #991b1b; color: #ffffff; padding: 0.1rem 0.5rem; border-radius: 3px; font-size: 0.65rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; }
.gs-discover-apply-form { display: flex; gap: 0.4rem; align-items: center; margin: 0; flex-wrap: wrap; }
.gs-discover-apply-form .mf-select--sm { font-size: 0.8rem; max-width: 260px; }
.gs-discover-apply { white-space: nowrap; }
.gs-section-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gs-bulk-found { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 0.75rem 1rem; margin-top: 0.75rem; }
.gs-bulk-found h4 { font-size: 0.9rem; margin: 0 0 0.5rem; color: #166534; }
.gs-bulk-found ul { margin: 0; padding-left: 1.25rem; font-size: 0.85rem; color: #166534; }
.gs-bulk-found code { background: #dcfce7; padding: 0.1rem 0.4rem; border-radius: 3px; }
.gs-pipeline-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.4rem; font-size: 0.85rem; color: #475569; margin-bottom: 0.75rem; }
.gs-pipeline-stats div strong { color: #0f172a; font-variant-numeric: tabular-nums; }
.gs-pipeline-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; padding-top: 0.75rem; border-top: 1px solid #f1f5f9; }
.gs-pipeline-actions form { margin: 0; }
.gs-pipeline-help { font-size: 0.75rem; color: #64748b; line-height: 1.4; flex: 1; min-width: 200px; }
.gs-pipeline-failures { margin: 0.5rem 0 0.75rem; font-size: 0.8rem; }
.gs-pipeline-failures summary { cursor: pointer; color: #991b1b; }
.gs-pipeline-failures ul { margin: 0.5rem 0 0 1.25rem; padding: 0; max-height: 240px; overflow-y: auto; }
.gs-pipeline-failures code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; color: #334155; }
.gs-failure-error { color: #991b1b; font-size: 0.75rem; word-break: break-word; }

/* ================================================================= */
/* GridSignal user-facing — Apple-style refinement                   */
/* ================================================================= */
.gs-page .portfolio-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.gs-page .portfolio-header-left h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }

.gs-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.gs-back-link:hover { color: #1f2937; background: #f1f5f9; text-decoration: none; }

/* Explorer header filter dropdown */
.gs-explorer-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.gs-explorer-filter-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.gs-explorer-filter .mf-select { min-width: 140px; }

/* Explorer summary + table */
.gs-summary-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gs-explorer-divider td {
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-bottom: none;
  border-top: 1px solid #e2e8f0;
}
.gs-explorer-divider-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.gs-explorer-row--pending td { color: #94a3b8; }
.gs-explorer-row--pending .pf-property-link strong { color: #475569; }

.gs-tier-badge--very_high { background: #bbf7d0; color: #14532d; }
.gs-tier-badge--high { background: #dcfce7; color: #166534; }
.gs-tier-badge--moderate { background: #fef3c7; color: #854d0e; }
.gs-tier-badge--low { background: #fee2e2; color: #991b1b; }
/* New stage-based tier bands (describing the opportunity's stage, not a value judgment) */
.gs-tier-badge--hot          { background: #bbf7d0; color: #14532d; }

/* Jurisdiction type badge on the detail-page header */
.gs-jur-type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gs-jur-type-badge--city   { background: #dbeafe; color: #1e40af; }
.gs-jur-type-badge--county { background: #fef3c7; color: #92400e; }
.gs-tier-badge--active       { background: #dcfce7; color: #166534; }
.gs-tier-badge--emerging     { background: #dbeafe; color: #1e40af; }
.gs-tier-badge--early_signal { background: #e0e7ff; color: #4338ca; }
.gs-tier-badge--dormant      { background: #f1f5f9; color: #64748b; }
.gs-status-badge--analyzed { background: #f1f5f9; color: #475569; }
.gs-status-badge--processing { background: #dbeafe; color: #1e40af; }
.gs-status-badge--not-polled { background: #f8fafc; color: #94a3b8; }
.gs-explorer-updated { font-size: 0.75rem; color: #94a3b8; }

/* Jurisdiction score summary — opportunity gets accent gradient */
.gs-score-summary { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gs-opportunity-card .gs-opportunity-value { color: #0f172a; }
.gs-opportunity-card--very_high { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.gs-opportunity-card--very_high .gs-opportunity-value { color: #14532d; }
.gs-opportunity-card--high { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.gs-opportunity-card--high .gs-opportunity-value { color: #166534; }
.gs-opportunity-card--moderate { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.gs-opportunity-card--moderate .gs-opportunity-value { color: #854d0e; }
.gs-opportunity-card--low { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.gs-opportunity-card--low .gs-opportunity-value { color: #991b1b; }
/* New stage-based opportunity-card tints. "Early signal" uses a hopeful indigo */
/* instead of red — finding a real signal early IS the win, so the card color    */
/* should feel like discovery, not failure.                                     */
.gs-opportunity-card--hot          { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.gs-opportunity-card--hot .gs-opportunity-value          { color: #14532d; }
.gs-opportunity-card--active       { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.gs-opportunity-card--active .gs-opportunity-value       { color: #166534; }
.gs-opportunity-card--emerging     { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.gs-opportunity-card--emerging .gs-opportunity-value     { color: #1e40af; }
.gs-opportunity-card--early_signal { background: linear-gradient(135deg, #eef2ff, #e0e7ff); }
.gs-opportunity-card--early_signal .gs-opportunity-value { color: #4338ca; }
.gs-opportunity-card--dormant      { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.gs-opportunity-card--dormant .gs-opportunity-value      { color: #64748b; }

.gs-empty--inline {
  padding: 2rem 1.5rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Signal stream — timeline of evidence cards */
.gs-signal-stream { display: flex; flex-direction: column; gap: 0.875rem; }
.gs-signal-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem 1.125rem;
  border-left: 3px solid #94a3b8;
}
.gs-signal-card--polarity-1 { border-left-color: #22c55e; }
.gs-signal-card--polarity-0 { border-left-color: #94a3b8; }
.gs-signal-card--polarity--1 { border-left-color: #ef4444; }

.gs-signal-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.gs-signal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}
.gs-signal-type-badge {
  background: #eef2ff;
  color: #3730a3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}
.gs-polarity-badge--positive { background: #dcfce7; color: #166534; }
.gs-polarity-badge--negative { background: #fee2e2; color: #991b1b; }
.gs-polarity-badge--neutral { background: #f1f5f9; color: #475569; }
.gs-confidence-badge--high { background: #dcfce7; color: #166534; }
.gs-signal-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

.gs-evidence-card {
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.75rem 0.875rem;
  margin-top: 0.5rem;
}
.gs-evidence-quote {
  margin: 0 0 0.625rem;
  padding: 0;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
  font-style: italic;
}
.gs-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.gs-evidence-source {
  font-size: 0.75rem;
  color: #64748b;
}
.gs-evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gs-evidence-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.625rem;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.gs-evidence-link-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  text-decoration: none;
  color: #0f172a;
}

/* Project detail — forecast metric cards */
.gs-project-description-card { padding: 1rem 1.25rem; }
.gs-project-description-text { color: #475569; font-size: 0.9375rem; line-height: 1.6; margin: 0; }

.gs-forecast-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.gs-forecast-section-header .pf-table-title { margin-bottom: 0; }
.gs-forecast-meta-pill {
  font-size: 0.75rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.gs-forecast-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gs-metric-card { gap: 0.375rem; }
.gs-metric-card-value {
  font-size: 1.75rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gs-metric-card-unit {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.gs-metric-card-footnote {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0.5rem 0 0;
  padding-top: 0.625rem;
  border-top: 1px solid #f1f5f9;
}
.gs-metric-card-empty { color: #cbd5e1; }
.gs-metric-card-details {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}
.gs-metric-card-details summary {
  cursor: pointer;
  color: #0066ff;
  user-select: none;
  font-weight: 500;
}
.gs-metric-card-details summary:hover { color: #0052cc; }
.gs-metric-card-details-body {
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.gs-metric-card-narrative {
  color: #334155;
  margin: 0 0 0.5rem;
  line-height: 1.5;
  font-size: 0.75rem;
}
.gs-metric-card-inputs { margin-bottom: 0.5rem; }
.gs-metric-card-inputs ul { margin: 0.25rem 0 0 1rem; padding: 0; }
.gs-metric-card-inputs li { font-size: 0.7rem; color: #475569; }
.gs-metric-card-inputs code { font-size: 0.6875rem; }
.gs-metric-card-confidence {
  font-size: 0.75rem;
  color: #64748b;
  padding-top: 0.375rem;
  border-top: 1px solid #e2e8f0;
}
.gs-input-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.125rem 0.4rem;
  border-radius: 4px;
  color: #334155;
}

@media (max-width: 768px) {
  .gs-page .portfolio-header { flex-direction: column; align-items: stretch; }
  .gs-explorer-filter { align-self: flex-start; }
}

/* Explorer hero signal — intelligence over summary, lead the page */
.gs-hero-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.5rem;
}
.gs-hero-link:hover { text-decoration: none; }
.gs-hero {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 1.75rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px -12px rgba(15,23,42,0.12);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gs-hero-link:hover .gs-hero {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 12px 32px -12px rgba(15,23,42,0.18);
}
.gs-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: #94a3b8;
}
.gs-hero--positive::before { background: linear-gradient(180deg, #22c55e, #16a34a); }
.gs-hero--negative::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.gs-hero--neutral::before  { background: linear-gradient(180deg, #94a3b8, #64748b); }
.gs-hero--project::before  { background: linear-gradient(180deg, #f59e0b, #d97706); }

/* Twin-hero row: side by side on wide, stacked on narrow */
.gs-hero-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
/* Extra breathing room when the hero row sits directly beneath the
   scan-picker card on the Scan A Market page — the picker's dense
   outline needs separation from the signal/project cards below it. */
.gs-hero-row--spaced {
  margin-top: 1.5rem;
}
.gs-explorer-active-scans + .gs-hero-row--spaced {
  margin-top: 1rem; /* smaller when an active-scans strip is between them */
}
.gs-hero-row .gs-hero-link {
  margin-bottom: 0;
  display: flex;
}
.gs-hero-row .gs-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.gs-hero-eyebrow-dot--amber {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}
.gs-hero--project .gs-hero-eyebrow-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}
.gs-hero-badge--project {
  background: #fef3c7;
  color: #92400e;
}
.gs-hero-fact-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.gs-hero-fact {
  font-size: 0.9rem;
  color: #334155;
  padding: 0.3rem 0.5rem;
  background: #f8fafc;
  border-radius: 6px;
}
.gs-hero-fact strong {
  color: #0f172a;
}
.gs-hero-quote-plain {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
  margin: 0.75rem 0 1rem;
}

/* Tabbed recent-scans card */
.gs-scans-tabs-card .gs-scan-list-head {
  padding-bottom: 0;
}
.gs-scans-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.gs-scans-tabs-card .gs-tab-list {
  display: inline-flex;
  gap: 0.25rem;
  border-bottom: none;
}
.gs-scans-tabs-card .gs-tab {
  background: transparent;
  border: none;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.gs-scans-tabs-card .gs-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.gs-scans-tabs-card .gs-tab--active {
  background: #0f172a;
  color: #fff;
}
.gs-scans-tabs-card .gs-tab--active .gs-tab-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.gs-scans-tabs-card .gs-tab-count {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.1rem 0.4rem;
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.gs-tab-count--live {
  background: #dcfce7 !important;
  color: #15803d !important;
}
.gs-scans-tab-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* My GridSignal Markets panel on the scan page */
.gs-my-markets-card {
  padding: 1.25rem 1.25rem 0.75rem;
}
.gs-my-markets-head { margin-bottom: 1rem; }
.gs-my-markets-count {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.1rem 0.5rem;
  background: #e2e8f0;
  color: #475569;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.gs-my-markets-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0.25rem 0 0;
  line-height: 1.5;
}
.gs-my-markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.gs-my-markets-tile {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.875rem 0.9rem 0.75rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.gs-my-markets-tile:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px -4px rgba(15,23,42,0.1);
  transform: translateY(-1px);
}
.gs-my-markets-tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.gs-my-markets-tile-link:hover { text-decoration: none; }
.gs-my-markets-tile-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.gs-my-markets-tile-name {
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.3;
}
.gs-my-markets-tile-status {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.gs-my-markets-tile-stats {
  font-size: 0.8rem;
  color: #475569;
}
.gs-my-markets-tile-stats--waiting {
  color: #94a3b8;
  font-style: italic;
}
.gs-opportunity-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #e2e8f0;
  color: #475569;
}
.gs-opportunity-pill--hot          { background: #fee2e2; color: #991b1b; }
.gs-opportunity-pill--active       { background: #fef3c7; color: #92400e; }
.gs-opportunity-pill--emerging     { background: #dcfce7; color: #166534; }
.gs-opportunity-pill--early_signal { background: #dbeafe; color: #1e40af; }
.gs-opportunity-pill--dormant      { background: #f1f5f9; color: #64748b; }
.gs-my-markets-tile-remove {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  color: #94a3b8;
  font-size: 0.75rem;
  text-decoration: none;
}
.gs-my-markets-tile-remove:hover {
  color: #dc2626;
  background: transparent;
}

/* Watchlist filter bar */
.gs-watchlist-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}
.gs-watchlist-filter-search {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 0.4rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
}
.gs-watchlist-filter-search:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.gs-watchlist-filter-select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
}
.gs-watchlist-no-match {
  padding: 1.25rem 0.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

/* "What we scanned" transparency panel */
.gs-scanned-sub {
  color: #475569;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.gs-scanned-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
}
.gs-scanned-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  flex: 1 1 110px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 6px;
  text-align: center;
}
.gs-scanned-stat strong { font-size: 1.4rem; color: #0f172a; }
.gs-scanned-stat span { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-top: 0.1rem; }
.gs-scanned-stat--analyzed { border-top: 3px solid #22c55e; }
.gs-scanned-stat--signal   { border-top: 3px solid #2563eb; }
.gs-scanned-stat--failed   { border-top: 3px solid #ef4444; }
.gs-scanned-stat--pending  { border-top: 3px solid #f59e0b; }

.gs-scanned-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.gs-scanned-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  flex-wrap: wrap;
}
.gs-scanned-row--signal { border-left: 3px solid #22c55e; }
.gs-scanned-row--none   { border-left: 3px solid #cbd5e1; }
.gs-scanned-row--failed { border-left: 3px solid #ef4444; background: #fef2f2; }
.gs-scanned-row--pending { border-left: 3px solid #f59e0b; background: #fffbeb; }
.gs-scanned-row-main { flex: 1 1 300px; min-width: 0; }
.gs-scanned-row-title { color: #0f172a; font-size: 0.92rem; word-break: break-word; }
.gs-scanned-row-title a { color: #2563eb; text-decoration: none; }
.gs-scanned-row-title a:hover { text-decoration: underline; }
.gs-scanned-row-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.gs-scanned-row-meta span::after { content: " · "; color: #cbd5e1; margin-left: 0.5rem; }
.gs-scanned-row-meta span:last-child::after { content: ""; }
.gs-scanned-row-verdict {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.gs-scanned-verdict {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.gs-scanned-verdict--signal  { background: #dcfce7; color: #166534; }
.gs-scanned-verdict--none    { background: #f1f5f9; color: #475569; }
.gs-scanned-verdict--failed  { background: #fee2e2; color: #991b1b; white-space: normal; }
.gs-scanned-verdict--pending { background: #fef3c7; color: #92400e; }
.gs-scanned-pdf-link { font-size: 0.75rem; color: #2563eb; text-decoration: none; }
.gs-scanned-pdf-link:hover { text-decoration: underline; }
.gs-scanned-truncated { font-size: 0.82rem; color: #64748b; text-align: center; margin-top: 1rem; font-style: italic; }

/* "Scan still working" banner — shown on every jurisdiction tab */
.gs-scan-in-flight-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #dbeafe 0%, #e0f2fe 100%);
  border: 1px solid #93c5fd;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.gs-scan-in-flight-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: gs-scan-live-spin 0.9s linear infinite;
  flex-shrink: 0;
}
.gs-scan-in-flight-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.gs-scan-in-flight-text strong {
  color: #1e40af;
  font-size: 0.95rem;
}
.gs-scan-in-flight-text span {
  color: #334155;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Admin "Right now" consolidated status card */
.gs-rightnow-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.gs-rightnow-card--quiet     { border-left-color: #22c55e; }
.gs-rightnow-card--working   { border-left-color: #2563eb; }
.gs-rightnow-card--attention { border-left-color: #f59e0b; background: #fffbeb; }
.gs-rightnow-card--empty     { border-left-color: #94a3b8; }

.gs-rightnow-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.gs-rightnow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gs-rightnow-dot--quiet     { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }
.gs-rightnow-dot--working   { background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); animation: gs-rightnow-pulse 1.6s ease-in-out infinite; }
.gs-rightnow-dot--attention { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }
.gs-rightnow-dot--empty     { background: #94a3b8; }

@keyframes gs-rightnow-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
  50%      { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.08); }
}

.gs-rightnow-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.gs-rightnow-headline {
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 700;
}
.gs-rightnow-sub {
  color: #475569;
  font-size: 0.88rem;
}

.gs-rightnow-details {
  margin-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
}
.gs-rightnow-details-toggle {
  cursor: pointer;
  font-size: 0.82rem;
  color: #2563eb;
  font-weight: 600;
  padding: 0.25rem 0;
  list-style: none;
}
.gs-rightnow-details-toggle::-webkit-details-marker { display: none; }
.gs-rightnow-details-toggle::before {
  content: "▸ ";
  color: #94a3b8;
  display: inline-block;
  transition: transform 0.12s ease;
}
details[open] > .gs-rightnow-details-toggle::before {
  content: "▾ ";
}

.gs-rightnow-breakdowns {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.gs-rightnow-breakdown {
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}
.gs-rightnow-breakdown-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.gs-rightnow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Project provenance badges — the moat badge. "Early signal" is
   the differentiated discovery via municipal records. "Public
   knowledge" is table-stakes web discovery. Visually distinct so
   the user instantly sees which projects nobody else has. */
.gs-project-provenance-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
  white-space: normal;
}
.gs-project-provenance-badge--early-signal {
  background: linear-gradient(90deg, #166534, #16a34a);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 101, 52, 0.3);
}
.gs-project-provenance-badge--public-knowledge {
  background: #fef3c7;
  color: #92400e;
}
.gs-project-provenance-badge--catalogued {
  background: #e2e8f0;
  color: #475569;
}
.gs-project-provenance-badge--unknown {
  background: #f1f5f9;
  color: #64748b;
}

/* Recent-signals hero carousel — replaces single-card hero that
   used to lose history whenever a new signal landed. */
.gs-hero-signals-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}
.gs-hero-signals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.gs-hero-signals-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}
.gs-hero-signals-count {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}
.gs-hero-signals-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.gs-hero-signals-nav-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.gs-hero-signals-nav-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.gs-hero-signals-position {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  min-width: 2.5rem;
  text-align: center;
}
.gs-hero-signals-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.gs-hero-signals-track::-webkit-scrollbar {
  height: 4px;
}
.gs-hero-signals-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.gs-hero-signals-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: block;
  text-decoration: none;
  color: inherit;
}
.gs-hero-signals-slide .gs-hero {
  height: 100%;
}
.gs-hero-signals-dots {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  padding-top: 0.1rem;
}
.gs-hero-signals-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.gs-hero-signals-dot:hover { background: #94a3b8; }
.gs-hero-signals-dot--active {
  background: #0f172a;
  transform: scale(1.3);
}

/* "What we scanned" pipeline-status diagnostic — shows the live
   state of the ingest pipeline for this jurisdiction instead of
   leaving the tab empty when nothing's completed yet. */
.gs-pipeline-status {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.gs-pipeline-headline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.gs-pipeline-headline strong {
  font-size: 1rem;
  color: #0f172a;
}
.gs-pipeline-headline span {
  color: #475569;
  font-size: 0.9rem;
  flex: 1;
  min-width: 240px;
}
.gs-pipeline-headline--working {
  background: #dbeafe;
  border-left: 3px solid #2563eb;
}
.gs-pipeline-headline--empty {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
}

.gs-pipeline-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
  margin: 0;
}
.gs-pipeline-fact {
  background: #fff;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
}
.gs-pipeline-fact dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.gs-pipeline-fact dd {
  margin: 0;
  color: #0f172a;
  font-size: 0.9rem;
  word-break: break-word;
}
.gs-pipeline-fact dd strong { color: #0f172a; }
.gs-pipeline-fact dd small { color: #64748b; }
.gs-pipeline-link {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}
.gs-pipeline-link:hover { text-decoration: underline; }
.gs-pipeline-chip {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  background: #dcfce7;
  color: #166534;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  vertical-align: middle;
}
.gs-pipeline-hint {
  margin: 1rem 0 0;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 6px;
  color: #475569;
  font-size: 0.85rem;
}

/* "Run GridSignal Scan" button + hint in Market Finder results */
.mf-gridsignal-form {
  display: inline-block;
  margin-left: 0.5rem;
}
.mf-gridsignal-hint {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
  cursor: help;
}

/* Compact inline form on My Markets cards */
.saved-search-gs-form {
  display: inline-block;
}

/* Possible-tier signal card on the user-facing jurisdiction page */
.gs-possible-card {
  margin-top: 1rem;
  padding: 0;
  background: #fafbfc;
  border: 1px dashed #cbd5e1;
}
.gs-possible-details { padding: 0.875rem 1.125rem; }
.gs-possible-summary {
  cursor: pointer;
  color: #334155;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gs-possible-summary::-webkit-details-marker { display: none; }
.gs-possible-summary::before {
  content: "▸";
  color: #94a3b8;
  transition: transform 0.15s ease;
}
details[open] > .gs-possible-summary::before { transform: rotate(90deg); }
.gs-possible-count {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.gs-possible-help { color: #64748b; font-size: 0.85rem; font-weight: 400; }
.gs-signal-stream--possible { margin-top: 1rem; }
.gs-signal-card--possible { opacity: 0.9; background: #fafbfc; }
.gs-confidence-badge--possible { background: #fef3c7; color: #92400e; }

/* Admin coverage diagnostic */
.gs-funnel-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0 1.25rem;
}
.gs-funnel-step {
  flex: 1 1 110px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gs-funnel-step--signals { background: #dcfce7; border-color: #86efac; }
.gs-funnel-value { font-size: 1.4rem; font-weight: 700; color: #0f172a; }
.gs-funnel-label { font-size: 0.75rem; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.gs-funnel-step small { color: #94a3b8; font-size: 0.7rem; }
.gs-funnel-arrow { display: flex; align-items: center; color: #cbd5e1; font-size: 1.25rem; }
.gs-funnel-warn {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.gs-nearmiss-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.gs-nearmiss { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.75rem 0.9rem; }
.gs-nearmiss-head { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; color: #475569; margin-bottom: 0.4rem; }
.gs-nearmiss-head strong { color: #0f172a; }
.gs-nearmiss-excerpt { color: #334155; font-size: 0.9rem; margin: 0.25rem 0 0.5rem; padding-left: 0.75rem; border-left: 3px solid #cbd5e1; }
.gs-nearmiss-ai { font-size: 0.8rem; color: #475569; background: #f8fafc; padding: 0.4rem 0.6rem; border-radius: 4px; }
.gs-nearmiss-sig { display: inline-block; background: #fef3c7; color: #92400e; padding: 0.1rem 0.4rem; border-radius: 4px; margin-right: 0.3rem; font-size: 0.72rem; }

.gs-coverage-table { font-size: 0.88rem; }
.gs-coverage-nullresult { background: #fef2f2; }
.gs-coverage-empty-note { padding: 2rem; text-align: center; color: #94a3b8; }
.gs-coverage-status-extracted { background: #dcfce7; color: #166534; }
.gs-coverage-status-no_signals { background: #e0e7ff; color: #3730a3; }
.gs-coverage-status-failed { background: #fee2e2; color: #991b1b; }
.gs-coverage-status-pending { background: #fef3c7; color: #92400e; }
.gs-coverage-status-unsupported { background: #f3e8ff; color: #6b21a8; }
.gs-coverage-error { color: #991b1b; }
.gs-coverage-details summary { cursor: pointer; color: #2563eb; font-size: 0.85rem; }
.gs-coverage-chunk-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.gs-coverage-chunk { background: #f8fafc; border-radius: 6px; padding: 0.5rem 0.65rem; font-size: 0.82rem; }
.gs-coverage-chunk--filtered { opacity: 0.6; background: #f1f5f9; }
.gs-coverage-chunk-meta { display: flex; gap: 0.75rem; color: #475569; flex-wrap: wrap; margin-bottom: 0.25rem; }
.gs-coverage-chunk-meta strong { color: #0f172a; }
.gs-coverage-pending { color: #92400e; font-style: italic; }
.gs-coverage-filtered-label { color: #94a3b8; font-style: italic; }
.gs-coverage-claude-summary { color: #475569; margin: 0.2rem 0; }
.gs-coverage-chunk-text { color: #334155; padding-left: 0.5rem; border-left: 2px solid #cbd5e1; margin: 0.25rem 0; }
.gs-coverage-chunk-signals { margin-top: 0.3rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.gs-coverage-signal-pill { font-size: 0.72rem; padding: 0.15rem 0.45rem; border-radius: 4px; font-weight: 600; }
.gs-coverage-signal-pill--confirmed { background: #22c55e; color: #fff; }
.gs-coverage-signal-pill--likely    { background: #dcfce7; color: #166534; }
.gs-coverage-signal-pill--possible  { background: #fef3c7; color: #92400e; }
.gs-coverage-signal-pill--noise     { background: #e2e8f0; color: #475569; }

.gs-coverage-portal-attempt { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.75rem 0.9rem; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.gs-coverage-portal-attempt code { font-size: 0.75rem; background: #fff; padding: 0.1rem 0.35rem; border-radius: 3px; }
.gs-coverage-portal-list { margin: 0.25rem 0 0 1.1rem; padding: 0; font-size: 0.8rem; color: #475569; }
.gs-coverage-portal-note { margin: 0.3rem 0 0; padding: 0.4rem 0.6rem; background: #fff; border-left: 3px solid #cbd5e1; font-style: italic; color: #475569; font-size: 0.82rem; }

.gs-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.75rem;
}
.gs-hero-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  animation: gs-hero-pulse 2s ease-in-out infinite;
}
.gs-hero--negative .gs-hero-eyebrow-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}
.gs-hero--neutral .gs-hero-eyebrow-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}
.gs-hero-eyebrow-time { color: #94a3b8; font-weight: 500; letter-spacing: 0.04em; }
@keyframes gs-hero-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.08); }
}

.gs-hero-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.875rem;
}
.gs-hero-jurisdiction {
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.gs-hero-state { color: #64748b; font-weight: 500; }

.gs-hero-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.gs-hero-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.gs-hero-badge--type {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  background: #eef2ff;
  color: #3730a3;
  letter-spacing: 0.02em;
}
.gs-hero-badge--positive { background: #dcfce7; color: #166534; }
.gs-hero-badge--negative { background: #fee2e2; color: #991b1b; }
.gs-hero-badge--neutral  { background: #f1f5f9; color: #475569; }
.gs-hero-badge--confidence { background: #fef3c7; color: #854d0e; }

.gs-hero-quote {
  position: relative;
  margin: 0 0 0.75rem;
  padding: 0;
  color: #1f2937;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-style: italic;
}
.gs-hero-quote-mark {
  color: #cbd5e1;
  font-size: 1.25em;
  font-style: normal;
  font-weight: 700;
  margin: 0 0.1em;
  vertical-align: -0.1em;
}

.gs-hero-source {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.gs-hero-source strong { color: #334155; font-weight: 600; }

.gs-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066ff;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}
.gs-hero-link:hover .gs-hero-cta { color: #0052cc; }
.gs-hero-link:hover .gs-hero-cta svg { transform: translateX(2px); }
.gs-hero-cta svg { transition: transform 0.15s ease; }

@media (max-width: 640px) {
  .gs-hero { padding: 1.25rem 1.25rem 1rem; }
  .gs-hero-jurisdiction { font-size: 1.375rem; }
  .gs-hero-quote { font-size: 1rem; }
}

/* Market Scan — user-facing scan flow (new / show) */
.gs-scan-card { padding: 1.5rem; }
.gs-scan-form { }
.gs-scan-fields {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.gs-scan-field label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.gs-scan-field input, .gs-scan-field select {
  width: 100%;
}
.gs-scan-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}
.gs-scan-picker { margin-bottom: 1rem; }
.gs-scan-picker label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.gs-scan-picker-wrap { position: relative; }
.gs-scan-picker-input { width: 100%; }
.gs-scan-picker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.18);
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
}
.gs-scan-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.875rem;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  font-size: 0.875rem;
  color: #334155;
}
.gs-scan-picker-item:last-child { border-bottom: none; }
.gs-scan-picker-item:hover { background: #f8fafc; color: #0f172a; }
.gs-scan-picker-item strong { color: #0f172a; font-weight: 600; }
.gs-scan-picker-empty {
  padding: 0.75rem 0.875rem;
  color: #64748b;
  font-size: 0.8125rem;
  font-style: italic;
}
.gs-scan-picker-selected {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: #166534;
  font-weight: 600;
}
.gs-scan-actions { margin-top: 0.5rem; }
.btn-disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.gs-scan-help {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0.75rem 0 0;
}
@media (max-width: 640px) {
  .gs-scan-fields { grid-template-columns: 1fr; }
}

.gs-scan-progress-card { padding: 1.5rem 1.75rem; }
.gs-scan-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}
.gs-scan-status-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.gs-scan-status--pending, .gs-scan-status--probing, .gs-scan-status--ingesting,
.gs-scan-status--extracting, .gs-scan-status--scoring { background: #dbeafe; color: #1e40af; }
.gs-scan-status--completed { background: #dcfce7; color: #166534; }
.gs-scan-status--no_vendor { background: #f1f5f9; color: #64748b; }
.gs-scan-status--failed, .gs-scan-status--cancelled { background: #fee2e2; color: #991b1b; }
.gs-scan-elapsed { color: #94a3b8; font-size: 0.8125rem; }

.gs-scan-stage {
  margin: 0.75rem 0 1rem;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.5;
}

.gs-scan-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}
.gs-scan-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.gs-scan-stage-pill--done { background: #dcfce7; color: #166534; }
.gs-scan-stage-pill--active { background: #dbeafe; color: #1e40af; }
.gs-scan-stage-pill--pending { background: #f1f5f9; color: #94a3b8; }
.gs-scan-stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: gs-hero-pulse 1.5s ease-in-out infinite;
}
.gs-scan-stage-dot--pending { animation: none; background: #cbd5e1; }

.gs-scan-stat-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f5f9;
  margin-top: 0.5rem;
}
.gs-scan-stat { display: flex; flex-direction: column; gap: 0.2rem; }
.gs-scan-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.gs-scan-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.gs-scan-nothing {
  margin: 1rem 0;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  text-align: center;
}
.gs-scan-nothing h3 { font-size: 1rem; margin: 0 0 0.4rem; color: #0f172a; }
.gs-scan-nothing p { color: #475569; font-size: 0.875rem; line-height: 1.5; margin: 0 0 0.75rem; }
.gs-scan-nothing--error { background: #fef2f2; }
.gs-scan-nothing--error h3 { color: #991b1b; }
.gs-scan-nothing-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.gs-scan-nothing-actions form { margin: 0; }
.gs-scan-row-actions form { margin: 0; display: inline-block; }

.gs-scan-done {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.gs-scan-done .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Watchlist opt-in CTA after a scan completes. Pulled out as its
   own card-like block so it reads as a distinct next step, not an
   afterthought bolted onto the primary "See results" button. */
.gs-scan-done-watchlist {
  margin-top: 1.25rem;
}
.gs-scan-done-watchlist-prompt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  flex-wrap: wrap;
}
.gs-scan-done-watchlist-copy {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.gs-scan-done-watchlist-copy strong {
  font-size: 1rem;
  color: #0f172a;
}
.gs-scan-done-watchlist-copy span {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
}
.gs-scan-done-watchlist-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.gs-scan-done-watchlist-on {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 0.875rem;
}
.gs-scan-done-watchlist-on svg {
  flex: 0 0 auto;
  color: #16a34a;
}
.gs-scan-done-watchlist-on strong {
  color: #14532d;
}

.gs-scan-preview-ready {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #86efac;
  border-radius: 8px;
}
.gs-scan-preview-ready[hidden] { display: none; }
.gs-scan-preview-ready-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.gs-scan-preview-ready-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #166534;
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gs-scan-preview-ready-count { color: #0f172a; font-size: 0.9rem; }
.gs-scan-preview-ready-count strong { font-size: 1.1rem; }
.gs-scan-preview-ready-copy {
  margin: 0 0 0.75rem;
  color: #166534;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.gs-scan-cancel-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.gs-explorer-active-scans {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.gs-explorer-active-scan {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 8px;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background 0.15s;
}
.gs-explorer-active-scan:hover { background: #bfdbfe; text-decoration: none; }
.gs-explorer-active-scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e40af;
  animation: gs-hero-pulse 1.5s ease-in-out infinite;
}
.gs-explorer-active-scan-pct { color: #3730a3; font-weight: 600; }
.gs-explorer-toolbar { display: flex; justify-content: flex-end; margin-bottom: 1rem; gap: 0.5rem; align-items: center; }
.gs-explorer-filter { display: inline-flex; gap: 0.5rem; align-items: center; }
.gs-explorer-filter-label { font-size: 0.75rem; color: #64748b; }

/* Parallel Full Ingest cards — stacked, each with its own live progress */
.gs-ingest-stack-header {
  font-size: 0.8125rem;
  color: #475569;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
.gs-ingest-stack-header strong { color: #1e40af; }
.gs-ingest-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.gs-ingest-stack .rebuild-status-card { margin-bottom: 0; }

/* ─── Latest-signals feed on the Scan landing page ────────────────────── */
/* The "wow factor" surface — proof that GridSignal is already watching     */
/* the country, with recent high-confidence signals clickable to the        */
/* jurisdiction they came from.                                             */
.gs-feed {
  margin-top: 1.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.5rem 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.gs-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.gs-feed-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.gs-feed-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
  animation: gs-feed-pulse 2.4s ease-in-out infinite;
}
@keyframes gs-feed-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }
  50%      { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.05); }
}
.gs-feed-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.gs-feed-list {
  display: flex;
  flex-direction: column;
}
.gs-feed-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  margin: 0 -0.75rem;
  border-radius: 10px;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.gs-feed-item + .gs-feed-item { margin-top: 0.1rem; }
.gs-feed-item:hover {
  background: #f8fafc;
  text-decoration: none;
  transform: translateX(2px);
}
.gs-feed-item--positive { border-left-color: #22c55e; }
.gs-feed-item--negative { border-left-color: #ef4444; }
.gs-feed-item--neutral  { border-left-color: #94a3b8; }
.gs-feed-item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.gs-feed-item-jurisdiction {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}
.gs-feed-item-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.gs-feed-item-time {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: auto;
}
/* ─── Live scanning state (jurisdiction page, 0 projects) ─────────────── */
/* Visible "we're working" surface shown when a user hits a market with no  */
/* projects yet. The gs-discovery-monitor Stimulus controller polls the    */
/* jurisdiction's status every 5s and auto-reloads when projects land.    */
.gs-scan-live-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.gs-scan-live-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #bfdbfe;
  border-top-color: #2563eb;
  animation: gs-scan-spin 0.9s linear infinite;
}
@keyframes gs-scan-spin {
  to { transform: rotate(360deg); }
}
.gs-scan-live-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.gs-scan-live-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 35%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: gs-scan-slide 1.6s ease-in-out infinite, gs-scan-shimmer 2s linear infinite;
}
@keyframes gs-scan-slide {
  0%   { left: -40%; width: 35%; }
  50%  { left: 50%;  width: 50%; }
  100% { left: 110%; width: 35%; }
}
@keyframes gs-scan-shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.gs-scan-live-status {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
}
.gs-scan-live-elapsed {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.gs-scan-live-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
}

/* ─── Admin: product-access badges + form fieldset ────────────────────── */
.product-access-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin-right: 0.3rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.gs-scan-proj-pill {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  vertical-align: middle;
}
.product-access-badge--on  { background: #dcfce7; color: #166534; }
.product-access-badge--off { background: #f1f5f9; color: #94a3b8; }
.form-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem 0.5rem;
}
.form-fieldset legend {
  padding: 0 0.4rem;
  font-weight: 600;
  color: #334155;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
}

/* ─── Jurisdiction page tabs ──────────────────────────────────────────── */
.gs-tabs { margin-top: 1.5rem; }
.gs-tab-list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.gs-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.gs-tab:hover { color: #0f172a; background: #f8fafc; }
.gs-tab--active {
  color: #0f172a;
  border-bottom-color: #0f172a;
}
.gs-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  height: 1.4rem;
}
.gs-tab--active .gs-tab-count { background: #0f172a; color: #fff; }
.gs-tab-panel { margin-top: 0; }
.gs-tab-panel[hidden] { display: none; }

/* ─── Scan list: checkboxes + bulk-delete toolbar ─────────────────────── */
.gs-scan-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.gs-scan-list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}
.gs-scan-list-toolbar[hidden] { display: none; }
.gs-scan-list-count { font-size: 0.8rem; color: #991b1b; }
.gs-scan-list-count strong { color: #7f1d1d; }
.gs-scan-list-bulk-form { display: inline-block; margin: 0; }
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
}
.btn-danger:hover { background: #b91c1c; color: #fff; }
.gs-scan-check-col {
  width: 40px;
  text-align: center;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}
.gs-scan-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #16a34a;
}
.gs-scan-table .gs-scan-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
}
.gs-scan-row-delete {
  color: #94a3b8;
  padding: 0.3rem 0.5rem !important;
}
.gs-scan-row-delete:hover { color: #dc2626; background: #fef2f2; }

/* ─── Project research card ───────────────────────────────────────────── */
.gs-research-card { padding: 1.5rem 1.75rem; }
.gs-research-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.gs-research-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.gs-research-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}
.gs-research-summary {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1f2937;
}
.gs-research-summary--pending,
.gs-research-summary--empty { color: #64748b; font-style: italic; }
.gs-research-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  animation: gs-feed-pulse 1.8s ease-in-out infinite;
  vertical-align: middle;
}
.gs-research-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gs-research-source {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #334155;
  text-decoration: none;
  max-width: 320px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gs-research-source:hover { background: #eff6ff; border-color: #93c5fd; color: #1e40af; text-decoration: none; }
.gs-research-source-host { font-weight: 600; white-space: nowrap; }
.gs-research-source-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
}

/* ─── Project fact grid ───────────────────────────────────────────────── */
.gs-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.gs-fact-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.gs-fact-card--wide { grid-column: 1 / -1; }
.gs-fact-card--highlight {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #86efac;
}
.gs-fact-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.gs-fact-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.015em;
}
.gs-fact-value--small { font-size: 0.95rem; font-weight: 500; }
.gs-fact-unit { font-size: 0.8rem; color: #64748b; font-weight: 500; margin-left: 0.15rem; }
.gs-fact-card--highlight .gs-fact-value { color: #14532d; }

.gs-forecast-pending { background: #eff6ff; border: 1px solid #bfdbfe; }
.gs-forecast-pending .pf-empty-title { color: #1e3a8a; display: inline-flex; align-items: center; gap: 0.4rem; }
.gs-forecast-pending .pf-empty-text { color: #1e40af; }

/* Definitive end state — we tried, this fact genuinely isn't public. */
/* Visually calmer than the active-polling blue; no spinner.           */
.gs-forecast-definitive {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1.5rem;
}
.gs-forecast-definitive .pf-empty-title {
  color: #334155;
  margin-bottom: 0.75rem;
}
.gs-forecast-definitive .pf-empty-text {
  color: #475569;
  margin-bottom: 0.75rem;
}
.gs-forecast-definitive .pf-empty-text:last-child { margin-bottom: 0; }

.gs-project-signal-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.gs-project-signal {
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border-left: 3px solid #22c55e;
  border-radius: 6px;
}
.gs-project-signal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: #64748b; }
.gs-project-signal-date { color: #94a3b8; }
.gs-project-signal-conf { margin-left: auto; font-weight: 600; }
.gs-project-signal-quote { margin: 0.5rem 0 0; font-size: 0.875rem; color: #334155; font-style: italic; line-height: 1.5; }

.gs-forecast-inputs { padding: 1rem 1.5rem; }
.gs-forecast-inputs-summary { cursor: pointer; font-weight: 600; color: #475569; font-size: 0.875rem; }
.gs-forecast-inputs[open] .gs-forecast-inputs-summary { color: #0f172a; }

/* ─── Projects hero on the user-facing jurisdiction page ──────────────── */
/* Clickable tiles that lead to the project overview + economic forecast.  */
/* Positioned above Evidence Timeline so a confirmed project is the first  */
/* thing a user acts on, not something buried below a wall of excerpts.    */
.gs-projects-hero {
  margin: 1.5rem 0;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.gs-projects-hero-head {
  margin-bottom: 1rem;
}
.gs-projects-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #14532d;
  background: #bbf7d0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
/* "Active in this market" (public-context) variant — amber-tinted  */
/* so it's visually distinct from the green "Discovered by GridSignal" */
/* tier but still colorful and tile-based, not a slate list.           */
.gs-projects-hero--context {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fde68a;
}
.gs-projects-hero--context .gs-projects-hero-title { color: #92400e; }
.gs-projects-hero--context .gs-projects-hero-sub { color: #b45309; }
.gs-projects-hero-eyebrow--context {
  background: #fed7aa;
  color: #9a3412;
}
.gs-project-tile--context {
  border-color: #fde68a;
}
.gs-project-tile--context:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.1);
}
.gs-project-tile--context .gs-project-tile-stage {
  color: #92400e;
  background: #fef3c7;
}
.gs-project-tile--context .gs-project-tile-cta { color: #b45309; }

.gs-project-tile-fact--loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-style: italic;
  color: #94a3b8;
  font-size: 0.75rem;
}
.gs-project-tile-fact--loading .gs-scan-live-spinner {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
}

.gs-projects-rerun {
  display: flex;
  justify-content: flex-end;
  margin: 0.75rem 0 0.25rem;
}
.gs-projects-rerun-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}
.gs-projects-rerun-btn:hover { color: #0f172a; background: transparent; }

.gs-projects-hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: gs-feed-pulse 2s ease-in-out infinite;
}
.gs-projects-hero-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #14532d;
  letter-spacing: -0.01em;
}
.gs-projects-hero-sub {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #166534;
}

.gs-project-tile-spotted {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #15803d;
  letter-spacing: 0.01em;
}

/* ─── Market context (publicly-known projects, tier-2) ────────────────── */
/* Deliberately quieter than the "Discovered by GridSignal" tier —        */
/* slate container, list-style rows, no vibrant color. These are not      */
/* the hook, they're the "so you have the full picture" context.          */
.gs-market-context {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.gs-market-context-head {
  margin-bottom: 0.75rem;
}
.gs-market-context-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.005em;
}
.gs-market-context-sub {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}
.gs-market-context-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}
.gs-market-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid #e2e8f0;
  color: #334155;
  text-decoration: none;
  transition: color 0.15s ease;
}
.gs-market-context-row:first-child { border-top: none; }
.gs-market-context-row:hover { color: #0f172a; text-decoration: none; }
.gs-market-context-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.gs-market-context-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}
.gs-market-context-facts {
  font-size: 0.8rem;
  color: #64748b;
}
.gs-market-context-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.gs-market-context-row:hover .gs-market-context-cta { color: #0f172a; }

/* ─── Project page provenance eyebrow (early vs context) ──────────────── */
.gs-project-provenance {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.gs-project-provenance--early_signal {
  color: #14532d;
  background: #bbf7d0;
}
.gs-project-provenance--public_context {
  color: #475569;
  background: #e2e8f0;
}
.gs-project-provenance-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: gs-feed-pulse 2s ease-in-out infinite;
}
.gs-projects-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.875rem;
}
.gs-project-tile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.gs-project-tile:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.12);
  border-color: #86efac;
}
.gs-project-tile-stage {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}
.gs-project-tile-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}
.gs-project-tile-aka {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #64748b;
}
.gs-project-tile-facts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.gs-project-tile-fact {
  font-size: 0.8125rem;
  color: #334155;
}
.gs-project-tile-fact strong {
  font-weight: 600;
  color: #64748b;
  margin-right: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gs-project-tile-cta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #16a34a;
}

.admin-toolbar {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}
.data-table-sub {
  display: inline-block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.4rem;
}

.gs-feed-item-quote {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #475569;
  font-style: italic;
}
@media (max-width: 640px) {
  .gs-feed { padding: 1rem 1rem 0.5rem; }
  .gs-feed-item-time { margin-left: 0; width: 100%; }
}

/* ─── GridSignal activity feed on the Alerts page ───────────────── */
.gs-activity-feed {
  margin: 0 0 2rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.gs-activity-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gs-activity-feed-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}
.gs-activity-feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}
.gs-activity-feed-unread {
  display: inline-block;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gs-activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.gs-activity-row {
  position: relative;
  display: flex;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: background 120ms ease, border-color 120ms ease;
}
.gs-activity-row:hover { background: #f1f5f9; border-color: #cbd5e1; }
.gs-activity-row--unread {
  background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 55%);
  border-color: #c7d2fe;
}
.gs-activity-row-link {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}
.gs-activity-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.gs-activity-row-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.gs-activity-row-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gs-activity-row-badge--scan       { background: #eef2ff; color: #4338ca; }
.gs-activity-row-badge--signal     { background: #ecfdf5; color: #047857; }
.gs-activity-row-badge--score      { background: #fef3c7; color: #92400e; }
.gs-activity-row-badge--moratorium { background: #fee2e2; color: #991b1b; }
.gs-activity-row-badge--load       { background: #e0f2fe; color: #075985; }
.gs-activity-row-time { font-weight: 500; }
.gs-activity-row-title {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.35;
}
.gs-activity-row-body {
  margin: 0;
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.45;
}
.gs-activity-row-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #334155;
}
.gs-activity-row-fact strong { color: #0f172a; }
.gs-activity-row-fact--muted { color: #64748b; font-style: italic; }
.gs-activity-row-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #4338ca;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.gs-activity-row-dismiss {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: #94a3b8;
  padding: 0 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.gs-activity-row-dismiss:hover { color: #334155; }
.gs-activity-row-dismiss form { margin: 0; }

@media (max-width: 640px) {
  .gs-activity-feed { padding: 1rem; }
  .gs-activity-row-link { flex-direction: column; align-items: flex-start; }
  .gs-activity-row-cta { align-self: flex-end; }
}

/* ─── Opportunity Finder (search + presets + filters) ───────────── */
.gs-opp-finder {
  margin: 1.5rem 0 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.gs-opp-finder-search-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
.gs-opp-finder-search {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 0.9rem;
  transition: border-color 120ms ease, background 120ms ease;
}
.gs-opp-finder-search:focus-within {
  border-color: #818cf8;
  background: #ffffff;
}
.gs-opp-finder-search-icon { color: #64748b; flex: 0 0 auto; }
.gs-opp-finder-search-input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  padding: 0.7rem 0.75rem;
  min-width: 0;
}
.gs-opp-finder-search-clear {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
}
.gs-opp-finder-search-clear:hover { color: #0f172a; }
.gs-opp-finder-submit { flex: 0 0 auto; }

.gs-opp-finder-lenses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}
.gs-opp-finder-lenses-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.gs-opp-finder-lens {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 120ms ease;
}
.gs-opp-finder-lens:hover {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}
.gs-opp-finder-lens--active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}

.gs-opp-finder-filters-wrap { margin-top: 1rem; }
.gs-opp-finder-filters-toggle {
  cursor: pointer;
  font-size: 0.82rem;
  color: #4338ca;
  padding: 0.3rem 0;
  font-weight: 600;
  user-select: none;
}
.gs-opp-finder-filters-toggle:hover { text-decoration: underline; }
.gs-opp-finder-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding-top: 0.75rem;
  align-items: end;
}
.gs-opp-finder-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #475569;
}
.gs-opp-finder-filters label span { font-weight: 600; }
.gs-opp-finder-filters input,
.gs-opp-finder-filters select {
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #ffffff;
}
.gs-opp-finder-filters-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  grid-column: 1 / -1;
}

.gs-opp-finder-default-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  color: #1e3a8a;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
}

/* ─── Dashboard tabs ──────────────────────────────────────────── */
.gs-dashboard-tabs { margin-top: 1rem; }

/* ─── Opportunity Finder results table ──────────────────────────── */
.gs-opp-results-card { margin-top: 1rem; }
.gs-opp-results-table th { font-size: 0.72rem; }
.gs-opp-results-table td { vertical-align: middle; }
.gs-opp-results-muted { color: #94a3b8; font-size: 0.82rem; }
.gs-opp-stage-badge {
  background: #ecfdf5;
  color: #047857;
  font-size: 0.68rem;
}
.gs-opp-results-scanned { color: #475569; font-size: 0.82rem; }
.gs-opp-results-unscanned {
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
}
.gs-opp-results-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.gs-opp-results-actions form { margin: 0; }
.gs-opp-results-watchlist-btn { white-space: nowrap; }
.gs-opp-results-watchlist-on {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  background: #ecfdf5;
  border-radius: 999px;
}
.gs-opp-results-fallback {
  padding: 1.5rem;
  margin-top: 1rem;
}
.gs-opp-finder-fallback-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.gs-my-markets-head--tab {
  padding: 0;
  display: block;
}

@media (max-width: 640px) {
  .gs-opp-finder { padding: 1rem; }
  .gs-opp-finder-search-row { flex-direction: column; }
  .gs-opp-finder-submit { width: 100%; }
  .gs-opp-finder-lenses { gap: 0.4rem; }
  .gs-opp-finder-lens { font-size: 0.75rem; padding: 0.3rem 0.65rem; }
  .gs-opp-results-table th:nth-child(3),
  .gs-opp-results-table td:nth-child(3),
  .gs-opp-results-table th:nth-child(4),
  .gs-opp-results-table td:nth-child(4),
  .gs-opp-results-table th:nth-child(5),
  .gs-opp-results-table td:nth-child(5) { display: none; }
}

/* ─── Compact single-line facts for the project hero card ───────── */
/* Rob wanted the two hero cards (signal · project) to match in size.
   Previous rendering stacked the project's facts vertically which
   made that card taller than the signal card next to it. Flatten to
   one line matching the signal card's quote line. */
.gs-hero-facts-inline {
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gs-hero-facts-inline strong { color: #0f172a; }

/* Equal heights for the two hero carousels. The signal card's
   multi-line blockquote used to make it taller than the project
   card; now we clamp the quote to 3 lines AND let CSS grid stretch
   both items to match the SHORTER natural height (project card)
   rather than the taller one. Rob's ask: shorten the market card
   to match the project card, not stretch the project card up. */
.gs-hero-row--spaced {
  align-items: stretch;  /* both grid items match row height */
}
.gs-hero-row--spaced .gs-hero-row-item {
  display: flex;
  flex-direction: column;
  min-height: 0;  /* release the previous floor */
}
.gs-hero-row--spaced .gs-hero-signals-track {
  min-height: 0;
  flex: 1 1 auto;
}
.gs-hero-quote--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.5rem 0;
}

/* ─── Results-table scanned-elsewhere badge ─────────────────────── */
.gs-opp-results-scanned-other {
  display: inline-block;
  padding: 2px 8px;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── Opportunity Finder — adopt Market Finder's filter UI ───────── */
/* Rob called out that the collapsed <details> + ad-hoc inputs block
   on the GridSignal dashboard felt like a different product from
   Market Finder's search. This glues the shared .mf-controls grid
   into the Opportunity Finder card so both sides feel like one app. */
.gs-opp-mf-controls {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.gs-opp-mf-controls .mf-controls-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, auto);
  gap: 0.85rem;
  align-items: end;
}
.gs-opp-mf-controls .mf-field { min-width: 0; }
.gs-opp-mf-controls .mf-field label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.gs-opp-mf-controls .mf-input,
.gs-opp-mf-controls .mf-select,
.gs-opp-mf-controls .mf-multiselect-toggle {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}
.gs-opp-mf-controls .mf-multiselect { position: relative; }
.gs-opp-mf-controls .mf-multiselect-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 0.4rem;
}
.gs-opp-mf-controls .mf-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
  border-radius: 4px;
}
.gs-opp-mf-controls .mf-multiselect-option:hover { background: #f1f5f9; }
.gs-opp-mf-controls .mf-multiselect-toggle.has-selections {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
  font-weight: 600;
}
.gs-opp-mf-controls .gs-opp-mf-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .gs-opp-mf-controls .mf-controls-row {
    grid-template-columns: 1fr 1fr;
  }
  .gs-opp-mf-controls .mf-field-actions { grid-column: 1 / -1; }
}

/* ─── Admin Tier A seed card ───────────────────────────────────── */
.gs-tier-a-body { padding: 0.25rem 1rem 1rem; }
.gs-tier-a-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.gs-tier-a-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 240px;
}
.gs-tier-a-field > span {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.gs-tier-a-field small {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}
.gs-tier-a-input-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}
.gs-tier-a-input-row input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 1rem;
  width: 100%;
}
.gs-tier-a-input-prefix { color: #64748b; font-weight: 600; }

.gs-tier-a-progress {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.gs-tier-a-progress--running {
  background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 100%);
  border-color: #c7d2fe;
}
.gs-tier-a-progress--done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.gs-tier-a-bar {
  margin: 0.5rem 0;
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.gs-tier-a-bar-fill {
  background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
  height: 100%;
  transition: width 0.3s ease;
}
.gs-tier-a-stats {
  font-size: 0.82rem;
  color: #475569;
}
.gs-tier-a-stats span { color: #0f172a; font-weight: 600; }

/* Tier A force-refresh checkbox + helper note */
.gs-tier-a-force {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  margin: 0.5rem 0;
  max-width: 480px;
}
.gs-tier-a-force input[type="checkbox"] { margin-top: 0.2rem; }
.gs-tier-a-force > span { display: flex; flex-direction: column; gap: 0.2rem; }
.gs-tier-a-force strong { color: #92400e; font-size: 0.9rem; }
.gs-tier-a-force small { color: #78350f; font-size: 0.78rem; line-height: 1.4; }
.gs-tier-a-recency-note {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border-radius: 6px;
  color: #475569;
}
.gs-tier-a-recency-note small { font-size: 0.78rem; line-height: 1.5; }

/* Tier A failure diagnostics panel */
.gs-tier-a-progress--warn {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}
.gs-tier-a-failures {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #d97706;
}
.gs-tier-a-failures summary {
  cursor: pointer;
  margin-bottom: 0.6rem;
  color: #78350f;
}
.gs-tier-a-failure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin: 0.4rem 0 0.75rem;
}
.gs-tier-a-failure-class {
  padding: 2px 8px;
  background: #ffffff;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  font-size: 0.78rem;
}
.gs-tier-a-failure-class code { background: transparent; padding: 0; color: #78350f; }
.gs-tier-a-failure-list {
  margin: 0;
  padding: 0 0 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.gs-tier-a-failure-list li { line-height: 1.4; }
.gs-tier-a-failure-list code {
  padding: 1px 6px;
  background: #ffffff;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #78350f;
}
.gs-tier-a-failure-hint { margin-top: 0.75rem; }
.gs-tier-a-failure-hint small { color: #78350f; line-height: 1.5; }
.gs-tier-a-failure-hint code {
  padding: 0 4px;
  background: #ffffff;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  font-size: 0.72rem;
}

/* ─── Remove-from-dashboard button variants ─────────────────────── */
/* User-scoped: deletes the user's own scans/watchlist/notifications
   for this market, doesn't touch anything shared. Styled quietly
   (slate link) since this is a routine account action, not a danger
   operation.

   The .btn-danger-outline + .gs-reset-btn classes also still ship
   because the admin-only "Reset shared data" button in the market
   header uses them. That one IS destructive across users and gets
   amber-outline styling to match. */
.btn-danger-outline {
  background: transparent;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.btn-danger-outline:hover {
  background: #fef3c7;
  color: #78350f;
  border-color: #f59e0b;
}
.gs-reset-btn svg { margin-right: 0.3rem; vertical-align: -2px; }

.gs-scan-row-remove {
  color: #64748b !important;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.gs-scan-row-remove:hover { color: #0f172a !important; }

.gs-opp-results-remove-btn {
  color: #64748b;
  font-size: 0.78rem;
  white-space: nowrap;
}
.gs-opp-results-remove-btn:hover { color: #0f172a; }

/* ─── Opportunity Finder autocomplete dropdown ──────────────────── */
/* Fires on the main search bar — type "Wichita Falls" → see the
   city/county matches → click one → scan starts immediately. Styled
   to match Market Finder's search dropdown (grouped by type with
   a badge chip + action hint on the right). */
.gs-market-search-scan-form { display: none; }

.gs-market-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  z-index: 50;
  padding: 0.3rem 0;
}
.gs-opp-finder-search { position: relative; }

.gs-market-search-group {
  padding: 0.4rem 0.9rem 0.2rem;
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.gs-market-search-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #0f172a;
  transition: background 100ms ease;
}
.gs-market-search-item:hover { background: #eef2ff; }
.gs-market-search-item:hover .gs-market-search-cta { color: #4338ca; }

.gs-market-search-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.gs-market-search-badge--city   { background: #e0f2fe; color: #075985; }
.gs-market-search-badge--county { background: #ecfccb; color: #3f6212; }
.gs-market-search-label { flex: 1 1 auto; }
.gs-market-search-cta {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}
.gs-market-search-empty {
  padding: 0.75rem 0.9rem;
  color: #64748b;
  font-size: 0.85rem;
  font-style: italic;
}
