*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--muted2); }

:root {
  --bg:       #0d0d0d;
  --panel:    #141414;
  --panel2:   #1c1c1c;
  --border:   #252525;
  --border2:  #2e2e2e;
  --text:     #e0e0e0;
  --muted:    #5a5a5a;
  --muted2:   #888;
  --accent:   #6366f1;
  --accent-d: #4f52c9;
  --green:    #22c55e;
  --red:      #ef4444;
  --yellow:   #f59e0b;

  --sidebar-w: 130px;
  --detail-w:  320px;
  --topbar-h:  44px;
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.exit-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted2);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.exit-btn:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.08); }
.exit-btn:disabled { opacity: 0.45; cursor: default; }
.topbar-user {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.topbar-admin-link {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.topbar-admin-link:hover { background: rgba(99, 102, 241, 0.1); }

.currency-select {
  background: #111116;
  border: 1px solid #2a2a35;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.currency-select:hover, .currency-select:focus {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

.logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.logo-wordmark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  margin-top: 8px;
}
.logo-img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.logo-img {
  position: absolute;
  top: 0; left: 0;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}
.logo-img-open {
  filter: drop-shadow(0 0 3px rgba(167,104,255,0.5));
  z-index: 1;
}
.logo-img-closed {
  opacity: 0;
  z-index: 2;
  background: var(--panel);
}
/* Full glow state — toggled by JS when there are notifications */
.logo-img-wrap.logo-notify .logo-img-open {
  filter: drop-shadow(0 0 7px rgba(167,104,255,0.95))
          drop-shadow(0 0 14px rgba(167,104,255,0.45));
}
/* Pulse animation when unread notifications exist */
@keyframes notify-pulse {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(167,104,255,0.7)) drop-shadow(0 0 12px rgba(167,104,255,0.35)); }
  50%       { filter: drop-shadow(0 0 12px rgba(167,104,255,1.0)) drop-shadow(0 0 24px rgba(167,104,255,0.6)); }
}
.logo-img-wrap.logo-notify .logo-img-open {
  animation: notify-pulse 2s ease-in-out infinite;
}
/* Notification badge dot */
.notify-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 10px; height: 10px;
  background: #e07070;
  border-radius: 50%;
  border: 2px solid var(--panel);
  z-index: 10;
}
/* Notification panel */
.notify-panel {
  position: absolute;
  top: 56px; left: 8px;
  width: 280px;
  background: #1a1a1f;
  border: 1px solid #2a2a35;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}
.notify-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #111116;
  border-bottom: 1px solid #2a2a35;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b8a9f5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.notify-mark-read {
  background: none;
  border: 1px solid #3a3a4a;
  color: #888;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.notify-mark-read:hover { color: #ccc; border-color: #666; }
.notify-list {
  max-height: 320px;
  overflow-y: auto;
}
.notify-item {
  padding: 10px 12px;
  border-bottom: 1px solid #1e1e28;
  font-size: 0.8rem;
  line-height: 1.45;
}
.notify-item.unread { background: #16161e; }
.notify-item-title {
  font-weight: 600;
  color: #c8c0f8;
  margin-bottom: 3px;
}
.notify-item-body { color: #aaa; }
.notify-item-time { color: #555; font-size: 0.7rem; margin-top: 4px; }
.notify-empty { padding: 18px 12px; text-align: center; color: #555; font-size: 0.8rem; }
/* Mobile: notification tab in bottom nav */
@media (max-width: 768px) {
  .notify-panel {
    top: auto;
    bottom: calc(56px + env(safe-area-inset-bottom) + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: min(320px, 92vw);
  }
  .nav-btn-notify { display: flex !important; }
}
.nav-btn-notify {
  display: none;
  position: relative;
}
.nav-btn-notify .notify-badge {
  top: 6px; right: 8px;
  width: 8px; height: 8px;
}
.status {
  font-size: 11px;
  color: var(--muted2);
  transition: color 0.2s;
}
.status.busy { color: var(--yellow); }
.status.error { color: var(--red); }

.updater-status {
  font-size: 10px;
  color: var(--muted);
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  transition: color 0.2s;
  white-space: nowrap;
}
.updater-status.updater-active { color: var(--accent); }
.updater-bar-wrap {
  display: inline-block;
  width: 60px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}
.updater-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* ── Layout ──────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; }

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Dashboard ───────────────────────────────────────── */
.dash-search-bar {
  display: flex;
  gap: 8px;
  padding: 16px 16px 12px;
}
.dash-search-bar input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.dash-search-bar input:focus { border-color: var(--accent); }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 16px 16px;
  overflow-y: auto;
}
.dash-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 140px;
}
.dash-card-header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.dash-badge.hobbyist { background: #1a2a4a; color: #7aacf5; }
.dash-badge.pro      { background: #2a1a3a; color: #b47af5; }
.dash-empty  { font-size: 0.82rem; color: var(--muted); }
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
  gap: 8px;
}
.dash-row:last-child { border-bottom: none; }
.dash-row-clickable { cursor: pointer; }
.dash-row-clickable:hover { background: var(--hover); border-radius: 4px; }
.dash-row-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-price { color: var(--accent); font-weight: 600; flex-shrink: 0; }
.dash-row-meta  { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.dash-alert-low  { color: var(--green); }
.dash-alert-high { color: var(--yellow); }
.dash-lot-body { display: flex; flex-direction: column; gap: 10px; }
.dash-lot-desc { font-size: 0.83rem; color: var(--muted); margin: 0; }
.lot-margin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.lot-margin-label { font-size: 0.78rem; color: var(--muted); flex-shrink: 0; }
.lot-margin-slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.lot-margin-input {
  width: 46px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 2px 6px;
  text-align: center;
}
.lot-margin-pct { font-size: 0.82rem; color: var(--muted); flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-sub   { font-size: 0.8rem; color: var(--muted); margin-top: -8px; }
.modal-fields { display: flex; flex-direction: column; gap: 10px; }
.modal-field  { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.modal-field input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 6px 10px;
  outline: none;
}
.modal-field input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
  overflow: hidden;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn.active { background: var(--panel2); color: var(--text); font-weight: 600; }
.nav-btn[draggable] { cursor: grab; user-select: none; }
.nav-btn.dragging   { opacity: 0.35; }
.nav-btn.drag-over-before { box-shadow: 0 -2px 0 var(--accent); }
.nav-btn.drag-over-after  { box-shadow: 0  2px 0 var(--accent); }
.nav-btn.nav-locked { opacity: 0.45; cursor: default; }
.nav-btn.nav-locked::after { content: ' 🔒'; font-size: 0.7em; }
.nav-btn-soon { opacity: 0.4; cursor: default; pointer-events: none; display: block;
                color: var(--muted); font-size: 13px; padding: 7px 10px; border-radius: 6px;
                position: relative; }
.soon-badge { font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
              background: var(--border2); color: var(--muted); border-radius: 3px;
              padding: 1px 4px; margin-left: 4px; vertical-align: middle; }

/* ── Content area ────────────────────────────────────── */
.content {
  flex: 1;
  overflow: auto;
  padding: 16px;
  min-width: 0;
}
.view { display: none; }
.view.active { display: block; }

.view-header { margin-bottom: 14px; }
.view-header h2 { font-size: 15px; font-weight: 600; }
.header-sub { font-size: 11px; color: var(--muted2); margin-top: 3px; display: block; }
.view-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.export-btn {
  font-size: 11px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.mobile-close-btn { display: none; }

/* ── Search ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.search-variants-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.search-variants-toggle input { accent-color: var(--accent); cursor: pointer; }
.search-lang-select {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
}
#search-input {
  flex: 1;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.15s;
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--muted); }

.hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* ── Card grid ───────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
}
.card-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.12s, background 0.12s;
  touch-action: manipulation; /* snappier taps, no 300ms delay */
  -webkit-tap-highlight-color: transparent;
}
.card-tile:hover { border-color: var(--accent); background: var(--panel2); }
.card-tile.selected { border-color: var(--accent); }

.tile-actions {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  opacity: 0;
  pointer-events: none; /* invisible buttons must not capture touches */
  transition: opacity 0.12s;
}
.card-tile:hover .tile-actions {
  opacity: 1;
  pointer-events: auto;
}

.tile-btn {
  flex: 1;
  padding: 3px 0;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.tile-btn-wl {
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  border-color: rgba(99,102,241,0.25);
}
.tile-btn-wl:hover  { background: rgba(99,102,241,0.25); }
.tile-btn-lot {
  background: rgba(245,158,11,0.12);
  color: var(--yellow);
  border-color: rgba(245,158,11,0.25);
}
.tile-btn-lot:hover  { background: rgba(245,158,11,0.25); }
.tile-btn-done {
  background: rgba(34,197,94,0.12) !important;
  color: var(--green) !important;
  border-color: rgba(34,197,94,0.25) !important;
}

.card-tile img {
  width: 100%;
  border-radius: 5px;
  display: block;
  background: var(--panel2);
}
.tile-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.tile-set  { font-size: 11px; color: var(--muted2); }

/* ── Card detail page ───────────────────────────────── */
.card-detail-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.card-detail-left { display: flex; flex-direction: column; gap: 12px; }
.card-detail-img { width: 100%; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.5); display: block; }
.card-action-box { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.card-action-title { font-size: 11px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.card-action-row { display: flex; gap: 8px; }
.card-detail-right { display: flex; flex-direction: column; }
.price-band { display: flex; gap: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 8px; flex-wrap: wrap; gap: 20px; }
.price-band-item { display: flex; flex-direction: column; gap: 4px; }
.price-band-value { font-size: 20px; font-weight: 700; color: var(--text); }
.price-band-value.muted { color: var(--muted2); font-size: 16px; }
.card-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-meta-section { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.input-sm { background: var(--panel2); border: 1px solid var(--border); color: var(--text); font-size: 12px; padding: 6px 8px; border-radius: 5px; font-family: inherit; }
.input-sm:focus { outline: none; border-color: var(--accent); }
@media (max-width: 860px) {
  .card-detail-grid { grid-template-columns: 1fr; }
  .card-detail-left { max-width: 360px; }
  .card-meta-grid { grid-template-columns: 1fr; }
}

/* ── Detail panel ────────────────────────────────────── */
.detail-panel {
  width: var(--detail-w);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Expanded Detail Takeover ── */
.detail-panel--expanded {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  z-index: 1000;
  background: var(--bg);
  border-left: none !important;
}

.detail-panel--expanded .detail-content {
  display: grid;
  grid-template-columns: 420px 1fr;
  grid-template-areas: "img data";
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
  align-items: flex-start;
}

.detail-panel--expanded .detail-img {
  grid-area: img;
  max-width: 100%;
  width: 420px;
  cursor: zoom-out;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  position: sticky;
  top: 60px;
}

.detail-panel--expanded .detail-data-wrap {
  grid-area: data;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Specific elements in expanded grid */
.detail-panel--expanded .detail-header-row { grid-column: 1 / -1; }
.detail-panel--expanded .detail-name { font-size: 24px; }
.detail-panel--expanded .detail-meta { grid-column: 1 / -1; margin-bottom: 10px; }
.detail-panel--expanded .price-section { border: 1px solid var(--border); padding: 16px; border-radius: 8px; background: var(--panel); }
.detail-panel--expanded .chart-wrap { grid-column: 1 / -1; height: 300px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.detail-panel--expanded .btn-row { grid-column: 1 / -1; padding-top: 10px; }
.detail-panel--expanded .trade-log-row { grid-column: 1 / -1; }
.detail-panel--expanded .ebay-exclude-row { grid-column: 1 / -1; }

.expand-close-btn {
  display: none;
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  z-index: 1010;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.detail-panel--expanded .expand-close-btn {
  display: flex;
}
.expand-close-btn:hover {
  background: var(--border);
  color: var(--text);
  transform: scale(1.1) rotate(90deg);
}

.expand-btn-inline {
  display: inline-flex;
}
.detail-panel--expanded .expand-btn-inline {
  display: none;
}

@media (max-width: 1100px) {
  .detail-panel--expanded .detail-content {
    grid-template-columns: 1fr;
    grid-template-areas: "img" "data";
    padding: 40px 20px;
  }
  .detail-panel--expanded .detail-img {
    width: 280px;
    margin: 0 auto;
    position: static;
  }
  .detail-panel--expanded .detail-data-wrap {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .detail-panel--expanded .detail-data-wrap {
    grid-template-columns: 1fr;
  }
}

.detail-content {
  padding: 12px 14px;
}

.detail-img {
  width: 100%;
  max-width: 180px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform 0.2s;
}
.detail-img:hover {
  transform: scale(1.02);
}
.detail-name { font-size: 15px; font-weight: 700; }

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

.detail-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.badge {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted2);
}
.badge-id {
  color: var(--border2);
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ── Price sections ──────────────────────────────────── */
.price-section { display: flex; flex-direction: column; gap: 0; }
.price-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.price-subsection-title {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 8px;
  margin-bottom: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-label { font-size: 12px; color: var(--muted2); }
.price-value { font-size: 13px; font-weight: 600; }

.val-green  { color: var(--green); }
.val-red    { color: var(--red); }
.val-yellow { color: var(--yellow); }

.delta {
  font-size: 10px;
  font-weight: 600;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 3px;
}
.delta.up   { background: rgba(34,197,94,0.15);  color: var(--green); }
.delta.down { background: rgba(239,68,68,0.15);   color: var(--red); }
.delta.flat { color: var(--muted); }

/* ── Sparkline chart ─────────────────────────────────── */
.chart-wrap { position: relative; height: 72px; margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn-ghost { background: none; color: var(--text); }
.btn-ghost:hover { background: var(--panel2); }
.btn-danger { background: none; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-row { display: flex; gap: 7px; }

/* ── Sortable column headers ─────────────────────────── */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--text); }
th.sort-active    { color: var(--accent); }

/* ── Watchlist table ─────────────────────────────────── */
.watchlist-table {
  width: 100%;
  border-collapse: collapse;
}
.watchlist-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border2);
}
.watchlist-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.watchlist-table tr:hover td { background: var(--panel2); cursor: pointer; }
.wl-price    { font-weight: 600; color: var(--green); }
.wl-set      { color: var(--muted2); }
.wl-alert    { color: var(--muted2); font-size: 11px; }
.wl-no-alert { color: var(--border2); }
.wl-rm {
  text-align: right;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.wl-rm:hover { color: var(--red); }

/* ── Filter bar (Drift / Dip / Grade tabs) ───────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted2);
}
.filter-bar select,
.filter-bar input[type=number] {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
}
.filter-bar select:focus,
.filter-bar input:focus { border-color: var(--accent); }

/* ── Analysis tables (shared by Drift / Dip / Grade) ── */
#drift-results,
#dip-results,
#grade-results { overflow-x: auto; }

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.analysis-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.analysis-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.analysis-table tr:hover td { background: var(--panel2); cursor: pointer; }
.analysis-table .col-name { font-weight: 600; }
.analysis-table .col-set  { color: var(--muted2); font-size: 11px; }
.analysis-table .col-price { font-weight: 600; }
.analysis-table .col-score { font-weight: 700; }

/* drift arrows */
.arrow-up   { color: var(--green); }
.arrow-down { color: var(--red); }

/* dip score bar */
.score-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
  opacity: 0.7;
}

/* grading profit cells */
.profit-pos { color: var(--green); font-weight: 600; }
.profit-neg { color: var(--red); }
.pop-green  { color: var(--green); }
.pop-yellow { color: var(--yellow); }
.pop-red    { color: var(--red); }

/* grading tab eBay verify links */
.ebay-link {
  display: inline-block;
  padding: 2px 7px;
  margin: 1px;
  border-radius: 4px;
  background: #1a3a5c;
  color: #7eb8f7;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid #2a5080;
}
.ebay-link:hover { background: #2a5080; color: #fff; }

/* ── eBay comps section in detail panel ──────────────── */
.ebay-section { display: flex; flex-direction: column; gap: 8px; }
.ebay-grade-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 6px;
}
.ebay-sale-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.ebay-sale-row:last-child { border-bottom: none; }
.ebay-sale-price { font-weight: 600; }
.ebay-sale-date  { color: var(--muted2); }
.ebay-avg-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid var(--border2);
  margin-top: 4px;
}

/* ── Alert indicators ────────────────────────────────── */
.alert-dot { font-size: 10px; margin-right: 4px; }
.alert-low  { color: var(--green); }
.alert-high { color: var(--red); }

/* ── Trade log row (detail panel) ───────────────────── */
.trade-log-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.trade-price-input {
  width: 80px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 8px;
  outline: none;
}
.trade-price-input:focus { border-color: var(--accent); }
.btn-trade-buy  { background: none; color: var(--green); border-color: var(--green); }
.btn-trade-buy:hover  { background: var(--green); color: #000; }
.btn-trade-sell { background: none; color: var(--red); border-color: var(--red); }
.btn-trade-sell:hover { background: var(--red); color: #fff; }

/* ── Trades summary bar ──────────────────────────────── */
.trades-summary-bar {
  display: flex;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
.trades-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  gap: 4px;
}
.trades-stat:last-child { border-right: none; }
.trades-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.trades-stat span:last-child { font-size: 14px; font-weight: 700; }

/* ── Alert inputs (detail panel) ────────────────────── */
.alert-inputs { display: flex; flex-direction: column; }
.alert-inputs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.alert-input-label { font-size: 11px; color: var(--muted2); white-space: nowrap; }
.alert-input {
  width: 72px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
}
.alert-input:focus { border-color: var(--accent); }

/* ── Card trades summary (detail panel) ─────────────── */
.card-trades-summary {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0 8px;
}

/* ── Lot builder ─────────────────────────────────────── */
.lot-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.lot-save-row {
  display: flex;
  gap: 5px;
  align-items: center;
}
.lot-save-input {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 9px;
  outline: none;
  width: 140px;
}
.lot-save-input:focus { border-color: var(--accent); }
#saved-lots-panel {
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
.saved-lots-empty { color: var(--muted2); font-size: 12px; padding: 6px 4px; }
.saved-lots-table { margin: 0; }
.btn-lot {
  background: rgba(245,158,11,0.12);
  color: var(--yellow);
  border: 1px solid rgba(245,158,11,0.3);
}
.btn-lot:hover { background: rgba(245,158,11,0.22); }

.lot-empty {
  color: var(--muted2);
  font-size: 13px;
  padding: 24px 0;
}
.qty-btn {
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.lot-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.lot-remove-btn:hover { color: var(--red); }
.lot-refresh-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1;
  transition: color 0.15s, transform 0.2s;
}
.lot-refresh-btn:hover { color: var(--accent); }
.lot-refresh-btn:disabled { opacity: 0.4; cursor: default; }
.lot-pct-input {
  width: 42px; padding: 2px 4px; font-size: 11px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text); border-radius: 3px; text-align: center;
}
.lot-pct-input.lot-pct-override {
  border-color: var(--yellow); color: var(--yellow);
}

/* ── Crack slab opportunities ────────────────────────── */
.crack-row {
  background: rgba(34, 197, 94, 0.04);
}
.crack-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  margin-left: 5px;
  vertical-align: middle;
  white-space: nowrap;
  cursor: default;
}

/* Grade-worthy indicator in lot rows */
.grade-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0;
  cursor: default;
}

/* ── Lot analysis (legacy scan/text) ─────────────────── */
.lot-scan-section {
  margin-bottom: 14px;
}
.lot-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--panel);
  user-select: none;
}
.lot-drop-zone:hover,
.lot-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
}
.lot-drop-icon { font-size: 28px; margin-bottom: 6px; }
.lot-drop-label { font-size: 13px; color: var(--text); margin-bottom: 3px; }
.lot-drop-sub { font-size: 11px; color: var(--muted2); }

.lot-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 11px;
}
.lot-section-divider::before,
.lot-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.scan-summary-header {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 6px;
}
.scan-ok  { color: var(--green); }
.scan-warn { color: var(--yellow); }

.conf-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.conf-high  { background: rgba(34,197,94,0.15);  color: var(--green); }
.conf-mid   { background: rgba(245,158,11,0.15); color: var(--yellow); }
.conf-low   { background: rgba(239,68,68,0.15);  color: var(--red); }

.rarity-badge {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  background: var(--panel2);
  color: var(--muted2);
  border: 1px solid var(--border);
}

.lot-input-area {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.lot-textarea {
  flex: 1;
  height: 160px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.lot-textarea:focus { border-color: var(--accent); }
.lot-totals {
  display: flex;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
.lot-totals .trades-stat { flex: 1; }

/* ── eBay exclude field ──────────────────────────────── */
.ebay-exclude-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ebay-exclude-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ebay-exclude-input {
  flex: 1;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
}
.ebay-exclude-input:focus { border-color: var(--accent); }

/* ── Misc ────────────────────────────────────────────── */
.spinner { padding: 24px; text-align: center; color: var(--muted); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Leads tab ───────────────────────────────────────── */
.leads-new-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* nav badge (tiny dot on sidebar button) */
.nav-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 8px;
  margin-left: 5px;
  line-height: 16px;
  vertical-align: middle;
}

.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.leads-filter-group {
  display: flex;
  gap: 4px;
}

.leads-filter-btn {
  background: var(--panel);
  border: 1px solid var(--border2);
  color: var(--muted2);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.leads-filter-btn:hover { color: var(--text); border-color: var(--muted); }
.leads-filter-btn.active {
  background: var(--panel2);
  color: var(--text);
  border-color: var(--accent);
  font-weight: 600;
}

.leads-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leads-scan-status {
  font-size: 11px;
  color: var(--muted2);
}

/* Card grid */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.lead-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s;
}
.lead-card:hover { border-color: var(--border2); }

.lead-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: var(--panel2);
}
.lead-thumb-empty {
  height: 80px;
  background: var(--panel2);
}

.lead-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.lead-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.lead-source-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--panel2);
  color: var(--muted2);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border2);
}

.lead-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.lead-date {
  font-size: 11px;
  color: var(--yellow);
  margin-left: auto;
}

.lead-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}
.lead-title:hover { color: var(--accent); text-decoration: underline; }

.lead-location {
  font-size: 11px;
  color: var(--muted2);
}

.lead-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.lead-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}

.lead-status-select {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 6px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}
.lead-status-select:focus { border-color: var(--accent); }

.lead-notes-input {
  flex: 1;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
  min-width: 0;
}
.lead-notes-input:focus { border-color: var(--accent); }
.lead-notes-input::placeholder { color: var(--muted); }

/* ── Scraper log panel ───────────────────────────────── */
.log-panel {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.log-panel-toggle {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.3px;
}
.log-panel-toggle:hover { color: var(--text); }

.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
}

.log-session-select {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 7px;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}
.log-session-select:focus { border-color: var(--accent); }

.log-file-hint {
  font-size: 11px;
  color: var(--muted);
}

.log-output {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.55;
  color: #b0b0b0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow-y: auto;
  /* newest lines at top of scroll = scroll to bottom */
}

/* ── DDTG inner tabs ─────────────────────────────────────── */
.ddtg-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ddtg-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

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

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

.ddtg-panel { display: none; }
.ddtg-panel.active { display: block; }

/* ── Price Movement mode toggle ──────────────────────────── */
.pm-mode-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.pm-mode {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pm-mode:hover { color: var(--text); border-color: var(--muted); }
.pm-mode.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── TAG vs PSA table extras ─────────────────────────────── */
.tag-premium-high  { color: #22c55e; font-weight: 600; }
.tag-premium-mid   { color: #f59e0b; }
.tag-premium-low   { color: var(--muted); }

/* ── Portfolio group tabs ────────────────────────────────── */
.portfolio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1rem;
}

.portfolio-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.portfolio-tab:hover {
  background: var(--panel2);
  color: var(--text);
  border-color: var(--border2);
}

.portfolio-tab--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.portfolio-tab--active:hover {
  background: var(--accent-d);
  border-color: var(--accent-d);
  color: #fff;
}

.portfolio-tab-del {
  background: none;
  border: none;
  color: inherit;
  font-size: 10px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: 0.6;
}
.portfolio-tab-del:hover { opacity: 1; }

.portfolio-tab-add {
  border-style: dashed;
}

/* positive/negative for portfolio gain/loss */
.positive { color: var(--green); }
.negative { color: var(--red); }

/* ── Mobile + tablet responsive (≤1024px) ───────────────── */
@media (max-width: 1024px) {

  /* Mobile: allow body to scroll so address bar collapse reveals content */
  body {
    overflow-y: auto;
  }

  /* Stack layout vertically — sidebar becomes top nav (below settings bar) */
  .layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
  }

  .layout > .sidebar {
    order: 1;
    flex-shrink: 0;
  }

  .layout > .content {
    order: 2;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .layout > .detail-panel {
    order: 3;
  }

  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 0 10px;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    z-index: 110;
  }

  .sidebar-logo {
    display: none; /* Hide logo in bottom nav to save space */
  }

  .nav-btn {
    font-size: 11px;
    padding: 0 14px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: none !important;
    position: relative;
  }
  
  .nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
  }

  /* Hide detail panel by default on mobile; show as overlay when active */
  .detail-panel {
    display: none;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 200;
    overflow-y: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .detail-panel.mobile-open {
    display: block;
  }

  /* Close button for mobile detail panel */
  .mobile-close-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: var(--panel);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .mobile-close-btn:hover { background: var(--panel2); }

  /* Full-width content */
  .content {
    padding: 12px 12px 24px 12px;
  }

  /* Card grid: 2 cols on mobile */
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 7px;
  }

  /* Leads grid: single column */
  .leads-grid {
    grid-template-columns: 1fr;
  }

  /* Search input bigger tap target */
  #search-input {
    font-size: 16px; /* prevents iOS zoom */
    padding: 11px 14px;
  }

  /* Filter bars wrap */
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Analysis tables: allow horizontal scroll */
  .analysis-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Lot actions wrap tighter */
  .lot-actions-row {
    gap: 6px;
  }
  .lot-save-input { width: 110px; }

  /* Topbar: tighten up */
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .logo { letter-spacing: 2px; }
  .search-bar {
    align-items: stretch;
  }
  .search-variants-toggle {
    order: 2;
  }
  .search-lang-select {
    order: 3;
  }
  #search-input {
    order: 1;
    width: 100%;
  }

  /* Log output shorter on mobile */
  .log-output { max-height: 250px; }
}

@media (max-width: 1024px) {
  /* Drop indicators flip sides on the horizontal bottom bar */
  .nav-btn.drag-over-before { box-shadow: -2px 0 0 var(--accent); }
  .nav-btn.drag-over-after  { box-shadow:  2px 0 0 var(--accent); }
}

@media (max-width: 480px) {
  /* Hide updater status bar on very small screens — saves valuable topbar space */
  .updater-status { display: none; }

  /* Tighter topbar on very small screens */
  .topbar {
    padding: 6px 10px;
    gap: 6px;
  }

  /* Smaller admin links and status on very small screens */
  .topbar-admin-link { font-size: 0.7rem; padding: 2px 6px; }
  .topbar-user { font-size: 0.7rem; }

  /* Single column dashboard cards at very small widths */
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-btn { font-size: 10px; padding: 6px 7px; }
  .search-variants-toggle,
  .search-lang-select {
    width: 100%;
  }
  .view-header-row > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* ── Offer History tab ───────────────────────────────── */
.offer-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.offer-pending   { background: rgba(245,158,11,0.15); color: var(--yellow); }
.offer-won       { background: rgba(34,197,94,0.15);  color: var(--green);  }
.offer-lost      { background: rgba(239,68,68,0.15);  color: var(--red);    }
.offer-countered { background: rgba(99,102,241,0.15); color: var(--accent); }

.offer-form {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.offer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.offer-input {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 9px;
  outline: none;
  width: 100%;
}
.offer-input:focus { border-color: var(--accent); }
.offer-input::placeholder { color: var(--muted); }

/* ── Bulk import modal ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 20px;
  width: 480px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
}

.bulk-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
}
.bulk-textarea:focus { border-color: var(--accent); }
.bulk-textarea::placeholder { color: var(--muted); }

.modal-actions {
  display: flex;
  gap: 8px;
}

/* ── Copy button ─────────────────────────────────────────── */
.copy-btn {
  font-size: 14px;
  padding: 2px 7px;
  flex-shrink: 0;
  opacity: 0.6;
}
.copy-btn:hover { opacity: 1; }

/* ── Detail panel link buttons ───────────────────────────── */
.detail-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border2);
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.detail-link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Paid gate banner ─────────────────────────────────────────────────────── */
.paid-gate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--text);
}

/* ── Hunting grid ─────────────────────────────────────────────────────────── */
.hunting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  padding: 4px 0;
}
.hunting-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-align: center;
}
.hunting-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.hunting-card-img {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 2.5/3.5;
  object-fit: contain;
  background: var(--panel2);
}
.hunting-card-name {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hunting-card-set  { font-size: 10px; color: var(--muted); }
.hunting-card-price { font-size: 11px; color: var(--green); margin-top: 2px; font-weight: 600; }

/* ── Camera Scanner ───────────────────────────────────────────────────────── */
.scanner-layout { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.scanner-camera-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.scanner-video  { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-canvas { display: none; }
.scanner-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.scanner-frame {
  width: 55%; aspect-ratio: 2.5/3.5;
  border: 2px solid rgba(99,102,241,0.7);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
}
.scanner-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.scanner-result {
  width: 100%; max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.scanner-match { color: var(--green); }

@media (max-width: 600px) {
  .hunting-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .scanner-camera-box { max-width: 100%; }
}

/* ── Arbiter multi-page additions ──────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 4px 0;
}
.card-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card-tile:hover { border-color: var(--accent); background: var(--panel2); }
.card-tile img { width: 100%; display: block; }
.card-tile-info { padding: 6px 8px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card-tile-name { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile-meta { font-size: 0.7rem; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile-price { font-size: 0.75rem; color: var(--green); font-weight: 600; margin-top: 2px; }

.browse-count { font-size: 0.75rem; color: var(--muted); margin-left: auto; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--muted2);
  cursor: pointer;
  user-select: none;
}
.toggle-label input[type=checkbox] { accent-color: var(--accent); cursor: pointer; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.filters select, .filters input[type=text], .filters input[type=number] {
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-family: inherit;
}
.filters select:focus, .filters input:focus {
  outline: none;
  border-color: var(--accent);
}

.flash { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 0.82rem; }
.flash-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.flash-success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.flash-info    { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }

/* ── Arbiter multi-page additions ──────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 4px 0;
}
.card-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card-tile:hover { border-color: var(--accent); background: var(--panel2); }
.card-tile img { width: 100%; display: block; }
.card-tile-info { padding: 6px 8px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card-tile-name { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile-meta { font-size: 0.7rem; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile-price { font-size: 0.75rem; color: var(--green); font-weight: 600; margin-top: 2px; }
.browse-count { font-size: 0.75rem; color: var(--muted); margin-left: auto; }
.toggle-label { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--muted2); cursor: pointer; user-select: none; }
.toggle-label input[type=checkbox] { accent-color: var(--accent); cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input[type=text], .filters input[type=number] { background: var(--panel2); border: 1px solid var(--border2); color: var(--text); border-radius: 5px; padding: 4px 8px; font-size: 0.78rem; font-family: inherit; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); }
.flash { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 0.82rem; }
.flash-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.flash-success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.flash-info    { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }

/* ── Auth + card-bg compatibility ─────────────────────── */
:root { --card-bg: var(--panel); }
.auth-card {
  max-width: 400px;
  margin: 60px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
}
.auth-card h2 { margin-bottom: 20px; font-size: 1.2rem; color: var(--text); }
.auth-card label { display: block; font-size: 0.8rem; color: var(--muted2); margin-bottom: 4px; margin-top: 14px; }
.auth-card input[type=text],
.auth-card input[type=email],
.auth-card input[type=password] {
  width: 100%; padding: 8px 10px;
  background: var(--panel2); border: 1px solid var(--border2);
  color: var(--text); border-radius: 6px; font-size: 0.85rem;
  font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-card .btn { margin-top: 18px; width: 100%; }
.auth-card .auth-links { margin-top: 14px; font-size: 0.78rem; color: var(--muted2); text-align: center; }
.auth-card .auth-links a { color: var(--accent); text-decoration: none; }

/* ── Watchlist / Alerts / Hunting tables ───────────────── */
.watchlist-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.watchlist-table th { text-align: left; padding: 6px 10px; color: var(--muted2); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.watchlist-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.watchlist-table tr:hover td { background: var(--panel2); }
.wl-price  { color: var(--green); font-weight: 600; }
.wl-set    { color: var(--muted2); font-size: 0.75rem; }
.wl-alert  { color: var(--yellow); font-size: 0.75rem; }

.alert-input { background: var(--panel2); border: 1px solid var(--border2); color: var(--text); border-radius: 5px; padding: 4px 8px; font-size: 0.78rem; font-family: inherit; width: 90px; }
.alert-input:focus { outline: none; border-color: var(--accent); }
.alert-inputs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert-inputs-row { display: flex; gap: 6px; align-items: center; }
.alert-input-label { font-size: 0.72rem; color: var(--muted2); }
.alert-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.alert-dot.active { background: var(--green); }
.alert-low  { color: var(--red);    font-size: 0.75rem; }
.alert-high { color: var(--green);  font-size: 0.75rem; }

/* ── Hunting grid ─────────────────────────────────────── */
.hunting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 4px 0; }
.hunting-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: border-color 0.15s; }
.hunting-card:hover { border-color: var(--accent); }
.hunting-card-img { width: 100%; display: block; }
.hunting-card-name { font-size: 0.78rem; font-weight: 600; padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hunting-card-set  { font-size: 0.7rem; color: var(--muted2); padding: 0 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hunting-card-price { font-size: 0.75rem; color: var(--green); font-weight: 600; padding: 0 8px 8px; }

/* ── Share banner ─────────────────────────────────────── */
.share-banner { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; border-radius: 6px; padding: 8px 14px; margin-bottom: 14px; font-size: 0.82rem; }

/* ── Browse layout with sidebar ───────────────────────── */
.browse-layout { display: flex; gap: 16px; align-items: flex-start; }
.browse-main   { flex: 1; min-width: 0; }

/* ── Card Detail Sidebar ──────────────────────────────── */
.card-sidebar {
  position: fixed;
  top: var(--topbar-h);
  right: -320px;
  width: 300px;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  transition: right 0.25s ease;
  z-index: 200;
  background: var(--bg, #111);
  border-left: 1px solid var(--border);
}
.card-sidebar--open { right: 0; }
.card-sidebar-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; color: var(--muted); font-size: 13px;
}
.card-sidebar-loading {
  display: flex; align-items: center; justify-content: center; height: 200px;
}
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-sidebar-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  position: relative;
  min-width: 272px;
}
.card-sidebar-close {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 2px 5px; border-radius: 4px; line-height: 1;
}
.card-sidebar-close:hover { background: var(--panel2); color: var(--text); }
.card-sidebar-img {
  width: 100%; border-radius: 8px; display: block; margin-bottom: 6px;
}
.card-sidebar-name {
  font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; padding-right: 22px;
}
.card-sidebar-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* card-tile selected state */
.card-tile { cursor: pointer; }
.card-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* responsive: stack sidebar below on small screens */
@media (max-width: 768px) {
  .browse-layout { flex-direction: column; }
  .card-sidebar { width: 100% !important; right: -105% !important; }
  .card-sidebar--open { right: 0 !important; }
}

/* ── Scanner ─────────────────────────────────────────────── */
.scanner-wrap { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.scanner-drop {
  border: 2px dashed var(--border); border-radius: 12px;
  background: var(--panel); position: relative;
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
}
.scanner-drop.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.scanner-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--muted); padding: 2rem; text-align: center; }
.scanner-drop-inner svg { opacity: 0.5; margin-bottom: 0.25rem; }
.scanner-drop-inner p { margin: 0; font-size: 0.9rem; }
.scanner-hint { font-size: 0.78rem !important; opacity: 0.7; }
.scanner-file-label { color: var(--accent); cursor: pointer; text-decoration: underline; }
.scanner-preview { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; margin: 1rem auto; }
.scanner-loading { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); padding: 1.5rem; justify-content: center; }
.scanner-match-card { display: flex; gap: 1.25rem; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; align-items: flex-start; }
.scanner-match-img { width: 100px; border-radius: 6px; flex-shrink: 0; }
.scanner-match-info { display: flex; flex-direction: column; gap: 0.5rem; }
.scanner-match-name { font-size: 1.15rem; font-weight: 700; }
.scanner-match-meta { font-size: 0.82rem; color: var(--muted); }
.scanner-no-match { text-align: center; color: var(--muted); padding: 1rem; }
.scanner-error { color: var(--danger, #e05); }

/* ── Pagination ───────────────────────────────────────────── */
.browse-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: 1.25rem 0; grid-column: 1 / -1;
}
.pag-info { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

/* ── Hunting rework ───────────────────────────────────────── */
.hunting-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 2rem; text-align: center; color: var(--muted);
}
.hunting-empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.hunting-empty-title { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.hunting-empty-sub { font-size: 0.875rem; max-width: 360px; line-height: 1.6; }
.hunting-remove-btn { width: 100%; font-size: 11px; padding: 4px 0; }
.hunting-card { display: flex; flex-direction: column; }

/* ── QR Code ──────────────────────────────────────────────── */
.qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 1rem; width: fit-content;
}
.qr-wrap canvas { border-radius: 6px; }
.qr-url { font-size: 11px; color: var(--muted); word-break: break-all; max-width: 220px; text-align: center; }
.qr-hidden { display: none !important; }

/* ── Dashboard ────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.dash-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.dash-card--wide { grid-column: span 2; }
.dash-card--alert { border-color: var(--accent); }
.dash-card-header {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 0.25rem;
}
.dash-card-link { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 400; text-transform: none; letter-spacing: 0; }
.dash-card-link:hover { text-decoration: underline; }
.dash-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }
.dash-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 5px 0;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.dash-row:last-child { border-bottom: none; }
.dash-row:hover { background: var(--panel2); margin: 0 -1rem; padding: 5px 1rem; border-radius: 6px; }
.dash-row--alert { color: var(--accent); }
.dash-row-img { width: 36px; height: 50px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.dash-row-info { flex: 1; min-width: 0; }
.dash-row-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-meta { font-size: 11px; color: var(--muted); }
.dash-row-price { text-align: right; flex-shrink: 0; }
.dash-change { font-size: 11px; font-weight: 600; }
.dash-change--up { color: #4ade80; }
.dash-change--down { color: #f87171; }
.dash-stats-row { display: flex; gap: 1rem; padding: 0.5rem 0; }
.dash-stat { flex: 1; text-align: center; }
.dash-stat-val { font-size: 1.25rem; font-weight: 700; }
.dash-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dash-lot-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 0 0.75rem; }
.dash-hunting-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 4px 0; }
.dash-hunt-thumb img { width: 52px; border-radius: 4px; display: block; }
.dash-hunt-more {
  width: 52px; height: 72px; background: var(--panel2); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); text-decoration: none; font-weight: 600;
}
@media (max-width: 720px) { .dash-card--wide { grid-column: span 1; } }
