/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2028;
    --bg-hover: #21262d;
    --bg-modal: #141820;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-glow: rgba(88, 166, 255, 0.15);
    --green: #3fb950;
    --green-bg: rgba(63, 185, 80, 0.12);
    --orange: #d29922;
    --orange-bg: rgba(210, 153, 34, 0.12);
    --red: #f85149;
    --red-bg: rgba(248, 81, 73, 0.12);
    --gray: #6e7681;
    --gray-bg: rgba(110, 118, 129, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== TOP NAV ========== */
.top-nav {
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    align-items: center;
}

.lang-switcher {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.lang-switcher:hover {
    background: var(--bg-hover);
}

/* Web session widget */
#webUserWidget {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}
.nav-logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 0 0 4px;
}
.nav-logout-btn:hover { color: var(--red); }

.nav-user-name-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.nav-user-name-btn:hover { color: var(--text-primary); }

/* Sub info popup */
.sip-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 52px 12px 0;
}
.sip-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-width: 230px;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sip-plan {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.sip-expires {
    font-size: 13px;
    color: var(--text-secondary);
}
.sip-upgrade-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.sip-upgrade-btn:hover { opacity: 0.85; }
.sip-divider {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 2px;
}
.sip-ref-hint {
    font-size: 12px;
    color: var(--text-secondary);
}
.sip-ref-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(63,185,80,0.15);
    border: 1px solid #3fb950;
    border-radius: 8px;
    color: #3fb950;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.sip-ref-btn:hover { background: rgba(63,185,80,0.25); }
.sip-ref-btn:disabled { opacity: 0.6; cursor: default; }
.sip-ref-stats {
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 16px;
}
.sip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.sip-close:hover { color: var(--text-primary); }

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-hover);
    border: 1px solid var(--border);
}

/* ========== STATUS TABS ========== */
.tabs-row {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-left: 12px;
}

.status-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 8px 12px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

/* Tab Info Button */
.tab-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: rgba(56, 132, 244, 0.3);
    touch-action: manipulation;
}

.tab-info-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.tab-info-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
}

.tab-info-btn svg {
    flex-shrink: 0;
}

/* Tab Info Banner */
.tab-info-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(56, 132, 244, 0.06);
    border-bottom: 1px solid rgba(56, 132, 244, 0.15);
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-info-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.tab-info-icon {
    color: #3884f4;
    flex-shrink: 0;
    margin-top: 1px;
}

