:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-subtle: rgba(37, 99, 235, 0.07);

  --bg-0: #ffffff;
  --bg-1: #f9fafb;
  --bg-2: #f3f4f6;
  --bg-3: #e5e7eb;
  --bg-input: #ffffff;

  --text-0: #111827;
  --text-1: #374151;
  --text-2: #6b7280;
  --text-3: #9ca3af;

  --border-0: #e5e7eb;
  --border-1: #d1d5db;

  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.08);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.08);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);

  --radius: 8px;
  --radius-lg: 12px;
  --banner-h: 0px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-0: #09090b;
  --bg-1: #111113;
  --bg-2: #1c1c1f;
  --bg-3: #27272a;
  --bg-input: #1c1c1f;

  --text-0: #fafafa;
  --text-1: #d4d4d8;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --border-0: #27272a;
  --border-1: #3f3f46;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 440px; margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-0);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* App Banner */
.app-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #fff;
  background: var(--brand);
}

[data-theme="dark"] .app-banner {
  background: #1e40af;
}

.app-banner-warning {
  background: var(--amber);
}

.app-banner-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.app-banner-msg {
  flex: 1;
}

.app-banner-close {
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  color: rgba(255,255,255,0.7);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-top: 1px;
}
.app-banner-close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.navbar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
  display: flex;
  align-items: center;
}
.navbar-toggle:hover { color: var(--text-0); }

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.3px;
  flex: 1;
  display: flex;
  align-items: center;
}

.navbar-logo-full { height: 36px; width: auto; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-link {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
}
.navbar-link:hover { color: var(--text-0); }

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-3);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-0);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s;
}
[data-theme="dark"] .theme-toggle { background: var(--brand); }
[data-theme="dark"] .theme-toggle::after { transform: translateX(16px); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

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

.btn-secondary {
  background: var(--bg-0);
  color: var(--text-1);
  border-color: var(--border-1);
}
.btn-secondary:hover { background: var(--bg-1); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-2);
  color: var(--text-0);
}

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Forms */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-0);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 4px;
}

.form-success {
  font-size: 0.8125rem;
  color: var(--green, #16a34a);
}

/* Inline text-style button (e.g. "email me a sign-in link") */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.btn-link:hover { opacity: 0.8; }
.btn-link:disabled { opacity: 0.5; cursor: default; }

/* Cards */
.card {
  background: var(--bg-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* App Layout */
.app-layout {
  display: flex;
  height: calc(100vh - 56px);
}

.sidebar {
  width: 220px;
  background: var(--bg-1);
  border-right: 1px solid var(--border-0);
  padding: 16px 12px;
  transition: width 0.2s, padding 0.2s, opacity 0.2s;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .sidebar {
  background: #0a0a0f;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-link:hover {
  color: var(--text-0);
  background: var(--bg-2);
}
.sidebar-link.active {
  color: var(--brand);
  background: var(--brand-subtle);
  font-weight: 600;
}

.sidebar-link svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-0);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  color: var(--text-1);
}

.sidebar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 0;
  padding: 0;
  border-right: none;
}

.sidebar.collapsed * {
  opacity: 0;
  pointer-events: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-width: 0;
  overflow: hidden;
}

.chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.has-deals .chat-pane {
  flex: 1 1 0;
  border-right: 1px solid var(--border-0);
}

.deals-pane {
  width: 0;
  flex: 0 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-1);
  position: relative;
  opacity: 0;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s ease 0.1s;
}

.deals-pane.open {
  flex: 1 1 0;
  opacity: 1;
}

/* Chat */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* legacy Edge/IE */
}
.chat-messages::-webkit-scrollbar { display: none; }  /* WebKit (Safari/Chrome) */

/* Search Landing */
.search-landing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.search-landing-inner {
  text-align: center;
  padding: 40px 20px;
  max-width: 600px;
}

.search-landing-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-0);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.search-landing-inner .chat-input-area {
  border-top: none;
  padding: 24px 0;
  width: 100%;
  max-width: 520px;
}

