/* ═══════════════════════════════════════════════
   EasyList Pro — Design System
   Linear/Vercel dark SaaS aesthetic
   Electric blue + teal accents, glassmorphism
   ═══════════════════════════════════════════════ */

:root {
    --background: hsl(225 25% 6%);
    --foreground: hsl(210 20% 95%);
    --card: hsl(225 20% 10%);
    --primary: hsl(210 100% 55%);
    --accent: hsl(170 80% 50%);
    --secondary: hsl(225 15% 15%);
    --muted: hsl(225 15% 13%);
    --muted-foreground: hsl(215 15% 55%);
    --border: hsl(225 15% 18%);
    --destructive: hsl(0 84.2% 60.2%);
    --warning: hsl(45 96% 56%);
    --success: hsl(160 84% 39%);
    --radius: 0.75rem;
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
}

/* ── Header / Nav ────────────────────────── */
header {
    position: sticky; top: 0; z-index: 100;
    background: hsl(225 25% 6% / 0.8);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid hsl(225 15% 18% / 0.5);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
}
header h1 {
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.02em;
}
header h1 .logo-text {
    background-image: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
header h1 .pro-badge {
    font-family: 'Inter', sans-serif;
    font-size: 10px; padding: 2px 7px; border-radius: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 14px; }
.credit-pill {
    display: flex; align-items: center; gap: 6px; padding: 6px 14px;
    background: var(--secondary); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.25s ease;
}
.credit-pill:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px -5px hsl(210 100% 55% / 0.2);
}
.credit-pill .credit-count {
    background-image: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 700;
}
.user-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); }
.user-info .username { color: var(--foreground); font-weight: 500; }
.btn-signout {
    background: none; border: 1px solid hsl(225 15% 18% / 0.5);
    color: var(--muted-foreground); padding: 5px 12px; border-radius: 6px;
    font-size: 12px; font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.btn-signout:hover { border-color: var(--destructive); color: var(--destructive); }

/* ── Login Page ──────────────────────────── */
.login-page {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 90vh; text-align: center; padding: 40px 24px;
    position: relative; overflow: hidden;
}
/* Radial hero glow */
.login-page::before {
    content: ''; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
    width: 140%; height: 70%;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, hsl(210 100% 55% / 0.12), transparent);
    pointer-events: none;
}
/* Grid pattern */
.login-page::after {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(hsl(225 15% 18% / 0.3) 1px, transparent 1px),
        linear-gradient(90deg, hsl(225 15% 18% / 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none; opacity: 0.4;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}
.login-page > * { position: relative; z-index: 1; }

.login-logo {
    font-size: 56px; margin-bottom: 20px;
    filter: drop-shadow(0 0 30px hsl(210 100% 55% / 0.3));
}
.login-page h2 {
    font-size: clamp(32px, 5vw, 48px); font-weight: 700;
    margin-bottom: 10px; letter-spacing: -0.03em;
}
.login-page h2 .gradient-text {
    background-image: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-page .tagline {
    color: var(--muted-foreground); font-size: 17px; margin-bottom: 48px;
    font-weight: 400; letter-spacing: -0.01em;
}
.login-features {
    display: flex; gap: 40px; margin-bottom: 48px; flex-wrap: wrap; justify-content: center;
}
.login-feature {
    text-align: center; max-width: 170px;
    padding: 24px 16px; border-radius: var(--radius);
    background: hsl(225 20% 10% / 0.6); border: 1px solid hsl(225 15% 18% / 0.5);
    backdrop-filter: blur(8px); transition: all 0.3s ease;
}
.login-feature:hover {
    border-color: hsl(225 15% 18%);
    transform: translateY(-2px);
    box-shadow: 0 0 30px -10px hsl(210 100% 55% / 0.15);
}
.login-feature .icon { font-size: 28px; margin-bottom: 10px; display: block; }
.login-feature h4 { font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.login-feature p { font-size: 13px; color: var(--muted-foreground); line-height: 1.5; }

.btn-ebay-login {
    background: linear-gradient(135deg, var(--primary), hsl(200 100% 50%));
    color: white; border: none; padding: 14px 40px;
    border-radius: var(--radius); font-size: 16px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px;
    transition: all 0.3s ease; font-family: 'Inter', sans-serif;
    box-shadow: 0 0 30px -5px hsl(210 100% 55% / 0.3);
}
.btn-ebay-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 40px -5px hsl(210 100% 55% / 0.5);
}
.btn-ebay-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.login-note {
    margin-top: 20px; font-size: 13px; color: var(--muted-foreground); max-width: 400px; line-height: 1.5;
}
.login-note strong {
    background-image: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 600;
}

/* ── Buttons ─────────────────────────────── */
.btn {
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer; font-family: 'Inter', sans-serif;
    transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), hsl(190 90% 48%));
    color: white;
    box-shadow: 0 0 20px -5px hsl(210 100% 55% / 0.25);
}
.btn-primary:hover {
    box-shadow: 0 0 30px -5px hsl(210 100% 55% / 0.4);
    transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-success {
    background: linear-gradient(135deg, var(--success), var(--accent));
    color: white;
    box-shadow: 0 0 20px -5px hsl(170 80% 50% / 0.25);
}
.btn-success:hover {
    box-shadow: 0 0 30px -5px hsl(170 80% 50% / 0.4);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent; color: var(--foreground);
    border: 1px solid hsl(225 15% 18% / 0.5);
}
.btn-outline:hover { border-color: var(--muted-foreground); }
.btn-danger {
    background: transparent; color: var(--destructive);
    border: 1px solid hsl(0 84.2% 60.2% / 0.3);
}
.btn-danger:hover { background: hsl(0 84.2% 60.2% / 0.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-ghost {
    background: transparent; color: var(--muted-foreground); border: none;
    padding: 6px 12px; font-size: 13px;
}
.btn-ghost:hover { color: var(--foreground); }

/* ── Main Container ──────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 32px; }

/* ── Dashboard Tabs ─────────────────────── */
.dashboard-tabs {
    display: flex; gap: 0; padding: 0 32px;
    border-bottom: 1px solid hsl(225 15% 18% / 0.5);
    background: hsl(225 20% 8% / 0.6);
}
.tab-btn {
    padding: 12px 22px; background: transparent; border: none;
    color: var(--muted-foreground); cursor: pointer; font-size: 14px; font-weight: 500;
    border-bottom: 2px solid transparent; transition: all 0.2s; font-family: 'Inter', sans-serif;
    display: inline-flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--foreground); }
.tab-btn.active { color: var(--foreground); border-bottom-color: var(--primary); }
.tab-count {
    font-size: 11px; font-weight: 600; min-width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--secondary); border-radius: 10px; padding: 0 6px;
    color: var(--muted-foreground);
}
.tab-count:empty { display: none; }
.tab-btn.active .tab-count { background: hsl(210 100% 55% / 0.15); color: var(--primary); }

/* ── Drafts Tab View (full-width) ──────── */
.drafts-tab-view { min-height: 50vh; }
.drafts-tab-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 20px; gap: 16px;
}
.drafts-tab-header h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* ── Steps (compact breadcrumb) ──────────── */
.steps-compact {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 20px; padding: 0 4px;
}
.step-crumb {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 500; color: var(--muted-foreground);
    transition: color 0.2s;
}
.step-crumb.active { color: var(--foreground); }
.step-crumb.done { color: var(--accent); }
.step-dot {
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; background: var(--secondary); color: var(--muted-foreground);
    transition: all 0.2s;
}
.step-crumb.active .step-dot { background: var(--primary); color: white; }
.step-crumb.done .step-dot { background: var(--accent); color: white; }
.step-sep { color: hsl(225 15% 25%); font-size: 14px; font-weight: 300; }

/* ── Drop Zone ───────────────────────────── */
.drop-zone {
    border: 2px dashed hsl(225 15% 18% / 0.7); border-radius: var(--radius);
    padding: 72px 40px; text-align: center; cursor: pointer;
    transition: all 0.3s ease; background: var(--card);
    position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: hsl(210 100% 55% / 0.04);
    box-shadow: 0 0 40px -10px hsl(210 100% 55% / 0.15);
}
.drop-zone h2 { font-size: 20px; margin-bottom: 8px; font-weight: 600; letter-spacing: -0.02em; }
.drop-zone p { color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.drop-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; display: block; }

/* ── Image Grid ──────────────────────────── */
.image-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px; margin-top: 16px;
}
.image-thumb {
    position: relative; aspect-ratio: 1; border-radius: 8px;
    overflow: hidden; border: 2px solid hsl(225 15% 18% / 0.5);
    cursor: pointer; transition: all 0.25s ease;
}
.image-thumb:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px -5px hsl(210 100% 55% / 0.2);
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-thumb .remove-btn {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
    border-radius: 50%; background: hsl(225 25% 6% / 0.8); color: white; border: none;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(4px);
}
.image-thumb:hover .remove-btn { opacity: 1; }

