/* ==========================================================================
   Listings Page Styles
   Uses Vuexy / Bootstrap 5 utilities where possible.
   Only custom CSS that BS5 can't handle lives here.
   ========================================================================== */

/* Section: Theme Variables */
:root {
    --listing-bg-start: #f8f9fa;
    --listing-bg-mid: #f8f9fa;
    --listing-bg-end: #f8f9fa;
    --listing-surface: #fff;
    --listing-accent: #7367f0;
    --listing-accent-soft: rgba(115, 103, 240, .08);
    --listing-accent-hover: rgba(115, 103, 240, .14);
    --listing-border: rgba(15,23,42,.07);
    --listing-text: #5d596c;
    --listing-muted: #a5a3ae;
    --listing-card-bg: #ffffff;
    --listing-card-border: transparent;
    --listing-card-text: #5d596c;
    --listing-card-title: #5d596c;
    --listing-card-label: #a5a3ae;
    --listing-card-value: #5d596c;
    --listing-card-price: #7367f0;
    --listing-card-image-bg: #fafafa;
    --listing-card-image-border: rgba(15,23,42,.06);
    --listing-card-chip-bg: rgba(15,23,42,.03);
    --listing-card-chip-border: rgba(15,23,42,.06);
    --listing-selected: rgba(115, 103, 240, .12);
    --listing-deep: #0b172a;
    --listing-shell-shadow: 0 .125rem .75rem 0 rgba(75, 70, 92, .08);
    --listing-row-alt: rgba(115, 103, 240, .02);
    --stack-gap: 0.75rem;
}

/* Section: Dark Theme Variables */
.dark-style {
    --listing-bg-start: #2f3349;
    --listing-bg-mid: #2f3349;
    --listing-bg-end: #2f3349;
    --listing-surface: #2f3349;
    --listing-accent: #7367f0;
    --listing-accent-soft: rgba(115, 103, 240, .1);
    --listing-accent-hover: rgba(115, 103, 240, .18);
    --listing-border: rgba(148,163,184,.15);
    --listing-text: #cfcce4;
    --listing-muted: rgba(148,163,184,.7);
    --listing-card-bg: #25293c;
    --listing-card-border: rgba(115, 103, 240, .15);
    --listing-card-text: #cfcce4;
    --listing-card-title: #e7e3fc;
    --listing-card-label: #7c7a92;
    --listing-card-value: #cfcce4;
    --listing-card-price: #7367f0;
    --listing-card-image-bg: rgba(30,41,59,.78);
    --listing-card-image-border: rgba(148,163,184,.2);
    --listing-card-chip-bg: rgba(255,255,255,.04);
    --listing-card-chip-border: rgba(255,255,255,.06);
    --listing-selected: rgba(115, 103, 240, .18);
    --listing-deep: #e7e3fc;
    --listing-shell-shadow: 0 .125rem .75rem 0 rgba(0, 0, 0, .2);
    --listing-row-alt: rgba(255,255,255,.015);
    color-scheme: dark;
}