.search-landing-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-3);
  line-height: 1.6;
}
.search-landing-footer a {
  color: var(--text-2);
  text-decoration: underline;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.search-suggestion {
  padding: 8px 16px;
  border: 1px solid var(--border-1);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-1);
  background: var(--bg-0);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.search-suggestion:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-subtle);
}

.search-hero {
  margin-bottom: 24px;
}

.search-hero-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.search-hero-query {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.4;
}

.search-stages {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.4s ease;
}

.search-stages.stages-done {
  opacity: 0;
}

/* Search Summary (post-animation) */
.search-summary {
  padding: 24px 0;
  max-width: 600px;
  margin: 0 auto;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.summary-query {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.4;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.summary-stat {
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
}

.summary-stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

.summary-stat-label {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 500;
}

.summary-insight {
  font-size: 0.875rem;
  color: var(--text-1);
  line-height: 1.65;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}

.summary-section {
  margin-bottom: 24px;
}

.summary-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.summary-view-deals {
  display: none;
  margin-top: 20px;
}

.summary-marketplaces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-mp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  background: var(--bg-0);
  font-size: 0.8125rem;
  color: var(--text-1);
  font-weight: 500;
}

.summary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Price Chart */
.summary-chart {
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  background: var(--bg-0);
  padding: 20px;
}

.chart-area {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  position: relative;
  padding-top: 20px;
}

.chart-market-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--red);
  opacity: 0.5;
  z-index: 1;
}

.chart-market-label {
  position: absolute;
  top: -18px;
  right: 0;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--red);
  background: var(--bg-0);
  padding: 0 4px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chart-bar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 2px 2px;
  min-height: 8px;
}

.chart-bar-price {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-top: 6px;
}

.chart-bar-label {
  font-size: 0.5625rem;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 2px;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: var(--bg-2);
  color: var(--text-0);
  border-bottom-left-radius: 2px;
}

.chat-bubble.bot .typing-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: dotPulse 1.4s infinite;
  margin-right: 3px;
}
.chat-bubble.bot .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.bot .typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* Search Response Animation */
.search-response {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.search-stage {
  padding: 12px 0;
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 10px;
}

.stage-header span {
  transition: color 0.3s;
}

.results-header {
  color: var(--green);
  font-weight: 600;
  font-size: 0.875rem;
}

.stage-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-0);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

.stage-spinner.done {
  border-color: var(--green);
  border-top-color: var(--green);
  animation: none;
  position: relative;
}

.stage-spinner.done::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Search warning banner */
.search-warning-inline {
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  border-radius: var(--radius, 8px);
  padding: 10px 16px;
  margin: 12px 0 0;
}
.search-warning-inline a {
  color: var(--amber);
  font-weight: 600;
  text-decoration: underline;
}
.search-warning-inline a:hover {
  opacity: 0.8;
}

/* Bad query */
.bad-query-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-top: 16px;
  border-radius: var(--radius);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  color: var(--text-1);
  font-size: 0.875rem;
}
.bad-query-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bad-query-warning {
  padding: 10px 18px;
  margin-top: 8px;
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.bad-query-warning a {
  color: var(--brand);
  text-decoration: underline;
}

/* Marketplace chips */
.marketplace-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 26px;
}

.mp-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  background: var(--bg-0);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-1);
}

.mp-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Query list */
.query-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 26px;
}

.query-item {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 2px solid var(--brand);
}

/* Filter chips */
.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 26px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  font-size: 0.6875rem;
  background: var(--bg-0);
}

.filter-label {
  color: var(--text-3);
  font-weight: 500;
}

.filter-value {
  color: var(--text-0);
  font-weight: 600;
}

/* Scan progress */
.scan-progress {
  height: 3px;
  background: var(--bg-2);
  border-radius: 2px;
  margin: 8px 0 6px 26px;
  overflow: hidden;
}

.scan-bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 2px;
  transition: width 0.12s linear;
}

