/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
   :root {
    /* Color Palette */
    --bg-color: #0b0c10;
    --bg-gradient: linear-gradient(135deg, #0b0c10 0%, #1f2833 100%);
    --card-bg: rgba(31, 40, 51, 0.4);
    --card-border: rgba(102, 252, 241, 0.2);
    --primary-color: #66fcf1;
    --primary-hover: #45a29e;
    --text-main: #e0e2e4;
    --text-muted: #8b929a;
    --accent-red: #ff4b4b;
    --accent-green: #4ade80;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

body.theme-pokemon {
    --bg-color: #C41214;
    --bg-gradient: #C41214;
    --card-bg: #111;
    --primary-color: #ffde00;
    --primary-hover: #2ecc40;
    --card-border: #4ea8de;
    --lcd-blue: #4ea8de;
    background: #C41214 !important;
}

/* ── Pokédex Header ─────────────────────────────────────── */
body.theme-pokemon header.glass-panel {
    background: #C41214;
    border: none;
    border-bottom: 5px solid #8a0909;
    box-shadow: 0 5px 0 #5a0505, 0 8px 20px rgba(0,0,0,0.5);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 18px 28px;
    margin-bottom: 0;
    position: relative;
}

/* Blue lens eye */
body.theme-pokemon .logo h1::before {
    content: '';
    display: inline-block;
    width: 46px;
    height: 46px;
    background: radial-gradient(circle at 38% 35%, #cceeff, #4ea8de 45%, #005a9e);
    border: 4px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    margin-right: 14px;
    box-shadow: 0 0 0 4px #222, 0 0 20px #4ea8de, inset 0 0 10px rgba(0,0,0,0.3);
    vertical-align: middle;
    flex-shrink: 0;
}

/* Status indicator dots (red · yellow · green) */
body.theme-pokemon header.glass-panel::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 96px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 18px 0 0 #f5c542, 36px 0 0 #2ecc40;
}

body.theme-pokemon .logo h1 {
    text-transform: none;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 14px;
}
/* lens via ::before — remove its margin-right (gap handles spacing) */
body.theme-pokemon .logo h1::before {
    margin-right: 0 !important;
}

/* ── Screen / Main content area ─────────────────────────── */
body.theme-pokemon main {
    background: #111;
    border-top: 6px solid #555;
    padding: 20px 24px 28px;
    position: relative;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.7);
    min-height: 60vh;
}

/* Hinge line visual separator */
body.theme-pokemon main::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    background: #888;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ── Search panel (screen bezel) ───────────────────────── */
body.theme-pokemon .cm-filters-container {
    background: #1a1a2e;
    border: 3px solid #666;
    border-radius: 6px;
    box-shadow: inset 0 0 24px rgba(0,20,80,0.3);
}

body.theme-pokemon .cm-filter-col label {
    color: #7ec8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

body.theme-pokemon .cm-input,
body.theme-pokemon .cm-dropdown {
    background: #0d1117;
    border: 1px solid #3a5070;
    color: #a0d8ef;
    font-family: 'Courier New', monospace;
}

body.theme-pokemon .cm-input::placeholder { color: #456; }

body.theme-pokemon .cm-input:focus,
body.theme-pokemon .cm-dropdown:focus {
    border-color: #4ea8de;
    box-shadow: 0 0 0 2px rgba(78,168,222,0.2);
}

/* Green Pokédex SEARCH button */
body.theme-pokemon .cm-btn-search {
    background: #1f8c2e;
    color: #fff;
    border: none;
    border-radius: 5px;
    box-shadow: 0 5px 0 #0f5018, inset 0 1px 0 rgba(255,255,255,0.15);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

body.theme-pokemon .cm-btn-search:hover {
    background: #28a83a;
    box-shadow: 0 3px 0 #0f5018;
    transform: translateY(2px);
}

/* ── Results panel (LCD screen) ────────────────────────── */
body.theme-pokemon .results-section {
    background: #0b0e1a;
    border: 3px solid #4ea8de;
    border-radius: 6px;
    padding: 16px;
    box-shadow: inset 0 0 40px rgba(0,30,80,0.5), 0 0 16px rgba(78,168,222,0.1);
}

body.theme-pokemon .cm-hits {
    color: #7ec8f0;
    font-family: 'Courier New', monospace;
}

body.theme-pokemon .cm-view-btn {
    background: #0d1117;
    border: 1px solid #4ea8de;
    color: #4ea8de;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

body.theme-pokemon .cm-view-btn.active,
body.theme-pokemon .cm-view-btn:hover {
    background: #4ea8de;
    color: #000;
}

/* ── Cards ──────────────────────────────────────────────── */
body.theme-pokemon .cm-card {
    background: #141820;
    border: 1px solid #2a3a50;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(78,168,222,0.08);
}

body.theme-pokemon .cm-card:hover {
    border-color: #ffde00;
    box-shadow: 0 0 18px rgba(255,222,0,0.35), 0 4px 12px rgba(0,0,0,0.4);
    transform: translateY(-4px);
}

body.theme-pokemon .cm-card-img-wrapper {
    background: #0d0d0d;
}

body.theme-pokemon .cm-card-title {
    color: #a0d8ef;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.theme-pokemon .cm-card-price {
    color: #ffde00;
    font-family: 'Courier New', monospace;
}

body.theme-pokemon .cm-card-price strong {
    color: #ffde00;
    text-shadow: 0 0 8px rgba(255,222,0,0.5);
}

/* ── Layout overrides ───────────────────────────────────── */
body.theme-pokemon .app-container {
    padding: 0;
}

body.theme-pokemon .search-section {
    margin-bottom: 0;
    padding: 0;
}


/* ── Modal overrides ────────────────────────────────────── */
body.theme-pokemon .card-details-grid {
    background: #001219;
    border: 2px solid #333;
    box-shadow: inset 0 0 10px #4ea8de;
}

body.theme-pokemon .detail-value {
    color: #4ea8de;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

body.theme-pokemon .price-tag {
    background: #000;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    border: 1px solid #333;
}

/* ── Pokémon Modal — Red / Black / Yellow ─────────────── */
body.theme-pokemon .modal-content {
    background: rgba(10, 2, 2, 0.97);
    border: 1px solid rgba(204, 0, 0, 0.45);
    box-shadow: 0 0 50px rgba(204, 0, 0, 0.12), 0 20px 60px rgba(0,0,0,0.9);
}

body.theme-pokemon .modal-right h2 {
    color: #ffde00;
    text-shadow: 0 0 20px rgba(255, 222, 0, 0.35);
    margin-bottom: 0.8rem;
}

body.theme-pokemon .close-btn { color: rgba(255, 222, 0, 0.7); border-color: rgba(255, 222, 0, 0.15); }
body.theme-pokemon .close-btn:hover { color: #ffde00; border-color: rgba(255, 222, 0, 0.4); box-shadow: 0 0 12px rgba(255, 222, 0, 0.15); }

/* Cardmarket — bold Pokémon red */
body.theme-pokemon #modal-card-link {
    background: rgba(204, 0, 0, 0.22);
    border: 1px solid rgba(204, 0, 0, 0.65);
    color: #ff4040;
}
body.theme-pokemon #modal-card-link:hover { background: rgba(204, 0, 0, 0.32); }

/* PriceCharting — electric yellow */
body.theme-pokemon #modal-tcgplayer-link {
    background: rgba(255, 222, 0, 0.1);
    border-color: rgba(255, 222, 0, 0.5);
    color: #ffde00;
}
body.theme-pokemon #modal-tcgplayer-link:hover { background: rgba(255, 222, 0, 0.2); }

/* Details grid */
body.theme-pokemon .card-details-grid {
    background: rgba(25, 3, 3, 0.92);
    border: 1px solid rgba(204, 0, 0, 0.28);
    box-shadow: inset 0 0 12px rgba(204, 0, 0, 0.06);
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
body.theme-pokemon .detail-label { color: rgba(255, 120, 120, 0.5); }
body.theme-pokemon .detail-value {
    color: #ffde00;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}
body.theme-pokemon .detail-row { border-bottom-color: rgba(204, 0, 0, 0.15); }

/* Stat boxes */
body.theme-pokemon .stat-box {
    background: rgba(25, 3, 3, 0.92);
    border: 1px solid rgba(204, 0, 0, 0.28);
    box-shadow: inset 0 0 8px rgba(204, 0, 0, 0.05);
    padding: 0.7rem 0.3rem;
    min-width: 0;
}
body.theme-pokemon .stat-label { color: rgba(255, 120, 120, 0.5); font-size: 0.62rem; }
body.theme-pokemon .stat-value {
    color: #ffde00;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
}
body.theme-pokemon .price-stats-grid { margin-bottom: 0.5rem; gap: 0.4rem; }

/* Chart containers */
body.theme-pokemon .price-chart-container > div:first-child {
    background: rgba(25, 3, 3, 0.7) !important;
    border-color: rgba(204, 0, 0, 0.25) !important;
}
body.theme-pokemon .price-chart-container > div:last-child {
    background: rgba(25, 3, 3, 0.7) !important;
    border-color: rgba(255, 222, 0, 0.2) !important;
}
body.theme-pokemon .price-chart-container > div:first-child > div:first-child {
    color: #ff4040 !important;
}
body.theme-pokemon .price-chart-container > div:last-child > div:first-child {
    color: #ffde00 !important;
}

/* Red scrollbar */
body.theme-pokemon .modal-right {
    scrollbar-color: rgba(204, 0, 0, 0.4) transparent;
}
body.theme-pokemon .modal-right::-webkit-scrollbar { width: 4px; }
body.theme-pokemon .modal-right::-webkit-scrollbar-track { background: transparent; }
body.theme-pokemon .modal-right::-webkit-scrollbar-thumb {
    background: rgba(204, 0, 0, 0.4);
    border-radius: 2px;
}

/* ── Pokédex Header — hidden by default, shown for Pokémon theme ── */
.modal-pokedex-header { display: none; }

body.theme-pokemon .modal-pokedex-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #b31d1d 0%, #7a0000 60%, #4a0000 100%);
    padding: 18px 28px 22px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
body.theme-pokemon .modal-pokedex-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: #ffde00;
    border-radius: 50%;
    opacity: 0.06;
    pointer-events: none;
}
body.theme-pokemon .modal-header-eyebrow {
    font-size: 10px;
    color: rgba(255,222,0,0.65);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
body.theme-pokemon .modal-header-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #ffde00;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    margin: 0 0 8px;
    line-height: 1.2;
}
body.theme-pokemon .modal-header-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
body.theme-pokemon .header-meta-pill {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}
body.theme-pokemon .header-meta-pill.rarity {
    color: #ffde00;
    border-color: rgba(255,222,0,0.35);
    background: rgba(255,222,0,0.1);
}

body.theme-pokemon .modal-no-pricing-notice {
    font-size: 10px;
    color: rgba(255,200,80,0.85);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 8px;
}
body.theme-pokemon .modal-no-pricing-notice.hidden {
    display: none;
}

/* ── Hide elements replaced by the Pokédex header ── */
body.theme-pokemon .modal-right > h2 { display: none; }
body.theme-pokemon .card-details-grid { display: none; }

/* ── Modal padding reset — header takes over the top ── */
body.theme-pokemon .modal-content {
    padding: 0;
}
body.theme-pokemon .modal-body {
    padding: 16px 20px 20px;
    gap: 16px;
}
body.theme-pokemon .modal-right {
    padding-right: 4px;
}

/* ── Card image — dark inset frame ── */
body.theme-pokemon .modal-img-frame {
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(179,29,29,0.35);
    border-radius: 14px;
    padding: 10px;
    box-shadow: inset 0 0 20px rgba(179,29,29,0.08), 0 0 0 1px rgba(255,255,255,0.03);
}
body.theme-pokemon .modal-img-frame img {
    border-radius: 8px;
}

/* ── Stat boxes — left-border accent style ── */
body.theme-pokemon .stat-box {
    background: rgba(255,255,255,0.03);
    border: none;
    border-left: 3px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 6px;
    min-width: 0;
    box-shadow: none;
}
body.theme-pokemon .stat-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.62rem;
}
body.theme-pokemon .stat-value {
    color: rgba(255,255,255,0.85);
    font-family: inherit;
    font-size: 0.82rem;
}
/* Low Price — green */
body.theme-pokemon .price-stats-grid .stat-box:nth-child(1) { border-left-color: #50c878; }
body.theme-pokemon .price-stats-grid .stat-box:nth-child(1) .stat-value { color: #50c878; }
/* Price Trend — red */
body.theme-pokemon .price-stats-grid .stat-box:nth-child(2) { border-left-color: #ff4444; }
body.theme-pokemon .price-stats-grid .stat-box:nth-child(2) .stat-value { color: #ff6b6b; }
/* 1-Day Avg — yellow */
body.theme-pokemon .price-stats-grid .stat-box:nth-child(5) { border-left-color: #ffde00; }
body.theme-pokemon .price-stats-grid .stat-box:nth-child(5) .stat-value { color: #ffde00; }

/* ── Pokémon Modal: Pokéball, chart colour-match, button colour-match ── */

/* Pokéball — hidden on desktop, shown on mobile */
/* Pokéball — shown on desktop in modal header */
body.theme-pokemon .modal-pokeball {
    display: block;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, #CC0000 0%, #CC0000 46%, #1a1a1a 46.01%, #1a1a1a 54%, #f0f0f0 54.01%, #f0f0f0 100%);
    box-shadow: 0 0 16px rgba(204,0,0,0.45), 0 0 32px rgba(204,0,0,0.15), inset 0 1px 3px rgba(255,255,255,0.1);
    position: relative;
    margin-top: 2px;
}
body.theme-pokemon .modal-pokeball::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    background: #f0f0f0;
    border: 2.5px solid #1a1a1a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
body.theme-pokemon .modal-pokeball::before {
    content: '';
    position: absolute;
    top: 8px; left: 9px;
    width: 11px; height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: rotate(-20deg);
}

/* Header thumbnail — hidden on desktop */
.modal-header-thumb { display: none; }

/* Header text wrapper */
body.theme-pokemon .modal-pokedex-header-text { flex: 1; }

/* Chart containers — add glowing dot to labels */
body.theme-pokemon .price-chart-container > div:first-child {
    background: rgba(204,0,0,0.04) !important;
    border-radius: 12px;
}
body.theme-pokemon .price-chart-container > div:first-child > div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}
body.theme-pokemon .price-chart-container > div:first-child > div:first-child::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #CC0000;
    box-shadow: 0 0 6px rgba(204,0,0,0.5);
    flex-shrink: 0;
}
body.theme-pokemon .price-chart-container > div:last-child {
    background: rgba(255,222,0,0.03) !important;
    border-radius: 12px;
}
body.theme-pokemon .price-chart-container > div:last-child > div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}
body.theme-pokemon .price-chart-container > div:last-child > div:first-child::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ffde00;
    box-shadow: 0 0 6px rgba(255,222,0,0.4);
    flex-shrink: 0;
}

/* Buy buttons — exact colour-match */
body.theme-pokemon #modal-card-link {
    color: #CC0000;
    border-color: #CC0000;
    background: rgba(204,0,0,0.12);
}
body.theme-pokemon #modal-card-link:hover { background: rgba(204,0,0,0.2); }
body.theme-pokemon #modal-tcgplayer-link {
    color: #ffde00;
    border-color: #ffde00;
    background: rgba(255,222,0,0.08);
}
body.theme-pokemon #modal-tcgplayer-link:hover { background: rgba(255,222,0,0.15); }

/* ── Pokémon Site Redesign: search, screen bezel, card tiles ── */

/* DBS orb — hidden on Pokémon theme */
body.theme-pokemon .site-dbs-orb { display: none; }

/* Search panel — red-tinted */
body.theme-pokemon .cm-filters-container {
    background: rgba(10,2,2,0.95);
    border: 2px solid rgba(204,0,0,0.3);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(204,0,0,0.05);
}
body.theme-pokemon .cm-filter-col label {
    color: rgba(255,120,120,0.6);
    font-family: inherit;
}
body.theme-pokemon .cm-input,
body.theme-pokemon .cm-dropdown {
    font-family: inherit;
}

/* Screen bezel — white/grey frame around results */
body.theme-pokemon .results-section {
    background: #c8c8c8;
    border: 3px solid #aaa;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 2px 12px rgba(0,0,0,0.5);
    position: relative;
}
/* Red dot above screen */
body.theme-pokemon .results-section::before {
    content: '';
    position: absolute;
    top: -1px; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 5px;
    background: rgba(220,30,30,0.6);
    border-radius: 0 0 4px 4px;
}
/* Yellow accent dot bottom-right */
body.theme-pokemon .results-section::after {
    content: '';
    position: absolute;
    bottom: 8px; right: 12px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #f5c542;
    box-shadow: 0 0 5px rgba(245,197,66,0.4);
    pointer-events: none;
}
/* Dark screen inside bezel */
body.theme-pokemon .cm-results-inner {
    background: #0a0a12;
    border-radius: 6px;
    padding: 12px;
    min-height: 80px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

/* Card tiles — red left-border */
body.theme-pokemon .cm-card {
    background: rgba(18,8,8,0.95);
    border: 1px solid rgba(204,0,0,0.2);
    border-radius: 8px;
    border-left: 3px solid rgba(204,0,0,0.45);
    box-shadow: none;
}
body.theme-pokemon .cm-card:hover {
    border-left-color: #ffde00;
    box-shadow: 0 4px 20px rgba(255,222,0,0.2);
    transform: translateY(-3px);
}
body.theme-pokemon .cm-card-title {
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
}
body.theme-pokemon .cm-set-badge {
    display: inline-block;
    background: rgba(204,0,0,0.15);
    border: 1px solid rgba(204,0,0,0.3);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    color: rgba(255,100,100,0.85);
    font-weight: 700;
    font-family: inherit;
    margin-bottom: 3px;
}
body.theme-pokemon .cm-card-name {
    color: rgba(255,255,255,0.88);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
}
body.theme-pokemon .cm-card-price {
    color: rgba(255,255,255,0.4);
    font-family: inherit;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
}
body.theme-pokemon .cm-card-price strong {
    color: #ffde00;
    font-size: 0.88rem;
    font-family: inherit;
    text-shadow: 0 0 6px rgba(255,222,0,0.3);
}

/* ============================================================
   KAME HOUSE — Dragon Ball Super Theme
   ============================================================ */

/* Blurred background image — only the bg blurs, content stays sharp */
body.theme-dbs {
    --primary-color: #FFD700;
    --text-main: #f0e8d8;
    --text-muted: #c8b898;
    background: #1a0e28 !important;
    position: relative;
}

body.theme-dbs::before {
    content: '';
    position: fixed;
    inset: -30px;
    background: url('/assets/kame-house-bg-opt.jpg') center / cover no-repeat;
    filter: blur(10px);
    transform: scale(1.05) translateZ(0); /* force GPU layer for blur */
    z-index: 0;
}

/* Dark overlay to deepen contrast */
body.theme-dbs::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 22, 0.45);
    z-index: 0;
}

body.theme-dbs .app-container {
    padding: 0;
    position: relative;
    z-index: 1;
}

/* ── Header — bold sunset orange like Pokédex red ──────── */
body.theme-dbs header.glass-panel {
    background: #C44820;
    border: none;
    border-bottom: 5px solid #7A2800;
    box-shadow: 0 5px 0 #4A1400, 0 8px 24px rgba(0,0,0,0.55);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 18px 28px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

/* Dragon Balls in header background */
body.theme-dbs header.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/dragonballs.svg') right center / auto 180% no-repeat;
    opacity: 0.15;
    pointer-events: none;
}

/* Status dots matching Pokédex style */
body.theme-dbs header.glass-panel::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 98px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFD700;
    box-shadow: 18px 0 0 #FF8C42, 36px 0 0 #E8A0E0;
}

/* Dragon Ball golden sphere — hidden now that site-dbs-orb replaces it */
body.theme-dbs .logo h1::before { display: none; }
/* Make logo a row so orb sits beside the title */
body.theme-dbs .logo { display: flex; align-items: center; gap: 12px; }

body.theme-dbs .logo h1 {
    text-transform: none;
    font-style: normal;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

body.theme-dbs .logo h1 .logo-by {
    color: rgba(255,200,80,0.55) !important;
}

/* ── Hinge / screen divider ────────────────────────────── */
body.theme-dbs main {
    background: rgba(8, 4, 20, 0.72);
    border-top: 6px solid #555;
    padding: 20px 24px 28px;
    position: relative;
    box-shadow: inset 0 4px 24px rgba(0,0,0,0.8);
    min-height: 60vh;
}

body.theme-dbs main::before {
    content: '';
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    background: #888;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

body.theme-dbs .search-section {
    margin-bottom: 0;
    padding: 0;
}

/* ── Search panel — dark screen ────────────────────────── */
body.theme-dbs .cm-filters-container {
    background: rgba(15, 8, 35, 0.82);
    border: 2px solid rgba(255,210,0,0.25);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(255,140,0,0.05);
    backdrop-filter: blur(8px);
}

body.theme-dbs .cm-filter-col label {
    color: #FFD700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

body.theme-dbs .cm-input,
body.theme-dbs .cm-dropdown {
    background: rgba(5, 3, 15, 0.80);
    border: 1px solid rgba(255,200,50,0.3);
    color: #f0e0c0;
}

body.theme-dbs .cm-input::placeholder { color: rgba(200,160,80,0.5); }

body.theme-dbs .cm-input:focus,
body.theme-dbs .cm-dropdown:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.2);
}

body.theme-dbs .cm-dropdown option {
    background: #1a0e28;
    color: #f0e0c0;
}

/* Energy trail yellow SEARCH button */
body.theme-dbs .cm-btn-search {
    background: #FFD700;
    color: #1a0e00;
    border: none;
    border-radius: 5px;
    font-weight: 900;
    letter-spacing: 1px;
    box-shadow: 0 5px 0 #8B6000, inset 0 1px 0 rgba(255,255,255,0.25);
}

body.theme-dbs .cm-btn-search:hover {
    background: #FFE840;
    box-shadow: 0 3px 0 #8B6000;
    transform: translateY(2px);
}

/* ── Results panel — dark LCD ──────────────────────────── */
body.theme-dbs .results-section {
    background: rgba(10, 5, 25, 0.78);
    border: 2px solid rgba(255,210,0,0.3);
    border-radius: 8px;
    padding: 16px;
    box-shadow: inset 0 0 30px rgba(255,140,0,0.04), 0 0 20px rgba(255,180,0,0.08);
    backdrop-filter: blur(8px);
    margin-top: 16px;
}

body.theme-dbs .cm-hits {
    color: #FFD700;
    font-weight: 700;
}

body.theme-dbs .cm-view-btn {
    background: rgba(10,5,25,0.7);
    border: 1px solid rgba(255,210,0,0.35);
    color: #FFD700;
    font-weight: 700;
}

body.theme-dbs .cm-view-btn.active,
body.theme-dbs .cm-view-btn:hover {
    background: #FFD700;
    border-color: #FFD700;
    color: #1a0e00;
}

/* ── Cards — dark panels with golden glow ──────────────── */
body.theme-dbs .cm-card {
    background: rgba(18, 10, 40, 0.88);
    border: 1px solid rgba(255,200,50,0.25);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-dbs .cm-card:hover {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255,215,0,0.4), 0 8px 24px rgba(0,0,0,0.5);
    transform: translateY(-4px);
}

body.theme-dbs .cm-card-img-wrapper {
    background: rgba(5, 3, 15, 0.6);
    border-radius: 5px 5px 0 0;
}

body.theme-dbs .cm-card-title {
    color: #f0e0c0;
    font-weight: 700;
    font-size: 0.82rem;
}

body.theme-dbs .cm-card-price {
    color: #FFD700;
    font-weight: 700;
}

body.theme-dbs .cm-card-price strong {
    color: #FFE840;
    text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

/* ── Modal overrides ────────────────────────────────────── */
body.theme-dbs .card-details-grid {
    background: rgba(15, 8, 35, 0.95);
    border: 2px solid rgba(255,210,0,0.3);
    box-shadow: inset 0 0 12px rgba(255,150,0,0.08);
}

body.theme-dbs .detail-label { color: #c8a060; }
body.theme-dbs .detail-value { color: #FFD700; font-family: 'Courier New', monospace; }
body.theme-dbs .detail-row { border-bottom-color: rgba(255,200,50,0.15); }

body.theme-dbs .price-tag {
    background: #FFD700;
    color: #1a0e00;
    font-weight: 900;
}

/* ── DBS Modal deep-theme ───────────────────────────────── */

/* Narrower left column + tighter gap = more room for 5-stat grid */
body.theme-dbs .modal-body { gap: 1.5rem; }
body.theme-dbs .modal-left { flex: 0 0 240px; }
body.theme-dbs .modal-right { overflow-x: hidden; }
body.theme-dbs .modal-content {
    background: rgba(8, 4, 20, 0.96);
    border: 1px solid rgba(255, 200, 50, 0.22);
    box-shadow: 0 0 60px rgba(255, 150, 0, 0.08), 0 20px 60px rgba(0,0,0,0.8);
    backdrop-filter: blur(24px);
}

body.theme-dbs .modal-right h2 {
    color: #FFD700;
    text-shadow: 0 0 24px rgba(255, 200, 0, 0.35);
    margin-bottom: 0.8rem;
}

body.theme-dbs .card-details-grid {
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

body.theme-dbs .close-btn { color: rgba(255, 200, 50, 0.7); border-color: rgba(245, 166, 35, 0.15); }
body.theme-dbs .close-btn:hover { color: #FFD700; border-color: rgba(245, 166, 35, 0.4); box-shadow: 0 0 12px rgba(245, 166, 35, 0.15); }

/* Species row not relevant for DBS */
body.theme-dbs .detail-row-species { display: none; }

/* Gold scrollbar for DBS modal right column */
body.theme-dbs .modal-right {
    scrollbar-color: rgba(255,200,50,0.35) transparent;
}
body.theme-dbs .modal-right::-webkit-scrollbar { width: 4px; }
body.theme-dbs .modal-right::-webkit-scrollbar-track { background: transparent; }
body.theme-dbs .modal-right::-webkit-scrollbar-thumb {
    background: rgba(255,200,50,0.35);
    border-radius: 2px;
}

/* All 5 stats in one row */
body.theme-dbs .price-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Low-price note */
body.theme-dbs .modal-right > div[style*="11px"] {
    color: rgba(200, 160, 90, 0.55);
}

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

/* Touch / mobile polish */
button, a, .cm-card, .close-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── DBS Modal Redesign: Header, Orb, Stat Boxes, Charts, Buttons ── */

/* Header — hidden by default, shown for DBS theme */
.modal-dbs-header { display: none; }
body.theme-dbs #modal-card-title,
body.theme-pokemon #modal-card-title { display: none; }
body.theme-dbs .modal-title-row,
body.theme-pokemon .modal-title-row { justify-content: flex-end; }
body.theme-pokemon .modal-title-row { margin-bottom: 0.3rem; }

body.theme-dbs .modal-dbs-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #2a0800 0%, #1a0500 60%, #0f0200 100%);
    padding: 16px 24px 18px;
    border-bottom: 1px solid rgba(255,150,0,0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
body.theme-dbs .modal-dbs-header::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(255,200,0,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Dragon Ball orb */
body.theme-dbs .modal-dbs-orb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFE066 0%, #FF9900 45%, #FF4400 80%, #CC2200 100%);
    box-shadow: 0 0 20px rgba(255,150,0,0.5), 0 0 40px rgba(255,100,0,0.2), inset 0 -4px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 2px;
}
body.theme-dbs .modal-dbs-orb::before {
    content: '';
    position: absolute;
    top: 7px; left: 9px;
    width: 12px; height: 7px;
    background: rgba(255,255,255,0.35);
    border-radius: 50%;
    transform: rotate(-30deg);
}
body.theme-dbs .modal-dbs-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
body.theme-dbs .modal-dbs-star-row {
    display: flex;
    gap: 2px;
    justify-content: center;
}
body.theme-dbs .modal-dbs-star {
    font-size: 8px;
    color: rgba(160,10,10,0.9);
    line-height: 1;
}

/* Header text */
body.theme-dbs .modal-dbs-header-text { flex: 1; }
body.theme-dbs .modal-dbs-eyebrow {
    font-size: 10px;
    color: rgba(255,180,0,0.6);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 3px;
}
body.theme-dbs .modal-dbs-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 2px 10px rgba(255,150,0,0.4);
    line-height: 1.1;
    margin: 0 0 8px;
}
body.theme-dbs .modal-dbs-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
body.theme-dbs .dbs-meta-pill {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,150,0,0.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}
body.theme-dbs .dbs-meta-pill.rarity {
    color: #FFD700;
    border-color: rgba(255,200,0,0.4);
    background: rgba(255,200,0,0.08);
}

/* Hide elements promoted to header */
body.theme-dbs .modal-right > h2 { display: none; }
body.theme-dbs .card-details-grid { display: none; }

/* Modal layout reset — header takes over top */
body.theme-dbs .modal-content { padding: 0; }
body.theme-dbs .modal-body { padding: 20px; gap: 20px; }
body.theme-dbs .modal-right { padding-right: 4px; }

/* Image frame — override display:contents from earlier rule */
body.theme-dbs .modal-img-frame {
    display: block;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,150,0,0.3);
    border-radius: 12px;
    padding: 8px;
    box-shadow: inset 0 0 20px rgba(255,100,0,0.06);
}
body.theme-dbs .modal-img-frame img { border-radius: 6px; }

/* Stat boxes — gold tint + bottom-border accent */
body.theme-dbs .stat-box {
    background: rgba(255,215,0,0.04);
    border: 1px solid rgba(255,215,0,0.1);
    border-radius: 8px;
    padding: 8px 6px;
    border-bottom: 2px solid rgba(255,200,0,0.35);
    box-shadow: none;
}
body.theme-dbs .stat-label { color: rgba(255,255,255,0.4); font-size: 0.62rem; }
body.theme-dbs .stat-value { color: rgba(255,255,255,0.85); font-family: inherit; font-size: 0.82rem; }
body.theme-dbs .price-stats-grid .stat-box:nth-child(1) { border-bottom-color: #50c878; background: rgba(80,200,120,0.04); border-color: rgba(80,200,120,0.1); }
body.theme-dbs .price-stats-grid .stat-box:nth-child(1) .stat-value { color: #50c878; }
body.theme-dbs .price-stats-grid .stat-box:nth-child(2) { border-bottom-color: #F5A623; background: rgba(245,166,35,0.04); border-color: rgba(245,166,35,0.1); }
body.theme-dbs .price-stats-grid .stat-box:nth-child(2) .stat-value { color: #F5A623; }
body.theme-dbs .price-stats-grid .stat-box:nth-child(5) { border-bottom-color: #FFD700; background: rgba(255,215,0,0.05); border-color: rgba(255,215,0,0.12); }
body.theme-dbs .price-stats-grid .stat-box:nth-child(5) .stat-value { color: #FFD700; }

/* Chart containers — gold (CM) and orange (USD) */
body.theme-dbs .price-chart-container > div:first-child {
    background: rgba(255,215,0,0.04) !important;
    border-color: rgba(255,215,0,0.25) !important;
    border-radius: 12px;
}
body.theme-dbs .price-chart-container > div:first-child > div:first-child {
    color: #FFD700 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.theme-dbs .price-chart-container > div:first-child > div:first-child::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #FFD700;
    box-shadow: 0 0 6px rgba(255,215,0,0.5);
    flex-shrink: 0;
}
body.theme-dbs .price-chart-container > div:last-child {
    background: rgba(245,166,35,0.04) !important;
    border-color: rgba(245,166,35,0.25) !important;
    border-radius: 12px;
}
body.theme-dbs .price-chart-container > div:last-child > div:first-child {
    color: #F5A623 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.theme-dbs .price-chart-container > div:last-child > div:first-child::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #F5A623;
    box-shadow: 0 0 6px rgba(245,166,35,0.4);
    flex-shrink: 0;
}

/* Buy buttons — colour-matched text/border/background */
body.theme-dbs #modal-card-link {
    color: #FFD700;
    border-color: #FFD700;
    background: rgba(255,215,0,0.12);
}
body.theme-dbs #modal-card-link:hover { background: rgba(255,215,0,0.2); }
body.theme-dbs #modal-tcgplayer-link {
    color: #F5A623;
    border-color: #F5A623;
    background: rgba(245,166,35,0.12);
}
body.theme-dbs #modal-tcgplayer-link:hover { background: rgba(245,166,35,0.2); }
body.theme-dbs #modal-collectr-link {
    color: #64c878;
    border-color: #64c878;
    background: rgba(100,200,120,0.12);
}
body.theme-dbs #modal-collectr-link:hover { background: rgba(100,200,120,0.2); }

/* ── DBS Site Redesign: 3-star orb, search, card tiles ── */

/* DBS orb — hidden by default, shown on DBS theme */
.site-dbs-orb { display: none; }
body.theme-dbs .site-dbs-orb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFE066 0%, #FF9900 45%, #FF4400 80%, #CC2200 100%);
    box-shadow: 0 0 0 4px #1a0800, 0 0 20px rgba(255,150,0,0.5), 0 0 32px rgba(255,100,0,0.2);
    position: relative;
    flex-shrink: 0;
}
body.theme-dbs .site-dbs-orb::before {
    content: '';
    position: absolute;
    top: 9px; left: 11px;
    width: 13px; height: 7px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: rotate(-30deg);
}
body.theme-dbs .site-dbs-orb-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
body.theme-dbs .site-dbs-orb-star-row { display: flex; gap: 2px; }
body.theme-dbs .site-dbs-orb-star { font-size: 10px; color: rgba(160,10,10,0.9); line-height: 1; }

/* Search panel — gold-tinted */
body.theme-dbs .cm-filters-container {
    background: rgba(8,4,20,0.95);
    border: 1px solid rgba(255,150,0,0.25);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(255,100,0,0.03);
}
body.theme-dbs .cm-filter-col label { color: rgba(255,180,0,0.55); }
body.theme-dbs .cm-input,
body.theme-dbs .cm-dropdown {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,150,0,0.2);
    color: #fff;
    font-family: inherit;
}

/* Results section */
body.theme-dbs .results-section {
    background: rgba(8,4,20,0.95);
    border: 1px solid rgba(255,150,0,0.2);
    border-radius: 8px;
    padding: 12px;
    box-shadow: none;
}
body.theme-dbs .cm-results-inner {
    background: transparent;
    padding: 0;
}

/* Card tiles — gold bottom-border */
body.theme-dbs .cm-card {
    background: rgba(10,4,20,0.9);
    border: 1px solid rgba(255,215,0,0.12);
    border-radius: 8px;
    border-bottom: 2px solid rgba(255,200,0,0.25);
    box-shadow: none;
}
body.theme-dbs .cm-card:hover {
    border-bottom-color: #FFD700;
    box-shadow: 0 4px 20px rgba(255,200,0,0.12);
    transform: translateY(-3px);
}
body.theme-dbs .cm-card-title {
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    font-weight: normal;
    font-size: inherit;
    color: inherit;
    margin-bottom: 0;
}
body.theme-dbs .cm-set-badge {
    display: inline-block;
    background: rgba(255,200,0,0.08);
    border: 1px solid rgba(255,200,0,0.2);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    color: rgba(255,200,0,0.65);
    font-weight: 700;
    font-family: inherit;
    margin-bottom: 3px;
}
body.theme-dbs .cm-card-name {
    color: rgba(255,255,255,0.88);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
}
body.theme-dbs .cm-card-price {
    color: rgba(255,255,255,0.4);
    font-family: inherit;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
}
body.theme-dbs .cm-card-price strong {
    color: #FFD700;
    font-size: 0.88rem;
    font-family: inherit;
}

/* ==========================================================================
   Utility Classes (Glassmorphism)
   ========================================================================== */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin-bottom: 3rem;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo span {
    color: var(--primary-color);
}

/* "by MrBULU" — smaller attribution under the brand name */
.logo-by {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4) !important;
    line-height: 1;
    margin-top: 3px;
}
/* Logo text stack — MarketDex on top, by MrBULU below */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.game-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.3rem;
    border-radius: 30px;
}

.game-toggle button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.game-toggle button img {
    height: 35px !important; /* Force identical height */
    width: auto !important;
    max-width: 90%;
    object-fit: contain;
    filter: grayscale(1) opacity(0.7);
    transition: all 0.3s ease;
}

.game-toggle button.active img {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

.game-toggle button.active {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.4);
}

body.theme-pokemon .game-toggle button:not(.active) {
    color: rgba(255, 255, 255, 0.85);
}

body.theme-pokemon .game-toggle button.active {
    color: #000;
}

/* ==========================================================================
   Search Section
   ========================================================================== */
.search-section {
    text-align: center;
    margin-bottom: 4rem;
}

/* ==========================================================================
   Results Grid
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    contain: layout style; /* limit recalc scope to this container */
}

.price-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: rgba(102, 252, 241, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Loading state */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 3rem auto;
}

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

.no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 2.5rem 1rem;
}
.no-results-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}
.suggestion-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.suggestion-chip:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
body.theme-pokemon .suggestion-chip:hover { border-color: rgba(204,0,0,0.5); color: #ffde00; }
body.theme-dbs     .suggestion-chip:hover { border-color: rgba(255,200,0,0.4); color: #FFD700; }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Start at top for scrolling */
    padding: 20px; /* Space for scrolling */
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #111;
    padding: 2.5rem;
    /* Inherits background/border glass properties from .glass-panel */
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.95);
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.06);
}



.modal-body {
    display: flex;
    gap: 3rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-left {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-left img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
}

.buy-button {
    text-align: center;
    display: block;
    padding: 1rem;
    background: #58a6ff;
    color: #0d1117;
    text-decoration: none;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.buy-button:hover {
    background: #79c0ff;
    transform: translateY(-2px);
}

.modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.modal-right h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
    color: #e0e2e4;
    line-height: 1.2;
}

.card-details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
    background: rgba(13, 17, 23, 0.4);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.detail-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.5rem;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    color: #8b929a;
    font-size: 0.9rem;
}

.detail-value {
    color: #e0e2e4;
    font-weight: 600;
}

.price-stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-box {
    flex: 1 1 min-content;
    min-width: 90px;
    background: rgba(13, 17, 23, 0.4);
    padding: 1rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    color: #8b929a;
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #e0e2e4;
}

.chart-container {
    flex: 1;
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    min-height: 250px;
    position: relative;
}

/* Responsiveness */
/* ── Tablet (≤1100px): narrow modal columns ── */
@media (max-width: 1100px) {
    .modal-left { flex: 0 0 260px; }
    body.theme-dbs .modal-left { flex: 0 0 220px; }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
    /* Layout */
    .app-container { padding: 0.75rem; }

    /* Header */
    header.glass-panel {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.2rem 1rem;
        margin-bottom: 0;
    }
    .logo { display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .logo h1 { font-size: 1.3rem; display: flex; flex-direction: column; align-items: center; }
    .logo h1::before { margin-right: 0 !important; margin-bottom: 6px !important; }

    /* Game toggle */
    .game-toggle { width: 100%; max-width: 340px; }
    .game-toggle button { flex: 1; padding: 0.7rem 0.4rem; font-size: 0.82rem; }
    .game-toggle button img { height: 28px !important; width: auto !important; margin-right: 5px !important; }

    /* Search */
    .cm-filters-container { padding: 1rem; }
    .cm-filters-row { flex-direction: column; align-items: stretch; gap: 0.8rem; }
    .cm-filter-col { width: 100%; }
    /* Search bar — SEARCH full width, RESET + Filter split below */
    .cm-filter-submit {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .cm-filter-submit #search-button {
        grid-column: 1 / -1;
        width: 100%;
        height: 44px;
    }
    .cm-filter-submit #reset-button,
    .cm-filter-submit #filter-toggle-btn {
        width: 100%;
        height: 40px;
        justify-content: center;
    }

    /* Results */
    .cm-results-header { flex-direction: column; gap: 0.8rem; align-items: flex-start; }
    .cm-view-toggles { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .cm-view-btn { justify-content: center; }

    /* Cards grid — 2 columns minimum */
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }

    /* Modal — stacks vertically, whole box scrolls */
    .modal { 
        padding: 8px; 
        padding-top: max(8px, env(safe-area-inset-top)); 
        overflow-y: auto !important; 
        display: block !important; /* Allow natural flow for scrolling overlay */
        -webkit-overflow-scrolling: touch;
    }
    .modal-content {
        margin: 0 auto;
        padding: 1.2rem 0.9rem;
        padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
        border-radius: 10px;
        max-height: none !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        position: relative;
    }
    .modal-body { flex-direction: column; gap: 1rem; overflow: visible; min-height: auto; }
    .modal-left { flex: 0 0 auto; max-width: 180px; margin: 0 auto; }
    .modal-right { overflow-y: visible; overflow-x: hidden; padding-right: 0; min-height: auto; }
    .modal-right h2 { font-size: 1.2rem; text-align: center; }

    /* Close button — larger tap target, clear notch in PWA standalone mode */


    /* Price stats — 3 cols on mobile */
    .price-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
    body.theme-dbs .price-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-box { min-width: 0; padding: 0.5rem 0.2rem; }
    .stat-label { font-size: 0.58rem; letter-spacing: 0.3px; }
    .stat-value { font-size: 0.82rem; }

    /* Buttons */
    .buy-button { padding: 0.7rem; font-size: 12px; }

    /* Charts — compact on mobile */
    .price-chart-container { gap: 8px !important; margin-top: 8px !important; }
    .price-chart-container > div { padding: 8px 10px 6px !important; }
    .chart-canvas-wrapper { height: 130px !important; padding: 2px !important; margin-bottom: 0 !important; }
    .chart-meta { font-size: 7px !important; color: rgba(255,255,255,0.4) !important; margin-bottom: 2px !important; }

    /* Modal body — tighter spacing on mobile */
    .modal-right { padding: 10px !important; }
    body.theme-pokemon .modal-body,
    body.theme-dbs .modal-body { padding: 0 !important; gap: 0 !important; }
    .price-stats-grid { gap: 4px !important; margin-bottom: 8px !important; }
    .stat-box { padding: 6px 4px !important; }
    #modal-price-source { font-size: 9px !important; margin: 4px 0 8px !important; }
    #modal-tcg-stats { margin-top: 6px !important; padding: 8px 10px !important; }

    /* Equal height stat boxes */
    .price-stats-grid { align-items: stretch; }
    .stat-box { display: flex; flex-direction: column; justify-content: center; }

    /* ── Mobile Option A: thumbnail in header, hide left panel ── */

    /* Show thumbnails */
    .modal-header-thumb {
        display: block;
        flex-shrink: 0;
        width: 44px;
        height: 60px;
        border-radius: 6px;
        overflow: hidden;
    }
    .modal-header-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 5px;
        cursor: zoom-in;
        -webkit-tap-highlight-color: transparent;
    }
    body.theme-pokemon .modal-header-thumb {
        border: 1px solid rgba(179,29,29,0.5);
        background: rgba(0,0,0,0.5);
    }
    body.theme-dbs .modal-header-thumb {
        border: 1px solid rgba(255,150,0,0.25);
        background: rgba(0,0,0,0.4);
    }

    /* Show Pokéball on mobile */
    body.theme-pokemon .modal-pokeball {
        display: block;
        width: 32px;
        height: 32px;
        margin-top: 2px;
    }
    body.theme-pokemon .modal-pokeball::after {
        width: 9px; height: 9px;
        border-width: 2px;
    }
    body.theme-pokemon .modal-pokeball::before {
        top: 5px; left: 6px;
        width: 7px; height: 4px;
    }

    /* Pokémon header: switch to row layout on mobile */
    body.theme-pokemon .modal-pokedex-header {
        flex-direction: row;
        align-items: flex-start;
        padding: 10px 14px 12px;
        gap: 8px;
    }

    /* DBS orb: smaller on mobile */
    body.theme-dbs .modal-dbs-orb {
        width: 32px;
        height: 32px;
    }
    body.theme-dbs .modal-dbs-orb::before {
        top: 4px; left: 5px;
        width: 7px; height: 4px;
    }
    body.theme-dbs .modal-dbs-star { font-size: 7px; }
    body.theme-dbs .modal-dbs-header {
        padding: 10px 14px 12px;
        gap: 8px;
    }

    /* On mobile: hide the card image (in header thumbnail) but keep the buy buttons */
    body.theme-pokemon .modal-img-frame,
    body.theme-dbs .modal-img-frame {
        display: none;
    }
    /* modal-left: stacked column — marketplace row on top, action strip below */
    body.theme-pokemon .modal-left,
    body.theme-dbs .modal-left {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        background: rgba(0,0,0,0.15);
    }
    body.theme-pokemon .modal-left > *,
    body.theme-dbs .modal-left > * { display: none !important; }
    body.theme-pokemon .modal-left > .modal-marketplace-btns,
    body.theme-dbs .modal-left > .modal-marketplace-btns {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        flex: 0 0 auto !important;
        width: 100% !important;
    }
    /* Give / Get trade row — full-width 2-up on mobile */
    body.theme-pokemon .modal-left > .modal-trade-row,
    body.theme-dbs .modal-left > .modal-trade-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
    }
    body.theme-pokemon .modal-left > .modal-trade-row .modal-action-btn,
    body.theme-dbs .modal-left > .modal-trade-row .modal-action-btn {
        flex: 1 !important;
        justify-content: center !important;
        padding: 12px 8px !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
    }
    body.theme-pokemon .modal-left > .modal-action-strip,
    body.theme-dbs .modal-left > .modal-action-strip {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: flex-start !important;
        padding: 0 !important;
    }
    body.theme-pokemon .modal-left > .modal-action-strip .modal-action-btn,
    body.theme-dbs .modal-left > .modal-action-strip .modal-action-btn {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 10px 8px !important;
        font-size: 0.7rem !important;
    }
    /* Equal-width marketplace buttons, compact */
    body.theme-pokemon .modal-left .buy-button,
    body.theme-dbs .modal-left .buy-button {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin-top: 0 !important;
        padding: 10px 4px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        text-align: center;
        border-radius: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    /* Header titles: left-align on mobile */
    body.theme-pokemon .modal-header-title,
    body.theme-dbs .modal-dbs-title {
        font-size: 16px;
    }

    /* Tap targets: min 44px for view toggle buttons */
    .cm-view-btn {
        min-height: 44px;
        padding: 10px 12px;
    }
    /* Close button — larger tap target, clear notch in PWA standalone mode */
    .close-btn {
        top: max(0.8rem, env(safe-area-inset-top));
        right: 0.8rem;
        width: 38px;
        height: 38px;
        min-height: 38px;
        min-width: 38px;
    }
}



/* ── Small mobile (≤420px) ── */
@media (max-width: 420px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .game-toggle button img { height: 22px !important; }

    /* Disclaimer ticker — compact on mobile */
    .disclaimer-banner { height: 24px; font-size: 9.5px; }
    .disclaimer-icon { display: none; }
    .modal-left { max-width: 150px; }

    /* Pagination — compact layout to prevent horizontal overflow */
    .pagination {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 4px 6px;
    }
    .pagination-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .pagination-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        padding: 0 6px;
    }
    .pagination-info {
        font-size: 11px;
    }
}

/* ==========================================================================
   CM Dark Search Redesign
   ========================================================================== */
.cm-filters-container {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.cm-filters-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.cm-filter-col {
    display: flex;
    flex-direction: column;
}

.cm-filter-col label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #e0e2e4;
}

.cm-dropdown, .cm-input {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem; /* ≥16px prevents iOS auto-zoom on focus */
    outline: none;
    transition: border-color 0.2s;
}

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

.cm-dropdown:focus, .cm-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 252, 241, 0.1);
}

