/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #2563eb;
  --primary-h: #1d4ed8;
  --accent:    #f59e0b;
  --accent-h:  #d97706;
  --danger:    #ef4444;
  --success:   #22c55e;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1e293b;
  --text-2:    #64748b;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --chat-w:    480px;
  --header-h:  64px;
  --cat-h:     44px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Buttons ─────────────────────────────────────────────────────────────  */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--primary-h); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
}
.btn-accent:hover { background: var(--accent-h); }
.small-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
}
.small-btn:hover { background: var(--bg); }
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  position: relative;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg); }
.full-width { width: 100%; }

/* ── Badge ────────────────────────────────────────────────────────────── */
.badge {
  position: absolute;
  top: -2px; right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.hidden { display: none !important; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1440px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-img { height: 40px; width: auto; display: block; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--primary); }
.logo-badge {
  font-size: 10px; color: #fff; background: var(--accent);
  border-radius: 4px; padding: 2px 6px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.logo-badge:hover { opacity: .8; }
.header-search { flex: 1; display: flex; gap: 8px; max-width: 560px; }
.header-search input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  transition: border .15s;
}
.header-search input:focus { border-color: var(--primary); }
.header-actions { display: flex; gap: 8px; margin-left: auto; }

/* ── Category bar ────────────────────────────────────────────────────── */
.category-bar {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  height: var(--cat-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  display: flex; align-items: center; gap: 4px;
  padding: 0 24px;
  overflow-x: auto;
}
.cat-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 16px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-2);
  transition: all .15s;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Main layout ─────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  margin-top: calc(var(--header-h) + var(--cat-h));
  height: calc(100vh - var(--header-h) - var(--cat-h));
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  /* Ensure full width even when margin:auto is applied */
  width: 100%;
}

