/* style.css - Growth Engine Design System + Components */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Type scale */
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw, 0.75rem);
  --text-sm:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-lg:   clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --text-2xl:  clamp(1.5rem, 1rem + 2vw, 2.5rem);

  /* Fonts */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing (4px grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== DARK MODE (DEFAULT) ===== */
:root, [data-theme="dark"] {
  --color-bg:             #0d0f11;
  --color-surface:        #131619;
  --color-surface-2:      #1a1d22;
  --color-surface-offset: #15181c;
  --color-surface-offset-2: #1e2228;
  --color-surface-dynamic: #252a31;
  --color-divider:        #2a2f37;
  --color-border:         #333a44;

  --color-text:           #e0e2e6;
  --color-text-muted:     #8b9099;
  --color-text-faint:     #555d68;
  --color-text-inverse:   #0d0f11;

  --color-grade-aplus:    #22c55e;
  --color-grade-a:        #34d399;
  --color-grade-bplus:    #eab308;
  --color-grade-b:        #f59e0b;
  --color-grade-c:        #f97316;
  --color-grade-d:        #ef4444;

  --color-primary:        #34d399;
  --color-primary-hover:  #22c55e;
  --color-primary-active: #16a34a;
  --color-primary-highlight: #1a2e26;

  --color-success:        #22c55e;
  --color-success-highlight: #162d1e;
  --color-warning:        #eab308;
  --color-warning-highlight: #2a2510;
  --color-error:          #ef4444;
  --color-error-highlight: #2d1515;
  --color-amber:          #f59e0b;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

  /* Backward-compatible aliases used by pd-* / lrba-* / report-preview-* blocks */
  --bg-primary:       var(--color-surface);
  --bg-secondary:     var(--color-surface-2);
  --text-primary:     var(--color-text);
  --text-secondary:   var(--color-text-muted);
  --text-muted:       var(--color-text-faint);
  --border:           var(--color-border);
  --accent:           var(--color-primary);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --color-bg:             #f4f5f7;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafbfc;
  --color-surface-offset: #eef0f3;
  --color-surface-offset-2: #e5e8ec;
  --color-surface-dynamic: #dde0e5;
  --color-divider:        #d0d4da;
  --color-border:         #c0c6cf;

  --color-text:           #1a1d22;
  --color-text-muted:     #6b7280;
  --color-text-faint:     #9ca3af;
  --color-text-inverse:   #f4f5f7;

  --color-grade-aplus:    #16a34a;
  --color-grade-a:        #059669;
  --color-grade-bplus:    #ca8a04;
  --color-grade-b:        #d97706;
  --color-grade-c:        #ea580c;
  --color-grade-d:        #dc2626;

  --color-primary:        #059669;
  --color-primary-hover:  #047857;
  --color-primary-active: #065f46;
  --color-primary-highlight: #d1fae5;

  --color-success:        #16a34a;
  --color-success-highlight: #dcfce7;
  --color-warning:        #ca8a04;
  --color-warning-highlight: #fef9c3;
  --color-error:          #dc2626;
  --color-error-highlight: #fee2e2;
  --color-amber:          #d97706;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* ===== DASHBOARD LAYOUT ===== */
html, body { height: 100%; margin: 0; }

.dashboard {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 50;
  padding: var(--space-3) var(--space-4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
}

.logo-text {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  white-space: nowrap;
  display: none;
}

@media (min-width: 768px) {
  .logo-subtitle { display: block; }
}

/* Nav tabs */
.nav-tabs {
  display: flex;
  gap: var(--space-1);
  margin-left: var(--space-4);
  flex-shrink: 0;
}

.nav-tab {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
  white-space: nowrap;
}

.nav-tab:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.nav-tab.active { background: var(--color-primary-highlight); color: var(--color-primary); }
a.nav-tab-link { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--color-border); background: transparent; }
a.nav-tab-link:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-highlight); }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}

.filter-select, .filter-input {
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text);
  min-width: 0;
  transition: border-color var(--transition-interactive);
}

.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.filter-input { width: 140px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.icon-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

/* Look up address - pill button in header-actions */
.btn-lookup {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary, #0d0f11);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: background var(--transition-interactive), transform var(--transition-interactive);
}
.btn-lookup:hover { background: var(--color-primary-hover, var(--color-primary)); transform: translateY(-1px); }
.btn-lookup svg { stroke-width: 2.4; }

/* Task 13 (Ali 21 May): Lookup pill living inside the stats strip, left of
   the Live badge. Persistent (no auto-hide). Sized to match strip type. */
.btn-lookup-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid #38bdf8;
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-lookup-strip:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56,189,248,0.35);
}
.btn-lookup-strip svg { stroke-width: 2.4; }

/* Library pill (sibling of lookup pill) - gold to echo the starred-deal theme */
.btn-library-strip {
  border-color: #fbbf24;
  background: #fbbf24;
  color: #0f172a;
}
.btn-library-strip:hover {
  background: #fcd34d;
  border-color: #fcd34d;
  box-shadow: 0 4px 12px rgba(251,191,36,0.35);
}