.cm-name-col {
    flex-grow: 1;
}

.cm-filter-checkboxes {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 10px;
}

.cm-filter-checkboxes label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e0e2e4;
    cursor: pointer;
}

.cm-btn-search {
    background-color: var(--primary-color);
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.cm-btn-search:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cm-btn-reset {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.cm-btn-reset:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.cm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cm-hits-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cm-hits {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e2e4;
}

/* Price dot legend */
.price-dot-legend {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.6;
    transition: opacity 150ms;
}
.price-dot-legend:hover { opacity: 1; }

.pdl-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pdl-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    margin-right: 5px;
    white-space: nowrap;
}

body.theme-pokemon .price-dot-legend { font-family: 'Courier New', monospace; }
body.theme-pokemon .pdl-label { color: rgba(78,168,222,0.75); }

/* Hide label text on very small screens, keep dots — but keep trend legend */
@media (max-width: 420px) {
    .pdl-label { display: none; }
    .pdl-label.trend-legend { display: inline !important; font-size: 10px; }
    .price-dot-legend { gap: 4px; }
    .pdl-dot { margin-right: 2px; }
}

.cm-view-toggles {
    display: flex;
    gap: 8px;
}

.cm-view-btn {
    background: #1e2025;
    border: 1px solid #30363d;
    color: #8b929a;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cm-view-btn.active, .cm-view-btn:hover {
    background: #30363d;
    color: #e0e2e4;
}

/* #5 — Skeleton loading animation */
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    background: #1e2025;
    pointer-events: none;
    cursor: default;
    border: 1px solid #30363d;
}
.skeleton-card:hover { transform: none; box-shadow: none; }