/* ── Upload summary (collapsed upload state) ─ */
.upload-summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px; margin-top: 16px;
    background: hsl(170 80% 50% / 0.05); border: 1px solid hsl(170 80% 50% / 0.25);
    border-radius: var(--radius);
}
.upload-summary-text { font-size: 14px; color: var(--muted-foreground); }
.upload-summary-text strong { color: var(--foreground); }

/* ── Drafts List ────────────────────────── */
.drafts-expiry-hint { font-size: 12px; color: var(--muted-foreground); opacity: 0.7; margin-top: 4px; }
.drafts-list {
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); overflow: hidden;
}
.drafts-empty {
    padding: 48px 16px; text-align: center; color: var(--muted-foreground); font-size: 14px;
    line-height: 1.6;
}
.draft-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: 1px solid hsl(225 15% 18% / 0.3);
    transition: background 0.12s; gap: 12px;
}
.draft-item:last-child { border-bottom: none; }
.draft-item:hover { background: hsl(225 15% 12% / 0.5); }
.draft-info { flex: 1; min-width: 0; }
.draft-name {
    font-size: 13px; font-weight: 500; color: var(--foreground);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.draft-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }
.draft-expiry { font-size: 10px; color: var(--muted-foreground); opacity: 0.7; }
.draft-expiry-warn { font-size: 10px; color: var(--warning); font-weight: 500; }
.draft-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Listing Cards ───────────────────────── */
.listings-section { margin-top: 32px; padding-bottom: 70px; }
.listing-card {
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); margin-bottom: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.listing-card:hover {
    border-color: hsl(225 15% 22%);
    box-shadow: 0 0 40px -15px hsl(210 100% 55% / 0.08);
}
.listing-card.has-errors { border-color: hsl(0 84.2% 60.2% / 0.5); }
.listing-card.listed { border-color: hsl(142 71% 45% / 0.5); background: hsl(142 71% 45% / 0.04); opacity: 0.85; }
.listing-card.listed .listing-header { cursor: default; }
.listing-card.listed .card-chevron { display: none; }
.listing-card.listed .listed-badge { display: inline-flex; align-items: center; gap: 4px; background: hsl(142 71% 45% / 0.15); color: hsl(142 71% 45%); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* ── Publish Complete Banner ─────────────── */
.publish-complete-banner {
    margin: 24px 0; padding: 24px; text-align: center;
    background: hsl(142 71% 45% / 0.06); border: 1px solid hsl(142 71% 45% / 0.3);
    border-radius: var(--radius); animation: fade-in 0.4s ease;
}
.publish-complete-banner h3 { margin: 0 0 6px; font-size: 18px; color: hsl(142 71% 45%); }
.publish-complete-banner p { margin: 0 0 16px; color: var(--muted-foreground); font-size: 14px; }

/* ── Card Header (always visible, clickable) */
.listing-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; cursor: pointer; user-select: none;
    transition: background 0.15s ease; gap: 12px;
}
.listing-header:hover { background: hsl(225 15% 12% / 0.6); }
.listing-num {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.card-thumb {
    width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
    border: 1px solid hsl(225 15% 18% / 0.6);
}
.header-title-text {
    font-size: 14px; font-weight: 500; color: var(--foreground);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.header-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }
.card-chevron {
    color: var(--muted-foreground); font-size: 18px; line-height: 1;
    transition: transform 0.2s ease; flex-shrink: 0; margin-left: 4px;
}
.listing-card.collapsed .card-chevron { transform: rotate(-90deg); }

/* ── Card Body (collapsible) ─────────────── */
.card-body { padding: 0 20px 20px; border-top: 1px solid hsl(225 15% 18% / 0.4); }
.listing-card.collapsed .card-body { display: none; }
.listing-body { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding-top: 20px; }
.listing-shipping { padding: 16px 0 0; border-top: 1px solid hsl(225 15% 18% / 0.25); margin-top: 12px; }
.listing-shipping .field-row { gap: 8px; }
.listing-shipping select { font-size: 12px; padding: 5px 8px; }
.listing-tweak { padding: 16px 0 0; }
.listing-tweak .field-group { margin: 0; }
.listing-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }

/* ── Image controls in listings ──────────── */
.listing-img-wrap {
    position: relative; aspect-ratio: 1; border-radius: 8px;
    overflow: hidden; border: 2px solid hsl(225 15% 18% / 0.5);
    cursor: pointer; transition: all 0.25s ease;
}
.listing-img-wrap:hover { border-color: hsl(225 15% 18%); }
.listing-img-wrap.featured {
    border-color: var(--accent);
    box-shadow: 0 0 20px -5px hsl(170 80% 50% / 0.25);
}
.listing-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.img-featured-badge {
    position: absolute; top: 4px; left: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 4px; letter-spacing: 0.5px; text-transform: uppercase;
    opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.listing-img-wrap.featured .img-featured-badge { opacity: 1; }
.img-set-featured {
    position: absolute; top: 4px; right: 4px;
    background: hsl(225 25% 6% / 0.7); color: hsl(215 15% 55%); border: none;
    width: 22px; height: 22px; border-radius: 50%; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: all 0.2s; backdrop-filter: blur(4px);
}
.listing-img-wrap:hover .img-set-featured { opacity: 1; }
.listing-img-wrap.featured .img-set-featured { opacity: 1; color: var(--accent); }
.listing-img-wrap.img-load-error { border-color: hsl(0 84% 60% / 0.4); }
.listing-img-wrap.img-load-error::after {
    content: '⚠ Image not found'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted-foreground); background: var(--muted);
    pointer-events: none;
}
.listing-img-wrap .img-move-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: hsl(225 25% 6% / 0.8);
    display: flex; align-items: center; justify-content: center;
    gap: 4px; padding: 3px 4px; opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(8px);
}
.listing-img-wrap:hover .img-move-bar { opacity: 1; }
.img-move-bar select {
    background: hsl(225 15% 15% / 0.8); color: var(--foreground);
    border: 1px solid hsl(225 15% 18% / 0.5); border-radius: 4px;
    padding: 2px 4px; font-size: 11px; font-family: inherit; outline: none; cursor: pointer; max-width: 100%;
}
.img-move-bar select option { background: var(--card); color: var(--foreground); }