/* ── Chat resize handle ──────────────────────────────────────────────── */
.chat-resize-handle {
  width: 6px;
  flex-shrink: 0;
  background: var(--border);
  cursor: col-resize;
  position: relative;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-resize-handle:hover,
.chat-resize-handle.dragging { background: var(--primary); }
.chat-collapse-btn {
  position: absolute;
  width: 20px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  right: -20px;
  z-index: 10;
  transition: all .15s;
}
.chat-collapse-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Chat panel ──────────────────────────────────────────────────────── */
.chat-panel {
  width: var(--chat-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: width .2s ease;
}
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}
.guest-notice {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  font-size: 12.5px;
  color: #78350f;
  line-height: 1.4;
}
.guest-notice-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.guest-notice-btn {
  flex-shrink: 0;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.guest-notice-btn:hover { background: #d97706; color: #fff; }
.guest-notice-btn.outline {
  background: #fff;
  color: #78350f;
  border: 1px solid #f59e0b;
}
.guest-notice-btn.outline:hover { background: #fef3c7; color: #78350f; }
.plan-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.plan-badge.free { background: #e2e8f0; color: #475569; }
.plan-badge.pro {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { display: flex; gap: 8px; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.msg.assistant .msg-bubble {
  background: #f0f4ff;
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble strong { font-weight: 700; }
.msg-bubble br + br { margin-top: 4px; }

/* Streaming cursor */
.typing-cursor::after {
  content: "▋";
  animation: blink .7s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.chat-input-area {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-area textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border .15s;
}
.chat-input-area textarea:focus { border-color: var(--primary); }
.chat-input-area .btn-primary { align-self: flex-end; }

/* ── Products section ────────────────────────────────────────────────── */
.products-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.products-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.results-info { font-size: 13px; color: var(--text-2); }
.sort-controls { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sort-controls select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.compare-bar {
  background: #fffbeb;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}

/* ── Product grid ────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  flex: 1;
}

.product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  cursor: pointer;
  position: relative;
}
.product-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.product-card.selected-compare {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card-img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
}
.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.product-card:hover .card-img-wrap img { transform: scale(1.05); }

.card-discount-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--danger);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
}

.card-web-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}
.card-compare-check {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.card-compare-check:hover { border-color: var(--accent); }
.product-card.selected-compare .card-compare-check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-brand { font-size: 11px; color: var(--text-2); }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.4; }
.card-desc { font-size: 11px; color: var(--text-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.card-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.stars { color: #f59e0b; }
.review-count { color: var(--text-2); }

.card-price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.card-price { font-size: 18px; font-weight: 700; color: var(--danger); }
.card-original-price { font-size: 12px; color: var(--text-2); text-decoration: line-through; }

.card-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.btn-add-cart {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
}
.btn-add-cart:hover { background: var(--primary-h); }
.btn-buy-link {
  display: inline-flex;
  align-items: center;
  background: #f97316;
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.btn-buy-link:hover { background: #ea6e0e; }
.btn-wishlist {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 15px;
  transition: all .15s;
}
.btn-wishlist:hover { background: #fff0f3; border-color: #fca5a5; }

/* ── Drawers ─────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-right2 { right: 0; }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.cart-total { font-size: 16px; font-weight: 700; text-align: right; }

/* Cart item */
.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}
.cart-item-img {
  width: 56px; height: 56px;
  border-radius: 6px; object-fit: cover;
  background: var(--border);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; }
.cart-item-price { font-size: 13px; color: var(--danger); font-weight: 700; }
.cart-item-qty {
  display: flex; align-items: center; gap: 4px;
}
.qty-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.qty-val { font-size: 13px; min-width: 24px; text-align: center; }
.cart-item-remove {
  background: none; border: none; cursor: pointer; color: var(--text-2);
  font-size: 18px; padding: 2px 6px;
}
.cart-item-remove:hover { color: var(--danger); }

/* Wishlist item */
.wishlist-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; background: var(--bg); border-radius: 8px;
}
.wishlist-item-img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.wishlist-item-info { flex: 1; }
.wishlist-item-name { font-size: 13px; font-weight: 600; }
.wishlist-item-price { font-size: 13px; color: var(--danger); }

/* Empty state */
.empty-state {
  text-align: center; color: var(--text-2);
  padding: 32px 16px; font-size: 14px;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 8px; }

/* ── Compare Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 90vw; max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 17px; font-weight: 700;
}
.modal-body { overflow-y: auto; padding: 24px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th, .compare-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.compare-table th { background: #f8fafc; font-weight: 700; }
.compare-table .row-label { background: #f8fafc; font-weight: 600; white-space: nowrap; }
.compare-winner td { background: #f0fdf4; }
.winner-badge {
  display: inline-block;
  background: var(--success);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 4px;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeInUp .3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Loading skeleton ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card {
  height: 320px; border-radius: var(--radius);
}

/* ── Markdown in chat ─────────────────────────────────────────────────── */
.msg-bubble table { border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.msg-bubble th, .msg-bubble td {
  border: 1px solid rgba(0,0,0,.15);
  padding: 4px 8px;
}
.msg-bubble th { background: rgba(0,0,0,.06); }
.msg-bubble h2 { font-size: 14px; margin: 8px 0 4px; }
.msg-bubble h3 { font-size: 13px; margin: 6px 0 3px; }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 4px 0; }
.msg-bubble code { background: rgba(0,0,0,.08); border-radius: 3px; padding: 1px 4px; font-size: 12px; }
.msg-bubble p { margin: 4px 0; }

/* ── Responsive ──────────────────────────────────────────────────────── */
/* Chat collapsed state */
.chat-panel.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-right: none;
}
.chat-panel.collapsed * { visibility: hidden; }
.chat-resize-handle.collapsed { background: var(--primary-light, #dbeafe); }

@media (max-width: 768px) {
  :root { --chat-w: 100%; }
  .main-layout { flex-direction: column; height: auto; min-height: calc(100vh - var(--header-h) - var(--cat-h)); }
  .chat-panel {
    width: 100% !important;
    height: var(--chat-h-mobile, 50vh);
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    transition: height .2s ease;
    overflow: hidden;
  }
  .chat-panel.collapsed {
    width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    border-bottom: none;
  }
  /* Horizontal handle on mobile becomes a horizontal drag bar */
  .chat-resize-handle {
    display: flex !important;
    width: 100%;
    height: 8px;
    cursor: row-resize;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .chat-collapse-btn {
    position: static;
    width: 48px;
    height: 16px;
    border-radius: 4px;
    font-size: 11px;
    right: unset;
  }
  .products-section { flex: 1; min-height: 40vh; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Auth / Forms ─────────────────────────────────────────────────────── */
.btn-outline {
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.tab-switcher { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.tab-btn {
  flex: 1; background: none; border: none; padding: 8px 20px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: all .15s;
}
.tab-btn.active { background: var(--primary); color: #fff; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-2); }
.form-input {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px;
  font-size: 14px; outline: none; transition: border .15s;
  font-family: inherit; box-sizing: border-box;
}
.form-input:focus { border-color: var(--primary); }
.form-error {
  background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: 6px; padding: 8px 12px;
  color: var(--danger); font-size: 13px; margin-top: 8px;
}

/* ── Modal sizes ─────────────────────────────────────────────────────── */
.modal-sm { max-width: 420px !important; }

/* ── Payment methods ─────────────────────────────────────────────────── */
.payment-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.payment-method-btn {
  flex: 1; min-width: 100px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  cursor: pointer; background: none;
  font-size: 13px; text-align: center;
  transition: all .15s;
}
.payment-method-btn:hover { border-color: var(--primary); }
.payment-method-btn.selected { border-color: var(--primary); background: #eff6ff; }
.payment-method-icon { font-size: 22px; display: block; margin-bottom: 4px; }

/* ── Price check result ──────────────────────────────────────────────── */
.platform-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  transition: border .15s;
}
.platform-card:hover { border-color: var(--primary); }
.platform-card.cheapest { border-color: var(--success); background: #f0fdf4; }
.platform-name { font-weight: 700; font-size: 14px; min-width: 60px; }
.platform-price { font-size: 20px; font-weight: 700; color: var(--danger); }
.platform-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge-tag {
  font-size: 11px; padding: 2px 6px;
  border-radius: 4px; font-weight: 600;
}
.badge-flash { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-coupon { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.platform-go-btn {
  margin-left: auto;
  background: none; border: 1.5px solid var(--primary);
  color: var(--primary); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: 13px;
  white-space: nowrap;
}
.platform-go-btn:hover { background: var(--primary); color: #fff; }

/* ── Orders list ─────────────────────────────────────────────────────── */
.order-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
  cursor: pointer; transition: border .15s;
}
.order-card:hover { border-color: var(--primary); }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-id { font-size: 12px; color: var(--text-2); }
.order-status { font-size: 12px; font-weight: 700; }
.order-items { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.order-total { font-size: 15px; font-weight: 700; color: var(--danger); }

/* ── Rec score badge ─────────────────────────────────────────────────── */
.rec-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; border-radius: 6px; padding: 2px 7px;
  font-size: 10px; font-weight: 700;
}

/* ── User avatar chip ────────────────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 6px;
  background: #eff6ff; border-radius: 20px;
  padding: 4px 12px 4px 6px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--primary);
  border: none; transition: background .15s;
}
.user-chip:hover { background: #dbeafe; }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ── Recommend explanation ───────────────────────────────────────────── */
.rec-explanation {
  font-size: 11px; color: #7c3aed;
  background: #f5f3ff; border-radius: 4px;
  padding: 2px 6px; margin-top: 4px;
  display: inline-block;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.cat-rec { background: linear-gradient(135deg,#ede9fe,#dbeafe) !important; color: #5b21b6 !important; border-color: #a78bfa !important; }
.cat-rec.active { background: linear-gradient(135deg,#7c3aed,#2563eb) !important; color: #fff !important; border-color: transparent !important; }
