html,
body {
    height: 100%;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #343a40;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

body.index-page {
    background-color: #e7edf3;
}

.hero-shell {
    padding: 2rem 0 1rem;
}

/* ── Modern Navbar ── */
.app-nav {
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: background 0.3s, box-shadow 0.3s;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-nav.scrolled {
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #fff !important;
    transition: opacity 0.2s;
}
.navbar-brand:hover { opacity: 0.85; }

.app-nav .navbar-collapse {
    margin-top: 0.25rem;
}

/* Nav links with animated underline */
.app-nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.72) !important;
    padding: 0.4rem 0.65rem !important;
    position: relative;
    transition: color 0.18s;
}
.app-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: #60a5fa;
    border-radius: 2px;
    transition: left 0.22s ease, right 0.22s ease;
}
.app-nav-link:hover,
.app-nav-link:focus {
    color: #fff !important;
}
.app-nav-link:hover::after,
.app-nav-link:focus::after {
    left: 0.65rem;
    right: 0.65rem;
}

/* Dropdown */
.app-dropdown {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    padding: 6px;
    min-width: 13rem;
    animation: dropIn 0.18s ease;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.app-dropdown .dropdown-item {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    border-radius: 6px;
    padding: 8px 12px;
    transition: background 0.14s, color 0.14s;
}
.app-dropdown .dropdown-item:hover {
    background: rgba(96,165,250,0.15);
    color: #fff;
}

.app-nav-right {
    gap: 0.6rem;
}

.app-nav-credit-badges {
    gap: 0.35rem;
}

.app-nav-user-block {
    gap: 0.55rem;
}

.app-nav-email {
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    line-height: 1.2;
    max-width: 220px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Login / Register / Logout buttons */
.app-nav-btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.3);
    background: transparent;
    text-decoration: none;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    white-space: nowrap;
}
.app-nav-btn-ghost:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.07);
}

.app-nav-btn-solid {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: 1.5px solid #2563eb;
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}
.app-nav-btn-solid:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.3);
    color: #fff;
}

.btn-accent {
    background-color: #4a6fa5;
    border-color: #4a6fa5;
    color: #fff;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: #166088;
    border-color: #166088;
    color: #fff;
}

.hero-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1.8fr 0.8fr;
    align-items: end;
}

.hero-panel h1,
.section-head h1,
.section-head h2,
.panel-card h2,
.panel-card h1,
.item-card h3,
.detail-copy h1 {
    font-weight: 600;
}

.hero-panel h1 {
    font-size: 2.5rem;
}

.muted {
    color: #6c757d;
}

.hero-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.eyebrow,
.label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: #166088;
}

.mono {
    font-family: 'Courier New', monospace;
}

.item-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    display: flex;
    flex-direction: column;
}