.skeleton-placeholder {
    aspect-ratio: 63 / 88;
    background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-info-placeholder {
    padding: 1rem;
    height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.skeleton-line {
    background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-title-line { height: 14px; width: 80%; margin-bottom: 12px; }
.skeleton-price-line { height: 12px; width: 40%; }

.cm-card {
    background: #1e2025;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    contain: layout style; /* isolate layout recalcs per card */
}

.cm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

/* Skip rendering off-screen cards until they scroll into view */
.cm-card:nth-child(n+5) {
    content-visibility: auto;
    contain-intrinsic-size: 220px 320px;
}
.cm-card-img-wrapper {
    padding: 16px;
    text-align: center;
    background: #131519;
    position: relative;
}
.cm-card-img-wrapper img {
    max-width: 100%;
    height: auto;
}
.cm-card-info {
    padding: 16px;
}
.cm-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e0e2e4;
}
.cm-card-price {
    font-size: 1.1rem;
    color: var(--primary-color);
}
.cm-card-price strong {
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(248, 91, 26, 0.3);
}

/* List View — grid container becomes single-column */
.cards-grid.list-view-enabled {
    grid-template-columns: 1fr;
    gap: 6px;
}

/* Offline banner */
.offline-banner {
    background: #b31d1d;
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 9999;
}
.offline-banner.hidden { display: none; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 4px 8px;
    gap: 12px;
    flex-wrap: wrap;
}
.pagination:empty { display: none; }
.pagination-top { margin-bottom: 8px; }
.pagination-bottom {
    margin-top: 16px;
    padding-bottom: 4px;
}

.pagination-info {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pagination-btn:hover:not(.disabled):not(.active) {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}
.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 700;
}
.pagination-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.pagination-ellipsis {
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    padding: 0 4px;
    user-select: none;
}

/* DBS theme */
body.theme-dbs .pagination-btn {
    background: rgba(255,200,50,0.06);
    border-color: rgba(255,200,50,0.15);
    color: rgba(255,220,100,0.7);
}
body.theme-dbs .pagination-btn:hover:not(.disabled):not(.active) {
    background: rgba(255,200,50,0.15);
    color: #FFD700;
    border-color: rgba(255,200,50,0.4);
}
body.theme-dbs .pagination-btn.active {
    background: #FFD700;
    border-color: #FFD700;
    color: #1a0e00;
}

/* Pokémon theme */
body.theme-pokemon .pagination-btn.active {
    background: #CC0000;
    border-color: #CC0000;
}

/* ==========================================================================
   Disclaimer Ticker
   ========================================================================== */
@keyframes disclaimer-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.disclaimer-banner {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 10.5px;
    color: rgba(255,255,255,0.45);
    transition: background 0.4s ease, border-color 0.4s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
    height: 28px;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}
.disclaimer-track {
    display: flex;
    white-space: nowrap;
    animation: disclaimer-scroll 28s linear infinite;
    will-change: transform;
}
.disclaimer-banner:hover .disclaimer-track {
    animation-play-state: paused;
}
.disclaimer-inner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 40px 0 0;
    flex-shrink: 0;
}
.disclaimer-icon {
    flex-shrink: 0;
    opacity: 0.5;
    transition: color 0.4s ease;
}
.disclaimer-close {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, #16181d 40%);
    border: none;
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 8px 0 20px;
    z-index: 2;
}
.disclaimer-close:hover { color: rgba(255,255,255,0.6); }

/* Pokémon theme */
body.theme-pokemon .disclaimer-banner {
    background: #150303;
    border-color: rgba(204,0,0,0.25);
}
body.theme-pokemon .disclaimer-close {
    background: linear-gradient(90deg, transparent 0%, #150303 40%);
}
body.theme-pokemon .disclaimer-icon { color: #d60000; }
body.theme-pokemon #disclaimer-text strong,
body.theme-pokemon #disclaimer-text-dup strong { color: rgba(255,230,0,0.9); }

/* DBS theme */
body.theme-dbs .disclaimer-banner {
    background: #0d0510;
    border-color: rgba(255,200,50,0.1);
}
body.theme-dbs .disclaimer-close {
    background: linear-gradient(90deg, transparent 0%, #0d0510 40%);
}
body.theme-dbs .disclaimer-icon { color: #F5A623; }
body.theme-dbs #disclaimer-text strong,
body.theme-dbs #disclaimer-text-dup strong { color: rgba(255,200,50,0.9); }

/* ==========================================================================
   Autocomplete Dropdown
   ========================================================================== */
/* ==========================================================================
   Rich Autocomplete Dropdown
   ========================================================================== */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    z-index: 500;
    overflow: hidden;
    display: none;
    max-height: 380px;
    overflow-y: auto;
}
.autocomplete-dropdown.visible { display: block; }

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.autocomplete-item strong { font-weight: 700; }

/* Thumbnail */
.ac-thumb {
    width: 32px;
    height: 44px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}

/* Info block (name + meta) */
.ac-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 1px;
}
.ac-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    line-height: 1.3;
}
.ac-meta {
    font-size: 10px;
    opacity: 0.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Price (right-aligned) */
.ac-price {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

/* ── Pokémon theme ── */
body.theme-pokemon .autocomplete-dropdown {
    background: #120202;
    border-color: rgba(204,0,0,0.5);
}
body.theme-pokemon .autocomplete-item:hover,
body.theme-pokemon .autocomplete-item.active {
    background: rgba(204,0,0,0.25);
    color: #ffde00;
}
body.theme-pokemon .autocomplete-item strong { color: #ffde00; }
body.theme-pokemon .ac-price { color: #ffe600; }

/* ── DBS theme ── */
body.theme-dbs .autocomplete-dropdown {
    background: #0d0510;
    border-color: rgba(255,200,50,0.25);
}
body.theme-dbs .autocomplete-item:hover,
body.theme-dbs .autocomplete-item.active {
    background: rgba(255,200,50,0.1);
    color: #FFD700;
}
body.theme-dbs .autocomplete-item strong { color: #FFD700; }
body.theme-dbs .ac-price { color: #F5A623; }

/* Mini Marketplace Links in Cards */
.mp-mini-link {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.2s;
    display: inline-block;
}
.mp-mini-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Volatility Badge */
.volatility-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: rgba(255, 68, 68, 0.3); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
    50% { border-color: rgba(255, 68, 68, 0.8); box-shadow: 0 0 8px 0 rgba(255, 68, 68, 0.2); }
    100% { border-color: rgba(255, 68, 68, 0.3); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 8px;
    height: 150px;
}

@media (max-width: 600px) {
    .chart-canvas-wrapper {
        height: 140px; /* Slightly shorter on mobile to save vertical space */
        padding: 4px;
    }

    .price-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .stat-box {
        padding: 6px !important;
    }

    .stat-value {
        font-size: 12px !important;
    }

    .stat-label {
        font-size: 8px !important;
    }
}

/* Keyboard focus indicator */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color, #b31d1d);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   No Results & Search Error States
   ========================================================================== */

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 10px;
}

.no-results-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.25);
    margin-bottom: 8px;
}
body.theme-pokemon .no-results-icon { color: rgba(78,168,222,0.4); border-color: rgba(78,168,222,0.15); }
body.theme-dbs .no-results-icon { color: rgba(245,166,35,0.4); border-color: rgba(245,166,35,0.12); }

.no-results-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin: 0;
}
body.theme-pokemon .no-results-title { font-family: 'Courier New', monospace; color: #7ec8f0; }

.no-results-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    margin: 0;
}

.no-results-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

/* Search error state */
.search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 10px;
}
.search-error.hidden { display: none; }

.search-error-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(244,63,94,0.08);
    border: 1px solid rgba(244,63,94,0.2);
    color: rgba(244,63,94,0.7);
    margin-bottom: 8px;
}

.search-error-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    margin: 0;
}
body.theme-pokemon .search-error-title { font-family: 'Courier New', monospace; }

.search-error-msg {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    margin: 0;
    max-width: 320px;
}

.search-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 9px 20px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}
.search-retry-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
body.theme-pokemon .search-retry-btn { font-family: 'Courier New', monospace; border-color: rgba(78,168,222,0.3); color: #7ec8f0; }
body.theme-pokemon .search-retry-btn:hover { border-color: #4ea8de; color: #a8dfff; }
body.theme-dbs .search-retry-btn { border-color: rgba(245,166,35,0.3); color: #ffd166; }
body.theme-dbs .search-retry-btn:hover { border-color: #F5A623; color: #fff; }

/* ==========================================================================
   Filter Panel
   ========================================================================== */

.filter-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 200ms ease,
                padding 280ms ease;
    padding: 0 12px;
}

.filter-panel.open {
    max-height: min(600px, 60vh);
    opacity: 1;
    padding: 0 12px 4px;
}

.filter-panel-inner {
    background: rgba(20, 24, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-y: auto;
}

body.theme-pokemon .filter-panel-inner {
    background: rgba(10, 12, 20, 0.97);
    border-color: rgba(78, 168, 222, 0.35);
    box-shadow: 0 0 24px rgba(78, 168, 222, 0.1);
}

body.theme-dbs .filter-panel-inner {
    background: rgba(15, 10, 5, 0.97);
    border-color: rgba(245, 166, 35, 0.2);
    box-shadow: 0 0 24px rgba(245, 166, 35, 0.06);
}

.filter-group {
    margin-bottom: 14px;
}
.filter-group:last-of-type { margin-bottom: 0; }

.filter-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 8px;
}

body.theme-pokemon .filter-group-label {
    color: rgba(78,168,222,0.8);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .filter-group-label {
    color: rgba(245,166,35,0.55);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.65);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    user-select: none;
}

.filter-chip:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    transform: translateY(-1px);
}

.filter-chip-sub {
    font-size: 0.68rem;
    opacity: 0.6;
}

.filter-chip.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

body.theme-pokemon .filter-chip.active {
    background: rgba(78,168,222,0.3);
    border-color: #4ea8de;
    color: #fff;
    box-shadow: 0 0 10px rgba(78,168,222,0.3);
    transform: translateY(-1px);
}

body.theme-dbs .filter-chip.active {
    background: rgba(245,166,35,0.2);
    border-color: #F5A623;
    color: #ffd680;
    box-shadow: 0 0 10px rgba(245,166,35,0.25);
    transform: translateY(-1px);
}

.filter-panel-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: flex-end;
}

.filter-clear-btn {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 150ms;
}
.filter-clear-btn:hover { color: rgba(255,255,255,0.75); }

.cm-btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    white-space: nowrap;
}

