/* ────────────────────────────────────────────────────────────
   AskMeBro.in — Main Stylesheet
   Inspired by Claude.ai's clean, readable aesthetic
──────────────────────────────────────────────────────────── */

:root {
  /* ── Dark theme (default) ─────────────────────────── */
  --bg: #1a1a1a;
  --bg-2: #212121;
  --bg-3: #2a2a2a;
  --bg-hover: #303030;
  --border: #383838;
  --border-light: #2e2e2e;

  --text-primary: #ececec;
  --text-secondary: #9a9a9a;
  --text-muted: #666;

  --accent: #cc785c;
  --accent-hover: #d4896c;
  --accent-light: rgba(204,120,92,0.12);
  --accent-border: rgba(204,120,92,0.3);

  --green: #4ade80;
  --green-bg: rgba(74,222,128,0.1);
  --yellow: #fbbf24;
  --yellow-bg: rgba(251,191,36,0.1);
  --red: #f87171;
  --red-bg: rgba(248,113,113,0.1);

  --sidebar-w: 260px;
  --sidebar-collapsed: 0px;

  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);

  /* Typography */
  --font: 'Sora', system-ui, sans-serif;
  --mono: 'DM Mono', 'Courier New', monospace;

  /* Radii */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f5f4f2;
  --bg-2: #ffffff;
  --bg-3: #f0ede9;
  --bg-hover: #e8e4df;
  --border: #ddd8d2;
  --border-light: #e8e3de;

  --text-primary: #1a1714;
  --text-secondary: #5a5550;
  --text-muted: #9a9490;

  --accent: #cc785c;
  --accent-hover: #b8674d;
  --accent-light: rgba(204,120,92,0.1);
  --accent-border: rgba(204,120,92,0.25);

  --green: #16a34a;
  --green-bg: rgba(22,163,74,0.08);
  --yellow: #d97706;
  --yellow-bg: rgba(217,119,6,0.08);
  --red: #dc2626;
  --red-bg: rgba(220,38,38,0.08);

  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Smooth theme transition on everything */
body, .sidebar, .auth-card, .card, .search-input-wrap,
.auth-input, .history-item, .modal-box, .user-menu,
.verdict-banner, .stat-box, .seller-kv, .alt-item,
.discount-item, .feedback-card, .thumb-btn, .category-chip {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Theme Toggle Button ──────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: .875rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  padding: .4rem .875rem .4rem .6rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s, color .15s, box-shadow .2s;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform .4s ease;
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* Hide toggle inside app when sidebar is showing it */
.app .theme-toggle { top: .75rem; }

.hidden { display: none !important; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }

/* ── Auth Screen ───────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem 2rem 2rem;
  animation: slideUp .3s ease;
}

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

.auth-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-logo img,
.auth-logo-img {
  display: block;
  margin: 0 auto 0.625rem;
  width: 240px;
  height: auto;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-tagline {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-top: .2rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  padding: .625rem 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  width: 100%;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 500;
  padding: .7rem 1rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.google-btn:active { background: #f1f3f4; }

.google-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: .8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .9rem;
  padding: .75rem 1rem;
  margin-bottom: .625rem;
  outline: none;
  transition: border-color .15s;
}

.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus { border-color: var(--accent); }

.auth-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  padding: .8rem;
  margin-top: .25rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.auth-submit:hover { background: var(--accent-hover); }
.auth-submit:active { transform: scale(.98); }

.auth-error {
  color: var(--red);
  font-size: .8rem;
  margin-top: .5rem;
  text-align: center;
}

/* ── App Shell ─────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s ease;
  position: relative;
}

/* Desktop collapsed — shrinks to 0 but open button stays */
.sidebar.collapsed { width: 0; }

/* ── Floating open button — shown only when sidebar is collapsed on desktop ── */
.sidebar-open-btn {
  display: none;
  position: fixed;
  top: .875rem;
  left: .875rem;
  z-index: 300;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-secondary);
  cursor: pointer;
  padding: .45rem .6rem;
  box-shadow: var(--shadow);
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-open-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent-border);
}

.sidebar-open-btn svg { width: 18px; height: 18px; display: block; }

