/* =============================================
   CompDeck — styles.css
   Premium Dark Dashboard — Linear + Robinhood + Stripe + Vercel patterns
   ============================================= */

:root {
  /* Surface layering (Linear-inspired) */
  --bg-0: #0F1419;          /* app background */
  --bg-1: #0a0e13;          /* header / deepest */
  --bg-2: #151B23;          /* cards */
  --bg-3: #1C2333;          /* elevated cards / inputs */
  --bg-4: #232B3A;          /* popovers / hover */
  --bg-5: #2a3347;          /* active highlights */

  /* Borders — barely there */
  --border:    rgba(255, 255, 255, 0.06);
  --border-md: rgba(255, 255, 255, 0.10);
  --border-hi: rgba(255, 255, 255, 0.14); /* hover brightened */

  /* Text hierarchy (Linear-inspired) */
  --text-primary:   rgba(255, 255, 255, 1.00);
  --text-secondary: rgba(255, 255, 255, 0.60);
  --text-tertiary:  rgba(255, 255, 255, 0.35);

  /* Accent — Warm Amber: prices, CTAs only */
  --accent:      oklch(73% 0.14 65);
  --accent-soft: oklch(73% 0.14 65 / 0.15);
  --accent-glow: oklch(73% 0.14 65 / 0.30);
  --accent-hover: oklch(78% 0.14 65);

  /* Mint — Niche Riches cousin accent */
  --mint:       oklch(63% 0.07 200);
  --mint-bright: oklch(68% 0.09 200);
  --mint-soft:  oklch(63% 0.07 200 / 0.14);
  --mint-glow:  oklch(63% 0.07 200 / 0.35);

  /* Semantic: green = positive ONLY, red = negative ONLY (Robinhood rule) */
  --green:      oklch(82% 0.19 145);
  --green-soft: oklch(82% 0.19 145 / 0.13);
  --red:        oklch(66% 0.20 25);
  --red-soft:   oklch(66% 0.20 25 / 0.13);
  --red-glow:   oklch(66% 0.20 25 / 0.30);

  --yellow:     oklch(83% 0.17 85);
  --yellow-soft: oklch(83% 0.17 85 / 0.12);

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 999px;

  --header-h: 56px;
  --font:         'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-headline: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --card-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.25);
  --card-hover-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.3);
}

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

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Data label utility (Stripe-inspired) ---- */
.data-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-family: var(--font);
}

/* ---- Header ---- */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background:
    linear-gradient(90deg, rgba(79,152,163,0.15) 0%, rgba(229,162,40,0.10) 100%),
    rgba(10, 14, 19, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
#app-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Brand signature line — top edge */
#app-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4ADE80 0%, #E5A228 50%, #4ADE80 100%);
  opacity: 1;
}

.header-left { display: flex; align-items: center; gap: 8px; }

.logo-mark { flex-shrink: 0; display: block; }

.logo {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  /* TEMP: dev empty-state preview menu — remove before launch
     Prevents text selection from kicking off during the long-press
     gesture. Visually identical to default; no user-facing indicator. */
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* END TEMP */
}

.mode-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(74,222,128,0.15);
  color: #4ADE80;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(74,222,128,0.4);
  animation: fieldBadgePulse 3s ease-in-out infinite;
}
@keyframes fieldBadgePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(74,222,128,0.2); }
  50%       { box-shadow: 0 0 16px rgba(74,222,128,0.4); }
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover, .icon-btn:active { background: var(--bg-4); color: var(--text-primary); }

/* Settings gear — muted default, spins on hover */
#btn-settings { color: rgba(255,255,255,0.5); }
#btn-settings:hover { color: var(--text-primary); }
#btn-settings:hover svg { animation: gearSpin 0.4s ease-out; }
@keyframes gearSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Back arrow — slides left on hover, greyed-out when at history root */
#btn-back svg { transition: transform 0.2s ease; }
#btn-back:hover svg { transform: translateX(-3px); }
#btn-back.is-disabled {
  color: rgba(255,255,255,0.18);
  cursor: default;
  pointer-events: none;
}
#btn-back.is-disabled:hover { background: transparent; }
#btn-back.is-disabled:hover svg { transform: none; }

/* ---- Screens ---- */
.screen { display: none; min-height: 100vh; padding-top: calc(var(--header-h) + 16px); padding-bottom: 80px; }
.screen.active { display: flex; flex-direction: column; }