.scan-counter {
  font-size: 0.6875rem;
  color: var(--text-3);
  padding-left: 26px;
  font-variant-numeric: tabular-nums;
}

/* Market compare */
.market-compare {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 26px;
}

.market-compare-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-1);
  padding: 6px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
}

.mc-icon {
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Result cards */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  background: var(--bg-0);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.result-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-sm);
}

.result-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.result-card:first-child .result-rank {
  background: var(--brand-subtle);
  color: var(--brand);
}

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

.result-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--text-3);
}

.result-meta span::after {
  content: '\00b7';
  margin-left: 4px;
}

.result-meta span:last-child::after {
  content: none;
}

.result-right {
  text-align: right;
  flex-shrink: 0;
}

.result-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.result-score {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.result-score span {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--green);
}

.result-score .score-fill {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}

.result-score .score-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--score);
  background: var(--green);
  border-radius: 2px;
}

.search-again {
  padding: 8px 0;
  display: flex;
  justify-content: center;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease both;
}

.pop-in {
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.type-in {
  animation: typeIn 0.3s ease both;
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

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

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

.chat-input-area {
  padding: 16px 0 24px;
  border-top: 1px solid var(--border-0);
}
.chat-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}

.chat-input-wrap textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: var(--font);
  background: transparent;
  color: var(--text-0);
  padding: 10px 0;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
}
.chat-input-wrap textarea::placeholder { color: var(--text-3); }
.chat-typing {
  position: absolute;
  left: 16px;
  /* Bound the right edge (before the send button) so long examples clip instead of
     overflowing the input on narrow screens. */
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-3);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  /* Stay left-aligned (the landing hero centers text); the box is now full-width so
     without this short examples would center. Long ones scroll left via JS. */
  text-align: left;
  line-height: 1.5;
}
.search-landing .chat-input-wrap {
  padding: 6px 6px 6px 20px;
}
.search-landing .chat-input-wrap textarea {
  font-size: 1.1rem;
  padding: 12px 0;
}
.search-landing .chat-typing {
  font-size: 1.1rem;
  left: 20px;
  right: 60px;
}
.search-landing .chat-send-btn {
  width: 44px; height: 44px;
}
.search-landing .chat-send-btn svg {
  width: 22px; height: 22px;
}

.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--brand);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--brand-hover); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send-btn svg {
  width: 20px; height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-input-help {
  text-align: center;
  margin-top: 6px;
  font-size: 0.78rem;
}
.chat-input-help a { color: var(--text-3); text-decoration: none; }
.chat-input-help a:hover { color: var(--brand); }

/* Inline Verify Banner */
.verify-inline {
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  margin: 16px auto;
  max-width: 600px;
  overflow: hidden;
}

.verify-inline-header {
  padding: 12px 18px;
  background: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

.verify-inline-body {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--text-1);
}
.verify-inline-body p { margin: 0 0 4px; }

/* --- Password show/hide toggle --- */
.password-wrap { position: relative; display: block; }
.password-wrap .form-input { width: 100%; padding-right: 42px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
}
.password-toggle:hover { color: var(--text-1); }
.password-toggle svg { width: 18px; height: 18px; }

.verify-steps-inline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.verify-step-inline {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-0);
}
.verify-step-inline:last-child { border-bottom: none; }

.verify-step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.verify-step-inline.done .verify-step-dot {
  background: var(--green);
  color: #fff;
}

.verify-step-content {
  flex: 1;
  min-width: 0;
}

.verify-step-content .verify-step-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 4px;
}

.verify-step-content p {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 8px;
}

.phone-input-row {
  display: flex;
  gap: 8px;
}

.phone-input-row input {
  flex: 1;
  min-width: 0;
}

.code-input-row {
  display: flex;
  gap: 8px;
}

.code-input-row input {
  width: 130px;
  text-align: center;
  letter-spacing: 4px;
  font-size: 1rem;
  font-weight: 600;
}

/* Settings */
.settings-view {
  padding: 32px 40px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}

.settings-view::-webkit-scrollbar { display: none; }