/* ── Form Fields ─────────────────────────── */
.listing-fields { display: flex; flex-direction: column; gap: 12px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-group label {
    font-size: 11px; color: var(--muted-foreground); font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.field-group input, .field-group textarea, .field-group select {
    background: var(--muted); border: 1px solid hsl(225 15% 18% / 0.5); border-radius: 8px;
    padding: 9px 12px; color: var(--foreground); font-size: 14px; font-family: 'Inter', sans-serif;
    outline: none; transition: all 0.25s ease;
}
.field-group input:focus, .field-group textarea:focus, .field-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(210 100% 55% / 0.1);
}
.field-group textarea { min-height: 80px; resize: vertical; }
.desc-preview, .desc-editor {
    background: hsl(225 15% 12%);
    border: 1px solid hsl(225 15% 22%);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--foreground);
    max-height: 200px;
    overflow-y: auto;
}
.desc-editor {
    cursor: text;
    outline: none;
    min-height: 80px;
    transition: border-color 0.15s;
}
.desc-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px hsl(199 89% 48% / 0.15);
}
.desc-editor:empty::before {
    content: 'Click to edit description...';
    color: var(--muted-foreground);
    font-style: italic;
}
.desc-preview h3, .desc-editor h3 { font-size: 14px; margin: 8px 0 4px; color: var(--foreground); }
.desc-preview p, .desc-editor p { margin: 4px 0; }
.desc-preview ul, .desc-editor ul { margin: 4px 0 4px 18px; }
.desc-preview li, .desc-editor li { margin: 2px 0; }
.field-group input.field-error, .field-group select.field-error {
    border-color: var(--destructive);
    box-shadow: 0 0 0 3px hsl(0 84.2% 60.2% / 0.1);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.specifics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.specific-item { display: flex; gap: 4px; }
.specific-item input { flex: 1; padding: 6px 8px; font-size: 13px; }
.category-search { display: flex; gap: 8px; }
.category-search input { flex: 1; }
.category-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cat-chip {
    padding: 4px 10px; background: var(--secondary);
    border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.cat-chip:hover { border-color: var(--primary); color: var(--primary); }
.cat-chip.selected { border-color: var(--accent); color: var(--accent); background: hsl(170 80% 50% / 0.08); }

/* ── Price Panel ─────────────────────────── */
.price-panel {
    background: var(--muted); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: 8px; padding: 14px; margin-top: 10px;
}
.price-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.price-panel-rate-limit { text-align: center; padding: 24px 16px; border-color: hsl(38 80% 40% / 0.4); background: hsl(38 60% 20% / 0.15); }
.price-panel-header h4 { font-size: 13px; color: var(--muted-foreground); }
.price-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.price-stat {
    text-align: center; padding: 10px; border-radius: 8px;
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
}
.price-stat .label { font-size: 10px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.08em; }
.price-stat .value { font-size: 16px; font-weight: 600; margin-top: 2px; font-family: 'Space Grotesk', sans-serif; }
.price-stat .value.highlight { color: var(--accent); }
.price-stat .value.accent { color: var(--primary); }
.use-price-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; border: none; padding: 4px 10px;
    border-radius: 4px; font-size: 11px; cursor: pointer; margin-top: 4px; font-family: inherit;
}
.sold-items-list { max-height: 180px; overflow-y: auto; }
.sold-items-list::-webkit-scrollbar { width: 4px; }
.sold-items-list::-webkit-scrollbar-track { background: transparent; }
.sold-items-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sold-item {
    display: flex; align-items: center; gap: 10px; padding: 6px 0;
    border-bottom: 1px solid hsl(225 15% 18% / 0.3); font-size: 13px;
}
.sold-item:last-child { border-bottom: none; }
.sold-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.sold-item .sold-title { flex: 1; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sold-item .sold-price { font-weight: 600; color: var(--accent); white-space: nowrap; font-family: 'Space Grotesk', sans-serif; }
.sold-item a { color: var(--primary); text-decoration: none; font-size: 12px; }
.sold-item a:hover { text-decoration: underline; }

/* ── Toolbar Summary Bar ────────────────── */
.toolbar-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; margin-bottom: 10px;
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); gap: 12px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-divider { width: 1px; height: 18px; background: hsl(225 15% 18% / 0.6); }
.toolbar-info { font-size: 12px; color: var(--muted-foreground); }

/* ── Settings Drawer ────────────────────── */
.settings-drawer {
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
    animation: drawer-open 0.2s ease;
}
@keyframes drawer-open { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 400px; } }
.settings-drawer-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.drawer-section { padding: 16px 20px; }
.drawer-section:first-child { border-right: 1px solid hsl(225 15% 18% / 0.4); }
.drawer-section-title {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--muted-foreground); margin-bottom: 10px;
}
.drawer-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.drawer-row:last-child { margin-bottom: 0; }
.drawer-row label { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; min-width: 70px; }
.drawer-row select, .drawer-row input {
    background: var(--muted); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: 8px; padding: 6px 10px; color: var(--foreground);
    font-size: 13px; font-family: 'Inter', sans-serif; outline: none; flex: 1;
}
.drawer-row select:focus, .drawer-row input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px hsl(210 100% 55% / 0.1);
}
.drawer-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 8px 16px; border-top: 1px solid hsl(225 15% 18% / 0.4);
    background: hsl(225 15% 8%);
}