/* Show open button only when sidebar is collapsed on desktop */
@media (min-width: 769px) {
  .sidebar.collapsed ~ * .sidebar-open-btn,
  .sidebar.collapsed + .main .sidebar-open-btn {
    display: block;
  }
}

/* We'll control this via JS class on body instead */
body.sidebar-collapsed .sidebar-open-btn { display: block; }
body.sidebar-collapsed .theme-toggle { left: 3.5rem; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
  white-space: nowrap;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: .35rem;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}

.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 18px; height: 18px; display: block; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem .75rem 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  padding: .625rem .875rem;
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
  margin-bottom: 1rem;
  white-space: nowrap;
}

.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-btn:hover { background: var(--bg-hover); border-color: var(--accent-border); }

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 .25rem .5rem;
}

.history-list { display: flex; flex-direction: column; gap: 2px; }

.history-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s;
  overflow: hidden;
}

.history-item:hover { background: var(--bg-hover); }
.history-item.active { background: var(--accent-light); }

.history-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.history-name {
  flex: 1;
  font-size: .8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover .history-name { color: var(--text-primary); }

.history-skeleton { padding: .25rem 0; }
.sk-line {
  height: 10px;
  background: var(--bg-3);
  border-radius: 4px;
  margin-bottom: 10px;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: .4; }
  50% { opacity: .8; }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid var(--border-light);
  position: relative;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border-radius: var(--r);
  cursor: default;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-details { flex: 1; overflow: hidden; }
.user-name { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .725rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: background .15s;
}

.user-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-menu-btn svg { width: 16px; height: 16px; display: block; }

.user-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: .75rem;
  right: .75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.user-menu button {
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .875rem;
  padding: .75rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}

.user-menu button:hover { background: var(--bg-hover); }
.user-menu button svg { width: 16px; height: 16px; }

/* ── Main ──────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
}

.view.active { display: block; }

/* ── Home View ─────────────────────────────────────────── */
.home-center {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.home-hero {
  text-align: center;
  max-width: 580px;
  margin-bottom: 2.5rem;
}

.hero-logo {
  display: block;
  margin: 0 auto 1.25rem;
  width: 320px;
  height: auto;
  animation: float 4s ease-in-out infinite;
}

/* Sidebar logo */
.sidebar-logo {
  width: 140px;
  height: auto;
  display: block;
}

/* Loading logo */
.loading-logo {
  width: 120px;
  height: auto;
  display: block;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.home-hero h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-primary);
  margin-bottom: .75rem;
}

.hero-sub {
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.search-box {
  width: 100%;
  max-width: 660px;
  margin-bottom: 1rem;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: .375rem .375rem .375rem 1rem;
  gap: .75rem;
  transition: border-color .2s, box-shadow .2s;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: .875rem;
  min-width: 0;
}

.search-input::placeholder { color: var(--text-muted); font-family: var(--font); }

.search-submit {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  padding: .6rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}

.search-submit:hover { background: var(--accent-hover); }
.search-submit:active { transform: scale(.97); }
.search-submit:disabled { opacity: .5; cursor: not-allowed; }
.btn-arrow { width: 16px; height: 16px; }

.search-hint {
  font-size: .775rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: .75rem;
}

.example-chips {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.chip-label { font-size: .8rem; color: var(--text-muted); }

.chip {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: .775rem;
  padding: .3rem .75rem;
  border-radius: 99px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.chip:hover { background: var(--bg-hover); border-color: var(--accent-border); color: var(--accent); }

/* ── Loading View ──────────────────────────────────────── */
.loading-center {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.loading-animation {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulseRing 1.5s ease-in-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(.8); opacity: .8; }
  50% { transform: scale(1.2); opacity: .3; }
  100% { transform: scale(.8); opacity: .8; }
}

.loading-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.loading-steps { display: flex; flex-direction: column; gap: .5rem; text-align: left; }

.loading-step {
  font-size: .875rem;
  color: var(--text-muted);
  padding: .375rem .75rem;
  border-radius: var(--r);
  transition: color .3s, background .3s;
}

.loading-step.active {
  color: var(--text-primary);
  background: var(--accent-light);
}

/* ── Result View ───────────────────────────────────────── */
.result-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Product Header */
.product-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.product-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--bg-3);
  flex-shrink: 0;
}

.product-img-placeholder {
  width: 80px;
  height: 80px;
  background: var(--bg-3);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 2rem;
}

.product-meta { flex: 1; min-width: 0; }

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: .2rem .6rem;
  border-radius: 99px;
  margin-bottom: .5rem;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: .35rem;
}

.product-brand { font-size: .85rem; color: var(--text-secondary); margin-bottom: .625rem; }

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

/* Verdict Banner */
.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: var(--r-lg);
  margin-bottom: 1.25rem;
  border: 1px solid;
}

