* { box-sizing: border-box; }
body {
  background: #0a0a0f;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 640px; margin: 0 auto; }
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-top: 4px;
}
.logo { font-size: 1.3rem; font-weight: 700; }
.logo span { color: #6366f1; }
.tagline { color: #94a3b8; font-size: 0.75rem; margin-top: 2px; }
.account-area { position: relative; }
#account-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px; font-size: 0.75rem;
  font-weight: 500; background: rgba(99,102,241,0.12);
  color: #6366f1; border: 1px solid rgba(99,102,241,0.25);
  cursor: pointer; white-space: nowrap;
}
#account-badge.disconnected {
  background: rgba(239,68,68,0.1); color: #ef4444;
  border-color: rgba(239,68,68,0.2); cursor: default;
}
.connected-dot { width:6px;height:6px;border-radius:50%;background:#10b981;display:inline-block;flex-shrink:0; }
.disconnected-dot { width:6px;height:6px;border-radius:50%;background:#ef4444;display:inline-block;flex-shrink:0; }
#account-badge a { color: inherit; text-decoration: none; }
#account-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  margin-top: 4px; background: #1a1a2e; border: 1px solid #2a2a3a;
  border-radius: 8px; min-width: 200px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#account-dropdown.show { display: block; }
.acct-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer; font-size: 0.85rem;
  border-bottom: 1px solid #2a2a3a; transition: background 0.1s;
}
.acct-opt:last-child { border-bottom: none; }
.acct-opt:hover { background: rgba(99,102,241,0.08); }
.acct-opt.active { color: #6366f1; font-weight: 600; }
.acct-opt .check { margin-left: auto; opacity: 0; color: #10b981; }
.acct-opt.active .check { opacity: 1; }
.acct-add {
  padding: 10px 14px; color: #94a3b8; font-size: 0.8rem;
  cursor: pointer; border-top: 1px solid #2a2a3a;
}
.acct-add:hover { color: #6366f1; }
.acct-add a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.list-card { background: #16161f; border: 1px solid #2a2a3a; border-radius: 12px; padding: 24px; }
.upload-area {
  border: 2px dashed #2a2a3a; border-radius: 10px; padding: 28px 16px;
  text-align: center; background: #12121a; cursor: pointer;
  transition: all 0.2s; margin-bottom: 16px;
}
.upload-area:hover, .upload-area.dragover { border-color: #6366f1; background: rgba(99,102,241,0.04); }
.cam-icon { width: 36px; height: 36px; margin-bottom: 6px; color: #64748b; }
#file-input { display: none; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 12px;
}
.gallery-cell {
  border-radius: 8px; overflow: hidden; aspect-ratio: 1;
  border: 1px solid #2a2a3a; background: #12121a; position: relative;
}
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-badge {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; z-index: 2;
}
.gallery-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.gallery-actions button { flex: 1; }
.type-toggle { display: flex; gap: 0; margin-bottom: 16px; }
.type-btn {
  flex: 1; padding: 10px; text-align: center; border: 1px solid #2a2a3a;
  background: #12121a; color: #94a3b8; font-size: 0.85rem;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.type-btn:first-child { border-radius: 8px 0 0 8px; }
.type-btn:last-child { border-radius: 0 8px 8px 0; }
.type-btn.active { background: #1a1a2e; color: #e2e8f0; border-color: #6366f1; }
.form-group { margin-bottom: 14px; }
label {
  display: block; margin-bottom: 4px; color: #94a3b8;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.01em;
}
input, select {
  width: 100%; padding: 10px 12px; background: #12121a;
  border: 1px solid #2a2a3a; border-radius: 6px;
  color: #e2e8f0; font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus { outline: none; border-color: #6366f1; }
.row { display: flex; gap: 10px; }
.col { flex: 1; min-width: 0; }
.cond-section { display: none; }
.cond-section.visible { display: block; }
.inline-toggle { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.inline-toggle label { margin: 0; display: inline; }
.inline-toggle input[type="checkbox"] { width: auto; accent-color: #6366f1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 20px; border: none; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s; width: 100%; margin-top: 8px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #6366f1; color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.status-msg {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px;
  font-size: 0.85rem; display: none;
}
.status-msg.error { display: block; background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.status-msg.success { display: block; background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.status-msg.info { display: block; background: rgba(99,102,241,0.1); color: #6366f1; border: 1px solid rgba(99,102,241,0.2); }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.connect-prompt { text-align: center; padding: 32px 16px; }
.connect-prompt .big-icon { font-size: 3rem; margin-bottom: 12px; }
.connect-prompt p { color: #94a3b8; font-size: 0.9rem; margin-bottom: 24px; }
.btn-ebay {
  background: #0064d2; color: white; padding: 14px 28px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 8px; text-decoration: none; font-weight: 600;
}
.btn-ebay:hover { opacity: 0.9; }
.nav-tabs { display: flex; gap: 0; margin-bottom: 16px; }
.nav-tab {
  flex: 1; padding: 10px; text-align: center; border: 1px solid #2a2a3a;
  background: #12121a; color: #94a3b8; font-size: 0.85rem;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.nav-tab:first-child { border-radius: 8px 0 0 8px; }
.nav-tab:last-child { border-radius: 0 8px 8px 0; }
.nav-tab.active { background: #1a1a2e; color: #e2e8f0; border-color: #6366f1; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* eBay scan results */
.scan-result {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; background: #12121a;
  border: 1px solid #2a2a3a; border-radius: 8px;
  cursor: pointer; transition: all 0.1s;
}
.scan-result:hover { border-color: #6366f1; }
.scan-result-img {
  width: 50px; height: 50px; object-fit: contain;
  border-radius: 4px; background: #0a0a0f; flex-shrink: 0;
}
.scan-result-placeholder {
  width: 50px; height: 50px; background: #12121a;
  border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 1.5rem;
}
.scan-result-body { flex: 1; min-width: 0; }
.scan-result-title {
  font-size: 0.82rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scan-result-condition { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
.scan-result-price {
  text-align: right; flex-shrink: 0;
}
.scan-result-price .amount { font-weight: 700; font-size: 1rem; color: #10b981; }
.scan-result-price .bids { font-size: 0.7rem; color: #f59e0b; }

/* Scan info tip box */
.scan-info { 
  margin-top: 12px; padding: 14px;
  background: #16161f; border: 1px solid #2a2a3a;
  border-radius: 10px;
}
.scan-info-title { font-size: 0.78rem; color: #64748b; margin-bottom: 6px; }
.scan-info ul { margin: 0; padding-left: 16px; font-size: 0.8rem; color: #94a3b8; }
.scan-info code { color: #6366f1; }
.scan-info-divider { margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a2a3a; }
.scan-info-hint { font-size: 0.78rem; color: #64748b; margin-bottom: 4px; }

/* Stats summary card */
.scan-stats {
  display: none; margin-top: 12px; padding: 10px;
  background: #12121a; border-radius: 8px; border: 1px solid #2a2a3a;
}
.scan-stats-header { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.scan-stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.scan-stat { }
.scan-stat-label { color: #94a3b8; font-size: 0.8rem; }
.scan-stat-value { font-weight: 600; }
.scan-stat-value.avg { color: #10b981; }
.scan-stat-value.median { color: #f59e0b; }
.scan-stat-value.range { }