.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-0);
  margin-bottom: 28px;
}

.settings-tab {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.settings-tab:hover {
  color: var(--text-0);
}

.settings-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.settings-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.settings-profile-info { min-width: 0; }

.settings-profile-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-0);
}

.settings-profile-email {
  font-size: 0.8125rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section-header {
  margin-bottom: 10px;
}

.settings-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}

.settings-section-desc {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.5;
}

.settings-card {
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  background: var(--bg-0);
  overflow: hidden;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-0);
  font-size: 0.8125rem;
}
.settings-row:last-child { border-bottom: none; }

.settings-label {
  color: var(--text-2);
  font-weight: 500;
}

.settings-value {
  color: var(--text-0);
}

.settings-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.settings-action .phone-input-row,
.settings-action .code-input-row {
  width: 100%;
}

.form-input-sm {
  padding: 6px 10px;
  font-size: 0.8125rem;
}

/* Location settings */
.location-current {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-0);
}

.location-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.location-text { flex: 1; min-width: 0; }

.location-city {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-0);
}

.location-source {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 1px;
}

.location-radius {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-0);
  font-size: 0.8125rem;
}

.location-radius-label {
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

.location-radius input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
  height: 4px;
}

.location-radius-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-0);
  min-width: 50px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.location-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-0);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.pulse-highlight {
  animation: pulse-ring 1.5s ease-out 3;
}

.location-history {
  padding: 12px 16px;
}

.location-history-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 6px;
}

.location-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.location-history-chip {
  font-size: 0.6875rem;
  padding: 3px 8px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--bg-1);
  font-variant-numeric: tabular-nums;
}


/* Preference chips */
.pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 16px;
}

.pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-1);
  background: var(--bg-1);
}

.pref-chip-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.875rem;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.pref-chip-delete:hover { color: var(--red); }

.settings-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-style: italic;
}

/* Location chip (search results) */
.location-result-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-2);
  background: var(--bg-0);
  margin-bottom: 20px;
}

.location-result-change {
  color: var(--brand);
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-family: var(--font);
  padding: 0;
}
.location-result-change:hover { color: var(--brand-hover); }

/* Add preference input */
.add-pref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-0);
}

.add-pref-row input {
  flex: 1;
  min-width: 0;
}

.text-green { color: var(--green); }
.text-amber { color: var(--amber); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  color: #fff;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--brand); }
.toast { cursor: pointer; }
.toast-out { animation: toastOut 0.2s ease forwards; }

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

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-0);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Utilities */
.hidden { display: none !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 28px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.8125rem; }
.text-muted { color: var(--text-2); }

/* Deals Header */
.deals-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-0);
  background: var(--bg-1);
  flex-shrink: 0;
}

.deals-header-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.deals-back-btn {
  display: none;
}

.deals-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-0);
}

.deals-header-subtitle {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 1px;
}

.deals-header-query {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 2px;
}

.deals-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-0);
  margin-bottom: 8px;
}

.deals-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deals-tab:hover {
  color: var(--text-0);
}

.deals-tab.active {
  color: var(--text-0);
  border-bottom-color: var(--accent, #5b7ff5);
}

.deals-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text-2);
}

.deals-tab.active .deals-tab-count {
  background: var(--accent, #5b7ff5);
  color: white;
}

.deals-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.deals-sort-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-3);
  margin-right: 2px;
}

.sort-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-0);
  border-radius: 999px;
  background: var(--bg-0);
  padding: 2px 3px 2px 10px;
}

.sort-group-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-2);
  margin-right: 2px;
  white-space: nowrap;
}

.sort-dir-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  /* iOS Safari: kill the 300ms tap delay and keep the tap target on the button itself */
  touch-action: manipulation;
}
/* The inner arrow must never swallow the tap (Safari hit-tests the SVG, not the button) */
.sort-dir-btn svg { pointer-events: none; }
.sort-dir-btn:hover {
  color: var(--text-0);
  background: var(--bg-2);
}
.sort-dir-btn.active {
  background: var(--brand);
  color: #fff;
}

