@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #0D0D0D;
  --bg: #0f0f10;
  --bg-elevated: #141416;
  --card: #17171a;
  --card-hover: #1c1c20;
  --muted: #9a9aa8;
  --text: #f2f2f5;
  --text-secondary: #CCCCCC;
  --line: rgba(255,255,255,.06);
  --line-hover: rgba(255,255,255,.12);
  --btn: #232328;
  --btn-hover: #2d2d34;
  --accent-glow: rgba(160, 140, 255, 0.15);
  --accent-subtle: rgba(180, 160, 255, 0.08);
  --topbar-bg: rgba(13, 13, 13, 0.85);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --border: rgba(255,255,255,.1);
  --surface: #1a1a1e;
}

[data-theme="light"] {
  --bg-deep: #f5f5f7;
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --card: #ffffff;
  --card-hover: #f0f0f2;
  --muted: #6b6b78;
  --text: #1a1a1d;
  --text-secondary: #4a4a52;
  --line: rgba(0,0,0,.08);
  --line-hover: rgba(0,0,0,.14);
  --btn: #e8e8ec;
  --btn-hover: #dcdce2;
  --accent-glow: rgba(100, 80, 200, 0.12);
  --accent-subtle: rgba(100, 80, 200, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --surface: #f5f5f7;
  --border: rgba(0,0,0,.1);
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
small { color: var(--muted); font-size: 12px; }

h3, h4 {
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.theme-toggle:hover {
  background: var(--btn-hover);
}

/* Mobile Bottom Navigation */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 100;
  padding: 10px 0 6px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 8px;
}

.bottom-nav-inner.bottom-nav-2row {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto auto;
  row-gap: 0;
  max-width: 100%;
}

.bottom-nav-inner.bottom-nav-2row .bottom-nav-item:nth-child(n+6) {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.bottom-nav-inner.bottom-nav-4 {
  grid-template-columns: repeat(4, 1fr);
  max-width: 400px;
}

/* Hide desktop login button on mobile */
@media (max-width: 768px) {
  .btn-login-desktop {
    display: none !important;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.15s;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: #4a90d9;
}

.bottom-nav-item.empty {
  pointer-events: none;
  opacity: 0;
}

/* Leaderboard Ad - Only show on mobile/tablet */
.leaderboard-ad-container {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  z-index: 99;
  text-align: center;
  padding: 0 8px;
}

.leaderboard-ad-img {
  max-width: 728px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

/* Hide top nav pills and show bottom nav on mobile/tablet */
@media (max-width: 768px) {
  .nav-pills {
    display: none !important;
  }
  .bottom-nav {
    display: block;
  }
  .leaderboard-ad-container {
    display: block;
  }
  body {
    padding-bottom: 300px;
  }
  body.has-1row-nav .leaderboard-ad-container {
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  }
  body.has-2row-nav .leaderboard-ad-container {
    bottom: calc(130px + env(safe-area-inset-bottom, 0px));
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand, .brand-center {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--text);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.brand-center {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .topbar-inner {
    min-height: 44px;
    flex-wrap: nowrap;
  }
  
  .topbar-public .user-actions {
    display: flex !important;
    gap: 8px;
  }
  
  .topbar-public .user-actions .btn-login-desktop {
    display: none !important;
  }
  
  .topbar-logged-in .user-actions {
    flex-shrink: 0;
  }
}

.badge-dev {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.nav-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #b2b2c7;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-pill:hover,
.nav-pill.active {
  background: rgba(255, 255, 255, 0.08);
  color: #e9e9ef;
}

[data-theme="light"] .nav-pill {
  color: #6a6a7a;
}

[data-theme="light"] .nav-pill:hover,
[data-theme="light"] .nav-pill.active {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1f;
}

.nav-more-wrap {
  position: relative;
  display: inline-flex;
}

.nav-more-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 180px;
  background: var(--card-bg, #1e1e2e);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px 0;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-more-wrap.open .nav-more-menu {
  display: block;
}

.nav-more-menu a,
.nav-more-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary, #b2b2c7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-more-menu a:hover,
.nav-more-menu button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text, #e9e9ef);
}

[data-theme="light"] .nav-more-menu {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

[data-theme="light"] .nav-more-menu a,
[data-theme="light"] .nav-more-menu button {
  color: #6a6a7a;
}

[data-theme="light"] .nav-more-menu a:hover,
[data-theme="light"] .nav-more-menu button:hover {
  background: rgba(0,0,0,0.04);
  color: #1a1a1f;
}

@media (max-width: 768px) {
  .nav-more-wrap {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-only-feature {
    display: none !important;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--btn-hover);
  border-color: var(--line-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.input:focus, textarea:focus, select:focus {
  border-color: var(--line-hover);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea { min-height: 100px; resize: vertical; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.25s ease;
}

button.card {
  color: var(--text);
  font-family: inherit;
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%, rgba(255,255,255,0.04) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: var(--line-hover);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 40px var(--accent-glow);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.post {
  position: relative;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.25s ease;
}

.post:hover {
  border-color: var(--line-hover);
}

.post + .post { margin-top: 12px; }
.post .content { 
  margin: 12px 0; 
  white-space: pre-wrap; 
  color: var(--text-secondary);
  line-height: 1.6;
}

.post .media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.post .media img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.post .media img:hover {
  border-color: var(--line-hover);
  transform: scale(1.02);
}

.notice {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg) 100%);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, transparent 100%);
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
}

.hr { 
  height: 1px; 
  background: var(--line); 
  margin: 16px 0; 
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 768px) {
  .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-group {
  position: relative;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--line-hover);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: #f87171;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.nav-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.notification-item .notif-text {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}

.notification-item .notif-time {
  font-size: 11px;
  color: var(--muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.price-range-slider {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}

.range-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  pointer-events: none;
}

.range-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  border-radius: 3px;
  pointer-events: none;
}

.range-input {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #8b5cf6;
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #8b5cf6;
}

/* Notifications Page */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-row {
  overflow: hidden;
  border-radius: 12px;
}

.notification-content {
  position: relative;
  overflow: hidden;
}

.notification-swipe-container {
  display: flex;
  position: relative;
}

.notification-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.15s ease;
  position: relative;
  z-index: 1;
}

.notification-main:hover {
  background: var(--card-hover);
}

.notification-main.clickable {
  cursor: pointer;
}

.notification-main.clickable::after {
  content: '›';
  font-size: 18px;
  color: var(--text-muted);
  margin-left: auto;
  padding-right: 8px;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.notification-icon.success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.notification-icon.error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.notification-icon.processing {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.notification-message {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.notification-delete-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: #f87171;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0 12px 12px 0;
}

@media (max-width: 640px) {
  .container {
    padding: 12px 16px;
  }
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.deal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}
.deal-card:hover {
  border-color: var(--line-hover);
}
.deal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.deal-title {
  font-weight: 500;
  color: var(--text);
}
.deal-status {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.deal-status-pending {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}
.deal-status-pending-final {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
}
.deal-status-completed {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}
.deal-status-cancelled {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}
.deal-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.deal-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.deal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn-outline:hover {
  border-color: var(--line-hover);
  color: var(--text);
}

.price-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.price-history-table th,
.price-history-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.price-history-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.price-history-table tbody tr:hover {
  background: var(--card-hover);
}

.mark-sold-btn {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mark-sold-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Vision Module Styles */
.vision-camera-guidelines {
  background: var(--card);
  border: 1px dashed var(--line-hover);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.guideline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.guideline-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}

.vision-upload-zone {
  background: var(--card);
  border: 2px dashed var(--line-hover);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.vision-upload-zone:hover,
.vision-upload-zone.dragover {
  border-color: rgba(160, 140, 255, 0.4);
  background: var(--card-hover);
}
.vision-upload-label {
  cursor: pointer;
  display: block;
}
.vision-file-input {
  display: none;
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-icon {
  font-size: 32px;
  opacity: 0.7;
}
.upload-text {
  font-weight: 500;
  color: var(--text);
}
.upload-hint {
  font-size: 12px;
  color: var(--muted);
}
.upload-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}
.required {
  color: #ef5350;
}
.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.image-quality-indicator {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.image-quality-indicator.good {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
}
.image-quality-indicator.warning {
  background: rgba(255, 152, 0, 0.15);
  color: #ffb74d;
}
.image-quality-indicator.error {
  background: rgba(239, 83, 80, 0.15);
  color: #ef5350;
}
.checking {
  color: var(--muted);
}

.condition-selector {
  margin: 20px 0;
}
.condition-label {
  display: block;
  font-weight: 500;
  margin-bottom: 12px;
}
.vision-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.suggestion-badge {
  background: linear-gradient(135deg, rgba(160, 140, 255, 0.2), rgba(120, 100, 200, 0.2));
  color: #c4b5fd;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.suggestion-note {
  font-size: 12px;
  color: var(--muted);
}
.condition-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.condition-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
}
.condition-option:hover {
  border-color: var(--line-hover);
  background: var(--card-hover);
}
.condition-option.suggested {
  border-color: rgba(160, 140, 255, 0.4);
}
.condition-option input[type="radio"] {
  display: none;
}
.condition-option input[type="radio"]:checked + .condition-code {
  color: #c4b5fd;
}
.condition-option:has(input:checked) {
  border-color: rgba(160, 140, 255, 0.6);
  background: rgba(160, 140, 255, 0.1);
}
.condition-code {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.condition-name {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.card-match-suggestions {
  margin: 20px 0;
}
.card-match-suggestions > label {
  display: block;
  font-weight: 500;
  margin-bottom: 12px;
}
.match-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.match-option:hover {
  border-color: var(--line-hover);
  background: var(--card-hover);
}
.match-option.best-match {
  border-color: rgba(160, 140, 255, 0.3);
}
.match-option input[type="radio"] {
  display: none;
}
.match-option:has(input:checked) {
  border-color: rgba(160, 140, 255, 0.6);
  background: rgba(160, 140, 255, 0.1);
}
.match-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.match-name {
  font-weight: 500;
  color: var(--text);
}
.match-set {
  font-size: 12px;
  color: var(--muted);
}
.match-variant {
  font-size: 11px;
  color: var(--text-secondary);
}
.match-confidence {
  font-size: 11px;
  color: #81c784;
  margin-top: 4px;
}

.pregrade-results {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 20px 0;
}
.pregrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pregrade-header h3 {
  font-size: 16px;
  font-weight: 600;
}
.pregrade-confidence {
  background: rgba(160, 140, 255, 0.15);
  color: #c4b5fd;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.pregrade-disclaimer {
  background: rgba(255, 152, 0, 0.1);
  color: #ffb74d;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
}

.grade-predictions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.grade-card {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.grade-card .grader-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.grade-card.psa .grader-name { color: #f44336; }
.grade-card.cgc .grader-name { color: #2196f3; }
.grade-card.tag .grader-name { color: #9c27b0; }
.grade-card .grade-range {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.grade-card .grade-likely {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.pregrade-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.detail-label {
  color: var(--muted);
}
.detail-value {
  color: var(--text);
  font-weight: 500;
}
.limiting-factors .detail-value {
  color: #ffb74d;
}

.no-matches {
  color: var(--muted);
  text-align: center;
  padding: 20px;
  background: var(--card);
  border-radius: 10px;
}

.vision-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--muted);
}
.vision-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: #c4b5fd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.vision-error {
  background: rgba(239, 83, 80, 0.1);
  color: #ef5350;
  padding: 14px 18px;
  border-radius: 10px;
  margin: 16px 0;
}

.pregrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c4dff, #536dfe);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pregrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}
.pregrade-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Post actions - desktop shows full text, mobile shows compact */
.post-actions .action-count {
  display: none;
}
.post-actions .action-text {
  display: inline;
}

@media (max-width: 768px) {
  .post-actions {
    flex-wrap: nowrap;
    gap: 6px !important;
  }
  .post-actions .action-count {
    display: inline;
  }
  .post-actions .action-text {
    display: none;
  }
  .post-actions .btn,
  .post-actions .btn-ghost {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }
}

/* Comment dropdown menu */
.comment-menu-dropdown button:hover {
  background: var(--btn-hover) !important;
}
.btnDeleteComment:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}
.btnReportComment:hover {
  background: var(--btn-hover) !important;
}

/* Listing Image Gallery */
.listing-image-gallery {
  min-height: 100px;
}
.listing-image-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  background: var(--card);
  border: 2px solid var(--border);
  transition: transform 0.15s, border-color 0.15s;
}
.listing-image-item:hover {
  border-color: #4ade80;
}
.listing-image-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: grabbing;
}
.listing-image-item.drag-over {
  border-color: #4ade80;
  transform: scale(1.05);
}
.listing-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-image-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
  transition: background 0.15s;
}
.listing-image-item .remove-btn:hover {
  background: #ef4444;
}
.listing-image-add {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 2px dashed var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.listing-image-add:hover {
  border-color: #4ade80;
  color: #4ade80;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .listings-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  .listings-grid { grid-template-columns: repeat(6, 1fr); }
}

.swipe-delete-content {
  touch-action: pan-y;
  user-select: none;
}


.view-listing-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 900px) {
  .view-listing-layout {
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
  }
  .view-listing-left {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 80px;
  }
  .view-listing-right {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

/* Photo Gallery Grid */
.gallery-grid {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(8, 1fr);
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(12, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(16, 1fr); }
}
.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  min-width: 0;
  max-width: 100%;
  background: rgba(255,255,255,.04);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.gallery-item-info {
  display: none;
  padding: 6px 8px;
}
.gallery-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
.gallery-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr) !important; }
.gallery-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr) !important; }
.gallery-grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr) !important; }
.gallery-grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr) !important; }
.gallery-grid[data-cols="7"] { grid-template-columns: repeat(7, 1fr) !important; }
.gallery-grid[data-cols="8"] { grid-template-columns: repeat(8, 1fr) !important; }
.gallery-grid[data-cols="9"] { grid-template-columns: repeat(9, 1fr) !important; }
.gallery-grid[data-cols="10"] { grid-template-columns: repeat(10, 1fr) !important; }
.gallery-grid[data-cols="11"] { grid-template-columns: repeat(11, 1fr) !important; }
.gallery-grid[data-cols="12"] { grid-template-columns: repeat(12, 1fr) !important; }
.gallery-grid[data-cols="13"] { grid-template-columns: repeat(13, 1fr) !important; }
.gallery-grid[data-cols="14"] { grid-template-columns: repeat(14, 1fr) !important; }
.gallery-grid[data-cols="15"] { grid-template-columns: repeat(15, 1fr) !important; }
.gallery-grid[data-cols="16"] { grid-template-columns: repeat(16, 1fr) !important; }
.gallery-grid[data-cols="2"] .gallery-item {
  aspect-ratio: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: var(--card-bg, rgba(255,255,255,.04));
}
.gallery-grid[data-cols="2"] .gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px 12px 0 0;
}
.gallery-grid[data-cols="2"] .gallery-item-info {
  display: block;
}
.gallery-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gallery-item-price {
  font-size: 14px;
  font-weight: 700;
  color: #4ade80;
  margin-top: 4px;
}

/* Gallery Overlay */
.gallery-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.gallery-overlay.active {
  display: flex;
}
.gallery-overlay-card {
  position: relative;
  max-width: 60vw;
  max-height: 80vh;
  width: 100%;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform;
}
@media (max-width: 767px) {
  .gallery-overlay-card { max-width: 85vw; max-height: 80vh; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .gallery-overlay-card { max-width: 70vw; max-height: 75vh; }
}
.gallery-overlay-card.swiping-right {
  transform: translateX(120%) rotate(15deg);
  opacity: 0;
}
.gallery-overlay-card.swiping-left {
  transform: translateX(-120%) rotate(-15deg);
  opacity: 0;
}
.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  font-weight: 900;
  padding: 12px 32px;
  border-radius: 16px;
  border: 5px solid;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.swipe-hint-like {
  color: #4ade80;
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.3);
}
.swipe-hint-dislike {
  color: #f43f5e;
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.3);
}
.gallery-overlay-actions {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
  justify-content: center;
}
.gallery-overlay-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-swipe-dislike {
  background: rgba(244,63,94,0.15);
  color: #f43f5e;
  border: 1px solid rgba(244,63,94,0.3) !important;
}
.btn-swipe-like {
  background: rgba(74,222,128,0.15);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.3) !important;
}
.gallery-overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  border: none;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}
.gallery-overlay-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  max-height: 50vh;
}
.gallery-overlay-body {
  padding: 16px;
}
.gallery-overlay-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.gallery-overlay-price {
  font-size: 18px;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 14px;
}
.gallery-overlay-view {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Column indicator */
.gallery-col-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 9998;
  backdrop-filter: blur(8px);
}
.gallery-col-indicator.show {
  opacity: 1;
}

@keyframes checkinPulse {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes checkinPulseText {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

[data-theme="light"] .gallery-item {
  background: rgba(0,0,0,.03);
}
[data-theme="light"] .gallery-grid[data-cols="2"] .gallery-item {
  border-color: rgba(0,0,0,.1);
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
[data-theme="light"] .gallery-item-title {
  color: var(--text);
}
[data-theme="light"] .gallery-overlay-card {
  background: var(--card);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
[data-theme="light"] .gallery-overlay-title {
  color: var(--text);
}
[data-theme="light"] .gallery-overlay-close {
  background: rgba(0,0,0,.6);
  color: #fff;
}
[data-theme="light"] .gallery-overlay-actions button {
  border: 1px solid rgba(0,0,0,.1) !important;
}
[data-theme="light"] .btn-swipe-dislike {
  background: rgba(244,63,94,0.1);
  color: #dc2626;
  border-color: rgba(244,63,94,0.25) !important;
}
[data-theme="light"] .btn-swipe-like {
  background: rgba(74,222,128,0.1);
  color: #16a34a;
  border-color: rgba(74,222,128,0.25) !important;
}
[data-theme="light"] .gallery-col-indicator {
  background: rgba(255,255,255,.9);
  color: var(--text);
}