.item-card:hover,
.item-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.item-card h3 {
    font-size: 1rem;
    line-height: 1.35;
    margin: 0.55rem 0 0.9rem;
    min-height: 2.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-thumb {
    position: relative;
    height: 236px;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.item-thumb-media {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #f7f9fc;
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 22px rgba(20, 24, 31, 0.08);
}

.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-meta {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-card,
.notice-panel {
    padding: 1.5rem;
}

.panel-card,
.notice-panel,
.empty-state {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.card-topline,
.price-row,
.spec-grid,
.bid-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.index-toolbar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.toolbar-stat {
    margin-right: 0.2rem;
}

.mobile-only-inline {
    display: none;
}

.desktop-only-inline {
    display: inline;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(22, 96, 136, 0.12);
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
}

.category-chip.active {
    background: #166088;
    border-color: #166088;
    color: #fff;
}

.price-row,
.spec-grid {
    margin-top: 1.25rem;
}

.spec-grid {
    flex-wrap: wrap;
}

.spec-grid > div,
.price-row > div {
    flex: 1 1 40%;
}

.spec-grid-card {
    display: grid;
    gap: 0.3rem;
    align-content: start;
}

.compact-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.2rem;
}

.compact-meta > div {
    flex: 1 1 45%;
}

.compact-actions {
    margin-top: auto;
    padding-top: 1rem;
    display: grid;
    gap: 0.5rem;
}

.btn-quick-bid {
    background: #0b74d1;
    border-color: #0b74d1;
    color: #fff;
    font-weight: 700;
}

.btn-quick-bid:hover,
.btn-quick-bid:focus {
    background: #085ea9;
    border-color: #085ea9;
    color: #fff;
}

.btn-outbid-bid {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
    font-weight: 800;
}

.btn-outbid-bid:hover,
.btn-outbid-bid:focus {
    background: #a91f1f;
    border-color: #a91f1f;
    color: #fff;
}

.btn-highest-bid {
    background: #0f5132 !important;
    border-color: #0f5132 !important;
    color: #ffffff !important;
    font-weight: 800;
}

.btn-highest-bid:disabled {
    opacity: 1 !important;
    background: #0f5132 !important;
    border-color: #0f5132 !important;
    color: #ffffff !important;
}

.btn-setup-bid {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
    font-weight: 700;
}

.btn-setup-bid:hover,
.btn-setup-bid:focus {
    background: #5a6268;
    border-color: #5a6268;
    color: #fff;
}

.btn-bid-locked {
    background: #6b7280;
    border-color: #6b7280;
    color: #fff;
    font-weight: 800;
}

.btn-bid-locked:hover,
.btn-bid-locked:focus {
    background: #4b5563;
    border-color: #4b5563;
    color: #fff;
}

.item-card.quick-state-outbid {
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.09), rgba(220, 53, 69, 0.03));
    border: 2px solid rgba(220, 53, 69, 0.48);
    box-shadow: 0 10px 24px rgba(220, 53, 69, 0.16);
}

.item-card.quick-state-leading {
    background: linear-gradient(180deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.03));
    border: 2px solid rgba(25, 135, 84, 0.45);
    box-shadow: 0 10px 24px rgba(25, 135, 84, 0.17);
}

.listing-disclosure-banner {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fff3cd;
    border: 1px solid #f0c36d;
    color: #7a4b00;
    font-weight: 600;
    line-height: 1.5;
}

.top-disclosure-banner {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #ffe8a1;
    border: 1px solid #e3b04b;
    color: #6c4300;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: 0 2px 10px rgba(227, 176, 75, 0.18);
}

.listing-disclosure-card {
    display: inline-block;
    margin-bottom: 0.8rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: #fff3cd;
    border: 1px solid #f0c36d;
    color: #7a4b00;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.item-card-note {
    margin: 0 0 0.85rem;
    color: #6c757d;
    line-height: 1.55;
    font-size: 0.94rem;
}

.item-condition-state {
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #e7f1ff;
    border: 1px solid #7fb3ff;
    color: #0b4f9c;
    display: grid;
    gap: 0.2rem;
}

.item-package-callout {
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #f4f7fb;
    border: 1px solid #c7d5e6;
    color: #36506b;
    display: grid;
    gap: 0.2rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(74, 111, 165, 0.1);
    color: #166088;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.approved-pill {
    background: rgba(68, 131, 92, 0.16);
    color: #2f6d43;
}

.pending-pill {
    background: rgba(255, 193, 7, 0.2);
    color: #8a6d1f;
}

.upcoming-pill,
.listing-state-badge.upcoming {
    background: #facc15;
    color: #111;
}

.listing-state-badge.live {
    background: rgba(25, 135, 84, 0.94);
    color: #fff;
}

.item-thumb .listing-state-badge {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(20, 24, 31, 0.12);
    font-weight: 800;
}

.item-thumb .countdown-overlay-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 12px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 800;
    font-size: clamp(0.62rem, 2.7vw, 0.78rem);
    line-height: 1.05;
    text-transform: none;
    letter-spacing: 0.01em;
    background: rgba(11, 116, 209, 0.94);
    color: #ffffff;
    border: 1px solid rgba(191, 219, 254, 0.7);
    box-shadow: 0 10px 24px rgba(11, 116, 209, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
}