.verdict-buy { background: var(--green-bg); border-color: rgba(74,222,128,.3); }
.verdict-caution { background: var(--yellow-bg); border-color: rgba(251,191,36,.3); }
.verdict-skip { background: var(--red-bg); border-color: rgba(248,113,113,.3); }

.verdict-left { display: flex; align-items: center; gap: .875rem; }

.verdict-icon { font-size: 1.75rem; }

.verdict-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.verdict-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.015em;
}

.verdict-buy .verdict-text { color: var(--green); }
.verdict-caution .verdict-text { color: var(--yellow); }
.verdict-skip .verdict-text { color: var(--red); }

.verdict-confidence {
  text-align: right;
}

.confidence-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-primary);
}

.confidence-label { font-size: .7rem; color: var(--text-muted); }

/* Cards */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-title-icon { font-size: 1rem; }

.summary-text {
  font-size: .9375rem;
  line-height: 1.75;
  color: var(--text-primary);
  white-space: pre-line;
}

/* Rating */
.rating-top {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: 1rem;
}

.rating-number {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-primary);
  letter-spacing: -.03em;
}

.rating-stars { font-size: 1.1rem; }

.rating-count { font-size: .85rem; color: var(--text-muted); }

.bar-row {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: .4rem;
}

.bar-label { font-size: .75rem; color: var(--text-secondary); width: 36px; flex-shrink: 0; }

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

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width .6s cubic-bezier(.23,1,.32,1);
}

.bar-fill.high { background: var(--green); }
.bar-fill.mid { background: var(--yellow); }
.bar-fill.low { background: var(--red); }

.bar-pct { font-size: .75rem; color: var(--text-muted); width: 32px; text-align: right; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
}

.stat-box {
  background: var(--bg-3);
  border-radius: var(--r);
  padding: .875rem;
  text-align: center;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.stat-val.good { color: var(--green); }
.stat-val.warn { color: var(--yellow); }
.stat-val.bad { color: var(--red); }

.stat-label { font-size: .75rem; color: var(--text-muted); line-height: 1.3; }

/* Insights Lists */
.insight-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .insight-cols { grid-template-columns: 1fr; }
}

.insight-col h4 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .625rem;
}

.insight-col.praise h4 { color: var(--green); }
.insight-col.complaints h4 { color: var(--red); }
.insight-col.returns h4 { color: var(--yellow); }

.insight-list { list-style: none; }

.insight-list li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border-light);
}

.insight-list li:last-child { border-bottom: none; }

.insight-list li::before {
  content: '•';
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: .05em;
}

/* Authenticity */
.auth-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid;
}

.auth-score-circle.high { border-color: var(--green); color: var(--green); }
.auth-score-circle.medium { border-color: var(--yellow); color: var(--yellow); }
.auth-score-circle.low { border-color: var(--red); color: var(--red); }

.auth-score-num {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1;
}

.auth-score-pct { font-size: .6rem; }

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 99px;
}

.risk-low { background: var(--green-bg); color: var(--green); }
.risk-medium { background: var(--yellow-bg); color: var(--yellow); }
.risk-high { background: var(--red-bg); color: var(--red); }

.signal-list { list-style: none; display: flex; flex-direction: column; gap: .375rem; }

.signal-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.signal-icon { flex-shrink: 0; margin-top: .1em; }

/* Warnings */
.warning-list { list-style: none; }

.warning-item {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  font-size: .875rem;
  color: var(--text-secondary);
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
}

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

.warning-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Alternatives */
.alt-list { display: flex; flex-direction: column; gap: .625rem; }