.tab-info-text {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.tab-info-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tab-info-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.status-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.tab-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.tab-count {
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ========== FILTERS BAR ========== */
.filters-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    padding: 10px 30px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus {
    border-color: var(--accent);
}

.filter-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.price-filter {
    display: flex;
    gap: 4px;
}

.price-input {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.price-input:focus {
    border-color: var(--accent);
}

.price-input::placeholder {
    color: var(--text-muted);
}

.sort-select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.sort-select:focus {
    border-color: var(--accent);
}

.btn-filter {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-filter:hover {
    background: var(--accent-hover);
}

/* ========== ITEMS GRID ========== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* ========== ITEM CARD ========== */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    border-color: rgba(88, 166, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.item-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-hover);
    overflow: hidden;
}

.item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.item-card:hover .item-photo img {
    transform: scale(1.04);
}

.item-photo .no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.3px;
}

.status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.status-badge.active { background: rgba(63,185,80,0.2); color: #3fb950; border: 1px solid rgba(63,185,80,0.35); }
.status-badge.reserved { background: rgba(210,153,34,0.2); color: #d29922; border: 1px solid rgba(210,153,34,0.35); }
.status-badge.deleted { background: rgba(248,81,73,0.2); color: #f85149; border: 1px solid rgba(248,81,73,0.35); }
.status-badge.removed_by_system { background: rgba(163,113,247,0.2); color: #a371f7; border: 1px solid rgba(163,113,247,0.35); }

.photo-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.photo-count svg {
    opacity: 0.7;
}

.status-time {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ========== LEVEL BADGE ========== */
.level-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.level-badge + .level-badge {
    left: 56px;
}
.level-badge.level-1 { background: rgba(63,185,80,0.85); color: #fff; }
.level-badge.level-2 { background: rgba(88,166,255,0.85); color: #fff; }
.level-badge.level-3 { background: rgba(210,153,34,0.85); color: #fff; }
.level-badge.level-4 { background: rgba(248,81,73,0.85); color: #fff; }
.level-badge.level-5 { background: rgba(163,113,247,0.85); color: #fff; }

/* ========== ITEM INFO ========== */
.item-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-title-row {
    margin-bottom: 2px;
}

.item-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.item-category {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.item-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.item-stats-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(48, 54, 61, 0.6);
}

.item-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1;
}

.item-stat svg {
    width: 13px;
    height: 13px;
    opacity: 0.55;
    flex-shrink: 0;
}

.item-stat--star {
    color: #e5a220;
}

.item-stat--star svg {
    opacity: 0.85;
}

.item-stat--date {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

.item-shipping {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: rgba(88, 166, 255, 0.08);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.2);
}

/* ========== LOADING ========== */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading.visible {
    display: block;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-modal);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 1000px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.modal-nav-arrows {
    display: flex;
    gap: 4px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.nav-btn:hover {
    border-color: var(--accent);
}

.modal-nav-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.2s;
}

.btn-action:hover {
    border-color: var(--accent);
}

.btn-download {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(63, 185, 80, 0.3);
}

.btn-download:hover {
    border-color: var(--green);
    background: rgba(63, 185, 80, 0.2);
}

.btn-download-photos {
    background: rgba(56, 132, 244, 0.1);
    color: #3884f4;
    border-color: rgba(56, 132, 244, 0.3);
    cursor: pointer;
}

.btn-download-photos:hover {
    border-color: #3884f4;
    background: rgba(56, 132, 244, 0.2);
}

.btn-download-photos:disabled {
    cursor: wait;
}

.btn-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close:hover {
    border-color: var(--red);
    color: var(--red);
}

.modal-body {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.modal-left {
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.modal-photo {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--bg-hover);
}

.modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-photo-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

/* Seller compact under photo */
.modal-seller-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.seller-compact-info {
    flex: 1;
    min-width: 0;
}
.seller-compact-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-secondary);
}
.seller-compact-sep {
    color: var(--text-muted);
}
.seller-compact-detail {
    white-space: nowrap;
}

/* ========== GALLERY ARROWS ========== */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
    line-height: 1;
}

.gallery-arrow:hover {
    background: rgba(88, 166, 255, 0.8);
}

.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }

/* ========== SPARKLINE ========== */
.sparkline-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.sparkline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sparkline-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sparkline-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.sparkline-section svg {
    display: block;
    width: 100%;
    height: auto;
}

.sparkline-empty {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0;
}

/* ========== MODAL CONTENT (right side) ========== */
.modal-content {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.mc-header {
    margin-bottom: 12px;
}

.modal-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.modal-status-badge.active { background: var(--green-bg); color: var(--green); border: 1px solid rgba(46,204,113,0.3); }
.modal-status-badge.reserved { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(243,156,18,0.3); }
.modal-status-badge.deleted { background: var(--red-bg); color: var(--red); border: 1px solid rgba(231,76,60,0.3); }
.modal-status-badge.removed_by_system { background: rgba(163,113,247,0.12); color: #a371f7; border: 1px solid rgba(163,113,247,0.3); }

.modal-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2px;
}

.modal-category {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Price block */
.mc-price-block {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.mc-price-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}
.modal-price {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Similar items inline with price */
.similar-items-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.similar-chip {
    color: var(--text-secondary);
    font-weight: 500;
}
.similar-chip-sep {
    color: var(--text-muted);
}
.similar-diff {
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.similar-diff.cheaper {
    color: #22c55e;
    background: rgba(34,197,94,0.12);
}
.similar-diff.expensive {
    color: #ef4444;
    background: rgba(239,68,68,0.12);
}
.similar-diff.same {
    color: var(--text-secondary);
    background: rgba(128,128,128,0.1);
}

/* Info strip */
.mc-info-strip {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
}
.mc-info-chip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border-right: 1px solid var(--border);
}
.mc-info-chip:last-child {
    border-right: none;
}
.mc-info-chip svg {
    flex-shrink: 0;
    opacity: 0.5;
}

/* Tooltip for chips with data-tooltip attribute */
.mc-info-chip[data-tooltip] {
    position: relative;
    cursor: default;
}
.mc-info-chip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1c2028;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 11.5px;
    font-weight: 400;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 7px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 100;
    letter-spacing: 0.1px;
}
.mc-info-chip[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border);
    pointer-events: none;
    z-index: 100;
}
/* Last chip — align tooltip to right to avoid overflow */
.mc-info-chip:last-child[data-tooltip]:hover::after {
    left: auto;
    right: 0;
    transform: none;
}
.mc-info-chip:last-child[data-tooltip]:hover::before {
    left: auto;
    right: 16px;
    transform: none;
}
.mc-info-views {
    color: var(--accent);
    font-weight: 700;
}
.mc-info-views svg {
    opacity: 0.8;
}

/* Tools row */
.mc-tools-row {
    display: flex;
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.mc-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.mc-tool-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88, 166, 255, 0.06);
}
.mc-tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.mc-tool-market {
    color: var(--accent);
    border-color: rgba(88, 166, 255, 0.3);
}
.mc-tool-translate {
    color: var(--text-secondary);
}
.mc-tool-translate.translated {
    border-color: var(--green);
    color: var(--green);
}
.mc-tool-wh {
    color: var(--text-secondary);
}

/* Sections */
.mc-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.mc-section:last-child {
    border-bottom: none;
}

/* Description */
.mc-description-section .modal-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-height: 180px;
    overflow-y: auto;
}
.modal-description::-webkit-scrollbar {
    width: 4px;
}
.modal-description::-webkit-scrollbar-track {
    background: transparent;
}
.modal-description::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.seller-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.seller-name-link {
    text-decoration: none;
    color: inherit;
}
.seller-name-link.has-link:hover .seller-name {
    color: var(--accent);
    text-decoration: underline;
}

.seller-name {
    font-size: 14px;
    font-weight: 600;
    transition: color 0.15s;
}

.seller-rating {
    margin-top: 2px;
}

.star {
    font-size: 18px;
    cursor: default;
}
.star-empty {
    color: #484f58;
}
.star-half {
    background: linear-gradient(90deg, #d29922 50%, #484f58 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.star-full {
    color: #d29922;
}

.seller-details {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seller-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.seller-detail-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.seller-detail-label {
    color: var(--text-muted);
    white-space: nowrap;
}

.seller-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.seller-listings-clickable {
    cursor: default;
}

/* ========== SELLER ITEMS CAROUSEL ========== */
.seller-items-section {
    margin-top: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.seller-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.seller-items-header h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
}

.seller-items-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.si-arrow {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}

.si-arrow:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

.si-counter {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
}

.seller-items-viewport {
    overflow: hidden;
}

.seller-items-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seller-items-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 16px 0;
}

.si-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
    overflow: hidden;
}

.si-card:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.05);
}

.si-card-img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-primary);
}

.si-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.si-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-muted);
}

.si-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.si-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.si-card-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.si-card-loc {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.si-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.si-card-time {
    white-space: nowrap;
}

.si-card-visits {
    white-space: nowrap;
}

/* Status badges for seller items */
.si-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
    line-height: 1.4;
}
.si-badge-new {
    background: var(--green);
    color: #000;
}
.si-badge-reserved {
    background: var(--orange);
    color: #000;
}
.si-badge-deleted {
    background: var(--red);
    color: #fff;
}
.si-card-deleted {
    opacity: 0.5;
}
.si-card-reserved {
    opacity: 0.7;
}

/* ========== STATUS TIMELINE ========== */
.timeline-section {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.timeline-section h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.timeline-track {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.timeline-point {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 4px;
}

.timeline-dot-pulse {
    animation: timelinePulse 2s ease-in-out infinite;
}

@keyframes timelinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.timeline-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.timeline-status {
    font-size: 12px;
    font-weight: 600;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-visits {
    font-size: 11px;
    color: var(--text-secondary);
}

.timeline-delta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0 2px 9px;
}

.timeline-delta-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    min-width: 8px;
}

.timeline-delta-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.timeline-loading {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* ========== HISTORY TABLE ========== */
.history-section {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.history-section h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.history-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-secondary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.active { background: var(--green-bg); color: var(--green); }
.history-status.reserved { background: var(--orange-bg); color: var(--orange); }
.history-status.deleted { background: var(--red-bg); color: var(--red); }
.history-status.removed_by_system { background: rgba(163,113,247,0.12); color: #a371f7; }

.views-delta {
    color: var(--green);
    font-weight: 600;
    font-size: 11px;
}

.views-delta.negative {
    color: var(--red);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== RESPONSIVE ========== */

/* ---- Tablets & small screens ---- */
@media (max-width: 768px) {
    /* Top nav offset for sticky tabs */
    .top-nav {
        padding: 8px 12px;
    }
    
    .tabs-row {
        top: 45px;
        padding-left: 8px;
    }

    .status-tabs {
        padding: 8px 6px 8px 4px;
        gap: 3px;
    }
    
    .tab {
        padding: 7px 10px;
        font-size: 12px;
    }

    .tab-info-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }
    .tab-info-btn svg {
        width: 14px;
        height: 14px;
    }
    .tab-info-banner {
        padding: 10px 12px;
    }
    .tab-info-text {
        font-size: 12px;
    }

    /* Filters */
    .filters-bar {
        flex-direction: column;
        padding: 10px 12px;
        gap: 6px;
    }
    
    .search-box {
        width: 100%;
        min-width: 0;
    }
    
    .price-filter {
        width: 100%;
    }
    
    .price-input {
        flex: 1;
        min-width: 0;
    }
    
    .filter-select {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .btn-filter {
        width: 100%;
        padding: 12px 20px;
    }

    /* Items grid */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-price {
        font-size: 18px;
    }

    .item-info {
        padding: 10px 12px 12px;
    }

    /* Fav button always visible on touch */
    .fav-btn {
        opacity: 1;
        transform: scale(1);
    }

    /* Gallery arrows always visible */
    .gallery-arrow {
        display: flex;
    }

    /* Modal fullscreen on mobile */
    .modal-overlay {
        padding: 0;
    }

    .modal {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        max-height: none;
        overflow-y: visible;
    }
    
    .modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .modal-content {
        padding: 16px 12px;
        max-height: none;
    }

    /* Modal nav: single compact toolbar */
    .modal-nav {
        padding: 6px 8px;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .modal-nav-arrows {
        flex-shrink: 0;
        gap: 4px;
    }

    .modal-nav-arrows .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .modal-nav-actions {
        flex: 1;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 4px;
    }

    /* All action buttons: uniform square icon-only */
    .btn-action {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        font-size: 0;
        gap: 0;
        flex-shrink: 0;
        justify-content: center;
    }

    .btn-action span,
    .btn-action .fav-btn-text,
    .btn-action .dl-photos-text {
        display: none;
    }

    .btn-action svg {
        width: 18px;
        height: 18px;
    }

    .btn-close {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    /* Modal content */
    .modal-title {
        font-size: 17px;
    }
    
    .modal-price {
        font-size: 24px;
    }
    
    .mc-info-strip {
        flex-wrap: wrap;
    }
    .mc-info-chip {
        flex: none;
        width: 50%;
    }
    .mc-info-chip:nth-child(2) {
        border-right: none;
    }
    
    .mc-tools-row {
        flex-wrap: wrap;
    }

    .modal-description {
        max-height: 200px;
    }

    /* Timeline */
    .timeline-section {
        padding: 12px;
    }

    /* Seller items */
    .seller-items-section {
        margin-top: 10px;
    }

    /* Grabber modal */
    .grabber-modal {
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
    }

    .grabber-header {
        padding: 16px;
    }

    .grabber-body {
        padding: 16px;
    }
}

/* ---- Phones ---- */
@media (max-width: 480px) {
    .top-nav {
        padding: 6px 10px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .tabs-row {
        top: 39px;
        padding-left: 6px;
    }

    .status-tabs {
        padding: 6px 4px 6px 2px;
        gap: 2px;
    }
    
    .tab {
        padding: 6px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .tab-count {
        padding: 1px 6px;
        font-size: 10px;
    }

    .tab-info-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    .tab-info-btn svg {
        width: 13px;
        height: 13px;
    }
    .tab-info-banner {
        padding: 8px 10px;
    }
    .tab-info-text {
        font-size: 11px;
    }

    .payment-sub-filters {
        padding: 8px 10px;
        gap: 6px;
    }
    .payment-filter-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    .origin-filters {
        padding: 6px 10px;
        gap: 6px;
    }
    .origin-filter-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .tab-icon {
        width: 12px;
        height: 12px;
    }

    /* Grabber button compact */
    .tab-grabber {
        padding: 6px 8px;
        font-size: 11px;
    }

    .tab-grabber svg {
        width: 12px;
        height: 12px;
    }

    /* Grid: 2 columns */
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px;
    }
    
    .item-info {
        padding: 8px 10px 10px;
    }

    .item-name {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }

    .item-price {
        font-size: 17px;
    }

    .item-stat {
        font-size: 10px;
    }

    .item-stat--date {
        font-size: 9.5px;
    }

    .item-category {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .item-stats-row {
        gap: 8px;
        padding-top: 6px;
    }

    .status-badge {
        font-size: 8px;
        padding: 3px 6px;
    }

    .photo-count {
        font-size: 10px;
        padding: 2px 6px;
    }

    .level-badge {
        font-size: 8px;
        padding: 2px 6px;
    }

    /* Modal */
    .modal-nav-arrows .nav-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .btn-action {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .btn-close {
        width: 34px;
        height: 34px;
    }



    .modal-title {
        font-size: 15px;
    }

    .modal-price {
        font-size: 22px;
    }

    /* Seller card */
    .seller-card {
        padding: 10px;
    }

    .seller-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .seller-name {
        font-size: 13px;
    }

    /* Filters */
    .search-box input {
        padding: 8px 10px 8px 34px;
        font-size: 14px; /* prevent iOS zoom */
    }

    .price-input {
        padding: 8px 10px;
        font-size: 14px; /* prevent iOS zoom */
    }

    .grabber-input {
        font-size: 14px; /* prevent iOS zoom */
    }
}

/* ---- Touch device overrides ---- */
@media (hover: none) and (pointer: coarse) {
    /* Always show fav button (no hover on touch) */
    .fav-btn {
        opacity: 1;
        transform: scale(1);
    }
    
    /* Always show gallery arrows */
    .gallery-arrow {
        display: flex;
    }

    /* Larger touch targets */
    .tab {
        min-height: 36px;
    }

    .nav-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .btn-action {
        min-height: 40px;
    }

    .btn-close {
        min-width: 40px;
        min-height: 40px;
    }

    /* Disable hover transforms on cards */
    .item-card:hover {
        transform: none;
    }

    .item-card:hover .item-photo img {
        transform: none;
    }
}

/* ========== FAVORITES ========== */

/* Star button on card */
.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    opacity: 0;
    transform: scale(0.85);
}

.fav-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: all 0.25s ease;
}

.item-card:hover .fav-btn {
    opacity: 1;
    transform: scale(1);
}

.fav-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    color: #f5c842;
}

.fav-btn.active {
    opacity: 1;
    transform: scale(1);
    color: #f5c842;
}

.fav-btn.active svg {
    fill: #f5c842;
    stroke: #f5c842;
}

/* Favorites tab star icon */
.tab-star-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.tab-favorites {
    gap: 5px;
}

.tab-favorites.active .tab-star-icon {
    fill: var(--text-primary);
    color: var(--text-primary);
}

/* Payment tab */
.tab-payment {
    gap: 5px;
}

.tab-payment.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.tab-payment.active svg {
    stroke: var(--text-primary);
}

/* Payment sub-filters */
.payment-sub-filters {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.payment-filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(56, 132, 244, 0.3);
    touch-action: manipulation;
}

.payment-filter-btn:hover {
    border-color: #3884f4;
    color: #3884f4;
}

.payment-filter-btn.active {
    background: rgba(56, 132, 244, 0.15);
    border-color: #3884f4;
    color: #3884f4;
}

/* Origin filter (платформа публикации) */
.origin-filters {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.origin-filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(63, 185, 80, 0.3);
    touch-action: manipulation;
}

.origin-filter-btn:hover {
    border-color: #3fb950;
    color: #3fb950;
}

.origin-filter-btn.active {
    background: rgba(63, 185, 80, 0.15);
    border-color: #3fb950;
    color: #3fb950;
}

/* Trial banner */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(63, 185, 80, 0.12);
    border-bottom: 1px solid rgba(63, 185, 80, 0.3);
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
}
.trial-banner-link {
    color: #3fb950;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}
.trial-banner-link:hover { text-decoration: underline; }

/* Paywall referral section */
.pw-referral-section {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(63, 185, 80, 0.07);
    border: 1px solid rgba(63, 185, 80, 0.25);
    border-radius: 10px;
    text-align: center;
}
.pw-referral-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.pw-referral-btn {
    width: 100%;
    padding: 9px 14px;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid #3fb950;
    border-radius: 8px;
    color: #3fb950;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.pw-referral-btn:hover {
    background: rgba(63, 185, 80, 0.25);
}
.pw-referral-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Modal favorite button */
.btn-fav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-fav svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    flex-shrink: 0;
    transition: all 0.25s;
}

.btn-fav:hover {
    border-color: #f5c842;
    color: #f5c842;
}

.btn-fav.active {
    border-color: #f5c842;
    color: #f5c842;
    background: rgba(245, 200, 66, 0.08);
}

.btn-fav.active svg {
    fill: #f5c842;
    stroke: #f5c842;
}

/* Share button */
.btn-share {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-share:hover {
    background: rgba(88, 166, 255, 0.1);
}

/* Share toast */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--green);
    color: #000;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10000;
}
.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== GRABBER TAB BUTTON ========== */
.tab-grabber {
    margin-left: auto;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
}
.tab-grabber:hover {
    background: rgba(88, 166, 255, 0.2);
}
.tab-grabber svg {
    flex-shrink: 0;
}

/* Grabber button in modal */
.btn-grabber-modal {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-grabber-modal:hover {
    background: rgba(88, 166, 255, 0.12);
}

/* ========== GRABBER MODAL ========== */
.grabber-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.grabber-overlay.active {
    display: flex;
}
.grabber-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
.grabber-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.grabber-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.grabber-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.grabber-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}
.grabber-site-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.grabber-site-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.grabber-site-btn:hover {
    border-color: var(--accent);
}
.grabber-site-btn.active {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.12);
    color: var(--accent);
}
.grabber-input-area {
    display: flex;
    flex-direction: column;
}
.grabber-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.grabber-input:focus {
    border-color: var(--accent);
}
.grabber-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}
.grabber-submit {
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s;
}
.grabber-submit:hover {
    opacity: 0.85;
}
.grabber-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.grabber-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(88, 166, 255, 0.08);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent);
}
.grabber-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(88, 166, 255, 0.3);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: grabberSpin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes grabberSpin {
    to { transform: rotate(360deg); }
}
.grabber-success {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: 10px;
}
.grabber-success-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.grabber-success-info {
    flex: 1;
    min-width: 0;
}
.grabber-success-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grabber-success-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.grabber-download-btn {
    padding: 8px 16px;
    background: var(--green);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.grabber-download-btn:hover {
    opacity: 0.85;
}
.grabber-error {
    padding: 14px 16px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 10px;
    color: var(--red);
    font-size: 13px;
}

/* ========== WILLHABEN PHOTO SEARCH ========== */
.wh-search-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.wh-query-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-style: italic;
}
.wh-query-label:empty {
    display: none;
}
.wh-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wh-result-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wh-result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.wh-result-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    background: rgba(88, 166, 255, 0.06);
}
.wh-result-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background);
}
.wh-result-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wh-result-preview .wh-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-muted);
}
.wh-result-info {
    flex: 1;
    min-width: 0;
}
.wh-result-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.wh-result-meta {
    font-size: 11px;
    color: var(--text-muted);
}
.wh-result-meta .wh-photo-count {
    font-weight: 600;
    color: var(--accent);
}
.wh-result-price {
    margin-left: 8px;
    font-weight: 600;
    color: var(--green);
}
.wh-result-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.wh-dl-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 7px;
    border: none;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
}
.wh-dl-btn:hover {
    opacity: 0.85;
}
.wh-dl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.wh-more-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.wh-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.wh-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}
.wh-loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ========== MARKET ANALYSIS ========== */
.market-analysis-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 0;
}