/* Section: Dark Theme Component Overrides */
.dark-style .loader-overlay { background: transparent; }
.dark-style .loader-spinner { border-color: rgba(115, 103, 240, .18); border-top-color: #7367f0; }
.dark-style .loader-text { color: #7c7a92; }

.dark-style .pagination button {
    background: #25293c;
    border-color: rgba(148,163,184,.15);
    color: var(--listing-text);
}
.dark-style .pagination button:hover:not(:disabled):not(.is-active) {
    background: rgba(115, 103, 240, .1);
    border-color: rgba(115, 103, 240, .25);
}
.dark-style .pagination button.is-active {
    background: var(--listing-accent);
    border-color: var(--listing-accent);
    color: #fff;
}


/* Section: Dashboard Layout */
.listing-dashboard-card {
    position: relative;
    border: none;
    border-radius: .75rem;
    box-shadow: var(--listing-shell-shadow);
    background: var(--listing-surface);
    overflow: clip;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Section: Page Header */
.listings-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--listing-deep);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.listings-header h3::before {
    content: '';
    width: 3px;
    height: 1em;
    background: var(--listing-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Section: Toolbar */
.listings-toolbar {
    gap: .5rem !important;
}
.listings-search-bar {
    flex: 1 1 220px;
    max-width: 360px;
    min-width: 180px;
}
.listings-search-bar .form-control {
    font-size: .8125rem;
    border-radius: .375rem;
}
.listings-search-bar .input-group-text {
    color: var(--listing-muted);
    border-radius: .375rem 0 0 .375rem;
}

/* Toolbar Buttons -- borderless, neutral text, subtle hover */
.toolbar-btn {
    border: 1px solid var(--listing-border);
    background: var(--listing-surface);
    color: var(--listing-text);
    font-weight: 500;
    font-size: .8125rem;
    padding: .4rem .75rem;
    border-radius: .375rem;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.toolbar-btn:hover,
.toolbar-btn:focus-visible {
    background: var(--listing-accent-soft);
    color: var(--listing-accent);
    border-color: var(--listing-accent);
}
.dark-style .toolbar-btn { color: #cbd5e1; }
.dark-style .toolbar-btn:hover,
.dark-style .toolbar-btn:focus-visible { background: rgba(115, 103, 240, .1); color: var(--listing-accent); }

.toolbar-btn--muted {
    color: var(--listing-muted);
    font-weight: 400;
}
.toolbar-btn--muted:hover { color: var(--listing-accent); }

.toolbar-btn--icon {
    padding: .3rem .45rem;
}
.toolbar-btn.dropdown-toggle::after {
    vertical-align: .2em;
}

/* Separator */
.listings-separator {
    border: none;
    border-top: 1px solid var(--listing-border);
    opacity: .7;
}

/* Results Label */
.listing-results-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--listing-text);
    letter-spacing: .01em;
}
.listing-currency-note {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--listing-deep);
    letter-spacing: .01em;
}

/* Section: Filter Dropdown */
.filter-dropdown-menu {
    min-width: 180px;
}

/* Filter sub-content inside popover */
.filter-sub-content {
    min-width: 220px;
    max-width: 320px;
}
.filter-sub-content .filter-sub-title {
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.filter-sub-content .filter-sub-back {
    cursor: pointer;
    color: var(--listing-muted);
    transition: color .15s;
}
.filter-sub-content .filter-sub-back:hover { color: var(--listing-accent); }

/* Section: Active Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--listing-accent-soft);
    border: 1px solid rgba(115, 103, 240, .15);
    border-radius: 50rem;
    padding: .2rem .6rem .2rem .7rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--listing-accent);
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.filter-chip:hover {
    border-color: var(--listing-accent);
    box-shadow: 0 0 0 2px rgba(115, 103, 240, .1);
}
.filter-chip .chip-label { display: flex; align-items: center; gap: .25rem; }
.filter-chip .chip-value { font-weight: 700; }
.filter-chip .remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--listing-accent);
    padding: 0;
    transition: background .15s, color .15s;
}
.filter-chip .remove-btn:hover { background: rgba(239,68,68,.12); color: #dc3545; }
.filter-chip .remove-btn svg { width: 10px; height: 10px; }

/* Section: Copy Button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--listing-muted);
    cursor: pointer;
    padding: 0;
    margin-left: .15rem;
    border-radius: 4px;
    opacity: .4;
    transition: opacity .15s, color .15s;
}
.copy-btn:hover { opacity: 1; color: var(--listing-accent); }
.copy-btn .copy-icon--done { display: none; }
.copy-btn.is-copied .copy-icon { display: none; }
.copy-btn.is-copied .copy-icon--done { display: inline; color: #22c55e; }

/* Section: Empty States */
.listing-empty-state {
    border-radius: .75rem;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.6);
    padding: 3rem 1.5rem;
    color: #475569;
    text-align: center;
}
:is(.dark-style) .listing-empty-state {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(51, 65, 85, 0.4);
    color: #cbd5e1;
}
.listing-empty-content { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.listing-empty-text { text-align: center; }
.listing-empty-title, .listing-empty-subtitle { margin: 0; }
.listing-empty-title { margin-bottom: .25rem; font-size: 1rem; font-weight: 600; color: #0f172a; }
:is(.dark-style) .listing-empty-title { color: #e2e8f0; }
.listing-empty-subtitle { font-size: 0.875rem; color: #64748b; }
:is(.dark-style) .listing-empty-subtitle { color: #94a3b8; }
.listing-empty-icon { font-size: 2.5rem; color: #cbd5e1; line-height: 1; opacity: .6; }
:is(.dark-style) .listing-empty-icon { color: #475569; }
.listing-empty-state {
    animation: emptyFadeIn .4s ease;
}
@keyframes emptyFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Section: Table */

/* Table wrapper */
.listings-table-wrapper {
    position: relative;
    flex: 1;
    overflow-x: auto;
    margin: 0 .75rem;
    border-radius: .5rem;
    border: 1px solid var(--listing-border);
    cursor: grab;
}
.listings-table-wrapper.is-grabbing {
    cursor: grabbing;
    user-select: none;
}
.dark-style .listings-table-wrapper {
    border-color: rgba(148,163,184,.12);
}
.listings-table-wrapper.content-blurred .listings-table { opacity: .3; pointer-events: none; transition: opacity .25s ease; }

.listings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .8125rem;
}
.listings-table th,
.listings-table td {
    padding: .55rem .75rem;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid var(--listing-border);
    color: var(--listing-text);
}
.listings-table thead th {
    font-weight: 600;
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--listing-muted);
    background: var(--listing-surface);
    border-bottom: 1px solid var(--listing-border);
    position: sticky;
    top: 0;
    z-index: 3;
    user-select: none;
}
.listings-table tbody tr {
    transition: background .12s ease;
}
.listings-table tbody tr:nth-child(even) {
    background: rgba(115, 103, 240, .015);
}
.listings-table tbody tr:hover {
    background: var(--listing-accent-hover);
}

/* Sortable column headers */
.listings-table thead th.sortable-th {
    cursor: pointer;
    transition: color .15s, background .15s;
}
.listings-table thead th.sortable-th:hover {
    color: var(--listing-accent);
    background: var(--listing-accent-soft);
}
.sort-indicator {
    display: none;
    margin-left: .3rem;
    font-size: .6rem;
    vertical-align: middle;
    color: var(--listing-accent);
}
.sort-indicator.active {
    display: inline;
}

/* Checkbox column */
.col-checkbox { width: 52px; text-align: center; cursor: pointer; white-space: nowrap; }
.col-checkbox .form-check-input { vertical-align: middle; }
.col-checkbox .fav-btn { vertical-align: middle; margin-left: 4px; }

/* Favorite button */
.fav-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--listing-muted); font-size: .85rem; line-height: 1;
    transition: color .15s;
}
.fav-btn:hover { color: #f59e0b; }
.fav-btn.is-fav { color: #f59e0b; }
.fav-btn.is-fav:hover { color: #d97706; }
.col-actions { width: 44px; text-align: center; cursor: pointer; }

/* Listing cell (image + title + ids) */
.listing-cell { display: flex; align-items: center; gap: .625rem; min-width: 280px; }
.listing-cell__img {
    width: 40px; height: 40px;
    border-radius: .375rem;
    object-fit: contain;
    border: 1px solid var(--listing-card-image-border);
    background: var(--listing-card-image-bg);
    flex-shrink: 0;
    transition: border-color .15s, box-shadow .15s;
}
.listing-cell__img:hover {
    border-color: var(--listing-accent);
    box-shadow: 0 0 0 2px rgba(115,103,240,.1);
}
.listing-cell__info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.listing-cell__title {
    font-weight: 600;
    font-size: .8125rem;
    color: var(--listing-card-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 270px;
    cursor: pointer;
    text-decoration: none;
    transition: color .15s;
}
.listing-cell__title:hover { color: var(--listing-accent); }
.listing-cell__img { cursor: pointer; }
.listing-cell__ids { display: flex; gap: .75rem; align-items: center; font-size: .7rem; color: var(--listing-muted); }
.listing-cell__flag {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: default;
}
.listing-cell__flag--fallback {
    width: auto;
    height: auto;
    font-size: .75rem;
    color: var(--listing-muted);
}
.id-chip {
    display: inline-flex; align-items: center; gap: .15rem; cursor: default;
    font-size: .7rem; color: var(--listing-muted); font-family: 'SF Mono', 'Cascadia Code', monospace;
    background: var(--listing-card-chip-bg); border: 1px solid var(--listing-card-chip-border);
    border-radius: .25rem; padding: .1rem .35rem;
}
.id-chip .copy-btn { opacity: .3; }

/* Buy box cell */
.bb-cell--winner { background: rgba(34,197,94,.06) !important; }
.bb-check { color: #22c55e; font-weight: 700; margin-right: .25rem; }

/* Price/shipping cell */
.shipping-label { font-size: .7rem; color: var(--listing-muted); margin-top: .1rem; }

/* Status cell */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.status-dot--active { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.2); animation: statusPulse 2.5s ease-in-out infinite; }
.status-dot--inactive { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.2); }
.status-dot--oos { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.2); }
@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.2); } 50% { box-shadow: 0 0 0 4px rgba(34,197,94,.12); } }

/* Strategy dropdown in table — overridden by pill style below */
.dark-style .strategy-cell .dropdown-toggle:hover { background: rgba(115,103,240,.1); }

/* Property config button (plus icon in header) */
.prop-config-btn {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .85rem;
    line-height: 1;
    background: rgba(0,0,0,.06);
    color: rgba(0,0,0,.35);
    transition: background .15s, color .15s, transform .15s;
}
.prop-config-btn::after { display: none !important; } /* hide dropdown arrow */
#addFilterBtn::after { display: none !important; }
.prop-config-btn:hover { background: var(--listing-accent); color: #fff; transform: scale(1.05); }
.dark-style .prop-config-btn { background: rgba(255,255,255,.08); color: rgba(255,255,255,.35); }
.dark-style .prop-config-btn:hover { background: var(--listing-accent); color: #fff; }

/* Property config dropdown */
.prop-config-menu {
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
}
.prop-config-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    user-select: none;
}
.prop-config-item .ti-grip-vertical { color: var(--listing-muted); cursor: grab; }
.prop-config-item.drag-over { border-top: 2px solid var(--listing-accent); }

/* Action menu (3-dot) */
.action-dots-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem;
    color: var(--listing-muted);
    border-radius: .375rem;
    font-size: 1.1rem;
    line-height: 1;
    transition: color .15s, background .15s;
}
.action-dots-btn::after { display: none !important; } /* hide dropdown arrow */
.action-dots-btn:hover { color: var(--listing-accent); background: var(--listing-accent-soft); }
.dark-style .action-dots-btn:hover { background: rgba(115,103,240,.1); }

.col-actions .dropdown-menu {
    /* positioned as fixed via useDropdown({ fixed }) so it escapes the table
       wrapper's overflow clip; keep it compact and above other content. */
    width: fit-content !important;
}

/* Table empty state */
.table-empty-row td { text-align: center; padding: 4rem 1rem; color: var(--listing-muted); }
.listing-empty-icon { font-size: 2.5rem; color: var(--listing-muted); opacity: .5; display: block; margin-bottom: .75rem; }
.listing-empty-title { font-size: .9375rem; font-weight: 600; color: var(--listing-text); margin: 0 0 .25rem; }
.listing-empty-subtitle { font-size: .8125rem; color: var(--listing-muted); margin: 0; }

/* Section: Dark Theme Table Overrides */
.dark-style .listings-table thead th { background: #2f3349; }
.dark-style .listings-table tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.dark-style .listings-table tbody tr:hover { background: rgba(115,103,240,.12); }
.dark-style .bb-cell--winner { background: rgba(34,197,94,.08) !important; }

/* Section: Pagination */
.pagination {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
    gap: .3rem;
    flex-wrap: wrap;
    padding: 0 0.75rem 1rem;
}
.pagination button {
    border-radius: .375rem;
    border: 1px solid var(--listing-border);
    background: var(--listing-surface);
    padding: .35rem .65rem;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 34px;
    color: var(--listing-text);
    transition: all .12s;
}
.pagination button:hover:not(:disabled):not(.is-active) {
    background: var(--listing-accent-soft);
    border-color: var(--listing-accent);
    color: var(--listing-accent);
}
.pagination button.nav-button { min-width: 64px; font-weight: 600; }
.pagination button.is-active {
    background: var(--listing-accent);
    border-color: var(--listing-accent);
    color: #fff;
}
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination button.edge-button { min-width: 40px; font-size: 1rem; padding: .35rem .5rem; }
.pagination .pagination-gap {
    display: inline-flex;
    align-items: flex-end;
    padding: 0 .15rem;
    color: var(--listing-muted);
    font-weight: 600;
    user-select: none;
}

/* Section: Progress Bar */
.query-progress {
    position: fixed;
    left: 0;
    width: 100%;
    top: 0;
    height: 3px;
    z-index: 1030;
    border-radius: 999px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .15s, transform .2s;
    pointer-events: none;
}
.query-progress.in-nav {
    position: absolute;
    top: auto; bottom: -1px; left: 0; width: 100%; border-radius: 0; z-index: 1;
}
.query-progress.is-active { opacity: 1; transform: translateY(0); }
.query-progress::before, .query-progress::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 22%;
    border-radius: inherit;
    background: var(--listing-accent);
    filter: drop-shadow(0 2px 6px rgba(115, 103, 240, .45));
    animation: qp-marquee 900ms cubic-bezier(.4,0,.2,1) infinite;
}
.query-progress::after { width: 12%; opacity: .55; animation-duration: 1200ms; animation-delay: 120ms; }
@keyframes qp-marquee { 0% { left: -25% } 100% { left: 103% } }

/* Section: Loader Overlay */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    border-radius: .5rem;
    z-index: 20;
}
.loader-overlay.show { opacity: 1; pointer-events: auto; }
.loader-spinner-container { display: flex; flex-direction: column; align-items: center; gap: .85rem; }
.loader-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(115, 103, 240, .12);
    border-top-color: #7367f0;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { margin: 0; font-size: .8125rem; font-weight: 500; color: #64748b; letter-spacing: .01em; }

/* Section: Toast */
.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem 1rem;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .04);
    background: var(--listing-surface);
    color: var(--listing-text);
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.hide { opacity: 0; transform: translateX(1rem); }
.toast--success { border-left: 4px solid #28c76f; }
.toast--error { border-left: 4px solid #ea5455; }
.toast--warn { border-left: 4px solid #ff9f43; }
.toast--info { border-left: 4px solid #00cfe8; }
.toast__icon { display: flex; width: 20px; height: 20px; flex-shrink: 0; }
.toast__icon svg { width: 100%; height: 100%; }
.toast--success .toast__icon { color: #28c76f; }
.toast--error .toast__icon { color: #ea5455; }
.toast--warn .toast__icon { color: #ff9f43; }
.toast--info .toast__icon { color: #00cfe8; }
.dark-style .toast { background: #25293c; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }

/* Section: Responsive */
@media (max-width: 575.98px) {
    .listings-search-bar { flex: 1 1 100%; max-width: none; }
}

/* Section: Mobile / tablet card view (<992px) — replaces the wide scrolling table */
.listings-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .625rem;
    padding: .25rem .75rem .5rem;
}
.listings-cards.content-blurred { opacity: .3; pointer-events: none; transition: opacity .25s ease; }
.listings-cards__state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--listing-muted);
}
.listing-card {
    border: 1px solid var(--listing-border);
    border-radius: .65rem;
    background: var(--listing-surface);
    padding: .75rem .85rem;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.listing-card__top {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.listing-card__top .row-checkbox { margin-top: .15rem; flex-shrink: 0; }
.listing-card__top .fav-btn { flex-shrink: 0; }
.listing-card__product {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    gap: .625rem;
}
.listing-card__product .listing-cell__title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card__top .action-dots-btn { flex-shrink: 0; }

.listing-card__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--listing-border);
}
.listing-card__switch {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .75rem;
    font-weight: 600;
    color: var(--listing-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.listing-card__switch .form-switch { padding-left: 2.25em; }

.listing-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem .75rem;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--listing-border);
}
@media (min-width: 576px) {
    .listing-card__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.listing-card__field {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}
.listing-card__label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--listing-muted);
}
.listing-card__value {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--listing-text);
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark-style .listing-card { border-color: rgba(148,163,184,.14); box-shadow: none; }

/* Section: Custom Scrollbar */
.listings-table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.1) transparent;
}
.listings-table-wrapper::-webkit-scrollbar {
    height: 6px;
}
.listings-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.listings-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.1);
    border-radius: 3px;
}
.listings-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,.2);
}
.dark-style .listings-table-wrapper {
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.dark-style .listings-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.1);
}
.dark-style .listings-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.2);
}