/* ── Sticky Bottom Action Bar ───────────── */
.sticky-actions {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: hsl(225 25% 6% / 0.9);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-top: 1px solid hsl(225 15% 18% / 0.5);
    padding: 10px 0;
    animation: slide-up 0.25s ease;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sticky-actions-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between;
}
.sticky-count { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.sticky-buttons { display: flex; gap: 8px; align-items: center; }

/* ── Card overflow menu ─────────────────── */
.card-menu-wrap { position: relative; }
.card-menu-btn {
    background: none; border: 1px solid transparent; border-radius: 6px;
    color: var(--muted-foreground); font-size: 18px; line-height: 1;
    padding: 2px 8px; cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.card-menu-btn:hover { color: var(--foreground); border-color: hsl(225 15% 18% / 0.5); }
.card-menu-dropdown {
    position: absolute; top: 100%; right: 0; z-index: 50;
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.6);
    border-radius: 8px; min-width: 160px; padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: menu-appear 0.12s ease;
}
@keyframes menu-appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.card-menu-dropdown button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: none; border: none; padding: 8px 12px; border-radius: 6px;
    font-size: 13px; color: var(--foreground); cursor: pointer;
    font-family: inherit; transition: background 0.12s;
}
.card-menu-dropdown button:hover { background: hsl(225 15% 15%); }
.card-menu-dropdown .menu-danger { color: var(--destructive); }
.card-menu-dropdown .menu-danger:hover { background: hsl(0 84% 60% / 0.08); }