.item-card.quick-state-leading .item-thumb .countdown-overlay-badge {
    background: rgba(15, 81, 50, 0.94);
    color: #ffffff;
    border-color: rgba(187, 247, 208, 0.64);
    box-shadow: 0 10px 24px rgba(15, 81, 50, 0.4);
}

.item-card.quick-state-outbid .item-thumb .countdown-overlay-badge {
    background: rgba(198, 40, 40, 0.94);
    color: #ffffff;
    border-color: rgba(254, 202, 202, 0.7);
    box-shadow: 0 10px 24px rgba(198, 40, 40, 0.4);
}

.item-thumb .countdown-bottom-badge {
    position: absolute;
    left: 50%;
    bottom: 0.45rem;
    top: auto;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 0.9rem);
    max-width: calc(100% - 0.9rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 800;
    font-size: clamp(0.62rem, 2.7vw, 0.76rem);
    line-height: 1.05;
    text-transform: none;
    letter-spacing: 0.01em;
    background: rgba(15, 23, 42, 0.58);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 8px 16px rgba(2, 6, 23, 0.26);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
}

.item-thumb .countdown-bottom-badge.countdown-bidder {
    background: rgba(11, 116, 209, 0.74);
    color: #ffffff;
    border-color: rgba(191, 219, 254, 0.62);
    box-shadow: 0 8px 16px rgba(11, 116, 209, 0.28);
}

.item-card.quick-state-leading .item-thumb .countdown-bottom-badge.countdown-bidder {
    background: rgba(15, 81, 50, 0.74);
    color: #ffffff;
    border-color: rgba(187, 247, 208, 0.56);
    box-shadow: 0 8px 16px rgba(15, 81, 50, 0.28);
}

.item-card.quick-state-outbid .item-thumb .countdown-bottom-badge.countdown-bidder {
    background: rgba(198, 40, 40, 0.74);
    color: #ffffff;
    border-color: rgba(254, 202, 202, 0.62);
    box-shadow: 0 8px 16px rgba(198, 40, 40, 0.28);
}

.item-thumb .countdown-overlay-badge.ending-soon {
    background: rgba(161, 90, 0, 0.9);
    color: #fff;
}

.item-thumb .countdown-overlay-badge.ending-fast {
    background: rgba(180, 35, 24, 0.92);
    color: #fff;
}

.item-thumb .countdown-bottom-badge.ending-soon {
    background: rgba(161, 90, 0, 0.82);
    color: #fff;
}

.item-thumb .countdown-bottom-badge.ending-fast {
    background: rgba(180, 35, 24, 0.86);
    color: #fff;
}

.item-thumb .sold-overlay-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(51, 65, 85, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.34);
    pointer-events: none;
}

.item-thumb .sold-overlay-badge.sold-ended-overlay-badge {
    background: rgba(192, 57, 43, 0.95);
    color: #fff;
}

.item-thumb .sold-overlay-badge.auction-ended-overlay-badge {
    background: rgba(51, 65, 85, 0.95);
    color: #f8fafc;
}

.item-thumb .sold-overlay-badge.pending-overlay-badge {
    background: rgba(180, 83, 9, 0.95);
    color: #fff;
}

.item-thumb .highest-bidder-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: inline-block;
    max-width: calc(100% - 18px);
    padding-inline: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    font-weight: 850;
    font-size: clamp(0.84rem, 3.05vw, 1.12rem);
    letter-spacing: 0.01em;
    text-transform: none;
    color: #ffffff;
    -webkit-text-stroke: 0;
    text-shadow:
        1px 0 0 #0f172a,
        -1px 0 0 #0f172a,
        0 1px 0 #0f172a,
        0 -1px 0 #0f172a,
        1px 1px 0 #0f172a,
        -1px 1px 0 #0f172a,
        1px -1px 0 #0f172a,
        -1px -1px 0 #0f172a,
        3px 0 0 rgba(255, 255, 255, 0.68),
        -3px 0 0 rgba(255, 255, 255, 0.68),
        4px 0 0 rgba(255, 255, 255, 0.52),
        -4px 0 0 rgba(255, 255, 255, 0.52),
        0 2px 0 rgba(255, 255, 255, 0.50),
        0 -2px 0 rgba(255, 255, 255, 0.50),
        2px 2px 0 rgba(255, 255, 255, 0.46),
        -2px 2px 0 rgba(255, 255, 255, 0.46),
        2px -2px 0 rgba(255, 255, 255, 0.46),
        -2px -2px 0 rgba(255, 255, 255, 0.46),
        0 2px 5px rgba(0, 0, 0, 0.35);
}

