/* ═══════════════════════════════════════════════════════════
   HawkHero — Premium Design System
   Dark-first. Token-driven. Professional marketplace tool.
   ════════════════════════════════════════════════════════════ */

:root {
    /* ── Brand ──────────────────────────────────────────── */
    --color-primary:        #3b82f6;   /* electric blue */
    --color-primary-dim:    #2563eb;
    --color-primary-hover:  #1d4ed8;
    --color-primary-glow:   rgba(59, 130, 246, 0.18);
    --color-primary-subtle: rgba(59, 130, 246, 0.08);

    --color-emerald:        #10b981;
    --color-emerald-dim:    #059669;
    --color-emerald-glow:   rgba(16, 185, 129, 0.15);

    --color-gold:           #f59e0b;
    --color-gold-dim:       #d97706;
    --color-gold-glow:      rgba(245, 158, 11, 0.15);

    /* ── Surfaces (dark default) ───────────────────────── */
    --bg-base:              #060b14;
    --bg-surface:           #0d1420;
    --bg-elevated:          #131c2e;
    --bg-raised:            #1a2540;
    --bg-hover:             #1e2d4a;
    --bg-glass:             rgba(13, 20, 32, 0.7);

    /* ── Borders ───────────────────────────────────────── */
    --border:               #1e2d4a;
    --border-subtle:        #162038;
    --border-focus:         var(--color-primary);
    --border-accent:        rgba(59, 130, 246, 0.3);

    /* ── Text ──────────────────────────────────────────── */
    --text-primary:         #f0f4ff;
    --text-secondary:       #94a3b8;
    --text-muted:           #4a5568;
    --text-inverse:         #060b14;
    --text-on-accent:       #ffffff;

    /* ── Semantic ──────────────────────────────────────── */
    --color-success:        #10b981;
    --color-warning:        #f59e0b;
    --color-danger:         #ef4444;
    --color-danger-dim:     #dc2626;
    --color-danger-glow:    rgba(239, 68, 68, 0.15);
    --color-orange:         #fb923c;

    /* ── Spacing ───────────────────────────────────────── */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* ── Shape ─────────────────────────────────────────── */
    --radius-sm:    4px;
    --radius:       8px;
    --radius-md:    10px;
    --radius-lg:    14px;
    --radius-xl:    18px;
    --radius-2xl:   24px;
    --radius-full:  9999px;

    /* ── Elevation ─────────────────────────────────────── */
    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md:    0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.7);
    --shadow-xl:    0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-blue:  0 0 30px rgba(59, 130, 246, 0.2);
    --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.04);

    /* ── Gradients ─────────────────────────────────────── */
    --grad-primary:   linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --grad-emerald:   linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-gold:      linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-brand:     linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --grad-surface:   linear-gradient(180deg, #0d1420 0%, #060b14 100%);
    --grad-shine:     linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);

    /* ── Motion ────────────────────────────────────────── */
    --ease-out:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast:    120ms;
    --duration-normal:  220ms;
    --duration-slow:    400ms;

    /* ── Accessibility ─────────────────────────────────── */
    --touch-min:    44px;
    --focus-ring:   0 0 0 2px var(--bg-base), 0 0 0 4px var(--color-primary);
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg-base:              #f8fafc;
    --bg-surface:           #ffffff;
    --bg-elevated:          #f1f5f9;
    --bg-raised:            #e8eff8;
    --bg-hover:             #dde8f5;
    --bg-glass:             rgba(255, 255, 255, 0.85);

    --border:               #cbd5e1;
    --border-subtle:        #e2e8f0;
    --border-accent:        rgba(59, 130, 246, 0.25);

    --text-primary:         #0f172a;
    --text-secondary:       #475569;
    --text-muted:           #94a3b8;
    --text-inverse:         #ffffff;

    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md:    0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.10);
    --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.08);
    --shadow-blue:  0 0 30px rgba(59, 130, 246, 0.12);

    --color-primary-glow:   rgba(59, 130, 246, 0.10);
    --color-primary-subtle: rgba(59, 130, 246, 0.06);
}

/* ── x-cloak ─────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

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

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

html[data-theme="light"] {
    color-scheme: light;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Keyframes ───────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    @keyframes slideUp {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes scaleIn {
        from { opacity: 0; transform: scale(0.94); }
        to   { opacity: 1; transform: scale(1); }
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

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

    @keyframes shimmer {
        0%   { background-position: -200% center; }
        100% { background-position: 200% center; }
    }

    @keyframes glow-pulse {
        0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.15); }
        50%       { box-shadow: 0 0 40px rgba(59, 130, 246, 0.35); }
    }

    @keyframes upload-bounce {
        0%, 100% { transform: translateY(0); }
        50%       { transform: translateY(-6px); }
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════════ */