/* legacy compat */
.policy-tag {
    font-size: 11px; padding: 3px 10px; border-radius: 20px;
    background: hsl(210 100% 55% / 0.08); color: var(--primary);
    border: 1px solid hsl(210 100% 55% / 0.15);
}

/* ── Progress Modal ──────────────────────── */
.spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid hsl(210 100% 55% / 0.2); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-overlay {
    position: fixed; inset: 0; background: hsl(225 25% 6% / 0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; backdrop-filter: blur(8px);
}
.progress-box {
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); padding: 32px 40px; min-width: 420px; max-width: 560px;
    box-shadow: 0 0 60px -15px hsl(210 100% 55% / 0.15);
}
.progress-box h3 { font-size: 17px; margin-bottom: 20px; letter-spacing: -0.02em; }
.progress-steps { display: flex; flex-direction: column; gap: 10px; }
.progress-step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted-foreground); transition: color 0.2s; }
.progress-step.active { color: var(--foreground); }
.progress-step.done { color: var(--accent); }
.progress-step.error { color: var(--destructive); }
.progress-step-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.progress-step-detail { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.progress-step.done .progress-step-detail { color: var(--accent); font-weight: 500; }
.progress-bar-container { width: 100%; height: 4px; background: var(--muted); border-radius: 2px; margin-top: 16px; overflow: hidden; }
.progress-bar-fill {
    height: 100%; border-radius: 2px; transition: width 0.3s ease;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.progress-bar-fill.success { background: var(--accent); }
.progress-bar-fill.error { background: var(--destructive); }
.progress-pct { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; text-align: right; }

/* ── Publish Result ──────────────────────── */
.publish-result { padding: 12px 16px; border-radius: 8px; margin-top: 12px; font-size: 14px; }
.publish-result.success {
    background: hsl(170 80% 50% / 0.06); border: 1px solid hsl(170 80% 50% / 0.2);
    color: var(--accent);
}
.publish-result.error {
    background: hsl(0 84.2% 60.2% / 0.06); border: 1px solid hsl(0 84.2% 60.2% / 0.2);
    color: var(--destructive);
}
.publish-result a { color: var(--primary); text-decoration: none; }
.publish-result a:hover { text-decoration: underline; }
.publish-warnings {
    margin-top: 8px; padding: 8px 12px;
    background: hsl(45 96% 56% / 0.06); border: 1px solid hsl(45 96% 56% / 0.15);
    border-radius: 6px; color: var(--warning); font-size: 12px;
}
.publish-warnings summary { cursor: pointer; font-weight: 500; }
.publish-warnings ul { margin: 6px 0 0 16px; list-style: disc; }

/* ── Validation ──────────────────────────── */
.validation-alert {
    background: hsl(0 84.2% 60.2% / 0.06); border: 1px solid hsl(0 84.2% 60.2% / 0.15);
    border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: 13px;
}
.validation-alert .val-title { color: var(--destructive); font-weight: 600; margin-bottom: 6px; }
.validation-alert ul { list-style: none; padding: 0; }
.validation-alert li { color: var(--muted-foreground); padding: 2px 0; }
.validation-alert li::before { content: "\26A0\FE0F "; }

/* ── Credit Store Modal ──────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: hsl(225 25% 6% / 0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1001; backdrop-filter: blur(8px);
    padding: 24px; overflow-y: auto;
}
.modal-box {
    background: var(--card); border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); padding: 32px; max-width: 520px; width: 100%;
    box-shadow: 0 0 60px -15px hsl(210 100% 55% / 0.15);
    margin: auto;
}
.modal-box h3 { font-size: 20px; margin-bottom: 6px; letter-spacing: -0.02em; }
.modal-box .modal-subtitle { color: var(--muted-foreground); font-size: 14px; margin-bottom: 24px; }
.credit-packs { display: flex; flex-direction: column; gap: 12px; }
.credit-pack {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--muted);
    border: 1px solid hsl(225 15% 18% / 0.5);
    border-radius: var(--radius); cursor: pointer; transition: all 0.3s ease;
}
.credit-pack:hover {
    border-color: hsl(210 100% 55% / 0.4);
    box-shadow: 0 0 20px -5px hsl(210 100% 55% / 0.2);
    transform: translateY(-1px);
}
.credit-pack .pack-info h4 { font-size: 16px; margin-bottom: 2px; }
.credit-pack .pack-info p { font-size: 12px; color: var(--muted-foreground); }
.credit-pack .pack-price {
    font-size: 22px; font-weight: 700; font-family: 'Space Grotesk', sans-serif;
    background-image: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.credit-pack .per-credit { font-size: 11px; color: var(--muted-foreground); display: block; text-align: right; }
.modal-close {
    display: block; width: 100%; margin-top: 16px; padding: 10px;
    background: none; border: 1px solid hsl(225 15% 18% / 0.5); border-radius: 8px;
    color: var(--muted-foreground); font-size: 14px; font-family: 'Inter', sans-serif;
    cursor: pointer; text-align: center; transition: all 0.2s;
}
.modal-close:hover { border-color: var(--muted-foreground); color: var(--foreground); }

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(225 15% 18%); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(225 15% 25%); }

/* ── Utilities ───────────────────────────── */
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }
.text-dim { color: var(--muted-foreground); }
.text-sm { font-size: 13px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.actions { display: flex; gap: 12px; margin-top: 24px; align-items: center; }

/* ── Insufficient credits banner ─────────── */
.credits-warning {
    background: hsl(45 96% 56% / 0.06); border: 1px solid hsl(45 96% 56% / 0.15);
    border-radius: 8px; padding: 14px 20px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.credits-warning p { color: var(--warning); font-size: 14px; }

/* ── Account Page ────────────────────────── */
.account-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
}
.account-header h2 {
    font-family: var(--font-heading); font-size: 1.5em; color: var(--foreground);
}
.account-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.account-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 24px;
}
.account-card h3 {
    font-family: var(--font-heading); font-size: 1em; color: var(--foreground);
    margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.account-field {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid hsl(225 15% 15%);
}
.account-field:last-child { border-bottom: none; }
.account-label { color: var(--muted-foreground); font-size: 13px; }
.account-value { color: var(--foreground); font-size: 14px; font-weight: 500; }
.account-value-sm { font-size: 11px; font-family: monospace; opacity: 0.7; }
.credit-balance-large {
    font-family: var(--font-heading); font-size: 3em; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), hsl(190 90% 48%));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1.1;
}
.pricing-table { display: flex; flex-direction: column; gap: 8px; }
.pricing-row {
    display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
    padding: 10px 12px; background: hsl(225 15% 12%); border-radius: 8px; font-size: 14px;
}
.pricing-row span:nth-child(2) { font-weight: 600; color: var(--foreground); }
.account-footer {
    margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
    display: flex; gap: 12px; justify-content: center; font-size: 13px;
}
.account-footer a { color: var(--muted-foreground); text-decoration: none; }
.account-footer a:hover { color: var(--primary); }