/* ---- Auth / Onboarding Flow ---- */
.auth-flow {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg-0); overflow: hidden;
}
.auth-flow.hidden { display: none; }
.auth-screen {
  position: absolute; inset: 0; overflow-y: auto;
  display: none; -webkit-overflow-scrolling: touch;
}
.auth-screen.active { display: block; animation: authSlideIn 0.3s ease; }
.auth-screen.slide-out { animation: authSlideOut 0.3s ease forwards; }
.auth-screen.slide-in-rev { animation: authSlideInRev 0.3s ease; }
@keyframes authSlideIn  { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes authSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-40px); opacity: 0; } }
@keyframes authSlideInRev { from { transform: translateX(-40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.auth-content {
  max-width: 360px; margin: 0 auto;
  padding: 60px 24px 40px;
  display: flex; flex-direction: column;
}
.auth-logo { margin: 0 auto 16px; display: block; }
.auth-title {
  font-family: var(--font-headline); font-size: 24px; font-weight: 800;
  color: var(--text-primary); text-align: center; margin-bottom: 6px;
}
.auth-sub {
  font-size: 14px; color: var(--text-tertiary); text-align: center;
  margin-bottom: 28px;
}

/* Social buttons */
.auth-social {
  width: 100%; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px; border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.auth-social:hover { opacity: 0.9; }
.auth-apple  { background: #fff; color: #000; }
.auth-google { background: var(--bg-3); color: var(--text-primary); border: 1px solid var(--border-md); }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-tertiary); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-input {
  width: 100%; height: 48px; background: var(--bg-3);
  border: 1px solid var(--border-md); border-radius: 10px;
  padding: 0 14px; font-family: var(--font); font-size: 15px;
  color: var(--text-primary); outline: none; margin-bottom: 10px;
  transition: border-color 0.2s ease;
}
.auth-input:focus { border-color: rgba(74,222,128,0.4); }
.auth-input::placeholder { color: var(--text-tertiary); }
.auth-input-row { position: relative; }
.auth-input-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 16px; color: var(--text-tertiary);
}

.auth-submit {
  width: 100%; height: 48px; background: #4ADE80; color: #0a0e13;
  border: none; border-radius: 10px;
  font-family: var(--font-headline); font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 6px;
  box-shadow: 0 4px 16px rgba(74,222,128,0.25);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auth-submit:hover { background: #3cc870; }
.auth-submit:active { transform: scale(0.98); }

.auth-toggle {
  text-align: center; font-size: 13px; color: var(--text-tertiary);
  margin-top: 16px;
}
.auth-toggle-btn {
  background: none; border: none; color: #4ADE80; font-weight: 600;
  font-family: var(--font); font-size: 13px; cursor: pointer;
}
.auth-fine { text-align: center; font-size: 11px; color: var(--text-tertiary); margin-top: 12px; }
.auth-legal { text-align: center; font-size: 10px; color: rgba(255,255,255,0.25); margin-top: 8px; }
.auth-legal a { color: rgba(255,255,255,0.35); text-decoration: underline; }

/* Onboarding progress */
.ob-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.ob-dot.active { background: #4ADE80; }
.ob-dot.done { background: rgba(74,222,128,0.4); }

/* Category chips */
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ob-chip {
  padding: 10px 16px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 14px; color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ob-chip:hover { border-color: var(--border-md); }
.ob-chip.selected {
  background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.4);
  color: #4ADE80;
}

/* Platform cards */
.ob-platforms { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.ob-platform {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ob-platform:hover { border-color: var(--border-md); }
.ob-platform.selected { border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.04); }
.ob-plat-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ob-plat-fee { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }

/* ROI pills + source pills */
.ob-roi-pills, .ob-source-pills { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.ob-pill {
  padding: 8px 16px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 13px; font-family: var(--font-mono); font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ob-pill.selected { background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.4); color: #4ADE80; }
.ob-example { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; }
.ob-hint { font-size: 11px; color: var(--text-tertiary); margin-top: -4px; }

.ob-inline-field {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); margin-top: 8px;
}
.ob-inline-field span { min-width: 100px; }
.ob-inline-input {
  width: 56px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 6px; text-align: right;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-primary);
  outline: none; -moz-appearance: textfield;
}
.ob-inline-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.ob-auction-fields { padding: 4px 0 8px; }

/* Navigation */
.ob-nav-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ob-nav-row .auth-submit { flex: 1; }
.ob-back {
  background: none; border: none; font-family: var(--font);
  font-size: 13px; color: var(--text-tertiary); cursor: pointer;
  flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.ob-back:hover { color: var(--text-secondary); }
.ob-skip {
  display: block; background: none; border: none;
  font-size: 12px; color: var(--text-tertiary); cursor: pointer;
  text-align: center; margin-top: 10px; width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.ob-skip:hover { color: var(--text-secondary); }
.ob-continue { margin-top: 0; }

/* Completion check */
.ob-check-circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(74,222,128,0.1); border: 2px solid rgba(74,222,128,0.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; animation: obCheckPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes obCheckPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---- Home Dashboard ---- */
#screen-home { padding-left: 20px; padding-right: 20px; }

.home-content {
  display: flex; flex-direction: column; gap: 18px;
  width: 100%; max-width: 480px; margin: 0 auto;
  padding-top: 8px; padding-bottom: 24px;
}

.home-section {
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.home-section.visible { opacity: 1; transform: translateY(0); }

/* Greeting */
.welcome-greeting {
  font-family: var(--font-headline); font-size: 22px; font-weight: 800;
  color: var(--text-primary); line-height: 1.3;
}

/* Quick Stats Row (3 cards) */
.dash-stats-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.dash-stat-card {
  background: #151B23; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
  text-align: center;
}
.dash-stat-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.dash-stat-value {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
}
.dash-profit-val { color: #4ADE80; }

/* Scan CTA */
.btn-scan-cta {
  width: 100%; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #4ADE80; color: #0a0e13;
  border: none; border-radius: 12px;
  font-family: var(--font-headline); font-size: 16px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(74,222,128,0.3), 0 0 24px rgba(74,222,128,0.15);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-scan-cta:hover {
  background: #3cc870;
  box-shadow: 0 6px 24px rgba(74,222,128,0.4), 0 0 32px rgba(74,222,128,0.2);
}
.btn-scan-cta:active { transform: scale(0.98); }

/* Section headers */
.home-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.home-see-all {
  background: none; border: none; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.4); cursor: pointer; font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.home-see-all:hover { color: var(--text-secondary); }

/* Recent searches list (home) */
.home-recent-list { display: flex; flex-direction: column; gap: 4px; }
.home-recent-empty {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 12px;
  font-size: 13px; color: var(--text-tertiary);
  line-height: 1.4;
}
.home-recent-empty svg { color: var(--text-tertiary); flex-shrink: 0; }
.home-recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: #151B23; border: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.home-recent-item:hover { background: var(--bg-3); }
.home-recent-item:active { background: var(--bg-4); }
.home-recent-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.home-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-recent-info { flex: 1; min-width: 0; }
.home-recent-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.home-recent-meta {
  font-size: 11px; color: var(--text-tertiary); display: block; margin-top: 1px;
}
.home-recent-right { text-align: right; flex-shrink: 0; }
.home-recent-price {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: #4ADE80; display: block;
}
.home-recent-roi {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
  display: block; margin-top: 1px;
}

/* Top Finds horizontal scroll */
.top-finds-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 4px;
}
.top-finds-scroll::-webkit-scrollbar { display: none; }
.top-find-card {
  flex: 0 0 140px; background: #151B23; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px; cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.top-find-card:hover { background: var(--bg-3); }
.top-find-thumb {
  width: 100%; aspect-ratio: 1/1; border-radius: 8px;
  background: rgba(255,255,255,0.05); margin-bottom: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.top-find-thumb img { width: 100%; height: 100%; object-fit: cover; }
.top-find-name {
  font-size: 11px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; margin-bottom: 4px;
}
.top-find-profit {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: #4ADE80; display: block;
}
.top-find-roi {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
  display: block;
}

/* Market tip */
.market-tip-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(74,222,128,0.04); border: 1px solid rgba(74,222,128,0.10);
  border-radius: var(--radius-md); padding: 12px 14px;
}
.market-tip-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.market-tip-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: #0D1117;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.35); padding: 6px 0;
  transition: color 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.nav-tab:hover { color: rgba(255,255,255,0.55); }
.nav-tab.active { color: #4ADE80; }
.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  font-family: var(--font);
}

/* ---- Search Screen ---- */
#screen-search { padding-left: 0; padding-right: 0; padding-bottom: 0; }

/* Search bar */
.scan-search-bar { padding: 0 16px 8px; }
.scan-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #151B23; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 0 14px; height: 48px;
  transition: border-color 0.2s ease;
}
.scan-search-wrap:focus-within {
  border-color: rgba(74,222,128,0.3);
  box-shadow: 0 0 0 2px rgba(74,222,128,0.06);
}
.scan-search-icon { flex-shrink: 0; color: var(--text-tertiary); }
.scan-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--font); font-size: 15px; color: var(--text-primary);
  caret-color: #E5A228;
}
.scan-search-input::placeholder { color: var(--text-tertiary); }
.scan-barcode-btn {
  flex-shrink: 0; background: none; border: none;
  color: var(--accent); cursor: pointer; padding: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.scan-barcode-btn:hover { opacity: 0.7; }

/* Tabs */
.scan-tabs {
  display: flex; gap: 0; padding: 0 16px 10px;
}
.scan-tab {
  flex: 1; padding: 8px 0; border: none; background: none;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer; text-align: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.scan-tab.active { color: var(--text-primary); border-bottom-color: #4ADE80; }
.scan-tab:hover:not(.active) { color: var(--text-secondary); }

/* Panels */
.scan-panels { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scan-panel { display: none; flex: 1; flex-direction: column; }
.scan-panel.active { display: flex; }

/* Barcode viewfinder */
.scan-viewfinder {
  flex: 1; position: relative;
  background: #0a0c0f;
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
}
.scan-vf-overlay {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px;
}
.scan-reticle {
  width: 220px; height: 140px; position: relative;
}
.scan-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: rgba(255,255,255,0.5); border-style: solid; border-width: 0;
}
.scan-corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-radius: 6px 0 0 0; }
.scan-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-radius: 0 6px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 6px; }
.scan-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 6px 0; }
.scan-line {
  position: absolute; left: 12px; right: 12px;
  height: 2px; background: #4ADE80; top: 50%;
  box-shadow: 0 0 8px rgba(74,222,128,0.5);
  animation: scanLinePulse 2s ease-in-out infinite;
}
@keyframes scanLinePulse {
  0%, 100% { opacity: 0.4; transform: translateY(-20px); }
  50% { opacity: 1; transform: translateY(20px); }
}
.scan-vf-hint {
  font-size: 13px; color: rgba(255,255,255,0.4); text-align: center;
}
.scan-vf-controls {
  position: absolute; bottom: 16px; left: 20px;
}
.scan-torch-btn {
  background: rgba(255,255,255,0.1); border: none;
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scan-torch-btn:hover { background: rgba(255,255,255,0.15); color: var(--text-primary); }

/* Demo scan button */
.scan-demo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 16px;
  background: var(--accent); color: #0a0e13; border: none;
  border-radius: var(--radius-md); height: 44px;
  font-family: var(--font-headline); font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 16px rgba(229,162,40,0.25);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.scan-demo-btn:hover { background: var(--accent-hover); }
.scan-demo-btn:active { transform: scale(0.98); }

/* Text panel */
.scan-text-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.scan-text-input-wrap { display: flex; flex-direction: column; gap: 10px; }

/* Photo panel placeholder */
.scan-photo-placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; min-height: 280px;
  color: var(--text-tertiary);
}
.scan-photo-lock { font-size: 15px; font-weight: 600; }
.scan-photo-hint { font-size: 12px; opacity: 0.6; }

/* Recent searches (shared) */
.scan-recent { display: flex; flex-direction: column; gap: 8px; }

/* Bottom hint */
.scan-bottom-hint {
  text-align: center; font-size: 11px; color: var(--text-tertiary);
  padding: 8px 16px 12px; opacity: 0.6;
}
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.recent-item:hover { background: var(--bg-2); }
.recent-item:active { background: var(--bg-3); }
.recent-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
}
.recent-text { flex: 1; min-width: 0; }
.recent-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-meta {
  font-size: 11px; color: var(--text-tertiary); margin-top: 1px;
}
.recent-arrow { flex-shrink: 0; color: var(--text-tertiary); opacity: 0.5; }

/* ---- Capture ---- */
#screen-capture { align-items: center; padding-left: 20px; padding-right: 20px; }

.capture-zone {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; width: 100%; max-width: 360px; margin-top: 40px;
}

.capture-icon {
  width: 96px; height: 96px;
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
}

.capture-hint { font-size: 14px; color: var(--text-secondary); text-align: center; }
.manual-entry { margin-top: 24px; }

.photo-previews { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.preview-list { display: flex; gap: 10px; flex-wrap: wrap; }

.preview-thumb {
  position: relative; width: 88px; height: 88px;
  border-radius: var(--radius-md); overflow: hidden;
  border: 2px solid var(--border); flex-shrink: 0;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-thumb .remove-photo {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.7); border: none; color: white;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.capture-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* ---- Processing ---- */
#screen-processing { align-items: center; justify-content: center; }

.processing-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.spinner-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--bg-4);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.processing-label { font-family: var(--font-headline); font-size: 18px; font-weight: 700; }
.processing-sub { font-size: 14px; color: var(--text-secondary); margin-top: -12px; }

/* ---- Confirm ---- */
#screen-confirm { padding: 0; }

.confirm-content {
  display: flex; flex-direction: column; gap: 16px;
  padding: calc(var(--header-h) + 20px) 16px 32px;
}

.confirm-photo-strip { display: flex; gap: 8px; }
.confirm-photo-strip img {
  height: 72px; width: 72px; object-fit: cover;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}

.id-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.id-card:hover { border-color: var(--border-hi); box-shadow: var(--card-hover-shadow); }

.id-card-header { display: flex; align-items: center; justify-content: space-between; }
.id-name-wrap { display: flex; align-items: flex-start; gap: 8px; }

.id-name {
  font-family: var(--font-headline); font-size: 18px; font-weight: 700;
  color: var(--text-primary); line-height: 1.3; flex: 1;
}

.btn-edit { padding: 4px; background: none; border: none; color: var(--text-tertiary); cursor: pointer; border-radius: var(--radius-sm); }
.btn-edit:hover { color: var(--accent); }

.input-edit {
  width: 100%; background: var(--bg-3); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 16px; padding: 8px 10px; outline: none; font-family: var(--font);
}

.id-category { font-size: 13px; color: var(--text-secondary); }

/* Item condition — selects which comp segment drives price and confidence.
   Sits in the id-card because it describes the item, so it applies to both
   the cost path and Max Bid Mode. */
.condition-field {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border);
}
/* Same control on the results header card, which is more compact than the
   confirm screen's ID card — only the surrounding spacing differs. */
.condition-field-results { margin-top: 12px; }
.condition-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.condition-pill {
  /* min-height honours the 44px touch-target floor in CLAUDE.md; the pills
     wrap rather than shrink below it on narrow screens. */
  min-height: 44px; padding: 8px 16px; background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.condition-pill:hover { border-color: var(--border-md); }
.condition-pill.active {
  background: rgba(229,162,40,0.10); border-color: var(--accent); color: var(--accent);
}

.cost-input-wrap {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--card-shadow);
}

.input-dollar-wrap { display: flex; align-items: center; gap: 6px; }
.dollar-sign { font-family: var(--font-mono); font-size: 18px; color: var(--text-secondary); font-weight: 500; }

/* Command-feel inputs (Vercel-inspired) */
.input-cost, .input-full {
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 500;
  padding: 10px 14px;
  outline: none;
  transition: box-shadow 0.2s ease;
  -moz-appearance: textfield;
}
.input-cost::-webkit-outer-spin-button,
.input-cost::-webkit-inner-spin-button { -webkit-appearance: none; }
.input-cost:focus, .input-full:focus {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), inset 0 0 0 1px var(--accent);
}
.input-cost::placeholder, .input-full::placeholder { color: var(--text-tertiary); transition: opacity 0.2s ease; }
.input-cost:focus::placeholder, .input-full:focus::placeholder { opacity: 0; }
.input-full { font-family: var(--font); font-size: 16px; }
.input-full { width: 100%; }

/* Purchase price hint & expander */
.cost-hint {
  font-size: 11px; color: var(--text-tertiary); margin-top: -4px;
}
.cost-expander {
  background: none; border: none; font-family: var(--font);
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  cursor: pointer; padding: 4px 0; text-align: left;
  transition: color 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.cost-expander:hover { color: var(--text-secondary); }
.cost-expander-arrow {
  display: inline-block; transition: transform 0.2s ease;
  font-size: 10px;
}
.cost-expander-arrow.open { transform: rotate(90deg); }

/* Cost breakdown panel */
.cost-breakdown {
  background: rgba(0,0,0,0.2); border-radius: var(--radius-md);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  margin-top: 2px;
}
.cost-bd-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.cost-bd-label {
  color: var(--text-secondary); min-width: 80px; flex-shrink: 0;
}
.cost-bd-input-wrap {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.cost-bd-dollar { font-family: var(--font-mono); font-size: 13px; color: var(--text-tertiary); }
.cost-bd-input {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--text-primary); outline: none; width: 100%;
  -moz-appearance: textfield;
}
.cost-bd-input::-webkit-inner-spin-button,
.cost-bd-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cost-bd-input:focus { border-color: rgba(229,162,40,0.4); }
.cost-bd-pct-wrap {
  display: flex; align-items: center; gap: 2px;
}
.cost-bd-pct {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 6px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--text-primary); outline: none; width: 48px;
  text-align: right; -moz-appearance: textfield;
}
.cost-bd-pct::-webkit-inner-spin-button,
.cost-bd-pct::-webkit-outer-spin-button { -webkit-appearance: none; }
.cost-bd-pct:focus { border-color: rgba(229,162,40,0.4); }
.cost-bd-pct-sign { font-size: 12px; color: var(--text-tertiary); }
.cost-bd-amt { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); margin-left: auto; white-space: nowrap; }
/* Premium info tooltip */
.cost-bd-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; font-size: 10px; line-height: 1;
  color: var(--text-tertiary); cursor: pointer; vertical-align: middle;
  margin-left: 2px; -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.cost-bd-info:hover { color: var(--text-secondary); }
.cost-bd-info-text {
  font-size: 11px; color: var(--text-tertiary); line-height: 1.5;
  padding: 8px 10px; margin: -2px 0 4px;
  background: rgba(0,0,0,0.25); border-radius: var(--radius-sm);
  grid-column: 1 / -1;
}
.cost-bd-info-dismiss {
  background: none; border: none; font-family: var(--font);
  font-size: 11px; font-weight: 600; color: var(--accent);
  cursor: pointer; padding: 0; margin-left: 4px;
  -webkit-tap-highlight-color: transparent;
}

.cost-bd-divider { height: 1px; background: var(--border); margin: 2px 0; }
.cost-bd-total { font-weight: 600; }
.cost-bd-total .cost-bd-label { color: var(--text-primary); }
.cost-bd-total-val {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--accent); margin-left: auto;
}

/* Settings toggle */
.settings-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.settings-checkbox { display: none; }
.settings-toggle-track {
  width: 38px; height: 20px; border-radius: 10px;
  background: var(--bg-4); position: relative;
  transition: background 0.2s ease; flex-shrink: 0;
}
.settings-toggle-track::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-secondary);
  top: 2px; left: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.settings-checkbox:checked + .settings-toggle-track {
  background: rgba(74,222,128,0.25);
}
.settings-checkbox:checked + .settings-toggle-track::after {
  transform: translateX(18px); background: #4ADE80;
}
.settings-hint {
  font-size: 11px; color: var(--text-tertiary); margin-top: -4px;
}

.confirm-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---- Results Screen ---- */
#screen-results {
  position: relative;
  padding-left: 16px;
  padding-right: 16px;
  gap: 10px;
}

/* ---- Skeleton overlay (Vercel-inspired) ---- */
.results-skeleton {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(var(--header-h) + 16px) 16px 32px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 30;
  background: var(--bg-0);
  min-height: 100vh;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.results-skeleton.hidden { opacity: 0; }

.skel-block {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-lg);
}
.skel-row-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.skel-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.skel-comp-row { display: flex; gap: 10px; overflow: hidden; }

/* ---- Results content ---- */
.results-item-header {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.results-item-header:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-1px);
}

.results-name {
  font-family: var(--font-headline); font-size: 17px; font-weight: 700;
  color: var(--text-primary); line-height: 1.3; margin-bottom: 6px;
}
.results-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.results-category { font-size: 13px; color: var(--text-secondary); }

/* ---- KPI Cards Row ---- */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg);
  padding: 13px 8px 12px;
  display: flex; flex-direction: column;
  align-items: center; gap: 7px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: default;
}
.kpi-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.kpi-header { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; }

.kpi-icon-circle {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text-tertiary);
}
.kpi-icon-circle.kpi-icon-amber { background: var(--accent-soft); color: var(--accent); }
.kpi-icon-circle.kpi-icon-green { background: var(--green-soft); color: var(--green); }
.kpi-icon-circle.kpi-icon-mint  { background: var(--mint-soft); color: var(--mint-bright); }