/* Marketplace filter */
.deals-mp-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.mp-filter-btn {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-0);
  background: var(--bg-0);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.mp-filter-btn:hover {
  color: var(--text-0);
  border-color: var(--text-3);
}
.mp-filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Deals List */
.deals-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deal-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  background: var(--bg-0);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.deal-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-sm);
}
.deal-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-subtle);
}

.deal-card-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.deal-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.deal-card-photos {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.deal-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.deal-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 4px;
}

.deal-card-meta span::after {
  content: '\00b7';
  margin-left: 4px;
}
.deal-card-meta span:last-child::after { content: none; }

.deal-card-market {
  font-weight: 600;
  color: var(--text-2);
}

.deal-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.deal-card-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

.deal-card-savings {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--green);
}

.deal-card-time {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-left: auto;
}

/* Deal score meter — animated fill bar */
.deal-score-meter {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  min-width: 60px;
}

.deal-score-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-3, #e0e0e0);
  border-radius: 3px;
  overflow: hidden;
  min-width: 36px;
}

.deal-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.deal-score-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  min-width: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Show more button */
.deals-show-more {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.deals-show-more:hover {
  background: var(--bg-2);
  color: var(--text-0);
}

/* Old price strikethrough — used in cards and detail */
.price-old {
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  margin-left: 8px;
}

.price-drop-amount {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
  margin-left: 8px;
}

.detail-price-drop {
  display: flex;
  align-items: center;
  margin-top: 6px;
}
.detail-price-drop .price-old {
  font-size: 1.0625rem;
  margin-left: 0;
}

.deal-card-comp {
  font-size: 0.6875rem;
  color: var(--brand);
  font-weight: 500;
  margin-top: 4px;
  font-style: italic;
}

/* Deal Detail Panel */
.deal-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-0);
  overflow-y: auto;
  z-index: 10;
}

.detail-top {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-0);
}

.detail-back {
  font-size: 0.8125rem;
}

.detail-photos {
  padding: 16px;
}

.detail-photo-main {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  position: relative;
  margin-bottom: 8px;
  background: var(--bg-2);
  overflow: hidden;
}

.detail-photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.6875rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.detail-photo-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-photo-thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius);
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
  overflow: hidden;
}
.detail-photo-thumb:hover { opacity: 1; }
.detail-photo-thumb.active { opacity: 1; border-color: var(--brand); }

.detail-content {
  padding: 0 20px 24px;
}

.detail-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 6px;
}

.detail-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 20px;
}

.detail-subtitle span::after {
  content: '\00b7';
  margin-left: 4px;
}
.detail-subtitle span:last-child::after { content: none; }

/* Price comparison */
.detail-price-section {
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

.detail-price-label {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* Detail deal score */
.detail-score-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-score-label {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-bottom: 6px;
}

.detail-score-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-score-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-3, #e0e0e0);
  border-radius: 4px;
  overflow: hidden;
}

.detail-score-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-0);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-price-vs {
  display: flex;
  align-items: center;
}

.detail-market-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.detail-savings-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.detail-savings-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.detail-savings-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--green);
}

/* Detail sections */
/* Detail view Details/Market tabs */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-0);
  margin: 4px 0 16px;
}
.detail-tab {
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.detail-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
/* Cluster view sits fine inside the narrower detail panel too */
.detail-tab-panel .cluster-center-view {
  padding: 0;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.detail-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-spec {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  font-size: 0.8125rem;
}

.detail-spec-label {
  color: var(--text-3);
}

.detail-description {
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.6;
}

.detail-desc-note {
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-3);
}

/* Score breakdown */
.detail-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.detail-score-row > span:first-child {
  width: 120px;
  flex-shrink: 0;
}

.detail-score-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}

.detail-score-bar > div {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.detail-score-val {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-1);
  width: 48px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  margin-top: 24px;
}

