/* Inventory v2 — clearer chips, sticky detail, modern tokens */

.inventory-page--v2 {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 0 32px;
}

.inv-v2-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.inv-v2-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inv-v2-ava {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--va-border, rgba(255,255,255,.1));
}

.inv-v2-identity .eyebrow {
    margin: 0 0 2px;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    color: var(--va-text-muted, #8b93a7);
    text-transform: uppercase;
}

.inv-v2-identity .page-title {
    margin: 0;
    font-size: 1.45rem;
}

.inv-v2-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inv-v2-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.inv-v2-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.inv-v2-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--va-border, rgba(255,255,255,.1));
    background: color-mix(in srgb, var(--va-bg-elevated, #161b26) 80%, transparent);
    color: var(--va-text, #eef1f6);
    font-size: 0.82rem;
    cursor: pointer;
}

.inv-v2-chip span {
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}

.inv-v2-chip:hover {
    border-color: color-mix(in srgb, var(--va-accent) 45%, transparent);
}

.inv-v2-chip.on {
    border-color: var(--va-accent, #00e5ff);
    background: color-mix(in srgb, var(--va-accent) 16%, transparent);
}

.inv-v2-search {
    flex: 0 1 280px;
}

.inv-v2-search .search-input {
    width: 100%;
}

.inv-v2-panel {
    border: 1px solid var(--va-border, rgba(255,255,255,.08)) !important;
    background: color-mix(in srgb, var(--va-bg-elevated, #161b26) 88%, transparent) !important;
    border-radius: 16px;
    padding: 16px !important;
    overflow: hidden;
    min-width: 0;
}

.inv-v2-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 340px) !important;
    gap: 16px !important;
    align-items: start;
}

.inv-v2-left {
    min-width: 0;
    overflow: hidden;
}

.inv-v2-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important;
    gap: 10px !important;
    align-content: start;
    min-width: 0;
    min-height: 280px;
    max-height: min(62vh, 560px);
    overflow: auto;
    overflow-x: hidden;
    padding: 10px !important;
    border-radius: 12px;
    border: 1px solid var(--va-border, rgba(255,255,255,.08));
    background: color-mix(in srgb, var(--va-bg, #07080c) 78%, transparent);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.inv-v2-grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.inv-v2-grid.inv-v2-grid--cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
}

.inv-v2-grid--cards .inv-v2-card.market-card-v2,
.inv-v2-grid--cards .steam-inv-slot.market-card-v2 {
    width: 100%;
    min-width: 0;
    padding: 0 !important;
    aspect-ratio: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--va-border, rgba(255,255,255,.1));
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    overflow: hidden;
    place-items: unset !important;
}

.inv-v2-grid--cards .inv-v2-card .art,
.inv-v2-grid--cards .inv-v2-card .market-card-preview {
    height: 110px;
    min-height: 110px;
    background-size: cover;
    background-position: center;
    background-color: #12151c;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--va-border, rgba(255,255,255,.08));
}

.inv-v2-grid--cards .inv-v2-card .art > *,
.inv-v2-grid--cards .inv-v2-card .art .vcoin-theme-preview,
.inv-v2-grid--cards .inv-v2-card .art .vcoin-theme-preview--card {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.inv-v2-grid--cards .inv-v2-card .in,
.inv-v2-grid--cards .inv-v2-card .market-card-body {
    padding: 10px 12px 12px !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.inv-v2-grid--cards .inv-v2-card .market-card-title {
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inv-v2-grid--cards .inv-v2-card .market-card-cat {
    font-size: 0.75rem;
}

.inv-v2-grid--cards .inv-v2-card.on {
    border-color: var(--va-accent, #66c0f4) !important;
    box-shadow: 0 0 0 1px var(--va-accent, #66c0f4);
}

/* Equal cards: fixed preview square + one-line name; nothing escapes the cell */
.inv-v2-slot {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px;
    width: 100%;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
    padding: 6px !important;
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--va-bg, #07080c) 70%, transparent) !important;
    overflow: hidden !important;
    box-sizing: border-box;
    place-items: unset !important;
}

.inv-v2-slot .steam-inv-slot-preview {
    position: relative;
    display: block !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto !important;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 8px;
    background: color-mix(in srgb, var(--va-bg-elevated, #12151c) 90%, #000);
    place-items: unset !important;
}

.inv-v2-slot .steam-inv-slot-preview > * {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-sizing: border-box;
}

.inv-v2-slot .steam-inv-slot-preview img {
    object-fit: cover;
}

.inv-v2-slot .inv-fallback,
.inv-v2-slot .inv-cell-fallback,
.inv-v2-slot .inv-gift-card-preview,
.inv-v2-slot .inv-icon-demo,
.inv-v2-slot .inv-theme-swatch {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
}

.inv-v2-slot .inv-theme-swatch {
    background:
        linear-gradient(180deg, var(--tp-nav) 28%, transparent 28%),
        var(--tp-bg);
    border: 1px solid color-mix(in srgb, var(--tp-accent) 45%, transparent);
}

.inv-v2-slot .inv-theme-swatch i {
    display: block;
    width: 42%;
    height: 10px;
    border-radius: 999px;
    background: var(--tp-accent);
}

.inv-v2-slot .inv-icon-demo {
    width: 72% !important;
    height: 72% !important;
    inset: 14% !important;
    background: color-mix(in srgb, var(--va-bg, #0e141b) 90%, #000);
}

/* Compact launcher-theme mock inside grid cells — показываем мини-UI, не только букву */
.inv-v2-slot .vcoin-theme-preview,
.inv-v2-slot .vcoin-theme-preview--rich {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: 0 !important;
}

.inv-v2-slot .vcoin-theme-preview-chrome {
    flex: 1;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column;
}

.inv-v2-slot .vcoin-theme-preview-top {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 6px !important;
    font-size: 0.55rem !important;
}

.inv-v2-slot .vcoin-theme-preview-main {
    display: flex !important;
    flex: 1;
    min-height: 0;
}

.inv-v2-slot .vcoin-theme-preview-rail,
.inv-v2-slot .vcoin-theme-preview-stage,
.inv-v2-slot .vtp-hero,
.inv-v2-slot .vtp-cards,
.inv-v2-slot .vtp-cta,
.inv-v2-slot .vtp-nav-link {
    display: block !important;
}

.inv-v2-slot .vcoin-theme-preview-caption,
.inv-v2-slot .vcoin-theme-preview-avatar,
.inv-v2-slot .vcoin-theme-preview-avatar--ph {
    display: none !important;
}

.inv-v2-slot .vcoin-theme-preview-top {
    padding: 4px 6px !important;
    gap: 4px;
    flex-shrink: 0;
}

.inv-v2-slot .vtp-mark {
    width: 12px;
    height: 12px;
    font-size: 0.55rem;
    border-radius: 3px;
}

.inv-v2-slot .vcoin-theme-preview-main {
    flex: 1;
    min-height: 0;
}

.inv-v2-slot .vcoin-theme-preview-stage {
    padding: 6px !important;
    gap: 4px !important;
}

.inv-v2-slot .vtp-hero {
    flex: 1;
    height: auto !important;
    min-height: 0;
    border-radius: 4px;
}

.inv-v2-slot .vcoin-icon-theme-preview {
    max-width: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.inv-v2-slot .vcoin-icon-theme-preview-wall {
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.inv-v2-slot .vcoin-icon-theme-preview-wall .vcoin-icon-frame-demo:not(.is-on),
.inv-v2-slot .vcoin-icon-theme-preview .vcoin-theme-preview-caption {
    display: none !important;
}

.inv-v2-slot .vcoin-icon-theme-preview-wall .vcoin-icon-frame-demo.is-on,
.inv-v2-slot .vcoin-icon-theme-preview-wall .vcoin-icon-frame-demo:only-child {
    display: flex !important;
    width: 70% !important;
    height: auto !important;
    aspect-ratio: 2 / 3;
    max-height: 78%;
    transform: none !important;
    font-size: 0.65rem;
}

.inv-v2-slot-name {
    flex: 0 0 auto;
    font-size: 0.68rem;
    line-height: 1.2;
    height: 1.2em;
    opacity: 0.75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: left;
}

.inv-v2-detail {
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 14px !important;
    border-radius: 14px;
    border: 1px solid var(--va-border, rgba(255,255,255,.08));
    background: color-mix(in srgb, var(--va-bg, #07080c) 55%, transparent);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.inv-v2-detail::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.inv-v2-preview {
    position: relative;
    border-radius: 12px !important;
    cursor: zoom-in;
    width: 100%;
    max-height: 200px;
    min-height: 120px;
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.inv-v2-preview > * {
    width: 100%;
    max-height: 200px;
    min-height: 0 !important;
}

.inv-v2-preview img {
    width: 100%;
    height: 100%;
    max-height: 200px;
    object-fit: contain;
}

.inv-v2-preview .vcoin-theme-preview--rich {
    min-height: 160px !important;
    max-height: 200px;
}

.inv-v2-preview .vcoin-theme-preview-chrome {
    min-height: 140px !important;
}

.inv-v2-preview .vcoin-theme-preview-caption {
    display: none;
}

.inv-v2-preview .vcoin-icon-theme-preview {
    max-width: 100% !important;
}

.inv-v2-preview .vcoin-icon-theme-preview-wall {
    padding: 10px;
    gap: 8px;
}

.inv-v2-preview .vcoin-icon-theme-preview-wall .vcoin-icon-frame-demo {
    width: 48px;
    height: 68px;
}

.inv-v2-hint {
    font-size: 0.82rem;
    margin: 0 0 4px;
    line-height: 1.4;
}

.inv-v2-pager {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inv-v2-empty {
    grid-column: 1 / -1;
    padding: 24px 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .inv-v2-body {
        grid-template-columns: 1fr !important;
    }
    .inv-v2-detail {
        position: relative;
        top: 0;
        max-height: none;
    }
}

/* Cinema-chat background picker */
.uil-cx-bg {
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--va-border, rgba(255,255,255,.1));
    background: color-mix(in srgb, var(--va-bg-elevated, #161b26) 70%, transparent);
}

.uil-cx-bg-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.uil-cx-bg-desc {
    margin: 0 0 12px;
    font-size: 0.82rem;
}

.uil-cx-bg-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.uil-cx-opt {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--va-border);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
}

.uil-cx-opt.on {
    border-color: var(--va-accent);
    background: color-mix(in srgb, var(--va-accent) 16%, transparent);
}

.uil-cx-bg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.uil-cx-bg-tile {
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    background-color: #12151c;
    cursor: pointer;
    padding: 0;
}

.uil-cx-bg-tile.on {
    border-color: var(--va-accent);
}

.uil-cx-bg-preview {
    margin-top: 12px;
    height: 72px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--va-border);
}


/* —— Responsive —— */
@media (max-width: 639px) {
  .inv-v2-grid--cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