/* ── App Header ──────────────────────────────────────────── */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--bg-glass);
    animation: slideDown 0.4s var(--ease-out) both;
}

/* subtle gradient line at bottom of header */
.app-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--color-primary) 30%, var(--color-emerald) 70%, transparent 100%);
    opacity: 0.4;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-header .logo svg {
    flex-shrink: 0;
    color: var(--color-primary);
    -webkit-text-fill-color: unset;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--grad-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.25);
}

.logo-text {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-header .tagline {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: auto;
    letter-spacing: 0.01em;
}

.header-theme-btn {
    margin-left: 8px;
    flex-shrink: 0;
}

/* ── Main Container ─────────────────────────────────────── */
.main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 28px;
    animation: fadeIn 0.5s var(--ease-out) both;
}

/* ═══════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 32px;
    width: fit-content;
}

.tab-btn {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-raised);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-raised);
    box-shadow: var(--shadow-sm);
}

.tab-btn.active::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--radius-md) - 2px);
    background: var(--bg-raised);
    z-index: -1;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD ZONE
   ════════════════════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-2xl);
    padding: 64px 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--duration-normal) var(--ease-out),
                background var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

/* inner shine on hover */
.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--color-primary-subtle) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    pointer-events: none;
}

.upload-zone:hover::before,
.upload-zone.dragging::before {
    opacity: 1;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--color-primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-blue), inset 0 0 0 1px var(--border-accent);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--duration-normal) var(--ease-out);
}

.upload-zone:hover .upload-icon-wrap,
.upload-zone.dragging .upload-icon-wrap {
    background: var(--color-primary-glow);
    border-color: var(--border-accent);
    color: var(--color-primary);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.2);
}

@media (prefers-reduced-motion: no-preference) {
    .upload-zone.dragging .upload-icon-wrap {
        animation: upload-bounce 0.7s ease-in-out infinite;
    }
}

.upload-zone h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.5;
}

.upload-zone .upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.photo-preview-wrap {
    margin-top: 24px;
}

.photo-preview {
    max-width: 380px;
    max-height: 320px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    animation: scaleIn 0.35s var(--ease-spring) both;
}

.upload-file-name {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--duration-fast) var(--ease-out),
                opacity var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Primary — gradient blue CTA */
.btn-primary {
    background: var(--grad-primary);
    color: var(--text-on-accent);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0) scale(0.97); }

/* Analyze — the hero button */
.btn-analyze {
    background: var(--grad-brand);
    color: var(--text-on-accent);
    padding: 0 32px;
    min-height: 52px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.35), 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: -0.01em;
}

.btn-analyze:hover:not(:disabled) {
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.5), 0 1px 2px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-analyze:active { transform: translateY(0) scale(0.97); }

@media (prefers-reduced-motion: no-preference) {
    .btn-analyze:not(:disabled) {
        animation: glow-pulse 3s ease-in-out infinite;
    }
}

/* Emerald — save / success actions */
.btn-emerald {
    background: var(--grad-emerald);
    color: var(--text-on-accent);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

/* Secondary */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-raised);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-sm);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-accent);
    background: var(--bg-elevated);
}

/* Danger */
.btn-danger {
    background: var(--color-danger);
    color: var(--text-on-accent);
}

.btn-danger:hover:not(:disabled) {
    background: var(--color-danger-dim);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* Copy — prominent inline copy buttons */
.btn-copy {
    min-height: 34px;
    padding: 0 12px;
    background: var(--color-primary-glow);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--color-primary);
    color: var(--text-on-accent);
    border-color: var(--color-primary);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.btn-copy.copied {
    background: var(--color-emerald-glow);
    border-color: var(--color-emerald);
    color: var(--color-emerald);
}

/* Size modifiers */
.btn-sm {
    min-height: var(--touch-min);
    padding: 0 14px;
    font-size: 0.8rem;
}

.btn-icon {
    min-height: var(--touch-min);
    width: var(--touch-min);
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-raised);
    color: var(--color-primary);
    border-color: var(--border-accent);
}

/* ── Analyze Row ─────────────────────────────────────────── */
.analyze-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.analyze-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
    border-color: var(--border);
    border-top-color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════
   RESULT CARD — the showcase output
   ════════════════════════════════════════════════════════════ */
.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    animation: scaleIn 0.4s var(--ease-spring) both;
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.03);
    position: relative;
}

/* top accent bar */
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-brand);
    z-index: 1;
}

.result-photo-col {
    background: var(--bg-elevated);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 28px;
    min-height: 280px;
    border-right: 1px solid var(--border-subtle);
}

.result-photo {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: block;
}