/* Cluster section */
.detail-cluster {
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.cluster-range {
  margin-bottom: 12px;
}

.cluster-range-bar {
  position: relative;
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  margin-bottom: 6px;
}

.cluster-marker {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.cluster-median {
  background: var(--text-3);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  top: -4px;
}

.cluster-deal {
  background: var(--brand);
  border: 2px solid var(--bg-0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.cluster-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-3);
}

.cluster-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.cluster-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cluster-stat-label {
  font-size: 0.6875rem;
  color: var(--text-3);
}

.cluster-stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.cluster-siblings-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.cluster-siblings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster-sib-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.cluster-sib-card:hover {
  background: var(--bg-2);
}

.cluster-sib-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.cluster-sib-info {
  min-width: 0;
  flex: 1;
}

.cluster-sib-title {
  font-size: 0.75rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cluster-sib-price {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: calc(56px + var(--banner-h));
    left: 0;
    bottom: 0;
    z-index: 60;
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.collapsed {
    width: 220px;
    padding: 16px 12px;
    border-right: 1px solid var(--border-0);
  }
  .sidebar.collapsed * {
    opacity: 1;
    pointer-events: auto;
  }

  .chat-container { padding: 0 16px; }
  .settings-view { padding: 24px 16px; max-width: none; }

  /* Compact banner: long message, so shrink type/padding, badge on its own row,
     close pinned top-right (out of flow) so it doesn't dangle below the text */
  .app-banner { position: relative; padding: 10px 42px 10px 14px; gap: 6px 10px; font-size: 0.8125rem; line-height: 1.45; flex-wrap: wrap; }
  .app-banner-badge { font-size: 0.625rem; padding: 3px 9px; margin-top: 0; }
  .app-banner-msg { flex-basis: 100%; }
  .app-banner-close { position: absolute; top: 8px; right: 10px; width: 26px; height: 26px; }

  /* Tighten the results header chrome so listings start higher */
  .deals-header { padding: 10px 14px 8px; }
  .deals-header-title { font-size: 1.05rem; }
  .deal-card { padding: 10px; gap: 10px; }
  .deal-card-title { font-size: 0.9rem; }

  /* Tabs + sort scroll horizontally instead of clipping the last item */
  .deals-tabs { gap: 4px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .deals-tabs::-webkit-scrollbar { display: none; }
  .deals-tab { flex: 0 0 auto; white-space: nowrap; }
  .deals-sort { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .deals-sort::-webkit-scrollbar { display: none; }

  .has-deals .chat-pane {
    flex: 1;
    border-right: none;
  }

  .deals-pane.open {
    position: fixed;
    top: calc(56px + var(--banner-h));
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    z-index: 50;
    flex: none;
    width: 100%;
  }

  .deals-back-btn {
    display: inline-flex;
  }

  .deal-card-thumb {
    width: 64px;
    height: 64px;
  }

  .detail-photo-main { height: 220px; }
  .detail-specs { grid-template-columns: 1fr; }
  .detail-score-row > span:first-child { width: 90px; }

  .search-landing-title { font-size: 1.625rem; }
  .summary-stats { grid-template-columns: repeat(2, 1fr); }
  .chart-area { height: 120px; }
  .summary-view-deals { display: inline-flex; width: 100%; }
}

/* --- Analyzing state (results page, after scraping, before deals are ranked) --- */
.analyzing-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.analyzing-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-2, #eef1f6);
  overflow: hidden;
}
.analyzing-bar-fill {
  height: 100%;
  width: 6%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.4s ease;
}
.analyzing-status {
  font-size: 0.875rem;
  color: var(--text-2, #667);
  text-align: center;
  margin-bottom: 4px;
}
.skeleton-card {
  pointer-events: none;
}
.skeleton-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--bg-2, #eef1f6);
}
.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-2, #eef1f6);
}
.skeleton-line:nth-child(1) { width: 80%; }
.skeleton-line:nth-child(2) { width: 50%; }
.skeleton-line:nth-child(3) { width: 35%; }
.skeleton-thumb, .skeleton-line {
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}
[data-theme="dark"] .skeleton-thumb, [data-theme="dark"] .skeleton-line {
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Deal card images --- */
.deal-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.detail-photo-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.detail-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* --- Deal tag chips --- */
.deal-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.deal-tag-chip {
  font-size: 0.625rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--text-2);
  white-space: nowrap;
}

/* --- History view --- */
.history-list {
  padding: 0 20px 20px;
}
.history-card {
  padding: 14px 16px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.history-card:hover {
  border-color: var(--brand);
  background: var(--bg-1);
}
.history-card-prompt {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
}
.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-3);
}
.history-card-time {
  margin-left: auto;
}

/* History dropdown */
.chat-top-bar {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 10;
}

.history-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.history-btn:hover {
  color: var(--text-0);
  background: var(--bg-2);
}

.history-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  scrollbar-width: none;
}
.history-dropdown::-webkit-scrollbar { display: none; }

.history-dropdown-header {
  padding: 12px 16px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  position: sticky;
  top: 0;
  background: var(--bg-0);
}

.history-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-0);
}
.history-dropdown-item:last-child { border-bottom: none; }
.history-dropdown-item:hover { background: var(--bg-1); }