.cm-btn-filter:hover,
.cm-btn-filter.active {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

body.theme-pokemon .cm-btn-filter {
    background: #0d1117;
    border: 1px solid #3a5070;
    color: #7ec8f0;
    font-family: 'Courier New', monospace;
}
body.theme-pokemon .cm-btn-filter:hover,
body.theme-pokemon .cm-btn-filter.active {
    border-color: #4ea8de;
    color: #fff;
    box-shadow: 0 0 8px rgba(78,168,222,0.3);
}

body.theme-dbs .cm-btn-filter.active {
    border-color: #F5A623;
    color: #ffd680;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}
body.theme-pokemon .filter-badge { background: #4ea8de; color: #000; }
body.theme-dbs .filter-badge     { background: #F5A623; color: #000; }
.filter-badge.hidden { display: none; }

body.theme-dbs    .filter-group-pokemon-only { display: none; }
body.theme-pokemon .filter-group-dbs-only    { display: none; }

.active-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.active-filter-pills.hidden { display: none; }

.active-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 12px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 120ms ease;
    border: 1px solid transparent;
}

body.theme-pokemon .active-pill {
    background: rgba(78,168,222,0.25);
    border-color: #4ea8de;
    color: #fff;
}
body.theme-dbs .active-pill {
    background: rgba(245,166,35,0.15);
    border-color: rgba(245,166,35,0.4);
    color: #ffd680;
}

.active-pill:hover { opacity: 0.75; }
.active-pill-remove {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-left: 2px;
}

/* ==========================================================================
   Price Tier Dot
   ========================================================================== */

.cm-card {
    position: relative;
}

.price-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 2;
}

.price-dot-budget   { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.price-dot-standard { background: #60a5fa; box-shadow: 0 0 6px rgba(96,165,250,0.4); }
.price-dot-valuable { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.price-dot-premium  { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.6); }
.price-dot-elite    { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.7); }

/* ==========================================================================
   Recently Viewed
   ========================================================================== */

.recently-viewed-section {
    padding: 8px 0 12px;
}
.recently-viewed-section.hidden { display: none; }

.recently-viewed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.recently-viewed-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
body.theme-pokemon .recently-viewed-label {
    color: rgba(78,168,222,0.8);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .recently-viewed-label { color: rgba(245,166,35,0.5); }

.recently-viewed-clear {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 150ms;
}
.recently-viewed-clear:hover { color: rgba(255,255,255,0.65); }

.recently-viewed-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.recently-viewed-list::-webkit-scrollbar { display: none; }

.rv-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
    flex-shrink: 0;
    max-width: 200px;
}

.rv-chip:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.22);
    transform: translateY(-2px);
}

body.theme-pokemon .rv-chip:hover { border-color: rgba(78,168,222,0.4); }
body.theme-dbs .rv-chip:hover { border-color: rgba(245,166,35,0.35); }

.rv-chip-img {
    width: 28px;
    height: 38px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.rv-chip-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rv-chip-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.rv-chip-price {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    font-variant-numeric: tabular-nums;
}
body.theme-pokemon .rv-chip-price { color: #ffe600; font-family: 'Courier New', monospace; }
body.theme-dbs .rv-chip-price { color: rgba(245,166,35,0.6); }

.rv-price-delta {
    font-size: 0.62rem;
    font-weight: 600;
    margin-left: 3px;
}
.rv-price-delta.up   { color: #f43f5e; }
.rv-price-delta.down { color: #4ade80; }

/* ==========================================================================
   Copy Price + Share Buttons (Modal)
   ========================================================================== */

.modal-action-strip {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.modal-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.modal-action-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
    color: #fff;
    transform: translateY(-1px);
}

.modal-action-btn.copied {
    border-color: #4ade80;
    color: #4ade80;
    background: rgba(74,222,128,0.1);
}

/* ==========================================================================
   Mobile — bottom sheet for filter panel
   ========================================================================== */

@media (max-width: 600px) {
    .filter-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 320ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .filter-panel.open {
        max-height: 80vh;
        padding: 0;
    }

    .filter-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.02);
    }

    .filter-panel-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #fff;
    }

    .filter-close-btn {
        background: none;
        border: none;
        color: rgba(255,255,255,0.6);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 4px;
        line-height: 1;
    }

    .filter-panel-inner {
        border-radius: 0;
        max-height: calc(80vh - 120px);
        overflow-y: auto;
        padding: 16px 20px 24px;
        margin-bottom: 0;
    }

    .filter-panel-inner::before {
        display: none; /* Removed the handle since we have a header now */
    }

    .filter-panel-footer {
        display: flex;
        gap: 12px;
        padding: 16px 20px;
        border-top: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.03);
    }

    .filter-apply-btn {
        flex: 1.5;
        background: var(--primary-color);
        color: #000;
        border: none;
        border-radius: 8px;
        padding: 12px;
        font-weight: 700;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .filter-clear-btn {
        flex: 1;
        background: rgba(255,255,255,0.1);
        color: #fff;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 8px;
        padding: 12px;
        font-size: 0.9rem;
    }

    .filter-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        backdrop-filter: blur(2px);
    }
    .filter-backdrop.visible { display: block; }
}

/* Desktop styles for new header/footer */
@media (min-width: 601px) {
    .filter-panel-header, .filter-apply-btn { display: none; }
    .filter-panel-footer { padding: 12px 0 0; }
}

@media (min-width: 601px) {
    .filter-backdrop { display: none !important; }
}

/* ==========================================================================
   Watchlist — ★ button on grid cards
   ========================================================================== */

.watch-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 150ms ease;
    padding: 0;
}

.watch-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.75);
    transform: scale(1.1);
}

body.theme-pokemon .watch-btn.watched {
    background: rgba(255, 222, 0, 0.2);
    border-color: rgba(255, 222, 0, 0.6);
    color: #ffde00;
    box-shadow: 0 0 8px rgba(255, 222, 0, 0.3);
}