.sold-ended-badge {
    background: #c0392b !important;
    color: #fff !important;
}

.buy-now-sold-badge {
    background: #c0392b !important;
    color: #fff !important;
}

.winner-gold-badge {
    position: absolute;
    left: 50% !important;
    right: auto !important;
    top: 0.55rem !important;
    transform: translateX(-50%);
    width: calc(100% - 1rem);
    max-width: 94%;
    justify-content: center;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(140deg, #7a5600 0%, #f2c94c 28%, #ffe9a3 52%, #f1c14a 76%, #9b6d00 100%);
    color: #111 !important;
    border: 1px solid rgba(255, 217, 102, 0.95);
    box-shadow: 0 0 12px rgba(255, 212, 82, 0.5), 0 8px 18px rgba(20, 24, 31, 0.22);
    overflow: visible;
}

.winner-gold-badge .winner-glint {
    position: absolute;
    font-size: 0.66rem;
    line-height: 1;
    color: rgba(255, 248, 214, 0.96);
    text-shadow:
        0 0 6px rgba(255, 235, 160, 0.95),
        0 0 12px rgba(255, 210, 90, 0.85);
    transform: translate(-50%, -50%) scale(var(--s0, 0.25)) rotate(var(--r0, 0deg));
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes winnerGlintPulse {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(var(--s0, 0.2)) rotate(var(--r0, 0deg)); }
    22%  { opacity: 0.85; transform: translate(-50%, -50%) scale(var(--s1, 1)) rotate(var(--r1, 28deg)); }
    58%  { opacity: 0.52; transform: translate(-50%, -50%) scale(calc(var(--s1, 1) * 0.92)) rotate(calc(var(--r1, 28deg) + 18deg)); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(var(--s2, 0.25)) rotate(var(--r2, 56deg)); }
}

.sold-ended-note {
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.pending-purchase-note {
    color: #a16207;
    font-weight: 700;
    font-size: 13px;
}

.item-card.sold-card {
    border: 1px solid rgba(100, 116, 139, 0.22);
    box-shadow: 0 6px 18px rgba(100, 116, 139, 0.18);
}

.item-card.sold-card .item-thumb {
    background: #dbe2ea;
}

.item-card.sold-card .item-thumb-media {
    background: #d9dee5;
}

.item-card.sold-card .item-thumb img {
    filter: grayscale(1) brightness(0.72) contrast(0.9);
}

.item-card.sold-card .item-meta {
    background: #e8edf3;
}

.item-card.sold-card h3,
.item-card.sold-card .label,
.item-card.sold-card strong {
    color: #556476;
}

.item-card.pending-purchase-card {
    background: #f1e9dc;
    border: 1px solid rgba(180, 83, 9, 0.28);
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.16);
}

.item-card.pending-purchase-card .item-thumb {
    background: #e8e2d7;
}

.item-card.pending-purchase-card .item-thumb-media {
    background: #e3dbd0;
}

.item-card.pending-purchase-card .item-thumb img {
    filter: grayscale(0.7) brightness(0.82) contrast(0.92);
}

.item-card.pending-purchase-card .item-meta {
    background: #f1e9dc;
    flex: 1;
}

.item-card.pending-purchase-card h3,
.item-card.pending-purchase-card .label {
    color: #78350f;
}

.item-card.pending-purchase-card strong {
    color: #92400e;
}

body.index-compact-view .item-card {
    border-radius: 9px;
}

body.index-compact-view .item-thumb {
    height: 144px;
    padding: 0.15rem;
}

body.index-compact-view .item-thumb-media {
    border-radius: 11px;
}

body.index-compact-view .item-meta {
    padding: 0.55rem 0.6rem;
}

body.index-compact-view .item-card h3,
body.index-compact-view .item-card .card-topline,
body.index-compact-view .item-card .compact-meta,
body.index-compact-view .item-card .text-muted.small {
    display: none;
}

body.index-compact-view .item-card .compact-actions {
    margin-top: 0.2rem;
    gap: 0.35rem;
}

body.index-compact-view .item-card .compact-actions .btn {
    font-size: 0.82rem;
    padding: 0.32rem 0.48rem;
}

body.index-compact-view .item-card .listing-state-badge,
body.index-compact-view .item-card .bid-count-badge,
body.index-compact-view .item-card .countdown-overlay-badge,
body.index-compact-view .item-card .sold-overlay-badge {
    font-size: 0.66rem;
}

body.index-compact-view .row.g-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.8rem;
}