.kpi-label { font-size: 8px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-tertiary); text-transform: uppercase; white-space: nowrap; }

.kpi-value {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary); line-height: 1;
  transition: color 0.3s ease;
}
.kpi-value.mono  { font-family: var(--font-mono); font-weight: 500; font-size: 19px; letter-spacing: -0.5px; }
.kpi-value.kpi-amber { color: var(--accent); }
.kpi-value.kpi-green { color: var(--green); }
.kpi-value.kpi-red   { color: var(--red); }

.kpi-sub { font-size: 9px; color: var(--text-secondary); line-height: 1; min-height: 11px; }
.kpi-sub.mono { font-family: var(--font-mono); }
.kpi-sub.pos  { color: var(--green); }
.kpi-sub.neg  { color: var(--red); }

/* ---- Score Banner ---- */
.score-banner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 18px;
  box-shadow: var(--card-shadow);
}
.score-banner .gauge-wrap { width: 100px; height: 100px; flex-shrink: 0; }
.score-banner .gauge-center { inset: 13px; }
.score-banner .gauge-bloom  { inset: -16px; }
.score-banner .gauge-score  { font-size: 36px; }
.score-banner .gauge-wrap.is-buy  {
  animation: none;
  box-shadow: 0 0 32px rgba(74,222,128,0.35), 0 0 64px rgba(74,222,128,0.18);
}
.score-banner .gauge-wrap.is-wait {
  animation: none;
  box-shadow: 0 0 32px rgba(229,162,40,0.30), 0 0 64px rgba(229,162,40,0.15);
}
.score-banner .gauge-wrap.is-pass {
  box-shadow: 0 0 32px rgba(248,113,113,0.30), 0 0 64px rgba(248,113,113,0.15);
}
.score-banner-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.score-banner-verdict {
  font-size: 30px; font-weight: 800; letter-spacing: 0.5px;
  line-height: 1; text-transform: uppercase;
  color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 8px;
}
.score-banner.is-buy           .score-banner-verdict { color: var(--green); }
.score-banner.is-wait          .score-banner-verdict { color: var(--yellow); }
.score-banner.is-pass          .score-banner-verdict { color: var(--red); }
.score-banner.is-insufficient  .score-banner-verdict {
  color: var(--text-tertiary);
  font-size: 22px; letter-spacing: 0.4px;
}
.score-banner-warn {
  color: var(--yellow);
  flex-shrink: 0;
}
/* Retry — only ever rendered under an INSUFFICIENT DATA banner caused by a
   source outage, so it is styled as a quiet affordance rather than a primary
   action: the point is that the app has no answer, not that it wants a tap. */