/* Section: Misc Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Form switches — accent-colored in table rows */
.listings-table .form-check-input:checked {
    background-color: var(--listing-accent);
    border-color: var(--listing-accent);
}
.listings-table .form-check-input {
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.listings-table .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(115, 103, 240, .2);
    border-color: var(--listing-accent);
}

/* Profit cell coloring */
.profit-positive { color: #16a34a; font-weight: 600; }
.profit-negative { color: #dc2626; font-weight: 600; }

/* Strategy cell badge style */
.strategy-cell .dropdown-toggle {
    background: var(--listing-card-chip-bg);
    border: 1px solid var(--listing-card-chip-border);
    border-radius: 50rem;
    padding: .2rem .65rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--listing-text);
    transition: background .15s, border-color .15s, color .15s;
}
.strategy-cell .dropdown-toggle:hover {
    background: var(--listing-accent-soft);
    border-color: rgba(115, 103, 240, .2);
    color: var(--listing-accent);
}
.strategy-cell .dropdown-toggle::after { font-size: .55rem; }

/* Buy box winner row subtle glow */
.bb-cell--winner {
    position: relative;
}

/* Listing title underline animation */
.listing-cell__title {
    text-decoration: none;
    background-image: linear-gradient(var(--listing-accent), var(--listing-accent));
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: color .15s, background-size .25s ease;
}
.listing-cell__title:hover {
    text-decoration: none;
    background-size: 100% 1px;
}

/* Section: Quantity Hover Popover */
.qty-hover-trigger {
    cursor: default;
    border-bottom: 1px dotted var(--listing-muted);
    transition: border-color .15s;
}
.qty-hover-trigger:hover {
    border-color: var(--listing-accent);
    color: var(--listing-accent);
}
.fee-hover-trigger {
    cursor: default;
    border-bottom: 1px dotted var(--listing-muted);
    transition: border-color .15s;
}
.fee-hover-trigger:hover {
    border-color: var(--listing-accent);
    color: var(--listing-accent);
}
.qty-popover {
    max-width: 280px;
    font-size: .8125rem;
}
.qty-popover .popover-body {
    padding: 0;
}
.qty-popover-content {
    padding: .5rem 0;
}
.qty-popover-section {
    padding: .35rem .75rem;
}
.qty-popover-section-title {
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--listing-muted);
    margin-bottom: .25rem;
}
.qty-popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .1rem 0;
    font-size: .8rem;
    color: var(--listing-text);
}
.qty-popover-row--total {
    border-top: 1px solid var(--listing-border);
    margin-top: .2rem;
    padding-top: .25rem;
    font-weight: 600;
}
.qty-popover-muted {
    color: var(--listing-muted);
    font-style: italic;
    font-size: .75rem;
}
.qty-popover-negative {
    color: #ea5455;
    font-weight: 600;
}
.qty-popover-divider {
    border-top: 1px solid var(--listing-border);
    margin: .25rem 0;
}
.qty-popover-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 0;
}
.dark-style .qty-popover .popover-body {
    background: #25293c;
    color: #cfcce4;
}
.dark-style .qty-popover .popover-arrow::after {
    border-right-color: #25293c;
}
.qty-popover--lg {
    max-width: 320px;
    font-size: .875rem;
}
.qty-popover--lg .qty-popover-section {
    padding: .5rem 1rem;
}
.qty-popover--lg .qty-popover-row {
    padding: .2rem 0;
}