body.index-compact-view .row.g-4 > .js-item-col {
    max-width: none;
    width: auto;
}

@media (max-width: 576px) {
    body.index-compact-view .row.g-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bid-count-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    background: rgba(20, 24, 31, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.01em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.pulse-soft {
    animation: pulse-soft 3.6s ease-in-out infinite;
}

.spin-valid-today-note {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde047, #f59e0b);
    color: #111827;
    font-size: 0.72rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.spin-note-mobile {
    display: none;
}

@media (max-width: 576px) {
    .index-main-section {
        margin-top: 0 !important;
    }

    section.container.mt-4 {
        margin-top: 0.25rem !important;
        margin-bottom: 0.35rem !important;
    }

    .index-toolbar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        gap: 0.25rem;
        padding-bottom: 0.1rem;
    }

    .index-toolbar::-webkit-scrollbar {
        display: none;
    }

    .index-toolbar > * {
        flex: 0 0 auto;
    }

    .index-toolbar .btn {
        font-size: 0.72rem !important;
        padding: 2px 6px !important;
        border-radius: 8px;
        white-space: nowrap;
    }

    .toolbar-stat {
        font-size: 0.95rem !important;
        margin-right: 0.1rem;
    }

    .index-sort-form {
        width: auto;
    }

    .index-sort-select {
        width: auto;
        min-width: 100px !important;
        max-width: 116px;
        height: 26px;
        border-radius: 8px;
        font-size: 0.70rem !important;
        padding: 1px 22px 1px 6px !important;
    }

    #cat-toggle,
    #sold-toggle,
    #compact-toggle {
        white-space: nowrap;
    }

    .desktop-only-inline {
        display: none;
    }

    .mobile-only-inline {
        display: inline;
    }

    .spin-valid-today-note {
        margin-left: 0.25rem;
        padding: 0.14rem 0.4rem;
        font-size: 0.64rem;
        white-space: normal;
    }

    .spin-note-full {
        display: none;
    }

    .spin-note-mobile {
        display: inline;
    }
}

@keyframes pulse-soft {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 96, 136, 0);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 0.22rem rgba(22, 96, 136, 0.08);
    }
}

.thumb-fallback {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: rgba(74, 111, 165, 0.1);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 700;
}

.thumb-fallback.large {
    width: 160px;
    height: 160px;
    font-size: 4rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.notice-panel {
    border-left: 6px solid #4a6fa5;
}

.narrow-shell {
    max-width: 560px;
}

.form-control {
    border-radius: 0.375rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(74, 111, 165, 0.15);
    border-color: rgba(74, 111, 165, 0.4);
}

.item-detail-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 2rem;
    align-items: start;
}

.item-gallery,
.item-info {
    min-width: 0;
}

.gallery-main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #eef2f7;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    width: 100%;
    height: 460px;
    object-fit: contain;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(20, 24, 31, 0.72);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
}

.gallery-nav.prev {
    left: 0.85rem;
}

.gallery-nav.next {
    right: 0.85rem;
}