.score-retry {
  align-self: flex-start;
  margin-top: 2px;
  min-height: 44px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-primary);
  background: var(--bg-3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.score-retry:hover  { background: var(--bg-4); border-color: var(--text-tertiary); }
.score-retry:active { transform: scale(0.98); }
.score-banner-subtitle {
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.3;
}

/* ---- CSS Conic Gauge (Vercel bloom + no SVG) ---- */

.gauge-wrap {
  position: relative;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  --gauge-deg: 0deg;
}
.gauge-wrap.is-buy {
  box-shadow: 0 0 20px rgba(74,222,128,0.3), 0 0 40px rgba(74,222,128,0.15);
  animation: gaugeGlow 3s ease-in-out infinite;
}
@keyframes gaugeGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(74,222,128,0.3), 0 0 40px rgba(74,222,128,0.15); }
  50%       { box-shadow: 0 0 32px rgba(74,222,128,0.5), 0 0 60px rgba(74,222,128,0.25); }
}

/* Bloom glow layer */
.gauge-bloom {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.gauge-wrap.is-buy .gauge-bloom {
  background: radial-gradient(circle, oklch(63% 0.07 200 / 0.40) 0%, transparent 65%);
  filter: blur(4px);
  opacity: 1;
  animation: bloomPulse 3s ease-in-out infinite;
}
.gauge-wrap.is-pass .gauge-bloom {
  background: radial-gradient(circle, oklch(66% 0.20 25 / 0.35) 0%, transparent 65%);
  filter: blur(4px);
  opacity: 1;
}
.gauge-wrap.is-wait .gauge-bloom {
  background: radial-gradient(circle, oklch(83% 0.17 85 / 0.30) 0%, transparent 65%);
  filter: blur(4px);
  opacity: 1;
}

@keyframes bloomPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%       { opacity: 1.00; transform: scale(1.1); }
}

/* Conic gradient ring */
.gauge-conic {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    oklch(55% 0.15 190)    0deg,
    #4ADE80                var(--gauge-deg),
    rgba(255,255,255,0.05) var(--gauge-deg)
  );
  transition: background 0.1s ease;
}
.gauge-wrap.is-pass .gauge-conic {
  background: conic-gradient(
    from -90deg,
    var(--red) 0deg,
    oklch(66% 0.20 25 / 0.5) var(--gauge-deg),
    rgba(255,255,255,0.05) var(--gauge-deg)
  );
}
.gauge-wrap.is-wait .gauge-conic {
  background: conic-gradient(
    from -90deg,
    oklch(75% 0.16 80) 0deg,
    var(--yellow) var(--gauge-deg),
    rgba(255,255,255,0.05) var(--gauge-deg)
  );
}

/* Mask center to create ring */
.gauge-center {
  position: absolute; inset: 8px;
  border-radius: 50%;
  background: var(--bg-2);
  z-index: 1;
}

.gauge-score {
  position: relative; z-index: 2;
  font-family: var(--font-mono); font-size: 15px;
  font-weight: 500; color: var(--text-primary); line-height: 1;
}

/* ---- Ownership Card (post-purchase state) ---- */
.ownership-card {
  background: oklch(82% 0.19 145 / 0.06);
  border: 1px solid oklch(82% 0.19 145 / 0.22);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ownership-card-main {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
}
.ownership-card-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: oklch(82% 0.19 145 / 0.18);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.ownership-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ownership-card-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.1px;
  color: var(--text-primary); line-height: 1.1;
}
.ownership-card-sub {
  font-size: 12.5px; color: var(--text-secondary);
  font-family: var(--font-mono);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ownership-card-sub-sep { opacity: 0.5; }
.ownership-card-affordance {
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}
.ownership-card-main:hover .ownership-card-affordance {
  color: var(--text-secondary); transform: translateX(2px);
}
.ownership-card-actions {
  display: flex; align-items: center; gap: 8px;
  padding-top: 8px;
  border-top: 1px solid oklch(82% 0.19 145 / 0.18);
}
.ownership-action-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 6px;
}
.ownership-action-btn:hover { color: var(--text-primary); }
.ownership-action-remove { color: var(--red); }
.ownership-action-remove:hover { color: var(--red); opacity: 0.8; }
.ownership-actions-sep { color: var(--text-tertiary); }
.ownership-card-remove-confirm {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 8px;
  border-top: 1px solid oklch(82% 0.19 145 / 0.18);
}
.ownership-remove-q { font-size: 12.5px; color: var(--text-secondary); }
.ownership-remove-btns { display: flex; gap: 8px; }
.ownership-remove-yes {
  background: var(--red); color: white; border: none;
  padding: 6px 12px; border-radius: var(--radius-md);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.ownership-remove-no {
  background: none; color: var(--text-secondary); border: 1px solid var(--border-hi);
  padding: 6px 12px; border-radius: var(--radius-md);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}

/* ---- Breakdown Expand Toggle ---- */
.breakdown-toggle {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.breakdown-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hi);
}
.breakdown-toggle-chevron {
  transition: transform 0.25s ease;
}
.breakdown-toggle.expanded .breakdown-toggle-chevron {
  transform: rotate(180deg);
}

/* ---- Strategy Toggle ---- */
.strategy-toggle {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 5px;
  box-shadow: var(--card-shadow);
}