.result-body {
    padding: 28px 28px 24px;
}

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

/* ── Generated Listing Preview ───────────────────────────── */
.listing-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-emerald-glow);
    border: 1px solid var(--color-emerald);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-emerald);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.listing-preview-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-emerald);
}

@media (prefers-reduced-motion: no-preference) {
    .listing-preview-badge .dot {
        animation: pulse 1.5s ease-in-out infinite;
    }
}

/* ═══════════════════════════════════════════════════════════
   FIELDS & INPUTS
   ════════════════════════════════════════════════════════════ */
.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    gap: 8px;
}

.field-label span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.field-value {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    font-family: inherit;
}

.field-value::placeholder {
    color: var(--text-muted);
}

.field-value:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

textarea.field-value {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Title field — slightly bigger, more prominent */
.field-title-input {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* price value display */
.price-display {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-gold);
    letter-spacing: -0.03em;
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════
   CHIPS / TAGS
   ════════════════════════════════════════════════════════════ */
.chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: text;
    min-height: 44px;
    transition: border-color var(--duration-fast);
}

.chips-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 3px 10px 3px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
    transition: border-color var(--duration-fast);
}

.chip:hover {
    border-color: var(--border-accent);
}

.chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--duration-fast), color var(--duration-fast);
}

.chip button:hover {
    background: var(--color-danger-glow);
    color: var(--color-danger);
}

.chips-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    min-width: 100px;
    flex: 1;
    font-family: inherit;
    padding: 3px 0;
}

/* ═══════════════════════════════════════════════════════════
   CONDITION SELECTOR
   ════════════════════════════════════════════════════════════ */
.condition-select {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.condition-btn {
    min-height: var(--touch-min);
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    display: inline-flex;
    align-items: center;
}

.condition-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    background: var(--bg-raised);
}

.condition-btn.selected {
    background: var(--color-primary-glow);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--border-accent);
}

/* ═══════════════════════════════════════════════════════════
   FORMAT PANEL — copy formatted listing
   ════════════════════════════════════════════════════════════ */
.format-panel {
    margin-top: 28px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 24px;
}

.format-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.format-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.format-tab {
    min-height: 38px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
}

.format-tab:hover {
    border-color: var(--border-accent);
    color: var(--text-secondary);
    background: var(--bg-raised);
}

.format-tab.active {
    background: var(--color-primary-glow);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* The formatted output box — make people want to screenshot this */
.format-output {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.65;
    max-height: 280px;
    overflow-y: auto;
    font-family: "SF Mono", "Fira Code", "JetBrains Mono", "Consolas", monospace;
    border-left: 3px solid var(--color-primary);
    position: relative;
}

.format-output-placeholder {
    color: var(--text-muted);
    font-size: 0.83rem;
    font-style: italic;
    font-family: "SF Mono", "Fira Code", monospace;
    padding: 18px 20px;
    text-align: center;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* ── Big Copy CTA ────────────────────────────────────────── */
.copy-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-top: 12px;
    transition: border-color var(--duration-fast);
}

.copy-cta:hover {
    border-color: var(--border-accent);
}

.copy-cta-info {
    flex: 1;
    min-width: 0;
}

.copy-cta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.copy-cta-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════ */
.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s var(--ease-out) both;
    pointer-events: auto;
    min-width: 220px;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}

.toast.success {
    border-color: var(--color-success);
}

.toast.success::before {
    background: var(--color-success);
}

.toast.error {
    border-color: var(--color-danger);
}

.toast.error::before {
    background: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════
   HISTORY — listing gallery
   ════════════════════════════════════════════════════════════ */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.history-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-card);
}

.history-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--shadow-blue);
}

.history-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-elevated);
    display: block;
}

.history-info {
    padding: 14px;
    border-top: 1px solid var(--border-subtle);
}

.history-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.history-price {
    color: var(--color-gold);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: -0.02em;
}

.history-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 400;
}

.history-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.history-card-wrap {
    position: relative;
}

.history-card-wrap:hover .history-delete {
    opacity: 1;
}

/* ── Bulk selection ──────────────────────────────────────── */
.history-thumb-wrap {
    position: relative;
}

.bulk-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
}

.bulk-check.checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.bulk-check svg { color: var(--text-on-accent); }

.history-card.bulk-selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow), var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════
   STATS ROW
   ════════════════════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
    animation: slideUp 0.4s var(--ease-out) both;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 22px 20px;
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-shine);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.accent {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, var(--bg-surface) 60%, var(--color-gold-glow));
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.stat-card.accent .stat-value {
    color: var(--color-gold);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   TOOLBAR / SEARCH
   ════════════════════════════════════════════════════════════ */
.history-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    flex: 1;
    min-width: 200px;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    min-height: var(--touch-min);
}