.alt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-3);
  border-radius: var(--r);
  padding: .75rem 1rem;
}

.alt-info { flex: 1; min-width: 0; }
.alt-name { font-size: .875rem; font-weight: 600; color: var(--text-primary); margin-bottom: .2rem; }
.alt-reason { font-size: .8rem; color: var(--text-muted); }

.alt-right { text-align: right; flex-shrink: 0; }
.alt-rating { font-size: .875rem; color: var(--yellow); font-weight: 700; }

.alt-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .775rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: .375rem;
  transition: color .15s;
}

.alt-link:hover { color: var(--accent-hover); }
.alt-link svg { width: 12px; height: 12px; }

/* Discount Links */
.discount-list { display: flex; flex-direction: column; gap: .5rem; }

.discount-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--bg-3);
  border-radius: var(--r);
  padding: .75rem 1rem;
}

.discount-platform {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.discount-note { font-size: .8rem; color: var(--text-muted); }

.discount-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  padding: .35rem .75rem;
  white-space: nowrap;
  transition: background .15s;
}

.discount-btn:hover { background: rgba(204,120,92,.2); }

/* Seller Info */
.seller-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.seller-kv {
  background: var(--bg-3);
  border-radius: var(--r);
  padding: .625rem .875rem;
}

.seller-k { font-size: .7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.seller-v { font-size: .875rem; color: var(--text-primary); font-weight: 500; }
.seller-v.yes { color: var(--green); }
.seller-v.no { color: var(--red); }
.seller-v.unknown { color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: .875rem;
  padding: .625rem 1.25rem;
  border-radius: 99px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toastIn .2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive — Full Mobile First Overhaul ─────────────── */

/* ── Mobile bottom nav bar (shown on mobile only) ────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 .5rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .6rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: color .15s, background .15s;
  min-width: 56px;
}

.mobile-nav-btn svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-btn.active { color: var(--accent); }
.mobile-nav-btn:hover { color: var(--text-primary); }

/* ── Sidebar overlay backdrop ─────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible { display: block; }

/* ─── Small phones (up to 480px) ────────────────────────── */
@media (max-width: 480px) {
  html { font-size: 14px; }

  /* Auth */
  .auth-screen { padding: 1rem; align-items: flex-start; padding-top: 2rem; }
  .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--r-lg); }
  .auth-logo img,
  .auth-logo-img { width: 110px; height: auto; }
  .auth-logo h1 { font-size: 1.3rem; }
  .google-btn-container { transform: scale(0.92); transform-origin: center; }

  /* Sidebar — slides in from left as overlay */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    width: 80vw !important;
    max-width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }

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

  /* Main takes full width */
  .main { width: 100%; margin-left: 0 !important; }

  /* Show mobile bottom nav */
  .mobile-nav { display: flex; }

  /* Add padding so content doesn't hide behind bottom nav */
  .home-center { padding-bottom: 80px; padding-top: 1.5rem; }
  .result-container { padding-bottom: 80px; }
  .loading-center { padding-bottom: 80px; }

  /* Hero */
  .home-hero h2 { font-size: 1.2rem; }
  .hero-sub { font-size: .85rem; }
  .hero-logo { width: 160px; height: auto; }
  .loading-logo { width: 90px; height: auto; }

  /* Search box */
  .search-input-wrap {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--r-lg);
    padding: .75rem;
    gap: .625rem;
  }
  .search-icon { display: none; }
  .search-input { font-size: .9rem; }
  .search-submit {
    width: 100%;
    justify-content: center;
    border-radius: var(--r);
    padding: .75rem;
    font-size: .9rem;
  }

  /* Example chips */
  .example-chips { gap: .375rem; }
  .chip { font-size: .725rem; padding: .25rem .6rem; }

  /* Results */
  .product-header { flex-direction: column; gap: .875rem; }
  .product-img, .product-img-placeholder { width: 60px; height: 60px; }
  .product-name { font-size: .975rem; }
  .verdict-banner { flex-direction: column; gap: .75rem; }
  .verdict-confidence { text-align: left; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .insight-cols { grid-template-columns: 1fr; }
  .seller-grid { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .card-title { font-size: .72rem; }
  .rating-number { font-size: 2rem; }

  /* Feedback */
  .feedback-thumbs { gap: .5rem; }
  .thumb-btn { padding: .5rem .75rem; font-size: .8rem; }
  .feedback-categories { gap: .375rem; }
  .category-chip { font-size: .75rem; padding: .3rem .6rem; }
  .modal-box { padding: 1.5rem 1.25rem; }
  .modal-actions { flex-direction: column; }
  .modal-btn-secondary { text-align: center; }
}

/* ─── Tablets (481px – 768px) ────────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  /* Sidebar slides in as overlay */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }

  .sidebar.mobile-open { transform: translateX(0); }
  .main { width: 100%; }

  /* Show mobile bottom nav on tablets too */
  .mobile-nav { display: flex; }

  .home-center { padding-bottom: 80px; }
  .result-container { padding-bottom: 80px; }
  .loading-center { padding-bottom: 80px; }

  .home-hero h2 { font-size: 1.4rem; }
  .search-box { max-width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .product-header { flex-direction: column; }
  .seller-grid { grid-template-columns: 1fr 1fr; }
  .insight-cols { grid-template-columns: 1fr; }
}