.strategy-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); cursor: pointer;
  transition: background 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.strategy-btn.active {
  background: rgba(229, 162, 40, 0.08);
  border-color: #E5A228;
}
.strategy-icon { font-size: 16px; line-height: 1; }
.strategy-label {
  font-family: var(--font); font-size: 10.5px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.01em;
  transition: color 0.2s ease, font-weight 0.2s ease;
}
.strategy-btn.active .strategy-label { color: var(--text-primary); font-weight: 700; }
.strategy-btn:not(.active):hover { background: var(--bg-4); }

/* ---- Price Hero ---- */
.price-hero {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 20px 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.price-hero:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.price-hero-left { display: flex; flex-direction: column; gap: 3px; }

/* Main price — supporting context; Score banner is the headline */
.price-value {
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px; line-height: 1;
  margin-top: 4px;
}

.price-range { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.price-hero-right { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.platform-pill-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* Stripe-inspired status badges */
.platform-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.platform-pill.ebay     { background: oklch(50% 0.20 25 / 0.14); color: #ff7478; border: 1px solid oklch(50% 0.20 25 / 0.28); }
.platform-pill.amazon   { background: oklch(75% 0.15 65 / 0.14); color: #ffaa33; border: 1px solid oklch(75% 0.15 65 / 0.28); }
.platform-pill.facebook { background: oklch(55% 0.15 260 / 0.14); color: #6aadff; border: 1px solid oklch(55% 0.15 260 / 0.28); }
.platform-pill.poshmark { background: oklch(50% 0.20 25 / 0.14); color: #ff7474; border: 1px solid oklch(50% 0.20 25 / 0.28); }
.platform-pill.mercari  { background: oklch(52% 0.12 270 / 0.14); color: #8a9ef0; border: 1px solid oklch(52% 0.12 270 / 0.28); }

/* ---- Stats Row ---- */
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.stat-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-md); padding: 12px 10px;
  display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.stat-value {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; color: var(--text-primary); line-height: 1.2;
  transition: color 0.2s ease;
}
.stat-value.green { color: #4ADE80; }
.stat-value.amber { color: #E5A228; }
.stat-value.red   { color: #F87171; }

/* Sparkline (Robinhood-inspired) */
.sparkline-wrap { display: flex; align-items: center; }
.sparkline-wrap svg { display: block; }

/* ---- Confidence Badges (Stripe pill style) ---- */
.confidence-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
/* HIGH badge has subtle pulse glow */
.confidence-badge.high {
  background: var(--green-soft); color: var(--green);
  border: 1px solid oklch(82% 0.19 145 / 0.28);
  animation: badgePulse 2.8s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
  50%       { box-shadow: 0 0 8px 2px rgba(74,222,128,0.30); }
}
.confidence-badge.med {
  background: var(--yellow-soft); color: var(--yellow);
  border: 1px solid oklch(83% 0.17 85 / 0.25);
}
.confidence-badge.low {
  background: var(--red-soft); color: var(--red);
  border: 1px solid oklch(66% 0.20 25 / 0.28);
}

/* ---- Margin Card ---- */
.margin-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.margin-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-1px);
}

.margin-card-title {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-headline); font-size: 11px; font-weight: 700;
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.margin-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--text-secondary);
  padding: 4px 0;
}
.margin-row.margin-net {
  font-family: var(--font-headline); font-size: 16px; font-weight: 700;
  color: var(--text-primary);
}
/* Robinhood rule: green = positive, red = negative only */
.margin-row .neg { color: var(--red);   font-family: var(--font-mono); font-size: 13px; }
.margin-row .pos { color: var(--green); font-family: var(--font-mono); font-size: 13px; }

.margin-divider { height: 1px; background: var(--border-hi); }

/* ---- Sweet Spot Card ---- */
.sweet-spot-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.sweet-spot-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-1px);
}

.sweet-spot-header {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-headline); font-size: 11px; font-weight: 700;
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sweet-spot-header svg { color: var(--accent); flex-shrink: 0; }

.sweet-spot-rows { display: flex; flex-direction: column; gap: 5px; }

.sweet-spot-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sweet-spot-row.is-best {
  background: var(--bg-3);
  border-color: var(--border-md);
}
/* Current strategy selection — inset left bar, no layout shift */
.sweet-spot-row.is-selected {
  box-shadow: inset 3px 0 0 #E5A228;
  background: rgba(255,255,255,0.04);
}
.sweet-spot-row.is-best.is-selected {
  background: var(--bg-3);
  box-shadow: inset 3px 0 0 #E5A228;
}
.sweet-spot-row.is-selected .sweet-spot-name { color: var(--text-primary); }

.sweet-spot-row-top {
  display: flex; align-items: center; justify-content: space-between;
}
.sweet-spot-strategy { display: flex; align-items: center; gap: 6px; }
.sweet-spot-icon { font-size: 13px; line-height: 1; }
.sweet-spot-name {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-secondary);
}
.sweet-spot-row.is-best .sweet-spot-name { color: var(--text-primary); }

.sweet-spot-row-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.sweet-spot-value {
  font-family: var(--font-mono); font-size: 16px; font-weight: 500;
  color: var(--text-secondary); white-space: nowrap;
}
.sweet-spot-row.is-best .sweet-spot-value {
  font-size: 18px; color: var(--accent);
}
.sweet-spot-badge {
  font-family: var(--font-headline); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sweet-spot-badge-rec {
  color: #4ADE80;
  text-shadow: 0 0 8px rgba(74,222,128,0.5);
}
.sweet-spot-badge-pick {
  color: #E5A228;
  text-shadow: 0 0 8px rgba(229,162,40,0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sweet-spot-badge-pick.visible { opacity: 1; }

/* Bar track */
.sweet-spot-bar-track {
  height: 8px; background: var(--bg-5);
  border-radius: 999px; overflow: hidden;
}
.sweet-spot-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: rgba(229,162,40,0.35);
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.sweet-spot-bar-fill.is-best-fill {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Summary + note lines */
.sweet-spot-summary {
  font-family: var(--font); font-size: 13px; font-style: italic;
  color: var(--text-secondary); line-height: 1.55;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.sweet-spot-note {
  font-family: var(--font); font-size: 11px;
  color: var(--text-tertiary); line-height: 1.5;
  margin-top: 4px; min-height: 0;
}
.sweet-spot-footnote {
  font-family: var(--font); font-size: 11px; font-style: italic;
  color: rgba(255,255,255,0.35); line-height: 1.5;
  margin-top: 12px;
}
.sweet-spot-footnote svg { display: inline; vertical-align: middle; margin-right: 4px; position: relative; top: -1px; }
.sweet-spot-footnote-em { color: rgba(255,255,255,0.50); }

/* ---- Comp Cards ---- */
.comps-section { display: flex; flex-direction: column; gap: 10px; }

.comps-header {
  display: flex; align-items: center; justify-content: space-between; padding: 0 2px;
}
.comps-count { font-size: 12px; color: var(--text-tertiary); }

.comp-cards-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.comp-cards-scroll::-webkit-scrollbar { display: none; }

.comp-card {
  flex-shrink: 0; width: 160px;
  background: var(--bg-2); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  cursor: default;
}
.comp-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.comp-card-price {
  font-family: var(--font-mono); font-size: 20px; font-weight: 500;
  color: var(--text-primary); letter-spacing: -0.5px; line-height: 1;
}

.comp-card-title {
  font-size: 12px; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.comp-card-meta { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 2px; }

.comp-card-condition-row { display: flex; align-items: center; gap: 5px; }

.condition-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.condition-dot.dot-green  { background: var(--green); }
.condition-dot.dot-mint   { background: var(--mint-bright); }
.condition-dot.dot-yellow { background: var(--yellow); }
.condition-dot.dot-orange { background: oklch(72% 0.19 55); }
.condition-dot.dot-red    { background: var(--red); }
.condition-dot.dot-gray   { background: var(--text-tertiary); }

.comp-card-condition { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.comp-card-date      { font-size: 12px; color: rgba(255,255,255,0.4); }

.comp-card-platform {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: var(--radius-full); align-self: flex-start;
}
.comp-card-platform.ebay { background: oklch(50% 0.20 25 / 0.13); color: #ff7478; border: 1px solid oklch(50% 0.20 25 / 0.22); }

/* Horizontal section divider (Stripe-inspired) */
.section-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ---- Results Footer ---- */
.results-footer { padding-top: 8px; padding-bottom: 8px; }

.btn-new-search {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #0a0e13;
  border: none; border-radius: var(--radius-md);
  font-family: var(--font-headline); font-size: 15px; font-weight: 700;
  padding: 13px 22px; cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: 0 0 24px var(--accent-glow), 0 2px 8px oklch(73% 0.14 65 / 0.2);
  -webkit-tap-highlight-color: transparent;
}
.btn-new-search:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px var(--accent-glow), 0 4px 16px oklch(73% 0.14 65 / 0.25);
}
.btn-new-search:hover .search-icon { transform: rotate(15deg); }
.btn-new-search:active { transform: scale(0.98); }
.btn-new-search.btn-full { width: 100%; }

/* Search icon rotation micro-interaction */
.search-icon { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); flex-shrink: 0; }

/* TEMP: dev empty-state preview menu — remove before launch */
.dev-empty-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  -webkit-tap-highlight-color: transparent;
}
.dev-empty-card {
  width: 100%; max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.dev-empty-title {
  font-family: var(--font-headline);
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--text-tertiary); text-transform: uppercase;
  margin-bottom: 6px;
}
.dev-empty-btn {
  width: 100%; min-height: 44px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  text-align: left; padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dev-empty-btn:hover { background: var(--bg-4); border-color: var(--border-hi); }
.dev-empty-btn-reset {
  color: var(--green);
  border-color: oklch(82% 0.19 145 / 0.28);
  margin-top: 4px;
}
.dev-empty-close {
  align-self: center; margin-top: 6px;
  background: none; border: none;
  color: var(--text-tertiary); font-family: inherit; font-size: 12px;
  cursor: pointer; padding: 8px 12px;
}
.dev-empty-close:hover { color: var(--text-secondary); }
/* END TEMP */

/* ---- Settings Panel ---- */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  backdrop-filter: blur(3px);
}

.settings-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(320px, 100vw);
  background: var(--bg-1); border-left: 1px solid var(--border);
  z-index: 210; display: flex; flex-direction: column; overflow-y: auto;
}

.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.settings-title { font-family: var(--font-headline); font-size: 16px; font-weight: 700; }
.settings-body  { padding: 16px; display: flex; flex-direction: column; gap: 24px; }
.settings-section { display: flex; flex-direction: column; gap: 10px; }

.settings-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--text-secondary); text-transform: uppercase;
}
.settings-label strong {
  color: var(--text-primary); text-transform: none;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
}

/* Range Slider */
.range-slider {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: var(--bg-5);
  outline: none; cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.range-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg-1);
}

.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); }

.api-mode-info {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px;
}
.badge-demo {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  background: var(--yellow-soft); color: var(--yellow);
  border: 1px solid oklch(83% 0.17 85 / 0.25);
  padding: 1px 6px; border-radius: var(--radius-full);
  white-space: nowrap; margin-top: 1px;
}
.api-mode-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ---- Modal ---- */
.modal {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-3); border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 210; padding-bottom: env(safe-area-inset-bottom, 16px);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-headline); font-size: 16px; font-weight: 700; }
.modal-body  { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---- Buttons ---- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #0a0e13;
  border: none; border-radius: var(--radius-md);
  font-family: var(--font-headline); font-size: 15px; font-weight: 700;
  padding: 13px 22px; cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-xl   { padding: 16px 32px; font-size: 17px; border-radius: var(--radius-lg); width: 100%; }
.btn-primary.btn-full { width: 100%; }

.btn-ghost {
  background: var(--bg-3); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; padding: 11px 20px;
  cursor: pointer; font-family: var(--font);
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover { background: var(--bg-4); border-color: var(--border-md); }
.btn-ghost.btn-sm   { padding: 8px 14px; font-size: 13px; }
.btn-ghost.btn-full { width: 100%; }

.btn-link {
  background: none; border: none; color: var(--text-tertiary);
  font-size: 14px; cursor: pointer; font-family: var(--font);
  text-decoration: underline; text-underline-offset: 2px; padding: 4px;
}
.btn-link:hover { color: var(--text-secondary); }

/* ---- Auction Mode ---- */
/* ---- Product Images Carousel ---- */
.product-images { margin: 0 -20px; position: relative; }
.product-images-scroll {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.product-images-scroll::-webkit-scrollbar { display: none; }
.product-img-slide {
  flex: 0 0 100%; scroll-snap-align: start;
  aspect-ratio: 3/2; background: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-img-slide::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 20px;
  background: linear-gradient(var(--bg-0), transparent);
  z-index: 1; pointer-events: none;
}
.product-img-slide img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-img-slide img[loading="lazy"] { background: var(--bg-3); }
.product-images-counter {
  position: absolute; top: 8px; right: 28px;
  font-size: 10px; font-family: var(--font-mono); font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  padding: 2px 8px; border-radius: 12px;
  pointer-events: none;
}
.product-images-dots {
  display: flex; justify-content: center; gap: 5px;
  padding: 6px 0 4px;
}
.product-images-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.2); transition: background 0.2s ease;
}
.product-images-dot.active { background: #4ADE80; }
.product-images-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px;
  padding: 32px 20px; color: var(--text-tertiary);
  font-size: 13px;
}
.product-images-empty svg { opacity: 0.3; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 95vw; max-height: 90vh; object-fit: contain;
  border-radius: 4px;
}

/* ---- Bid Detail in Margin Card ---- */
.margin-bid-detail {
  padding: 2px 0 4px; font-size: 11px; color: var(--text-tertiary); line-height: 1.6;
}
.margin-bid-note {
  font-size: 10px; color: var(--text-tertiary); opacity: 0.7; font-style: italic;
}

/* ---- Confirm Path Cards ---- */
.confirm-path-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 10px; transition: border-color 0.2s ease;
}
.confirm-path-card.active { border-color: rgba(74,222,128,0.3); }
.confirm-path-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; width: 100%; background: none; border: none;
  cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent;
}
.confirm-path-icon { font-size: 20px; flex-shrink: 0; }
.confirm-path-text { flex: 1; }
.confirm-path-title {
  font-family: var(--font-headline); font-size: 15px; font-weight: 700;
  color: var(--text-primary); display: block;
}
.confirm-path-sub {
  font-size: 12px; color: var(--text-tertiary); display: block; margin-top: 1px;
}
.confirm-path-body { padding: 0 16px 16px; }