.gallery-thumbs {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.gallery-thumbs .thumb {
    width: 100%;
    height: 86px;
    max-width: 86px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #eef2f7;
    cursor: pointer;
}

.gallery-thumbs .thumb.active {
    border-color: #166088;
}

.gallery-placeholder {
    min-height: 460px;
    border-radius: 14px;
    background: rgba(74, 111, 165, 0.1);
    display: grid;
    place-items: center;
    font-size: 4rem;
    font-weight: 700;
    color: #166088;
}

.item-info {
    display: grid;
    gap: 1.15rem;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.badge-row .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-row .badge.source,
.badge-row .badge.category {
    background: #e9f2fb;
    color: #166088;
}

.badge-row .badge.condition {
    background: #e7f1ff;
    color: #0b4f9c;
}

.badge-row .badge.live {
    background: #e6f4ea;
    color: #2f6d43;
}

.badge-row .badge.sold {
    background: #b42318;
    color: #fff;
}

.badge-row .badge.upcoming {
    background: #facc15;
    color: #111;
}

.badge-row .badge.hidden {
    background: #fff4db;
    color: #8a6d1f;
}

.badge-row .badge.time-left-badge {
    background: #edf6ff;
    color: #0b4f9c;
}

.time-left-badge {
    justify-self: start;
    font-weight: 700;
}

.time-left-badge.ending-soon {
    background: #fff1d6;
    color: #a15a00;
}

.time-left-badge.ending-fast {
    background: #ffe0e0;
    color: #b42318;
}

.item-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.18;
}

.inspection-notice {
    margin: 0;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: #fff3cd;
    border: 1px solid #f0c36d;
    color: #7a4b00;
    font-weight: 600;
    line-height: 1.6;
}

.item-teaser {
    margin: 0;
    font-size: 1rem;
    color: #495057;
    line-height: 1.7;
}

.meta-table {
    margin: 0;
    display: grid;
    gap: 0.85rem;
}

.meta-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: baseline;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(22, 96, 136, 0.08);
}

.meta-row dt,
.meta-row dd {
    margin: 0;
}

.meta-row dt {
    font-weight: 700;
    color: #6c757d;
}

.meta-row dd {
    color: #212529;
}

.price-main {
    font-size: 1.4rem;
    font-weight: 700;
    color: #166088;
}

.item-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.bid-panel,
.bid-history,
.item-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 1.35rem;
}

.bid-panel-header {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.bid-panel-header h2,
.bid-history h3,
.item-section h2,
.item-section h3 {
    margin: 0;
}

.auction-timer.in-panel {
    margin-top: 0;
}

.auction-timer.top-of-item {
    margin: 0 0 1.1rem;
}

.timer-label,
.timer-sub {
    display: block;
}

.timer-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #166088;
}

.timer-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #212529;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.timer-sub {
    font-size: 0.88rem;
    color: #6c757d;
    line-height: 1.4;
}

.bid-notice,
.no-bids {
    margin: 0;
    color: #6c757d;
}

.form-group {
    margin-bottom: 1rem;
}

.bid-history {
    display: grid;
    gap: 0.8rem;
}

.bid-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 140px;
    gap: 0.75rem;
    align-items: center;
}

.bid-amount {
    font-weight: 700;
    color: #166088;
}

.bid-email,
.bid-time {
    color: #6c757d;
    font-size: 0.92rem;
}

.item-sections {
    margin-top: 2rem;
    display: grid;
    gap: 1.25rem;
}

.condition-selected {
    margin-top: 0.75rem;
    color: #0b4f9c;
    font-weight: 700;
}

.highlights-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.65rem;
}

.video-wrap {
    background: #eef2f7;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrap .item-video {
    height: 320px;
}

.detail-card {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 0.95fr 1.05fr;
}

.detail-media {
    min-height: 420px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-media .carousel,
.detail-media .carousel-inner,
.detail-media .carousel-item {
    width: 100%;
    height: 100%;
}

.detail-media .carousel-item img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #eef2f7;
}

.detail-gallery {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.75rem;
}

.detail-gallery-thumb {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    border: 1px solid rgba(22, 96, 136, 0.12);
    padding: 0;
}

.detail-gallery-thumb img {
    width: 100%;
    height: 84px;
    object-fit: cover;
    display: block;
}

.detail-gallery-thumb.active {
    border-color: #166088;
    box-shadow: 0 0 0 2px rgba(22, 96, 136, 0.15);
}