.ma-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.ma-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.ma-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ma-refresh-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 2px 7px;
    transition: all 0.2s;
    line-height: 1;
}
.ma-refresh-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.ma-query {
    font-size: 10px;
    color: var(--text-muted);
}

.ma-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.ma-stat {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}
.ma-stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}
.ma-stat-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.ma-cheaper {
    color: #4caf50 !important;
}
.ma-expensive {
    color: #f44336 !important;
}
.ma-same {
    color: var(--accent) !important;
}

.ma-items-toggle {
    margin-top: 10px;
}
.ma-items-toggle-btn {
    width: 100%;
    padding: 5px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ma-items-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.ma-items-list {
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
}
.ma-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.ma-item-row:last-child {
    border-bottom: none;
}
.ma-item-title {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ma-item-price {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}
.ma-item-views {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}
.ma-item-watchlist {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
}

/* ========== PAYWALL ========== */
.paywall-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
}
.paywall-modal {
    background: var(--bg-card, #1a1f2e);
    border: 1px solid var(--border, #2a3040);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
}
.paywall-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.paywall-modal h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary, #e4e8f1);
}
.paywall-modal p {
    color: var(--text-muted, #8b95a8);
    font-size: 14px;
    margin-bottom: 4px;
}
.paywall-features {
    text-align: left;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    margin-top: 12px;
    font-size: 13px;
}
.paywall-features div {
    padding: 3px 0;
    color: var(--text-secondary, #b0b8c8);
}
.paywall-close {
    margin-top: 16px;
    background: var(--accent, #5b6ef5);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.paywall-close:hover {
    opacity: 0.9;
}
.paywall-login-btn {
    display: block;
    margin-top: 14px;
    background: #2da4e0;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    width: 100%;
}
.paywall-login-btn:hover { background: #1e90d0; }
.paywall-login-btn:disabled { background: #1d4a65; cursor: default; }
.pw-btn-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
}
.pw-btn-row .paywall-login-btn,
.pw-btn-row .paywall-close {
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
}
.paywall-bot-btn {
    display: block;
    margin-top: 12px;
    background: #2da4e0;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}
.paywall-bot-btn:hover { background: #1e90d0; }
.pw-code-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #0d1117;
    border: 1px dashed #30363d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.pw-code-text {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #58a6ff;
}
.pw-copy-btn {
    background: none;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    padding: 3px 7px;
    font-size: 13px;
}
.pw-copy-btn:hover { color: #e6edf3; }
.pw-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== SPOILER (BLUR) FOR FREE USERS ========== */
.item-card.spoiler .item-photo img,
.item-card.spoiler .item-photo .no-photo {
    filter: blur(20px);
    -webkit-filter: blur(20px);
    transform: scale(1.1);
    pointer-events: none;
}
.item-card.spoiler .item-info {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    pointer-events: none;
    user-select: none;
}
.item-card.spoiler:hover {
    transform: none;
    box-shadow: none;
}
.item-card.spoiler:hover .item-photo img {
    transform: scale(1.1);
}
.item-card.spoiler .spoiler-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: rgba(0,0,0,0.35);
    border-radius: var(--radius);
    pointer-events: none;
}
.spoiler-overlay .spoiler-icon {
    font-size: 36px;
    margin-bottom: 6px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.spoiler-overlay .spoiler-text {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
    padding: 4px 14px;
    background: rgba(91,110,245,0.6);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