.auction-panel {
  background: var(--bg-2); border: 1px solid rgba(229,162,40,0.15);
  border-radius: var(--radius-lg); padding: 16px;
}
.auction-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.auction-panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent);
}
.auction-exit-link {
  background: none; border: none; font-family: var(--font);
  font-size: 11px; color: var(--text-tertiary); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.auction-exit-link:hover { color: var(--text-secondary); }

.auction-calc-toggle {
  display: flex; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 3px; margin-bottom: 12px; gap: 2px;
}
.auction-calc-seg {
  flex: 1; padding: 6px 8px; background: transparent;
  border: 1px solid transparent; border-radius: calc(var(--radius-md) - 2px);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auction-calc-seg:hover { color: var(--text-secondary); }
.auction-calc-seg.active {
  background: rgba(229,162,40,0.10); border-color: var(--accent);
  color: var(--accent);
}

.auction-margin-pills {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.auction-pill {
  padding: 6px 14px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 13px; font-family: var(--font-mono); font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auction-pill:hover { border-color: var(--border-md); }
.auction-pill.active {
  background: rgba(229,162,40,0.10); border-color: var(--accent); color: var(--accent);
}
.auction-pill-custom { font-family: var(--font); }

.auction-custom-wrap {
  display: flex; align-items: center; gap: 4px; margin-bottom: 12px;
}
.auction-custom-input {
  width: 72px; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text-primary); outline: none; text-align: right;
  -moz-appearance: textfield;
}
.auction-custom-input::-webkit-inner-spin-button,
.auction-custom-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.auction-custom-input:focus { border-color: var(--accent); }
.auction-custom-pct { font-size: 14px; color: var(--text-tertiary); }

.auction-result {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 0 4px;
}
.auction-result-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.auction-result-value {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  color: #4ADE80;
}
.auction-result-hint {
  font-size: 12px; color: var(--text-tertiary); padding-bottom: 4px;
}

/* ---- Platform Picker ---- */
.margin-fee-tap { cursor: pointer; }
.margin-fee-change {
  font-size: 10px; color: var(--accent); font-weight: 600;
  margin-left: 4px; opacity: 0.7;
}
.margin-fee-tap:hover .margin-fee-change { opacity: 1; }
.margin-fee-free { color: #4ADE80 !important; }

.platform-picker {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(0,0,0,0.3); border-radius: var(--radius-md);
  padding: 6px; margin: 4px 0;
}
.platform-picker-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
  transition: background 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.platform-picker-opt:hover { background: rgba(255,255,255,0.04); }
.platform-picker-opt.selected {
  background: rgba(229,162,40,0.08); color: var(--text-primary);
}
.platform-picker-opt .pp-name { font-weight: 600; }
.platform-picker-opt .pp-fee { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.platform-picker-opt.selected .pp-fee { color: var(--accent); }

.margin-local-warn {
  font-size: 11px; color: var(--yellow); opacity: 0.8;
  padding: 4px 0 2px;
}

/* ---- Info Tips ---- */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; font-size: 10px; line-height: 1;
  color: var(--text-tertiary); cursor: pointer; vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.info-tip:hover { color: var(--text-secondary); }
.info-tip-text {
  display: block; font-size: 11px; line-height: 1.5;
  color: var(--text-tertiary); font-weight: 400; letter-spacing: 0;
  text-transform: none;
  padding: 6px 8px; margin-top: 4px;
  background: rgba(0,0,0,0.3); border-radius: var(--radius-sm);
}

/* ---- Utilities ---- */
.hidden { display: none !important; }

/* Skeleton shimmer keyframe */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ---- Animations ---- */
@keyframes slideIn  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }

.settings-panel:not(.hidden) { animation: slideIn 0.25s ease; }
.modal:not(.hidden)           { animation: slideUp 0.25s ease; }

/* ---- Edit-purchase form ---- */
/* (The standalone declare-ownership button was removed; cost-entry on
   /confirm now implicitly records the inventory item. The form below is
   used only for editing an existing purchase from the ownership card.) */
.bought-this-section { margin: 2px 0; }

.bought-form {
  overflow: hidden;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 400px; opacity: 1; }
}

.bought-form-inner {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.bought-label {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  display: block;
}

.bought-cost-input { font-size: 18px; width: 100%; }

.source-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.source-pill {
  padding: 7px 18px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
}
.source-pill:hover { border-color: var(--border-md); }
.source-pill.active {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.4);
  color: #4ADE80;
}

.btn-save-inventory {
  background: #4ADE80 !important; color: #0a0e13 !important;
  margin-top: 12px;
}
.btn-save-inventory:hover { background: #3cc870 !important; }

.btn-cancel-bought {
  background: none; border: none; font-family: var(--font);
  font-size: 13px; color: var(--text-tertiary); cursor: pointer;
  text-align: center; padding: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn-cancel-bought:hover { color: var(--text-secondary); }

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

/* ---- Bulk Mode Screens ---- */
#screen-bulk-input, #screen-bulk-results { padding-left: 16px; padding-right: 16px; }

.bulk-input-wrap, .bulk-results-wrap {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding-top: 8px; padding-bottom: 28px;
  display: flex; flex-direction: column; gap: 18px;
}

.bulk-header { display: flex; flex-direction: column; gap: 4px; }
.bulk-title {
  font-family: var(--font-headline);
  font-size: 26px; font-weight: 800; letter-spacing: -0.4px;
  color: var(--text-primary); margin: 0;
}
.bulk-tagline { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.4; }

.bulk-section { display: flex; flex-direction: column; gap: 6px; }
.bulk-helper { font-size: 12px; color: var(--text-tertiary); margin: 0; }
.bulk-paste {
  width: 100%; resize: vertical; min-height: 168px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease;
}
.bulk-paste:focus { border-color: var(--green); }
.bulk-paste::placeholder { color: var(--text-tertiary); opacity: 0.55; }

.bulk-file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bulk-file-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid var(--border-hi);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bulk-file-btn:hover { background: var(--bg-3); color: var(--text-primary); border-color: var(--border-hi); }
.bulk-file-name { font-size: 12.5px; color: var(--text-tertiary); }

.bulk-sample-link {
  align-self: flex-start;
  background: none; border: none;
  color: var(--green); font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px 0;
}
.bulk-sample-link:hover { text-decoration: underline; }

.bulk-cta { margin-top: 4px; }
.bulk-cta[disabled] { opacity: 0.45; cursor: not-allowed; }

.bulk-results-header { display: flex; flex-direction: column; gap: 4px; }
.bulk-results-title {
  font-family: var(--font-headline);
  font-size: 22px; font-weight: 800; letter-spacing: -0.3px;
  color: var(--text-primary); margin: 0;
}
/* Outage note under the pallet title. Amber rather than red: the run is
   incomplete, not failed — the matched rows below it are still good. */
.bulk-results-note {
  margin: 0;
  font-size: 12.5px; line-height: 1.45;
  color: var(--yellow);
}

.bulk-pnl-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--card-shadow);
}
.bulk-pnl-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-tertiary); text-transform: uppercase;
  margin-bottom: 4px;
}
.bulk-pnl-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; color: var(--text-secondary);
}
.bulk-pnl-row span:last-child { font-family: var(--font-mono); color: var(--text-primary); }
.bulk-pnl-row .neg { color: var(--red); }
.bulk-pnl-row .pos { color: var(--green); }
.bulk-pnl-divider { height: 1px; background: var(--border-hi); margin: 2px 0; }
.bulk-pnl-net {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.bulk-pnl-net span:last-child { font-size: 17px; font-weight: 700; }
/* Sits directly under Net Pallet Value, because that is the number a reader
   would otherwise take as a complete valuation. */
.bulk-pnl-incomplete {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--yellow);
  text-align: right;
}