.history-dropdown-prompt {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-dropdown-meta {
  display: flex;
  gap: 8px;
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 3px;
}

.history-dropdown-meta span::after {
  content: '\00b7';
  margin-left: 4px;
}
.history-dropdown-meta span:last-child::after { content: none; }

.history-dropdown-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-style: italic;
}

/* Cluster center view */
.cluster-center-view {
  padding: 24px 0;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  /* Fill the chat-messages flex column so overflow-y can actually scroll */
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* legacy Edge/IE */
}
.cluster-center-view::-webkit-scrollbar { display: none; }  /* WebKit (Safari/Chrome) */

.cluster-center-header { margin-bottom: 20px; }

.cluster-center-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-0);
}

.cluster-center-subtitle {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-top: 4px;
}

.cluster-center-range {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
}

.cluster-center-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}

.cluster-center-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
}

.cluster-center-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

.cluster-center-stat-label {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 2px;
}

.cluster-center-listings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster-listing-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-0);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.cluster-listing-card:hover {
  border-color: var(--border-1);
  background: var(--bg-1);
}
.cluster-listing-card.active {
  border-color: var(--brand);
  background: var(--brand-subtle);
}

.cluster-listing-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-2);
}
.cluster-listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cluster-listing-info {
  flex: 1;
  min-width: 0;
}

.cluster-listing-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cluster-listing-meta {
  display: flex;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 2px;
}
.cluster-listing-meta span::after {
  content: '\00b7';
  margin-left: 6px;
}
.cluster-listing-meta span:last-child::after { content: none; }

.cluster-listing-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* --- Search error box --- */
/* --- Status boxes (error, info, pending) --- */
.status-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  margin: 16px 0;
  border-radius: var(--radius-lg);
  max-width: 560px;
}
.status-box-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  line-height: 1;
}
.status-box-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.status-box-msg {
  font-size: 0.875rem;
  color: var(--text-1);
  line-height: 1.6;
}

.status-error {
  background: var(--red-bg);
  border: 1px solid var(--red);
}
.status-error .status-box-icon {
  background: var(--red);
  color: #fff;
}

.status-info {
  background: var(--bg-1);
  border: 1px solid var(--border-0);
}
.status-info .status-box-icon {
  background: var(--bg-3);
  color: var(--text-2);
}

.status-pending {
  background: var(--brand-subtle);
  border: 1px solid var(--brand);
}
.status-pending .status-box-icon {
  background: var(--brand);
  color: #fff;
  font-size: 0.625rem;
  letter-spacing: 1px;
}

/* --- Detail photo thumbnails --- */
.detail-photo-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.7;
}
.detail-photo-thumb:hover { opacity: 1; }
.detail-photo-thumb.active {
  border-color: var(--brand);
  opacity: 1;
}

/* --- Broken image fallback --- */
.deal-card-thumb img,
.detail-photo-main img,
.detail-photo-thumb img,
.cluster-listing-thumb img {
  background: var(--bg-2);
}