body.theme-dbs .watch-btn.watched {
    background: rgba(245, 166, 35, 0.2);
    border-color: rgba(245, 166, 35, 0.6);
    color: #F5A623;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

body.theme-pokemon .cm-card.is-watched {
    border-color: rgba(255, 222, 0, 0.45);
    box-shadow: 0 0 16px rgba(255, 222, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.theme-dbs .cm-card.is-watched {
    border-color: rgba(245, 166, 35, 0.4);
    box-shadow: 0 0 16px rgba(245, 166, 35, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Watchlist — header button
   ========================================================================== */

.btn-watchlist {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.btn-watchlist:hover,
.btn-watchlist.has-items {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

body.theme-pokemon .btn-watchlist {
    background: #0d1117;
    border-color: #3a5070;
    color: #7ec8f0;
    font-family: 'Courier New', monospace;
}
body.theme-pokemon .btn-watchlist:hover,
body.theme-pokemon .btn-watchlist.has-items {
    border-color: #ffde00;
    color: #ffde00;
    box-shadow: 0 0 8px rgba(255, 222, 0, 0.2);
}

body.theme-dbs .btn-watchlist.has-items {
    border-color: #F5A623;
    color: #ffd166;
}

.watchlist-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}
body.theme-pokemon .watchlist-badge { background: #ffde00; color: #000; }
body.theme-dbs .watchlist-badge     { background: #F5A623; color: #000; }
.watchlist-badge.hidden             { display: none; }

@media (max-width: 600px) {
    .btn-watchlist {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* ==========================================================================
   Watch button split dropdown
   ========================================================================== */
.watch-btn-group {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}
.watch-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 150ms;
}
.watch-dropdown-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.watch-btn-group .modal-watch-btn-title { border-radius: 6px 0 0 6px; }

.watch-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: rgba(20, 20, 25, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 4px;
    min-width: 160px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.watch-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms;
    text-align: left;
}
.watch-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
body.theme-pokemon .watch-dropdown-item:hover { background: rgba(255, 222, 0, 0.1); color: #ffde00; }
body.theme-dbs .watch-dropdown-item:hover { background: rgba(245, 166, 35, 0.1); color: #ffd166; }

/* ==========================================================================
   Watchlist — modal watch button state
   ========================================================================== */

.modal-watch-btn.watching {
    border-color: rgba(255, 222, 0, 0.5) !important;
    color: #ffde00 !important;
    background: rgba(255, 222, 0, 0.1) !important;
}

body.theme-dbs .modal-watch-btn.watching {
    border-color: rgba(245, 166, 35, 0.5) !important;
    color: #F5A623 !important;
    background: rgba(245, 166, 35, 0.1) !important;
}

/* ==========================================================================
   Watchlist — full-screen overlay
   ========================================================================== */

/* Pokémon: looks like the Pokédex LCD screen */
body.theme-pokemon .watchlist-overlay {
    background: #111;
    border: 3px solid #4ea8de;
    box-shadow: inset 0 0 40px rgba(0,30,80,0.5), 0 0 0 2px #222;
}

/* DBS: dark anime aesthetic */
body.theme-dbs .watchlist-overlay {
    background: #0f0a05;
    border: 1px solid rgba(245,166,35,0.25);
}

.watchlist-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wl-fade-in 200ms ease;
}

@keyframes wl-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.watchlist-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
    gap: 12px;
}

body.theme-pokemon .watchlist-overlay-header {
    background: #1a1a2e;
    border: 3px solid #555;
    border-radius: 6px;
    box-shadow: inset 0 0 24px rgba(0,20,80,0.3);
    margin: 8px 8px 0;
}

body.theme-dbs .watchlist-overlay-header {
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(245,166,35,0.2);
}

.watchlist-overlay-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.watchlist-overlay-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.watchlist-overlay-sub {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    opacity: 0.5;
}

body.theme-pokemon .watchlist-overlay-name { color: #7ec8f0; font-family: 'Courier New', monospace; }
body.theme-pokemon .watchlist-overlay-sub  { color: #7ec8f0; font-family: 'Courier New', monospace; }
body.theme-dbs .watchlist-overlay-name     { color: #ffd166; }
body.theme-dbs .watchlist-overlay-sub      { color: #ffd166; }

.watchlist-back-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 7px 14px;
    border-radius: 6px;
    transition: all 150ms;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
body.theme-pokemon .watchlist-back-btn {
    color: rgba(78,168,222,0.75);
    border-color: rgba(78,168,222,0.25);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .watchlist-back-btn {
    color: rgba(245,166,35,0.75);
    border-color: rgba(245,166,35,0.25);
}
.watchlist-back-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.watchlist-summary {
    padding: 7px 20px;
    font-size: 0.76rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    display: flex;
    gap: 16px;
    align-items: center;
}
body.theme-pokemon .watchlist-summary {
    color: rgba(78,168,222,0.6);
    font-family: 'Courier New', monospace;
    background: rgba(78,168,222,0.04);
    border-bottom-color: rgba(78,168,222,0.1);
    margin: 0 8px;
    border-radius: 0 0 4px 4px;
}
body.theme-dbs .watchlist-summary {
    color: rgba(245,166,35,0.55);
    background: rgba(245,166,35,0.03);
    border-bottom-color: rgba(245,166,35,0.1);
}

.watchlist-pnl-positive { color: #4ade80; font-weight: 700; }
.watchlist-pnl-negative { color: #f43f5e; font-weight: 700; }
.watchlist-pnl-neutral  { color: rgba(255, 255, 255, 0.4); }

/* --- Watchlist Alert Settings (Option 4) --- */
.watchlist-alert-settings {
    padding: 12px 20px;
    flex-shrink: 0;
}
body.theme-pokemon .watchlist-alert-settings {
    margin: 0 8px;
    background: rgba(78, 168, 222, 0.02);
}
body.theme-dbs .watchlist-alert-settings {
    background: rgba(245, 166, 35, 0.02);
}
.alert-settings-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
body.theme-pokemon .alert-settings-card {
    border-color: rgba(78, 168, 222, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
body.theme-dbs .alert-settings-card {
    border-color: rgba(245, 166, 35, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.alert-settings-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.alert-settings-icon {
    font-size: 1.5rem;
    animation: alert-bell-wiggle 4s infinite ease-in-out;
    transform-origin: top center;
    flex-shrink: 0;
}
@keyframes alert-bell-wiggle {
    0%, 100% { transform: rotate(0); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-15deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30% { transform: rotate(-5deg); }
    35%, 95% { transform: rotate(0); }
}
.alert-settings-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.alert-settings-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}
.alert-settings-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}
.alert-settings-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.alert-toggle-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body.theme-pokemon .alert-toggle-btn {
    background: #4ea8de;
    color: #000;
}
body.theme-pokemon .alert-toggle-btn:hover {
    background: #5fc1f5;
    box-shadow: 0 0 12px rgba(78, 168, 222, 0.4);
}
body.theme-dbs .alert-toggle-btn {
    background: #F5A623;
    color: #000;
}
body.theme-dbs .alert-toggle-btn:hover {
    background: #ffbe4d;
    box-shadow: 0 0 12px rgba(245, 166, 35, 0.4);
}

.alert-toggle-btn.enabled {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
}
.alert-toggle-btn.enabled:hover {
    background: rgba(74, 222, 128, 0.1) !important;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.2) !important;
}

.alert-toggle-btn.blocked {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f43f5e !important;
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
    cursor: not-allowed;
}

.alert-test-btn {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}
.alert-test-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.watchlist-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 20px;
}
body.theme-pokemon .watchlist-body { padding: 12px 14px 20px; }

/* ==========================================================================
   Watchlist — rows
   ========================================================================== */

.watchlist-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 120ms, border-color 120ms;
}
.watchlist-row:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }

.watchlist-row.dbs-row { border-color: rgba(245, 166, 35, 0.12); }
.watchlist-row.dbs-row:hover { border-color: rgba(245, 166, 35, 0.25); }

.watchlist-row-img {
    width: 40px;
    height: 54px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.watchlist-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.watchlist-row-name {
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.theme-pokemon .watchlist-row-name { color: #a0d8ef; font-family: 'Courier New', monospace; }
body.theme-dbs .watchlist-row-name     { color: rgba(255, 255, 255, 0.85); }
.watchlist-row.dbs-row .watchlist-row-name { color: rgba(245, 166, 35, 0.9); }

.watchlist-row-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watchlist-price-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.watchlist-saved-price { font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }
.watchlist-arrow       { font-size: 0.75rem; color: rgba(255, 255, 255, 0.2); }

.watchlist-current-price {
    font-size: 0.88rem;
    font-weight: 700;
}
body.theme-pokemon .watchlist-current-price { color: #ffde00; font-family: 'Courier New', monospace; }
body.theme-dbs .watchlist-current-price     { color: #F5A623; }

.watchlist-delta {
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}
.watchlist-delta.up      { color: #4ade80; }
.watchlist-delta.down    { color: #f43f5e; }
.watchlist-delta.loading { color: rgba(255, 255, 255, 0.25); font-weight: 400; font-size: 0.7rem; }

.watchlist-row-remove {
    display: flex;
    align-items: center;
    padding: 0 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 120ms;
    flex-shrink: 0;
    align-self: center;
}
.watchlist-row-remove:hover { color: #f43f5e; background: rgba(244, 63, 94, 0.1); }

/* ==========================================================================
   Watchlist — empty state
   ========================================================================== */

.watchlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 12px;
    text-align: center;
    padding: 40px;
}

.watchlist-empty-icon  { font-size: 3rem; opacity: 0.2; }
.watchlist-empty-title { font-size: 1rem; font-weight: 600; color: rgba(255, 255, 255, 0.45); }
.watchlist-empty-hint  { font-size: 0.8rem; color: rgba(255, 255, 255, 0.25); }
body.theme-pokemon .watchlist-empty-title,
body.theme-pokemon .watchlist-empty-hint { font-family: 'Courier New', monospace; }

/* ==========================================================================
   v1.2.1 fixes — watch button, overlay clarity, iPhone PWA close btn
   ========================================================================== */

/* --- Watch button in modal title row (always visible on all screens) --- */

.modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0.8rem;
}

.modal-title-row h2 {
    flex: 1;
    margin-bottom: 0 !important;
}

.modal-watch-btn-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 3px;
}

.modal-watch-btn-title:hover {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

body.theme-pokemon .modal-watch-btn-title { font-family: 'Courier New', monospace; }

.modal-watch-btn-title.watching {
    border-color: rgba(255,222,0,0.5) !important;
    color: #ffde00 !important;
    background: rgba(255,222,0,0.12) !important;
}

body.theme-dbs .modal-watch-btn-title.watching {
    border-color: rgba(245,166,35,0.5) !important;
    color: #F5A623 !important;
    background: rgba(245,166,35,0.12) !important;
}

/* --- Grid ★ watch button — larger and more visible --- */

.watch-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 9px !important;
    margin: -9px !important;
    box-sizing: content-box !important;
    font-size: 15px !important;
    color: rgba(255,255,255,0.55) !important;
    background: rgba(0,0,0,0.65) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.watch-btn:hover {
    color: rgba(255,255,255,0.9) !important;
    background: rgba(0,0,0,0.85) !important;
    border-color: rgba(255,255,255,0.45) !important;
}

/* Watched state — large, bright, unmissable */
body.theme-pokemon .watch-btn.watched {
    width: 28px !important;
    height: 28px !important;
    font-size: 17px !important;
    color: #ffde00 !important;
    background: rgba(255,222,0,0.28) !important;
    border-color: #ffde00 !important;
    box-shadow: 0 0 12px rgba(255,222,0,0.55) !important;
}

body.theme-dbs .watch-btn.watched {
    width: 28px !important;
    height: 28px !important;
    font-size: 17px !important;
    color: #F5A623 !important;
    background: rgba(245,166,35,0.28) !important;
    border-color: #F5A623 !important;
    box-shadow: 0 0 12px rgba(245,166,35,0.55) !important;
}

/* --- Watchlist overlay — unified design (same background regardless of game) --- */

.watchlist-overlay {
    background: #0c0e14 !important;
}

.watchlist-overlay-header {
    background: #111420 !important;
    border-bottom-color: rgba(255,255,255,0.1) !important;
}

/* Clearer title text */
.watchlist-overlay-title {
    font-size: 0.9rem !important;
    color: rgba(255,255,255,0.9) !important;
    font-family: inherit !important;
    letter-spacing: 1px !important;
}

/* Clearer back button */
.watchlist-back-btn {
    color: rgba(255,255,255,0.55) !important;
    font-family: inherit !important;
    font-size: 0.82rem !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    padding: 6px 12px !important;
}

.watchlist-back-btn:hover {
    color: #fff !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* Clearer summary bar */
.watchlist-summary {
    background: rgba(255,255,255,0.03) !important;
    border-bottom-color: rgba(255,255,255,0.07) !important;
    color: rgba(255,255,255,0.55) !important;
    font-family: inherit !important;
    font-size: 0.8rem !important;
}

/* Clearer row names and meta */
.watchlist-row-name {
    font-size: 0.92rem !important;
    color: rgba(255,255,255,0.9) !important;
    font-family: inherit !important;
}

.watchlist-row.dbs-row .watchlist-row-name {
    color: rgba(255,200,100,0.9) !important;
}

.watchlist-row-meta {
    font-size: 0.74rem !important;
    color: rgba(255,255,255,0.45) !important;
}

/* Clearer saved/current price flow */
.watchlist-saved-price {
    font-size: 0.78rem !important;
    color: rgba(255,255,255,0.5) !important;
}

.watchlist-current-price {
    font-size: 0.92rem !important;
    color: rgba(255,255,255,0.9) !important;
    font-family: inherit !important;
}

body.theme-pokemon .watchlist-current-price { color: #ffde00 !important; }
body.theme-dbs .watchlist-current-price     { color: #F5A623 !important; }

/* Clearer empty state */
.watchlist-empty-title {
    font-size: 1.05rem !important;
    color: rgba(255,255,255,0.6) !important;
    font-family: inherit !important;
}

.watchlist-empty-hint {
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.35) !important;
    font-family: inherit !important;
}

/* --- iPhone PWA — close button safe area fix --- */

@supports (padding-top: env(safe-area-inset-top)) {
    .modal-content .close-btn {
        top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    }
}

/* ==========================================================================
   Sprint 1 — Card micro-interactions
   ========================================================================== */

/* 1A. 3D tilt — desktop only via CSS vars set by JS mousemove */
@media (pointer: fine) {
    .cm-card {
        transform: perspective(600px) rotateY(var(--tilt-x, 0deg)) rotateX(var(--tilt-y, 0deg));
        will-change: transform;
    }
}

/* 1B. Lift + ripple — touch devices */
@media (pointer: coarse) {
    .cm-card:active {
        transform: scale(1.06) translateY(-5px) !important;
        transition: transform 80ms ease !important;
        z-index: 2;
    }
}

.card-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    opacity: 1;
    animation: card-ripple-anim 450ms ease-out forwards;
}

@keyframes card-ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* 1C. Holographic shimmer on premium cards (>€20) — one-shot on hover/active */
.cm-card--premium {
    overflow: hidden;
}

.cm-card--premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%);
    transform: translateX(-110%);
    pointer-events: none;
    z-index: 4;
    transition: none;
}

.cm-card--premium:hover::before,
.cm-card--premium:active::before {
    transform: translateX(110%);
    transition: transform 600ms ease;
}

/* 1E. Star save pulse */
@keyframes star-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.watch-btn.pulse {
    animation: star-pulse 350ms ease-out;
}

/* ==========================================================================
   Sprint 2 — Card tile typography: price as hero
   ========================================================================== */

.cm-card-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px 2px;
    flex-wrap: wrap;
}

.cm-card-number {
    font-size: 7.5px;
    opacity: 0.38;
    flex-shrink: 0;
}

body.theme-pokemon .cm-card-number { font-family: 'Courier New', monospace; }

.cm-card-info > .cm-card-name {
    padding: 0 8px 3px;
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.theme-pokemon .cm-card-info > .cm-card-name { color: #a0d8ef; font-family: 'Courier New', monospace; }
body.theme-dbs .cm-card-info > .cm-card-name     { color: rgba(255,255,255,0.85); }

.cm-card-price-strip {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 5px 8px 7px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    margin-top: 2px;
}

body.theme-pokemon .cm-card-price-strip {
    border-top-color: rgba(255,222,0,0.12);
    background: rgba(255,222,0,0.04);
}

body.theme-dbs .cm-card-price-strip {
    border-top-color: rgba(245,166,35,0.12);
    background: rgba(245,166,35,0.04);
}

.cm-card-price-strip .price-value {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

body.theme-pokemon .cm-card-price-strip .price-value { color: #ffe600; font-family: 'Courier New', monospace; }
body.theme-dbs .cm-card-price-strip .price-value     { color: #F5A623; }

.cm-price-source {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.3;
    align-self: flex-end;
}

.cm-card-price-strip .price-loading { font-size: 12px; opacity: 0.35; font-weight: 400; }

.cm-card-price-links {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

@media (max-width: 480px) {
    .cm-card-price-strip .price-value { font-size: 13px; }
    .cm-card-price-strip .cm-price-source { font-size: 6px; }
    .cm-card-price-strip .cm-price-trend { font-size: 8px; margin-left: 4px; }
}

/* ==========================================================================
   Sprint 4 — Home state
   ========================================================================== */

.home-state {
    padding: 4px 0 8px;
    transition: opacity 180ms ease;
}

.home-state.hidden       { display: none; }
.home-state.fading-out   { opacity: 0; pointer-events: none; }

.home-section {
    margin-bottom: 16px;
}
.home-section.hidden { display: none; }

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 7px;
}

.home-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

body.theme-pokemon .home-section-title { color: rgba(78,168,222,0.8); font-family: 'Courier New', monospace; }
body.theme-dbs .home-section-title     { color: rgba(245,166,35,0.6); }

.home-section-link {
    font-size: 0.7rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 150ms;
    padding: 0;
}

.home-section-link:hover { opacity: 1; }
body.theme-pokemon .home-section-link { color: rgba(78,168,222,0.7); font-family: 'Courier New', monospace; }
body.theme-dbs .home-section-link     { color: rgba(245,166,35,0.7); }

.home-trending-scroll,
.home-watchlist-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.home-trending-scroll::-webkit-scrollbar,
.home-watchlist-scroll::-webkit-scrollbar { display: none; }

.trending-chip {
    flex-shrink: 0;
    width: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms, box-shadow 150ms;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
    padding: 0;
}

.trending-chip:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.trending-chip:active { transform: scale(0.97); }

body.theme-pokemon .trending-chip:hover { border-color: rgba(78,168,222,0.4); box-shadow: 0 8px 20px rgba(78,168,222,0.15); }
body.theme-dbs .trending-chip:hover     { border-color: rgba(245,166,35,0.4); box-shadow: 0 8px 20px rgba(245,166,35,0.15); }

.trending-chip-img {
    height: 72px;
    background: rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
    position: relative;
}

.trending-chip-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 150ms ease;
}

.trending-chip:hover .trending-chip-img img {
    transform: scale(1.06);
}

.trending-chip-name {
    font-size: 8.5px;
    padding: 5px 6px 6px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

body.theme-pokemon .trending-chip-name { color: #a0d8ef; font-family: 'Courier New', monospace; }
body.theme-dbs .trending-chip-name     { color: rgba(255,255,255,0.8); }

.wl-preview-item {
    flex-shrink: 0;
    width: 105px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wl-preview-item:active { transform: scale(1.05); }

body.theme-pokemon .wl-preview-item { border-color: rgba(255,222,0,0.1); }
body.theme-dbs .wl-preview-item     { border-color: rgba(245,166,35,0.1); }

.wl-preview-img {
    height: 68px;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wl-preview-img img { width: 100%; height: 100%; object-fit: contain; }

.wl-preview-body { padding: 5px 7px 7px; }

.wl-preview-name {
    font-size: 8.5px;
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.theme-pokemon .wl-preview-name { color: #a0d8ef; font-family: 'Courier New', monospace; }
body.theme-dbs .wl-preview-name     { color: rgba(245,166,35,0.85); }

.wl-preview-price {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

body.theme-pokemon .wl-preview-price { color: #ffde00; font-family: 'Courier New', monospace; }
body.theme-dbs .wl-preview-price     { color: #F5A623; }

.wl-preview-delta {
    font-size: 8px;
    font-weight: 700;
    margin-left: 3px;
}
.wl-preview-delta.up      { color: #4ade80; }
.wl-preview-delta.down    { color: #f43f5e; }
.wl-preview-delta.loading { color: rgba(255,255,255,0.25); font-weight: 400; }

/* ==========================================================================
   Mobile watchlist fixes
   ========================================================================== */

@media (max-width: 600px) {

    /* Watchlist button — shown inline next to hamburger in header (styled in mobile hamburger section) */

    /* Grid ★ button — bigger touch target (min 44×44 per iOS guidelines) */
    .watch-btn {
        width: 34px !important;
        height: 34px !important;
        padding: 5px !important;
        margin: -5px !important;
        box-sizing: content-box !important;
        font-size: 18px !important;
        top: 3px !important;
        left: 3px !important;
        border-radius: 6px !important;
    }

    .watch-btn.watched {
        width: 34px !important;
        height: 34px !important;
        font-size: 18px !important;
    }

    /* Modal title row — stack Watch button below title on narrow screens */
    .modal-title-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .modal-watch-btn-title {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
    }

    /* Watchlist overlay — full screen, no border clipping on mobile */
    .watchlist-overlay {
        border: none !important;
        box-shadow: none !important;
    }

    /* Watchlist header — full width, no margin offset */
    body.theme-pokemon .watchlist-overlay-header {
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
    }
    body.theme-pokemon .watchlist-summary {
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Watchlist rows — more padding for easier tapping */
    .watchlist-row {
        padding: 12px 10px !important;
    }

    .watchlist-row-remove {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.3rem !important;
        justify-content: center !important;
    }

    /* Safe area: push overlay header below notch, body above home indicator */
    .watchlist-overlay-header {
        padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    }
    .watchlist-body {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ==========================================================================
   Marketplace buttons with brand logos
   ========================================================================== */
.modal-marketplace-btns {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    width: 100%;
    flex-wrap: nowrap;
}

.btn-mp {
    flex: 1;
    min-width: 0;
    margin-top: 0 !important;
    padding: 9px 6px !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 700;
    border-radius: 10px !important;
    border-width: 1px !important;
    border-style: solid !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
}

/* Cardmarket — premium blue brand */
.btn-cardmarket {
    background: linear-gradient(135deg, rgba(29, 93, 174, 0.25), rgba(29, 93, 174, 0.1)) !important;
    border-color: #1d5dae !important;
    color: #5a9fd4 !important;
    box-shadow: 0 4px 15px rgba(29, 93, 174, 0.1);
}
.btn-cardmarket:hover {
    background: linear-gradient(135deg, rgba(29, 93, 174, 0.35), rgba(29, 93, 174, 0.15)) !important;
    border-color: #3b82f6 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29, 93, 174, 0.2);
}
/* TCGPlayer — premium blue/gold brand */
.btn-tcgplayer {
    background: linear-gradient(135deg, rgba(0, 110, 182, 0.25), rgba(0, 110, 182, 0.1)) !important;
    border-color: #006eb6 !important;
    color: #6fbef2 !important;
    box-shadow: 0 4px 15px rgba(0, 110, 182, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.btn-tcgplayer:hover {
    background: linear-gradient(135deg, rgba(0, 110, 182, 0.35), rgba(0, 110, 182, 0.15)) !important;
    border-color: #3da9f5 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 110, 182, 0.25);
}
/* Collectr — premium green brand */
.btn-collectr {
    background: linear-gradient(135deg, rgba(100, 200, 120, 0.25), rgba(100, 200, 120, 0.1)) !important;
    border-color: #64c878 !important;
    color: #86efac !important;
    box-shadow: 0 4px 15px rgba(100, 200, 120, 0.1);
}
.btn-collectr:hover {
    background: linear-gradient(135deg, rgba(100, 200, 120, 0.35), rgba(100, 200, 120, 0.15)) !important;
    border-color: #4ade80 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(100, 200, 120, 0.2);
}
/* eBay — neutral border, multicolor wordmark */
.btn-ebay {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

/* eBay multicolor wordmark */
.ebay-wordmark { font-weight: 800; font-size: 13px; letter-spacing: -0.5px; white-space: nowrap; }
.ebay-wordmark span:nth-child(1) { color: #e53238; }
.ebay-wordmark span:nth-child(2) { color: #0064d2; }
.ebay-wordmark span:nth-child(3) { color: #f5af02; }
.ebay-wordmark span:nth-child(4) { color: #86b817; }

/* Favicon img — prevent stretching inside flex button */
.btn-mp img { flex-shrink: 0; width: 14px; height: 14px; object-fit: contain; border-radius: 2px; }

/* Mobile: tighter buttons, smaller text */
@media (max-width: 480px) {
    .btn-mp { padding: 8px 4px !important; font-size: 10px !important; gap: 3px; }
    .btn-mp img { width: 13px; height: 13px; }
    .ebay-wordmark { font-size: 11px; }
}

/* ==========================================================================
   Trend price on card tiles
   ========================================================================== */
.cm-price-trend {
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    opacity: 0.8;
}
.cm-price-trend.trend-up   { color: #4ade80; }
.cm-price-trend.trend-down { color: #f87171; }
.cm-price-trend.trend-flat { color: rgba(255,255,255,0.4); }

/* ==========================================================================
   List view — redesigned for readability and visual hierarchy
   ========================================================================== */
.list-view-enabled .cm-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    min-height: 76px;
    max-height: 84px;
    overflow: hidden;
    border-left: 3px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}
.list-view-enabled .cm-card:hover {
    background: rgba(255, 255, 255, 0.04);
}
/* Price tier left accent */
.list-view-enabled .cm-card .price-dot { display: none; }
.list-view-enabled .cm-card--premium {
    border-left-color: rgba(255, 215, 0, 0.35);
}

/* ── Thumbnail — larger, proper card aspect ratio ── */
.list-view-enabled .cm-card .cm-card-img-wrapper {
    width: 56px !important;
    height: 68px !important;
    min-width: 56px !important;
    min-height: unset !important;
    flex: 0 0 56px !important;
    padding: 3px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(0,0,0,0.25) !important;
}
.list-view-enabled .cm-card .cm-card-img-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

/* Hide grading badge in list — too small to be useful, info is in modal */
.list-view-enabled .cm-card .grading-badge { display: none; }

/* ── Info block — two zones: details (left, stacked) and price (right) ── */
.list-view-enabled .cm-card .cm-card-info {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 2px 16px;
    padding: 0 !important;
}

/* Name — spans full width on its own row */
.list-view-enabled .cm-card .cm-card-name {
    grid-column: 1;
    grid-row: 1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-width: 0;
}

/* Set badge + card number row — below name */
.list-view-enabled .cm-card .cm-card-header {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.list-view-enabled .cm-card .cm-set-badge {
    font-size: 9px;
    padding: 1px 5px;
}

.list-view-enabled .cm-card .cm-card-number {
    font-size: 9px;
    color: rgba(255,255,255,0.4);
}

/* ── Price block — right column, spans both rows ── */
.list-view-enabled .cm-card .cm-card-price-strip {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    min-width: 80px;
}

.list-view-enabled .cm-card .cm-card-price-strip > strong,
.list-view-enabled .cm-card .cm-card-price-strip > .price-value {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
}

.list-view-enabled .cm-card .cm-price-source {
    display: inline;
    font-size: 9px;
    opacity: 0.5;
    margin-left: 4px;
}

.list-view-enabled .cm-card .cm-price-trend {
    font-size: 10px;
    margin-left: 0;
    white-space: nowrap;
}

/* No-price marketplace links in list mode */
.list-view-enabled .cm-card .cm-card-price-links {
    flex-direction: column;
    gap: 2px;
}
.list-view-enabled .cm-card .cm-card-price-links .mp-mini-link {
    font-size: 10px;
    padding: 0;
}

/* ── Watch button — visible on hover, no overlap ── */
.list-view-enabled .cm-card .watch-btn {
    position: static;
    flex-shrink: 0;
    transform: none;
    font-size: 16px;
    padding: 4px;
    opacity: 0.3;
    transition: opacity 0.15s;
}
.list-view-enabled .cm-card:hover .watch-btn,
.list-view-enabled .cm-card .watch-btn.watched {
    opacity: 1;
}

/* Skeleton card in list mode */
.list-view-enabled .skeleton-card {
    min-height: 76px;
}

/* ==========================================================================
   Grading Section — Pokémon modal (stat-box grid style, high-value only)
   ========================================================================== */
.modal-grading-section {
    margin-top: 0;
    padding: 10px;
    background: rgba(255, 215, 0, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.grading-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FFD700;
    margin-bottom: 6px;
}

.grading-header-dot {
    width: 7px;
    height: 7px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 8px #FFD700;
    flex-shrink: 0;
}

.grading-source-note {
    font-size: 9px;
    color: rgba(255, 215, 0, 0.4);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    margin-left: auto;
}

.grading-ebay-link {
    font-size: 9px;
    font-weight: 600;
    color: #e93512;
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.grading-ebay-link:hover { opacity: 1; }

/* Reuse .price-stats-grid layout, override colours for grading */
.grading-stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

.grading-stat-box {
    background: rgba(255, 215, 0, 0.05) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    position: relative;
}

.grading-stat-gem {
    background: rgba(255, 215, 0, 0.10) !important;
    border-color: rgba(255, 215, 0, 0.3) !important;
}

.grading-val-gem {
    color: #FFD700 !important;
}

.grading-grade-note {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
    display: block;
}

/* ROI box colour set by JS */
.grading-roi-positive .stat-value { color: #4ade80 !important; }
.grading-roi-negative .stat-value { color: #f87171 !important; }

/* CGC compact pill row below the main grid */
.grading-cgc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.grading-cgc-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.grading-cgc-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.grading-cgc-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 10px;
}

.cgc-grade {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.cgc-price {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 480px) {
    .grading-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Auth button ─────────────────────────────────────────── */
.btn-auth {
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.btn-auth:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
.btn-auth.signed-in {
    width: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--accent, #CC0000);
    border-color: transparent;
}

/* ── Auth modal ──────────────────────────────────────────── */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10004;
    padding: 16px;
}
.auth-modal.hidden { display: none; }
.auth-modal-box {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}
.auth-modal-box h2 { margin: 0 0 8px; font-size: 1.2rem; color: #fff; }
.auth-modal-sub    { margin: 0 0 24px; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.auth-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.auth-modal-close:hover { color: #fff; }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
#auth-email {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}
#auth-email:focus { border-color: rgba(255,255,255,0.4); }
#auth-submit {
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--accent, #CC0000);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
#auth-submit:hover   { opacity: 0.85; }
#auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-success { color: #4ade80; font-size: 0.9rem; margin: 0; }

/* ── Grading availability badge ──────────────────────────── */
.grading-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: rgba(255,215,0,0.95);
    background: rgba(0,0,0,0.78);
    padding: 4px 6px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grading-badge:not(.hidden)::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 3px;
    vertical-align: -1px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd700' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9H4.5a2.5 2.5 0 0 1 0-5H6'/%3E%3Cpath d='M18 9h1.5a2.5 2.5 0 0 0 0-5H18'/%3E%3Cpath d='M4 22h16'/%3E%3Cpath d='M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22'/%3E%3Cpath d='M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22'/%3E%3Cpath d='M18 2H6v7a6 6 0 0 0 12 0V2Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Grading unavailable message ─────────────────────────── */
.grading-unavailable {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
    padding: 12px 0 4px;
    margin: 0;
    font-style: italic;
}

/* ── Grading status line ─────────────────────────────────── */
.grading-status {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    font-style: italic;
    margin: 8px 0 4px;
    padding: 0;
}
.grading-status.hidden { display: none; }

/* ── Trending chip loading skeleton ──────────────────────── */
.trending-chip-loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Price legend trend explanation ─────────────────────── */
.pdl-sep {
    display: inline-block;
    width: 1px;
    height: 10px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
    vertical-align: middle;
}
.trend-legend {
    color: rgba(255,255,255,0.88);
    cursor: help;
    font-weight: 600;
}
.trend-legend-up   { color: #4ade80; }
.trend-legend-down { color: #f87171; }

/* ── Mobile: event-ready tweaks ──────────────────────────── */
@media (max-width: 480px) {
    /* Grading badge — larger font so readable on small screens at an event */
    .grading-badge {
        font-size: 0.62rem;
        padding: 5px 6px;
    }

    /* Auth button — icon-only on mobile */
    .btn-auth:not(.signed-in) {
        font-size: 0;
        padding: 0;
        width: 36px;
        border-radius: 50%;
        justify-content: center;
    }

    /* Trend price — compact on mobile card tiles */
    .cm-card .cm-price-trend {
        font-size: 8px;
        margin-left: 3px;
    }

    /* CM Trend legend — hide separator only on mobile, keep trend label */
    .pdl-sep {
        display: none;
    }

    /* Tagline — hide on mobile */
    .logo-tagline { display: none; }
}

/* ── Header tagline ────────────────────────────────────────── */
.logo-tagline {
    font-size: 0.52rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    line-height: 1;
    margin-top: 3px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem 2rem;
    margin-top: 2rem;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.footer-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 10px;
}
.footer-link {
    color: rgba(255,255,255,0.28);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-link:hover { color: rgba(255,255,255,0.6); }
.footer-sep { color: rgba(255,255,255,0.1); }
.footer-version { font-weight: 600; letter-spacing: 0.5px; }
.footer-copy { color: rgba(255,255,255,0.18); }
.footer-disclosure {
    flex-basis: 100%;
    text-align: center;
    margin-top: 4px;
    font-size: 0.5rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.22);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.01em;
}
body.theme-pokemon .footer-disclosure,
body.theme-dbs .footer-disclosure {
    color: rgba(255, 255, 255, 0.28);
    font-family: inherit;
}
/* Hide decorative elements in fallback (no theme) */
.footer-dots, .footer-speaker, .footer-btn { display: none; }

/* ── Pokémon theme — bottom panel mirrors the red header ── */
body.theme-pokemon .app-footer {
    background: #C41214;
    border-top: 5px solid #8a0909;
    box-shadow: 0 -5px 0 #5a0505, 0 -8px 20px rgba(0,0,0,0.5);
    border-radius: 0;
    margin-top: 0;
    padding: 14px 28px 18px;
    position: relative;
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.92);
}
body.theme-pokemon main::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    background: #888;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    z-index: 2;
    pointer-events: none;
}
body.theme-pokemon .footer-link {
    color: rgba(255,255,255,0.95);
    font-family: 'Courier New', monospace;
}
body.theme-pokemon .footer-link:hover { color: #ffde00; }
body.theme-pokemon .footer-sep { color: rgba(255,255,255,0.2); }
body.theme-pokemon .footer-version {
    color: #ffde00;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}
body.theme-pokemon .footer-copy {
    color: rgba(255,255,255,0.65);
    font-family: 'Courier New', monospace;
}
body.theme-pokemon .footer-dots {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 16px 0 0 #f5c542, 32px 0 0 #2ecc40;
    margin-right: 36px;
    flex-shrink: 0;
}
body.theme-pokemon .footer-speaker {
    display: block;
    width: 38px;
    height: 18px;
    border-radius: 3px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0.5) 0px, rgba(0,0,0,0.5) 2px,
        rgba(255,255,255,0.06) 2px, rgba(255,255,255,0.06) 5px
    );
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}
body.theme-pokemon .footer-btn {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: 0 3px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}
body.theme-pokemon .footer-btn-a { background: radial-gradient(circle at 35% 30%, #cc3333, #8a0909); }
body.theme-pokemon .footer-btn-b { background: radial-gradient(circle at 35% 30%, #4ea8de, #005a9e); }

/* ── DBS theme — bottom panel mirrors the orange header ── */
body.theme-dbs .app-footer {
    background: #C44820;
    border-top: 5px solid #7A2800;
    box-shadow: 0 -5px 0 #4A1400, 0 -8px 24px rgba(0,0,0,0.55);
    border-radius: 0;
    margin-top: 0;
    padding: 14px 28px 18px;
    position: relative;
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.95);
}
body.theme-dbs main::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    background: #888;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    z-index: 2;
    pointer-events: none;
}
body.theme-dbs .footer-link {
    color: rgba(255,255,255,0.95);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .footer-link:hover { color: #FFD700; }
body.theme-dbs .footer-sep { color: rgba(255,255,255,0.2); }
body.theme-dbs .footer-version {
    color: #FFFFFF;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}
body.theme-dbs .footer-copy {
    color: rgba(255,255,255,0.8);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .footer-dots {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFD700;
    box-shadow: 16px 0 0 #FF8C42, 32px 0 0 #E8A0E0;
    margin-right: 36px;
    flex-shrink: 0;
}
body.theme-dbs .footer-speaker {
    display: block;
    width: 38px;
    height: 18px;
    border-radius: 3px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0.5) 0px, rgba(0,0,0,0.5) 2px,
        rgba(255,255,255,0.06) 2px, rgba(255,255,255,0.06) 5px
    );
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}
body.theme-dbs .footer-btn {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: 0 3px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}
body.theme-dbs .footer-btn-a { background: radial-gradient(circle at 35% 30%, #FFD700, #b8860b); }
body.theme-dbs .footer-btn-b { background: radial-gradient(circle at 35% 30%, #FF8C42, #7A2800); }

/* ── Fair Value + Condition Toggles ─────────────────────── */
.fair-value-section {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
}
.fair-value-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.fair-value-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.fv-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    font-style: normal;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
    position: relative;
    transition: background 0.2s, color 0.2s;
}
.fv-info-icon:hover, .fv-info-icon:focus {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.fv-info-icon:hover::after, .fv-info-icon:focus-visible::after,
.fv-info-icon.tooltip-open::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a20;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
    padding: 12px 16px;
    border-radius: 10px;
    white-space: normal;
    width: 280px;
    max-width: calc(100vw - 40px);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 2000;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    text-align: left;
}
@media (max-width: 600px) {
    .fv-info-icon:hover::after, .fv-info-icon:focus-visible::after,
    .fv-info-icon.tooltip-open::after {
        left: 0;
        right: auto;
        transform: none;
        width: min(260px, calc(100vw - 40px));
    }
}
.fair-value-price {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}
.fair-value-signal {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}
.fair-value-signal[data-signal="good"] { background: rgba(74,222,128,0.15); color: #4ade80; }
.fair-value-signal[data-signal="fair"] { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }
.fair-value-signal[data-signal="high"] { background: rgba(239,68,68,0.15); color: #f87171; }
.fair-value-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 6px;
}
.condition-toggles {
    display: flex;
    gap: 6px;
}
.condition-btn {
    flex: 1;
    padding: 5px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    min-height: 32px;
}
.condition-btn.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}
.condition-discount {
    display: block;
    font-size: 8px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    margin-top: 0;
}
.condition-btn.active .condition-discount { color: rgba(255,255,255,0.6); }

/* ── Vendor Screen ───────────────────────────────────────── */
.vendor-screen {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
}
.vendor-screen.hidden { display: none; }
.vendor-exit-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
}
.vendor-card-name {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    max-width: 80%;
    line-height: 1.2;
}
.vendor-card-img {
    width: min(260px, 60vw);
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.vendor-fair-value {
    font-size: clamp(48px, 14vw, 80px);
    font-weight: 900;
    color: #fff;
    letter-spacing: -2px;
    line-height: 1;
}
.vendor-condition-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ── Trade Calculator ────────────────────────────────────── */
.trade-calc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}
.trade-calc.hidden { display: none; }
.trade-calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.trade-calc-title { font-size: 14px; font-weight: 700; color: #fff; }
.trade-calc-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
}
.trade-calc-body {
    display: grid;
    grid-template-columns: 1fr 70px 1fr;
    gap: 12px;
    align-items: start;
}
.trade-side-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.trade-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 40px;
}
.trade-card-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
}
.trade-card-item-name { flex: 1; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-card-item-price { color: #fff; font-weight: 700; white-space: nowrap; }
.trade-remove-btn {
    background: none;
    border: none;
    color: rgba(255,59,48,0.7);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}
.trade-empty { font-size: 11px; color: rgba(255,255,255,0.25); font-style: italic; padding: 4px 0; }
.trade-side-total {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin-top: 8px;
    text-align: right;
}
.trade-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
}
.trade-delta {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}
.trade-delta--gain { color: #34C759; }
.trade-delta--loss { color: #FF3B30; }
.trade-calc-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.trade-add-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
#trade-add-a-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
#trade-add-a-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fff;
}
#trade-add-b-btn {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}
#trade-add-b-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    color: #fff;
}
.trade-reset-btn {
    padding: 9px 14px;
    background: rgba(255,59,48,0.12);
    border: 1px solid rgba(255,59,48,0.2);
    border-radius: 10px;
    color: #FF3B30;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Trade Calculator open button in header — matches .btn-auth pill style */
.nav-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    background: rgba(0,0,0,0.15);

    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }

/* ==========================================================================
   UI Polish — price labels, CM Trend colour, header buttons, Give/Get
   ========================================================================== */

/* Price tier legend labels — brighter */
.pdl-label {
    color: rgba(255,255,255,0.88);
}
body.theme-pokemon .pdl-label {
    color: rgba(78,168,222,0.92);
}
/* Price Trend legend text always white regardless of theme */
.pdl-label.trend-legend {
    color: rgba(255,255,255,0.88) !important;
}

/* Filter chips — brighter base text + sub-label */
.filter-chip {
    color: rgba(255,255,255,0.88);
}
.filter-chip-sub {
    opacity: 0.82;
}

/* Give / Get trade row — prominent 2-up strip below marketplace links */
.modal-trade-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}
.modal-trade-row .modal-action-btn {
    flex: 1;
    justify-content: center;
    padding: 11px 8px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

/* Give/Get modal action buttons — coloured for quick recognition */
.modal-action-btn--give {
    border-color: rgba(248,113,113,0.4);
    color: #fca5a5;
}
.modal-action-btn--give:hover {
    background: rgba(248,113,113,0.12);
    border-color: rgba(248,113,113,0.65);
    color: #fca5a5;
}
.modal-action-btn--get {
    border-color: rgba(74,222,128,0.4);
    color: #86efac;
}
.modal-action-btn--get:hover {
    background: rgba(74,222,128,0.12);
    border-color: rgba(74,222,128,0.65);
    color: #86efac;
}

/* Header watchlist button — pill shape matching Trade/Sign-in */
.btn-watchlist {
    border-radius: 18px;
    padding: 0 14px;
    height: 36px;
    font-size: 0.95rem;
}

/* Trade header button — subtle teal tint to stand out from Sign in */
.nav-btn {
    border-color: rgba(96,165,250,0.35);
    color: rgba(147,197,253,0.95);
}
.nav-btn:hover {
    border-color: rgba(96,165,250,0.65);
    color: #bfdbfe;
    background: rgba(96,165,250,0.12);
}

/* Sign in button — slightly warmer to stand out */
.btn-auth:not(.signed-in) {
    border-color: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
}

/* Trade button — icon-only on narrow screens */
@media (max-width: 480px) {
    .nav-btn {
        font-size: 0;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* SVG in the button serves as the icon on mobile — no ::before needed */
    .nav-btn .btn-icon { width: 18px; height: 18px; }
}

/* ── Trade button SVG icon alignment ── */
.nav-btn { display: inline-flex; align-items: center; gap: 5px; }
.nav-btn .btn-icon { flex-shrink: 0; }

/* ── Sign In button: login icon via ::before ── */
.btn-auth:not(.signed-in) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-auth:not(.signed-in)::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.9)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
@media (max-width: 480px) {
    .btn-auth:not(.signed-in)::before { width: 16px; height: 16px; }
}

/* ── Auth avatar dropdown ── */
.auth-wrapper { position: relative; }
.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: authDropdownIn 0.15s ease;
}
@keyframes authDropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-dropdown.hidden { display: none; }
.auth-dropdown-email {
    padding: 10px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    word-break: break-all;
    line-height: 1.4;
}
.auth-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}
.auth-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.auth-dropdown-item:hover { background: rgba(255, 255, 255, 0.08); }
.auth-dropdown-signout { color: #f87171; }
.auth-dropdown-signout:hover { background: rgba(248, 113, 113, 0.1); }
body.theme-pokemon .auth-dropdown { border-color: rgba(255, 222, 0, 0.15); }
body.theme-dbs .auth-dropdown    { border-color: rgba(245, 166, 35, 0.15); }

/* ── Trade Calc quick-add row ── */
.trade-quick-add {
    padding: 10px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 10px;
}
.trade-quick-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
}
.trade-quick-input:focus { border-color: rgba(147,197,253,0.5); background: rgba(147,197,253,0.06); }
.trade-quick-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.trade-quick-price {
    width: 80px;
    flex-shrink: 0;
    padding: 8px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    -moz-appearance: textfield;
}
.trade-quick-price:focus { border-color: rgba(147,197,253,0.5); background: rgba(147,197,253,0.06); }
.trade-quick-price::-webkit-outer-spin-button,
.trade-quick-price::-webkit-inner-spin-button { -webkit-appearance: none; }
.trade-quick-btn {
    flex: 1;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid;
    transition: background 0.15s;
}
.trade-quick-btn--give {
    background: rgba(239, 68, 68, 0.35);
    border-color: #ef4444;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.trade-quick-btn--give:hover { 
    background: rgba(239, 68, 68, 0.5);
    transform: scale(1.02);
}
.trade-quick-btn--get {
    background: rgba(34, 197, 94, 0.35);
    border-color: #22c55e;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.trade-quick-btn--get:hover { 
    background: rgba(34, 197, 94, 0.5);
    transform: scale(1.02);
}

/* Header right-side action group — keeps watchlist, trade, sign-in close together */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile: center the header-actions group — nowrap prevents badge from pushing buttons apart */
@media (max-width: 600px) {
    .header-actions {
        justify-content: center;
        width: 100%;
        flex-wrap: nowrap;
    }
    .header-actions > button {
        flex-shrink: 0;
    }
}

/* Trade Calculator — quantity indicator */
.trade-qty {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    margin-left: 2px;
}

/* Auth modal error message */
.auth-error {
    color: #f87171;
    font-size: 13px;
    margin: 6px 0 0;
    text-align: center;
    line-height: 1.4;
}
.auth-error.hidden { display: none; }

/* ── Watchlist icon button — Pokéball / Dragon Ball ── */
.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.watch-icon {
    display: block;
    flex-shrink: 0;
    vertical-align: middle;
}
.watch-pos {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Header watchlist icon — show themed icon per game */
.wl-icon-pokemon,
.wl-icon-dbs {
    display: none;
    align-items: center;
    justify-content: center;
}
body.theme-pokemon .wl-icon-pokemon { display: inline-flex; }
body.theme-dbs     .wl-icon-dbs     { display: inline-flex; }

/* ==========================================================================
   Scan-first modal redesign — v1.0.6
   ========================================================================== */

/* --- Fair Value Hero block ------------------------------------------------ */
.modal-fair-value-hero {
    margin-top: 10px;
    padding: 12px 14px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
}
body.theme-pokemon .modal-fair-value-hero {
    border-color: rgba(220, 38, 38, 0.3);
    background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(0,0,0,0));
    box-shadow: 0 4px 20px rgba(220,38,38,0.08);
}
body.theme-dbs .modal-fair-value-hero {
    border-color: rgba(245,166,35,0.3);
    background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(0,0,0,0));
    box-shadow: 0 4px 20px rgba(245,166,35,0.07);
}

/* Currency / volatility / toggle inline meta row inside hero */
.modal-fv-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 6px;
}
.modal-fv-currency-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Fair Value inside hero: remove its own margin/border (hero provides it) */
.modal-fair-value-hero .fair-value-section {
    margin-top: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Currency toggle — push to far right inside the fair-value-row */
.modal-currency-toggle {
    margin-left: auto;
    padding: 3px 10px;
    font-size: 11px;
    flex-shrink: 0;
}

/* Currency note + source meta inline row */
.fair-value-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.fair-value-meta-row .fair-value-meta {
    margin-bottom: 0;
}

/* Hide old standalone meta row (safety fallback) */
.modal-fv-meta-row { display: none; }
/* Hide old disclaimer (now in tooltip) */
.fv-disclaimer { display: none; }
.modal-fair-value-hero .fair-value-price {
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 800;
}

/* --- Data band (price stats then grading, stacked) ----------------------- */
.modal-data-band {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.modal-data-band-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Price chart container (moved from inline styles) -------------------- */
.price-chart-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.price-chart-container > div {
    flex: 1;
    padding: 8px 10px;
    border-radius: 12px;
    position: relative;
}
.price-chart-container > div:first-child {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}
.price-chart-container > div:last-child {
    background: rgba(245, 166, 35, 0.03);
    border: 1px solid rgba(245, 166, 35, 0.15);
}
.chart-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.chart-label-cm { color: rgba(255,255,255,0.7); }
.chart-label-tcg { color: rgba(245,166,35,0.75); }
.chart-meta {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 4px;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

/* --- Price source line (moved from inline style) ------------------------- */
#modal-price-source {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-top: 4px;
}

/* Card metadata — now at bottom; add separator breathing room */
.modal-right .card-details-grid {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* --- Mobile overrides ----------------------------------------------------- */
@media (max-width: 768px) {
    /* Show modal-trade-row on mobile (was hidden via modal-left > * rule) */
    body.theme-pokemon .modal-left > .modal-trade-row,
    body.theme-dbs .modal-left > .modal-trade-row {
        display: flex !important;
    }

    /* Fair Value hero: tighter on mobile */
    .modal-fair-value-hero {
        margin-top: 10px;
        padding: 12px 14px 10px;
    }
    .modal-fair-value-hero .fair-value-price {
        font-size: 26px;
    }

    /* Data band: tighter gap on mobile */
    .modal-data-band {
        gap: 10px;
        margin-top: 10px;
    }

    /* Card details collapse hint on mobile */
    .modal-right .card-details-grid {
        margin-top: 12px;
        padding-top: 10px;
    }
}

/* --- Modal section labels (Trade / Buy Online) ---------------------------- */
.modal-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-top: 10px;
    margin-bottom: -4px;
    user-select: none;
}
/* First label has less top margin (image sits above) */
.modal-left .modal-section-label:first-of-type {
    margin-top: 10px;
}
/* Show section labels on mobile alongside their sibling rows */
@media (max-width: 768px) {
    body.theme-pokemon .modal-left > .modal-section-label,
    body.theme-dbs .modal-left > .modal-section-label {
        display: block !important;
        margin-top: 12px !important;
        margin-bottom: -2px !important;
    }
}

/* --- Fair Value disclaimer ------------------------------------------------ */
.fv-disclaimer {
    margin: 6px 0 0;
    font-size: 10px;
    color: rgba(255,255,255,0.28);
    line-height: 1.4;
}

/* ── Cookie Consent Banner ───────────────────────────────── */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 14px 16px;
    z-index: 10002;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.consent-banner-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.consent-banner-inner > div:first-child {
    flex: 1;
    min-width: 200px;
}
.consent-banner-inner strong {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
}
.consent-banner-inner p {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin: 0;
    line-height: 1.4;
}
.consent-link {
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
}
.consent-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.consent-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 44px;
    min-width: 80px;
}
.consent-btn-decline {
    background: transparent;
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
}
.consent-btn-accept {
    background: var(--primary-color, #CC0000);
    color: #fff;
    border-color: transparent;
}

/* ── Consent banner — theme variants ───────────────────── */
body.theme-pokemon .consent-banner {
    background: #1a0202;
    border-top: 1px solid rgba(255, 222, 0, 0.25);
}
body.theme-pokemon .consent-banner-inner strong {
    color: #ffde00;
}
body.theme-pokemon .consent-link {
    color: rgba(255, 222, 0, 0.8);
}
body.theme-pokemon .consent-btn-decline {
    border-color: rgba(255, 222, 0, 0.3);
    color: rgba(255, 222, 0, 0.7);
}

body.theme-dbs .consent-banner {
    background: #0e0820;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}
body.theme-dbs .consent-banner-inner strong {
    color: #FFD700;
}
body.theme-dbs .consent-link {
    color: rgba(255, 215, 0, 0.8);
}
body.theme-dbs .consent-btn-decline {
    border-color: rgba(255, 215, 0, 0.3);
    color: rgba(255, 215, 0, 0.7);
}

/* ── SW Update Banner ───────────────────────────────────── */
#sw-update-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(15, 18, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(102, 252, 241, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    color: #e0e2e4;
    animation: swBannerSlide 0.3s ease-out;
}
@keyframes swBannerSlide {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
#sw-update-btn {
    padding: 6px 14px;
    background: var(--primary-color, #66fcf1);
    color: #0b0c10;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
#sw-update-btn:hover { opacity: 0.85; }
#sw-dismiss-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
#sw-dismiss-btn:hover { color: #fff; }
@media (max-width: 480px) {
    #sw-update-banner {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        transform: none;
        font-size: 12px;
    }
    @keyframes swBannerSlide {
        from { transform: translateY(20px); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Beckett BGS 10 Premium Banner ──────────────────────── */
.grading-bgs10-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95) 0%, rgba(30, 30, 30, 0.95) 50%, rgba(212, 175, 55, 0.18) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grading-bgs10-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.15), transparent);
    transform: skewX(-25deg);
    animation: bgs-shimmer 6s infinite ease-in-out;
}

@keyframes bgs-shimmer {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

.grading-bgs10-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.bgs10-badge-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bgs10-crown-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.bgs10-crown {
    font-size: 16px;
    filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.5));
}

.bgs10-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bgs10-title {
    font-size: 13px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.bgs10-subtitle {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2px;
}

.bgs10-price-container {
    display: flex;
    align-items: center;
}

.bgs10-price {
    font-size: 18px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    font-family: monospace;
}

/* ==========================================================================
   Sprint 5 — Premium Features: Dynamic Grading Lab & Arbitrage Opportunities
   ========================================================================== */

/* --- Home Tabbed layout for Trending & Arbitrage --- */
.home-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 8px;
}
.home-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 180ms ease;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.home-tab:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.03);
}
.home-tab.active {
    color: #fff;
}
body.theme-pokemon .home-tab.active {
    background: rgba(78, 168, 222, 0.15);
    border: 1px solid rgba(78, 168, 222, 0.4);
    font-family: 'Courier New', monospace;
}
body.theme-dbs .home-tab.active {
    background: rgba(245, 166, 35, 0.15);
    border: 1px solid rgba(245, 166, 35, 0.4);
}

.home-pane.hidden {
    display: none !important;
}

/* --- Homepage Arbitrage Cards & Showcase --- */
.home-arbitrage-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.home-arbitrage-scroll::-webkit-scrollbar {
    display: none;
}
.arbitrage-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    display: block;
    line-height: 1.4;
}

.arbitrage-chip {
    flex-shrink: 0;
    width: 140px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.arbitrage-chip:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
body.theme-pokemon .arbitrage-chip:hover { border-color: rgba(78, 168, 222, 0.5); }
body.theme-dbs .arbitrage-chip:hover { border-color: rgba(245, 166, 35, 0.5); }

.arbitrage-chip-img {
    height: 90px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.arbitrage-chip-img img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.arbitrage-chip-name {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.theme-pokemon .arbitrage-chip-name { font-family: 'Courier New', monospace; color: #a0d8ef; }

.arbitrage-chip-roi-bar-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.arbitrage-chip-roi-header {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
}
.arbitrage-chip-roi-val {
    font-weight: 800;
    color: #4ade80;
}
.arbitrage-chip-roi-bar-bg {
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.arbitrage-chip-roi-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 3px;
}
.arbitrage-chip-prices {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 5px;
    color: rgba(255,255,255,0.4);
}
.arbitrage-chip-prices .raw-val {
    color: rgba(255,255,255,0.7);
}
.arbitrage-chip-prices .graded-val {
    color: #fff;
    font-weight: 700;
}

/* --- Dynamic Grading Lab Widget --- */
.modal-grading-lab {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 12px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
body.theme-pokemon .modal-grading-lab {
    border-color: rgba(78, 168, 222, 0.15);
    background: rgba(78, 168, 222, 0.02);
}
body.theme-dbs .modal-grading-lab {
    border-color: rgba(245, 166, 35, 0.15);
    background: rgba(245, 166, 35, 0.02);
}

.lab-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 6px;
}
body.theme-pokemon .lab-title { font-family: 'Courier New', monospace; color: #a0d8ef; }
.lab-title-sub {
    display: block;
    font-size: 9px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255,255,255,0.45);
    margin-top: 3px;
}

.lab-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lab-row.flex-row {
    flex-direction: row;
    gap: 10px;
}
.lab-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
.lab-col.shrink {
    flex: 0 0 75px;
}

.lab-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
}
body.theme-pokemon .lab-label { font-family: 'Courier New', monospace; }

.lab-grade-buttons,
.lab-fee-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lab-grade-btn,
.fee-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.65);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 120ms ease;
}
.lab-grade-btn:hover,
.fee-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.lab-grade-btn.active,
.fee-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}
body.theme-pokemon .lab-grade-btn.active,
body.theme-pokemon .fee-btn.active {
    background: #ffe600;
    color: #000;
    border-color: #ffe600;
}
body.theme-dbs .lab-grade-btn.active,
body.theme-dbs .fee-btn.active {
    background: #F5A623;
    color: #000;
    border-color: #F5A623;
}

.lab-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 4px 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    outline: none;
    text-align: center;
    width: 100%;
}
.lab-input:focus {
    border-color: rgba(255,255,255,0.4);
}

.lab-results {
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lab-res-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: rgba(255,255,255,0.6);
}
.lab-res-row.border-top {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 5px;
    margin-top: 2px;
}
.lab-res-row.font-bold {
    font-weight: 700;
}
.lab-res-val {
    color: #fff;
    font-family: monospace;
    font-size: 11px;
}
.lab-res-val.highlight {
    color: #4e88de;
}
body.theme-pokemon .lab-res-val.highlight { color: #ffe600; }
body.theme-dbs .lab-res-val.highlight { color: #F5A623; }

.lab-res-val.text-profit {
    color: #4ade80;
    font-size: 12px;
    font-weight: 800;
}
.lab-res-val.text-loss {
    color: #f87171;
    font-size: 12px;
    font-weight: 800;
}

.lab-roi-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
}
.lab-roi-badge.roi-high {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}
.lab-roi-badge.roi-med {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #facc15;
}
.lab-roi-badge.roi-low {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.lab-breakeven-alert {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 9px;
    line-height: 1.3;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.lab-breakeven-alert.success {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
    color: #c6f6d5;
}
.lab-breakeven-alert.warning {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fed7d7;
}

.lab-gauge-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.lab-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 7.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
.lab-gauge-bar-wrapper {
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
#lab-gauge-raw {
    background: rgba(255,255,255,0.25);
    height: 100%;
}
#lab-gauge-cost {
    background: rgba(239, 68, 68, 0.4);
    height: 100%;
}
#lab-gauge-profit {
    background: rgba(34, 197, 94, 0.5);
    height: 100%;
}

/* ==========================================================================
   v1.4.0 — PREMIUM COLLECTOR EXPERIENCE STYLES
   ========================================================================== */

/* ── Holographic 3D Card Shimmer ────────────────────────────────────────── */
.holographic-container {
    perspective: 1200px;
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.holographic-card {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.holographic-card.gyro-active {
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.foil-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: color-dodge;
    transition: opacity 0.3s ease;
    will-change: opacity, background-position, filter;
    background: linear-gradient(115deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.03) 30%, 
        rgba(255, 0, 128, 0.18) 43%, 
        rgba(0, 255, 255, 0.18) 50%, 
        rgba(255, 255, 0, 0.15) 57%, 
        rgba(255, 255, 255, 0.03) 70%, 
        transparent 100%
    );
    background-size: 250% 250%;
    background-position: 50% 50%;
    filter: brightness(1.2) contrast(1.1);
}

/* Sparkle overlay for foil cards */
.foil-sparkle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: color-dodge;
    transition: opacity 0.3s ease;
    will-change: opacity, background-position;
    background-image: radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1px);
    background-size: 15px 15px;
    background-repeat: repeat;
}

.holographic-card:hover .foil-shimmer,
.holographic-card:hover .foil-sparkle,
.holographic-card.gyro-active .foil-shimmer,
.holographic-card.gyro-active .foil-sparkle {
    opacity: 0.45;
}

/* ── Slab Info Banner ─────────────────────────────────────────────────────── */
.slab-info-banner {
    position: relative;
    background: rgba(255, 222, 0, 0.06);
    border: 1px solid rgba(255, 222, 0, 0.18);
    border-radius: 10px;
    padding: 12px 32px 12px 14px;
    margin-bottom: 12px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}
.slab-info-title {
    font-weight: 800;
    font-size: 0.78rem;
    color: #ffe066;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.slab-info-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.slab-info-grid strong {
    color: #fff;
}
.slab-info-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}
.slab-info-close:hover { color: #fff; }
body.theme-dbs .slab-info-banner {
    background: rgba(245, 166, 35, 0.06);
    border-color: rgba(245, 166, 35, 0.18);
}
body.theme-dbs .slab-info-title { color: #ffd166; }

/* ── Digital Graded Slabs (PSA, Beckett BGS, CGC) ────────────────────────── */
.graded-slab-container {
    perspective: 1500px;
    margin: 10px auto;
    width: 100%;
    max-width: 360px;
}

.graded-slab {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border: 6px solid rgba(240, 240, 240, 0.18);
    border-radius: 16px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.65), 
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.25),
        inset 0 0 8px rgba(255, 255, 255, 0.1);
    position: relative;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Service-Specific Case Textures & Insert Frames */

/* PSA Slab: Frosted Clear Outer Shell with Frosted White Card Insert Frame */
.graded-slab.slab-psa {
    background: rgba(245, 245, 245, 0.55);
    border: 6px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.65), 
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.75),
        inset 0 0 12px rgba(255, 255, 255, 0.3);
}
.graded-slab.slab-psa .slab-inner-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}
.graded-slab.slab-psa .watchlist-card-title {
    color: #111111 !important;
}
.graded-slab.slab-psa .watchlist-price-flow {
    background: rgba(0, 0, 0, 0.06) !important;
}
.graded-slab.slab-psa .watchlist-saved-price {
    color: #444444 !important;
}
.graded-slab.slab-psa .watchlist-current-price {
    color: #d00000 !important;
}
.graded-slab.slab-psa .watchlist-graded-prices {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}
.graded-slab.slab-psa .watchlist-graded-prices span {
    color: #333333 !important;
}

/* Beckett (BGS) Slab: Extra-Thick Acrylic Shell with Sleek Black Insert Frame */
.graded-slab.slab-bgs {
    background: rgba(10, 10, 10, 0.88);
    border: 6.5px solid rgba(240, 240, 240, 0.22);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.75), 
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.15),
        inset 0 0 10px rgba(0, 0, 0, 0.9);
}

/* CGC Slab: Clear Acrylic Shell with Solid Black Plastic Insert Frame */
.graded-slab.slab-cgc {
    background: rgba(18, 18, 18, 0.85);
    border: 6px solid rgba(240, 240, 240, 0.18);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.65), 
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Dynamic protective slab glare overlay */
.slab-glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 7px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.15;
    mix-blend-mode: overlay;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.5) 0%, 
        rgba(255, 255, 255, 0) 45%, 
        rgba(255, 255, 255, 0) 55%, 
        rgba(255, 255, 255, 0.3) 100%
    );
    transition: opacity 0.3s ease;
}

.graded-slab:hover .slab-glare {
    opacity: 0.35;
}

/* Slab Header Base */
.slab-header {
    border-radius: 6px;
    padding: 6px 10px;
    box-sizing: border-box;
    font-size: 9px;
    color: #fff;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15);
}

/* PSA Header - Crimson */
.slab-header-psa {
    background: linear-gradient(180deg, #d31e36 0%, #aa0d22 100%);
    border: 1.5px solid #a30e22;
    border-bottom: 3px solid #7c0716;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}
.slab-header-psa .slab-title {
    font-size: 8px;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: space-between;
}
.slab-header-psa .slab-grade-val {
    font-size: 15px;
    font-weight: 900;
    color: #ffe600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* CGC Header - Sky Blue */
.slab-header-cgc {
    background: linear-gradient(180deg, #1fa8df 0%, #0c75a4 100%);
    border: 1.5px solid #1480b0;
    border-bottom: 3px solid #084d6c;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}
.slab-header-cgc .slab-title {
    font-weight: 800;
    letter-spacing: 0.2px;
}
.slab-header-cgc .slab-meta {
    font-size: 7.5px;
    opacity: 0.85;
}
.slab-header-cgc .slab-grade-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.slab-header-cgc .slab-grade-val {
    font-size: 13px;
    font-weight: 800;
    background: #fff;
    color: #0c75a4;
    padding: 1px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* BGS Header - Textured Charcoal + Gold Label */
.slab-header-bgs {
    background: linear-gradient(180deg, #333333 0%, #1a1a1a 100%);
    border: 1.5px solid #444;
    border-bottom: 3px solid #000;
    padding: 0;
    overflow: hidden;
    display: block;
    position: relative;
}

.bgs-gold-banner {
    background: linear-gradient(90deg, #b8860b 0%, #e6ca65 30%, #ffd700 50%, #e6ca65 70%, #b8860b 100%);
    color: #000;
    font-family: 'Outfit', sans-serif;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    padding: 2px 4px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0,0,0,0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    animation: goldShimmer 3s infinite linear;
    background-size: 200% auto;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.bgs-subgrades {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.1);
    padding: 3px;
    box-sizing: border-box;
}
.bgs-sub-val {
    font-size: 6.5px;
    font-family: monospace;
    text-align: center;
    color: #ffde59;
}

/* Barcode */
.slab-barcode-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 2px;
    border-radius: 2px;
    margin-top: 1px;
}
.slab-barcode {
    height: 10px;
    width: 85%;
    background: repeating-linear-gradient(90deg, 
        #000, 
        #000 1px, 
        #fff 1px, 
        #fff 3px, 
        #000 3px, 
        #000 4px, 
        #fff 4px, 
        #fff 6px
    );
    opacity: 0.85;
}
.slab-serial {
    font-family: monospace;
    font-size: 6px;
    color: #333;
    margin-top: 1px;
}

/* Graded Card Body wrapper */
.slab-inner-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 6px;
    position: relative;
    box-sizing: border-box;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), 0 1px 1px rgba(255, 255, 255, 0.08);
}

.slab-inner-card img {
    width: 100%;
    display: block;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.5);
    aspect-ratio: 2.5 / 3.5;
    object-fit: cover;
}

/* ── Tac-tile 9-Pocket Binder View ───────────────────────────────────────── */
.binder-leather-backdrop {
    background: 
        radial-gradient(circle at 50% 50%, #201f1c 0%, #0d0c0a 100%),
        repeating-radial-gradient(circle, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 4px, transparent 4px, transparent 8px);
    background-blend-mode: overlay;
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 
        inset 0 0 50px rgba(0,0,0,0.9),
        0 15px 35px rgba(0,0,0,0.7);
    border: 2px solid rgba(255, 255, 255, 0.03);
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

/* Realistic 3-Ring Binder Metal Mechanism (Desktop Only) */
.binder-leather-backdrop::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 8px;
    background: linear-gradient(90deg, #111 0%, #444 30%, #888 50%, #444 80%, #111 100%);
    box-shadow: 4px 0 10px rgba(0,0,0,0.7);
    z-index: 10;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .binder-leather-backdrop::before {
        display: none;
    }
}

.binder-sheet-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding-left: 20px; /* offset for ring mechanism */
}

/* Pocket Sleeved Acrylic Frame */
.pocket-cell {
    position: relative;
    aspect-ratio: 2.5 / 3.5;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.4);
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.25s ease-in-out;
}

.pocket-cell:hover {
    transform: scale(1.02);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.15);
}

.acrylic-sleeve {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 9px;
    pointer-events: none;
    z-index: 8;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0) 35%, 
        rgba(255, 255, 255, 0) 65%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.03);
}

.pocket-cell-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255,255,255,0.15);
    font-size: 11px;
    padding: 10px;
    box-sizing: border-box;
}

.pocket-cell-empty-icon {
    font-size: 26px;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* Premium Liquid Glass Price Badge */
.liquid-glass-badge {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateZ(10px);
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 9.5px;
    font-weight: 700;
    color: #fff;
    z-index: 12;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    white-space: nowrap;
    text-align: center;
    transition: background 0.2s, border-color 0.2s;
}

body.theme-pokemon .liquid-glass-badge { border-color: rgba(255, 222, 0, 0.35); }
body.theme-dbs .liquid-glass-badge { border-color: rgba(245, 166, 35, 0.35); }

/* Binder Pagination Slider */
.binder-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    position: relative;
    z-index: 5;
}

.binder-page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.binder-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.binder-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.binder-page-indicator {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
}

/* ── Watchlist View Toggle Segment ─────────────────────────────────────── */
.wl-view-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 3px;
    align-self: center;
    margin: 8px 0;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.wl-view-btn { white-space: nowrap; flex-shrink: 0; }

.wl-view-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wl-view-btn:hover {
    color: #fff;
}

.wl-view-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.theme-pokemon .wl-view-btn.active {
    background: #ffde00;
    color: #000;
}
body.theme-dbs .wl-view-btn.active {
    background: #F5A623;
    color: #000;
}

/* ── Responsive Grid Adaptations ────────────────────────────────────────── */
@media (max-width: 900px) {
    .binder-sheet-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .binder-sheet-container {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 250px;
        padding-left: 0;
    }
}

/* Watchlist Set Filter Styling */
.watchlist-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
}

.wl-filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wl-set-select {
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.wl-set-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(30, 30, 30, 0.85);
}

.wl-set-select:focus {
    border-color: #ffde00;
    box-shadow: 0 0 8px rgba(255, 222, 0, 0.3);
}

body.theme-dbs .wl-set-select:focus {
    border-color: #F5A623;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

/* ══════════════════════════════════════════════════════════
   MARKET MOVERS
══════════════════════════════════════════════════════════ */

.movers-subtitle {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-left: 8px;
}

.movers-loading, .movers-none {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 20px;
}

.movers-empty {
    text-align: center;
    padding: 32px 20px;
}
.movers-empty-icon { font-size: 2rem; margin-bottom: 8px; }
.movers-empty-title { font-size: 0.95rem; font-weight: 700; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.movers-empty-hint  { font-size: 0.78rem; color: rgba(255,255,255,0.4); max-width: 280px; margin: 0 auto; }

.movers-date-note {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    text-align: right;
    padding: 2px 4px 8px;
}

.movers-section { margin-bottom: 16px; }
.movers-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding: 0 2px;
}
.mover-up-label   { color: #4ade80; }
.mover-down-label { color: #f87171; }

.movers-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mover-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mover-chip:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }

.mover-chip-img {
    width: 38px;
    height: 53px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
}
.mover-chip-img-placeholder {
    width: 38px;
    height: 53px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.mover-chip-info { flex: 1; min-width: 0; }
.mover-chip-name {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.9);
}
.mover-chip-set {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.mover-chip-prices {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
}
.mover-chip-old   { color: rgba(255,255,255,0.4); text-decoration: line-through; }
.mover-chip-arrow { color: rgba(255,255,255,0.25); }
.mover-chip-new   { color: rgba(255,255,255,0.8); font-weight: 600; }

.mover-chip-delta {
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 20px;
}
.mover-chip-delta.mover-up   { background: rgba(74,222,128,0.12); color: #4ade80; }
.mover-chip-delta.mover-down { background: rgba(248,113,113,0.12); color: #f87171; }

/* ══════════════════════════════════════════════════════════
   PORTFOLIO OVERLAY TAB
══════════════════════════════════════════════════════════ */

.pf-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    padding: 8px 4px 4px;
}
.pf-sum-item { color: rgba(255,255,255,0.7); }
.pf-sum-sep  { color: rgba(255,255,255,0.25); }

.pf-list { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }

.pf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px 10px;
    position: relative;
}

.pf-row-img {
    width: 38px;
    height: 53px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.pf-row-info { flex: 1; min-width: 0; }
.pf-row-name {
    font-size: 0.83rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.9);
}
.pf-row-meta {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pf-row-prices {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    margin-top: 4px;
    flex-wrap: wrap;
}
.pf-row-cost  { color: rgba(255,255,255,0.45); }
.pf-row-arrow { color: rgba(255,255,255,0.2); }
.pf-row-live  { color: rgba(255,255,255,0.85); font-weight: 600; }
.pf-row-live.loading { color: rgba(255,255,255,0.3); font-style: italic; }

.pf-up   { color: #4ade80; }
.pf-down { color: #f87171; }

.pf-row-remove {
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.pf-row-remove:hover { background: rgba(255,50,50,0.5); color: #fff; }

/* ── Portfolio quick-add form ──────────────────────────── */

/* ── Portfolio Popup Overlay ────────────────────────────── */
.pf-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(0,0,0,0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pf-fade-in 0.15s ease;
}
@keyframes pf-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.pf-popup {
    background: #1a1c24;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 20px;
    width: 320px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: pf-slide-up 0.2s ease;
}
@keyframes pf-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.pf-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pf-popup-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.pf-popup-close:hover { color: #fff; }
.pf-popup-card {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
}

.pqf-row { display: flex; flex-direction: column; gap: 3px; }
.pqf-row--split { flex-direction: row; gap: 10px; }
.pqf-row--split > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }

.pqf-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pqf-input, .pqf-select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
}
.pqf-input:focus, .pqf-select:focus {
    outline: none;
    border-color: rgba(255,222,0,0.5);
}
.pqf-input--sm { width: 100%; }

.pqf-actions { display: flex; gap: 8px; margin-top: 4px; }

.pqf-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.pqf-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pqf-btn--save   { background: #ffde00; color: #000; }
.pqf-btn--cancel { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }

/* Portfolio button in modal */
#modal-portfolio-btn.in-portfolio {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
}

/* ── Collector Hub Side Drawer (Messe & Event Convention Ready) ─────────── */

.collector-hub-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10002;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
}
.collector-hub-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
    display: block !important; /* Keep display:block but bypass visibility with pointer-events */
    visibility: hidden;
}

.collector-hub-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 100%;
    background: rgba(18, 18, 28, 0.88);
    backdrop-filter: blur(25px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.75), inset 1px 0 0 rgba(255, 255, 255, 0.1);
    z-index: 10003;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(0);
}
.collector-hub-drawer.hidden {
    transform: translateX(100%);
    pointer-events: none;
    display: flex !important; /* Keep flex display but bypass via translate */
    visibility: hidden;
}

.collector-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.collector-hub-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.user-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.user-email {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-status {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.hub-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}
.hub-close-btn:hover {
    color: #ffffff;
}

.collector-hub-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

.hub-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.hub-group-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.hub-group-subtitle {
    margin-top: -6px;
}

.hub-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.hub-primary-btn {
    background: linear-gradient(135deg, #ffe600 0%, #d4bf00 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: #000000;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    box-shadow: 0 4px 15px rgba(255, 230, 0, 0.25);
    text-align: center;
}
.hub-primary-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.hub-secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}
.hub-secondary-btn:hover {
    background: rgba(255, 50, 50, 0.15);
    color: #ff4d4d;
    border-color: rgba(255, 50, 50, 0.3);
}

.hub-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.hub-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hub-stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffe600;
    font-family: 'Outfit', sans-serif;
}
body.theme-dbs .hub-stat-card .stat-value {
    color: #F5A623;
}
.hub-stat-card .stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.hub-menu-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.hub-menu-item:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}
body.theme-pokemon .hub-menu-item {
    border-color: rgba(220, 50, 50, 0.25);
    background: linear-gradient(135deg, rgba(220, 50, 50, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}
body.theme-pokemon .hub-menu-item:hover {
    border-color: rgba(220, 50, 50, 0.40);
    background: linear-gradient(135deg, rgba(220, 50, 50, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 0 14px rgba(220, 50, 50, 0.10);
}
body.theme-dbs .hub-menu-item {
    border-color: rgba(255, 165, 0, 0.25);
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}
body.theme-dbs .hub-menu-item:hover {
    border-color: rgba(255, 165, 0, 0.40);
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 0 14px rgba(255, 165, 0, 0.10);
}
.hub-menu-item .pro-pill {
    margin-left: auto;
}

/* Messe Event Recalls Horizontal Scroll */
.hub-recall-tray::-webkit-scrollbar {
    height: 4px;
}
.hub-recall-tray::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}
.hub-recall-card {
    flex-shrink: 0;
    width: 68px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s, transform 0.15s;
}
.hub-recall-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}
.hub-recall-img {
    width: 100%;
    aspect-ratio: 2.5 / 3.5;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
.hub-recall-price {
    font-size: 7.5px;
    font-weight: 800;
    color: #ffde00;
    margin-top: 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}
body.theme-dbs .hub-recall-price {
    color: #F5A623;
}

.hub-toggle-btn.secondary.active {
    color: #ffe600 !important;
    background: rgba(255, 230, 0, 0.1) !important;
    border-color: rgba(255, 230, 0, 0.3) !important;
}
body.theme-dbs .hub-toggle-btn.secondary.active {
    color: #F5A623 !important;
    background: rgba(245, 166, 35, 0.1) !important;
    border-color: rgba(245, 166, 35, 0.3) !important;
}

/* ── Mobile Hamburger Menu Styles & Consolidation ───────────────────────── */

.btn-hub-menu {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
}
.btn-hub-menu:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
    .btn-hub-menu {
        display: flex; /* Shown only on mobile */
    }
    .header-actions #trade-calc-open-btn,
    .header-actions #auth-wrapper {
        display: none !important; /* Hide individual desktop action buttons */
    }

    /* Watchlist quick-access — compact icon-only next to hamburger on mobile */
    .header-actions #btn-watchlist {
        display: inline-flex !important;
        position: relative !important;
        padding: 0 !important;
        width: 38px !important;
        height: 38px !important;
        justify-content: center;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        font-size: 0 !important;
    }
    .header-actions #btn-watchlist .watchlist-badge:not(.hidden) {
        position: absolute;
        top: -4px;
        right: -4px;
        font-size: 0.6rem;
        min-width: 16px;
        height: 16px;
        padding: 0 3px;
    }
    
    .collector-hub-drawer {
        width: 100%; /* Take full width on small mobile viewport */
    }
}

/* ── Convention Dimming Mode (Messe Battery Conservation) ───────────────── */

body.battery-dimmed {
    transition: filter 0.8s ease, background 0.8s ease;
    filter: brightness(0.28) contrast(1.1);
}
body.battery-dimmed .collector-hub-drawer,
body.battery-dimmed #auth-modal {
    filter: brightness(3.5); /* Exclude the Collector Hub and Auth modal from dimming so they stay fully legible */
}
.battery-dimmed-active-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10005;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    backdrop-filter: blur(2px);
    animation: pulseDimMsg 2s infinite ease-in-out;
}
@keyframes pulseDimMsg {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ── Paywall Modal ─────────────────────────────────────────── */

.paywall-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: paywallFadeIn 0.25s ease-out;
}
.paywall-modal.hidden { display: none; }

@keyframes paywallFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.paywall-box {
    position: relative;
    width: min(400px, 92vw);
    background: rgba(22, 22, 34, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 20px;
    padding: 36px 28px 28px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.06);
    animation: paywallSlideUp 0.3s ease-out;
}

@keyframes paywallSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.paywall-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.15), transparent 70%);
    pointer-events: none;
}

.paywall-icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.paywall-headline {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.paywall-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 6px;
    line-height: 1.5;
}

.paywall-limit-note {
    font-size: 0.78rem;
    color: rgba(255, 180, 0, 0.85);
    font-weight: 600;
    margin: 0 0 18px;
    min-height: 1em;
}

.paywall-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.paywall-feature-row {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 10px;
}

.paywall-check-icon {
    flex-shrink: 0;
}

.paywall-price {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.paywall-price-period {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.paywall-cta-row {
    margin-bottom: 16px;
}

.paywall-coming-soon {
    display: inline-block;
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    background-size: 200% 200%;
    animation: goldShimmer 3s ease infinite;
    color: #000;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 28px;
    border-radius: 10px;
    cursor: default;
}

@keyframes goldShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.paywall-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.15s;
}
.paywall-dismiss:hover { color: rgba(255, 255, 255, 0.7); }

/* ── Pro Badge ─────────────────────────────────────────────── */

.pro-badge {
    display: inline-flex;
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728);
    color: #000;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1.4;
    align-self: flex-start;
}
.pro-badge.hidden { display: none; }

/* ── Pro Pill (inline tab indicator) ───────────────────────── */

.pro-pill {
    display: inline-block;
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728);
    color: #000;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.4;
}

.modal-action-btn .pro-pill { margin-left: 3px; }

/* PRO pill must not be squished away in flex rows on mobile */
.pro-pill { flex-shrink: 0; }
.wl-view-btn .pro-pill { margin-left: 2px; }
.lab-title .pro-pill { margin-left: 6px; }

/* ── Hub menu multi-line button ──────────────────────────── */
.hub-menu-item--multi { flex-wrap: wrap; }
.hub-menu-label { display: flex; flex-direction: column; line-height: 1.3; }
.hub-menu-sub {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.5;
    letter-spacing: 0.3px;
}

/* ── Grading Lab Pro Lock ────────────────────────────────── */
.modal-grading-lab.pro-locked { position: relative; overflow: hidden; }
.modal-grading-lab.pro-locked > *:not(.pro-lock-overlay):not(.lab-title) {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}
.modal-grading-lab.pro-locked > .lab-title {
    position: relative;
    z-index: 3;
}
.pro-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: background 0.2s;
    padding-top: 45px;
}
.pro-lock-overlay:hover {
    background: rgba(0, 0, 0, 0.55);
    color: #ffde00;
}
.pro-lock-overlay svg { opacity: 0.7; }

/* ── SVG icon alignment helpers ────────────────────────────── */

.tab-icon,
.section-icon,
.hub-icon,
.dropdown-icon,
.wl-tab-icon {
    vertical-align: -2px;
    flex-shrink: 0;
}

.paywall-icon {
    color: #ffd700;
    margin-bottom: 8px;
}

.paywall-icon svg {
    stroke: #ffd700;
}

/* ── Teaser blur overlay for Pro-gated sections ────────────── */

.pro-teaser-wrapper {
    position: relative;
}

.pro-teaser-blur {
    filter: blur(6px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.pro-teaser-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 18, 0.85) 40%);
    border-radius: 12px;
}

.pro-teaser-lock-icon {
    color: #ffd700;
}

.pro-teaser-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.pro-teaser-btn {
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    background-size: 200% 200%;
    animation: goldShimmer 3s ease infinite;
    color: #000;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s;
}
.pro-teaser-btn:hover { transform: scale(1.03); }

/* Fix gap between disclaimer banner and header (v1.9.1) */
body.theme-pokemon .disclaimer-banner {
    border-radius: 0;
    margin-bottom: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}
body.theme-dbs .disclaimer-banner {
    border-radius: 0;
    margin-bottom: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

/* ============================================================
   TCG CARD SCANNER & VIEWFINDER OVERLAY STYLES
   ============================================================ */

.search-scan-btn:hover {
    color: var(--primary-color) !important;
    transform: scale(1.1);
}
body.theme-pokemon .search-scan-btn {
    color: rgba(255, 222, 0, 0.6) !important;
}
body.theme-pokemon .search-scan-btn:hover {
    color: #ffde00 !important;
}
body.theme-dbs .search-scan-btn {
    color: rgba(255, 215, 0, 0.6) !important;
}
body.theme-dbs .search-scan-btn:hover {
    color: #FFD700 !important;
}

.scanner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-overlay.hidden {
    display: none !important;
}

.scanner-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.scanner-viewfinder {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Card framing guide: standard 2.5 x 3.5 ratio */
.scanner-viewfinder::before {
    content: '';
    width: 250px;
    height: 350px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.scanner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-color, #ffde00);
    z-index: 12;
    pointer-events: none;
    animation: scannerBracketsPulse 2s ease infinite;
}

.bracket-tl {
    top: calc(50% - 177px);
    left: calc(50% - 127px);
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 10px;
}

.bracket-tr {
    top: calc(50% - 177px);
    right: calc(50% - 127px);
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 10px;
}

.bracket-bl {
    bottom: calc(50% - 177px);
    left: calc(50% - 127px);
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 10px;
}

.bracket-br {
    bottom: calc(50% - 177px);
    right: calc(50% - 127px);
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 10px;
}

.scanner-guide-text {
    position: absolute;
    top: calc(50% - 215px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-family: var(--font-heading);
}

.scanner-status {
    position: absolute;
    top: calc(50% + 195px);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--primary-color, #ffde00);
    border-radius: 20px;
    padding: 6px 16px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(255, 222, 0, 0.2);
    animation: scannerStatusGlow 1.5s ease-in-out infinite alternate;
}

.scanner-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 20;
    padding: 0 24px;
}

.scanner-control-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(25, 25, 25, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
}
.scanner-control-btn:hover {
    background: rgba(40, 40, 40, 0.9);
    transform: scale(1.05);
}

.scanner-shutter-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}
.scanner-shutter-btn:hover {
    transform: scale(1.05);
    background: #f2f2f2;
}
.scanner-shutter-btn:active {
    transform: scale(0.95);
}

@keyframes scannerBracketsPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

@keyframes scannerStatusGlow {
    0% { box-shadow: 0 0 5px rgba(255, 222, 0, 0.1); }
    100% { box-shadow: 0 0 15px rgba(255, 222, 0, 0.35); }
}

/* Horizontally Scrolling Recent Scans Tray */
.scanner-history-tray {
    position: absolute;
    bottom: 120px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scanner-history-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: var(--font-heading);
}

.scanner-history-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide standard scrollbars */
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px 0;
}

.scanner-history-list::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.scanner-history-item {
    position: relative;
    width: 48px;
    height: 67px; /* Matches standard 2.5:3.5 ratio exactly */
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, box-shadow 0.2s;
    background: #111;
}

.scanner-history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scanner-history-item:hover {
    transform: translateY(-3px) scale(1.08);
    border-color: var(--primary-color, #ffde00);
    box-shadow: 0 0 12px rgba(255, 222, 0, 0.5);
}

.scanner-history-item:active {
    transform: scale(0.95);
}

/* Individual deletion triggers for scanner history */
.scanner-history-item-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: transform 0.2s, background-color 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.scanner-history-item-delete:hover {
    background: #ff453a;
    transform: scale(1.15);
}

.rv-chip-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rv-chip-wrapper:hover .rv-chip-delete-btn {
    opacity: 1;
    transform: scale(1);
}

.rv-chip-delete-btn:hover {
    background: #ff453a;
    transform: scale(1.15) !important;
}

@media (max-width: 768px) {
    .rv-chip-delete-btn {
        opacity: 0.9;
        transform: scale(1);
    }
}

/* SLEEK INTERACTIVE AVATAR UPLOAD COMPONENT */
.user-avatar-container {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.user-avatar-container:hover {
    border-color: var(--primary-color, #ffde00);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 222, 0, 0.4);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    padding: 3px 0;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.user-avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}

/* --- High-Trust Valuation Engine Upgrades (v2.1.0) --- */
/* Custom Submission Cost range slider styling */
.lab-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.2s;
    margin: 8px 0;
}

body.theme-pokemon .lab-slider {
    background: rgba(78, 168, 222, 0.15);
}

body.theme-dbs .lab-slider {
    background: rgba(245, 166, 35, 0.15);
}

.lab-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease, background-color 0.2s;
}

body.theme-pokemon .lab-slider::-webkit-slider-thumb {
    background: #4ea8de;
    box-shadow: 0 0 8px rgba(78, 168, 222, 0.6);
}

body.theme-dbs .lab-slider::-webkit-slider-thumb {
    background: #f5a623;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.6);
}

.lab-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.lab-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

body.theme-pokemon .lab-slider::-moz-range-thumb {
    background: #4ea8de;
}

body.theme-dbs .lab-slider::-moz-range-thumb {
    background: #f5a623;
}

.lab-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Glassmorphic styling extensions for the new ROI container */
.modal-grading-roi {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Status alerts and ROI badges */
.lab-res-val.text-profit {
    color: #4ade80 !important; /* Emerald Mint green for profit */
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.2);
}

.lab-res-val.text-loss {
    color: #f87171 !important; /* Rose/Red for loss */
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.2);
}

.lab-roi-badge.roi-high {
    background: rgba(74, 222, 128, 0.15) !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
    color: #4ade80 !important;
}

.lab-roi-badge.roi-med {
    background: rgba(245, 166, 35, 0.15) !important;
    border: 1px solid rgba(245, 166, 35, 0.3) !important;
    color: #f5a623 !important;
}

.lab-roi-badge.roi-low {
    background: rgba(248, 113, 113, 0.15) !important;
    border: 1px solid rgba(248, 113, 113, 0.3) !important;
    color: #f87171 !important;
}