/* Ad-hoc lookup modal */
.lookup-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(4px);
  padding: 16px;
}
.lookup-overlay.open { display: flex; }
.lookup-card {
  width: 100%; max-width: 520px;
  background: var(--color-surface, #131619);
  border: 1px solid var(--color-border, #2a2f37);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  padding: 24px;
  color: var(--color-text);
}
.lookup-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.lookup-card-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.lookup-card-sub { font-size: 13px; line-height: 1.5; color: var(--color-text-muted, #8b9099); margin: 0; }
.lookup-form { display: flex; flex-direction: column; gap: 10px; }
.lookup-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); font-weight: 600; }
.lookup-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-bg, #0d0f11);
  border: 1px solid var(--color-border, #2a2f37);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  transition: border-color var(--transition-interactive);
}
.lookup-input:focus { outline: none; border-color: var(--color-primary); }
.lookup-hint { font-size: 12px; color: var(--color-text-faint, #6b7280); margin: 0; }
.lookup-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.lookup-actions .btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 13px; }
.lookup-actions .btn-primary[disabled] { opacity: 0.6; cursor: progress; }
.lookup-status { font-size: 12.5px; line-height: 1.5; min-height: 18px; color: var(--color-text-muted); margin-top: 6px; }
.lookup-status.error { color: #f87171; }
.lookup-status.info  { color: #38bdf8; }
.lookup-status.success { color: #34d399; }

/* Pending-suburb card (auto-onboard polling) */
.pending-card {
  position: fixed; right: 24px; bottom: 24px; z-index: 8500;
  width: 320px; max-width: calc(100vw - 32px);
  background: var(--color-surface, #131619);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  color: var(--color-text);
  font-size: 13px; line-height: 1.5;
}
.pending-card h4 { font-size: 14px; margin: 0 0 6px; color: #f59e0b; font-weight: 700; }
.pending-card p { font-size: 12.5px; margin: 0 0 8px; color: var(--color-text-muted); }
.pending-card .pending-meta { font-size: 11px; color: var(--color-text-faint); }
.pending-card .pending-spinner {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #f59e0b; margin-right: 6px;
  animation: pendingPulse 1.4s ease-in-out infinite;
}
@keyframes pendingPulse { 0%,100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }
.pending-card-close {
  position: absolute; top: 8px; right: 10px; background: transparent; border: 0;
  color: var(--color-text-faint); cursor: pointer; font-size: 16px; line-height: 1;
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ===== MAP VIEW ===== */
.map-section {
  position: relative;
  height: 55vh;
  min-height: 350px;
  flex-shrink: 0;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Prevent map from stealing scroll/touch when user scrolls the page */
  touch-action: pan-y pinch-zoom;
}

.map-legend {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
  font-size: var(--text-xs);
}

.legend-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== TABLE SECTION ===== */
.table-section {
  padding: var(--space-4);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.table-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  font-size: var(--text-xs);
  border-collapse: collapse;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-surface-offset);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-interactive);
}

.data-table th:hover { color: var(--color-text); }
.data-table th.sorted { color: var(--color-primary); }
.data-table th .sort-arrow { font-size: 0.65em; margin-left: var(--space-1); }

.data-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-interactive);
}

.data-table tbody tr:hover { background: var(--color-surface-offset); }
.data-table tbody tr.selected { background: var(--color-primary-highlight); }

.suburb-name {
  font-weight: 500;
  color: var(--color-text);
}

.state-badge {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--color-surface-dynamic);
  color: var(--color-text-muted);
}

.price-cell {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.score-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
}

.grade-aplus { background: color-mix(in oklch, var(--color-grade-aplus) 18%, var(--color-surface)); color: var(--color-grade-aplus); }
.grade-a { background: color-mix(in oklch, var(--color-grade-a) 18%, var(--color-surface)); color: var(--color-grade-a); }
.grade-bplus { background: color-mix(in oklch, var(--color-grade-bplus) 18%, var(--color-surface)); color: var(--color-grade-bplus); }
.grade-b { background: color-mix(in oklch, var(--color-grade-b) 18%, var(--color-surface)); color: var(--color-grade-b); }
.grade-c { background: color-mix(in oklch, var(--color-grade-c) 18%, var(--color-surface)); color: var(--color-grade-c); }
.grade-d { background: color-mix(in oklch, var(--color-grade-d) 18%, var(--color-surface)); color: var(--color-grade-d); }

/* ===== HOTSPOTTING BAND BADGES ===== */
.band-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.band-bestbuy {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}
.band-hot {
  background: rgba(244,63,94,0.15);
  color: #f43f5e;
  border: 1px solid rgba(244,63,94,0.3);
}
.band-rising {
  background: rgba(56,189,248,0.15);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.3);
}
.band-default {
  background: rgba(107,114,128,0.12);
  color: #6b7280;
  border: 1px solid rgba(107,114,128,0.25);
}

/* ===== HOTSPOTTING INTEL SECTIONS (suburb detail) ===== */
.hs-intel-block {
  margin-bottom: var(--space-2);
}
.hs-verdict {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid #f59e0b;
  background: rgba(245,158,11,0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}
.hs-drivers-list,
.hs-infra-list {
  margin: 0;
  padding: 0 0 0 var(--space-4);
  list-style: disc;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.hs-drivers-list li,
.hs-infra-list li {
  margin-bottom: var(--space-1);
}
.hs-dollar {
  color: var(--color-success);
  font-weight: 700;
}
.hs-lga-thesis {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
}

/* ===== SOURCE BADGES ===== */
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  gap: 3px;
}
.source-hotspotting {
  background: color-mix(in oklch, #f59e0b 16%, var(--color-surface));
  color: #f59e0b;
  border: 1px solid color-mix(in oklch, #f59e0b 25%, transparent);
}
.source-hotspotting::before {
  content: '\2605';
  font-size: 0.5rem;
}
.source-htag {
  background: color-mix(in oklch, #22b8cf 16%, var(--color-surface));
  color: #22b8cf;
  border: 1px solid color-mix(in oklch, #22b8cf 25%, transparent);
}
.source-htag::before {
  content: '\25C6';
  font-size: 0.45rem;
}
.source-proptrack {
  background: color-mix(in oklch, #f97316 16%, var(--color-surface));
  color: #f97316;
  border: 1px solid color-mix(in oklch, #f97316 25%, transparent);
}
.source-proptrack::before {
  content: '\25B2';
  font-size: 0.4rem;
}

/* ===== DEX SCORES ===== */
.dex-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
}
.dex-score-card {
  text-align: center;
}
.dex-score-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.dex-score-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: var(--space-1);
}
.dex-score-bar {
  height: 4px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.dex-score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}
.dex-score {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-xs);
}
.dex-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid;
}
.dex-badge.dex-na {
  color: var(--color-text-faint);
  border-color: var(--color-text-faint);
}

/* ===== THERMOMETER BADGES ===== */
.thermo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
  background: color-mix(in oklch, currentColor 12%, var(--color-surface));
  white-space: nowrap;
}

/* ===== PPI BADGES ===== */
.ppi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ppi-rising    { background: color-mix(in oklch, var(--color-grade-aplus) 18%, var(--color-surface)); color: var(--color-grade-aplus); }
.ppi-consistent { background: color-mix(in oklch, var(--color-grade-a) 18%, var(--color-surface)); color: var(--color-grade-a); }
.ppi-recovery  { background: color-mix(in oklch, var(--color-grade-bplus) 18%, var(--color-surface)); color: var(--color-grade-bplus); }
.ppi-plateau   { background: var(--color-surface-dynamic); color: var(--color-text-muted); }
.ppi-declining { background: color-mix(in oklch, var(--color-grade-d) 18%, var(--color-surface)); color: var(--color-grade-d); }
.ppi-snr       { background: var(--color-surface-2); color: var(--color-text-faint); }

.pct-cell {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.pct-positive { color: var(--color-success); }
.pct-negative { color: var(--color-error); }
.pct-neutral { color: var(--color-text-muted); }

/* ===== DETAIL PANEL ===== */
.detail-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 95vw;
  z-index: 100;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-overlay.open { transform: translateX(0); }

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-backdrop.open { opacity: 1; pointer-events: auto; }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 5;
}

.detail-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.detail-state {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.detail-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.detail-close:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

.detail-body { padding: var(--space-4); }

/* Grade hero in detail */
.detail-grade-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.detail-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.detail-grade-info { flex: 1; }
.detail-grade-label { font-size: var(--text-xl); font-weight: 700; }
.detail-grade-explain { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); line-height: 1.5; }

/* Metric cards grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.metric-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  border: 1px solid var(--color-divider);
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.metric-value {
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

.metric-delta {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  margin-top: var(--space-1);
}

/* Radar chart container */
.chart-container {
  margin-bottom: var(--space-4);
}

.chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

/* Score breakdown */
.score-breakdown {
  margin-bottom: var(--space-4);
}

.score-bar-group {
  margin-bottom: var(--space-3);
}

.score-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}

.score-bar-label { color: var(--color-text-muted); }
.score-bar-value { font-family: var(--font-mono); font-weight: 600; }

.score-bar-track {
  height: 6px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Adjacent suburbs */
.adjacent-section { margin-bottom: var(--space-4); }

.adjacent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
}

.adjacent-name { color: var(--color-text); }
.adjacent-gap { font-family: var(--font-mono); color: var(--color-primary); }

/* Detail panel - listings CTA */
.detail-listings-box {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.detail-listings-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.detail-listings-header svg {
  color: var(--color-primary);
  flex-shrink: 0;
}
.detail-listings-dual {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-success, #16a34a);
  margin-bottom: var(--space-2);
}
.detail-listings-dual svg {
  color: var(--color-success, #16a34a);
}
.detail-listings-btn {
  width: 100%;
  margin-top: var(--space-2);
}
.detail-listings-empty {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.detail-listings-empty svg {
  color: var(--color-text-faint);
}

/* ===== INSIGHTS VIEW ===== */
.insights-view { padding: var(--space-4); }

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
  gap: var(--space-4);
}

.insight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.insight-card-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insight-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
}

.insight-card-badge {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.insight-list { padding: 0; }

.insight-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  transition: background var(--transition-interactive);
  cursor: pointer;
}

.insight-list-item:hover { background: var(--color-surface-offset); }
.insight-list-item:last-child { border-bottom: none; }

.insight-rank {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-faint);
  min-width: 20px;
}

.insight-suburb { flex: 1; font-weight: 500; color: var(--color-text); }
.insight-state { color: var(--color-text-faint); }
.insight-score { font-family: var(--font-mono); font-weight: 600; }
.insight-price { font-family: var(--font-mono); color: var(--color-text-muted); }

/* ===== METHODOLOGY VIEW ===== */
.methodology-view {
  padding: var(--space-4);
  max-width: 860px;
  margin: 0 auto;
}

.methodology-view h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: var(--space-8) 0 var(--space-4);
  letter-spacing: -0.01em;
}

.methodology-view h2:first-of-type { margin-top: 0; }

.methodology-view h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: var(--space-6) 0 var(--space-3);
}

.methodology-view p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.7;
}

.methodology-view a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-interactive);
}