/* ── Low credit warning ──────────────────── */
.credit-pill.credit-low { border-color: var(--warning) !important; }
.credit-pill.credit-low .credit-count { background-image: none !important; color: var(--warning) !important; -webkit-text-fill-color: var(--warning) !important; }
.credit-pill.credit-critical { border-color: var(--destructive) !important; animation: pulse-danger 1.5s ease-in-out infinite; }
.credit-pill.credit-critical .credit-count { background-image: none !important; color: var(--destructive) !important; -webkit-text-fill-color: var(--destructive) !important; }
@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 hsl(0 84% 60% / 0); }
    50% { box-shadow: 0 0 0 5px hsl(0 84% 60% / 0.18); }
}

/* ── Lightbox ────────────────────────────── */
.lightbox {
    position: fixed; inset: 0; background: hsl(225 25% 4% / 0.92);
    backdrop-filter: blur(12px); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out; animation: fade-in 0.15s ease;
}
.lightbox img {
    max-width: 92vw; max-height: 92vh; border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6); object-fit: contain;
    pointer-events: none;
}
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: hsl(225 20% 14% / 0.8); border: 1px solid var(--border);
    color: var(--foreground); font-size: 22px; line-height: 1;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.lightbox-close:hover { background: var(--destructive); border-color: var(--destructive); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.listing-img-wrap img { cursor: zoom-in; }

/* ── Draft restore banner ────────────────── */
.draft-banner {
    background: hsl(210 100% 55% / 0.07); border-bottom: 1px solid hsl(210 100% 55% / 0.2);
    padding: 10px 28px; display: flex; align-items: center; justify-content: space-between;
    gap: 16px; font-size: 13px; color: var(--primary);
}

/* ── Toast notifications ─────────────────── */
.toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 22px; font-size: 13px; font-weight: 500; color: var(--foreground);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35); z-index: 9999;
    transition: all 0.25s ease; opacity: 0; pointer-events: none;
    white-space: nowrap;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-success { border-color: hsl(170 80% 50% / 0.5); color: var(--accent); }