.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.search-box input::placeholder { color: var(--text-muted); }

.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-icon-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    position: relative;
}

/* glow behind empty state icon */
.empty-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-subtle) 0%, transparent 70%);
    pointer-events: none;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.empty-state-steps {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

.empty-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 140px;
}

.empty-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary-glow);
    border: 1px solid var(--border-accent);
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   ACTION ROW
   ════════════════════════════════════════════════════════════ */
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   BADGE
   ════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-cyan  {
    background: var(--color-primary-glow);
    color: var(--color-primary);
    border: 1px solid var(--border-accent);
}

.badge-gold  {
    background: var(--color-gold-glow);
    color: var(--color-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-green {
    background: var(--color-emerald-glow);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── Condition dots ──────────────────────────────────────── */
.condition-dot {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
}

.condition-dot.cond-new      { background: rgba(16,185,129,0.12);  color: var(--color-success); }
.condition-dot.cond-like-new { background: rgba(59,130,246,0.12);  color: var(--color-primary); }
.condition-dot.cond-good     { background: rgba(245,158,11,0.12);  color: var(--color-gold); }
.condition-dot.cond-fair     { background: rgba(245,158,11,0.10);  color: var(--color-orange); }
.condition-dot.cond-poor     { background: rgba(239,68,68,0.12);   color: var(--color-danger); }

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   EXTRA PHOTOS
   ════════════════════════════════════════════════════════════ */
.extra-photos-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    align-items: flex-start;
}

.extra-thumb-wrap {
    position: relative;
}

.extra-thumb {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    display: block;
}

.extra-thumb:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.extra-thumb-del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-danger);
    color: var(--text-on-accent);
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast);
}

.extra-thumb-del:hover { transform: scale(1.15); }

.add-photo-btn {
    width: 76px;
    height: 76px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    transition: all var(--duration-fast);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.add-photo-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-subtle);
}

/* ═══════════════════════════════════════════════════════════
   DETAIL FIELDS (weight / color / dimensions / model)
   ════════════════════════════════════════════════════════════ */
.detail-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detail-field {
    flex: 1;
    min-width: 110px;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS
   ════════════════════════════════════════════════════════════ */
.settings-panel {
    max-width: 680px;
    margin: 0 auto;
    animation: slideUp 0.35s var(--ease-out) both;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.settings-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.settings-section {
    margin-bottom: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.settings-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--duration-fast);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row:hover {
    background: var(--bg-elevated);
}

.setting-info { flex: 1; }

.setting-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.setting-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    min-height: var(--touch-min);
    min-width: 180px;
    cursor: pointer;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    font-family: inherit;
}

.setting-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.setting-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    min-height: var(--touch-min);
    width: 90px;
    text-align: center;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    font-family: inherit;
}

.setting-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
    display: flex;
    gap: 3px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border);
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    min-height: var(--touch-min);
}

.theme-btn.active {
    background: var(--grad-primary);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}

/* ── Platform Toggles ────────────────────────────────────── */
.platform-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
}

.platform-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast);
    user-select: none;
    min-height: var(--touch-min);
}

.platform-toggle input { display: none; }

.platform-toggle.active {
    background: var(--color-primary-glow);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ── About Card ──────────────────────────────────────────── */
.about-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
}

.about-logo {
    width: 52px;
    height: 52px;
    background: var(--grad-brand);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    object-fit: contain;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.25s var(--ease-spring) both;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE CAMERA BUTTON ROW
   ════════════════════════════════════════════════════════════ */
.upload-actions-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .main {
        padding: 20px 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }

    .app-header {
        padding: 0 calc(16px + env(safe-area-inset-left));
        padding-top: env(safe-area-inset-top);
        height: 60px;
    }

    .app-header .tagline { display: none; }

    .tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .upload-zone {
        padding: 40px 24px;
    }

    .price-row { grid-template-columns: 1fr; }

    .format-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .format-tab {
        flex-shrink: 0;
        min-height: 44px;
    }

    .btn,
    .tab-btn,
    .condition-btn { min-height: 48px; }

    .detail-field { min-width: 100px; }

    .stats-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-value { font-size: 1.3rem; }

    .history-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box { min-width: unset; }

    .toolbar-actions { justify-content: flex-end; }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .setting-select,
    .setting-input { width: 100%; min-width: unset; }

    .theme-toggle { width: 100%; }
    .theme-btn { flex: 1; justify-content: center; }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .result-photo-col { border-right: none; border-bottom: 1px solid var(--border-subtle); }

    .btn-analyze {
        width: 100%;
    }

    .empty-state-steps {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .detail-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