.methodology-view a:hover { color: var(--color-primary-hover); }

.factor-table {
  width: 100%;
  margin: var(--space-4) 0;
  font-size: var(--text-xs);
}

.factor-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
}

.factor-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
}

.factor-table td:first-child { color: var(--color-text); font-weight: 500; }

.grade-scale {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.grade-scale-item {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--color-divider);
}

.grade-scale-grade { font-size: var(--text-lg); font-weight: 700; }
.grade-scale-range { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ===== HELP OVERLAY ===== */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.help-overlay.open { display: flex; }

.help-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.help-card h2 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-4); }

.help-step {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.help-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.help-step-text { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
.help-step-text strong { color: var(--color-text); }

.help-dismiss {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-align: center;
  transition: background var(--transition-interactive);
  margin-top: var(--space-4);
}

.help-dismiss:hover { background: var(--color-primary-hover); }

/* ===== PULSE ANIMATION (A+ markers) ===== */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

.marker-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

/* ===== LEAFLET OVERRIDES (dark mode tiles) ===== */
.leaflet-container {
  background: var(--color-bg) !important;
  touch-action: pan-y pinch-zoom !important;
}

/* Override Leaflet's default touch-action:none which blocks page scroll */
.leaflet-container .leaflet-tile-pane,
.leaflet-container .leaflet-overlay-pane,
.leaflet-container .leaflet-marker-pane {
  touch-action: pan-y pinch-zoom !important;
}

.dark-tiles {
  filter: brightness(0.65) invert(1) contrast(2.8) hue-rotate(200deg) saturate(0.2) brightness(0.6);
}

[data-theme="light"] .dark-tiles {
  filter: none;
}

.leaflet-control-zoom a {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--color-border);
}

.leaflet-popup-tip { background: var(--color-surface) !important; }

.leaflet-popup-close-button {
  color: var(--color-text-muted) !important;
  font-size: 18px !important;
}
.leaflet-popup-close-button:hover { color: var(--color-text) !important; }

.leaflet-popup-content {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  margin: var(--space-3) !important;
  line-height: 1.5;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .filter-bar { order: 3; width: 100%; padding-top: var(--space-2); }
  .nav-tabs { order: 2; }
  .header-actions { order: 4; }
  .filter-input { width: 100px; }
  .map-section { height: 45vh; min-height: 280px; }
  .detail-overlay { width: 100%; max-width: 100%; }
  .insights-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .nav-tabs { display: none; }
  .logo-subtitle { display: none; }
}

/* ===== LOADING STATE ===== */
.loading-shimmer {
  background: linear-gradient(90deg, var(--color-surface-offset) 25%, var(--color-surface-dynamic) 50%, var(--color-surface-offset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== SCROLLBAR STYLING ===== */
.main::-webkit-scrollbar,
.detail-overlay::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar { width: 6px; height: 6px; }

.main::-webkit-scrollbar-track,
.detail-overlay::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track { background: transparent; }

.main::-webkit-scrollbar-thumb,
.detail-overlay::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
}

.main::-webkit-scrollbar-thumb:hover,
.detail-overlay::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--color-border); }

/* Popup styles */
.popup-header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.popup-name { font-weight: 600; font-size: var(--text-sm); }
.popup-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); }
.popup-metric-label { font-size: 0.65rem; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.popup-metric-value { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; }

/* ===== LISTINGS VIEW ===== */
.listings-view {
  padding: var(--space-4);
}

.listings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.listings-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.listings-count-badge {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  background: var(--color-surface-dynamic);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.listings-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* Listing card */
.listing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive), border-color var(--transition-interactive);
  cursor: default;
}