/* --- Deal locations map (inline in results summary) --- */
.summary-map {
  position: relative;
  height: 320px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}
.summary-map .leaflet-container {
  height: 100%;
  width: 100%;
}

/* --- Location editor modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--bg-0);
  border: 1px solid var(--border-0);
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-0); margin: 0 0 4px; }
.modal-sub { font-size: 0.8125rem; color: var(--text-2); margin: 0 0 14px; }
.modal-card .form-input { width: 100%; }
.modal-err { color: var(--red); font-size: 0.8rem; min-height: 1em; margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Location bar above the chat input ("Searching in X", click to edit) */
.chat-loc-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: 0 auto 8px 4px;
  padding: 4px 11px;
  background: var(--bg-2);
  border: 1px solid var(--border-0);
  color: var(--text-2);
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 100%;
}
.chat-loc-bar:hover { color: var(--text-0); border-color: var(--brand); }

/* DealBot Verify tell — appears above the prompt bar when a listing URL is detected */
.verify-tell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 4px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  animation: fadeIn 0.2s ease;
}
.verify-tell svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.verify-tell-ok {
  background: var(--brand-subtle);
  border: 1px solid var(--brand);
  color: var(--text-1);
}
.verify-tell-ok svg { color: var(--brand); }
.verify-tell-ok strong { color: var(--brand); }
.verify-tell-no {
  background: var(--bg-2);
  border: 1px solid var(--border-0);
  color: var(--text-2);
}
.verify-tell-pulse { animation: verifyTellPulse 0.45s ease; }
@keyframes verifyTellPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.025); }
  100% { transform: scale(1); }
}
/* Long listing URLs in the verify hero shouldn't blow out the layout */
.verify-hero-url { word-break: break-all; font-size: 1rem; }

/* DealBot Verify verdict card (the listing being checked + the price judgment) */
.verify-summary { padding: 4px 2px 8px; }
.verify-summary-head { margin-bottom: 10px; }
.verify-target-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: var(--bg-1);
}
.verify-target-photo {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: var(--bg-2);
}
.verify-target-body { min-width: 0; }
.verify-target-title {
  font-weight: 600; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.verify-target-price { font-size: 1.25rem; font-weight: 700; color: var(--text-0); margin-top: 2px; }
.verify-target-meta { font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }
.verify-verdict {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
}
.verify-verdict-save { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.verify-verdict-good { background: var(--brand-subtle); color: var(--brand); border: 1px solid var(--brand); }
.verify-verdict-neutral { background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border-0); }
.chat-loc-bar svg { width: 14px; height: 14px; flex: 0 0 auto; }
.chat-loc-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-approx-notice {
  position: absolute;
  top: 8px;
  left: 52px;
  right: 8px;
  z-index: 1100;
  background: var(--bg-0);
  border: 1px solid var(--border-0);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Public shared deal page (server-rendered, SEO) --- */
.share-page { max-width: 880px; margin: 0 auto; padding: 0 16px 64px; }
.share-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border-0); margin-bottom: 24px;
}
.share-brand { display: inline-flex; align-items: center; text-decoration: none; }
.share-logo { height: 34px; width: auto; display: block; }
.share-cta { text-decoration: none; }
.share-hero { margin-bottom: 24px; }
.share-title { font-size: 1.75rem; font-weight: 800; margin: 0 0 6px; line-height: 1.2; }
.share-loc { color: var(--text-2); font-weight: 600; }
.share-sub { color: var(--text-2); margin: 0; }
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-list .deal-card { text-decoration: none; color: inherit; }
.share-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-0); color: var(--text-3); font-size: 0.875rem; }
.share-footer a { color: var(--brand); }
@media (max-width: 768px) {
  .share-title { font-size: 1.35rem; }
  .share-cta { font-size: 0.8rem; }
}

/* Share button in results header */
.deals-share-btn { margin-left: auto; flex-shrink: 0; }