.bulk-bid-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-top-color: var(--border-md);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--card-shadow);
}
.bulk-bid-header { display: flex; flex-direction: column; gap: 2px; }
.bulk-bid-sub { font-size: 12px; color: var(--text-secondary); }
.bulk-margin-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-margin-pill {
  flex: 1; min-width: 64px;
  padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bulk-margin-pill:hover { color: var(--text-primary); }
.bulk-margin-pill.active {
  background: var(--green-soft); color: var(--green);
  border-color: oklch(82% 0.19 145 / 0.4);
}
.bulk-margin-custom {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
}
.bulk-margin-custom .dollar-sign { color: var(--text-tertiary); }
.bulk-margin-custom-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-mono); font-size: 14px;
  padding: 6px 0;
}
.bulk-bid-divider { height: 1px; background: var(--border-hi); margin: 4px 0 2px; }
.bulk-bid-result { display: flex; justify-content: space-between; align-items: baseline; }
.bulk-bid-label { font-size: 13px; color: var(--text-secondary); }
.bulk-bid-value {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.8px; line-height: 1;
}
.bulk-bid-projection {
  font-size: 12.5px; color: var(--text-secondary); margin: 0;
  line-height: 1.4;
}
.bulk-bid-projection .pos { color: var(--green); }

.bulk-items-section { display: flex; flex-direction: column; gap: 8px; }
.bulk-items-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
}
.bulk-items-count { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }
.bulk-items-list { display: flex; flex-direction: column; gap: 6px; }