.listing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-text-faint);
}

.listing-card-header {
  position: relative;
  padding: var(--space-3) var(--space-3) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 28px;
}

.listing-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
}

.listing-score-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-faint);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.listing-card-body {
  padding: var(--space-2) var(--space-3) var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Task 15 (Ali 21 May): listing thumbnail. 4:3 aspect, fills card width, */
/* clipped corners so it nests against the card edge above the address. */
.listing-thumb {
  position: relative;
  width: calc(100% + var(--space-3) * 2);
  margin: 0 calc(var(--space-3) * -1) var(--space-2);
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2, #0f172a);
  overflow: hidden;
  border-bottom: 1px solid var(--color-divider, #1e293b);
}
.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-thumb-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, rgba(148,163,184,0.04) 0 12px, rgba(148,163,184,0.08) 12px 24px);
  color: var(--color-text-faint, #64748b);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.listing-thumb-pending span { opacity: 0.7; }


.listing-address {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin-top: var(--space-1);
}

.listing-price {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.listing-specs {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.listing-spec {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.listing-spec svg {
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.listing-suburb-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.listing-suburb-name {
  font-weight: 500;
  color: var(--color-text-muted);
}

.listing-dom {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.listing-dom.dom-fresh { color: var(--color-success); }
.listing-dom.dom-recent { color: var(--color-text-muted); }
.listing-dom.dom-stale { color: var(--color-warning); }

.listing-divider {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin: 0;
}

.listing-agent-section {
  padding: var(--space-2) var(--space-3);
}

.listing-agent-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.listing-agent-agency {
  font-size: 0.65rem;
  color: var(--color-text-faint);
  margin-top: 1px;
}

.listing-why {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-raised);
  border-top: 1px solid var(--color-divider);
}

.listing-why-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 3px;
}

.listing-why-text {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-3);
}
.listing-actions .btn-site-link {
  flex: 1;
  min-width: 0;
}
.listing-actions .btn-primary {
  flex: 1;
  min-width: 0;
}
/* When 3 buttons (dual-listed): stack site links on one row, contact below */
.listing-actions:has(.btn-site-link + .btn-site-link) .btn-primary {
  flex-basis: 100%;
}

.dual-listed-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-3) var(--space-3);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--color-success, #16a34a);
  letter-spacing: 0.02em;
}
.dual-listed-badge svg {
  color: var(--color-success, #16a34a);
  flex-shrink: 0;
}

/* Shared button styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive), opacity var(--transition-interactive);
  white-space: nowrap;
  text-align: center;
  border: 1px solid var(--color-primary);
}

.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
  white-space: nowrap;
  text-align: center;
}

.btn-secondary:hover {
  background: var(--color-primary-highlight);
}

/* Listings empty state */
.listings-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* ===== CONTACT AGENT MODAL ===== */
.contact-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.contact-modal-overlay.open { display: flex; }

.contact-modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.contact-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.contact-modal-agent-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.contact-modal-agency {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.contact-modal-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-modal-contact-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.contact-modal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.contact-modal-link:hover { color: var(--color-primary-hover); }

.contact-modal-message-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-modal-textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  box-sizing: border-box;
  transition: border-color var(--transition-interactive);
}

.contact-modal-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact-modal-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.contact-modal-actions .btn-secondary,
.contact-modal-actions .btn-primary {
  flex: 1;
  min-width: 120px;
}

/* Copy success feedback */
.btn-secondary.copied {
  background: var(--color-success-highlight);
  color: var(--color-success);
  border-color: var(--color-success);
}

/* ===== LISTINGS RESPONSIVE ===== */
@media (max-width: 1100px) {
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .listings-header { flex-direction: column; align-items: flex-start; }
  .listings-filters { width: 100%; }
  .listings-grid { grid-template-columns: 1fr; }
  .contact-modal-actions .btn-secondary,
  .contact-modal-actions .btn-primary { min-width: 0; }
}

@media (max-width: 480px) {
  .listings-grid { grid-template-columns: 1fr; }
  .listing-specs { flex-wrap: wrap; }
}

/* ===== PAGINATION ===== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.pagination-btn {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--text-xs);
  cursor: pointer;
  min-width: 32px;
  text-align: center;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pagination-btn:hover:not(:disabled) {
  background: var(--color-surface-3, var(--color-surface-dynamic));
  border-color: var(--color-text-muted);
}
.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pagination-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.pagination-ellipsis {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  padding: 0 var(--space-1);
}
.pagination-size {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.pagination-size label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.pagination-size select {
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--text-xs);
  cursor: pointer;
}

/* ===== OFF-MARKET ===== */
.offmarket-view {
  padding: var(--space-4);
  max-width: 1400px;
  margin: 0 auto;
}
.offmarket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.offmarket-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.offmarket-count-badge {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.offmarket-filters {
  display: flex;
  gap: var(--space-2);
}
.offmarket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--space-4);
}
.offmarket-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.offmarket-card-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}
.offmarket-card-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.offmarket-suburb-name {
  font-weight: 600;
  font-size: var(--text-sm);
}
.offmarket-card-body {
  padding: var(--space-3) var(--space-4);
}
.offmarket-section {
  margin-bottom: var(--space-3);
}
.offmarket-section:last-child {
  margin-bottom: 0;
}
.offmarket-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.offmarket-streets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.street-pill {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: color-mix(in oklch, var(--color-primary) 15%, var(--color-surface-2));
  border: 1px solid color-mix(in oklch, var(--color-primary) 30%, var(--color-border));
  font-size: var(--text-xs);
  color: var(--color-text);
  font-family: var(--font-mono);
}
.offmarket-rationale {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: var(--space-2);
}
.offmarket-signals {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.offmarket-signal-label {
  font-weight: 600;
  color: var(--color-text);
  display: inline;
}
.offmarket-signal-item {
  margin-bottom: var(--space-2);
}
.offmarket-signal-item:last-child {
  margin-bottom: 0;
}
.offmarket-land-size {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.offmarket-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  margin-right: var(--space-1);
  animation: livePulse 2s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Off-market links */
.offmarket-signals a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.offmarket-signals a:hover { color: var(--color-primary-hover); }

/* Off-market responsive */
@media (max-width: 768px) {
  .offmarket-grid { grid-template-columns: 1fr; }
  .offmarket-header { flex-direction: column; align-items: flex-start; }
  .offmarket-filters { width: 100%; }
  .pagination-bar { flex-direction: column; align-items: flex-start; }
}

/* ===== TREND INDICATORS (table arrows) ===== */
.trend-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65em;
  font-style: normal;
  margin-left: 3px;
  line-height: 1;
  vertical-align: middle;
  font-variant-numeric: normal;
}
.trend-arrow.trend-up   { color: var(--color-success); }
.trend-arrow.trend-down { color: var(--color-error); }
.trend-arrow.trend-flat { color: var(--color-text-faint); }

/* ===== SPARKLINES (detail panel) ===== */
.sparkline-section {
  margin-bottom: var(--space-4);
}
.sparkline-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.sparkline-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.sparkline-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.sparkline-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.sparkline-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sparkline-canvas-wrap canvas {
  display: block;
  max-width: 100%;
}
.sparkline-insufficient {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
  padding: var(--space-3) 0;
  font-style: italic;
}

/* ===== TRENDS VIEW ===== */
.trends-view {
  padding: var(--space-4);
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.trends-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.trends-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Momentum summary cards */
.trends-momentum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-3);
}
.trends-momentum-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.trends-momentum-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.trends-momentum-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text);
  line-height: 1.1;
}
.trends-momentum-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
  font-family: var(--font-mono);
}
.trends-momentum-value.value-positive { color: var(--color-success); }
.trends-momentum-value.value-negative { color: var(--color-error); }
.trends-momentum-value.value-neutral  { color: var(--color-text); }