.detail-lead {
    margin-top: 0.9rem;
    margin-bottom: 1.1rem;
    font-size: 1rem;
    line-height: 1.65;
    color: #495057;
}

.auction-timer {
    margin-top: 1.1rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(22, 96, 136, 0.08), rgba(74, 111, 165, 0.14));
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    align-items: center;
}

.auction-timer-value {
    display: block;
    font-size: 1.25rem;
}

.auction-timer.ended {
    background: rgba(108, 117, 125, 0.12);
}

.auction-timer.ending-soon {
    background: #fff1d6;
    border: 1px solid #f0c36d;
}

.auction-timer.ending-soon .timer-label,
.auction-timer.ending-soon .timer-value {
    color: #a15a00;
}

.auction-timer.ending-fast {
    background: #ffe0e0;
    border: 1px solid #ef8e8e;
}

.auction-timer.ending-fast .timer-label,
.auction-timer.ending-fast .timer-value {
    color: #b42318;
}

.auction-timer.upcoming-message {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(220, 53, 69, 0.16));
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.auction-timer.upcoming-message .timer-label,
.auction-timer.upcoming-message .timer-value {
    color: #b42318;
}

.auction-timer.upcoming-message .timer-sub {
    color: #7a2830;
}

.auction-timer-top {
    margin-top: 0;
    border: 1px solid rgba(22, 96, 136, 0.18);
    box-shadow: 0 2px 12px rgba(22, 96, 136, 0.12);
}

.amazon-list {
    padding-left: 1.2rem;
    display: grid;
    gap: 0.65rem;
}

.description-block {
    display: grid;
    gap: 0.9rem;
}

.description-block p {
    margin: 0;
    line-height: 1.7;
    color: #495057;
}

.detail-table th {
    width: 34%;
    font-weight: 600;
    color: #212529;
    background: #f8fafc;
}

.bid-list {
    display: grid;
    gap: 0.9rem;
}

.bid-row {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.table-actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.editor-form {
    display: grid;
    gap: 1.5rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.editor-span-2 {
    grid-column: 1 / -1;
}

.media-manager h2 {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
}

.media-grid,
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
}

.media-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid rgba(22, 96, 136, 0.12);
    border-radius: 12px;
    background: #f8fafc;
}

.media-card img,
.media-card video,
.item-video {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    background: #e9eef3;
}

.media-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
}

table a {
    color: #166088;
    text-decoration: none;
}

/* ── Modern Footer ── */
.app-footer {
    background: #111827;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 0 1.25rem;
    margin-top: auto;
}

