
        :root {
            --surface: #ffffff;
            --surface-hover: #f8fafc;
            --border: rgba(0, 0, 0, 0.08);
            --border-hover: rgba(0, 0, 0, 0.12);
            --text-primary: var(--throne-text-primary);
            --text-secondary: var(--throne-text-secondary);
            --text-muted: #94a3b8;
            --accent: var(--throne-sidebar-bg);
            --accent-gradient: linear-gradient(135deg, var(--throne-sidebar-bg) 0%, var(--throne-accent-blue) 100%);
            --radius: 16px;
            --radius-sm: 10px;
            --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
            --bg-card: #ffffff;
            --bg-input: #f8fafc;
            --bg-hover: #f1f5f9;
            --bg: var(--bg-input);
            --text: var(--text-primary);
            --border-focus: var(--throne-accent-blue);
            --green: #10b981;
            --red: #ef4444;
            --yellow: #f59e0b;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: var(--throne-font);
            background: var(--throne-body-gradient);
            color: var(--text-primary);
            min-height: 100vh;
        }
        body.listing-page .throne-main {
            padding: 0.5rem clamp(0.625rem, 1vw, 1rem) 0 !important;
        }
        body.listing-view-list .throne-main {
            min-height: 100vh;
        }


        /* ─── Topbar ─────────────────────────────────── */
        .topbar {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0.5rem 2rem; background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(12px);
            border: 1px solid var(--border);
            border-radius: 99px;
            margin: 0 24px 0 24px;
            position: sticky; top: 0; z-index: 100;
        }
        .topbar-left { display: flex; align-items: center; gap: 2rem; }
        .topbar-logo {
            font-size: 1.1rem; font-weight: 800; color: var(--accent);
            text-decoration: none; letter-spacing: -0.02em;
            display: flex; align-items: center; gap: 0.5rem;
        }
        .topbar-nav { display: flex; gap: 0.25rem; }
        .topbar-nav a {
            padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
            color: var(--text-secondary); text-decoration: none; transition: all 0.2s;
        }
        .topbar-nav a:hover { color: var(--accent); background: rgba(3, 83, 164, 0.05); }
        .topbar-nav a.active { color: #fff; background: var(--accent-gradient); box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2); }
        .topbar .topbar-right {
            display: flex;
            align-items: center;
            align-content: center;
            gap: 0.42rem 0.82rem;
            flex: 0 1 1500px;
            width: 100%;
            max-width: 1500px;
            min-width: 0;
            flex-wrap: wrap;
            justify-content: center;
            margin: 0 auto;
        }
        .topbar.listing-topbar {
            justify-content: stretch;
            min-height: 48px;
            margin: 8px 8px 0;
            padding: 6px 10px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.92);
            border-color: rgba(148, 163, 184, 0.24);
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
        }
        .topbar.listing-topbar .topbar-right {
            justify-content: flex-start;
            align-items: flex-start;
            gap: 8px 6px;
            flex-wrap: wrap;
            max-width: none;
        }
        .topbar-stats-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.48rem;
            flex: 0 0 auto;
            flex-wrap: nowrap;
            min-width: 0;
            max-width: 100%;
            min-height: 32px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            line-height: 1;
            margin-left: auto;
            white-space: nowrap;
        }
        .topbar-stat { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
        .topbar-stat strong { color: #10b981; font-weight: 800; }
        .topbar-stat-divider {
            color: var(--text-muted);
            font-size: 0.72rem;
            line-height: 1;
        }
        .topbar-stat[hidden],
        .topbar-stat-divider[hidden] { display: none !important; }
        .topbar-batch-chip {
            display: inline-flex;
            align-items: center;
            align-content: flex-start;
            gap: 7px;
            flex: 0 1 auto;
            flex-wrap: nowrap;
            min-width: 0;
            width: auto;
            max-width: 100%;
            min-height: 36px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            color: var(--text-secondary);
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1;
        }
        .topbar-batch-chip[hidden] { display: none !important; }
        .topbar-field-kicker {
            align-items: center;
            align-self: stretch;
            background: rgba(3, 83, 164, 0.08);
            border-right: 1px solid rgba(148, 163, 184, 0.18);
            color: var(--accent);
            display: inline-flex;
            font-size: 0.64rem;
            font-weight: 900;
            letter-spacing: 0.07em;
            padding: 0 12px;
            text-transform: uppercase;
            white-space: nowrap;
        }
        .topbar-batch-main {
            display: flex;
            align-items: center;
            gap: 7px;
            flex: 0 1 auto;
            min-width: 0;
            max-width: clamp(120px, 22vw, 280px);
            overflow: hidden;
        }
        .topbar-batch-name {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--text-primary);
            font-size: 0.78rem;
            font-weight: 850;
        }
        .topbar-batch-field {
            display: inline-flex;
            align-items: center;
            gap: 0;
            flex: 0 1 auto;
            min-width: 0;
            height: 36px;
            padding: 0;
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 8px;
            background: #ffffff;
            color: var(--text-muted);
            font-size: 0.62rem;
            font-weight: 900;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            white-space: nowrap;
            overflow: hidden;
        }
        .topbar-batch-field input[type="text"] {
            height: 34px;
            min-width: 0;
            padding: 0 10px;
            border: 0;
            outline: none;
            background: transparent;
            color: var(--text-primary);
            font: inherit;
            font-size: 0.72rem;
            font-weight: 850;
            letter-spacing: 0;
            text-transform: none;
        }
        .topbar-batch-field input[type="text"]:focus {
            outline: none;
        }
        .topbar-batch-title-field {
            flex: 0 1 clamp(200px, 15vw, 250px);
            min-width: 200px;
            max-width: min(20vw, 270px);
        }
        .topbar-batch-title-field input {
            flex: 1 1 auto;
        }
        .topbar-sku-group {
            display: inline-flex;
            align-items: stretch;
            flex: 0 0 auto;
            min-width: 0;
            max-width: 100%;
        }
        .topbar-batch-sku-field {
            flex: 0 0 150px;
            min-width: 150px;
            border-right: 0;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }
        .topbar-batch-sku-field input {
            width: 78px;
        }
        .topbar-batch-toggle {
            flex: 0 0 auto;
            gap: 6px;
            margin-left: 0;
            padding: 0 10px;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
            cursor: pointer;
            user-select: none;
        }
        .topbar-batch-toggle input {
            width: 14px;
            height: 14px;
            margin: 0;
            accent-color: var(--accent);
            cursor: pointer;
        }
        .topbar-action-group {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            flex: 0 1 auto;
            flex-wrap: nowrap;
            min-width: 0;
            max-width: 100%;
        }
        .topbar-batch-meta {
            display: none;
            flex: 0 0 auto;
            color: var(--text-muted);
            font-size: 0.7rem;
            white-space: nowrap;
        }
        .topbar-batch-icon-button {
            flex: 0 0 34px;
            width: 34px;
            min-width: 34px;
            max-width: 34px;
            height: 34px;
            min-height: 34px;
            aspect-ratio: 1 / 1;
            box-sizing: border-box;
            padding: 0;
            border: 1px solid rgba(3, 83, 164, 0.22);
            border-radius: 8px;
            background: #ffffff;
            color: var(--accent);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .topbar-batch-icon-button:hover {
            transform: translateY(-1px);
            background: rgba(3, 83, 164, 0.08);
            border-color: rgba(3, 83, 164, 0.34);
        }
        .topbar-batch-icon-button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        .topbar-batch-icon-button svg {
            width: 16px;
            height: 16px;
            stroke: currentColor;
            flex: 0 0 auto;
        }
        .topbar-batch-icon-button.delete {
            background: #ef4444;
            border-color: #ef4444;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(239, 68, 68, 0.16);
        }
        .topbar-batch-icon-button.delete:hover {
            background: #dc2626;
            border-color: #dc2626;
            color: #ffffff;
        }
        .topbar-batch-icon-button.save {
            background: var(--accent);
            border-color: var(--accent);
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(3, 83, 164, 0.16);
        }
        .topbar-batch-icon-button.status.is-staged,
        .topbar-batch-icon-button.status.is-listed {
            background: #10b981;
            border-color: #10b981;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(16, 185, 129, 0.16);
        }
        .topbar-batch-icon-button.direct-ebay {
            background: #0f766e;
            border-color: #0f766e;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(15, 118, 110, 0.16);
        }
        .topbar-batch-icon-button.direct-ebay:hover {
            background: #0d9488;
            border-color: #0d9488;
            color: #ffffff;
        }
        .topbar-batch-icon-button.direct-ebay.direct-ebay-locked {
            background: #ffffff;
            border-color: rgba(148, 163, 184, 0.32);
            color: var(--text-muted);
            box-shadow: none;
        }
        .topbar-batch-icon-button.export {
            border-color: rgba(5, 150, 105, 0.22);
            background: #10b981;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(16, 185, 129, 0.16);
        }
        .topbar-batch-icon-button.export:hover {
            background: #059669;
            border-color: rgba(5, 150, 105, 0.34);
            box-shadow: 0 6px 14px rgba(16, 185, 129, 0.22);
        }


        /* ─── Buttons ────────────────────────────────── */
        .btn {
            padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.85rem;
            font-weight: 700; cursor: pointer; border: none; font-family: inherit;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: inline-flex; align-items: center; gap: 0.5rem;
        }
        .btn-primary { background: var(--accent-gradient); color: white; box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2); }
        .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(3, 83, 164, 0.3); }
        .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
        #listing-access-gate .gate-google-login {
            width: auto;
            min-width: 260px;
            margin: 20px auto 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0.75rem 1.25rem;
            font-size: 0.9rem;
        }
        .btn-green { background: #10b981; color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
        .btn-green:hover { background: #059669; transform: translateY(-1px); }
        .btn-danger { background: #ef4444; color: white; }
        .btn-secondary {
            background: var(--surface); color: var(--text-secondary);
            border: 1px solid var(--border); box-shadow: var(--shadow-sm);
        }
        .btn-secondary:hover { background: var(--surface-hover); transform: translateY(-1px); }

        .main { width: 100%; max-width: none; margin: 0 auto; padding: 0.35rem clamp(0.35rem, 0.7vw, 0.85rem) 0.75rem; box-sizing: border-box; }
        body.listing-view-list .throne-page-footer {
            flex: 0 0 auto;
            margin: auto auto 0;
            padding-top: 0.7rem;
            padding-bottom: 0.7rem;
        }
        body.listing-view-match {
            overflow-y: hidden;
        }
        body.listing-view-match .main {
            max-width: 2200px;
        }
        body.listing-view-match #matchView {
            --match-view-available-height: calc(100dvh - 150px);
            --match-card-width: min(clamp(340px, 23vw, 560px), max(260px, calc((var(--match-view-available-height) - 220px) * 5 / 7)));
            width: 100%;
            height: var(--match-view-available-height);
            max-width: 2200px;
            margin-left: auto;
            margin-right: auto;
            transform: none;
        }


        /* ─── Game Selector & Toolbar ────────────────── */
        .toolbar {
            display: flex; align-items: center; justify-content: space-between;
            margin: 10px 0 16px; gap: 12px; flex-wrap: wrap;
        }
        .toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .match-toolbar-workflow {
            display: none;
            align-items: center;
            justify-content: flex-end;
            gap: 14px;
            flex: 1 1 680px;
            min-width: 0;
        }
        body.listing-view-match .match-toolbar-workflow {
            display: flex;
        }
        body.listing-view-match .toolbar {
            flex-wrap: nowrap;
            padding: 5px 7px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: var(--surface);
            box-shadow: var(--shadow-sm);
        }
        body.listing-view-match .toolbar-left,
        body.listing-view-match .listing-toolbar-controls {
            flex-wrap: nowrap;
            flex: 0 0 auto;
        }
        .match-review-progress {
            display: grid;
            grid-template-columns: auto minmax(80px, 1fr) auto;
            align-items: center;
            gap: 10px;
            min-width: 180px;
            max-width: 560px;
            flex: 1 1 300px;
        }
        .match-review-progress-label,
        .match-review-progress-percent {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 800;
            white-space: nowrap;
        }
        .match-review-progress-track {
            position: relative;
            height: 7px;
            overflow: hidden;
            border-radius: 999px;
            background: var(--bg-hover);
        }
        .match-review-progress-track > span {
            display: block;
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: var(--accent-gradient);
            transition: width 0.18s ease;
        }
        .match-toolbar-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 7px;
            flex: 0 0 auto;
            min-width: 0;
        }
        .match-toolbar-divider {
            width: 1px;
            height: 26px;
            margin: 0 2px;
            background: var(--border);
        }
        .match-toolbar-actions .loupe-selects {
            flex: 0 0 auto;
        }
        @media (max-width: 1420px) {
            .match-review-progress-label { display: none; }
            .match-review-progress { min-width: 90px; grid-template-columns: minmax(70px, 1fr) auto; }
        }
        @media (max-width: 1120px) {
            body.listing-view-match .toolbar { flex-wrap: wrap; }
            .match-toolbar-workflow { flex-basis: 100%; justify-content: space-between; }
            .match-toolbar-actions { flex-wrap: wrap; }
        }
        .game-btns { display: flex; gap: 6px; }
        .game-btn {
            padding: 0.5rem 1.25rem; border-radius: 99px; font-size: 0.8rem; font-weight: 700;
            cursor: pointer; border: 1px solid var(--border); background: var(--bg-card);
            color: var(--text-secondary); transition: all 0.2s; font-family: inherit;
            box-shadow: var(--shadow-sm);
        }
        .game-btn:hover { color: var(--accent); background: var(--bg-hover); transform: translateY(-1px); }
        .game-btn.active { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2); }


        /* ─── Scan Mode Toggle ────────────────────────── */
        .scan-mode {
            display: flex; border-radius: 99px; overflow: hidden;
            border: 1px solid var(--border); background: var(--bg-card);
            padding: 4px; box-shadow: var(--shadow-sm);
        }
        .scan-mode-btn {
            padding: 0.4rem 1rem; font-size: 0.75rem; font-weight: 700;
            cursor: pointer; border: none; background: transparent;
            color: var(--text-secondary); border-radius: 99px; transition: all 0.2s; font-family: inherit;
            white-space: nowrap;
        }
        .scan-mode-btn:hover { color: var(--accent); background: rgba(3, 83, 164, 0.05); }
        .scan-mode-btn.active {
            background: var(--accent-gradient); color: white;
            box-shadow: 0 2px 8px rgba(3, 83, 164, 0.15);
        }
        .listing-toolbar-controls {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }
        .listing-sort-menu {
            position: relative;
            display: none;
        }
        .listing-sort-menu.visible { display: block; }
        .bulk-edit-all-button { display: none; }
        .bulk-edit-all-button.visible { display: inline-flex; }
        body:not(.listing-view-list) #bulkEditAllBtn { display: none !important; }
        body.listing-view-list #bulkEditAllBtn.visible { display: inline-flex; }
        body:not(.listing-flow-lots) #btnViewLot { display: none !important; }
        body:not(.listing-view-lot) #lotView { display: none !important; }
        .bulk-edit-all-button.active {
            border-color: rgba(3, 83, 164, 0.24);
            background: rgba(3, 83, 164, 0.08);
            color: var(--accent);
        }
        .listing-sort-button {
            min-height: 44px;
            min-width: 112px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 1rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-card);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
        }
        .listing-sort-button:hover,
        .listing-sort-menu.open .listing-sort-button {
            border-color: var(--border-hover);
            background: var(--bg-hover);
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
        }
        .listing-sort-button svg {
            width: 16px;
            height: 16px;
            flex: 0 0 auto;
        }
        .listing-sort-label {
            max-width: 128px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .listing-sort-chevron {
            transition: transform 0.16s ease;
        }
        .listing-sort-menu.open .listing-sort-chevron {
            transform: rotate(180deg);
        }
        .listing-sort-panel {
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            z-index: 120;
            width: 228px;
            display: none;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-card);
            box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
        }
        .listing-sort-menu.open .listing-sort-panel {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .listing-sort-option {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 10px 11px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.84rem;
            font-weight: 800;
            text-align: left;
            cursor: pointer;
        }
        .listing-sort-option:hover,
        .listing-sort-option.active {
            background: var(--bg-hover);
            color: var(--text-primary);
        }
        .listing-sort-option-icon {
            width: 18px;
            flex: 0 0 18px;
            color: var(--text-muted);
            text-align: center;
            font-size: 13px;
            font-weight: 900;
        }

        .scan-mode-label {
            font-size: 0.64rem; font-weight: 800; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.08em;
            align-self: center; margin-right: 2px;
        }
        #viewModeToggleGroup {
            height: 44px;
            margin-left: 0 !important;
            padding: 4px;
            border-radius: 8px;
            background: #ffffff;
            border-color: rgba(148, 163, 184, 0.24);
            box-shadow: var(--shadow-sm);
        }
        #viewModeToggleGroup .scan-mode-btn {
            min-width: 70px;
            border-radius: 7px;
            padding: 0 16px;
        }
        #bulkEditAllBtn {
            min-width: 128px;
        }
        @media (max-width: 720px) {
            .topbar.listing-topbar .topbar-right {
                align-items: stretch;
                justify-content: flex-start;
                flex-wrap: wrap;
            }
            .topbar-batch-chip {
                flex: 1 1 100%;
                flex-wrap: wrap;
            }
            .topbar-stats-pill {
                margin-left: 0;
            }
            .topbar-batch-title-field,
            .topbar-action-group {
                flex: 1 1 100%;
            }
            .topbar-batch-title-field {
                max-width: none;
            }
        }

        /* ─── Empty State / Drop Zone / Staging ──────── */
        .empty-state {
            border: 2px dashed var(--border); border-radius: 20px;
            padding: 80px 40px; text-align: center; cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--surface);
            margin: 40px auto;
            max-width: 900px;
            box-shadow: var(--shadow-sm);
        }
        .empty-state:hover {
            background: var(--surface-hover);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .empty-state-icon {
            width: 48px;
            height: 48px;
            margin: 0 auto 24px;
            color: var(--accent);
            opacity: 0.8;
        }
        .empty-state-icon svg {
            width: 100%;
            height: 100%;
            display: block;
        }
        .empty-state h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
        .empty-state p { color: var(--text-secondary); font-size: 15px; font-weight: 500; }
        .upload-limit-hint {
            margin-top: 14px;
            font-size: 13px;
            font-weight: 700;
            color: var(--accent);
        }

        .file-input { display: none; }

        .staging-state {
            display: none; padding: 24px; background: var(--bg-secondary);
            border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px;
        }
        .staging-header {
            display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
            gap: 16px;
        }
        .staging-copy h2 {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            font-size: 20px;
            font-weight: 800;
            line-height: 1.2;
        }
        .staging-copy p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 600;
            line-height: 1.35;
        }
        .staging-copy {
            min-width: 0;
            display: grid;
            gap: 8px;
        }
        .upload-limit-line {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px 10px;
            max-width: 720px;
            padding: 9px 11px;
            border: 1px solid rgba(3, 83, 164, 0.14);
            border-radius: 9px;
            background: rgba(3, 83, 164, 0.06);
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.35;
        }
        .upload-limit-line strong {
            color: var(--accent);
            font-size: 13px;
            font-weight: 900;
        }
        .upload-limit-line span {
            min-width: 0;
        }
        .staging-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            flex-wrap: wrap;
            width: 100%;
        }
        .staging-count-pill {
            min-width: 88px;
            min-height: 40px;
            padding: 0 6px;
            margin-right: auto;
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            color: var(--text-primary);
            font-size: 15px;
            font-weight: 900;
            line-height: 1.2;
            text-align: left;
        }
        .staging-control-btn,
        .staging-scan-btn {
            min-height: 48px;
            padding: 0.66rem 1rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            white-space: nowrap;
        }
        .staging-scan-btn {
            min-height: 56px;
            min-width: 150px;
            padding: 0.72rem 1.3rem;
            line-height: 1.1;
            box-shadow: 0 8px 20px rgba(3, 83, 164, 0.22);
        }
        .staging-scan-btn.scan-ready {
            animation: scanPulse 1.4s ease-in-out infinite;
        }
        @keyframes scanPulse {
            0%, 100% {
                transform: translateY(0);
                box-shadow: 0 8px 20px rgba(3, 83, 164, 0.22);
            }
            50% {
                transform: translateY(-1px);
                box-shadow: 0 0 0 5px rgba(3, 83, 164, 0.12), 0 12px 28px rgba(3, 83, 164, 0.3);
            }
        }
        .upload-limit-line {
            display: flex;
            flex-wrap: wrap;
            gap: 6px 10px;
            align-items: center;
            margin-top: 8px;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .upload-limit-line strong {
            color: var(--accent);
            font-weight: 800;
        }
        .scan-queue-panel {
            margin: 0 0 20px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface);
            box-shadow: var(--shadow-sm);
        }
        .scan-queue-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }
        .scan-queue-header h3 {
            font-size: 15px;
            font-weight: 800;
            margin: 0 0 2px;
        }
        .scan-queue-header p {
            font-size: 12px;
            color: var(--text-secondary);
            margin: 0;
        }
        .scan-queue-dismiss {
            width: 34px;
            height: 34px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.16s ease;
        }
        .scan-queue-dismiss:hover {
            color: var(--text-primary);
            border-color: rgba(3, 83, 164, 0.28);
            background: #fff;
        }
        .scan-queue-list {
            display: grid;
            gap: 8px;
        }
        .scan-job-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 34px;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
        }
        .scan-job-main {
            min-width: 0;
        }
        .scan-job-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-width: 0;
        }
        .scan-job-row.terminal {
            opacity: 0.82;
        }
        .scan-job-row.failed,
        .scan-job-row.completed_with_errors {
            border-color: rgba(239, 68, 68, 0.35);
        }
        .scan-job-title {
            font-size: 13px;
            font-weight: 800;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .scan-job-meta {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        .scan-job-phase {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .scan-job-progress {
            position: relative;
            height: 12px;
            border-radius: 99px;
            background: rgba(3, 83, 164, 0.10);
            box-shadow: inset 0 0 0 1px rgba(3, 83, 164, 0.06);
            overflow: hidden;
        }
        .scan-job-progress-wrap {
            margin-top: 9px;
        }
        .scan-job-progress span {
            display: block;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #0353a4, #0ea5e9 54%, #10b981);
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.22);
            transition: width 0.25s ease;
        }
        .scan-job-progress-label {
            flex: 0 0 auto;
            min-width: 42px;
            text-align: right;
            font-size: 12px;
            font-weight: 800;
            color: var(--accent);
            font-variant-numeric: tabular-nums;
        }
        .scan-job-progress.active::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
            transform: translateX(-100%);
            animation: scanJobProgressSweep 1.35s linear infinite;
        }
        @keyframes scanJobProgressSweep {
            from { transform: translateX(-100%); }
            to { transform: translateX(100%); }
        }
        @media (prefers-reduced-motion: reduce) {
            .scan-job-progress.active::after {
                animation: none;
                opacity: 0.35;
                transform: none;
            }
        }
        .scan-job-remove-btn {
            width: 34px;
            height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(3, 83, 164, 0.14);
            border-radius: 8px;
            background: #fff;
            color: var(--text-secondary);
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
        }
        .scan-job-remove-btn:hover {
            color: var(--red);
            border-color: rgba(220, 38, 38, 0.28);
            background: rgba(220, 38, 38, 0.06);
        }
        .staging-grid {
            display: grid; gap: 16px; max-height: 60vh; overflow-y: auto; padding-right: 8px;
        }
        .staging-grid.single { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
        .staging-grid.dual { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

        .active-batch-scan-state {
            display: none;
            max-width: 980px;
            margin: 60px auto 20px;
            padding: 34px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface);
            box-shadow: var(--shadow-sm);
            text-align: center;
        }
        .active-batch-scan-state h3 {
            margin: 0 0 8px;
            font-size: 20px;
            font-weight: 800;
            color: var(--text-primary);
        }
        .active-batch-scan-state p {
            margin: 0 0 18px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .active-batch-scan-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .staging-item {
            position: relative; border-radius: 8px; overflow: visible; border: 1px solid var(--border);
            background: var(--bg-card); display: flex; flex-direction: column; align-items: center;
        }
        .staging-item .staging-img-wrap {
            width: 100%; aspect-ratio: 5/7; border-radius: 8px; overflow: hidden; position: relative;
        }
        .staging-item img {
            width: 100%; height: 100%; object-fit: cover;
        }
        .staging-item-pair {
            display: flex; gap: 4px; flex-direction: row; border: 1px solid var(--border); background: var(--bg-card); border-radius: 8px; overflow: visible; padding: 4px; position: relative;
        }
        .staging-item-pair .staging-img-col {
            flex: 1; display: flex; flex-direction: column; align-items: center;
        }
        .staging-item-pair .staging-img-wrap {
            width: 100%; aspect-ratio: 5/7; position: relative; border-radius: 4px; overflow: hidden;
        }
        .staging-item-pair img {
            width: 100%; height: 100%; object-fit: cover;
        }
        .staging-empty-back {
            background: var(--bg-input); display: flex; align-items: center; justify-content: center;
            color: var(--text-muted); font-size: 11px; text-align: center; width: 100%; height: 100%;
        }
        .staging-remove-btn {
            position: absolute; top: 4px; right: 4px; background: rgba(239, 68, 68, 0.9);
            color: white; border: none; width: 24px; height: 24px; border-radius: 50%;
            cursor: pointer; font-weight: bold; font-size: 14px; display: flex; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.2s; z-index: 10;
        }
        .staging-item:hover .staging-remove-btn, .staging-item-pair:hover .staging-remove-btn { opacity: 1; }
        .staging-rotate-btn {
            margin-top: 4px; background: rgba(255,255,255,0.12); border: 1px solid var(--border);
            color: var(--text-secondary); width: 26px; height: 26px; border-radius: 50%;
            cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
            transition: background-color 0.2s, color 0.2s, border-color 0.2s; flex-shrink: 0;
        }
        .staging-rotate-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

        /* ─── Card Editor ────────────────────────────── */
        .editor { display: none; }
        .editor.active { display: block; }
        .match-view-container .editor {
            padding: 0 14px 16px;
        }
        .match-view-container .editor #thumbStrip,
        .match-view-container .editor #cardComparison {
            display: none !important;
        }
        .match-view-container .editor .title-row {
            margin-top: 2px;
        }
        .match-view-container .editor .title-row,
        .match-view-container .editor .fields-grid {
            display: none;
        }
        .match-view-container .editor .fields-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .match-view-container .editor .field-card {
            padding: 1rem;
            border-radius: 8px;
        }
        .match-view-container .editor .field-card h4 {
            margin-bottom: 0.45rem;
        }
        .match-view-container .editor .card-nav {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }

        .card-comparison { display: grid; grid-template-columns: max-content max-content; justify-content: center; gap: 24px; margin-bottom: 16px; }
        .back-panel { position: relative; }
        .back-placeholder {
            width: 100%; aspect-ratio: 5/7; max-width: 160px; border-radius: 8px;
            border: 2px dashed var(--border); margin: 0 auto;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-muted); font-size: 12px; cursor: pointer;
            transition: all 0.2s;
        }
        .back-placeholder:hover { color: var(--text-primary); background: var(--bg-hover); }
        .card-panel {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 1.5rem; text-align: center;
            box-shadow: var(--shadow-md);
        }

        .card-panel-label {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.5px; margin-bottom: 8px;
        }
        .card-panel-label.uploaded { color: var(--accent); }
        .card-panel-label.matched { color: var(--green); }
        .card-image {
            width: 100%; max-width: 260px; height: auto; aspect-ratio: 5/7; border-radius: 8px; object-fit: cover;
            border: 1px solid var(--border); margin: 0 auto; display: block;
            cursor: zoom-in;
        }
        /* Photo pair: front + back side-by-side */
        .photo-pair {
            display: flex; gap: 12px; justify-content: center; align-items: flex-start;
        }
        .photo-half { text-align: center; flex: 1; max-width: 260px; }
        .photo-half .card-image { width: 100%; max-width: none; }
        .match-confidence {
            margin-top: 8px; font-size: 13px; font-weight: 600;
        }
        .conf-high { color: var(--green); }
        .conf-med { color: var(--yellow); }
        .conf-low { color: var(--red); }

        /* Global card zoom preview */
        #cardZoomPreview {
            display: none; position: fixed; z-index: 9999;
            pointer-events: none;
            width: min(480px, calc(100vw - 24px));
            height: min(672px, calc(100vh - 24px));
            border-radius: 12px; overflow: hidden;
            box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.3);
            border: 2px solid var(--border);
            background: var(--bg-primary);
        }
        #cardZoomPreview img {
            width: 100%; height: 100%; object-fit: contain;
            background: var(--bg-primary);
        }

        /* Title row */
        .title-row {
            display: flex; gap: 8px; align-items: center; margin-bottom: 16px;
        }
        .title-input {
            flex: 1; padding: 0.75rem 1rem; background: var(--bg-input);
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            color: var(--text-primary); font-size: 0.95rem; font-family: inherit;
            box-shadow: var(--shadow-sm); font-weight: 600;
            min-width: 0;
        }

        .title-input:focus { outline: none; border-color: var(--border-focus); }
        .title-counter { font-size: 12px; white-space: nowrap; }

        .pill-group {
            display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
        }
        .match-view-container .pill-group {
            gap: 6px;
            margin-bottom: 0;
        }
        .pill {
            padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
            cursor: pointer; border: 1px solid var(--border); background: var(--bg-card);
            color: var(--text-secondary); transition: all 0.2s; font-family: inherit;
        }
        .match-view-container .pill {
            padding: 4px 8px;
            border-radius: 8px;
            font-size: 11px;
            line-height: 1.15;
        }
        .match-variant-mount {
            width: 100%;
            max-width: 360px;
            margin: 10px auto 0;
            text-align: left;
        }
        .match-variant-mount #variantSection {
            margin: 0 !important;
            padding: 10px;
            border-radius: 8px;
            border-color: rgba(148, 163, 184, 0.24);
            box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
        }
        .match-variant-mount #variantSection h4 {
            margin-bottom: 8px;
            font-size: 0.64rem;
            letter-spacing: 0.12em;
        }
        .match-variant-mount .pill-group {
            display: flex;
            flex-direction: column;
            flex-wrap: nowrap;
            gap: 6px;
            margin: 0;
        }
        .match-variant-mount .pill {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 7px 9px;
            border-radius: 7px;
            font-size: 11px;
            line-height: 1.15;
            text-align: left;
        }
        .match-variant-mount .pill span {
            flex: 0 0 auto;
            margin-left: auto;
        }
        .pill span {
            opacity: 0.72;
            font-weight: 800;
        }
        .pill.active span {
            opacity: 0.9;
        }
        .pill:hover { background: var(--bg-hover); color: var(--text-primary); }
        .pill.active { background: var(--accent); color: white; border-color: transparent; }

        /* Fields grid */
        .fields-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
            margin-bottom: 16px;
        }
        .field-card {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 1.5rem;
            box-shadow: var(--shadow-sm);
        }
        .field-card h4 {
            font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
            color: var(--accent); letter-spacing: 0.1em; margin-bottom: 1.25rem;
        }

        .field-item { margin-bottom: 8px; }
        .field-item:last-child { margin-bottom: 0; }
        .field-item label {
            font-size: 11px; color: var(--text-secondary); display: block; margin-bottom: 3px;
        }
        .field-item input, .field-item select {
            width: 100%; padding: 0.6rem 0.75rem; background: var(--bg-input);
            border: 1px solid var(--border); border-radius: 8px;
            color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
            font-weight: 600;
        }

        .field-item input:focus, .field-item select:focus {
            outline: none; border-color: var(--border-focus);
        }

        /* List View */
        .list-view-row {
            display: grid; grid-template-columns: 60px 1fr 100px 100px;
            gap: 12px; align-items: center; padding: 8px;
            border-bottom: 1px solid var(--border);
        }
        .list-view-row .text-sm { font-size: 12px; }
        .list-view-row .text-xs { font-size: 11px; color: var(--text-muted); }

        /* Navigation */
        .card-nav {
            display: flex; align-items: center; justify-content: space-between; gap: 12px;
            padding: 12px 16px; background: var(--bg-card);
            border: 1px solid var(--border); border-radius: var(--radius);
            margin-bottom: 12px;
        }
        .nav-btns { display: flex; justify-content: flex-end; gap: 8px; margin-left: auto; }
        .card-nav .btn { min-width: 106px; justify-content: center; }
        .card-nav-position { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

        /* Thumbnail strip */
        .thumb-strip {
            display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin-bottom: 16px;
            scrollbar-width: thin; scrollbar-color: var(--border) transparent;
        }
        .thumb {
            width: 48px; border-radius: 6px; overflow: hidden;
            display: flex; flex-direction: column; gap: 2px;
            border: 2px solid var(--border); cursor: pointer; flex-shrink: 0;
            transition: all 0.2s; position: relative; background: var(--bg-hover);
        }
        .thumb:hover { background: var(--bg-hover); }
        .thumb.active { border-color: var(--accent); box-shadow: 0 0 12px rgba(99,102,241,0.5); }
        .thumb img { width: 100%; aspect-ratio: 2.5/3.5; object-fit: cover; }
        .thumb .idx {
            position: absolute; bottom: 2px; right: 2px; font-size: 9px;
            background: rgba(0,0,0,0.7); color: white; padding: 1px 4px;
            border-radius: 3px; font-weight: 700;
        }

        /* Loading overlay */
        .loading-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(15, 23, 42, 0.3);
            backdrop-filter: blur(12px);
            z-index: 9999; align-items: center; justify-content: center;
            transition: all 0.3s ease;
        }
        .loading-overlay.active { display: flex; }
        .loading-box {
            background: var(--surface); border-radius: 24px; padding: 40px;
            text-align: center; width: 100%; max-width: 420px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        .spinner {
            width: 64px; height: 64px; border: 5px solid #f1f5f9;
            border-top-color: var(--accent); border-radius: 50%;
            animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
            margin: 0 auto 24px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        .progress-container {
            width: 100%; background: #f1f5f9; border-radius: 99px;
            height: 8px; margin: 24px 0 12px; overflow: hidden;
            display: none;
        }
        .progress-bar {
            height: 100%; background: var(--accent-gradient);
            width: 0%; transition: width 0.3s ease;
        }
        #loadingText {
            font-size: 16px; font-weight: 700; color: var(--text-primary);
            margin: 0;
        }
        #loadingSubtext {
            font-size: 13px; color: var(--text-secondary);
            margin-top: 8px; font-weight: 500;
        }

        .direct-ebay-dock {
            position: fixed;
            right: 24px;
            bottom: 24px;
            z-index: 10001;
            width: min(392px, calc(100vw - 32px));
            background: #ffffff;
            border: 1px solid rgba(15, 23, 42, 0.12);
            border-radius: 8px;
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
            padding: 14px;
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr);
            gap: 12px;
            align-items: start;
        }
        .direct-ebay-dock[hidden] { display: none; }
        .direct-ebay-dock-icon {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            background: #eaf4ff;
            color: var(--accent);
            flex-shrink: 0;
        }
        .direct-ebay-dock-icon .spinner {
            width: 22px;
            height: 22px;
            border-width: 3px;
            margin: 0;
        }
        .direct-ebay-dock.is-warning .direct-ebay-dock-icon {
            background: #fff7ed;
            color: #c2410c;
        }
        .direct-ebay-dock.is-complete .direct-ebay-dock-icon {
            background: #dcfce7;
            color: #047857;
        }
        .direct-ebay-dock-title {
            margin: 0;
            font-size: 14px;
            font-weight: 800;
            color: var(--text-primary);
            line-height: 1.25;
        }
        .direct-ebay-dock-subtitle {
            margin: 4px 0 0;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-secondary);
            line-height: 1.35;
        }
        .direct-ebay-dock-progress {
            height: 6px;
            margin-top: 10px;
            border-radius: 999px;
            background: #e2e8f0;
            overflow: hidden;
        }
        .direct-ebay-dock-progress-bar {
            height: 100%;
            width: 0%;
            border-radius: inherit;
            background: linear-gradient(90deg, #0058a8, #10b981);
            transition: width 0.25s ease;
        }
        .direct-ebay-dock-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            margin-top: 12px;
        }
        .direct-ebay-dock-actions button {
            border: 1px solid rgba(15, 23, 42, 0.12);
            background: #f8fafc;
            color: var(--text-primary);
            border-radius: 8px;
            padding: 7px 10px;
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
        }
        .direct-ebay-dock-actions button:hover {
            border-color: rgba(0, 88, 168, 0.32);
            color: var(--accent);
        }

        /* ─── Batch Bar ─────────────────────────────── */
        .batch-bar {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            grid-template-areas:
                "details"
                "actions";
            gap: 14px;
            align-items: stretch;
            padding: 1rem 1.2rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 12px;
            box-shadow: var(--shadow-sm);
        }
        .batch-group {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            min-width: 0;
            gap: 8px;
            padding-right: 14px;
            border-right: 1px solid rgba(148, 163, 184, 0.22);
        }
        .batch-group:last-child { border-right: 0; padding-right: 0; }
        .batch-group-picker { grid-area: picker; }
        .batch-group-details {
            grid-area: details;
            border-right: 0;
            padding-right: 0;
        }
        .batch-defaults-panel {
            display: grid;
            gap: 8px;
            border-top: 0;
            margin-top: 0;
            padding-top: 0;
        }
        .batch-group.batch-actions {
            grid-area: actions;
            border-right: 0;
            padding: 0;
        }
        .batch-group-title {
            font-size: 0.78rem;
            font-weight: 900;
            line-height: 1;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 0.09em;
        }
        .batch-picker-heading,
        .batch-details-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            min-width: 0;
        }
        .batch-toggle-btn {
            min-height: 28px;
            padding: 0.35rem 0.7rem;
            border: 1px solid rgba(3, 83, 164, 0.18);
            border-radius: 99px;
            background: rgba(3, 83, 164, 0.06);
            color: var(--accent);
            font-family: inherit;
            font-size: 0.72rem;
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
            transition: all 0.16s ease;
            white-space: nowrap;
        }
        .batch-toggle-btn:hover {
            border-color: rgba(3, 83, 164, 0.32);
            background: rgba(3, 83, 164, 0.1);
            color: var(--text-primary);
        }
        .batch-toggle-btn:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.14);
        }
        .batch-group-controls {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px 10px;
            min-width: 0;
        }
        .batch-picker-controls {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 40px;
            align-items: center;
            gap: 8px;
        }
        .batch-group-details .batch-group-controls {
            display: grid;
            grid-template-columns: minmax(260px, 1.8fr) minmax(170px, 0.75fr) minmax(156px, 0.55fr);
            align-items: start;
            gap: 8px;
        }
        .batch-active-line {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            min-height: 34px;
            padding: 0.42rem 0.65rem;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-weight: 700;
        }
        .batch-active-name {
            color: var(--text-primary);
            max-width: min(520px, 42vw);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .batch-active-dot {
            width: 7px;
            height: 7px;
            border-radius: 99px;
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.13);
            flex: 0 0 auto;
        }
        .batch-active-meta {
            min-width: 0;
            overflow: visible;
            text-overflow: clip;
            white-space: normal;
            color: var(--text-secondary);
        }
        .batch-name-input {
            height: 40px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 0.5rem 0.7rem;
            font-size: 0.88rem;
            font-weight: 700;
            color: var(--text-primary);
            font-family: inherit;
            width: 100%;
            min-width: 0;
            transition: all 0.2s;
        }
        .batch-name-input:hover { background: var(--bg-hover); border-color: var(--border-hover); }
        .batch-name-input:focus {
            outline: none; border-color: var(--accent);
            background: var(--bg-input);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .batch-detail-field {
            display: inline-flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            gap: 6px;
            min-width: 0;
        }
        .batch-detail-label {
            color: var(--text-muted);
            font-size: 0.72rem;
            font-weight: 800;
            line-height: 1;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .batch-name-field {
            width: 100%;
        }
        .batch-selector {
            height: 40px;
            padding: 0.45rem 0.82rem; background: var(--bg-input);
            border: 1px solid var(--border); border-radius: 10px;
            color: var(--text-primary); font-size: 0.82rem; font-family: inherit;
            color-scheme: light;
            cursor: pointer; min-width: 150px; font-weight: 700;
            line-height: 1.1;
        }
        #batchSelector { width: 100%; max-width: 100%; }
        .batch-create-btn {
            width: 40px;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 0;
            border-radius: 10px;
            background: var(--accent-gradient);
            color: #fff;
            font-family: inherit;
            font-size: 1.15rem;
            font-weight: 900;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2);
            transition: transform 0.16s ease, box-shadow 0.16s ease;
        }
        .batch-create-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 15px rgba(3, 83, 164, 0.28);
        }
        .batch-create-btn:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.16), 0 6px 15px rgba(3, 83, 164, 0.24);
        }

        .batch-selector:hover { border-color: var(--border-hover); background: var(--bg-hover); }
        .batch-selector:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .batch-selector option { background: var(--bg-card); }
        select.batch-selector.throne-smooth-select-native {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            min-width: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            border: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        .smooth-select-proxy {
            position: relative;
            width: 100%;
            min-width: 0;
        }
        .batch-picker-controls .smooth-select-proxy,
        .batch-field .smooth-select-proxy {
            width: 100%;
        }
        .smooth-select-trigger {
            width: 100%;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 0.45rem 0.72rem 0.45rem 0.82rem;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 800;
            line-height: 1.1;
            cursor: pointer;
            box-shadow: none;
            transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
        }
        .smooth-select-trigger:hover {
            background: var(--bg-hover);
            border-color: var(--border-hover);
        }
        .smooth-select-trigger:focus-visible,
        .smooth-select-proxy.is-open .smooth-select-trigger {
            outline: none;
            background: var(--bg-card);
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .smooth-select-trigger:active {
            transform: translateY(1px);
        }
        .smooth-select-proxy.compact .smooth-select-trigger {
            border-radius: 99px;
        }
        .smooth-select-trigger-text {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: left;
        }
        .smooth-select-chevron {
            width: 14px;
            height: 14px;
            flex: 0 0 auto;
            color: #475569;
            transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .smooth-select-proxy.is-open .smooth-select-chevron {
            transform: rotate(180deg);
        }
        .smooth-select-proxy.is-open {
            z-index: 1000;
        }
        .smooth-select-panel {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            z-index: 1000;
            max-height: min(280px, 48vh);
            overflow: auto;
            padding: 5px;
            border: 1px solid rgba(148, 163, 184, 0.34);
            border-radius: 10px;
            background: #ffffff;
            box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(-4px) scale(0.98);
            transform-origin: top center;
            transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1), transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.14s linear;
        }
        .smooth-select-proxy.is-open .smooth-select-panel {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(0) scale(1);
        }
        .smooth-select-option {
            width: 100%;
            min-height: 34px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 0.46rem 0.58rem;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: #0f172a;
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 750;
            text-align: left;
            cursor: pointer;
        }
        .smooth-select-option[hidden] {
            display: none !important;
        }
        .smooth-select-option:hover,
        .smooth-select-option:focus-visible {
            outline: none;
            background: #eff6ff;
            color: #0b3f7e;
        }
        .smooth-select-option.is-selected {
            background: rgba(3, 83, 164, 0.1);
            color: var(--accent);
        }
        .smooth-select-option.is-selected::after {
            content: "";
            width: 7px;
            height: 7px;
            flex: 0 0 auto;
            border-radius: 99px;
            background: var(--accent);
        }
        .smooth-select-option:disabled {
            cursor: default;
            color: #94a3b8;
            background: transparent;
        }
        .smooth-select-search {
            position: sticky;
            top: 0;
            z-index: 1;
            padding: 4px 4px 6px;
            background: #ffffff;
        }
        .smooth-select-search-input {
            width: 100%;
            min-height: 34px;
            padding: 0.45rem 0.62rem;
            border: 1px solid rgba(3, 83, 164, 0.18);
            border-radius: 8px;
            background: #f8fafc;
            color: var(--text-primary);
            font: inherit;
            font-size: 0.78rem;
            font-weight: 750;
            outline: none;
        }
        .smooth-select-search-input:focus {
            border-color: var(--accent);
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .smooth-select-no-results {
            padding: 0.55rem 0.62rem;
            color: var(--text-muted);
            font-size: 0.78rem;
            font-weight: 750;
        }
        .sku-prefix-field {
            width: 100%;
        }
        .sku-prefix-field small {
            display: inline;
            margin-left: 6px;
            color: var(--text-muted);
            font-size: 11px;
            line-height: 1.2;
            margin-top: 0;
            text-transform: none;
            letter-spacing: 0;
            font-weight: 700;
        }
        .sku-prefix-field input {
            width: 100%; min-width: 0; height: 40px;
            padding: 0.5rem 0.7rem; border-radius: 10px;
            border: 1px solid var(--border); background: var(--bg-input);
            color: var(--text-primary); font: inherit; font-size: 0.85rem;
            font-weight: 700;
        }
        .sku-prefix-field input:hover { border-color: var(--border-hover); background: var(--bg-hover); }
        .sku-prefix-field input:focus {
            outline: none; border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .sku-increment-field {
            width: 100%;
        }
        .sku-increment-control {
            width: 100%;
            min-width: 0;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0.5rem 0.7rem;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 0.82rem;
            font-weight: 800;
            cursor: pointer;
            user-select: none;
        }
        .sku-increment-control:hover {
            border-color: var(--border-hover);
            background: var(--bg-hover);
        }
        .sku-increment-control input {
            width: 16px;
            height: 16px;
            margin: 0;
            flex: 0 0 auto;
            accent-color: var(--accent);
        }
        .batch-inline-controls {
            display: flex; align-items: center; gap: 7px 8px; flex-wrap: wrap; min-width: 0;
        }
        .batch-compact-selector {
            min-width: 128px; border-radius: 99px; padding: 0.42rem 0.72rem;
        }
        .batch-compact-selector.variant { min-width: 138px; }
        .batch-field {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            min-width: 0;
        }
        .batch-field[hidden] {
            display: none !important;
        }
        .batch-field .scan-mode-label {
            align-self: flex-start;
            margin-right: 0;
        }
        .batch-field .batch-selector,
        .batch-field .scan-mode {
            width: 100%;
        }
        .batch-field-game { width: 142px; }
        .batch-field-config { width: 158px; }
        .batch-field-condition { width: 118px; }
        .batch-field-variant { width: 140px; }
        .batch-field-category { width: 160px; }
        .batch-field-listing-type,
        .batch-field-variation-sort { width: 176px; }
        .batch-field-variation-title,
        .batch-field-variation-cover,
        .batch-field-variation-specifics {
            width: 100%;
        }
        .create-batch-grid .batch-field-variation-title,
        .create-batch-grid .batch-field-variation-specifics {
            grid-column: 1 / -1;
        }
        .variation-metadata-input {
            width: 100%;
            min-height: 36px;
            border: 1px solid var(--border);
            border-radius: 99px;
            background: var(--bg-card);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 0.48rem 0.78rem;
            box-shadow: var(--shadow-sm);
            outline: none;
        }
        .variation-metadata-input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 91, 172, 0.12);
        }
        .variation-metadata-input::placeholder {
            color: var(--text-muted);
            font-weight: 600;
        }
        .variation-cover-upload-control {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 8px;
            align-items: center;
            min-width: 0;
        }
        .variation-cover-upload-btn,
        .variation-cover-clear-btn {
            min-height: 42px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 800;
            padding: 0.5rem 0.75rem;
            box-shadow: var(--shadow-sm);
            cursor: pointer;
            white-space: nowrap;
        }
        .variation-cover-upload-btn {
            text-align: left;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .variation-cover-upload-btn:hover,
        .variation-cover-clear-btn:hover {
            border-color: var(--accent);
        }
        .variation-cover-preview {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: 42px minmax(0, 1fr);
            gap: 8px;
            align-items: center;
            min-width: 0;
            color: var(--text-muted);
            font-size: 0.76rem;
            font-weight: 700;
        }
        .variation-cover-preview[hidden] {
            display: none !important;
        }
        .variation-cover-preview img {
            width: 42px;
            height: 42px;
            border-radius: 8px;
            border: 1px solid var(--border);
            object-fit: cover;
            background: var(--bg-input);
        }
        .variation-cover-preview span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .variation-specifics-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
        }
        .variation-specifics-clear {
            border: 0;
            background: transparent;
            color: var(--accent);
            font-family: inherit;
            font-size: 0.72rem;
            font-weight: 800;
            cursor: pointer;
            padding: 0;
        }
        .variation-specifics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
            gap: 8px;
            width: 100%;
        }
        .variation-specific-input-wrap {
            display: grid;
            gap: 4px;
            min-width: 0;
        }
        .variation-specific-input-wrap span {
            color: var(--text-muted);
            font-size: 0.66rem;
            font-weight: 800;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .variation-disabled-note {
            color: var(--text-muted);
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1.25;
        }
        .batch-scan-mode-field { width: 178px; }
        .batch-scan-mode-field .scan-mode-btn {
            padding: 0.38rem 0.56rem;
            font-size: 0.72rem;
        }
        .batch-check-control {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            min-height: 36px;
            padding: 0.45rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 99px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 0.75rem;
            font-weight: 700;
            box-shadow: var(--shadow-sm);
            cursor: pointer;
            white-space: nowrap;
        }
        .batch-check-control input {
            width: 15px;
            height: 15px;
            margin: 0;
            accent-color: var(--accent);
        }
        .batch-save-indicator {
            font-size: 11px; color: var(--text-muted);
            display: none; align-items: center; gap: 4px;
        }
        .batch-save-indicator:not(:empty) { display: flex; }
        .batch-save-indicator.saving { color: var(--yellow); }
        .batch-save-indicator.saved { color: var(--green); }
        .batch-group.batch-actions {
            display: grid;
            grid-template-columns: 1fr;
            align-content: flex-start;
            align-items: start;
            gap: 8px;
            min-width: 0;
            grid-column: 1 / -1;
            padding-top: 12px;
            border-top: 1px solid rgba(148, 163, 184, 0.22);
        }
        .batch-group.batch-actions .batch-group-title {
            grid-column: 1 / -1;
        }
        .batch-action-column {
            display: grid;
            grid-template-columns: repeat(6, minmax(112px, 1fr));
            gap: 8px;
            min-width: 0;
            align-items: stretch;
        }
        .batch-action-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
            gap: 6px;
            align-items: stretch;
        }
        .batch-action-row.batch-workflow-row,
        .batch-action-row.slab-workflow-row {
            display: contents;
        }
        .batch-action-row.slab-workflow-row { display: none; }
        .batch-danger-zone {
            display: grid;
            gap: 6px;
            margin-top: 0;
            padding-top: 0;
            border-top: 0;
        }
        .batch-danger-label {
            display: none;
            color: var(--text-muted);
            font-size: 0.62rem;
            font-weight: 900;
            line-height: 1;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .batch-action-column.batch-danger-actions {
            display: contents;
        }
        .batch-btn {
            min-height: 36px;
            width: 100%;
            padding: 0.42rem 0.55rem; border-radius: 10px; font-size: 0.74rem;
            font-weight: 700; cursor: pointer; border: 1px solid var(--border);
            background: var(--bg-card); color: var(--text-secondary);
            font-family: inherit; transition: all 0.2s;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .batch-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
        .batch-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
        .batch-btn:active:not(:disabled) { transform: translateY(1px); }
        .batch-btn svg {
            width: 15px;
            height: 15px;
            flex: 0 0 auto;
            display: block;
        }
        .batch-btn.delete {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
        }
        .batch-btn.save,
        .batch-btn.export-primary {
            min-height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
        }
        .batch-btn.save {
            background: var(--accent-gradient);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 5px 14px rgba(3, 83, 164, 0.2);
        }
        .batch-btn.save:hover:not(:disabled) {
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 7px 16px rgba(3, 83, 164, 0.24);
        }
        .batch-btn.export-primary {
            background: #10b981;
            border-color: #10b981;
            color: #fff;
            box-shadow: 0 5px 14px rgba(16, 185, 129, 0.2);
        }
        .batch-btn.export-primary:hover:not(:disabled) {
            background: #0f9f73;
            border-color: #0f9f73;
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 7px 16px rgba(16, 185, 129, 0.24);
        }
        .batch-btn.export-primary:disabled {
            background: var(--bg-input);
            border-color: var(--border);
            color: var(--text-muted);
            opacity: 1;
            box-shadow: none;
        }
        .batch-btn.listed {
            background: var(--accent-gradient);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 12px rgba(3, 83, 164, 0.18);
        }
        .batch-btn.listed.is-listed {
            background: #10b981;
            border-color: #10b981;
            color: #fff;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
        }
        .batch-btn.listed:hover {
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 6px 15px rgba(3, 83, 164, 0.26);
        }
        .batch-btn.listed.is-listed:hover {
            background: #0f9f73;
            border-color: #0f9f73;
            box-shadow: 0 6px 15px rgba(16, 185, 129, 0.26);
        }
        .batch-btn.danger:hover { border-color: var(--red); color: var(--red); background: rgba(239, 68, 68, 0.06); }
        .batch-btn.delete {
            background: #ef4444;
            border-color: #ef4444;
            color: #ffffff;
            box-shadow: 0 5px 14px rgba(239, 68, 68, 0.18);
        }
        .batch-btn.delete:hover {
            border-color: #dc2626;
            color: #ffffff;
            background: #dc2626;
            transform: translateY(-1px);
            box-shadow: 0 7px 16px rgba(239, 68, 68, 0.24);
        }
        body.batch-info-topbar-collapsed #batchBar {
            display: none !important;
        }
        body.batch-info-topbar-collapsed .toolbar {
            margin-top: 2px;
        }
        body:not(.listing-ui-ready) #batchBar,
        body:not(.listing-ui-ready) #createBatchFlow,
        body:not(.listing-ui-ready) #emptyState,
        body:not(.listing-ui-ready) #viewModeToggleGroup,
        body:not(.listing-ui-ready) #listingSortMenu,
        body:not(.listing-ui-ready) #bulkEditAllBtn,
        body.listing-batch-route-loading #batchBar,
        body.listing-batch-route-loading #createBatchFlow,
        body.listing-batch-route-loading #emptyState,
        body.listing-batch-route-loading #viewModeToggleGroup,
        body.listing-batch-route-loading #listingSortMenu,
        body.listing-batch-route-loading #bulkEditAllBtn {
            display: none !important;
        }
        .create-batch-flow {
            display: none;
            gap: 18px;
            margin: -2px 0 18px;
        }
        body.batch-create-mode .create-batch-flow {
            display: grid;
            grid-template-columns: minmax(420px, 0.95fr) minmax(500px, 1.05fr);
            align-items: start;
        }
        .create-batch-overview {
            grid-column: 1 / -1;
            display: grid;
            gap: 14px;
            padding: 16px 20px 18px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-card);
            box-shadow: var(--shadow-sm);
        }
        .create-batch-overview h1 {
            margin: 0;
            font-size: clamp(28px, 3vw, 38px);
            line-height: 1.05;
            letter-spacing: 0;
            color: var(--text-primary);
        }
        body.batch-create-mode #batchBar {
            display: none !important;
        }
        body.batch-create-mode .toolbar {
            display: none !important;
        }
        .create-batch-steps {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
            gap: 10px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }
        .create-batch-step {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            min-height: 74px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
        }
        .create-batch-step.is-active {
            border-color: rgba(3, 83, 164, 0.28);
            background: rgba(3, 83, 164, 0.06);
        }
        .create-step-number {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            background: #e2e8f0;
            color: var(--text-secondary);
            font-weight: 900;
        }
        .create-batch-step.is-active .create-step-number {
            background: var(--accent);
            color: #ffffff;
        }
        .create-batch-step.is-complete .create-step-number {
            background: #10b981;
            color: #ffffff;
        }
        .create-batch-step > span:not(.create-step-number) {
            display: grid;
            gap: 2px;
            min-width: 0;
        }
        .create-step-separator {
            align-self: center;
            color: var(--text-muted);
            font-size: 24px;
            font-weight: 900;
            line-height: 1;
        }
        .create-step-title {
            display: block;
            font-size: 13px;
            font-weight: 900;
            color: var(--text-primary);
        }
        .create-step-copy {
            display: block;
            margin-top: 2px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-secondary);
        }
        .create-batch-card,
        .create-upload-card {
            display: grid;
            gap: 12px;
            align-self: start;
            padding: 18px 20px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-card);
            box-shadow: var(--shadow-sm);
        }
        .create-batch-card h2,
        .create-upload-card h2 {
            font-size: 18px;
            line-height: 1.2;
            margin: 0;
        }
        .config-manage-link {
            width: 22px;
            height: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--text-muted);
            background: var(--bg-input);
            vertical-align: middle;
            flex: 0 0 auto;
        }
        .config-manage-link svg {
            width: 14px;
            height: 14px;
            flex: 0 0 auto;
        }
        .create-batch-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px 14px;
        }
        .create-batch-grid .batch-detail-field.batch-name-field,
        .create-batch-grid .sku-preview-field {
            grid-column: 1 / -1;
        }
        .create-section-heading {
            grid-column: 1 / -1;
            color: var(--accent);
            font-size: 0.76rem;
            font-weight: 900;
            line-height: 1;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .create-card-defaults-heading {
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }
        .create-scan-speed-heading {
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }
        .create-batch-grid .batch-field {
            width: 100%;
            align-items: stretch;
            justify-content: flex-start;
            gap: 6px;
        }
        .create-batch-grid .batch-detail-field,
        .create-batch-grid .batch-field,
        .create-batch-grid .sku-preview-field {
            min-width: 0;
        }
        .create-batch-grid .batch-name-input,
        .create-batch-grid .variation-metadata-input,
        .create-batch-grid .sku-prefix-field input,
        .create-batch-grid .sku-increment-control,
        .create-batch-grid .batch-selector,
        .create-batch-grid .smooth-select-proxy {
            width: 100% !important;
            min-width: 0;
            height: 42px;
            border-radius: 10px;
        }
        .create-batch-grid .batch-field select.batch-selector,
        .create-batch-grid .batch-field .smooth-select-proxy {
            border-radius: 10px !important;
        }
        .create-batch-grid .smooth-select-proxy.compact .smooth-select-trigger {
            border-radius: 10px !important;
        }
        .create-batch-grid .batch-compact-selector {
            min-width: 0;
            padding: 0.5rem 0.75rem;
        }
        .create-batch-grid .smooth-select-proxy {
            justify-content: space-between;
        }
        .create-batch-grid .scan-mode-label {
            min-height: 22px;
            margin: 0;
            display: flex;
            align-items: center;
            line-height: 1;
        }
        .create-batch-grid .batch-field-config .scan-mode-label {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .create-batch-grid .create-scan-mode-field {
            align-items: stretch;
            gap: 8px;
            max-width: 100%;
        }
        .create-batch-grid .create-scan-mode-field .scan-mode-label {
            color: var(--accent);
            font-size: 0.76rem;
        }
        .create-batch-grid .create-scan-mode-field .scan-mode {
            width: 100%;
            max-width: 100%;
            height: 44px;
            justify-self: stretch;
        }
        .create-batch-grid .create-scan-mode-field .scan-mode-btn {
            flex: 1 1 0;
            min-width: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-align: center;
        }
        .create-batch-grid .create-scan-mode-field .create-step-copy {
            margin: 0;
            text-align: left;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .fast-scan-control {
            position: relative;
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            min-height: 42px;
            padding: 7px 10px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            cursor: pointer;
            user-select: none;
        }
        .batch-field-fast-scan {
            grid-column: 1 / -1;
            max-width: 360px;
        }
        .fast-scan-control input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .fast-scan-control .toggle {
            pointer-events: none;
        }
        .fast-scan-control-text {
            display: grid;
            gap: 1px;
            min-width: 0;
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 900;
            line-height: 1.1;
        }
        .fast-scan-control-text small {
            color: var(--text-secondary);
            font-size: 10px;
            font-weight: 850;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .create-upload-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }
        .create-upload-mode-control {
            width: min(300px, 100%);
            display: grid;
            gap: 8px;
            flex: 0 0 auto;
        }
        .create-upload-mode-control .scan-mode-label {
            color: var(--accent);
            font-size: 0.76rem;
            line-height: 1;
        }
        .create-upload-mode-control .scan-mode {
            width: 100%;
            height: 44px;
        }
        .create-upload-mode-control .scan-mode-btn {
            flex: 1 1 0;
            min-width: 0;
        }
        .toggle {
            position: relative;
            width: 48px;
            height: 28px;
            border-radius: 999px;
            background: #e5e7eb;
            cursor: pointer;
            flex: 0 0 auto;
            transition: background-color 0.2s ease;
        }
        .toggle::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
            transition: transform 0.2s ease;
        }
        .toggle.active {
            background: var(--accent);
        }
        .toggle.active::after {
            transform: translateX(20px);
        }
        .batch-match-tuning {
            grid-column: 1 / -1;
            display: grid;
            gap: 12px;
            padding-top: 14px;
            border-top: 1px solid var(--border);
        }
        .batch-match-tuning[hidden] {
            display: none !important;
        }
        .matching-settings-head {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            align-items: center;
        }
        .matching-settings-title,
        .matching-rule-title {
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 900;
        }
        .matching-settings-copy,
        .matching-help {
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.42;
            max-width: 420px;
        }
        .matching-settings-actions {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }
        .matching-filter-status {
            margin-top: 5px;
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 800;
        }
        .matching-clear-btn {
            padding: 8px 12px;
            border: 1px solid rgba(239, 68, 68, 0.24);
            border-radius: 8px;
            background: #ffffff;
            color: var(--danger);
            cursor: pointer;
            font: inherit;
            font-size: 12px;
            font-weight: 900;
            white-space: nowrap;
        }
        .matching-clear-btn:hover:not(:disabled) {
            border-color: rgba(239, 68, 68, 0.45);
            background: rgba(239, 68, 68, 0.06);
        }
        .matching-clear-btn:disabled {
            cursor: not-allowed;
            opacity: 0.55;
        }
        .matching-reprint-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
        }
        .matching-tuning-body {
            display: none;
            gap: 12px;
        }
        .batch-match-tuning.enabled .matching-tuning-body {
            display: grid;
        }
        .matching-rule-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 12px;
        }
        .matching-rule-group {
            display: grid;
            gap: 10px;
            min-width: 0;
            padding: 12px;
            border: 1px solid var(--border);
            border-left: 3px solid rgba(3, 83, 164, 0.55);
            border-radius: 8px;
            background: #ffffff;
        }
        .matching-rule-group.require {
            border-left-color: rgba(22, 163, 74, 0.75);
        }
        .matching-rule-group.avoid {
            border-left-color: rgba(239, 68, 68, 0.7);
        }
        .matching-set-picker {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: start;
            gap: 8px;
        }
        .matching-set-select {
            width: 100%;
            height: 112px;
            min-width: 0;
            padding: 8px 6px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #ffffff;
            color: var(--text-primary);
            font: inherit;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.25;
        }
        .matching-set-select option {
            padding: 5px 8px;
            border-radius: 6px;
        }
        .matching-set-add {
            justify-self: end;
            padding: 8px 12px;
            border: 1px solid rgba(3, 83, 164, 0.18);
            border-radius: 8px;
            background: #ffffff;
            color: var(--accent);
            cursor: pointer;
            font: inherit;
            font-size: 12px;
            font-weight: 900;
        }
        .matching-set-add:hover {
            border-color: rgba(3, 83, 164, 0.35);
            background: rgba(3, 83, 164, 0.06);
        }
        .matching-selected-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            grid-column: 1 / -1;
            min-height: 34px;
            padding-top: 2px;
        }
        .matching-selected-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            max-width: 100%;
            padding: 7px 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #ffffff;
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 900;
            line-height: 1.2;
        }
        .matching-selected-chip span {
            overflow-wrap: anywhere;
        }
        .matching-selected-chip button {
            width: 18px;
            height: 18px;
            border: 0;
            border-radius: 50%;
            background: rgba(15, 23, 42, 0.08);
            color: var(--text-secondary);
            cursor: pointer;
            font: inherit;
            font-size: 12px;
            font-weight: 900;
            line-height: 18px;
        }
        .matching-selected-chip button:hover {
            background: var(--danger);
            color: #ffffff;
        }
        .matching-empty {
            align-self: center;
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 800;
        }
        .matching-rule-group textarea {
            min-height: 74px;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font: inherit;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.4;
            background: #ffffff;
        }
        .sku-preview-field {
            display: grid;
            gap: 6px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }
        .sku-preview-value {
            min-height: 28px;
            padding: 7px 10px;
            border-radius: 7px;
            background: rgba(3, 83, 164, 0.08);
            color: var(--accent);
            font-size: 12px;
            font-weight: 900;
        }
        .create-upload-target {
            padding: 11px 12px;
            border: 1px solid rgba(3, 83, 164, 0.16);
            border-radius: 8px;
            background: rgba(3, 83, 164, 0.07);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 800;
            text-align: center;
        }
        .create-upload-target strong {
            color: var(--accent);
        }
        .create-upload-card .empty-state {
            margin: 0;
            max-width: none;
            padding: 58px 32px;
            border-radius: 14px;
            background: var(--surface);
        }
        .create-upload-card .staging-state {
            margin: 0;
            padding: 18px;
            background: var(--bg-card);
            border-radius: 10px;
        }
        .create-upload-card .staging-header {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            align-items: stretch;
            gap: 18px;
            margin-bottom: 18px;
        }
        body.slab-create-mode .create-batch-flow {
            grid-template-columns: minmax(360px, 620px) minmax(0, 1fr);
        }
        body.slab-create-mode .create-upload-card,
        body.slab-create-mode .create-batch-steps,
        body.slab-create-mode .create-batch-grid .batch-field-condition,
        body.slab-create-mode .create-batch-grid .batch-field-variant,
        body.slab-create-mode .create-batch-grid .batch-field-fast-scan,
        body.slab-create-mode .create-batch-grid .create-scan-speed-heading,
        body.slab-create-mode .create-batch-grid .create-scan-mode-field,
        body.slab-create-mode .create-batch-grid .sku-preview-field {
            display: none !important;
        }
        body.slab-create-mode .create-batch-card {
            max-width: 620px;
        }
        body.slab-create-mode .create-batch-grid {
            grid-template-columns: minmax(0, 1fr) minmax(0, 0.84fr);
        }
        body.slab-create-mode .create-batch-grid .create-card-defaults-heading {
            padding-top: 10px;
        }
        body.slab-create-mode .create-batch-grid .batch-field-game,
        body.slab-create-mode .create-batch-grid .batch-field-config,
        body.slab-create-mode .create-batch-grid .batch-field-category {
            width: 100%;
        }
        body.slab-create-mode .create-batch-grid .batch-field-category {
            grid-column: 1 / -1;
            max-width: 360px;
        }
        .batch-bar.batch-collapsed {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0.65rem 0.9rem;
            margin-bottom: 10px;
        }
        .batch-bar.batch-collapsed .batch-group-details { display: none; }
        body.batch-info-collapsed #batchBar .batch-group-details { display: none; }
        .batch-bar.batch-collapsed .batch-group.batch-actions .batch-group-title { display: none; }
        body.batch-info-collapsed #batchBar .batch-group.batch-actions .batch-group-title { display: none; }
        .batch-bar.batch-collapsed .batch-workflow-row .batch-btn:not(.listed) { display: none; }
        body.batch-info-collapsed #batchBar .batch-workflow-row .batch-btn:not(.listed) { display: none; }
        .batch-bar.batch-collapsed .batch-group.batch-actions > .batch-action-column > .batch-btn:not(.export-primary) { display: none; }
        body.batch-info-collapsed #batchBar .batch-group.batch-actions > .batch-action-column > .batch-btn:not(.export-primary) { display: none; }
        .batch-bar.batch-collapsed .batch-group.batch-actions .batch-danger-zone { display: none; }
        body.batch-info-collapsed #batchBar .batch-group.batch-actions .batch-danger-zone { display: none; }
        .batch-bar.batch-collapsed .batch-group.batch-actions {
            display: grid;
            flex: 0 0 308px;
            min-width: 308px;
            margin-left: auto;
            padding: 0;
            border: 0;
        }
        body.batch-info-collapsed #batchBar .batch-group.batch-actions {
            display: grid;
            flex: 0 0 308px;
            min-width: 308px;
            margin-left: auto;
            padding: 0;
            border: 0;
        }
        .batch-bar.batch-collapsed .batch-group.batch-actions .batch-action-column {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 8px;
        }
        body.batch-info-collapsed #batchBar .batch-group.batch-actions .batch-action-column {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 8px;
        }
        .batch-bar.batch-collapsed .batch-workflow-row {
            display: block;
            grid-column: 1;
            grid-row: 1;
        }
        body.batch-info-collapsed #batchBar .batch-workflow-row {
            display: block;
            grid-column: 1;
            grid-row: 1;
        }
        .batch-bar.batch-collapsed .batch-btn.export-primary {
            grid-column: 2;
            grid-row: 1;
        }
        body.batch-info-collapsed #batchBar .batch-btn.export-primary {
            grid-column: 2;
            grid-row: 1;
        }
        .batch-bar.batch-collapsed .batch-btn {
            min-height: 38px;
        }
        .batch-bar.batch-collapsed .batch-group-picker {
            flex: 1 1 auto;
            display: grid;
            grid-template-columns: auto minmax(220px, 420px) minmax(0, 1fr);
            align-items: center;
            gap: 10px;
            padding: 0;
            border: 0;
        }
        .batch-bar.batch-collapsed .batch-picker-heading {
            justify-content: flex-start;
        }
        .batch-bar.batch-collapsed .batch-group-controls {
            flex-wrap: nowrap;
        }
        .batch-bar.batch-collapsed .batch-picker-controls {
            grid-template-columns: minmax(0, 1fr) 38px;
        }
        .batch-bar.batch-collapsed #batchSelector {
            height: 38px;
        }
        .batch-bar.batch-collapsed .batch-create-btn {
            width: 38px;
            height: 38px;
        }
        .batch-bar.batch-collapsed .batch-active-line {
            min-height: 0;
            flex-wrap: nowrap;
            overflow: hidden;
        }
        .batch-bar.batch-collapsed .batch-active-name {
            max-width: 180px;
            flex: 0 1 auto;
        }
        .batch-bar.batch-collapsed .batch-active-meta {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* ─── Replace Card Modal ────────────────────── */
        .modal-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.85); z-index: 100;
            align-items: center; justify-content: center;
            overflow-y: auto;
        }
        .modal-overlay.active { display: flex; }
        .modal {
            width: 100%; max-width: 1100px; margin: 24px;
            background: var(--bg-secondary); border: 1px solid var(--border);
            border-radius: var(--radius); display: flex; flex-direction: column;
            max-height: calc(100vh - 48px); overflow: hidden;
        }
        .match-view-container .modal {
            width: 100%;
            max-width: none;
            margin: 0;
        }
        body.listing-view-match .match-view-container .modal {
            height: 100%;
            max-height: 100%;
            min-height: 0;
        }
        body.batch-info-collapsed .match-view-container {
            margin-top: 8px !important;
        }
        body.batch-info-collapsed .match-view-container .modal {
            max-height: calc(100dvh - 20px);
            margin-top: 12px;
            margin-bottom: 12px;
        }
        body.listing-view-match.batch-info-collapsed .match-view-container .modal {
            max-height: 100%;
            margin-top: 0;
            margin-bottom: 0;
        }
        .modal-header {
            display: flex; align-items: center; justify-content: space-between;
            gap: 16px;
            min-height: 56px;
            padding: 8px 14px 8px 18px; border-bottom: 1px solid var(--border);
        }
        .modal-title-block {
            min-width: 0;
            flex: 1 1 auto;
        }
        .modal-title-row {
            display: flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
        }
        .modal-header h2 {
            display: flex;
            align-items: baseline;
            gap: 6px;
            min-width: 0;
            font-size: 15px;
            font-weight: 800;
            line-height: 1.15;
            margin: 0;
            white-space: nowrap;
        }
        .modal-title-separator {
            color: var(--text-muted);
            font-weight: 700;
        }
        .modal-header .card-info {
            min-width: 0;
            max-width: 280px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .modal-title-help {
            position: relative;
            width: 24px;
            height: 24px;
            border-radius: 7px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 800;
            line-height: 1;
            cursor: help;
            display: flex; align-items: center; justify-content: center;
            box-shadow: var(--shadow-sm);
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
        }
        .modal-title-help:hover,
        .modal-title-help:focus-visible {
            background: var(--surface);
            border-color: var(--border-focus);
            color: var(--accent);
            transform: translateY(-1px);
        }
        .modal-title-help::after {
            content: attr(data-tooltip);
            position: absolute;
            top: 50%;
            left: calc(100% + 10px);
            transform: translateY(-50%);
            width: max-content;
            max-width: 260px;
            padding: 7px 9px;
            border-radius: 6px;
            background: #111827;
            color: #fff;
            font-size: 11px;
            font-weight: 600;
            line-height: 1.35;
            white-space: normal;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease;
            z-index: 40;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
        }
        .modal-title-help:hover::after,
        .modal-title-help:focus-visible::after {
            opacity: 1;
        }

        /* Top comparison: Your Photo + Current Match side by side */
        .modal-match-body {
            display: grid;
            grid-template-columns: minmax(680px, 1fr) minmax(360px, 760px);
            min-height: 0;
            flex: 1;
            border-bottom: 1px solid var(--border);
        }
        .modal-comparison-panel {
            min-width: 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            border-right: 1px solid var(--border);
        }
        .modal-results-panel {
            min-width: 0;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .modal-top {
            display: grid;
            grid-template-columns: repeat(2, minmax(240px, var(--match-card-width, 420px)));
            justify-content: end;
            gap: clamp(18px, 1.2vw, 36px);
            padding: clamp(12px, 1.5vw, 22px) clamp(16px, 1.8vw, 28px) 10px;
            flex: 0 0 auto;
            align-items: start;
        }
        .modal-card-preview {
            text-align: center; position: relative; overflow: hidden; border-radius: 8px; min-width: 0;
            display: flex; flex-direction: column; align-items: center;
        }
        .modal-card-preview.uploaded-preview {
            align-items: center;
        }
        .modal-card-preview .preview-label {
            align-self: center;
            margin-bottom: 9px;
            padding: 0;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 850;
            line-height: 1.2;
            letter-spacing: 0;
            text-transform: uppercase;
        }
        .modal-card-preview .preview-label.uploaded,
        .modal-card-preview .preview-label.current {
            color: var(--text-secondary);
        }
        .preview-label-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 25px;
            margin-bottom: 9px;
        }
        .preview-label-row .preview-label {
            margin-bottom: 0;
        }
        .current-match-confidence {
            display: inline-flex;
            align-items: center;
            min-height: 24px;
            padding: 0 9px;
            border-radius: 999px;
            background: var(--throne-status-success-bg, #ecfdf5);
            color: var(--throne-status-success-text, #047857);
            font-size: 11px;
            font-weight: 900;
            line-height: 1;
            white-space: nowrap;
        }
        .current-match-confidence.confidence-medium {
            background: var(--throne-status-warning-bg, #fffbeb);
            color: var(--throne-status-warning-text, #92400e);
        }
        .current-match-confidence.confidence-low {
            background: var(--throne-status-danger-bg, #fff5f5);
            color: var(--throne-status-danger-text, #b91c1c);
        }
        .modal-card-img {
            width: min(100%, var(--match-card-width, 420px));
            max-width: 100%;
            height: auto;
            max-height: none;
            aspect-ratio: 5/7;
            border-radius: 8px;
            border: 1px solid var(--border);
            object-fit: contain;
            transition: transform 0.3s ease;
        }

        /* Magnification Tool */
        .selection-box { position: absolute; border: 2px solid var(--accent); background: rgba(99, 102, 241, 0.2); display: none; pointer-events: none; z-index: 100; }
        .magnify-mode img { cursor: crosshair !important; }
        .loupe-lens { position: absolute; border: 4px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.8); border-radius: 50%; background-repeat: no-repeat; cursor: grab; z-index: 110; display: none; background-color: var(--bg-card); }
        .loupe-lens:active { cursor: grabbing; }

        .modal-card-name {
            margin-top: 12px; font-size: 20px; font-weight: 800;
            line-height: 1.15;
            color: var(--text-primary);
        }
        .modal-card-set {
            max-width: 360px;
            margin: 6px auto 0;
            font-size: 14px;
            font-weight: 700;
            line-height: 1.35;
            color: var(--text-primary);
            overflow-wrap: anywhere;
        }
        .modal-card-debug {
            max-width: 360px;
            margin: 5px auto 0;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.35;
            color: var(--text-muted);
            overflow-wrap: anywhere;
        }

        /* Search + Results */
        .modal-search {
            padding: 12px 20px; border-bottom: 1px solid var(--border);
        }
        .modal-search input {
            width: 100%; padding: 10px 14px; background: var(--bg-input);
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            color: var(--text-primary); font-size: 14px; font-family: inherit;
        }
        .modal-search input:focus {
            outline: none; border-color: var(--border-focus);
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
        }
        .modal-search input::placeholder { color: var(--text-muted); }
        .modal-results { flex: 1; overflow-y: auto; padding: 12px 20px; max-height: none; min-height: 0; }
        .modal-results-header {
            display: flex; align-items: center; justify-content: space-between;
            gap: 12px; margin-bottom: 10px;
        }
        .modal-results-header .modal-section-label { margin: 0; min-width: 0; }
        .modal-results-header-actions {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            flex: 0 0 auto;
        }
        .modal-results-header .result-count {
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
        }
        .match-results-view-toggle {
            display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px;
            padding: 2px; border: 1px solid var(--border); border-radius: 7px;
            background: var(--bg-input);
        }
        .match-results-view-toggle button {
            min-width: 44px; height: 26px; padding: 0 9px; border: 0; border-radius: 5px;
            background: transparent; color: var(--text-secondary); font: inherit;
            font-size: 11px; font-weight: 800; letter-spacing: 0; cursor: pointer;
        }
        .match-results-view-toggle button.active {
            background: var(--surface); color: var(--accent);
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
        }
        .modal-results-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
            gap: 10px;
        }
        .modal-results-grid.list-view {
            display: flex; flex-direction: column; gap: 4px;
        }
        .modal-results-grid .no-results { grid-column: 1 / -1; }
        .match-card {
            display: flex; flex-direction: column; gap: 8px; padding: 10px;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-sm); cursor: pointer;
            transition: all 0.2s; position: relative;
        }
        .match-card:hover {
            background: var(--bg-card-hover);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .match-card.selected {
            border-color: var(--green);
            box-shadow: 0 0 0 1px var(--green);
        }
        .match-card-img-wrap {
            position: relative; flex-shrink: 0; text-align: center;
        }
        .match-card-img {
            width: 100%; max-width: 140px; aspect-ratio: 5/7;
            border-radius: 6px; object-fit: cover; display: block;
            margin: 0 auto; cursor: pointer;
            transition: box-shadow 0.2s;
        }
        .match-card:hover .match-card-img {
            box-shadow: 0 0 12px rgba(99,102,241,0.3);
        }
        .match-card-info { min-width: 0; }
        .match-card-name {
            font-size: 13px; font-weight: 700; line-height: 1.3;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
        }
        .match-card-set {
            font-size: 11px; color: var(--text-secondary); margin-top: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .match-card-details {
            font-size: 13px; font-weight: 600; color: var(--text-primary); margin-top: 2px;
        }
        .match-card-conf {
            position: absolute; top: 6px; right: 6px;
            font-size: 10px; font-weight: 700; padding: 2px 6px;
            border-radius: 4px; line-height: 1.2; text-align: center;
            border: 1px solid rgba(255,255,255,0.85);
            box-shadow: 0 1px 4px rgba(15,23,42,0.28);
        }
        .match-card-conf.high { background: #059669; color: #ffffff; }
        .match-card-conf.med { background: #f59e0b; color: #111827; }
        .match-card-conf.low { background: #dc2626; color: #ffffff; }
        .match-card-price {
            font-size: 14px; font-weight: 700; color: var(--green); margin-top: 2px;
        }
        .match-card-variants {
            display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
        }
        .match-variant-btn {
            border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary);
            border-radius: 6px; padding: 3px 6px; font-size: 10px; font-weight: 700;
            line-height: 1.2; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; font-family: inherit;
        }
        .match-variant-btn:hover {
            border-color: var(--accent); color: var(--accent); background: rgba(59, 130, 246, 0.08);
        }
        .match-card-list-row {
            display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(118px, 150px);
            align-items: center; gap: 8px; padding: 6px 8px;
            min-height: 68px;
        }
        .match-card-list-row:hover { transform: none; }
        .match-card-list-row .match-card-img-wrap { text-align: left; }
        .match-card-list-row .match-card-img {
            width: 42px; max-width: 42px; height: 59px; aspect-ratio: auto; margin: 0;
        }
        .match-card-list-row .match-card-name {
            font-size: 13px; line-height: 1.25; -webkit-line-clamp: 1;
        }
        .match-card-list-row .match-card-set {
            font-size: 11px; margin-top: 2px;
        }
        .match-list-meta {
            display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: baseline;
            margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--text-primary);
        }
        .match-list-meta .match-card-price {
            margin: 0; font-size: 12px; line-height: 1.2;
        }
        .match-list-actions {
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
        }
        .match-list-actions .match-card-conf {
            position: static;
            align-self: flex-end;
            margin-bottom: 0;
        }
        .match-card-list-row .match-card-variants {
            flex-direction: column; flex-wrap: nowrap; align-items: stretch;
            gap: 3px; margin: 0; min-width: 0;
        }
        .match-card-list-row.no-actions .match-card-info { grid-column: 2 / -1; }
        .match-card-list-row.has-confidence .match-card-variants { padding-top: 0; }
        .match-card-list-row .match-variant-btn {
            width: 100%; text-align: left; padding: 3px 7px; font-size: 10px;
        }
        @media (max-width: 640px) {
            .modal-results-header { align-items: stretch; flex-direction: column; }
            .modal-results-header-actions {
                align-self: flex-start;
                flex-wrap: wrap;
                justify-content: flex-start;
            }
            .match-results-view-toggle { align-self: flex-start; }
            .match-card-list-row {
                grid-template-columns: 48px minmax(0, 1fr);
                align-items: start;
            }
            .match-card-list-row .match-card-img { width: 42px; max-width: 42px; height: 59px; }
            .match-card-list-row .match-list-actions {
                grid-column: 2; padding-top: 0;
            }
            .match-card-list-row.has-confidence .match-card-variants { padding-top: 0; }
        }
        .export-dialog-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 10050;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(15, 23, 42, 0.62);
            backdrop-filter: blur(6px);
        }
        .export-dialog-overlay.active { display: flex; }
        .export-dialog {
            width: min(560px, 100%);
            max-height: calc(100dvh - 40px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-card);
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
        }
        .export-dialog-header {
            display: grid;
            grid-template-columns: 40px 1fr;
            gap: 12px;
            padding: 18px 20px 14px;
            border-bottom: 1px solid var(--border);
        }
        .export-dialog-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: rgba(234, 179, 8, 0.14);
            color: #a16207;
        }
        .export-dialog-title {
            margin: 0 0 4px;
            color: var(--text-primary);
            font-size: 17px;
            font-weight: 800;
            line-height: 1.25;
        }
        .export-dialog-message {
            margin: 0;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 600;
            line-height: 1.45;
        }
        .export-dialog-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 16px 20px;
            overflow-y: auto;
        }
        .export-dialog-section[hidden] { display: none; }
        .export-dialog-section-title {
            margin: 0 0 8px;
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .export-dialog-warning-list,
        .export-dialog-example-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .export-dialog-warning-item {
            display: grid;
            grid-template-columns: 20px 1fr;
            gap: 8px;
            padding: 10px 12px;
            border: 1px solid rgba(234, 179, 8, 0.28);
            border-radius: 8px;
            background: rgba(234, 179, 8, 0.08);
        }
        .export-dialog-warning-mark {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: #f59e0b;
            color: #fff;
            font-size: 13px;
            font-weight: 900;
            line-height: 1;
        }
        .export-dialog-warning-label {
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 800;
            line-height: 1.3;
        }
        .export-dialog-warning-detail,
        .export-dialog-counts,
        .export-dialog-more {
            margin-top: 2px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.4;
        }
        .export-dialog-counts {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 0;
        }
        .export-dialog-count {
            padding: 4px 7px;
            border: 1px solid var(--border);
            border-radius: 7px;
            background: var(--bg-input);
        }
        .export-dialog-count.blocker {
            border-color: rgba(239, 68, 68, 0.24);
            background: rgba(239, 68, 68, 0.08);
            color: #991b1b;
        }
        .export-dialog-count.warning {
            border-color: rgba(234, 179, 8, 0.3);
            background: rgba(234, 179, 8, 0.08);
            color: #854d0e;
        }
        .export-dialog-example-item {
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface-hover);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.4;
        }
        .export-dialog-example-item.blocker {
            border-color: rgba(239, 68, 68, 0.24);
            background: rgba(239, 68, 68, 0.06);
        }
        .export-dialog-example-item.warning {
            border-color: rgba(234, 179, 8, 0.3);
            background: rgba(234, 179, 8, 0.06);
        }
        .export-dialog-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 14px 20px;
            border-top: 1px solid var(--border);
            background: var(--bg-input);
        }
        body.listing-dialog-open { overflow: hidden; }
        .listing-dialog-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 10050;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(15, 23, 42, 0.62);
            backdrop-filter: blur(6px);
        }
        .listing-dialog-overlay.active { display: flex; }
        .listing-dialog {
            width: min(520px, 100%);
            max-height: calc(100dvh - 40px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-card);
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
        }
        .listing-dialog-header {
            display: grid;
            grid-template-columns: 40px minmax(0, 1fr);
            gap: 12px;
            padding: 18px 20px 16px;
            border-bottom: 1px solid var(--border);
        }
        .listing-dialog-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: rgba(3, 83, 164, 0.1);
            color: var(--accent);
        }
        .listing-dialog-icon.warning {
            background: rgba(234, 179, 8, 0.14);
            color: #a16207;
        }
        .listing-dialog-icon.danger {
            background: rgba(239, 68, 68, 0.1);
            color: #dc2626;
        }
        .listing-dialog-icon.success {
            background: rgba(16, 185, 129, 0.12);
            color: #047857;
        }
        .listing-dialog-title {
            margin: 0 0 5px;
            color: var(--text-primary);
            font-size: 17px;
            font-weight: 800;
            line-height: 1.25;
        }
        .listing-dialog-message {
            margin: 0;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 600;
            line-height: 1.45;
            white-space: pre-line;
        }
        .listing-dialog-details {
            margin-top: 12px;
            max-height: 220px;
            overflow: auto;
        }
        .listing-dialog-detail-list {
            display: grid;
            gap: 8px;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .listing-dialog-detail-item {
            padding: 9px 10px;
            border: 1px solid rgba(234, 179, 8, 0.28);
            border-radius: 8px;
            background: rgba(234, 179, 8, 0.08);
        }
        .listing-dialog-detail-label {
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 850;
            line-height: 1.35;
        }
        .listing-dialog-detail-text {
            margin-top: 3px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.4;
        }
        .listing-dialog-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 14px 20px;
            border-top: 1px solid var(--border);
            background: var(--bg-input);
        }
        .direct-merge-dialog-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 10060;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(15, 23, 42, 0.62);
            backdrop-filter: blur(6px);
        }
        .direct-merge-dialog-overlay.active { display: flex; }
        .direct-merge-dialog {
            width: min(980px, 100%);
            max-height: calc(100dvh - 40px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-card);
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
        }
        .direct-merge-dialog-header {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 16px;
            padding: 18px 20px 14px;
            border-bottom: 1px solid var(--border);
        }
        .direct-merge-dialog-header h2 {
            margin: 0 0 6px;
            color: var(--text-primary);
            font-size: 18px;
            font-weight: 800;
        }
        .direct-merge-dialog-header p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 600;
            line-height: 1.4;
        }
        .direct-merge-close {
            width: 36px;
            height: 36px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-secondary);
            font-size: 22px;
            font-weight: 700;
            line-height: 1;
            cursor: pointer;
        }
        .direct-merge-dialog-tools {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            padding: 12px 20px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-input);
        }
        .direct-merge-list {
            display: grid;
            gap: 10px;
            padding: 14px 20px;
            overflow: auto;
        }
        .direct-merge-row {
            display: grid;
            grid-template-columns: 96px minmax(0, 1fr);
            gap: 12px;
            align-items: start;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
        }
        .direct-merge-row.selected {
            border-color: rgba(3, 83, 164, 0.35);
            background: rgba(3, 83, 164, 0.04);
        }
        .direct-merge-check {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--accent);
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
        }
        .direct-merge-check input {
            width: 18px;
            height: 18px;
            accent-color: var(--accent);
        }
        .direct-merge-card {
            min-width: 0;
            display: grid;
            gap: 8px;
        }
        .direct-merge-card-title {
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 800;
            line-height: 1.3;
        }
        .direct-merge-card-meta,
        .direct-merge-target-meta {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.35;
        }
        .direct-merge-ebay-item-link {
            color: var(--accent);
            font-weight: 800;
            text-decoration: underline;
            text-underline-offset: 2px;
            white-space: nowrap;
        }
        .direct-merge-ebay-item-link:hover {
            color: #03437f;
        }
        .direct-merge-target {
            display: grid;
            grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
            gap: 10px;
            align-items: center;
        }
        .direct-merge-target select {
            width: 100%;
            min-height: 42px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 800;
            padding: 0 12px;
        }
        .direct-merge-target select:disabled {
            opacity: 0.55;
        }
        .direct-merge-price-choice {
            display: grid;
            grid-template-columns: 116px minmax(220px, 360px);
            gap: 10px;
            align-items: center;
        }
        .direct-merge-price-choice label {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 800;
        }
        .direct-merge-price-choice select {
            width: 100%;
            min-height: 38px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 800;
            padding: 0 12px;
        }
        .direct-merge-price-choice select:disabled {
            opacity: 0.55;
        }
        .direct-merge-dialog-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 14px 20px;
            border-top: 1px solid var(--border);
            background: var(--bg-input);
        }
        .list-edit-dialog {
            width: min(960px, 100%);
        }
        .list-edit-dialog .listing-dialog-header {
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: start;
        }
        .list-edit-close {
            width: 32px;
            height: 32px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 20px;
            line-height: 1;
        }
        .list-edit-close:hover {
            color: var(--text-primary);
            border-color: var(--border-hover);
            background: var(--bg-hover);
        }
        .list-edit-body {
            overflow: auto;
            padding: 18px 20px;
            background: var(--surface-hover);
        }
        .list-edit-title-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 10px;
            align-items: center;
            margin-bottom: 14px;
        }
        .list-edit-title-row .title-input {
            margin: 0;
        }
        .list-edit-fields-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
            margin-bottom: 0;
        }
        .list-edit-fields-grid .field-card {
            border-radius: 8px;
            padding: 1rem 1.1rem;
        }
        .list-edit-wide {
            grid-column: 1 / -1;
        }
        .list-edit-specifics-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px 18px;
        }
        .list-edit-images-card {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .list-edit-image-manager {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .list-edit-primary-photos {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .list-edit-photo-tile,
        .list-edit-extra-card {
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            padding: 10px;
        }
        .list-edit-photo-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .list-edit-photo-preview {
            width: 100%;
            aspect-ratio: 3 / 4.18;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--surface);
            object-fit: contain;
            display: block;
        }
        .list-edit-photo-actions,
        .list-edit-extra-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }
        .list-edit-image-btn {
            min-height: 34px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text-primary);
            cursor: pointer;
            font-size: 12px;
            font-weight: 800;
            padding: 0 12px;
        }
        .list-edit-image-btn:hover {
            border-color: var(--border-hover);
            background: var(--bg-hover);
        }
        .list-edit-image-btn.danger {
            color: var(--danger);
        }
        .list-edit-image-btn:disabled {
            cursor: not-allowed;
            opacity: 0.45;
        }
        .list-edit-extra-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .list-edit-extra-title {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 900;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .list-edit-extra-strip {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 12px;
        }
        .list-edit-extra-thumb {
            width: 100%;
            aspect-ratio: 1 / 1;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--surface);
            object-fit: contain;
            display: block;
        }
        .list-edit-empty-images {
            border: 1px dashed var(--border);
            border-radius: 8px;
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 700;
            padding: 14px;
            text-align: center;
        }
        .list-edit-variant-section[hidden] {
            display: none;
        }
        .list-edit-variant-section {
            margin-bottom: 14px;
            border-radius: 8px;
            padding: 1rem 1.1rem;
        }
        .list-edit-variant-section .pill-group {
            margin-bottom: 0;
        }
        .list-edit-dialog .listing-dialog-footer .btn {
            min-width: 112px;
            justify-content: center;
        }
        @media (max-width: 560px) {
            .export-dialog-overlay { padding: 12px; align-items: flex-end; }
            .export-dialog { max-height: calc(100dvh - 24px); }
            .export-dialog-header { grid-template-columns: 1fr; }
            .export-dialog-icon { display: none; }
            .export-dialog-footer { flex-direction: column-reverse; }
            .export-dialog-footer .btn { justify-content: center; width: 100%; }
            .listing-dialog-overlay { padding: 12px; align-items: flex-end; }
            .listing-dialog { max-height: calc(100dvh - 24px); }
            .listing-dialog-header { grid-template-columns: 1fr; }
            .listing-dialog-icon { display: none; }
            .listing-dialog-footer { flex-direction: column-reverse; }
            .listing-dialog-footer .btn { justify-content: center; width: 100%; }
            .direct-merge-dialog-overlay { padding: 12px; align-items: flex-end; }
            .direct-merge-dialog { max-height: calc(100dvh - 24px); }
            .direct-merge-dialog-tools,
            .direct-merge-dialog-footer { flex-direction: column; }
            .direct-merge-dialog-tools .btn,
            .direct-merge-dialog-footer .btn { width: 100%; justify-content: center; }
            .direct-merge-row,
            .direct-merge-target,
            .direct-merge-price-choice { grid-template-columns: 1fr; }
        }
        @media (max-width: 760px) {
            .list-edit-dialog {
                max-height: calc(100dvh - 24px);
            }
            .list-edit-fields-grid,
            .list-edit-specifics-grid,
            .list-edit-primary-photos {
                grid-template-columns: 1fr;
            }
            .list-edit-title-row {
                grid-template-columns: 1fr;
            }
        }
        .auto-advance {
            display: flex; align-items: center; gap: 6px; font-size: 12px;
            color: var(--text-secondary); cursor: pointer; user-select: none;
            white-space: nowrap;
            flex: 0 0 auto;
        }
        .auto-advance input {
            width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer;
        }
        .modal-nav-arrows {
            display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 5px;
            flex: 0 1 auto;
            min-width: 0;
        }
        .modal-tool-group {
            display: flex;
            align-items: center;
            gap: 5px;
            padding-right: 7px;
            margin-right: 1px;
            border-right: 1px solid var(--border);
        }
        .modal-tool-group:last-of-type {
            margin-right: 0;
        }
        .loupe-tool-group {
            gap: 8px;
        }
        .loupe-selects {
            display: none;
            align-items: center;
            gap: 6px;
        }
        .loupe-selects.is-visible {
            display: flex;
        }
        .loupe-control-select {
            height: 34px;
            min-height: 34px;
            padding: 0 2rem 0 0.78rem;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 12px;
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
        }
        .loupe-shape-select {
            width: 92px;
        }
        .loupe-size-select {
            width: 136px;
        }
        .loupe-selects .smooth-select-proxy {
            flex: 0 0 auto;
            width: var(--throne-smooth-width, auto);
        }
        .loupe-selects .smooth-select-trigger {
            height: 34px;
            min-height: 34px;
            padding: 0 0.62rem 0 0.78rem;
            border-radius: 9px;
            font-size: 12px;
            font-weight: 850;
        }
        .loupe-selects .smooth-select-panel {
            min-width: 100%;
        }
        .modal-nav-group {
            padding-left: 2px;
        }
        .modal-card-nav-group {
            gap: 6px;
        }
        .modal-nav-btn {
            width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border);
            background: var(--bg-card); color: var(--text-secondary);
            font-size: 16px; cursor: pointer; transition: all 0.2s;
            display: flex; align-items: center; justify-content: center;
            box-shadow: var(--shadow-sm);
        }
        .modal-nav-btn svg {
            width: 17px;
            height: 17px;
            display: block;
        }
        .modal-nav-btn:hover:not(:disabled),
        .modal-nav-btn:focus-visible:not(:disabled) {
            background: var(--surface);
            border-color: var(--border-focus);
            color: var(--accent);
            transform: translateY(-1px);
        }
        .modal-nav-btn.tool-warning {
            color: var(--yellow);
        }
        .modal-nav-btn.modal-delete-btn {
            color: var(--red);
        }
        .modal-nav-btn.modal-delete-btn:hover:not(:disabled) {
            background: var(--red);
            border-color: var(--red);
            color: #fff;
        }
        .modal-card-action {
            min-width: 78px;
            min-height: 34px;
            padding: 0 11px;
            border-radius: 8px;
            justify-content: center;
            white-space: nowrap;
        }
        .modal-card-action svg {
            width: 16px;
            height: 16px;
            display: block;
        }
        .modal-card-action:disabled,
        .modal-card-action:disabled:hover {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
            box-shadow: var(--shadow-sm);
        }
        .modal-delete-action {
            width: 34px;
            min-width: 34px;
            padding: 0;
            border-radius: 8px;
            align-items: center;
            justify-content: center;
        }
        .modal-card-position {
            min-width: 62px;
            padding: 0 9px;
            min-height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.56);
            text-align: center;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .modal-done-action {
            min-height: 34px;
            padding: 0 12px;
            border-radius: 8px;
            white-space: nowrap;
        }
        body.listing-view-match .match-view-container .modal-header {
            display: none;
        }

        .report-issue-overlay {
            position: fixed;
            inset: 0;
            z-index: 1300;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(15, 23, 42, 0.48);
            backdrop-filter: blur(4px);
        }
        .report-issue-overlay[hidden] {
            display: none;
        }
        .report-issue-dialog {
            width: min(620px, calc(100vw - 32px));
            max-height: min(820px, calc(100dvh - 32px));
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 16px;
            background: var(--surface);
            color: var(--text-primary);
            box-shadow: var(--shadow-md);
        }
        .report-issue-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 20px 22px 16px;
            border-bottom: 1px solid var(--border);
        }
        .report-issue-header h2 {
            margin: 0;
            font-size: 21px;
            line-height: 1.2;
            font-weight: 900;
        }
        .report-issue-header p {
            margin: 6px 0 0;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 700;
        }
        .report-issue-close {
            width: 34px;
            height: 34px;
            flex: 0 0 auto;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--surface-hover);
            color: var(--text-secondary);
            font: inherit;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
        }
        .report-issue-close:hover,
        .report-issue-close:focus-visible {
            border-color: var(--border-focus);
            color: var(--accent);
        }
        .report-issue-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
            max-height: calc(100dvh - 150px);
            overflow-y: auto;
            padding: 18px 22px 22px;
        }
        .report-issue-types {
            display: grid;
            gap: 7px;
            min-width: 0;
            margin: 0;
            padding: 0;
            border: 0;
        }
        .report-issue-types legend,
        .report-issue-description > span {
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .report-issue-types label {
            display: grid;
            grid-template-columns: 18px minmax(0, 1fr);
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface);
            cursor: pointer;
            transition: border-color 0.15s ease, background 0.15s ease;
        }
        .report-issue-types label:hover,
        .report-issue-types label:has(input:checked) {
            border-color: rgba(3, 83, 164, 0.34);
            background: var(--throne-status-info-bg, #eef6ff);
        }
        .report-issue-types input {
            width: 16px;
            height: 16px;
            margin: 2px 0 0;
            accent-color: var(--accent);
        }
        .report-issue-types span {
            display: grid;
            gap: 2px;
            min-width: 0;
        }
        .report-issue-types strong {
            font-size: 14px;
            font-weight: 850;
        }
        .report-issue-types small {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.35;
        }
        .report-issue-description {
            display: flex;
            flex-direction: column;
        }
        .report-issue-description textarea {
            width: 100%;
            min-height: 112px;
            resize: vertical;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            color: var(--text-primary);
            font: inherit;
            font-size: 14px;
            line-height: 1.5;
        }
        .report-issue-description textarea:focus {
            outline: 0;
            border-color: var(--border-focus);
            box-shadow: 0 0 0 3px var(--throne-focus-ring, rgba(3, 83, 164, 0.2));
        }
        .report-issue-helper,
        .report-issue-error {
            margin: 0;
            font-size: 12px;
            font-weight: 650;
            line-height: 1.45;
        }
        .report-issue-helper { color: var(--text-secondary); }
        .report-issue-error {
            padding: 9px 11px;
            border-radius: 9px;
            background: var(--throne-status-danger-bg, #fff5f5);
            color: var(--throne-status-danger-text, #b91c1c);
        }
        .report-issue-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            padding-top: 2px;
        }
        .report-issue-actions .btn {
            min-height: 42px;
            padding-inline: 18px;
        }
        @media (max-width: 640px) {
            .report-issue-overlay { padding: 10px; }
            .report-issue-dialog { width: 100%; max-height: calc(100dvh - 20px); }
            .report-issue-header { padding: 17px 16px 14px; }
            .report-issue-form { padding: 15px 16px 18px; }
        }
        @media (max-width: 1200px) {
            .modal-match-body {
                grid-template-columns: 1fr;
            }
            .modal-comparison-panel {
                border-right: none;
                border-bottom: 1px solid var(--border);
            }
            .modal-top {
                grid-template-columns: repeat(2, minmax(240px, 340px));
            }
            .modal-results {
                max-height: 520px;
            }
        }
        @media (max-width: 720px) {
            .modal-top {
                grid-template-columns: 1fr;
            }
        }

        /* ─── List View Styles ─── */
        .list-view-container {
            display: none; /* hidden by default */
            flex-direction: column; gap: 4px; width: 100%;
            container-name: list-view;
            container-type: inline-size;
            --lv-control-height: 42px;
            --lv-control-radius: 8px;
            --lv-thumb-width: 68px;
            --lv-thumb-height: 94px;
            --lv-thumb-column-width: 146px;
        }
        .list-view-container.active { display: flex; }
        .list-bottom-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
            padding: 10px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.94);
            box-shadow: var(--shadow-sm);
        }
        .list-bottom-action-group {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            min-width: 0;
        }
        .list-bottom-action-group.primary {
            flex: 0 1 auto;
        }
        .list-bottom-action-group.secondary {
            flex: 1 1 360px;
            justify-content: flex-end;
            margin-left: auto;
        }
        .list-bottom-actions .batch-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            flex: 0 0 auto;
            width: auto;
            min-width: 118px;
            min-height: 40px;
            padding: 0 13px;
        }
        .list-bottom-actions .batch-btn.direct-ebay {
            background: #0f766e;
            border-color: #0f766e;
            color: #fff;
            box-shadow: 0 5px 14px rgba(15, 118, 110, 0.18);
        }
        .list-bottom-actions .batch-btn.direct-ebay:hover:not(:disabled) {
            background: #0d6b64;
            border-color: #0d6b64;
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 7px 16px rgba(15, 118, 110, 0.24);
        }
        .list-bottom-actions .batch-btn.direct-ebay.direct-ebay-locked,
        .list-bottom-actions .batch-btn.direct-ebay:disabled {
            background: var(--bg-input);
            border-color: var(--border);
            color: var(--text-muted);
            box-shadow: none;
        }
        @media (max-width: 900px) {
            .list-bottom-action-group.secondary {
                flex-basis: 100%;
            }
        }

        .lot-view-container {
            display: none;
            width: 100%;
            gap: 16px;
            align-items: start;
            grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
        }
        .lot-view-container.active { display: grid; }
        .lot-preview-card,
        .lot-editor-card,
        .lot-manifest-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: var(--shadow-sm);
        }
        .lot-preview-card {
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .lot-cover-frame {
            width: 100%;
            aspect-ratio: 1 / 1;
            background: #050505;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            overflow: hidden;
            display: grid;
            place-items: center;
            position: relative;
        }
        .lot-cover-frame.is-white-bg {
            background: #fff;
            border-color: rgba(15, 23, 42, 0.16);
        }
        .lot-cover-frame img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: none;
        }
        .lot-cover-frame.has-image img { display: block; }
        .lot-cover-placeholder {
            color: rgba(255,255,255,0.72);
            font-size: 0.84rem;
            font-weight: 800;
            text-align: center;
            padding: 20px;
        }
        .lot-cover-frame.is-white-bg .lot-cover-placeholder {
            color: rgba(15, 23, 42, 0.68);
        }
        .lot-cover-frame.has-image .lot-cover-placeholder { display: none; }
        .lot-cover-loading {
            position: absolute;
            inset: 0;
            z-index: 2;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 20px;
            background: #fff7ed;
            color: #7c2d12;
            text-align: center;
            font-size: 0.84rem;
            font-weight: 900;
            line-height: 1.15;
        }
        .lot-cover-loading small {
            display: block;
            max-width: 100%;
            color: #9a3412;
            font-size: 0.68rem;
            font-weight: 800;
            line-height: 1.2;
        }
        .lot-cover-frame.is-generating .lot-cover-loading { display: flex; }
        .lot-cover-frame.is-generating .lot-cover-placeholder { display: none; }
        .lot-cover-frame.is-generating.has-image img {
            display: block;
            opacity: 0.2;
        }
        .lot-cover-settings {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            min-width: 0;
        }
        .lot-cover-settings label {
            color: var(--text-secondary);
            font-size: 0.72rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .lot-cover-background-select {
            min-width: 128px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text-primary);
            font: inherit;
            font-size: 0.84rem;
            font-weight: 800;
            padding: 0.48rem 0.65rem;
        }
        .lot-cover-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .lot-pair-background-control {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 38px;
            color: var(--text-secondary);
            font-size: 0.72rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .lot-cover-actions .btn {
            min-height: 38px;
            padding: 0.44rem 0.75rem;
            border-radius: 8px;
        }
        .lot-editor-card {
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .lot-editor-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(110px, 0.28fr);
            gap: 12px;
        }
        .lot-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }
        .lot-field label {
            font-size: 0.72rem;
            font-weight: 900;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .lot-field input,
        .lot-field select,
        .lot-field textarea {
            width: 100%;
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text-primary);
            font: inherit;
            font-size: 0.9rem;
            padding: 0.66rem 0.74rem;
            box-sizing: border-box;
        }
        .lot-field textarea {
            min-height: 150px;
            resize: vertical;
            line-height: 1.35;
        }
        .lot-description-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .lot-description-heading .btn {
            min-height: 34px;
            padding: 0.36rem 0.64rem;
            border-radius: 8px;
            font-size: 0.78rem;
            white-space: nowrap;
        }
        .lot-final-description-preview {
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            padding: 12px;
        }
        .lot-final-description-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }
        .lot-final-description-header span {
            font-size: 0.72rem;
            font-weight: 900;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .lot-final-description-header small {
            font-size: 0.68rem;
            font-weight: 800;
            color: var(--text-secondary);
        }
        .lot-final-description-frame {
            min-height: 92px;
            max-height: 260px;
            overflow: auto;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #ffffff;
            color: #0f172a;
            padding: 12px;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 0.86rem;
            line-height: 1.45;
        }
        .lot-final-description-frame img,
        .lot-final-description-frame table,
        .lot-final-description-frame iframe {
            max-width: 100%;
        }
        .lot-final-description-empty {
            color: var(--text-secondary);
            font-weight: 800;
        }
        .lot-title-count {
            align-self: flex-end;
            font-size: 0.76rem;
            font-weight: 800;
            color: var(--text-secondary);
        }
        .lot-title-count.over-limit { color: var(--red); }
        .lot-stat-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
        }
        .lot-stat {
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 10px;
            background: var(--surface);
        }
        .lot-stat span {
            display: block;
            font-size: 0.68rem;
            font-weight: 900;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .lot-stat strong {
            display: block;
            margin-top: 4px;
            font-size: 1rem;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .lot-manifest-card {
            grid-column: 1 / -1;
            padding: 14px;
        }
        .lot-manifest-header {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
            margin-bottom: 10px;
        }
        .lot-manifest-header h3 {
            margin: 0;
            font-size: 0.98rem;
        }
        .lot-image-strip {
            display: grid;
            gap: 8px;
        }
        .lot-image-strip {
            grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
            margin-bottom: 12px;
        }
        .lot-image-tile {
            position: relative;
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            overflow: hidden;
        }
        .lot-image-tile.is-excluded {
            opacity: 0.48;
        }
        .lot-image-tile.needs-pair {
            border-color: rgba(245, 158, 11, 0.5);
            background: #fffbeb;
        }
        .lot-pair-pending-preview {
            width: 100%;
            aspect-ratio: 1 / 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 7px;
            padding: 12px 10px;
            background: #fff7ed;
            color: #7c2d12;
            text-align: center;
            font-size: 0.72rem;
            font-weight: 900;
            line-height: 1.15;
        }
        .lot-pair-pending-preview small {
            display: block;
            max-width: 100%;
            color: #9a3412;
            font-size: 0.62rem;
            font-weight: 800;
            line-height: 1.15;
        }
        .lot-pair-pending-spinner {
            width: 24px;
            height: 24px;
            border-radius: 999px;
            border: 3px solid rgba(251, 146, 60, 0.32);
            border-top-color: #f97316;
            animation: lotPairPendingSpin 0.85s linear infinite;
        }
        @keyframes lotPairPendingSpin {
            to { transform: rotate(360deg); }
        }
        .lot-image-tile img {
            width: 100%;
            aspect-ratio: 1 / 1;
            height: auto;
            object-fit: contain;
            display: block;
            background: #050505;
        }
        .lot-image-tile.is-white-bg img {
            background: #ffffff;
        }
        .lot-image-tile.is-black-bg img {
            background: #050505;
        }
        .lot-image-toggle {
            position: absolute;
            top: 6px;
            left: 6px;
            z-index: 2;
            display: grid;
            place-items: center;
            width: 22px;
            height: 22px;
            padding: 0;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.92);
            color: var(--text-primary);
            box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
        }
        .lot-image-toggle input {
            width: 14px;
            height: 14px;
            accent-color: var(--accent);
            margin: 0;
        }
        .lot-image-delete {
            position: absolute;
            top: 6px;
            right: 6px;
            z-index: 2;
            width: 24px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(220, 38, 38, 0.22);
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.94);
            color: #b91c1c;
            font-size: 18px;
            font-weight: 900;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
        }
        .lot-image-delete:hover,
        .lot-image-delete:focus-visible {
            outline: none;
            background: #dc2626;
            border-color: #dc2626;
            color: #ffffff;
        }
        .lot-image-title {
            padding: 7px 8px;
            font-size: 0.72rem;
            font-weight: 850;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        @media (max-width: 980px) {
            .lot-view-container {
                grid-template-columns: 1fr;
            }
            .lot-editor-grid,
            .lot-stat-grid {
                grid-template-columns: 1fr;
            }
        }

        .list-view-row {
            display: grid;
            grid-template-columns: 24px var(--lv-thumb-column-width) minmax(0, 1fr) 122px;
            gap: 9px; align-items: center; padding: 0.34rem 0.42rem;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: 10px;
            transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
            margin-bottom: 0;
            box-shadow: var(--shadow-sm);
        }
        .list-view-row.selected {
            border-color: rgba(0, 86, 162, 0.44);
            background: linear-gradient(90deg, rgba(0, 86, 162, 0.07), var(--bg-card) 34%);
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
        }
        .list-view-row.graded-row {
            border-color: rgba(3, 83, 164, 0.22);
            background: linear-gradient(90deg, rgba(3, 83, 164, 0.045), var(--bg-card) 28%);
        }
        .list-view-row.graded-row.selected {
            border-color: rgba(0, 86, 162, 0.48);
            background: linear-gradient(90deg, rgba(0, 86, 162, 0.09), var(--bg-card) 34%);
        }
        body.listing-flow-slabs .batch-field-game,
        body.listing-flow-slabs .batch-field-condition,
        body.listing-flow-slabs .batch-field-variant,
        body.listing-flow-slabs .batch-scan-mode-field,
        body.listing-flow-slabs .batch-workflow-row,
        body.listing-flow-slabs .batch-combine-btn {
            display: none !important;
        }
        body.listing-flow-slabs #batchActionsGroup {
            display: none !important;
        }
        body.listing-flow-slabs .batch-inline-controls {
            display: grid;
            grid-template-columns: minmax(150px, 190px) minmax(150px, 190px);
            justify-content: start;
        }
        body.listing-flow-slabs .batch-action-column {
            gap: 8px;
        }
        body.listing-flow-slabs .batch-action-row.slab-workflow-row {
            display: contents;
        }
        body.listing-flow-slabs .toolbar {
            display: none;
        }
        .stock-list-card {
            display: none;
            flex-direction: column;
            gap: 14px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 18px;
            box-shadow: var(--shadow-sm);
        }
        body.listing-flow-stock.stock-list-open .stock-list-card {
            display: flex;
        }
        body.listing-flow-stock .create-upload-card,
        body.listing-flow-stock .create-scan-mode-field {
            display: none !important;
        }
        body.listing-flow-stock.batch-create-mode .create-batch-flow {
            grid-template-columns: minmax(0, 1fr);
            max-width: 1320px;
            margin-left: auto;
            margin-right: auto;
            gap: 12px;
        }
        body.listing-flow-stock .create-batch-overview {
            gap: 10px;
            padding: 12px 16px;
        }
        body.listing-flow-stock .create-batch-overview h1 {
            font-size: clamp(24px, 2.2vw, 30px);
        }
        body.listing-flow-stock .create-batch-step {
            min-height: 52px;
            padding: 8px 10px;
            gap: 9px;
        }
        body.listing-flow-stock .create-step-number {
            width: 28px;
            height: 28px;
        }
        body.listing-flow-stock .create-batch-card {
            gap: 8px;
            padding: 12px 14px;
        }
        body.listing-flow-stock .create-batch-card,
        body.listing-flow-stock .stock-list-card {
            grid-column: 1 / -1;
        }
        body.listing-flow-stock .create-batch-grid {
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 8px 10px;
            align-items: end;
        }
        body.listing-flow-stock .create-section-heading {
            display: none;
        }
        body.listing-flow-stock .create-batch-grid .batch-detail-field.batch-name-field {
            grid-column: span 2;
        }
        body.listing-flow-stock .create-batch-grid .batch-field-game,
        body.listing-flow-stock .create-batch-grid .batch-field-config,
        body.listing-flow-stock .create-batch-grid .batch-field-category {
            grid-column: span 2;
        }
        body.listing-flow-stock .create-batch-grid .sku-preview-field {
            grid-column: span 2;
        }
        body.listing-flow-stock .create-batch-grid .batch-name-input,
        body.listing-flow-stock .create-batch-grid .sku-prefix-field input,
        body.listing-flow-stock .create-batch-grid .sku-increment-control,
        body.listing-flow-stock .create-batch-grid .batch-selector,
        body.listing-flow-stock .create-batch-grid .smooth-select-proxy {
            height: 36px;
            border-radius: 8px;
        }
        body.listing-flow-stock .create-batch-grid .scan-mode-label,
        body.listing-flow-stock .create-batch-grid .batch-detail-label {
            min-height: 16px;
            font-size: 0.7rem;
        }
        body.listing-flow-stock .create-batch-grid .sku-preview-value {
            min-height: 36px;
            padding: 8px 10px;
        }
        body.listing-flow-stock .create-batch-card h2 {
            font-size: 16px;
        }
        body.listing-flow-stock .create-batch-card > div:first-child {
            display: flex;
            align-items: baseline;
            gap: 10px;
            flex-wrap: wrap;
        }
        body.listing-flow-stock .create-batch-card > div:first-child .create-step-copy {
            margin-top: 0;
        }
        body.listing-flow-stock .create-batch-grid .batch-field-fast-scan,
        body.listing-flow-stock .create-batch-grid .create-scan-speed-heading {
            display: none !important;
        }
        body.listing-flow-stock #batchActionsGroup .batch-btn.listed,
        body.listing-flow-stock #exportBtn {
            display: none !important;
        }
        .stock-list-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }
        .stock-list-header h2 {
            margin: 0 0 4px;
            font-size: 1.05rem;
            color: var(--text-primary);
        }
        .stock-list-header p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 0.85rem;
        }
        .stock-search-bar {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto auto;
            gap: 10px;
            align-items: center;
        }
        .stock-search-input {
            min-height: 44px;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0 12px;
            font-size: 0.95rem;
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.86);
        }
        .stock-search-results {
            display: grid;
            gap: 8px;
        }
        .stock-result-row {
            display: grid;
            grid-template-columns: 68px minmax(260px, 1fr) minmax(112px, 132px) minmax(154px, 200px) 82px 84px;
            gap: 12px;
            align-items: center;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.68);
        }
        .stock-result-image {
            width: 56px;
            height: 78px;
            border-radius: 6px;
            object-fit: contain;
            background: rgba(15, 23, 42, 0.06);
            border: 1px solid rgba(15, 23, 42, 0.08);
        }
        .stock-result-placeholder {
            width: 56px;
            height: 78px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.68rem;
            color: var(--text-secondary);
            background: rgba(15, 23, 42, 0.06);
            border: 1px dashed var(--border);
            text-align: center;
        }
        .stock-result-title {
            min-width: 0;
            font-weight: 800;
            color: var(--text-primary);
            line-height: 1.18;
            white-space: normal;
            overflow-wrap: anywhere;
        }
        .stock-result-meta {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 4px 8px;
            margin-top: 4px;
            color: #1e293b;
            font-size: 0.92rem;
            font-weight: 850;
            line-height: 1.25;
        }
        .stock-result-meta-item {
            display: inline-flex;
            align-items: center;
            min-width: 0;
            overflow-wrap: anywhere;
        }
        .stock-result-meta-separator {
            color: var(--text-muted);
            font-weight: 800;
        }
        .stock-result-price {
            margin-top: 4px;
            color: var(--accent);
            font-size: 0.78rem;
            font-weight: 800;
        }
        .stock-result-select,
        .stock-result-qty {
            min-height: 38px;
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0 10px;
            background: rgba(255, 255, 255, 0.92);
            color: var(--text-primary);
            min-width: 0;
        }
        .stock-result-qty {
            width: 100%;
        }
        .stock-result-add {
            white-space: nowrap;
        }
        .stock-empty-state {
            border: 1px dashed var(--border);
            border-radius: 8px;
            padding: 22px;
            color: var(--text-secondary);
            text-align: center;
            background: rgba(255, 255, 255, 0.5);
        }
        @media (max-width: 980px) {
            .stock-result-row {
                grid-template-columns: 58px minmax(0, 1fr) minmax(112px, 1fr);
            }
            .stock-result-row .stock-result-select,
            .stock-result-row .stock-result-qty,
            .stock-result-row .stock-result-add {
                grid-column: 2 / -1;
            }
            body.listing-flow-stock .create-batch-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            body.listing-flow-stock .create-batch-grid .batch-detail-field.batch-name-field,
            body.listing-flow-stock .create-batch-grid .sku-preview-field {
                grid-column: 1 / -1;
            }
        }
        @media (max-width: 700px) {
            .stock-list-header,
            .stock-search-bar {
                grid-template-columns: 1fr;
                display: grid;
            }
            .stock-result-row {
                grid-template-columns: 54px minmax(0, 1fr);
            }
            .stock-result-row .stock-result-select,
            .stock-result-row .stock-result-qty,
            .stock-result-row .stock-result-add {
                grid-column: 1 / -1;
            }
            body.listing-flow-stock .create-batch-grid {
                grid-template-columns: 1fr;
            }
        }
        body.listing-flow-slabs .list-view-container {
            --lv-control-height: 42px;
            gap: 6px;
        }
        .list-view-row.graded-row,
        body.listing-flow-slabs .list-view-row.graded-row {
            display: grid;
            grid-template-columns: 24px 150px minmax(0, 1fr) 122px;
            gap: 12px;
            align-items: center;
            padding: 0.48rem 0.58rem 0.48rem 0.42rem;
            border-radius: 9px;
        }
        .list-view-row.graded-row .slab-contain-thumbs,
        .list-view-row.graded-row .lv-thumbs,
        body.listing-flow-slabs .graded-row .lv-thumbs {
            display: grid;
            grid-template-columns: repeat(2, 70px);
            grid-template-rows: 104px 26px;
            align-items: center;
            justify-items: center;
            justify-content: center;
            height: 136px;
            width: 150px;
            gap: 6px 8px;
        }
        .list-view-row.graded-row .slab-contain-thumbs img,
        .list-view-row.graded-row .lv-thumbs img,
        .list-view-row.graded-row .lv-thumb-placeholder,
        body.listing-flow-slabs .graded-row .lv-thumbs img,
        body.listing-flow-slabs .graded-row .lv-thumb-placeholder {
            width: 70px;
            height: 104px;
            flex-basis: 70px;
            max-width: 70px;
            max-height: 104px;
            aspect-ratio: auto;
            object-fit: contain;
            object-position: center;
            background: #fff;
            display: block;
        }
        .list-view-row.graded-row .lv-thumb-action,
        body.listing-flow-slabs .graded-row .lv-thumb-action {
            cursor: pointer;
        }
        .list-view-row.graded-row .lv-thumb-action:hover,
        body.listing-flow-slabs .graded-row .lv-thumb-action:hover {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(0, 86, 162, 0.12);
        }
        .list-view-row.graded-row .lv-info,
        body.listing-flow-slabs .graded-row .lv-info {
            justify-content: center;
            min-height: 132px;
            gap: 8px;
        }
        .list-view-row.graded-row .lv-title-row,
        body.listing-flow-slabs .graded-row .lv-title-row {
            display: grid;
            grid-template-columns: minmax(300px, 1fr) 46px;
            gap: 8px;
            align-items: center;
        }
        .list-view-row.graded-row .lv-title,
        body.listing-flow-slabs .graded-row .lv-title {
            min-height: 32px;
            padding: 5px 9px;
            font-size: 13px;
            line-height: 1.15;
        }
        .list-view-row.graded-row .lv-edit-row,
        body.listing-flow-slabs .graded-row .lv-edit-row {
            gap: 6px;
            align-items: center;
        }
        .list-view-row.graded-row .lv-controls-stack,
        body.listing-flow-slabs .graded-row .lv-controls-stack {
            gap: 3px;
        }
        .list-view-row.graded-row .lv-fields-row,
        body.listing-flow-slabs .graded-row .lv-fields-row {
            grid-template-columns: 48px 92px 96px 104px 82px 72px minmax(132px, 210px) minmax(104px, 120px) 120px;
            column-gap: 10px;
            row-gap: 4px;
            justify-content: start;
        }
        .list-view-row.graded-row .lv-field-category,
        body.listing-flow-slabs .graded-row .lv-field-category {
            max-width: 220px;
        }
        .list-view-row.graded-row .lv-field-cert,
        body.listing-flow-slabs .graded-row .lv-field-cert {
            width: 100%;
            max-width: 120px;
        }
        .list-view-row.graded-row .lv-price.lv-market-display,
        .list-view-row.graded-row .lv-ebay-box,
        body.listing-flow-slabs .graded-row .lv-price.lv-market-display,
        body.listing-flow-slabs .graded-row .lv-ebay-box {
            min-width: 0;
        }
        .list-view-row.graded-row .lv-price .lv-market-value,
        body.listing-flow-slabs .graded-row .lv-price .lv-market-value {
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .list-view-row.graded-row .lv-label,
        body.listing-flow-slabs .graded-row .lv-label {
            min-height: 10px;
            font-size: 10px;
        }
        .list-view-row.graded-row .lv-affiliate-btn,
        body.listing-flow-slabs .graded-row .lv-affiliate-btn {
            min-height: 24px;
        }
        .list-view-row.graded-row .lv-slab-swap,
        body.listing-flow-slabs .graded-row .lv-slab-swap {
            grid-column: 1 / -1;
            justify-self: center;
            width: 32px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 7px;
            background: var(--bg-input);
            color: var(--accent);
            padding: 0;
            cursor: pointer;
        }
        .list-view-row.graded-row .lv-slab-swap svg,
        body.listing-flow-slabs .graded-row .lv-slab-swap svg {
            width: 15px;
            height: 15px;
            display: block;
        }
        .list-view-row.graded-row .lv-slab-swap:hover:not(:disabled),
        body.listing-flow-slabs .graded-row .lv-slab-swap:hover:not(:disabled) {
            border-color: var(--accent);
            background: var(--bg-hover);
        }
        .list-view-row.graded-row .lv-slab-swap:disabled,
        body.listing-flow-slabs .graded-row .lv-slab-swap:disabled {
            color: var(--text-muted);
            cursor: not-allowed;
            opacity: 0.55;
        }
        body.listing-flow-slabs .graded-row .lv-row-actions {
            align-self: start;
            padding-top: 0;
            margin-left: 0;
        }


        .lv-thumbs {
            display: flex; flex: 0 0 auto; gap: 5px; height: var(--lv-thumb-height); width: var(--lv-thumb-column-width); align-items: center; justify-content: center;
        }
        .lv-thumbs img {
            height: var(--lv-thumb-height); width: var(--lv-thumb-width); border-radius: 4px; border: 1px solid var(--border);
            object-fit: cover;
        }
        .list-view-row:not(.graded-row) .lv-thumbs img:first-child { width: 100%; aspect-ratio: 2.5/3.5; object-fit: cover; }
        .list-view-row:not(.graded-row) .lv-thumbs img.lv-thumb:first-child { width: var(--lv-thumb-width); aspect-ratio: auto; }
        .lv-thumb-placeholder {
            height: var(--lv-thumb-height);
            width: var(--lv-thumb-width);
            flex: 0 0 var(--lv-thumb-width);
            border-radius: 4px;
            border: 1px solid var(--border);
            background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
        }
        .lv-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; }
        .lv-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0; }
        .lv-title { font-weight: 600; font-size: 14px; line-height: 1.2; color: var(--text); padding: 5px 10px; border: 1px solid var(--border); background: var(--bg-input); width: 100%; border-radius: 8px; transition: all 0.2s; }
        .lv-title:hover { background: var(--bg-hover); }
        .lv-title:focus { outline: none; border-color: var(--accent); background: var(--bg-hover); }
        .lv-title.over-limit { border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.05); }
        .lv-title-counter { font-size: 11px; white-space: nowrap; font-weight: 500; transition: color 0.2s; }
        .lv-edit-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
        .lv-controls-stack { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
        .lv-fields-row {
            display: grid;
            grid-template-columns: 48px 88px 82px 76px 72px minmax(128px, 210px) minmax(124px, 160px) minmax(104px, 120px);
            column-gap: 8px;
            row-gap: 4px;
            align-items: end;
            max-width: 100%;
        }
        .lv-field-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
        .lv-field-qty { width: 48px; }
        .lv-field-price { width: 88px; }
        .lv-field-market { width: 82px; }
        .lv-field-cond { width: 72px; }
        .lv-field-finish { width: 104px; }
        .lv-field-variant { width: 100%; min-width: 0; max-width: 210px; }
        .lv-field-category { width: 100%; max-width: 160px; }
        .lv-field-sku { width: 100%; max-width: 120px; }
        .lv-fields-row > .lv-field-group { width: 100%; }
        .lv-label {
            display: flex; align-items: center; min-height: 10px;
            font-size: 10.5px; line-height: 1; font-weight: 800;
            color: var(--text-muted); text-transform: uppercase; padding-left: 2px;
            white-space: nowrap;
        }
        .lv-price {
            height: var(--lv-control-height); width: 100%;
            display: inline-flex; align-items: center; gap: 6px;
            background: var(--bg-input); border: 1px solid var(--border);
            border-radius: var(--lv-control-radius); padding: 0 12px;
            transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
        }
        .lv-price.lv-input-control { cursor: text; }
        .lv-price.lv-quantity-control { justify-content: center; padding: 0; }
        .lv-price.lv-market-display {
            background: transparent; border-color: transparent; padding: 0;
            justify-content: flex-start; cursor: default;
        }
        .lv-price:focus-within {
            background: var(--bg-card);
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .lv-price span { color: var(--text-muted); font-size: 13px; line-height: 1; flex: 0 0 auto; }
        .lv-price .lv-price-prefix { pointer-events: none; }
        .lv-price .lv-market-value {
            color: var(--text-primary); font-size: 13px; font-weight: 800;
            font-variant-numeric: tabular-nums;
        }
        .lv-price input {
            height: 100%; min-width: 0; border: none; background: transparent;
            color: var(--text-primary); font-weight: 800; font-size: 14px;
            line-height: 1; width: 100%; padding: 0; font-family: inherit;
            font-variant-numeric: tabular-nums;
        }
        .lv-price input.lv-quantity-input { text-align: center; }
        .lv-price input:focus { outline: none; }
        .lv-text-input {
            height: var(--lv-control-height);
            min-height: var(--lv-control-height);
            width: 100%;
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: var(--lv-control-radius);
            background: var(--bg-input);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 13px;
            font-weight: 800;
            line-height: 1;
            padding: 0 11px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
        }
        .lv-text-input:hover { border-color: var(--text-muted); }
        .lv-text-input:focus {
            outline: none;
            background: var(--bg-card);
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }

        /* Remove up/down spinners on number inputs */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        input[type=number] { -moz-appearance: textfield; }

        .lv-select {
            height: var(--lv-control-height); min-height: var(--lv-control-height);
            background: var(--bg-input); border: 1px solid var(--border);
            color: var(--text-primary); font-size: 14px; font-weight: 800;
            line-height: 1; padding: 0 14px; border-radius: var(--lv-control-radius);
            cursor: pointer; font-family: inherit; min-width: 0;
            width: 100%;
        }
        .lv-select option { background: var(--bg-card); color: var(--text-primary); font-size: 14px; }
        .lv-select:hover { border-color: var(--text-muted); }
        .lv-select:focus { outline: none; border-color: var(--accent); }

        select.batch-selector,
        select.lv-select,
        .field-item select,
        .modal-tool-group select {
            color-scheme: light;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-color: var(--bg-input);
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-position: right 0.75rem center;
            background-repeat: no-repeat;
            background-size: 14px 14px;
            color: var(--text-primary);
            transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
        }
        select.batch-selector,
        .field-item select {
            padding-right: 2.4rem;
        }
        select.lv-select,
        .modal-tool-group select {
            padding-right: 1.9rem;
        }
        select.batch-selector:hover,
        select.lv-select:hover,
        .field-item select:hover,
        .modal-tool-group select:hover {
            background-color: var(--bg-hover);
        }
        select.batch-selector:focus,
        select.lv-select:focus,
        .field-item select:focus,
        .modal-tool-group select:focus {
            outline: none;
            background-color: var(--bg-card);
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        select.batch-selector option,
        select.lv-select option,
        .field-item select option,
        .modal-tool-group select option {
            color-scheme: light;
            background-color: #ffffff;
            color: #0f172a;
        }
        select.batch-selector option:checked,
        select.lv-select option:checked,
        .field-item select option:checked,
        .modal-tool-group select option:checked {
            background-color: #dbeafe;
            color: #0f172a;
        }
        select::-ms-expand {
            display: none;
        }

        .lv-btn { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: all 0.2s; font-size: 11px; font-weight: 600; text-transform: uppercase; }
        .lv-btn:hover { background: rgba(239,68,68,0.1); color: #ef4444; border-color: #ef4444; }
        .lv-btn-icon { width: 26px; height: 26px; background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 2px; border-radius: 8px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
        .lv-btn-icon svg { width: 15px; height: 15px; }
        .lv-btn-icon:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
        .lv-btn-icon.edit:hover { color: var(--accent); background: rgba(3,83,164,0.08); border-color: rgba(3,83,164,0.28); }
        .lv-btn-icon.confirming { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.42); color: #ef4444; font-weight: 800; min-width: 48px; }
        .lv-side-rail {
            display: grid;
            grid-template-columns: 88px 26px;
            align-self: stretch;
            align-items: start;
            column-gap: 8px;
            width: 122px;
        }
        .lv-row-actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; align-self: start; gap: 4px; margin-left: 0; padding-top: 0; }
        .lv-affiliate-stack { display: flex; flex-direction: column; gap: 3px; width: 88px; flex: 0 0 88px; align-self: center; }
        .lv-affiliate-btn {
            display: flex; align-items: center; justify-content: center;
            min-height: 22px; padding: 3px 5px; border: 1px solid var(--border);
            border-radius: 7px; background: var(--bg-input); text-decoration: none;
            text-transform: uppercase; letter-spacing: 0.04em; font-size: 9.5px;
            font-weight: 800; line-height: 1; transition: all 0.15s;
        }
        .lv-btn-sold { color: #059669; }
        .lv-btn-sold:hover { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: #047857; }
        .lv-btn-listed { color: #0b62b4; }
        .lv-btn-listed:hover { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: #0353a4; }
        .lv-btn-tcg { color: #8b5cf6; }
        .lv-btn-tcg:hover { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.3); color: #7c3aed; }
        .lv-affiliate-btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
        .lv-ebay-field { width: 82px; }
        .lv-ebay-box {
            height: var(--lv-control-height); display: flex; align-items: stretch;
            background: var(--bg-input); border: 1px solid var(--border);
            border-radius: var(--lv-control-radius); padding: 3px 4px;
        }
        .lv-ebay-split {
            width: 100%; display: grid; grid-template-rows: repeat(2, minmax(0, 1fr));
            gap: 3px; align-items: stretch;
        }
        .lv-ebay-split.lv-ebay-active-only {
            grid-template-rows: minmax(0, 1fr);
        }
        .lv-ebay-cell {
            min-width: 0; min-height: 0; display: flex; align-items: center;
            justify-content: center; overflow: hidden; border-radius: 5px;
            background: #fff;
        }
        .lv-ebay-check {
            width: 100%; height: 100%; border: 0; background: transparent;
            color: #0b62b4; font: inherit; font-size: 9px; font-weight: 800;
            line-height: 1; text-transform: uppercase; cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center;
            text-align: center; white-space: nowrap; padding: 0 2px;
        }
        .lv-ebay-check:hover { color: #0353a4; }
        .lv-ebay-check:disabled { color: var(--text-muted); cursor: wait; }
        .lv-ebay-check.error { color: #dc2626; }
        .lv-ebay-check.empty { color: var(--text-muted); }
        .lv-ebay-muted {
            color: var(--text-muted); font-size: 11px; font-weight: 800;
            text-transform: uppercase;
        }
        .lv-ebay-lowline { display: flex; align-items: center; gap: 6px; width: 100%; }
        .lv-ebay-price-chip {
            width: 100%; height: 100%; border: 0; background: transparent;
            display: flex; align-items: center; justify-content: center;
            gap: 2px; cursor: pointer; padding: 0 2px;
        }
        .lv-ebay-price-chip:hover { background: rgba(59,130,246,0.08); }
        .lv-ebay-chip-label {
            color: var(--text-muted); font-size: 7px; line-height: 1;
            font-weight: 900; text-transform: uppercase;
        }
        .lv-ebay-price {
            color: #0b62b4; font-size: 9px; line-height: 1;
            font-weight: 900; white-space: nowrap;
        }
        .lv-ebay-use {
            margin-left: auto; border: 1px solid rgba(59,130,246,0.25);
            background: rgba(59,130,246,0.08); color: #0b62b4;
            border-radius: 5px; padding: 2px 5px; font-size: 10px;
            font-weight: 800; cursor: pointer;
        }
        .lv-ebay-results {
            display: grid; grid-template-columns: 1fr; gap: 4px;
            margin-top: 2px; max-width: 760px;
        }
        .lv-ebay-results-head {
            color: var(--text-muted); font-size: 11px; font-weight: 700;
            display: flex; align-items: center; gap: 8px; justify-content: space-between;
        }
        .lv-ebay-results-head > span:first-child {
            min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .lv-ebay-result-actions {
            display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
        }
        .lv-ebay-refresh {
            border: 1px solid rgba(59,130,246,0.22); border-radius: 5px;
            background: rgba(59,130,246,0.06); color: #0b62b4;
            cursor: pointer; font-size: 10px; font-weight: 800;
            padding: 2px 6px; white-space: nowrap;
        }
        .lv-ebay-refresh:hover { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.11); }
        .lv-ebay-result {
            display: grid; grid-template-columns: 72px 1fr 190px; gap: 8px;
            align-items: center; padding: 5px 7px; border: 1px solid var(--border);
            border-radius: 8px; background: rgba(59,130,246,0.04);
            text-decoration: none; color: var(--text-primary);
        }
        .lv-ebay-result:hover { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.08); }
        .lv-ebay-result-price { color: #0b62b4; font-size: 12px; font-weight: 800; }
        .lv-ebay-result-title {
            min-width: 0; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; font-size: 12px; font-weight: 700;
        }
        .lv-ebay-result-meta {
            min-width: 0; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; color: var(--text-muted); font-size: 11px;
        }

        @container list-view (max-width: 1080px) {
            .list-view-row {
                grid-template-columns: 24px var(--lv-thumb-column-width) minmax(0, 1fr);
                align-items: start;
            }
            .list-view-row.graded-row,
            body.listing-flow-slabs .list-view-row.graded-row {
                grid-template-columns: 24px 146px minmax(0, 1fr);
            }
            .lv-side-rail,
            .list-view-row.graded-row .lv-side-rail,
            body.listing-flow-slabs .graded-row .lv-side-rail {
                grid-column: 3;
                width: 100%;
                grid-template-columns: minmax(0, 1fr) 30px;
                align-self: start;
                align-items: start;
            }
            .lv-affiliate-stack,
            .list-view-row.graded-row .lv-affiliate-stack,
            body.listing-flow-slabs .graded-row .lv-affiliate-stack {
                width: 100%;
                flex: 1 1 auto;
                flex-direction: row;
                flex-wrap: wrap;
                align-self: start;
            }
            .lv-affiliate-btn,
            .list-view-row.graded-row .lv-affiliate-btn,
            body.listing-flow-slabs .graded-row .lv-affiliate-btn {
                flex: 1 1 86px;
                min-width: 86px;
            }
            .lv-row-actions {
                flex-direction: row;
                justify-content: flex-end;
                align-items: flex-start;
            }
        }

        @container list-view (max-width: 980px) {
            .list-view-row,
            .list-view-row.graded-row,
            body.listing-flow-slabs .list-view-row.graded-row {
                --lv-thumb-width: 60px;
                --lv-thumb-height: 84px;
                --lv-thumb-column-width: 130px;
            }
            .lv-title-row,
            .list-view-row.graded-row .lv-title-row,
            body.listing-flow-slabs .graded-row .lv-title-row {
                grid-template-columns: minmax(0, 1fr) 44px;
            }
            .lv-fields-row,
            .list-view-row.graded-row .lv-fields-row,
            body.listing-flow-slabs .graded-row .lv-fields-row {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
            .lv-field-qty,
            .lv-field-price,
            .lv-field-market,
            .lv-field-cond,
            .lv-field-finish,
            .lv-field-variant,
            .lv-field-category,
            .lv-field-sku,
            .lv-field-cert,
            .lv-ebay-field {
                width: 100%;
                max-width: none;
            }
        }

        @container list-view (max-width: 720px) {
            .list-view-row,
            .list-view-row.graded-row,
            body.listing-flow-slabs .list-view-row.graded-row {
                grid-template-columns: 24px minmax(0, 1fr);
            }
            .lv-thumbs,
            .list-view-row.graded-row .lv-thumbs,
            body.listing-flow-slabs .graded-row .lv-thumbs {
                grid-column: 2;
            }
            .lv-info,
            .list-view-row.graded-row .lv-info,
            body.listing-flow-slabs .graded-row .lv-info {
                grid-column: 1 / -1;
                min-height: 0;
            }
            .lv-side-rail,
            .list-view-row.graded-row .lv-side-rail,
            body.listing-flow-slabs .graded-row .lv-side-rail {
                grid-column: 1 / -1;
                grid-template-columns: minmax(0, 1fr) 30px;
            }
            .lv-fields-row,
            .list-view-row.graded-row .lv-fields-row,
            body.listing-flow-slabs .graded-row .lv-fields-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        .over-limit-text { color: #ef4444 !important; font-weight: 700; }

        .lv-title-ro { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 4px; margin-left: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
        .lv-set { font-size: 12px; color: var(--text-secondary); }

        /* ─── Bulk Edit Bar ─── */
        .bulk-edit-bar {
            position: sticky; top: 108px; z-index: 90;
            background: var(--surface); backdrop-filter: blur(12px);
            border: 1px solid rgba(0, 86, 162, 0.32); border-radius: 12px;
            padding: 16px 18px; margin: 4px 0 16px;
            display: none; align-items: start; gap: 12px 14px;
            grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.48fr) minmax(380px, 0.56fr);
            grid-template-areas:
                "summary summary danger"
                "fields title commands";
            width: 100%;
            box-sizing: border-box;
            overflow: visible;
            box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
            animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        @keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .bulk-edit-bar.active { display: grid; }
        .bulk-edit-bar:focus-within { z-index: 160; }
        .bulk-selection-group {
            display: inline-flex; align-items: center; gap: 10px;
            grid-area: summary;
            min-width: 0; white-space: nowrap; flex-wrap: wrap;
            align-self: center;
        }
        .bulk-count { font-size: 14px; font-weight: 850; color: var(--accent); white-space: nowrap; }
        .bulk-actions-group {
            display: flex; align-items: center; gap: 8px;
            min-width: 0; flex-wrap: wrap;
        }
        .bulk-field-actions {
            grid-area: fields;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
            align-self: start;
            align-content: start;
            align-items: center;
            gap: 9px 10px;
            padding: 10px;
            background: rgba(248, 250, 252, 0.78);
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 12px;
        }
        .bulk-field-actions::before {
            content: "Apply Fields";
            grid-column: 1 / -1;
            color: var(--text-muted);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.04em;
            line-height: 1;
            text-transform: uppercase;
        }
        .bulk-command-actions {
            grid-area: commands;
            align-self: start;
            display: grid;
            grid-template-columns: 1fr;
            align-items: center;
            gap: 10px;
            justify-content: stretch;
            padding: 10px;
            background: rgba(248, 250, 252, 0.78);
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 12px;
        }
        .bulk-title-actions {
            grid-area: title;
            align-self: start;
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            justify-content: stretch;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: rgba(248, 250, 252, 0.78);
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 12px;
        }
        .bulk-select.title-template { flex: 1 1 220px; width: 100%; max-width: none; }
        .bulk-title-actions .bulk-action-btn {
            grid-column: 1 / -1;
            width: 100%;
        }
        .bulk-danger-actions {
            grid-area: danger;
            align-self: center;
            display: inline-flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: flex-end;
            justify-self: end;
        }
        .bulk-select { flex: 0 0 158px; width: 158px; max-width: 158px; }
        .bulk-select.condition { flex-basis: 184px; width: 184px; max-width: 184px; }
        .bulk-select.variant { flex-basis: 176px; width: 176px; max-width: 176px; }
        .bulk-select.category { flex-basis: 190px; width: 190px; max-width: 190px; }
        .bulk-select.configuration { flex-basis: 220px; width: 220px; max-width: 220px; }
        .bulk-select.business-policy { flex-basis: 220px; width: 220px; max-width: 220px; }
        .bulk-field-actions .bulk-select {
            width: 100%;
            max-width: none;
            min-width: 0;
            flex: unset;
        }
        .bulk-price-tools {
            display: inline-grid;
            grid-template-columns: auto minmax(120px, 1fr) auto;
            align-items: center;
            gap: 10px;
            white-space: nowrap;
            min-width: 0;
            grid-column: 1 / -1;
        }
        .bulk-tool-label {
            color: var(--text-muted); font-size: 11px; font-weight: 900;
            letter-spacing: 0.04em; text-transform: uppercase;
        }
        .bulk-price-adjust {
            height: var(--lv-control-height); width: 100%; min-width: 0;
            display: inline-flex; align-items: center; gap: 6px;
            padding: 0 11px; border: 1px solid var(--border);
            border-radius: var(--lv-control-radius); background: var(--bg-input);
            transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
        }
        .bulk-price-adjust:focus-within {
            background: var(--bg-card);
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(0, 86, 162, 0.12);
        }
        .bulk-price-prefix {
            color: var(--text-muted); font-size: 13px; font-weight: 800;
            line-height: 1; pointer-events: none;
        }
        .bulk-price-adjust-input {
            height: 100%; width: 100%; min-width: 0; border: 0; padding: 0;
            background: transparent; color: var(--text-primary); font: inherit;
            font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
        }
        .bulk-price-adjust-input:focus { outline: none; }
        .bulk-price-adjust-input::placeholder { color: var(--text-muted); opacity: 0.78; }
        .bulk-action-btn {
            height: var(--lv-control-height); min-width: 94px;
            display: inline-flex; align-items: center; justify-content: center; gap: 6px;
            padding: 0 12px; border: 1px solid var(--border);
            border-radius: var(--lv-control-radius); background: var(--bg-input);
            color: var(--text-secondary); font-family: inherit; font-size: 12px;
            font-weight: 800; line-height: 1; cursor: pointer; white-space: nowrap;
            box-shadow: var(--shadow-sm);
            transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
        }
        .bulk-action-btn[hidden] { display: none !important; }
        .bulk-action-btn svg {
            width: 15px; height: 15px; flex: 0 0 auto; display: block;
        }
        .bulk-command-actions > .bulk-action-btn {
            width: 100%;
        }
        .bulk-action-btn:hover {
            background: var(--bg-hover); border-color: var(--text-muted);
            color: var(--text-primary); transform: translateY(-1px);
        }
        .bulk-action-btn:active { transform: translateY(0); }
        .bulk-action-btn.primary {
            min-width: 110px;
            border-color: rgba(0, 86, 162, 0.24);
            background: rgba(0, 86, 162, 0.08);
            color: var(--accent);
        }
        .bulk-action-btn.compact {
            min-width: 86px;
            padding: 0 10px;
        }
        .bulk-action-btn.done {
            min-width: 74px;
            border-color: rgba(0, 86, 162, 0.24);
            background: var(--accent);
            color: #ffffff;
        }
        .bulk-action-btn.done:hover {
            border-color: var(--accent);
            background: #034f9b;
            color: #ffffff;
        }
        .bulk-action-btn:disabled {
            opacity: 0.52;
            cursor: not-allowed;
            transform: none;
        }
        .bulk-action-btn:disabled:hover {
            background: var(--bg-input);
            border-color: var(--border);
            color: var(--text-secondary);
            transform: none;
        }
        .bulk-action-btn.done:disabled:hover {
            background: var(--accent);
            border-color: rgba(0, 86, 162, 0.24);
            color: #ffffff;
        }
        .bulk-action-btn.merge { min-width: 116px; }
        .bulk-action-btn.delete {
            min-width: 142px; color: #b91c1c;
            border-color: rgba(185, 28, 28, 0.18);
            background: rgba(239, 68, 68, 0.06);
        }
        .bulk-action-btn.delete:hover {
            border-color: rgba(220, 38, 38, 0.36);
            background: rgba(239, 68, 68, 0.1);
            color: #991b1b;
        }
        @media (max-width: 1280px) {
            .bulk-edit-bar {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "summary"
                    "fields"
                    "title"
                    "commands"
                    "danger";
            }
            .bulk-selection-group,
            .bulk-field-actions,
            .bulk-title-actions,
            .bulk-command-actions,
            .bulk-danger-actions {
                width: 100%;
                justify-self: stretch;
            }
            .bulk-field-actions { padding: 8px; }
            .bulk-title-actions { padding: 8px; justify-content: flex-start; }
            .bulk-command-actions { margin-left: 0; padding: 8px; }
            .bulk-danger-actions { margin-left: 0; padding-left: 0; border-left: 0; justify-self: stretch; }
        }
        @media (max-width: 980px) {
            .bulk-command-actions {
                grid-template-columns: 1fr;
                justify-content: stretch;
            }
            .bulk-command-actions > .bulk-action-btn,
            .bulk-price-tools {
                width: 100%;
            }
            .bulk-price-tools {
                grid-template-columns: auto minmax(0, 1fr) auto;
            }
            .bulk-price-adjust {
                width: 100%;
            }
        }
        @media (max-width: 720px) {
            .bulk-actions-group,
            .bulk-selection-group { flex-wrap: wrap; }
            .bulk-select,
            .bulk-select.condition,
            .bulk-select.variant,
            .bulk-select.category,
            .bulk-select.configuration,
            .bulk-select.business-policy,
            .bulk-select.title-template { flex: 1 1 150px; width: auto; max-width: none; }
            .bulk-price-tools { white-space: normal; }
            .bulk-command-actions,
            .bulk-danger-actions { justify-content: flex-start; }
        }

        .slab-view-container { display: grid; gap: 18px; }
        .slab-create-import-slot {
            display: none;
            min-width: 0;
        }
        .slab-standalone-import-slot {
            display: block;
        }
        body.slab-create-mode .slab-create-import-slot {
            display: block;
            grid-column: 2;
            min-width: 0;
        }
        body.slab-create-mode .slab-create-import-slot .slab-view-container {
            height: 100%;
        }
        body.slab-create-mode .slab-create-import-slot .slab-import-layout {
            grid-template-columns: minmax(0, 1fr);
            height: 100%;
            align-content: start;
        }
        body.slab-create-mode .slab-create-import-slot .slab-panel {
            min-width: 0;
        }
        .slab-import-layout {
            display: grid;
            grid-template-columns: repeat(3, minmax(240px, 1fr));
            gap: 18px;
            align-items: stretch;
        }
        .slab-panel,
        .slab-results {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow-sm);
            padding: 18px;
        }
        .slab-panel-header,
        .slab-results-header {
            display: flex;
            justify-content: space-between;
            gap: 14px;
            align-items: flex-start;
            margin-bottom: 14px;
        }
        .slab-panel-header h2,
        .slab-results-header h2 {
            margin: 0 0 4px;
            font-size: 17px;
            line-height: 1.2;
            color: var(--text-primary);
        }
        .slab-panel-header p,
        .slab-results-header p {
            margin: 0;
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.4;
        }
        .slab-token-status,
        .slab-csv-status,
        .slab-count {
            white-space: nowrap;
            font-size: 12px;
            font-weight: 800;
            color: var(--accent);
            background: rgba(3, 83, 164, 0.08);
            border: 1px solid rgba(3, 83, 164, 0.12);
            border-radius: 99px;
            padding: 5px 10px;
        }
        .slab-token-status.error {
            color: #b91c1c;
            background: rgba(239, 68, 68, 0.08);
            border-color: rgba(239, 68, 68, 0.16);
        }
        .slab-csv-status.error {
            color: #b91c1c;
            background: rgba(239, 68, 68, 0.08);
            border-color: rgba(239, 68, 68, 0.16);
        }
        .slab-field {
            display: grid;
            gap: 7px;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-secondary);
        }
        .slab-input,
        .slab-textarea {
            width: 100%;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-primary);
            border-radius: 8px;
            padding: 10px 12px;
            font: inherit;
            color-scheme: light;
        }
        .slab-input:focus,
        .slab-textarea:focus {
            outline: none;
            border-color: var(--border-focus);
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(3, 83, 164, 0.08);
        }
        .slab-textarea {
            min-height: 158px;
            resize: vertical;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 13px;
            line-height: 1.45;
        }
        .slab-file-input { display: none; }
        .slab-csv-progress {
            display: grid;
            gap: 8px;
            margin-top: 14px;
            padding: 10px 12px;
            border: 1px solid rgba(3, 83, 164, 0.12);
            border-radius: 8px;
            background: rgba(3, 83, 164, 0.045);
        }
        .slab-csv-progress[hidden] { display: none !important; }
        .slab-csv-progress-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-primary);
        }
        .slab-csv-progress-count {
            flex: 0 0 auto;
            color: var(--accent);
            font-variant-numeric: tabular-nums;
        }
        .slab-csv-progress-track {
            height: 10px;
            border-radius: 999px;
            background: rgba(3, 83, 164, 0.12);
            overflow: hidden;
        }
        .slab-csv-progress-track span {
            display: block;
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #0353a4, #10b981);
            transition: width 0.25s ease;
        }
        .slab-csv-progress-detail {
            min-height: 16px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
        }
        .slab-actions {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 14px;
        }
        .slab-actions-primary { justify-content: space-between; }
        .slab-field-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .slab-token-link {
            color: var(--accent);
            font-size: 12px;
            font-weight: 800;
            text-decoration: none;
        }
        .slab-token-link:hover { text-decoration: underline; }
        .slab-save-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 700;
        }
        .slab-results-list { display: grid; gap: 10px; }
        .slab-empty {
            border: 1px dashed var(--border-hover);
            border-radius: 10px;
            padding: 28px;
            text-align: center;
            color: var(--text-secondary);
            background: var(--bg-input);
            font-weight: 700;
        }
        .slab-result-row {
            display: grid;
            grid-template-columns: minmax(94px, 0.25fr) minmax(0, 1fr) minmax(92px, 0.2fr) minmax(96px, 0.2fr) 34px;
            gap: 12px;
            align-items: center;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px;
            background: #ffffff;
        }
        .slab-result-row.error {
            border-color: rgba(239, 68, 68, 0.22);
            background: rgba(254, 242, 242, 0.8);
        }
        .slab-result-cert {
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 13px;
            font-weight: 800;
            color: var(--text-primary);
        }
        .slab-result-title {
            min-width: 0;
            font-weight: 800;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .slab-result-meta,
        .slab-result-pop {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
        }
        .slab-result-grade {
            justify-self: start;
            color: #ffffff;
            background: var(--accent);
            border-radius: 999px;
            padding: 5px 10px;
            font-size: 12px;
            font-weight: 900;
            white-space: nowrap;
        }
        .slab-result-status {
            justify-self: end;
            font-size: 12px;
            font-weight: 800;
            color: #047857;
        }
        .slab-result-row.error .slab-result-status { color: #b91c1c; }
        .slab-result-remove {
            justify-self: end;
            width: 30px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(148, 163, 184, 0.34);
            border-radius: 999px;
            background: #ffffff;
            color: #64748b;
            font-size: 20px;
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .slab-result-remove:hover {
            border-color: rgba(220, 38, 38, 0.28);
            background: rgba(254, 242, 242, 0.95);
            color: #b91c1c;
        }
        .slab-result-remove:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .lv-checkbox-wrap { display: flex; flex: 0 0 24px; align-items: center; justify-content: center; padding: 0 2px 0 0; }
        .lv-checkbox {
            width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent);
            border-radius: 4px; border: 2px solid var(--border);
        }

        .modal-nav-btn:hover { border-color: var(--accent); color: var(--text-primary); }
        .modal-nav-btn:disabled { opacity: 0.3; cursor: default; }
        .modal-section-label {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            color: var(--text-muted); letter-spacing: 0.5px;
            margin-bottom: 8px; padding: 0 2px;
        }
        .no-results {
            text-align: center; padding: 40px 20px; color: var(--text-muted);
        }
        .no-results-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }

        @media (max-width: 1500px) {
            .batch-bar {
                grid-template-columns: minmax(0, 1fr);
                grid-template-areas:
                    "details"
                    "actions";
            }
            .batch-group.batch-actions {
                border-top: 1px solid rgba(148, 163, 184, 0.22);
                padding: 14px 0 0;
                min-width: 0;
                align-items: flex-start;
                justify-content: flex-start;
            }
            .batch-action-column {
                width: 100%;
                grid-template-columns: repeat(6, minmax(108px, 1fr));
                align-items: stretch;
            }
            .batch-action-column > .batch-btn,
            .batch-action-column > .batch-action-row,
            .batch-action-column > .batch-danger-zone {
                min-width: 0;
            }
            .batch-bar.batch-collapsed .batch-group-picker {
                grid-template-columns: auto minmax(220px, 1fr) minmax(0, 1fr);
            }
        }

        @media (max-width: 1100px) {
            .batch-action-column {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            body.slab-create-mode .create-batch-flow {
                grid-template-columns: 1fr;
            }
            body.slab-create-mode .create-batch-card,
            body.slab-create-mode .slab-create-import-slot {
                grid-column: 1;
            }
            body.slab-create-mode .create-batch-card {
                max-width: none;
            }
        }

        @media (max-width: 1380px) {
            body.slab-create-mode .slab-create-import-slot .slab-import-layout {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 900px) {
            .modal-results-grid { grid-template-columns: repeat(2, 1fr); }
            .slab-import-layout {
                grid-template-columns: 1fr;
            }
            .slab-result-row {
                grid-template-columns: 1fr;
                gap: 7px;
            }
            .slab-result-title {
                white-space: normal;
            }
            .slab-result-status {
                justify-self: start;
            }
            .slab-result-remove {
                justify-self: start;
            }
            .list-view-row {
                grid-template-columns: 24px var(--lv-thumb-column-width) minmax(0, 1fr);
            }
            .lv-side-rail {
                grid-column: 3;
                width: 100%;
                grid-template-columns: minmax(0, 1fr) 26px;
                align-self: start;
                align-items: start;
            }
            .lv-affiliate-stack {
                width: 100%;
                flex: 1 1 auto;
                flex-direction: row;
                flex-wrap: wrap;
                align-self: start;
            }
            .lv-affiliate-btn {
                flex: 1 1 86px;
                min-width: 0;
            }
            .list-view-row.graded-row .lv-title-row,
            body.listing-flow-slabs .graded-row .lv-title-row {
                grid-template-columns: minmax(0, 1fr) 44px;
            }
            .list-view-row.graded-row .lv-affiliate-stack,
            body.listing-flow-slabs .graded-row .lv-affiliate-stack {
                flex-direction: row;
                width: 100%;
                flex-basis: auto;
            }
            .list-view-row.graded-row .lv-affiliate-btn,
            body.listing-flow-slabs .graded-row .lv-affiliate-btn {
                flex: 1 1 86px;
            }
            .list-view-row.graded-row,
            body.listing-flow-slabs .list-view-row.graded-row {
                grid-template-columns: 24px 146px minmax(0, 1fr);
            }
            .list-view-row.graded-row .lv-side-rail,
            body.listing-flow-slabs .graded-row .lv-side-rail {
                grid-column: 3;
            }
            .list-view-row.graded-row .lv-fields-row,
            body.listing-flow-slabs .graded-row .lv-fields-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .list-view-row.graded-row .lv-field-cert,
            body.listing-flow-slabs .graded-row .lv-field-cert {
                max-width: none;
            }
            .batch-bar {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "picker"
                    "details"
                    "actions";
            }
            .batch-group {
                border-right: 0;
                border-bottom: 1px solid rgba(148, 163, 184, 0.22);
                padding-right: 0;
                padding-bottom: 14px;
            }
            .batch-group.batch-actions {
                border-top: 0;
                padding-top: 0;
            }
            .batch-group-details .batch-group-controls {
                grid-template-columns: 1fr;
            }
            .batch-group:last-child {
                border-bottom: 0;
                padding-bottom: 0;
            }
            .batch-bar.batch-collapsed {
                display: block;
                padding: 0.75rem;
            }
            .batch-bar.batch-collapsed .batch-group-picker {
                display: grid;
                grid-template-columns: 1fr;
                gap: 8px;
            }
            .batch-bar.batch-collapsed .batch-group.batch-actions {
                min-width: 0;
                flex: 0 1 auto;
                margin-top: 8px;
            }
            body.batch-info-collapsed #batchBar .batch-group.batch-actions {
                min-width: 0;
                flex: 0 1 auto;
                margin-top: 8px;
            }
            .batch-bar.batch-collapsed .batch-group.batch-actions .batch-action-column {
                grid-template-columns: 1fr;
            }
            body.batch-info-collapsed #batchBar .batch-group.batch-actions .batch-action-column {
                grid-template-columns: 1fr;
            }
            .batch-bar.batch-collapsed .batch-workflow-row,
            .batch-bar.batch-collapsed .batch-btn.export-primary {
                grid-column: auto;
                grid-row: auto;
            }
            body.batch-info-collapsed #batchBar .batch-workflow-row,
            body.batch-info-collapsed #batchBar .batch-btn.export-primary {
                grid-column: auto;
                grid-row: auto;
            }
            .batch-action-column.batch-danger-actions {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .batch-action-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .batch-bar.batch-collapsed .batch-picker-heading {
                justify-content: space-between;
            }
            .batch-bar.batch-collapsed .batch-active-line {
                flex-wrap: wrap;
            }
        }

        @media (max-width: 700px) {
            .list-view-row,
            .list-view-row.graded-row,
            body.listing-flow-slabs .list-view-row.graded-row {
                grid-template-columns: 24px minmax(0, 1fr);
            }
            .lv-thumbs,
            .list-view-row.graded-row .lv-thumbs,
            body.listing-flow-slabs .graded-row .lv-thumbs {
                grid-column: 2;
            }
            .lv-info,
            .list-view-row.graded-row .lv-info,
            body.listing-flow-slabs .graded-row .lv-info {
                grid-column: 1 / -1;
                min-height: 0;
            }
            .lv-side-rail,
            .list-view-row.graded-row .lv-side-rail,
            body.listing-flow-slabs .graded-row .lv-side-rail {
                grid-column: 1 / -1;
                grid-template-columns: minmax(0, 1fr) 26px;
            }
            .lv-fields-row,
            .list-view-row.graded-row .lv-fields-row,
            body.listing-flow-slabs .graded-row .lv-fields-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .lv-field-variant,
            .lv-field-category,
            .lv-field-sku {
                max-width: none;
            }
        }

        @media (max-width: 700px) { .card-comparison { grid-template-columns: 1fr; } .modal-top { grid-template-columns: 1fr; }
            .topbar {
                position: static;
                align-items: stretch;
                border-radius: 14px;
                margin: 0 8px 10px;
                padding: 0.65rem;
                gap: 8px;
            }
            .topbar.listing-topbar {
                position: static;
                align-items: stretch;
                border-radius: 8px;
                margin: 0 0 10px;
                padding: 0.65rem;
                gap: 8px;
            }
            .topbar-left {
                align-items: stretch;
                flex-direction: column;
                gap: 8px;
                min-width: 0;
            }
            .topbar-nav {
                max-width: 100%;
                overflow-x: auto;
                padding-bottom: 2px;
            }
            .topbar-nav a {
                white-space: nowrap;
            }
            .topbar .topbar-right {
                justify-content: center;
                gap: 4px 8px;
            }
            .topbar.listing-topbar .topbar-right {
                justify-content: center;
                gap: 6px 8px;
                flex-wrap: wrap;
            }
            .topbar-batch-chip {
                width: auto;
                max-width: 100%;
                flex-wrap: wrap;
                border-radius: 0;
                padding: 0;
            }
            .topbar-batch-title-field {
                flex-basis: 100%;
                max-width: none;
            }
            .topbar-sku-group,
            .topbar-action-group {
                max-width: 100%;
            }
            .topbar-batch-sku-field {
                flex: 0 0 168px;
            }
            .fields-grid { grid-template-columns: 1fr; }
            .modal-results-grid { grid-template-columns: 1fr; }
            .staging-header { align-items: flex-start; flex-direction: column; }
            .create-upload-header {
                display: grid;
                grid-template-columns: minmax(0, 1fr);
            }
            .create-upload-mode-control {
                width: 100%;
            }
            .matching-settings-head,
            .matching-reprint-row {
                align-items: stretch;
                flex-direction: column;
            }
            .matching-settings-actions {
                justify-content: space-between;
                width: 100%;
            }
            .matching-rule-grid {
                grid-template-columns: minmax(0, 1fr);
            }
            .matching-set-picker {
                grid-template-columns: minmax(0, 1fr);
            }
            .matching-set-add {
                justify-self: stretch;
            }
            .create-upload-card .staging-header { grid-template-columns: 1fr; }
            .staging-actions { justify-content: flex-start; align-items: stretch; }
            .staging-count-pill { width: 100%; margin-right: 0; padding: 0; }
            .staging-control-btn,
            .staging-scan-btn { flex: 1 1 160px; }
            .scan-job-row { grid-template-columns: minmax(0, 1fr) 34px; }
            .scan-job-progress { grid-column: 1 / -1; }
            #batchSelector, .batch-name-input { width: 100%; max-width: none; }
            .batch-picker-controls { grid-template-columns: minmax(0, 1fr) 40px; width: 100%; }
            .batch-inline-controls { flex-basis: 100%; }
            .batch-detail-field, .sku-prefix-field { flex-basis: 100%; width: 100%; }
            .batch-field { width: 100%; justify-content: flex-end; }
            .batch-field .batch-selector { flex: 1; min-width: 0; }
            .batch-action-row { grid-template-columns: 1fr; }
            .batch-action-column.batch-danger-actions { grid-template-columns: 1fr; }
            .scan-mode { width: 100%; }
            .scan-mode-btn { flex: 1; }
            .listing-toolbar-controls,
            .listing-sort-menu,
            .listing-sort-button { width: 100%; }
            .listing-sort-panel { left: 0; right: 0; width: 100%; }
        }

        /* Create Listing Batch workspace refinement */
        body.batch-create-mode .main {
            max-width: 1760px;
        }
        body.batch-create-mode .topbar.listing-topbar {
            display: none;
        }
        body.batch-create-mode .create-batch-flow {
            grid-template-columns: minmax(390px, 0.82fr) minmax(560px, 1.18fr);
            gap: 0;
            margin-top: 0;
            background: var(--bg-card);
        }
        .create-batch-overview {
            gap: 0;
            padding: 0;
            border: 0;
            border-bottom: 1px solid var(--border);
            border-radius: 0;
            box-shadow: none;
        }
        .create-batch-title-row,
        .create-card-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            min-width: 0;
        }
        .create-batch-title-row h1 {
            min-width: 0;
            font-size: clamp(28px, 2.1vw, 32px);
            letter-spacing: -0.025em;
        }
        .create-batch-title-row {
            min-height: 70px;
            padding: 14px 22px;
            border-bottom: 1px solid var(--border);
        }
        .create-daily-stat {
            display: inline-flex;
            align-items: center;
            flex: 0 0 auto;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 800;
        }
        .create-daily-stat strong {
            color: #0a9f66;
        }
        .create-daily-stat[hidden] {
            display: none;
        }
        .create-batch-steps {
            grid-template-columns: max-content minmax(72px, 1fr) max-content minmax(72px, 1fr) max-content;
            gap: 14px;
            align-items: center;
            min-height: 68px;
            padding: 0 22px;
        }
        .create-batch-step {
            min-height: 68px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
        }
        .create-batch-step.is-active {
            border-color: transparent;
            background: transparent;
        }
        .create-step-number {
            width: 28px;
            height: 28px;
            font-size: 12px;
        }
        .create-step-separator {
            height: 2px;
            overflow: hidden;
            color: transparent;
            background: var(--border);
            border-radius: 999px;
        }
        #createStepSetup + .create-step-separator {
            background: var(--border);
        }
        #createStepSetup.is-complete + .create-step-separator {
            background: var(--accent);
        }
        .create-step-title {
            font-size: 12px;
            font-weight: 700;
        }
        .create-batch-step .create-step-copy {
            display: none;
        }
        .create-batch-card,
        .create-upload-card {
            gap: 16px;
            min-width: 0;
            padding: 22px 28px;
            border: 0;
            border-radius: 0;
            box-shadow: none;
        }
        .create-batch-card {
            border-right: 1px solid var(--border);
        }
        .create-card-heading > div,
        .create-upload-header > div:first-child {
            min-width: 0;
        }
        .create-batch-card h2,
        .create-upload-card h2 {
            font-size: 19px;
            letter-spacing: -0.015em;
        }
        .create-batch-grid {
            gap: 14px 16px;
        }
        .create-section-heading {
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--accent);
            font-size: 0.7rem;
            letter-spacing: 0.075em;
        }
        .create-section-heading::after {
            content: '';
            height: 1px;
            flex: 1 1 auto;
            background: var(--border);
        }
        .create-card-defaults-heading,
        .create-scan-speed-heading {
            padding-top: 14px;
            border-top: 0;
        }
        .create-batch-grid .batch-name-input,
        .create-batch-grid .variation-metadata-input,
        .create-batch-grid .sku-prefix-field input,
        .create-batch-grid .sku-increment-control,
        .create-batch-grid .batch-selector,
        .create-batch-grid .smooth-select-proxy {
            height: 44px;
            border-radius: 8px;
        }
        .create-batch-grid .batch-field select.batch-selector,
        .create-batch-grid .batch-field .smooth-select-proxy,
        .create-batch-grid .smooth-select-proxy.compact .smooth-select-trigger {
            border-radius: 8px !important;
        }
        .create-batch-grid .smooth-select-trigger {
            height: 44px;
            padding: 0 12px;
            border-color: var(--border);
            background: var(--bg-input);
            box-shadow: none;
        }
        .create-batch-grid .smooth-select-trigger:hover,
        .create-batch-grid .smooth-select-proxy.is-open .smooth-select-trigger {
            border-color: rgba(3, 83, 164, 0.45);
            background: var(--bg-card);
        }
        .create-batch-grid .smooth-select-panel {
            padding: 6px;
            border-radius: 10px;
            border-color: rgba(148, 163, 184, 0.4);
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
        }
        .create-batch-grid .smooth-select-option {
            min-height: 38px;
            padding: 9px 11px;
            border-radius: 7px;
        }
        .create-batch-grid .smooth-select-option:hover,
        .create-batch-grid .smooth-select-option:focus-visible {
            background: rgba(3, 83, 164, 0.07);
        }
        .create-batch-grid .smooth-select-option.is-selected {
            background: rgba(3, 83, 164, 0.11);
            color: var(--accent);
        }
        .create-batch-grid .smooth-select-search {
            padding: 4px 4px 7px;
            background: var(--bg-card);
        }
        .create-batch-grid .smooth-select-search-input {
            border-radius: 7px;
            background: var(--bg-input);
        }
        .sku-preview-field {
            padding-bottom: 2px;
            border-bottom: 0;
        }
        .sku-preview-value {
            min-height: 36px;
            padding: 9px 11px;
            border: 1px solid rgba(3, 83, 164, 0.08);
            border-radius: 7px;
        }
        .batch-field-fast-scan {
            max-width: 100%;
        }
        .fast-scan-control {
            max-width: 260px;
            min-height: 44px;
            padding: 7px 10px;
            border: 0;
            background: transparent;
        }
        .fast-scan-control-text {
            grid-template-columns: auto;
        }
        .batch-match-tuning {
            gap: 12px;
            padding-top: 0;
            border-top: 0;
        }
        .matching-settings-overview {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            min-width: 0;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--bg-input);
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
            list-style: none;
        }
        .matching-settings-overview::-webkit-details-marker {
            display: none;
        }
        .matching-settings-overview:hover {
            border-color: rgba(3, 83, 164, 0.32);
            background: rgba(3, 83, 164, 0.045);
        }
        .matching-settings-overview-icon {
            color: var(--accent);
            font-size: 22px;
        }
        .matching-settings-overview > div {
            min-width: 0;
        }
        .matching-settings-disclosure-icon {
            margin-left: auto;
            color: var(--text-muted);
            transition: transform 0.18s ease;
        }
        .batch-match-tuning[open] .matching-settings-disclosure-icon {
            transform: rotate(90deg);
        }
        .matching-settings-details {
            display: grid;
            gap: 12px;
        }
        .batch-match-tuning:not([open]) > .matching-settings-details {
            display: none;
        }
        .matching-settings-head,
        .matching-reprint-row {
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--bg-card);
        }
        .matching-reprint-row {
            background: var(--bg-input);
        }
        .matching-tuning-body {
            padding: 2px 0 0;
        }
        .matching-rule-group {
            border-radius: 9px;
            background: var(--bg-card);
        }
        .create-upload-header {
            align-items: center;
        }
        .create-upload-mode-control {
            width: min(270px, 100%);
        }
        .create-upload-mode-control .scan-mode {
            height: 42px;
            padding: 3px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--bg-card);
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
        }
        .create-upload-mode-control .scan-mode-btn {
            border-radius: 999px;
        }
        .create-upload-summary {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            min-height: 54px;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 850;
            overflow-x: auto;
        }
        .create-upload-summary > span:not(.create-upload-summary-separator) {
            flex: 0 0 auto;
        }
        .create-upload-summary-icon {
            color: var(--accent);
            font-size: 20px;
        }
        .create-upload-summary-separator {
            color: var(--text-muted);
            opacity: 0.75;
        }
        .create-upload-card .empty-state {
            min-height: 390px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 38px 28px 24px;
            border: 2px dashed rgba(3, 83, 164, 0.3);
            border-radius: 12px;
            background: var(--bg-card);
            box-shadow: none;
        }
        .create-upload-card .empty-state:hover {
            border-color: rgba(3, 83, 164, 0.58);
            background: rgba(3, 83, 164, 0.025);
            transform: none;
            box-shadow: none;
        }
        .create-upload-card .empty-state-icon {
            width: 52px;
            height: 52px;
            margin-bottom: 16px;
            opacity: 1;
        }
        .create-upload-card .empty-state h3 {
            margin: 0 0 6px;
            font-size: 23px;
        }
        .create-upload-card .empty-state p {
            margin: 0;
            font-size: 14px;
        }
        .create-upload-card .upload-limit-hint {
            margin-top: 10px;
            font-size: 11px;
        }
        .create-upload-summary [hidden] {
            display: none;
        }
        .create-upload-format-row {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            margin-top: auto;
            padding-top: 24px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 750;
        }
        .create-upload-card .staging-state {
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
        }
        .create-upload-card .staging-item-pair {
            gap: 8px;
            padding: 8px;
            border-radius: 10px;
            box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
        }
        .create-upload-card .staging-side-label {
            align-self: flex-start;
            margin: 2px 0 6px;
            color: var(--text-muted);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .create-upload-card .staging-rotate-btn {
            width: auto;
            min-width: 30px;
            height: 30px;
            padding: 0 8px;
            border-radius: 7px;
            background: var(--bg-card);
        }
        body.listing-flow-stock .create-upload-summary {
            display: none;
        }
        @media (max-width: 1180px) {
            body.batch-create-mode .create-batch-flow {
                grid-template-columns: minmax(0, 1fr);
            }
            .create-batch-overview,
            .create-batch-card,
            .create-upload-card,
            .slab-create-import-slot,
            .stock-list-card {
                grid-column: 1;
            }
            .create-batch-card {
                border-right: 0;
                border-bottom: 1px solid var(--border);
            }
        }
        @media (max-width: 720px) {
            .create-batch-card,
            .create-upload-card {
                padding: 16px;
            }
            .create-batch-overview {
                padding: 0;
            }
            .create-batch-title-row {
                min-height: 60px;
                padding: 12px 16px;
            }
            .create-batch-steps {
                grid-template-columns: minmax(0, 1fr);
                gap: 4px;
                min-height: 0;
                padding: 8px 16px 12px;
            }
            .create-step-separator {
                display: none;
            }
            .create-batch-step {
                min-height: 38px;
                padding: 4px 0;
            }
            .create-upload-summary {
                gap: 9px;
            }
            .create-upload-card .empty-state {
                min-height: 370px;
                padding: 34px 18px 20px;
            }
            .create-upload-format-row {
                flex-wrap: wrap;
                justify-content: center;
                text-align: center;
            }
        }