/* ─── Desktop (769px+) ───────────────────────────────────── */
@media (min-width: 769px) {
  /* Sidebar always visible, collapses by width */
  .sidebar {
    position: relative;
    transform: none !important;
    transition: width .25s ease;
  }

  .sidebar.collapsed { width: 0 !important; }
  .mobile-nav { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* ─── Large screens (1200px+) ────────────────────────────── */
@media (min-width: 1200px) {
  .result-container { max-width: 860px; }
  .home-hero h2 { font-size: 2rem; }
}

/* ── Touch device improvements ───────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .auth-tab { padding: .75rem 0; }
  .history-item { padding: .75rem; }
  .nav-btn { padding: .75rem .875rem; }
  .thumb-btn { padding: .75rem 1.25rem; }
  .chip { padding: .4rem .875rem; }

  /* Remove hover effects that don't work on touch */
  .auth-submit:hover { background: var(--accent); }
  .search-submit:hover { background: var(--accent); }
}

/* ── Safe area support (iPhone notch/home bar) ───────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom));
    height: calc(56px + env(safe-area-inset-bottom));
  }

  .home-center { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .result-container { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ── Feedback Card ───────────────────────────────────────── */
.feedback-card {
  border-color: var(--accent-border);
  background: linear-gradient(135deg, var(--bg-2) 0%, rgba(204,120,92,.04) 100%);
}

.feedback-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 99px;
  background: var(--bg-3);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.feedback-badge--done {
  background: var(--green-bg);
  color: var(--green);
}

.feedback-prompt {
  font-size: .9375rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.feedback-thumbs {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
}

.thumb-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  padding: .625rem 1.25rem;
  cursor: pointer;
  transition: all .15s;
  flex: 1;
  justify-content: center;
}

.thumb-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.thumb-up:hover  { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.thumb-down:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

.thumb-up.active  { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.thumb-down.active { border-color: var(--red);  color: var(--red);  background: var(--red-bg); }

.feedback-detail {
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  margin-top: .25rem;
  animation: slideUp .2s ease;
}

.feedback-section { margin-bottom: 1rem; }

.feedback-section-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .625rem;
}

.feedback-categories {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.category-chip {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: .8rem;
  padding: .35rem .75rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all .12s;
}

.category-chip:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.category-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.feedback-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .875rem;
  padding: .75rem;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color .15s;
  line-height: 1.6;
}

.feedback-textarea::placeholder { color: var(--text-muted); }
.feedback-textarea:focus { border-color: var(--accent); }

.feedback-char-count {
  text-align: right;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feedback-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  padding: .625rem 1.5rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.feedback-submit:hover { background: var(--accent-hover); }
.feedback-submit:active { transform: scale(.98); }
.feedback-submit:disabled { opacity: .5; cursor: not-allowed; }

.feedback-submitted-note {
  font-size: .8rem;
  color: var(--text-muted);
}

/* Thank you state */
.feedback-thankyou {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  background: var(--bg-3);
  border-radius: var(--r);
  margin-top: .5rem;
  animation: slideUp .2s ease;
}

.thankyou-icon { font-size: 1.5rem; flex-shrink: 0; }

.thankyou-text {
  flex: 1;
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feedback-edit-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .775rem;
  padding: .3rem .75rem;
  border-radius: 99px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
}

.feedback-edit-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ── Short URL Warning Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity .2s ease;
}

.modal-overlay.visible { opacity: 1; }

.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  transform: translateY(12px);
  transition: transform .2s ease;
}

.modal-overlay.visible .modal-box { transform: translateY(0); }

.modal-icon { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}

.modal-body { font-size: .875rem; color: var(--text-secondary); line-height: 1.65; }

.modal-body code {
  font-family: var(--mono);
  font-size: .8rem;
  background: var(--bg-3);
  padding: .1rem .4rem;
  border-radius: 4px;
  color: var(--accent);
}

.modal-steps {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 1rem 0 1.25rem;
  background: var(--bg-3);
  border-radius: var(--r);
  padding: .875rem;
}

.modal-step {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  font-size: .8375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-num {
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .1em;
}

.modal-actions { display: flex; gap: .75rem; }

.modal-btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  padding: .7rem;
  cursor: pointer;
  transition: background .15s;
}

.modal-btn-primary:hover { background: var(--accent-hover); }

.modal-btn-secondary {
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .8rem;
  padding: .7rem 1rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

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

/* ── AI Provider Badge ───────────────────────────────────── */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  margin-left: .5rem;
  vertical-align: middle;
  cursor: default;
}

/* ── Google Official Button Container ────────────────────── */
.google-btn-container {
  display: flex;
  justify-content: center;
  margin-bottom: .75rem;
  min-height: 44px;
}

/* ── History Refresh Button ──────────────────────────────── */
.history-refresh-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color .15s, background .15s, transform .2s;
  /*margin-left: auto;*/
}

