/* V3: Teal Background - Teal bg, White cards, Dark teal text, Peach accent */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #5c9ead;
    --bg-secondary: #4e8a98;
    --bg-card: #f0f0f0;
    --text-primary: #326273;
    --text-secondary: #4a7a8a;
    --text-muted: #6a9aa8;
    --accent: #e39774;
    --accent-hover: #d4845f;
    --accent-light: #f5ddd2;
    --border: #d0d0d0;
    --border-light: #e0e0e0;
    --success: #4abe8a;
    --success-light: rgba(74, 190, 138, 0.15);
    --danger: #e07070;
    --danger-light: rgba(224, 112, 112, 0.15);
    --warning: #e39774;
    --gradient-text: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    --shadow-sm: 0 1px 3px rgba(50, 98, 115, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(50, 98, 115, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(50, 98, 115, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Theme-aware variables */
    --bg-body-start: #4e8a98;
    --bg-body-mid: #5c9ead;
    --bg-body-end: #6aabb8;
    --navbar-bg: rgba(62, 122, 138, 0.85);
    --navbar-text: rgba(255, 255, 255, 0.75);
    --navbar-text-hover: #ffffff;
    --navbar-border: rgba(255, 255, 255, 0.1);
    --card-bg-solid: #ffffff;
    --card-bg-alt: #f8f9fa;
    --input-bg: #eeeeee;
    --input-bg-white: #ffffff;
    --dropdown-bg: #1a2a35;
    --dropdown-item-text: #d0dde0;
    --dropdown-item-hover: rgba(92, 158, 173, 0.3);
    --dropdown-item-selected: rgba(92, 158, 173, 0.4);
    --heading-color: #ffffff;
    --on-bg-text: rgba(255, 255, 255, 0.85);
    --on-bg-text-muted: rgba(255, 255, 255, 0.6);
    --focus-ring: rgba(227, 151, 116, 0.15);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --desktop-ui-scale: 0.9;
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

/* Match the intended desktop density without asking users to change browser zoom. */
@media (min-width: 1100px) {
    html {
        font-size: calc(100% * var(--desktop-ui-scale));
    }
}

@supports (zoom: 1) {
    @media (min-width: 1100px) {
        html {
            font-size: 100%;
            zoom: var(--desktop-ui-scale);
        }
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, var(--bg-body-start) 0%, var(--bg-body-mid) 50%, var(--bg-body-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Navbar */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 14px 0; background: var(--navbar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--navbar-border); }
.nav-content { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; color: var(--heading-color); text-decoration: none; }
.logo-icon { font-size: 1.5rem; color: var(--accent); }
.logo-img { height: 36px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 16px; color: var(--navbar-text); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-radius: var(--radius-sm); transition: color 0.2s, background 0.2s; }
.nav-link:hover { color: var(--navbar-text-hover); background: rgba(255,255,255,0.1); }
.nav-link.active { color: var(--navbar-text-hover); background: rgba(255,255,255,0.15); }
.nav-btn { padding: 8px 20px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.login-btn { background: var(--accent); color: white; }
.login-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* Navbar — logged-in user widget */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); }
.nav-avatar-default { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 600; line-height: 1; border-radius: 50%; }
.nav-upgrade-btn { background: var(--accent); color: white; font-size: 0.8rem; padding: 6px 14px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; transition: all 0.2s; }
.nav-upgrade-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* Avatar trigger */
.nav-avatar-trigger { background: none; border: none; cursor: pointer; padding: 2px; border-radius: 50%; transition: box-shadow 0.15s; }
.nav-avatar-trigger:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.2); }
.nav-avatar-trigger img.nav-avatar { display: block; }

/* Profile dropdown */
.nav-profile-dropdown { position: relative; }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 260px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; }
.nav-profile-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-header { display: flex; align-items: center; gap: 12px; padding: 16px; }
.nav-dropdown-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.nav-dropdown-avatar-default { width: 40px; height: 40px; min-width: 40px; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.nav-dropdown-info { min-width: 0; }
.nav-dropdown-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-dropdown-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.nav-dropdown-divider { height: 1px; background: var(--border-light); margin: 0; }
.nav-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; cursor: pointer; transition: background 0.12s, color 0.12s; border: none; background: none; width: 100%; font-family: inherit; }
.nav-dropdown-item:hover { background: var(--hover-bg); color: var(--text-primary); }
.nav-dropdown-item svg { flex-shrink: 0; opacity: 0.5; }
.nav-dropdown-item:hover svg { opacity: 0.8; }
.nav-dropdown-signout { color: var(--danger); }
.nav-dropdown-signout:hover { background: rgba(224, 112, 112, 0.08); color: var(--danger); }
.nav-dropdown-signout svg { opacity: 0.7; }

.header { padding: 32px 0 24px; text-align: center; }
.header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.header h1 .highlight { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header p { color: var(--text-secondary); font-size: 0.95rem; }

.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 72px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-row + .filter-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.filter-group.grow { flex: 1; min-width: 200px; }
.filter-group label { font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.filter-row > .btn { margin-top: 22px; }
.filter-group input, .filter-group select { padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-primary); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.filter-group input:focus, .filter-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.filter-group input::placeholder { color: var(--text-muted); }
.filter-help-note { margin: 0; font-size: 0.75rem; line-height: 1.35; color: var(--text-secondary); }
.filter-row-note { flex-basis: 100%; margin: -2px 0 0; font-size: 0.75rem; line-height: 1.35; color: var(--text-secondary); }
.filter-actions-row { align-items: center; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
.search-dirty-note { margin: 0; font-size: 0.8rem; color: var(--text-secondary); }
.search-load-note { margin: 0; font-size: 0.8rem; color: var(--accent); font-weight: 600; }

.toggle-group { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 0.85rem; color: var(--text-secondary); }

.blacklist-input { display: flex; gap: 8px; }
.blacklist-input input { flex: 1; }
.blacklist-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; flex-basis: 100%; }
.blacklist-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--danger-light); border: 1px solid var(--danger); color: var(--danger); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.blacklist-tag-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; margin-left: 2px; }
.blacklist-tag-remove:hover { color: #c44; }
.btn { padding: 10px 16px; border: none; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); }
.btn:disabled { cursor: not-allowed; opacity: 0.65; }

/* Multi-select dropdown (collections & rarity filters) */
.multi-dropdown {
    position: relative;
    min-width: 180px;
}

.multi-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #d0d0d0);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary, #326273);
    background: var(--input-bg-white);
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.multi-dropdown-trigger:hover {
    border-color: var(--accent, #e39774);
}

.multi-dropdown.open .multi-dropdown-trigger {
    border-color: var(--accent, #e39774);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.multi-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: 280px;
    background: var(--dropdown-bg);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    z-index: 50;
    overflow: hidden;
}

.multi-dropdown.open .multi-dropdown-panel {
    display: block;
}

.multi-dropdown-actions {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.multi-action-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.multi-action-btn:hover {
    background: var(--dropdown-item-hover);
    color: #ffffff;
}

.multi-action-btn:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.multi-dropdown-list {
    max-height: 280px;
    overflow-y: auto;
}

.multi-dropdown-list::-webkit-scrollbar { width: 6px; }
.multi-dropdown-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.multi-dropdown-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.multi-dropdown-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }

.multi-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--dropdown-item-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.multi-dropdown-item:hover {
    background: var(--dropdown-item-hover);
    color: #ffffff;
}

.multi-dropdown-item.selected {
    color: #ffffff;
}

.multi-dropdown-check {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.multi-dropdown-item.selected .multi-dropdown-check {
    background: var(--accent, #e39774);
    border-color: var(--accent, #e39774);
}

.multi-dropdown-item.selected .multi-dropdown-check::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.warning-banner { display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(227, 151, 116, 0.2); border: 2px solid var(--accent); border-radius: var(--radius-md); padding: 16px 24px; margin-bottom: 16px; color: #fff; font-size: 1.1rem; font-weight: 700; }
.warning-icon { font-size: 1.4rem; }

.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.results-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--heading-color); }
.results-header span { color: var(--on-bg-text); font-size: 0.9rem; }
.results-controls { display: flex; align-items: center; gap: 16px; }
.sort-select { padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-primary); cursor: pointer; }
.sort-select:focus { outline: none; border-color: var(--accent); }

.tradeup-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.tradeup-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s; }
.tradeup-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.arbitrage-badge { display: inline-block; background: linear-gradient(135deg, var(--dropdown-bg), var(--bg-secondary)); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 4px; margin-bottom: 12px; letter-spacing: 0.02em; }
.tradeup-card-header { display: flex; gap: 16px; margin-bottom: 16px; }
.skin-preview { width: 72px; height: 54px; background: var(--input-bg); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.skin-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.skin-badge { position: absolute; top: 4px; left: 4px; background: var(--accent); color: white; font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.tradeup-info { flex: 1; min-width: 0; }
.tradeup-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.tradeup-subtitle { font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.liquidity { color: var(--accent); font-weight: 500; }
.tradeup-inputs-list { display: flex; flex-direction: column; gap: 8px; }
.header-input-item { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; padding: 8px 12px; background: var(--card-bg-alt); border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
.header-input-img { width: 64px; height: 48px; background: var(--input-bg); border-radius: 4px; overflow: visible; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.header-input-tooltip { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--dropdown-bg); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.8rem; text-align: center; white-space: nowrap; z-index: 10; box-shadow: var(--shadow-md); }
.header-input-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--dropdown-bg); }
.header-input-img:hover .header-input-tooltip { display: block; }
.tooltip-price-each { color: rgba(255,255,255,0.7); font-size: 0.75rem; }
.tooltip-price-total { font-weight: 600; margin-top: 2px; }
.header-input-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.header-input-text { flex: 1 1 0; min-width: 0; overflow: hidden; }
.header-input-price { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; align-self: stretch; white-space: nowrap; text-align: right; min-width: 74px; flex-shrink: 0; padding-top: 6px; }
.header-input-actions { display: flex; justify-content: flex-end; width: 100%; margin-bottom: 3px; }
.header-side-market-links { justify-content: flex-end; gap: 3px; max-width: 370px; }
.header-side-market-links .market-link-badge { width: 19px; height: 19px; }
.header-side-market-links .market-brand-favicon { width: 13px; height: 13px; }
.header-side-market-links .market-brand-icon { width: 10px; height: 10px; }
.header-input-price-each { font-size: 0.75rem; color: var(--text-secondary); }
.header-input-price-total { font-size: 1rem; font-weight: 700; color: var(--accent); }
.header-input-qty { font-size: 0.8rem; font-weight: 700; color: var(--accent); min-width: 28px; }
.header-input-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-input-collection { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.header-input-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; flex-wrap: wrap; overflow: hidden; }
.header-input-rarity { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.header-input-rarity.consumer-grade { color: #b0c3d9; }
.header-input-rarity.industrial-grade { color: #5e98d9; }
.header-input-rarity.mil-spec { color: #4b69ff; }
.header-input-rarity.restricted { color: #8847ff; }
.header-input-rarity.classified { color: #d32ce6; }
.header-input-rarity.covert { color: #eb4b4b; }
.header-input-float { font-size: 0.65rem; color: var(--text-muted); }

.tradeup-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.stat { text-align: center; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 1.1rem; font-weight: 600; }
.stat-value.cost { color: var(--accent); }
.stat-value.ev { color: #326273; }
.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }
.stat-cents { font-size: 0.8rem; opacity: 0.7; }

.tradeup-outcomes { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; }
.outcomes-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.outcome-skins { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.outcome-skins::-webkit-scrollbar { width: 4px; }
.outcome-skins::-webkit-scrollbar-track { background: transparent; }
.outcome-skins::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.outcome-skin { position: relative; width: 80px; background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.outcome-skin-img { width: 100%; height: 54px; display: flex; align-items: center; justify-content: center; }
.outcome-skin-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.outcome-skin img { max-width: 100%; max-height: 100%; object-fit: contain; }
.outcome-market-text, .outcome-fallback-text { width: 100%; font-size: 0.55rem; font-weight: 600; text-align: center; padding: 2px 2px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border-light); cursor: help; }
.outcome-market-text { color: var(--accent); background: var(--card-bg-alt); }
.outcome-fallback-text { color: var(--warning); background: rgba(227, 151, 116, 0.08); }
.outcome-skin .skin-tooltip { display: none; }
#floating-tooltip { display: none; position: fixed; background: var(--dropdown-bg); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.75rem; white-space: nowrap; z-index: 9999; pointer-events: none; box-shadow: var(--shadow-md); }
#floating-tooltip .tooltip-name { font-weight: 600; margin-bottom: 2px; }
#floating-tooltip .tooltip-price { color: var(--accent); }
.expand-btn { margin-left: auto; background: var(--border-light); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; padding: 8px 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.expand-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

.tradeup-footer { display: flex; align-items: center; gap: 24px; margin-top: 16px; padding-top: 12px; }
.footer-stat { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.footer-stat-icon { color: var(--text-muted); }
.footer-stat-label { color: var(--text-secondary); }
.footer-stat-value { font-weight: 600; color: var(--text-primary); }
.footer-stat-value.positive { color: var(--success); }
.footer-stat-value.negative { color: var(--danger); }
.btn-view-tradeup { margin-left: auto; padding: 8px 16px; font-size: 0.8rem; text-decoration: none; white-space: nowrap; }

/* Search Progress Bar */
.search-progress { margin-bottom: 12px; }
.progress-bar { height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
.progress-text { font-size: 0.8rem; color: var(--on-bg-text); margin-top: 6px; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 20px 0 40px; }
.page-btn { padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-primary); cursor: pointer; transition: all 0.2s; }
.page-btn:hover:not([disabled]):not(.active) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-btn[disabled] { opacity: 0.4; cursor: default; }
.page-ellipsis { color: var(--on-bg-text-muted); font-size: 0.85rem; padding: 0 4px; }
.page-goto { display: flex; align-items: center; gap: 6px; margin-left: 12px; }
.page-goto-input { width: 52px; padding: 7px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-primary); text-align: center; -moz-appearance: textfield; }
.page-goto-input::-webkit-outer-spin-button, .page-goto-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.page-goto-total { color: var(--on-bg-text-muted); font-size: 0.85rem; }
.page-goto-btn { padding: 8px 12px; }

.loading { text-align: center; padding: 60px 20px; color: var(--heading-color); }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px 20px; color: var(--heading-color); }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* Upsell Banner */
.upsell-banner { background: linear-gradient(135deg, var(--dropdown-bg) 0%, var(--bg-secondary) 100%); border: 1px solid rgba(227, 151, 116, 0.3); border-radius: var(--radius-lg); padding: 24px 28px; margin: 20px 0; }
.upsell-content { display: flex; align-items: center; gap: 20px; }
.upsell-icon { font-size: 2rem; color: var(--accent); }
.upsell-text { flex: 1; color: var(--heading-color); }
.upsell-text strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.upsell-text p { font-size: 0.85rem; margin: 0; opacity: 0.85; line-height: 1.5; }
.upsell-btn { white-space: nowrap; padding: 12px 24px !important; font-size: 0.95rem !important; }

/* Pro feature popup */
.pro-popup-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pro-popup { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; max-width: 380px; width: 90%; text-align: center; position: relative; box-shadow: var(--shadow-lg); }
.pro-popup-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 4px; }
.pro-popup-close:hover { color: var(--text-primary); }
.pro-popup-icon { margin-bottom: 12px; }
.pro-popup h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.pro-popup p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 20px; }
.pro-popup-btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; font-size: 0.95rem; padding: 12px 28px; border-radius: var(--radius-sm); text-decoration: none; transition: background 0.2s, transform 0.2s; }
.pro-popup-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.auth-popup-login { font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; }
.auth-popup-login:hover { color: var(--accent); }

.public-gate-card {
    width: 100%;
    padding: 20px;
    border: 1px solid rgba(227, 151, 116, 0.35);
    border-radius: var(--radius-md);
    background: rgba(227, 151, 116, 0.08);
    text-align: center;
}

.public-gate-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.public-gate-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.public-gate-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.public-gate-login {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.public-gate-login:hover {
    color: var(--accent);
}

.tradeup-outcomes-gated {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(92, 158, 173, 0.12);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Expanded Card State */
.tradeup-card.expanded .expand-btn svg {
    transform: rotate(180deg);
}

.expand-btn svg {
    transition: transform 0.3s ease;
}

/* Trade-Up Details (Expandable Section) */
.tradeup-details {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.tradeup-card.expanded .tradeup-details {
    display: grid;
    opacity: 1;
    max-height: none;
    overflow: visible;
}

.outcomes-section {
    max-height: 500px;
    overflow-y: auto;
}

.details-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.details-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-section h3 .item-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Input Items */
.input-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg-solid);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.item-image {
    position: relative;
    width: 56px;
    height: 42px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.quantity-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 1;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.item-collection {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.item-rarity {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}

.item-float { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }
.item-rarity.restricted { color: #8847ff; }
.item-rarity.classified { color: #d32ce6; }
.item-rarity.covert { color: #eb4b4b; }
.item-rarity.mil-spec { color: #4b69ff; }

.item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    gap: 2px;
    min-width: 82px;
}

.item-actions,
.outcome-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 6px;
}

.price-each {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.price-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Outcome Items */
.outcome-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg-solid);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.outcome-image {
    position: relative;
    width: 56px;
    height: 42px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.outcome-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.outcome-info {
    flex: 1;
    min-width: 0;
}

.outcome-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.outcome-collection {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.outcome-probability-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.probability-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.outcome-received {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.outcome-received .positive {
    color: var(--success);
    font-weight: 500;
}

.outcome-received .negative {
    color: var(--danger);
    font-weight: 500;
}

.outcome-fee-note {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-muted);
    margin-top: 4px;
}

.outcome-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    min-width: 82px;
}

.outcome-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.outcome-chance {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.market-link {
    text-decoration: none;
}

.market-links-menu {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.expandable-market-links {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.expandable-market-links-collapsed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.expandable-market-links-trigger {
    min-width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    padding: 0 5px;
    background: rgba(19, 28, 38, 0.14);
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.expandable-market-links-trigger:hover,
.expandable-market-links-trigger:focus-visible {
    background: rgba(19, 28, 38, 0.22);
    color: var(--text-primary);
    outline: none;
}

.expandable-market-links-panel {
    position: absolute;
    right: 0;
    top: 100%;
    display: grid;
    grid-template-columns: repeat(13, max-content);
    align-items: center;
    justify-content: start;
    justify-items: center;
    column-gap: 4px;
    row-gap: 6px;
    width: min(438px, calc(100vw - 32px));
    min-width: 0;
    padding: 8px 9px;
    border-radius: 12px;
    background: rgba(19, 28, 38, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 8;
}

.expandable-market-links:hover .expandable-market-links-panel,
.expandable-market-links:focus-within .expandable-market-links-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.expandable-market-links .market-link-badge {
    width: 23px;
    height: 23px;
}

.expandable-market-links .market-link-badge-logo-wide {
    width: 31px;
}

.expandable-market-links .market-brand-icon,
.expandable-market-links .market-brand-favicon {
    width: 11px;
    height: 11px;
}

.expandable-market-links .market-link-badge-logo-wide .market-brand-favicon {
    width: 18px;
    height: 9px;
}

@media (max-width: 900px) {
    .expandable-market-links-panel {
        grid-template-columns: repeat(10, max-content);
        width: min(314px, calc(100vw - 24px));
    }
}

.market-link-badge {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(19, 28, 38, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

.market-link-badge-logo {
    background: rgba(255, 255, 255, 0.98);
    color: #16202a;
    border-color: rgba(15, 23, 32, 0.12);
}

.market-link-badge-logo-dark {
    background: linear-gradient(135deg, #262241, #37305e);
    color: #f7f8fa;
    border-color: rgba(247, 248, 250, 0.14);
}

.market-link-badge-logo-wide {
    width: 38px;
    border-radius: 10px;
    padding: 0 6px;
}

.market-link-badge:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.market-link-badge-steam {
    background: linear-gradient(135deg, #1b2838, #2a475e);
}

.market-link-badge-skinport {
    box-shadow: inset 0 0 0 1px rgba(255, 106, 69, 0.16), 0 4px 12px rgba(255, 106, 69, 0.18);
}

.market-link-badge-csmoney {
    box-shadow: inset 0 0 0 1px rgba(14, 125, 231, 0.18), 0 4px 12px rgba(14, 125, 231, 0.18);
}

.market-link-badge-waxpeer {
    background: linear-gradient(135deg, #3346ff, #5875ff);
}

.market-link-badge-dmarket {
    box-shadow: inset 0 0 0 1px rgba(27, 141, 123, 0.18), 0 4px 12px rgba(27, 141, 123, 0.18);
}

.market-link-badge-marketcsgo {
    box-shadow: inset 0 0 0 1px rgba(166, 59, 59, 0.18), 0 4px 12px rgba(166, 59, 59, 0.18);
}

.market-link-badge-skinbaron {
    box-shadow: inset 0 0 0 1px rgba(184, 149, 83, 0.22), 0 4px 12px rgba(61, 52, 40, 0.18);
}

.market-link-badge-buff163 {
    box-shadow: inset 0 0 0 1px rgba(255, 122, 24, 0.18), 0 4px 12px rgba(255, 122, 24, 0.18);
}

.market-link-badge-buffmarket {
    box-shadow: inset 0 0 0 1px rgba(200, 164, 97, 0.22), 0 4px 12px rgba(200, 164, 97, 0.18);
}

.market-brand-icon {
    width: 12px;
    height: 12px;
    display: block;
}

.market-brand-favicon {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
    border-radius: 4px;
}

.market-link-badge-logo-dark .market-brand-favicon {
    border-radius: 0;
}

.market-link-badge-logo-wide .market-brand-favicon {
    width: 24px;
    height: 12px;
}

.market-brand-text {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.market-link:focus-visible {
    outline: 2px solid rgba(227, 151, 116, 0.35);
    outline-offset: 2px;
}

.overlay-market-links {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 4px;
    justify-content: end;
}

.overlay-market-links .market-link-badge {
    width: 18px;
    height: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

.overlay-market-links .market-link-badge-logo-wide {
    width: 24px;
    padding: 0 4px;
    border-radius: 7px;
}

.overlay-market-links .market-brand-icon,
.overlay-market-links .market-brand-favicon {
    width: 10px;
    height: 10px;
}

.overlay-market-links .market-link-badge-logo-wide .market-brand-favicon {
    width: 16px;
    height: 8px;
}

.dashboard-side-market-links {
    justify-content: flex-end;
    gap: 3px;
}

.dashboard-side-market-links .market-link-badge {
    width: 19px;
    height: 19px;
}

.dashboard-side-market-links .market-brand-favicon {
    width: 13px;
    height: 13px;
}

.dashboard-side-market-links .market-brand-icon {
    width: 10px;
    height: 10px;
}

.market-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.market-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(197, 195, 192, 0.18);
    background: rgba(19, 28, 38, 0.96);
    color: #f5f7fa;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.market-link-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(197, 195, 192, 0.30);
    background: rgba(27, 40, 56, 0.98);
}

.market-link-pill .market-link-badge {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.market-link-pill-label {
    white-space: nowrap;
}

/* Steam Button */
.btn-steam {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-steam:hover {
    background: var(--accent-hover);
}

/* Shared legal footer (dashboard pages) */
.site-legal-footer {
    margin-top: 18px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-md);
    background: rgba(22, 37, 42, 0.26);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.site-legal-copy {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.74);
}

.site-legal-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.site-legal-links a {
    font-size: 0.8rem;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.48);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
}

.site-legal-links a:hover {
    color: #ffe5d7;
    border-color: #ffe5d7;
}

.site-social-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-social-link {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.site-social-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

.site-social-link svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .header h1 { font-size: 1.4rem; }
    .filter-row { flex-direction: column; }
    .filter-group { width: 100%; }
    .tradeup-stats { grid-template-columns: repeat(2, 1fr); }
    .tradeup-outcomes { flex-wrap: wrap; }

    /* Expanded details stack on mobile */
    .tradeup-details {
        grid-template-columns: 1fr;
    }
    .site-legal-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Searchable Source Dropdown (shared across dashboard + builder) */
.source-dropdown {
    position: relative;
    min-width: 160px;
}

.source-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #d0d0d0);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary, #326273);
    background: var(--input-bg-white);
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.source-dropdown-trigger [id$="-text"] {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.source-dropdown-trigger:hover {
    border-color: var(--accent, #e39774);
}

.source-dropdown.open .source-dropdown-trigger {
    border-color: var(--accent, #e39774);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.source-dropdown-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.source-dropdown.open .source-dropdown-chevron {
    transform: rotate(180deg);
}

.source-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: 240px;
    background: var(--dropdown-bg);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    z-index: 50;
    overflow: hidden;
}

.source-dropdown.open .source-dropdown-panel {
    display: block;
}

.source-search-input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.source-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.source-list {
    max-height: 260px;
    overflow-y: auto;
}

.source-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--dropdown-item-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.source-list-item:hover {
    background: var(--dropdown-item-hover);
    color: #ffffff;
}

.source-list-item.selected {
    background: var(--dropdown-item-selected);
    color: #ffffff;
    font-weight: 500;
}

.source-list::-webkit-scrollbar { width: 6px; }
.source-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.source-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.source-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.35); }

/* Multi-select checkmark items inside source dropdown */
.source-multi-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-option-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.source-option-logo {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(19, 28, 38, 0.08);
    color: var(--text-secondary);
}

.source-option-icon {
    width: 12px;
    height: 12px;
    display: block;
}

.source-option-favicon {
    width: 14px;
    height: 14px;
    display: block;
    object-fit: contain;
    border-radius: 4px;
}

.source-option-fallback {
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}

.source-option-fallback-hidden {
    display: none;
}

.source-option-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-check {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.source-multi-item.selected .source-check {
    background: var(--accent, #e39774);
    border-color: var(--accent, #e39774);
}

.source-multi-item.selected .source-check::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ============ Multi-Venue Arbitrage Styles ============ */

.multi-venue-card {
    border-left: 3px solid var(--success);
}

/* Improvement badge on card header */
.improvement-badge {
    display: inline-block;
    background: var(--success-light);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

/* Per-output market badge (on outcome skin thumbnails) */
.output-market-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 3px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    z-index: 2;
    line-height: 1.2;
}

.outcome-skin {
    position: relative;
}

/* Buy order warning indicator */
.buy-order-warning {
    display: inline-block;
    background: rgba(227, 151, 116, 0.2);
    color: var(--warning);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 3px;
    cursor: help;
}

/* Per-input buy market badge */
.input-market-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Source-warning badge — full label in expanded details and input items */
.source-warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(227, 151, 116, 0.18);
    color: #a55328;
    border: 1px solid rgba(227, 151, 116, 0.35);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.input-buy-market {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.header-input-buy-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-buy-price {
    font-weight: 600;
    color: var(--accent);
}

.input-buy-total {
    font-weight: 500;
    color: var(--text-primary);
}

/* Outcome sell market line in expanded details */
.outcome-sell-market {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.outcome-sell-market .output-market-badge {
    position: static;
    transform: none;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: visible;
    text-overflow: clip;
    text-align: left;
}

.outcome-sell-market .buy-order-warning {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Top markets list in expanded details */
.outcome-top-markets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.top-market-item {
    font-size: 0.65rem;
    background: rgba(50, 98, 115, 0.08);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 3px;
}

.top-market-item.best {
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
}

/* Venue picker & custom fees section */
.venue-picker-row {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}

.custom-fees-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.15s;
}

.custom-fees-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.venue-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.venue-picker-note {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    padding: 8px 10px;
    border: 1px solid rgba(92, 158, 173, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(92, 158, 173, 0.08);
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
}

.venue-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: opacity 0.15s;
}

.venue-item.disabled {
    opacity: 0.45;
}

.venue-item-main {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.venue-market-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.venue-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.venue-checkbox {
    display: none;
}

.venue-check-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.venue-checkbox:checked + .venue-check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.venue-checkbox:checked + .venue-check-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.venue-market-name {
    min-width: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.venue-market-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(227, 151, 116, 0.12);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.venue-market-note {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.venue-fee-input {
    width: 90px;
    font-size: 0.75rem;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: right;
    flex-shrink: 0;
}

.venue-fee-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.venue-fee-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