.toast.toast-error { border-color: hsl(0 84% 60% / 0.5); color: var(--destructive); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
    .listing-body { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .price-stats { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 16px; }
    .login-features { flex-direction: column; align-items: center; }
    .settings-drawer-grid { grid-template-columns: 1fr; }
    .drawer-section:first-child { border-right: none; border-bottom: 1px solid hsl(225 15% 18% / 0.4); }
    .account-grid { grid-template-columns: 1fr; }
    .header-title-text { max-width: 160px; }
    .card-thumb { display: none; }
    .sticky-actions-inner { padding: 0 16px; }
    .sticky-buttons { flex-wrap: wrap; gap: 6px; }
    .dashboard-tabs { padding: 0 16px; }
    .tab-btn { padding: 10px 16px; font-size: 13px; }
}

/* Image delete button */
.img-delete-btn {
    position: absolute;
    top: 28px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: hsl(0 70% 45%);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.listing-img-wrap:hover .img-delete-btn { opacity: 1; }
.img-delete-btn:hover { background: hsl(0 80% 55%); }

/* Listing type & schedule badges */
.listing-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.lt-chinese { background: hsl(210 60% 20%); color: hsl(210 100% 70%); }
.lt-fixedpriceitem { background: hsl(170 40% 18%); color: hsl(170 80% 60%); }
.lt-chinesewithbin { background: hsl(280 40% 20%); color: hsl(280 80% 70%); }
.schedule-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: hsl(40 60% 18%);
    color: hsl(40 90% 65%);
    vertical-align: middle;
}