.history-refresh-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}

.history-refresh-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* Show on hover of parent */
.history-item:hover .history-refresh-btn { display: flex; }

/* Always show on touch devices */
@media (hover: none) {
  .history-refresh-btn { display: flex; }
}

/* Spinning animation when refreshing */
.history-refresh-btn.spinning svg {
  animation: spin .7s linear infinite;
}

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

/* ── Light Theme Component Overrides ─────────────────────── */
[data-theme="light"] .auth-screen {
  background: linear-gradient(135deg, #f5f0eb 0%, #ede8e3 100%);
}

[data-theme="light"] .search-input-wrap {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

[data-theme="light"] .search-input-wrap:focus-within {
  box-shadow: 0 0 0 3px var(--accent-light), 0 2px 12px rgba(0,0,0,.06);
}

[data-theme="light"] .card {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

[data-theme="light"] .sidebar {
  box-shadow: 1px 0 0 var(--border);
}

[data-theme="light"] .product-header {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

[data-theme="light"] .verdict-buy {
  background: rgba(22,163,74,.07);
  border-color: rgba(22,163,74,.25);
}

[data-theme="light"] .verdict-caution {
  background: rgba(217,119,6,.07);
  border-color: rgba(217,119,6,.25);
}

[data-theme="light"] .verdict-skip {
  background: rgba(220,38,38,.07);
  border-color: rgba(220,38,38,.25);
}

[data-theme="light"] .loading-animation {
  filter: drop-shadow(0 4px 12px rgba(204,120,92,.2));
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #ccc8c4;
}

[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,.3);
}

[data-theme="light"] .google-btn {
  border-color: #dadce0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

[data-theme="light"] .toast {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

[data-theme="light"] .mobile-nav {
  background: #ffffff;
  box-shadow: 0 -1px 0 var(--border);
}

[data-theme="light"] .feedback-card {
  background: linear-gradient(135deg, #ffffff 0%, rgba(204,120,92,.03) 100%);
}

[data-theme="light"] .bar-track { background: #e8e4df; }

[data-theme="light"] .auth-card {
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
}

[data-theme="light"] .history-item:hover { background: var(--bg-3); }
[data-theme="light"] .history-item.active { background: var(--accent-light); }

/* ── Product Image Wrap ───────────────────────────────────── */
.product-img-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.product-img-wrap .product-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--bg-3);
  position: absolute;
  top: 0;
  left: 0;
}

.product-img-wrap .product-img-placeholder {
  width: 80px;
  height: 80px;
  background: var(--bg-3);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Price with live indicator ───────────────────────────── */
.price-source {
  display: inline-flex;
  align-items: center;
  font-size: .6rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 99px;
  margin-left: .4rem;
  vertical-align: middle;
  letter-spacing: .04em;
}

.price-ai {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid rgba(251,191,36,.3);
}

.price-live {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(74,222,128,.3);
  animation: fadeIn .3s ease;
}

.price-loading {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 400;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── History Action Buttons ──────────────────────────────── */
.history-actions {
  display: none;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
  margin-left: auto;
}

.history-item:hover .history-actions { display: flex; }

@media (hover: none) {
  .history-actions { display: flex; }
}

.history-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}

.history-delete-btn svg { width: 13px; height: 13px; display: block; }

.history-delete-btn:hover {
  color: var(--red);
  background: var(--red-bg);
}

.history-actions .history-refresh-btn {
  margin-left: 0;
  display: flex;
}

/* ═══════════════════════════════════════════════════════════
   RIGHT SIDEBAR — Product Chat Panel (Phase 2)
═══════════════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────────────────── */
.right-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s ease;
}

.right-sidebar.collapsed { width: 0; }

/* ── Header ──────────────────────────────────────────────── */
.right-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .875rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.right-sidebar-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.015em;
  white-space: nowrap;
}

.right-sidebar-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.right-sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: .35rem;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}

.right-sidebar-close:hover { background: var(--bg-hover); color: var(--accent); }
.right-sidebar-close svg { width: 18px; height: 18px; display: block; }

/* ── Product Context ─────────────────────────────────────── */
.right-sidebar-product {
  padding: .625rem 1rem;
  background: var(--accent-light);
  border-bottom: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.chat-product-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .15rem;
}

.chat-product-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ── Participants bar ────────────────────────────────────── */
.chat-online-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  font-size: .74rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ── Messages Area ───────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: .875rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── Loading dots ────────────────────────────────────────── */
.chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.chat-loading.hidden { display: none; }

.chat-loading-dots {
  display: flex;
  gap: .3rem;
}

.chat-loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.chat-loading-dots span:nth-child(2) { animation-delay: .2s; }
.chat-loading-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Empty state ─────────────────────────────────────────── */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  flex: 1;
  gap: .5rem;
}

.chat-empty.hidden { display: none; }

.chat-empty-icon { font-size: 2rem; }
.chat-empty-title { font-size: .875rem; font-weight: 600; color: var(--text-primary); }
.chat-empty-sub { font-size: .775rem; color: var(--text-muted); line-height: 1.6; }

/* ── Date Divider ────────────────────────────────────────── */
.chat-date-divider {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin: .375rem 0;
  flex-shrink: 0;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.chat-date-divider span {
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

/* ── Message Bubbles ─────────────────────────────────────── */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  max-width: 88%;
  flex-shrink: 0;
}

.chat-msg.own { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }

.chat-msg-author {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 .5rem;
}

.chat-msg-bubble {
  padding: .5rem .75rem;
  border-radius: 14px;
  font-size: .8125rem;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg.other .chat-msg-bubble {
  background: var(--bg-3);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg.own .chat-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: 0 .5rem;
}

.chat-msg.own .chat-msg-meta { justify-content: flex-end; }

.chat-msg-time {
  font-size: .65rem;
  color: var(--text-muted);
}

.chat-msg-delete {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .15rem;
  border-radius: 3px;
  transition: color .12s;
}

.chat-msg-delete svg { width: 11px; height: 11px; display: block; }
.chat-msg-delete:hover { color: var(--red); }

/* Show delete on hover of own message */
.chat-msg.own:hover .chat-msg-delete { display: flex; }
@media (hover: none) {
  .chat-msg.own .chat-msg-delete { display: flex; }
}

/* ── Input Area ──────────────────────────────────────────── */
.chat-input-wrap {
  flex-shrink: 0;
  padding: .625rem .75rem .75rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-2);
}

/* On mobile, add padding so input sits above the bottom nav bar */
@media (max-width: 768px) {
  .chat-input-wrap {
    padding-bottom: calc(.75rem + 56px + env(safe-area-inset-bottom, 0px));
  }
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: .375rem .375rem .375rem .75rem;
  transition: border-color .15s;
}

.chat-input-row:focus-within {
  border-color: var(--accent);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .8375rem;
  line-height: 1.5;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
  padding: .125rem 0;
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}

.chat-send-btn:hover:not(:disabled) { background: var(--accent-hover); }
.chat-send-btn:active:not(:disabled) { transform: scale(.92); }
.chat-send-btn:disabled { opacity: .4; cursor: not-allowed; }
.chat-send-btn svg { width: 14px; height: 14px; }

.chat-input-footer {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: .375rem;
  padding: 0 .25rem;
}

/* ── Floating open button ────────────────────────────────── */
.right-sidebar-open-btn {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  padding: .75rem .875rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(204,120,92,.4);
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 600;
  transition: background .15s, transform .15s, box-shadow .15s;
}

.right-sidebar-open-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204,120,92,.5);
}

.right-sidebar-open-btn svg { width: 20px; height: 20px; }

/* ── Desktop layout ──────────────────────────────────────── */
@media (min-width: 769px) {
  .right-sidebar {
    position: relative;
    transform: none !important;
    height: 100vh;
  }

  .right-sidebar-open-btn { bottom: 2rem; right: 1rem; }
}

/* ── Mobile — overlay from right ─────────────────────────── */
@media (max-width: 768px) {
  .right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 101;
    width: 85vw !important;
    max-width: 320px;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,.4);
  }

  .right-sidebar.mobile-open { transform: translateX(0); }
  .right-sidebar-open-btn { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════
   PRICE COMPARISON PANEL
═══════════════════════════════════════════════════════════ */

.price-comparison-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.price-comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
  gap: .5rem;
  flex-wrap: wrap;
}