/* Grade movement timeline */
.trends-grade-timeline {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.trends-grade-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  transition: background var(--transition-interactive);
}
.trends-grade-row:last-child { border-bottom: none; }
.trends-grade-row:hover { background: var(--color-surface-offset); }
.trends-grade-date {
  font-family: var(--font-mono);
  color: var(--color-text-faint);
  min-width: 80px;
  flex-shrink: 0;
}
.trends-grade-suburb {
  flex: 1;
  font-weight: 500;
  color: var(--color-text);
  min-width: 120px;
}
.trends-grade-state {
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.trends-grade-change {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.trends-grade-arrow {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.trends-grade-type {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.trends-grade-type.type-promotion {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.trends-grade-type.type-demotion {
  background: var(--color-error-highlight);
  color: var(--color-error);
}
.trends-grade-type.type-initial {
  background: var(--color-surface-dynamic);
  color: var(--color-text-faint);
}
.trends-grade-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* Suburb metric charts */
.trends-charts-grid {
  width: 100%;
}
.trends-chart-placeholder {
  padding: var(--space-10);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
}
.trends-charts-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.trends-chart-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.trends-chart-card--full {
  grid-column: 1 / -1;
}
.trends-chart-insufficient {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  font-style: italic;
}

/* Listing flow */
.trends-listing-flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.trends-listing-flow-legend {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.trends-flow-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.trends-flow-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== TRENDS RESPONSIVE ===== */
@media (max-width: 768px) {
  .trends-momentum-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trends-charts-inner {
    grid-template-columns: 1fr;
  }
  .trends-grade-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .trends-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .trends-momentum-grid {
    grid-template-columns: 1fr;
  }
  .sparkline-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== SHORTLIST SYSTEM ===== */

/* Shortlist buttons on card header */
.shortlist-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.sl-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  padding: 0;
}

.sl-btn:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-secondary);
}

.sl-heart.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

.sl-reject.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

/* Rejected card dimming */
.listing-rejected {
  opacity: 0.5;
}

.listing-rejected:hover {
  opacity: 0.75;
}

/* Shortlisted card left accent */
.listing-shortlisted {
  border-left: 3px solid #22c55e;
}

/* Shortlist filter bar */
.shortlist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.sl-filter-group {
  display: flex;
  gap: 4px;
  background: var(--color-surface-raised);
  border-radius: 6px;
  padding: 3px;
}

.sl-filter-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.sl-filter-btn:hover {
  color: var(--color-text-primary);
  background: rgba(255,255,255,0.05);
}

.sl-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
}

/* Share action buttons */
.sl-share-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-share:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* Share mode header */
.share-mode-header {
  padding: 32px 24px 24px;
  text-align: center;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 16px;
}

.share-mode-inner {
  max-width: 480px;
  margin: 0 auto;
}

.share-mode-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.share-mode-logo .logo-mark {
  width: 24px;
  height: 24px;
}

.share-mode-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.share-mode-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.share-mode-sub {
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

/* Toast notification */
.ge-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid var(--color-divider);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  pointer-events: none;
}

.ge-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .shortlist-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .sl-filter-group {
    overflow-x: auto;
  }
  .sl-share-actions {
    justify-content: stretch;
  }
  .sl-share-actions .btn-share {
    flex: 1;
    justify-content: center;
  }
}

/* ===== LISTING CARD BADGES (walkability, price, noise, green) ===== */
.listing-price-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.price-position-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.pp-below { background: rgba(34,197,94,0.15); color: #16a34a; }
.pp-above { background: rgba(239,68,68,0.15); color: #dc2626; }
.pp-at { background: rgba(148,163,184,0.12); color: var(--text-muted); }

/* Pricing tier badges */
.tier-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tier-5 { background: rgba(59,130,246,0.12); color: #2563eb; }
.tier-4 { background: rgba(34,197,94,0.12); color: #16a34a; }
.tier-3 { background: rgba(234,179,8,0.12); color: #a16207; }
.tier-2 { background: rgba(249,115,22,0.12); color: #c2410c; }
.tier-1 { background: rgba(168,85,247,0.12); color: #7c3aed; }
.tier-over { background: rgba(239,68,68,0.1); color: #dc2626; }
.tier-under { background: rgba(148,163,184,0.1); color: var(--text-muted); }

.listing-badges-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.walk-badge, .noise-badge, .green-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.walk-badge svg, .noise-badge svg, .green-badge svg { flex-shrink: 0; }
.walk-high { background: rgba(34,197,94,0.12); color: #16a34a; }
.walk-med { background: rgba(234,179,8,0.12); color: #a16207; }
.walk-low { background: rgba(239,68,68,0.1); color: #dc2626; }
.noise-high { background: rgba(239,68,68,0.1); color: #dc2626; }
.noise-moderate { background: rgba(234,179,8,0.12); color: #a16207; }
.noise-low { background: rgba(34,197,94,0.1); color: #16a34a; }
.green-badge { background: rgba(34,197,94,0.1); color: #16a34a; }

/* ===== QUALITY SCORE BADGES ===== */
.quality-scores-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.qs-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  cursor: default;
}
.qs-badge svg { flex-shrink: 0; opacity: 0.7; }
.qs-green { background: rgba(34,197,94,0.13); color: #22c55e; }
.qs-blue { background: rgba(59,130,246,0.13); color: #60a5fa; }
.qs-amber { background: rgba(234,179,8,0.13); color: #eab308; }
.qs-red { background: rgba(239,68,68,0.13); color: #ef4444; }
.qs-none { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.3); }
.qs-overall {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  margin-left: 2px;
}
.qs-reno {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(234,179,8,0.85);
  margin-left: auto;
  white-space: nowrap;
}

/* ===== PROPERTY DETAIL QUALITY ASSESSMENT ===== */
.pd-quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.pd-quality-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px;
}
.pd-qc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.pd-qc-icon { font-size: 0.85rem; }
.pd-qc-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  flex: 1;
}
.pd-qc-grade {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.pd-qc-green .pd-qc-grade { color: #22c55e; }
.pd-qc-blue .pd-qc-grade { color: #60a5fa; }
.pd-qc-amber .pd-qc-grade { color: #eab308; }
.pd-qc-red .pd-qc-grade { color: #ef4444; }
.pd-qc-none .pd-qc-grade { color: rgba(255,255,255,0.3); }
.pd-qc-green { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.04); }
.pd-qc-blue { border-color: rgba(59,130,246,0.2); background: rgba(59,130,246,0.04); }
.pd-qc-amber { border-color: rgba(234,179,8,0.2); background: rgba(234,179,8,0.04); }
.pd-qc-red { border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.04); }
.pd-qc-meta {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.pd-qc-obs {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.35;
  margin-bottom: 2px;
}
.pd-qc-reno {
  font-size: 0.65rem;
  color: rgba(234,179,8,0.8);
  font-weight: 600;
  margin-top: 4px;
}
.pd-quality-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.pd-qs-overall {
  font-weight: 800;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.pd-qs-photos {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
}
.pd-qs-reno {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(234,179,8,0.85);
  margin-left: auto;
}
@media (max-width: 480px) {
  .pd-quality-grid { grid-template-columns: 1fr; }
}

/* ===== PROPERTY DETAIL MODAL ===== */
.pd-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
}
.pd-overlay.open {
  pointer-events: auto;
  visibility: visible;
}
.pd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pd-overlay.open .pd-backdrop { opacity: 1; }
.pd-card {
  position: relative;
  width: 440px;
  max-width: 96vw;
  height: 100vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.45);
  padding: var(--space-5);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  color: var(--color-text);
}
.pd-overlay.open .pd-card {
  transform: translateX(0);
}
.pd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.pd-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pd-sl-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.pd-sl-shortlisted { background: rgba(34,197,94,0.15); color: #16a34a; }
.pd-sl-rejected { background: rgba(239,68,68,0.1); color: #dc2626; }
.pd-address {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.pd-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}
.pd-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 3px;
}
.pd-specs {
  display: flex;
  gap: var(--space-3);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.pd-section {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.pd-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pd-walk-score {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0;
}

/* Price positioning bar */
.pd-pp-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #22c55e 0%, #94a3b8 50%, #ef4444 100%);
  margin: var(--space-3) 0 var(--space-1) 0;
}
.pd-pp-marker {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pd-pp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.pd-pp-stats {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.pd-stat {
  display: flex;
  flex-direction: column;
}
.pd-stat-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pd-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Walkability category bars */
.pd-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pd-cat-name {
  width: 80px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.pd-cat-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}
.pd-cat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.pd-cat-score {
  width: 24px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}
.pd-amenity-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Nearest amenities grid */
.pd-amenities-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pd-amenity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 3px 0;
}
.pd-amenity-icon { font-size: 0.85rem; width: 20px; text-align: center; flex-shrink: 0; }
.pd-amenity-type { color: var(--text-secondary); text-transform: capitalize; min-width: 80px; }
.pd-amenity-name { color: var(--text-primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-amenity-dist { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }

/* Environment */
.pd-env-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
}

/* Suburb metrics grid */
.pd-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.pd-metric {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  padding: 8px;
  border-radius: 6px;
}
.pd-metric-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pd-metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* WHY section */
.pd-why {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Agent section */
.pd-agent {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Actions */
.pd-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}
.pd-actions .btn-secondary, .pd-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

/* Mobile responsive */
@media (max-width: 520px) {
  .pd-card {
    width: 100vw;
    max-width: 100vw;
  }
  .pd-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== LRBA CALCULATOR ===== */
.lrba-section { border: 1px solid var(--accent); border-radius: 8px; padding: var(--space-4); margin: var(--space-4) calc(-1 * var(--space-2)); background: rgba(0,210,190,0.03); }
.lrba-form { display: flex; flex-direction: column; gap: 10px; }
.lrba-row { display: flex; align-items: center; gap: 8px; }
.lrba-row label { width: 110px; font-size: 0.78rem; color: var(--text-secondary); flex-shrink: 0; }
.lrba-input { flex: 1; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; font-size: 0.82rem; color: var(--text-primary); outline: none; font-family: inherit; }
.lrba-input:focus { border-color: var(--accent); }
.lrba-range-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.lrba-range { flex: 1; accent-color: var(--accent); }
.lrba-range-wrap span { font-size: 0.78rem; font-weight: 600; color: var(--accent); min-width: 42px; text-align: right; }
.lrba-calc-btn { margin-top: 6px; width: 100%; justify-content: center; }
.lrba-results { margin-top: var(--space-3); }
.lrba-results-header { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.lrba-card { background: var(--bg-secondary); border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.lrba-card-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.lrba-line { display: flex; justify-content: space-between; font-size: 0.78rem; padding: 3px 0; color: var(--text-secondary); }
.lrba-line span:last-child { font-weight: 600; color: var(--text-primary); }
.lrba-total { font-weight: 700 !important; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px; }
.lrba-total span { color: var(--text-primary) !important; font-weight: 700 !important; }
.lrba-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lrba-metric { text-align: center; padding: 8px; background: var(--bg-primary); border-radius: 6px; }
.lrba-metric-val { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.lrba-metric-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lrba-note { font-size: 0.68rem; color: var(--text-muted); line-height: 1.4; margin-top: 10px; padding: 8px 10px; background: var(--bg-secondary); border-radius: 4px; }
.lrba-report-actions { margin-top: 12px; }
.lrba-report-btn { width: 100%; justify-content: center; }

/* ===== REPORT PREVIEW OVERLAY ===== */
.report-preview-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.report-preview-overlay.open { opacity: 1; pointer-events: auto; }
.report-preview-card {
  width: 90vw; max-width: 880px; height: 90vh;
  background: var(--bg-primary); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  transform: scale(0.95); transition: transform 0.3s ease;
}
.report-preview-overlay.open .report-preview-card { transform: scale(1); }
.report-preview-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.report-preview-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.report-preview-actions { display: flex; gap: 8px; align-items: center; }
.report-preview-iframe { flex: 1; border: none; width: 100%; background: #f8fafc; }

@media (max-width: 600px) {
  .report-preview-card { width: 100vw; height: 100vh; border-radius: 0; }
  .report-preview-actions .btn-secondary span { display: none; }
  .lrba-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lrba-row label { width: auto; }
}

/* ================================================================
   MOBILE LANDING (Ian, 12 Jun 2026)
   On phones, the desktop dashboard (700-row table, map, 8-column
   filter bar) is unusable. We hide the dashboard chrome and show
   a clean centred hero with a giant "Lookup address" CTA. The
   overlay it opens is the same one the desktop pill triggers, so
   the report-build path is unchanged.
   Breakpoint matches the existing 768px convention in this file.
   ================================================================ */
.mobile-landing { display: none; }

@media (max-width: 768px) {
  /* Reveal the mobile hero. */
  .mobile-landing {
    display: flex;
    min-height: calc(100vh - 56px);
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 32px 20px 48px;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
  }
  .mobile-landing-inner {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
  .mobile-landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .mobile-landing-brand .logo-mark { width: 28px; height: 28px; }
  .mobile-landing-brand-text { text-align: left; }
  .mobile-landing-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
  }
  .mobile-landing-sub {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .mobile-landing-heading {
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 800;
    color: var(--text-primary);
    margin: 12px 0 4px;
    letter-spacing: -0.01em;
    max-width: 100%;
  }
  .mobile-landing-copy {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 8px;
    max-width: 100%;
  }
  .mobile-landing-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    padding: 18px 24px;
    margin-top: 12px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-landing-cta:active {
    transform: scale(0.98);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
  }
  .mobile-landing-cta:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 3px;
  }
  .mobile-landing-stats {
    display: flex;
    width: 100%;
    max-width: 360px;
    justify-content: space-around;
    gap: 8px;
    margin-top: 18px;
    padding: 14px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .mobile-landing-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .mobile-landing-stats strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
  }
  .mobile-landing-stats span {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .mobile-landing-hint {
    font-size: 0.75rem;
    color: var(--text-faint, var(--text-muted));
    margin-top: 14px;
    line-height: 1.45;
    opacity: 0.8;
  }

  /* Hide the full dashboard chrome on phones - everything below the
     header that is not the lookup overlay. The overlay sits outside
     #main-content so it remains reachable. */
  #global-stats-strip,
  .header .nav-tabs,
  .header .filter-bar,
  .header .header-actions,
  #main-content {
    display: none !important;
  }
  /* Keep the logo visible in the header on mobile (tiny, top-left) so
     users still know they're on Growth Engine while the overlay is
     open. */
  .header .header-inner {
    justify-content: center;
    padding: 8px 12px;
  }
  .header .logo .logo-text { font-size: 0.95rem; }
  .header .logo .logo-subtitle { display: none; }
}

/* =====================================================================
   LIBRARY (Ian, 12 Jun 2026)
   ---------------------------------------------------------------------
   Catalogue of every previously rendered + saved report. Sourced from
   /api/report-library (which reads ge_report_overrides). Cards show
   address, suburb/state/postcode, price + tier, updated timestamp +
   advisor, plus a star (deals secured) and delete button.
   ===================================================================== */
.library-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 0 32px;
}
.library-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.library-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.library-header-left .section-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}
.library-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-secondary, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
}
.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.library-filters .filter-select,
.library-filters .filter-input {
  height: 36px;
  padding: 0 12px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.library-filters .filter-input {
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
}
.library-filters .filter-select:focus,
.library-filters .filter-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
  border-color: rgba(37, 99, 235, 0.55);
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.library-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 12px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.library-card:hover {
  box-shadow: 0 4px 16px rgba(15, 36, 26, 0.08);
  transform: translateY(-1px);
  border-color: rgba(15, 36, 26, 0.18);
}
.library-card.is-starred {
  border-color: rgba(200, 169, 81, 0.55);
  background: linear-gradient(180deg, rgba(200, 169, 81, 0.06) 0%, var(--bg-primary, #fff) 100%);
}
.library-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.library-card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.library-card-actions button:hover {
  transform: translateY(-1px);
}
.library-star:hover {
  color: #c8a951;
  border-color: rgba(200, 169, 81, 0.6);
  background: rgba(200, 169, 81, 0.08);
}
.library-star.is-starred {
  color: #c8a951;
  border-color: rgba(200, 169, 81, 0.7);
  background: rgba(200, 169, 81, 0.12);
}
.library-delete:hover {
  color: #c92a2a;
  border-color: rgba(201, 42, 42, 0.55);
  background: rgba(201, 42, 42, 0.06);
}
.library-card-title {
  margin-top: 8px;
  padding-right: 72px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  word-break: break-word;
}
.library-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.02em;
}
.library-card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.library-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.library-card-tier {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6b7280);
  padding: 3px 8px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 999px;
}
.library-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e5e7eb);
}
.library-open {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}
.library-open:hover {
  text-decoration: underline;
}
.library-card-stamp {
  font-size: 0.7rem;
  color: var(--text-muted, #6b7280);
  font-style: italic;
}
.library-empty,
.library-loading {
  grid-column: 1 / -1;
  padding: 36px 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
  background: var(--bg-secondary, #f9fafb);
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 12px;
}

/* Secondary mobile CTA - smaller, ghost-style button under the primary
   lookup CTA on the mobile landing. */
.mobile-landing-secondary { display: none; }
@media (max-width: 768px) {
  /* Library CTA - paired sibling of the primary Lookup CTA above.
     Same shape/radius/icon-text layout as .mobile-landing-cta so the two
     buttons read as an intentional pair. Gold fill (matching the desktop
     stats-strip Library pill) keeps Lookup as the visual primary while
     giving Library equal prominence in the entry-point hierarchy. */
  .mobile-landing-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    padding: 14px 22px;
    margin-top: 10px;
    background: #fbbf24;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-landing-secondary:active {
    transform: scale(0.98);
    background: #fcd34d;
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.32);
  }
  .mobile-landing-secondary:focus-visible {
    outline: 3px solid rgba(251, 191, 36, 0.5);
    outline-offset: 3px;
  }

  /* When the user taps "Browse report library" from the mobile landing,
     the body gets .show-library-on-mobile -- unhide #main-content and
     hide the landing so the library view is reachable on phones. */
  body.show-library-on-mobile #mobile-landing { display: none !important; }
  body.show-library-on-mobile #main-content { display: block !important; }
  body.show-library-on-mobile .header .nav-tabs { display: flex !important; }
  body.show-library-on-mobile .view:not(#view-library) { display: none !important; }
  body.show-library-on-mobile #view-library { display: block !important; }

  /* Library cards stack on phones */
  .library-grid { grid-template-columns: 1fr; }
  .library-filters { flex-direction: column; align-items: stretch; }
  .library-filters .filter-select,
  .library-filters .filter-input { width: 100%; max-width: none; }
}
