* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(34,197,94,0.2) transparent; }
html, body { overflow-x: hidden; max-width: 100vw; }

body {
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0c0f0c;
    color: #e2e8f0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    position: relative;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    text-align: center;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, transparent 100%);
}

.lang-switcher {
    position: relative;
    display: inline-flex;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    color: #4ade80;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.lang-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.375rem;
    background: #141814;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    padding: 0.25rem;
    min-width: 150px;
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.lang-dropdown.open { display: flex; flex-direction: column; }

.lang-dropdown a {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.1s;
}
.lang-dropdown a:hover { background: rgba(34, 197, 94, 0.15); color: #e2e8f0; text-decoration: none; }
.lang-dropdown a.active { color: #22c55e; font-weight: 600; }

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #22c55e;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.header-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.tg-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    color: #4ade80;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.logout-link {
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
}
.logout-link:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}
.tg-icon { width: 16px; height: 16px; vertical-align: -2px; }
.tg-link:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Label Tabs */
.label-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.label-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.625rem 1rem;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 140px;
}
.label-tab:hover { border-color: rgba(34, 197, 94, 0.4); }
.label-tab.active { border-color: #22c55e; background: rgba(34, 197, 94, 0.08); box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 2px 8px rgba(34, 197, 94, 0.1); }

.label-tab-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555555;
}
.label-tab.active .label-tab-name { color: #22c55e; }

.label-tab-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #22c55e;
}

.label-tab-meta {
    font-size: 0.6875rem;
    color: #333333;
}

.btn-edit-label {
    color: #333333;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}
.btn-edit-label:hover { color: #4ade80; }

/* Portfolio Cards Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.pcard {
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pcard:hover {
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.pcard-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.375rem;
}

.pcard-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pcard-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.pcard-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pcard-mid {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.sparkline {
    width: 80px;
    height: 28px;
    flex-shrink: 0;
}

.pcard-bottom {
    display: flex;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: #555555;
}
.pcard-bottom .roi-cell {
    min-width: auto;
    font-size: 0.6875rem;
}

.back {
    color: #555555;
    text-decoration: none;
    font-size: 0.875rem;
}
.back:hover { color: #e2e8f0; }

.stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #22c55e;
}

.stat-label {
    font-size: 0.75rem;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: rgba(34, 197, 94, 0.03);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(34, 197, 94, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.card h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4ade80;
    text-align: center;
    margin-bottom: 1.25rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: #555555;
    font-weight: 500;
    border-bottom: 1px solid #1a1a1a;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}
tbody tr:hover { background: #1a1a1a; }

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #2a2a2a;
}

.r { text-align: right; }
.muted { color: #555555; }
.value { color: #22c55e; font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.buy {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge.sell {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.label-pro-player {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    margin-left: 0.4rem;
}

tr.buy td { border-left: 2px solid #22c55e; }
tr.sell td { border-left: 2px solid #ef4444; }

/* Activity Feed — Grouped */
.activity-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
}

.activity-group {
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.03);
    border: 1px solid rgba(34, 197, 94, 0.1);
    overflow: hidden;
}