.price-comparison-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.price-comparison-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.price-comparison-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
}

/* Loading dots */
.price-dots {
  display: flex;
  gap: .2rem;
  align-items: center;
}

.price-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.price-dots span:nth-child(2) { animation-delay: .2s; }
.price-dots span:nth-child(3) { animation-delay: .4s; }

/* Store list */
.price-stores-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Store item */
.price-store-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-3);
  border: 1.5px solid transparent;
  border-radius: var(--r);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .1s;
  cursor: pointer;
}

.price-store-item:hover {
  border-color: var(--accent-border);
  background: var(--bg-hover);
  transform: translateX(2px);
}

.price-store-item.best-price {
  border-color: var(--green);
  background: var(--green-bg);
}

.price-store-item.best-price:hover {
  border-color: var(--green);
  background: rgba(74,222,128,.15);
}

.price-store-item.out-of-stock {
  opacity: .6;
}

/* Store left */
.price-store-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.price-store-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.price-store-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
}

.price-store-oos {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--red-bg);
  color: var(--red);
  white-space: nowrap;
}

/* Store right */
.price-store-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.price-store-price {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.price-store-price.best {
  color: var(--green);
}

.price-best-tag {
  font-size: .62rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: .1rem;
}

.price-no-results {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  padding: .75rem;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .price-store-item { padding: .625rem .75rem; }
  .price-store-name { font-size: .8rem; }
  .price-store-price { font-size: 1rem; }
}


/* ── Region Selector in User Menu ───────────────────────── */
.region-menu-item {
  padding: .625rem 1rem .75rem;
  border-top: 1px solid var(--border-light);
}

.region-menu-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .5rem;
}

.region-select {
  width: 100%;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .8125rem;
  padding: .45rem .625rem;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  appearance: auto;
}

.region-select:focus {
  border-color: var(--accent);
}

.region-select option {
  background: var(--bg-2);
  color: var(--text-primary);
}

/* ── Guest Login ──────────────────────────────────────────── */
.guest-login-section {
  margin-top: .25rem;
}

.guest-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  padding: .7rem 1rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}

.guest-login-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-border);
}

.guest-login-btn:active { transform: scale(.98); }

.guest-login-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.guest-login-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.guest-login-note {
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