.bulk-item-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.bulk-item-card:not(.bulk-item-card-missing) {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.bulk-item-card:not(.bulk-item-card-missing):hover {
  background: var(--bg-3); border-color: var(--border-hi);
}
.bulk-item-card:not(.bulk-item-card-missing):active { transform: scale(0.99); }
.bulk-item-card:not(.bulk-item-card-missing):focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}
.bulk-item-card.bulk-item-card-missing { opacity: 0.55; }
.bulk-item-thumb {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bulk-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bulk-item-thumb-placeholder {
  font-size: 14px; font-weight: 700; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
}
.bulk-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bulk-item-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bulk-item-breakdown { font-size: 11.5px; color: var(--text-tertiary); font-family: var(--font-mono); }
.bulk-item-net { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.bulk-item-net-value { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.bulk-item-rank { font-size: 10.5px; color: var(--text-tertiary); }
.bulk-item-missing-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: var(--radius-full);
}
/* "Couldn't price" reads amber, not grey: unlike NOT FOUND it is a statement
   about our data source, and the row is expected to price fine on a retry. */
.bulk-item-missing-badge.is-unpriced {
  color: var(--yellow);
  border-color: rgba(229,162,40,0.40);
}

.bulk-empty {
  padding: 20px 12px;
  background: var(--bg-2); border: 1px dashed var(--border-hi);
  border-radius: var(--radius-md);
  color: var(--text-tertiary); font-size: 13px;
  text-align: center;
}

.bulk-results-footer { display: flex; justify-content: center; padding-top: 4px; }

/* ---- Profile / Inventory Screen ---- */
#screen-profile { padding-left: 20px; padding-right: 20px; }

.profile-content-wrap {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding-top: 4px; padding-bottom: 24px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Profile Header */
.profile-header {
  display: flex; align-items: center; gap: 14px;
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid rgba(74,222,128,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-headline); font-size: 22px; font-weight: 800;
  color: #4ADE80; flex-shrink: 0;
}
.profile-header-info { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 8px; }
.profile-name {
  font-family: var(--font-headline); font-size: 20px; font-weight: 800;
  color: var(--text-primary);
}
.profile-edit-btn {
  background: none; border: none; color: var(--text-tertiary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-edit-btn:hover { color: var(--text-secondary); }
.profile-member-since {
  font-size: 12px; color: var(--text-tertiary); display: block; margin-top: 2px;
}

/* Stats Row */
.profile-stats-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px;
}
.profile-stats-row .dash-stat-card { padding: 8px 6px; }
.profile-stats-row .dash-stat-value { font-size: 16px; }
.profile-stats-row .dash-stat-card.tappable {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-stats-row .dash-stat-card.tappable:hover { background: var(--bg-3); }
.profile-stats-row .dash-stat-card.tappable:active { transform: scale(0.98); }
.profile-stats-row .dash-stat-card.tappable:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}

/* Tab Switcher */
.profile-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
}
.profile-tab {
  flex: 1; padding: 10px 0; background: none; border: none;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer; text-align: center;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-tab.active { color: var(--text-primary); border-bottom-color: #4ADE80; }
.profile-tab:hover:not(.active) { color: var(--text-secondary); }

/* Inventory List */
.inventory-list { display: flex; flex-direction: column; gap: 8px; }

.inventory-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.15s ease, opacity 0.3s ease, transform 0.3s ease;
  animation: cardFadeIn 0.3s ease both;
}
.inventory-card:active { background: var(--bg-3); }
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.inv-card-top {
  display: flex; align-items: flex-start; gap: 12px;
}

.inv-card-thumb {
  width: 56px; height: 56px; border-radius: 10px;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.inv-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inv-card-thumb-placeholder {
  font-family: var(--font-headline); font-size: 20px; font-weight: 700;
  color: var(--text-tertiary);
}

.inv-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inv-card-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-card-meta { font-size: 12px; color: var(--text-tertiary); }
.inv-card-est { font-size: 12px; color: var(--text-secondary); }
.inv-card-est .pos { color: var(--green); font-family: var(--font-mono); font-weight: 600; }
.inv-card-roi {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: rgba(74,222,128,0.5); margin-left: 6px;
}
.inv-card-sold-meta { font-size: 11px; color: var(--text-tertiary); }

/* Overflow menu button (three dots) */
.inv-overflow-btn {
  background: none; border: none; color: var(--text-tertiary);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  flex-shrink: 0; transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.inv-overflow-btn:hover { color: var(--text-secondary); }

/* Overflow dropdown */
.inv-overflow-menu {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 0 2px;
  animation: fadeIn 0.15s ease;
}
.inv-menu-sep { font-size: 12px; color: rgba(255,255,255,0.15); user-select: none; }
.inv-menu-item {
  background: none; border: none; font-family: var(--font);
  font-size: 12px; font-weight: 500; color: var(--text-tertiary);
  cursor: pointer; padding: 2px 4px;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.inv-menu-item:hover { color: var(--text-secondary); }
.inv-menu-remove { color: rgba(248,113,113,0.5); }
.inv-menu-remove:hover { color: var(--red); }

/* Edit form inside inventory card */
.inv-edit-form {
  padding: 10px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  animation: slideDown 0.25s ease;
}
.inv-edit-form .input-cost { font-size: 16px; width: 100%; }

/* Remove confirm inside inventory card */
.inv-remove-confirm { padding: 8px 0 0; animation: fadeIn 0.15s ease; }

/* Card bottom — Mark as Sold row */
.inv-card-bottom {
  display: flex; gap: 8px; margin-top: 10px;
}

.btn-mark-sold {
  flex: 1; padding: 8px 12px;
  background: rgba(74,222,128,0.06); border: 1px solid rgba(74,222,128,0.20);
  border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 12px; font-weight: 600; color: #4ADE80;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-mark-sold:hover { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.35); }

/* Mark as Sold inline form */
.sold-form {
  width: 100%; padding: 12px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  animation: slideDown 0.25s ease;
}
.sold-form .input-cost { font-size: 16px; width: 100%; }
.sold-platform-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.sold-platform-pills .source-pill { padding: 5px 12px; font-size: 11px; }

.sold-fee-preview {
  padding: 4px 0 0;
}
.sold-preview-card {
  background: rgba(0,0,0,0.2); border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.sold-preview-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-tertiary);
}
.sold-preview-row .neg { color: var(--red); font-family: var(--font-mono); font-size: 11px; }
.sold-preview-row .pos { color: var(--green); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.sold-preview-divider { height: 1px; background: var(--border); }
.sold-preview-profit span:first-child { color: var(--text-secondary); font-weight: 600; }

.btn-confirm-sale {
  background: #4ADE80 !important; color: #0a0e13 !important;
}
.btn-confirm-sale:hover { background: #3cc870 !important; }

.btn-cancel-sold {
  background: none; border: none; font-family: var(--font);
  font-size: 12px; color: var(--text-tertiary); cursor: pointer;
  text-align: center; padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.btn-cancel-sold:hover { color: var(--text-secondary); }

/* ---- Sold Card ---- */
.sold-card {
  border-left: 3px solid rgba(74,222,128,0.2);
  cursor: pointer;
}
.sold-card:hover { border-color: var(--border-hi); border-left-color: rgba(74,222,128,0.35); }

.sold-card-profit-row {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 1px;
}
.sold-card-profit {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
}
.sold-card-profit.pos { color: var(--green); }
.sold-card-profit.neg { color: var(--red); }
.sold-card-roi {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: rgba(74,222,128,0.45);
}

/* Sold breakdown expandable */
.sold-card-breakdown {
  padding: 10px 0 2px; margin-top: 8px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
  animation: fadeIn 0.15s ease;
}
.sold-bd-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary);
}
.sold-bd-row .neg { color: var(--red); font-family: var(--font-mono); font-size: 12px; }
.sold-bd-row .pos { color: var(--green); font-family: var(--font-mono); font-size: 12px; }
.sold-bd-divider { height: 1px; background: var(--border); margin: 2px 0; }
.sold-bd-total { font-weight: 600; color: var(--text-primary); }

/* Sold summary bar */
.sold-summary-bar {
  margin-top: 12px; padding: 12px 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px; font-weight: 500; color: var(--text-tertiary);
  text-align: center; letter-spacing: 0.01em;
}

/* Tab content transition */
#profile-content {
  animation: tabFade 0.2s ease;
}
@keyframes tabFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Empty states */
.profile-empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 48px 20px; text-align: center;
}
.profile-empty-icon { color: var(--text-tertiary); opacity: 0.4; }
.profile-empty-title {
  font-family: var(--font-headline); font-size: 16px; font-weight: 700;
  color: var(--text-secondary);
}
.profile-empty-sub {
  font-size: 13px; color: var(--text-tertiary); max-width: 260px;
  line-height: 1.5;
}
.profile-empty-cta {
  margin-top: 6px; padding: 10px 24px; font-size: 14px;
}

/* Sale celebration animation */
.sale-celebration {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono); font-size: 36px; font-weight: 700;
  color: #4ADE80; z-index: 500;
  pointer-events: none;
  opacity: 0; transition: none;
  text-shadow: 0 0 20px rgba(74,222,128,0.5), 0 0 40px rgba(74,222,128,0.3);
}
.sale-celebration.animate {
  animation: saleFloat 1.5s ease-out forwards;
}
@keyframes saleFloat {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
  30%  { opacity: 1; transform: translate(-50%, -65%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}
.sale-celebration::before {
  content: '';
  position: fixed; inset: 0;
  background: rgba(74,222,128,0.08);
  pointer-events: none;
  animation: greenFlash 0.6s ease-out;
}
@keyframes greenFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Inventory badges on recent searches */
.home-recent-meta-row {
  display: flex; align-items: center; gap: 6px; margin-top: 1px;
}
.inv-badge {
  display: inline-flex; align-items: center;
  font-size: 8px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 2px 6px;
  border-radius: var(--radius-full); line-height: 1;
  white-space: nowrap; flex-shrink: 0;
}
.active-badge {
  background: rgba(74,222,128,0.12); color: #4ADE80;
}
.sold-badge {
  background: rgba(255,255,255,0.08); color: var(--text-secondary);
}

/* ---- Responsive ---- */
@media (min-width: 480px) {
  .screen { max-width: 480px; margin: 0 auto; }
  #app-header { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .results-skeleton { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