.activity-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s;
}
.activity-summary::-webkit-details-marker { display: none; }
.activity-summary::before {
    content: '\25B6';
    font-size: 0.5rem;
    color: #333333;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.activity-group[open] .activity-summary::before { transform: rotate(90deg); }
.activity-summary:hover { background: #151515; }

.activity-bar {
    width: 3px;
    align-self: stretch;
    flex-shrink: 0;
    border-radius: 2px;
}
.activity-group.buy .activity-bar { background: #22c55e; }
.activity-group.sell .activity-bar { background: #ef4444; }

.activity-profile {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.activity-count {
    font-size: 0.6875rem;
    color: #555555;
    flex-shrink: 0;
}

.activity-total {
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}
.activity-total.value { color: #22c55e; }
.activity-total.sell-value { color: #ef4444; }

.activity-day {
    font-size: 0.6875rem;
    flex-shrink: 0;
}

.activity-details {
    padding: 0 0.75rem 0.5rem 1.75rem;
}

.activity-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.1875rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid #2a2a2a;
}
.activity-detail-row:last-child { border-bottom: none; }

.activity-detail-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #888888;
}

.activity-detail-qty {
    color: #555555;
    flex-shrink: 0;
}

.activity-detail-price {
    color: #e2e8f0;
    font-weight: 500;
    flex-shrink: 0;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Donut chart cards */
.donut-wrap { margin-bottom: 1.5rem; }
.donut-title {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4ade80;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}
.donut-card {
    height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: visible;
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.06) 0%, transparent 70%);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 12px;
    padding: 1rem;
    box-shadow:
        0 0 30px rgba(34, 197, 94, 0.05) inset,
        0 4px 20px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.donut-card canvas {
    flex: 1;
    min-width: 0;
    max-width: 60%;
    height: 100% !important;
    transform: perspective(800px) rotateX(25deg);
    transition: transform 0.3s ease;
}
.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
    max-width: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 310px;
    flex-shrink: 0;
}
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    color: #ccc;
}
.donut-legend-item:hover,
.donut-legend-item.highlighted {
    background: rgba(34, 197, 94, 0.12);
    color: #fff;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    transform: translateX(3px);
}
.donut-legend-item.dimmed {
    opacity: 0.3;
}
.donut-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.3);
    transition: box-shadow 0.2s, transform 0.2s;
}
.donut-legend-item:hover .donut-legend-color,
.donut-legend-item.highlighted .donut-legend-color {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    transform: scale(1.3);
}
.donut-legend-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.donut-legend-val {
    color: #aaa;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.donut-legend-pct {
    color: #4ade80;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.donut-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow:
        0 0 40px rgba(34, 197, 94, 0.08) inset,
        0 0 25px rgba(34, 197, 94, 0.1),
        0 8px 30px rgba(0, 0, 0, 0.4);
}

a { color: #4ade80; text-decoration: none; }
a:hover { text-decoration: underline; color: #22c55e; }
.steam-link { color: #555555; font-size: 0.75rem; margin-left: 0.25rem; }
.steam-link:hover { color: #22c55e; }

.add-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.add-form input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.add-form input:focus { outline: none; border-color: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.2); }
.add-form input::placeholder { color: #333333; }
.add-form button, .btn-scan {
    padding: 0.5rem 1.25rem;
    background: #22c55e;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.15s, transform 0.1s;
}
.add-form button:hover, .btn-scan:hover { background: #16a34a; transform: translateY(-1px); }
.btn-delete, .btn-refresh {
    background: none;
    border: none;
    color: #555555;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}
.btn-delete:hover { color: #ef4444; }
.btn-refresh:hover { color: #22c55e; }
.btn-refresh.spinning {
    animation: spin 1s linear infinite;
    color: #22c55e;
}
@keyframes spin { to { transform: rotate(360deg); } }
.actions { white-space: nowrap; }
.inline { display: inline; }
.card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.card-header h2 { margin-bottom: 0; }
.header-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ROI Toggle */
.roi-toggle {
    display: flex;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    overflow: hidden;
}
.roi-btn {
    padding: 0.375rem 0.75rem;
    background: none;
    border: none;
    color: #555555;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.roi-btn:hover { color: #e2e8f0; }
.roi-btn.active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.movers-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.period-toggle, .price-toggle {
    display: flex;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    overflow: hidden;
}
.market-toggle {
    display: flex;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    overflow: hidden;
}
.market-btn {
    padding: 0.375rem 0.625rem;
    background: none;
    border: none;
    color: #555555;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.market-btn:hover { color: #e2e8f0; }
.market-btn.active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.period-btn, .source-btn {
    padding: 0.375rem 0.625rem;
    background: none;
    border: none;
    color: #555555;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.period-btn:hover, .source-btn:hover { color: #e2e8f0; }
.period-btn.active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.source-btn.active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.mover-vol { font-size: 0.625rem; color: #333333; margin-left: 0.25rem; }

/* Top Items Tabs */
.top-tabs {
    display: flex;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    overflow: hidden;
}
.top-tab {
    padding: 0.375rem 0.75rem;
    background: none;
    border: none;
    color: #555555;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.top-tab:hover { color: #e2e8f0; }
.top-tab.active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.roi-pos { color: #22c55e; font-weight: 600; }
.roi-neg { color: #ef4444; font-weight: 600; }
.roi-profit { font-size: 0.75rem; color: #555555; }
.roi-cell { min-width: 5rem; }

/* Top Items Split Layout */
.top-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.top-half { min-width: 0; }

/* Top Items Tiles */
.top-items-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.top-tiles-4 {
    grid-template-columns: repeat(4, 1fr);
}

.tile {
    background: rgba(34, 197, 94, 0.03);
    border-radius: 8px;
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(34, 197, 94, 0.1);
}
.tile:hover {
    background: rgba(34, 197, 94, 0.07);
    transform: translateY(-2px);
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.1);
}

.tile-rank {
    position: absolute;
    top: 0.5rem;
    left: 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #333333;
}
.tile:nth-child(1) .tile-rank { color: #fbbf24; }
.tile:nth-child(2) .tile-rank { color: #888888; }
.tile:nth-child(3) .tile-rank { color: #d97706; }

.tile-img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.tile-img-placeholder {
    width: 96px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.tile-name {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.375rem;
}

.tile-meta {
    font-size: 0.6875rem;
    color: #555555;
    margin-bottom: 0.375rem;
}
.tile-qty { color: #4ade80; }
.tile-dot { margin: 0 0.25rem; }
.tile-holders {
    color: #555555;
    cursor: pointer;
    transition: color 0.15s;
}
.tile-holders:hover { color: #4ade80; }
.tile-holders.holders-open { color: #4ade80; }

.holders-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #141814;
    border-radius: 0 0 8px 8px;
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    z-index: 10;
    border-top: 1px solid #1a1a1a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.holder-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: #e2e8f0;
    font-size: 0.75rem;
    transition: background 0.15s;
}
.holder-row:hover { background: #1a1a1a; text-decoration: none; }

.holder-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.holder-qty {
    color: #4ade80;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.holders-loading {
    text-align: center;
    font-size: 0.6875rem;
    color: #333333;
    padding: 0.25rem;
}

.tile-price {
    font-size: 0.8125rem;
    color: #888888;
    margin-bottom: 0.125rem;
}

.tile-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: #22c55e;
}

/* ROI Movers */
.movers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.mover {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: rgba(34, 197, 94, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-left: 3px solid transparent;
    transition: background 0.15s;
}
.mover:hover { background: rgba(34, 197, 94, 0.07); }
.mover-up { border-left-color: #22c55e; }
.mover-down { border-left-color: #ef4444; }

.mover-img {
    width: 48px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
}

.mover-img-placeholder {
    width: 48px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4ade80;
    flex-shrink: 0;
}

.mover-info {
    flex: 1;
    min-width: 0;
}

.mover-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.mover-prices {
    display: flex;
    gap: 0.5rem;
    font-size: 0.6875rem;
}
.mover-price-now { color: #e2e8f0; font-weight: 600; }
.mover-price-old { color: #333333; text-decoration: line-through; }

.mover-roi {
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mover-qty {
    font-size: 0.6875rem;
    color: #555555;
    flex-shrink: 0;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
    justify-content: center;
}

/* Search */
.search-bar { margin-bottom: 0.75rem; display: flex; justify-content: center; }
.search-bar input {
    width: 100%;
    max-width: 420px;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.search-bar input:focus { border-color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.search-bar input::placeholder { color: rgba(34, 197, 94, 0.4); }

.search-dropdown {
    display: none;
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 500px;
    max-height: 50vh;
    overflow-y: auto;
    background: #141814;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    margin-top: 4px;
}
.search-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #e2e8f0;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(34, 197, 94, 0.08);
}
.search-result:hover { background: rgba(34, 197, 94, 0.1); text-decoration: none; }
.search-result:last-child { border-bottom: none; }
.search-icon { width: 32px; height: 24px; object-fit: contain; flex-shrink: 0; }
.search-result-name { font-size: 0.8rem; font-weight: 500; }
.search-result-meta { font-size: 0.7rem; color: #4ade80; }
.search-result { cursor: pointer; }

/* Search detail card */
.search-detail { padding: 12px; }
.sd-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sd-name { font-size: 0.85rem; font-weight: 600; }
.sd-price { font-size: 0.8rem; color: #4ade80; margin-top: 2px; }
.sd-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sd-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(34,197,94,0.08); }
.sd-row:last-child { border-bottom: none; }
.sd-label { font-size: 0.75rem; color: rgba(226,232,240,0.5); }
.sd-val { font-size: 0.85rem; font-weight: 600; }
.sd-up { color: #22c55e; }
.sd-down { color: #ef4444; }
.sd-link { display: block; text-align: center; padding: 8px; background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); border-radius: 6px; color: #4ade80; font-size: 0.8rem; font-weight: 600; text-decoration: none; margin-bottom: 8px; }
.sd-link:hover { background: rgba(34,197,94,0.2); text-decoration: none; }
.sd-back { text-align: center; color: rgba(226,232,240,0.3); font-size: 0.75rem; cursor: pointer; }
.sd-back:hover { color: #4ade80; }

/* Inventory Cards */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
}

.inv-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.03);
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    transition: background 0.15s;
}
.inv-card:hover { background: rgba(34, 197, 94, 0.07); }

.inv-img {
    width: 48px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
}

.inv-img-placeholder {
    width: 48px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4ade80;
    flex-shrink: 0;
}

.inv-info {
    flex: 1;
    min-width: 0;
}

.inv-name {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inv-meta {
    font-size: 0.6875rem;
    color: #555555;
}

.inv-total {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #22c55e;
    flex-shrink: 0;
}

/* Float indicator */
.float-badge {
    display: inline-block;
    padding: 0.0625rem 0.375rem;
    background: rgba(56, 189, 248, 0.12);
    color: #4ade80;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', monospace;
    margin-left: 0.375rem;
    cursor: help;
}

.float-bar {
    position: relative;
    height: 4px;
    margin-top: 0.25rem;
    border-radius: 2px;
    overflow: visible;
    background: linear-gradient(to right,
        #22c55e 0%, #22c55e 7%,
        #84cc16 7%, #84cc16 15%,
        #eab308 15%, #eab308 38%,
        #f97316 38%, #f97316 45%,
        #ef4444 45%, #ef4444 100%
    );
    opacity: 0.7;
}

.float-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 1px;
    transform: translateX(-1px);
    box-shadow: 0 0 4px rgba(226, 232, 240, 0.6);
}

/* Split Layout: Portfolios + Activity sidebar */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 1.5rem;
    align-items: start;
}

.split-main { min-width: 0; overflow: hidden; }

.split-side {
    max-height: 80vh;
    overflow-y: auto;
    position: sticky;
    top: 1rem;
    background: #0d0d0d;
    border: 1px solid #111111;
    border-radius: 10px;
}
.split-side::-webkit-scrollbar { width: 4px; }
.split-side::-webkit-scrollbar-thumb { background: #1a1a1a; border-radius: 2px; }

.activity-feed-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

@media (max-width: 1024px) {
    .split-layout { grid-template-columns: 1fr; }
    .split-side {
        max-height: none;
        position: static;
    }
    .top-split { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
    .top-tiles-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    /* Base */
    .stats, .profile-stats { flex-wrap: wrap; gap: 1rem; }
    .stat-value { font-size: 1.25rem; }
    main { padding: 0.75rem; gap: 1rem; overflow-x: hidden; }
    .card { padding: 0.75rem; overflow: hidden; }

    /* Header */
    header { padding: 0.75rem; }
    header h1 { font-size: 1.2rem; margin-bottom: 0.5rem; }
    .header-links { flex-wrap: wrap; gap: 0.375rem; justify-content: center; }
    .tg-link { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
    .header-row { flex-direction: column; gap: 0.5rem; }
    .label-tabs { flex-wrap: wrap; justify-content: center; }
    .label-tab { min-width: 100px; padding: 0.5rem 0.75rem; }
    .label-tab-value { font-size: 1rem; }

    /* Portfolios */
    .portfolio-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .pcard { padding: 0.75rem; }
    .pcard-value { font-size: 1.2rem; }
    .pcard-name { font-size: 0.75rem; }
    .pcard-bottom { font-size: 0.6rem; flex-wrap: wrap; }

    /* Card header controls */
    .card-header { flex-direction: column; gap: 0.5rem; }
    .header-actions { flex-wrap: wrap; justify-content: center; gap: 0.375rem; }
    .movers-controls { flex-wrap: wrap; justify-content: center; }
    .market-toggle, .roi-toggle, .period-toggle, .price-toggle { flex-wrap: wrap; }
    .market-btn, .roi-btn, .period-btn, .source-btn { font-size: 0.65rem; padding: 0.25rem 0.5rem; }
    .btn-scan { font-size: 0.7rem; padding: 0.375rem 0.75rem; }

    /* Top Items */
    .top-split { grid-template-columns: 1fr; gap: 1rem; }
    .top-tiles-4 { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .donut-card { height: auto; min-height: 320px; flex-direction: column; padding: 0.75rem; gap: 0.5rem; }
    .donut-card canvas { max-width: 100%; height: 200px !important; transform: none !important; }
    .donut-legend { flex-direction: row; flex-wrap: wrap; max-width: 100%; min-width: 0; max-height: none; gap: 0.125rem; justify-content: center; }
    .donut-legend-item { font-size: 0.65rem; padding: 0.2rem 0.375rem; }
    .donut-title { font-size: 0.7rem; }

    /* Tiles */
    .tile { padding: 0.625rem; }
    .tile-img { width: 64px; height: 48px; }
    .tile-name { font-size: 0.65rem; }
    .tile-total { font-size: 0.9rem; }

    /* Movers */
    .movers-grid { grid-template-columns: 1fr; }
    .mover { padding: 0.5rem; overflow: hidden; max-width: 100%; }
    .mover-name { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mover-info { min-width: 0; overflow: hidden; }
    .mover-img { width: 36px; height: 28px; }
    .mover-roi { font-size: 0.75rem; }
    .mover-prices { flex-wrap: wrap; }

    /* Activity */
    .activity-feed { grid-template-columns: 1fr; }
    .activity-summary { font-size: 0.75rem; padding: 0.375rem 0.5rem; }

    /* Grids */
    .inv-grid { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .top-items-tiles { grid-template-columns: repeat(2, 1fr); }

    /* Search */
    .search-bar input { max-width: 100%; font-size: 0.8rem; }
    .search-dropdown { max-width: 95vw; left: 0; transform: none; }

    /* Add profile form */
    .add-form { flex-direction: column; }
    .add-form input { flex: none; }

    /* Profile page */
    .profile-stats { gap: 1rem; }
}

@media (max-width: 480px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    .top-tiles-4 { grid-template-columns: 1fr 1fr; }
    .label-tab { min-width: 80px; }
    .header-links { gap: 0.25rem; }
    .tg-link { font-size: 0.6rem; padding: 0.2rem 0.375rem; }
    .donut-card { height: 240px; }
}