.app-footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.app-footer-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}
.app-footer-logo .fa-gavel { color: #60a5fa; }

.app-footer-tagline {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    align-items: center;
}
.app-footer-links a {
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.18s;
}
.app-footer-links a:hover { color: #fff; }

.app-footer-bottom {
    padding-top: 1.1rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

.support-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    background: #166088;
    color: #fff;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    box-shadow: 0 12px 24px rgba(22, 96, 136, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.support-fab:hover,
.support-fab:focus {
    background: #0f4f70;
    color: #fff;
    text-decoration: none;
}

.support-fab.ai-mode {
    background: #0f766e;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.34);
}

.support-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: min(420px, calc(100vw - 2rem));
    max-height: 75vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(9, 27, 42, 0.26);
    border: 1px solid rgba(22, 96, 136, 0.2);
    overflow: hidden;
    z-index: 1060;
    display: flex;
    flex-direction: column;
}

.support-widget.ai-mode {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 18px 40px rgba(15, 118, 110, 0.24);
}

.support-widget-header {
    background: linear-gradient(135deg, #166088, #1f7ca8);
    color: #fff;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.support-widget.ai-mode .support-widget-header {
    background: linear-gradient(135deg, #0f766e, #14a38b);
}

.support-widget-body {
    padding: 0.75rem;
    background: #f7fafc;
    overflow-y: auto;
    min-height: 220px;
    max-height: 46vh;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.support-message {
    max-width: 88%;
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    background: #fff;
    border: 1px solid rgba(22, 96, 136, 0.15);
    box-shadow: 0 4px 12px rgba(9, 27, 42, 0.05);
}

.support-message.mine {
    margin-left: auto;
    background: #e9f6fd;
}

.support-message.ai {
    border-color: #8fd7c9;
    background: #e9fbf5;
}

.support-message.system {
    border-color: #f7d794;
    background: #fff8e6;
}

.support-message.system .support-message-meta {
    color: #8a6500;
    font-weight: 700;
}

.support-message-meta {
    font-size: 0.72rem;
    color: #4f6776;
    margin-bottom: 0.2rem;
}

.support-message-text {
    font-size: 0.93rem;
    color: #1e2933;
    white-space: pre-wrap;
}

.support-media {
    width: 100%;
    margin-top: 0.45rem;
    border-radius: 10px;
    border: 1px solid #d7e3ec;
    max-height: 220px;
    object-fit: cover;
    background: #ecf2f7;
}

.support-typing {
    min-height: 1.1rem;
    padding: 0 0.9rem;
    font-size: 0.78rem;
    color: #5e7381;
}

.support-ai-disclaimer {
    display: none;
    padding: 0.4rem 0.9rem;
    font-size: 0.72rem;
    color: #7a8a96;
    background: #f0f4f7;
    border-top: 1px solid #e2eaf0;
    line-height: 1.4;
}

.support-widget-actions {
    border-top: 1px solid rgba(22, 96, 136, 0.16);
    padding: 0.75rem;
    background: #fff;
}

.support-ai-badge {
    margin-top: 6px;
    display: inline-block;
    background: rgba(8, 38, 32, 0.38);
    border: 1px solid rgba(214, 255, 244, 0.34);
    color: #dcfff4;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    letter-spacing: 0.02em;
}

@media (max-width: 991px) {
    .app-nav-right {
        align-items: flex-start !important;
        margin-top: 0.35rem;
    }

    .app-nav-credit-badges,
    .app-nav-user-block {
        justify-content: flex-start;
    }

    .item-detail-wrapper,
    .hero-panel,
    .detail-card {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .editor-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .hero-panel h1 {
        max-width: none;
    }

    .section-head,
    .price-row,
    .spec-grid,
    .bid-row {
        display: grid;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .media-grid,
    .video-grid {
        grid-template-columns: 1fr 1fr;
    }

    .meta-row,
    .bid-row {
        grid-template-columns: 1fr;
    }

    .support-widget {
        width: calc(100vw - 1rem);
        right: 0.5rem;
        bottom: 0.5rem;
        max-height: 82vh;
    }

    .support-widget-body {
        max-height: 52vh;
    }

    .support-fab span {
        display: none;
    }

    .support-fab {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .app-nav-link,
    .app-nav .dropdown-item,
    .app-nav-btn-ghost,
    .app-nav-btn-solid {
        font-size: 0.86rem;
    }

    .app-nav-email {
        max-width: 220px;
        font-size: 0.84rem;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .section-head {
        margin-bottom: 0.5rem;
    }

    .row.g-4 {
        --bs-gutter-y: 0.75rem;
        --bs-gutter-x: 0.75rem;
    }

    .panel-card {
        padding: 0.85rem !important;
    }

    .media-grid,
    .video-grid,
    .detail-gallery {
        grid-template-columns: 1fr;
    }

    .detail-media,
    .detail-media .carousel-item img,
    .gallery-main img,
    .media-card img,
    .media-card video,
    .item-video {
        height: auto;
        min-height: 220px;
    }

    .gallery-main,
    .gallery-placeholder {
        min-height: 320px;
    }

    .gallery-thumbs {
        grid-template-columns: repeat(auto-fill, 64px);
        justify-content: start;
        gap: 0.5rem;
    }

    .gallery-thumbs .thumb {
        width: 64px;
        height: 64px;
        max-width: 64px;
    }

    .auction-timer {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 0.9rem 1rem;
    }

    .timer-label {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .timer-value {
        font-size: 1.15rem;
    }

    .timer-sub {
        font-size: 0.82rem;
    }
}
