@layer skinboost-fixes {
 #upgradeView [data-source-tab=owned]::after {content:"Инвентарь"!important}
 #profileView #opening-history,#profileView .profile-inventory-shell,
 #upgradeView #ownedPanel .skin-card,#profileView #profileItems .skin-card {border:0!important;box-shadow:none!important}

 #upgradeView .source-column {
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important;align-content:start!important;
 }
 #upgradeView .source-column>.source-tabs {grid-column:1!important;grid-row:1!important}
 #upgradeView .source-column>#ownedPanel,#upgradeView .source-column>#shopPanel {
  grid-column:1!important;grid-row:2!important;display:block!important;align-self:stretch!important;min-width:0!important;
  visibility:hidden;opacity:0!important;pointer-events:none;transition:none!important;
 }
 #upgradeView .source-column>#ownedPanel.active,#upgradeView .source-column>#shopPanel.active {visibility:visible;opacity:1!important;pointer-events:auto}
 #upgradeView .source-column>.source-panel:not(.active) * {visibility:hidden!important}
 #upgradeView #ownedPanel #ownedGrid.is-owned-empty {
  display:block!important;height:100%!important;min-height:0!important;max-height:none!important;
  overflow:hidden!important;padding:0!important;grid-template-rows:none!important;
 }
 #upgradeView #ownedPanel #ownedGrid>.owned-auth-panel,
 #upgradeView #ownedPanel #ownedGrid>.owned-empty-pay {
  position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;
  width:100%!important;height:100%!important;min-height:100%!important;max-height:none!important;
  margin:0!important;padding:0!important;border-radius:18px;overflow:hidden!important;isolation:isolate;
 }
 #upgradeView #ownedPanel #ownedGrid .empty-blur-grid {
  position:absolute!important;inset:0!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
  grid-template-rows:repeat(4,minmax(0,1fr))!important;gap:10px!important;padding:8px!important;
  filter:blur(6px)!important;opacity:.45!important;transform:scale(1.025)!important;pointer-events:none;
 }
 #upgradeView #ownedPanel #ownedGrid .empty-blur-grid>span {display:grid;place-items:center;min-width:0;min-height:0;border:1px solid #799d7c38;border-radius:12px;background:#26302a99}
 #upgradeView #ownedPanel #ownedGrid .empty-blur-grid img {width:90%;height:80px;object-fit:contain}
 #upgradeView #ownedPanel #ownedGrid .owned-empty-pay-card {
  position:relative!important;inset:auto!important;transform:none!important;z-index:2!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  gap:12px!important;max-width:90%;padding:28px!important;border-radius:28px!important;background:#0b1410db;text-align:center;font:inherit!important;
 }
 #upgradeView #ownedPanel #ownedGrid .owned-empty-pay-card b {font:600 20px/1.3 Inter,Arial,sans-serif!important;letter-spacing:-.3px;color:#eef8f2;margin:0!important;text-align:center!important}
 #upgradeView #ownedPanel #ownedGrid .owned-empty-pay-card small {color:#a3b7ab;font:400 12px/1.5 Inter,Arial,sans-serif!important;margin:0!important;text-align:center!important}
 #upgradeView #ownedPanel #ownedGrid .owned-empty-pay-card {width:calc(100% - 32px)!important;max-width:320px!important;border:0!important;box-shadow:none!important}
 #upgradeView #ownedPanel #ownedGrid .owned-auth-button {display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:10px!important;width:auto!important;max-width:100%!important;min-width:0!important;padding:12px 18px!important;margin:8px 0 0!important;white-space:nowrap!important;font:600 13px/1.3 Inter,Arial,sans-serif!important;border-radius:16px!important}
 #upgradeView #ownedPanel #ownedGrid .owned-auth-button .steam-mark {position:static!important;display:block!important;width:22px!important;height:22px!important;transform:none!important;margin:0!important;flex:0 0 22px!important}
 #upgradeView #ownedPanel #ownedGrid .owned-auth-button img {width:22px!important;height:22px!important}
 @media(max-width:700px) {
 #upgradeView .source-column .source-tabs {position:relative!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;height:auto!important;min-height:0!important;padding:8px!important}
 #upgradeView .source-column [data-source-tab=owned] {grid-column:1!important;min-width:0!important;width:auto!important}
 #upgradeView .source-column [data-source-tab=shop] {grid-column:2!important;min-width:0!important;width:auto!important}
 #upgradeView .source-column .source-filter {grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 42px!important;gap:8px!important;margin:0!important;width:auto!important;min-width:0!important;padding:0!important}
 #upgradeView .source-column .source-tabs:has([data-source-tab=shop].active) .source-filter {grid-column:1/-1!important;margin-right:50px!important}
 #upgradeView .source-column #cartButton {position:absolute!important;right:8px!important;bottom:8px!important;width:42px!important;height:42px!important;margin:0!important}
 #upgradeView .source-column .price-caption {display:none!important}
 #upgradeView .source-column #shopMin,#upgradeView .source-column #shopMax {width:100%!important;min-width:0!important;max-width:none!important;height:42px!important;margin:0!important;box-sizing:border-box!important}
 #upgradeView .source-column #shopSearchWrap {width:42px!important;min-width:0!important;height:42px!important;margin:0!important}
 #upgradeView .source-column #shopFilterBtn {width:42px!important;height:42px!important;min-width:42px!important;padding:0!important}
 #upgradeView .source-column .source-tabs.shop-search-open .source-filter {grid-template-columns:1fr!important}
 #upgradeView .source-column .source-tabs.shop-search-open #shopMin,#upgradeView .source-column .source-tabs.shop-search-open #shopMax {display:none!important}
 #upgradeView .source-column .source-tabs.shop-search-open #shopSearchWrap {grid-column:1/-1!important;width:100%!important}
 #upgradeView .source-column .source-tabs.shop-search-open #shopSearch {width:100%!important;min-width:0!important;flex:1!important}
 #upgradeView .target-column .target-toolbar {display:flex!important;gap:8px!important}
 #upgradeView .target-column #targetMin,#upgradeView .target-column #targetMax {flex:1 1 0!important;min-width:0!important;width:0!important;max-width:none!important}
 #upgradeView .target-column .target-title {flex:1 1 auto!important;min-width:0!important}
 #upgradeView .target-column .price-caption {display:none!important}
 #upgradeView .target-column #targetSearchWrap,#upgradeView .target-column #targetSortToggle {flex:0 0 42px!important;width:42px!important;min-width:42px!important}
 #upgradeView .target-column #targetFilterBtn {display:none!important}
 #upgradeView .target-column .target-toolbar.search-open #targetSearchWrap {flex:1 1 auto!important;width:auto!important}
 }
 .topbar .game-navigation .game-link svg {width:29px!important;height:29px!important}
 @media(max-width:700px) {
  .topbar .game-navigation .game-link svg {width:27px!important;height:27px!important}
  #upgradeView #ownedPanel #ownedGrid .empty-blur-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(5,minmax(0,1fr))!important}
  #upgradeView #ownedPanel #ownedGrid .empty-blur-grid>span:nth-child(n+16) {display:none!important}
  #upgradeView .target-column .target-title {display:none!important}
 }
}

@layer skinboost-fixes {
 @media(max-width:700px){
  #upgradeView .upgrade-stage{gap:8px!important}
  #upgradeView .target-chance-controls,#upgradeView .mobile-catalog-tabs{display:grid!important;box-sizing:border-box!important;height:56px!important;min-height:56px!important;padding:6px!important;gap:6px!important;border:0!important;border-radius:20px!important;margin:0!important;align-items:stretch!important}
  #upgradeView .target-chance-controls{grid-template-columns:repeat(7,minmax(0,1fr))!important}
  #upgradeView .mobile-catalog-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #upgradeView .target-chance-controls>button,#upgradeView .mobile-catalog-tabs>button{display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;line-height:1!important;border-radius:14px!important}
  #upgradeView .target-chance-controls .chance-settings>span,#upgradeView .target-chance-controls svg{display:block!important;margin:0!important;width:20px!important;height:20px!important}
  #upgradeView .upgrade-stage>.source-column,#upgradeView .upgrade-stage>.target-column{padding:0!important;border-radius:20px!important}
  #upgradeView .source-column>.source-tabs,#upgradeView .target-column>.target-toolbar{padding:6px!important;gap:6px!important;border-radius:20px!important}
  #upgradeView .source-column .source-tabs:has([data-source-tab=owned].active) .source-filter{display:none!important}
  #upgradeView .source-column .source-tabs>button[data-source-tab]{height:44px!important;min-height:44px!important;border-radius:14px!important;margin:0!important}
  #upgradeView .source-column #cartButton{right:6px!important;bottom:6px!important}
  #upgradeView .source-column .source-tabs:has([data-source-tab=shop].active) .source-filter{margin-right:48px!important;gap:6px!important}
 }
}

@layer skinboost-fixes {
 @media(max-width:700px){
  #upgradeView .upgrade-stage>.selection-column.source-column,#upgradeView .upgrade-stage>.selection-column.target-column{margin:0!important}
  #upgradeView .target-chance-controls>button,#upgradeView .target-chance-controls>button.chance,#upgradeView .target-chance-controls>#settingsBtn{grid-area:auto!important;max-width:none!important;width:100%!important;align-self:stretch!important;justify-self:stretch!important}
 }
}

@layer skinboost-fixes {
 @media(max-width:700px){
  #upgradeView .source-column .source-tabs:has([data-source-tab=shop].active) .source-filter{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px!important;margin-right:50px!important}
  #upgradeView .source-column #shopMin,#upgradeView .source-column #shopMax{height:44px!important;min-height:44px!important}
  #upgradeView .source-column #shopSearchWrap,#upgradeView .source-column #shopFilterBtn,#upgradeView .source-column #cartButton{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
  #upgradeView .source-column .source-tabs.shop-search-open .source-filter{grid-template-columns:1fr!important}
  #upgradeView .source-column .source-tabs.shop-search-open #shopSearchWrap{width:100%!important}
 }
}

@layer skinboost-fixes {
 @media(max-width:700px){
  #upgradeView .source-column .source-tabs:has([data-source-tab=owned].active){grid-template-rows:44px!important;height:56px!important;min-height:56px!important}
  #upgradeView .source-column .source-tabs:has([data-source-tab=owned].active) #cartButton{display:none!important}
 }
}
@layer skinboost-fixes {
 #upgradeView .source-column>#ownedPanel,#upgradeView .source-column>#shopPanel{display:flex!important;flex-direction:column!important;min-height:0!important}
 #upgradeView #ownedPanel>.owned-pager{margin-top:auto!important;padding-top:16px!important;padding-bottom:16px!important;flex-shrink:0!important;justify-content:center!important}
 #upgradeView #ownedPanel>#ownedGrid:not(.is-owned-empty){flex:0 0 auto!important}
 #upgradeView #ownedPanel>#ownedGrid.is-owned-empty{flex:1 1 auto!important;height:auto!important}
}
@layer skinboost-fixes {
 #upgradeView #ownedPanel:has(#ownedGrid>.skin-card)>.owned-pager{display:flex!important}
}

/* Keep the mobile catalog switch above the shared source-panel layout. */
@layer skinboost-fixes {
 @media(max-width:850px) {
  #upgradeView .upgrade-stage[data-mobile-catalog-view="target"]>.source-column,
  #upgradeView .upgrade-stage[data-mobile-catalog-view="source"]>.target-column {display:none!important}
 }
}

@layer skinboost-fixes {
 @media(min-width:701px){
  html body #upgradeView .source-column:has(#ownedGrid.is-owned-empty){align-self:stretch!important;height:auto!important;max-height:none!important}
  html body #upgradeView .source-column #ownedPanel:has(#ownedGrid.is-owned-empty){height:auto!important;min-height:0!important;max-height:none!important}
  html body #upgradeView #ownedPanel #ownedGrid.is-owned-empty{height:100%!important;min-height:0!important;max-height:none!important}
  html body #upgradeView #ownedPanel #ownedGrid.is-owned-empty>.owned-empty-pay,
  html body #upgradeView #ownedPanel #ownedGrid.is-owned-empty>.owned-auth-panel{height:100%!important;min-height:100%!important}
 }
}

/* A single stable grid for empty, selected and result previews. */
@layer skinboost-fixes {
 html body #upgradeView #ownedPanel #ownedGrid .empty-blur-grid {height:100%!important;max-height:none!important;mask-image:none!important;-webkit-mask-image:none!important}
 html body #upgradeView #ownedPanel #ownedGrid .empty-blur-grid img {height:100%!important;max-height:100%!important;width:90%!important;object-fit:contain!important}
 @media(max-width:850px) {
  html body #upgradeView .upgrade-stage {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:auto!important;grid-auto-rows:auto!important;gap:10px!important}
  html body #upgradeView .upgrade-stage>.wheel-column {display:contents!important}
  html body #upgradeView .upgrade-stage .wheel-wrap {grid-area:1/1/2/3!important;justify-self:center!important;margin:0!important}
  html body #upgradeView #sourcePreview {grid-area:2/1/3/2!important}
  html body #upgradeView #targetPreview {grid-area:2/2/3/3!important}
  html body #upgradeView .upgrade-stage #upgradeBtn {grid-area:3/1/4/3!important;width:100%!important;margin:0!important}
  html body #upgradeView .upgrade-stage>.balance-stake {grid-area:4/1/5/3!important}
  html body #upgradeView .upgrade-stage>.target-chance-controls {grid-area:5/1/6/3!important}
  html body #upgradeView .upgrade-stage>.mobile-catalog-tabs {grid-area:6/1/7/3!important}
  html body #upgradeView .upgrade-stage>.selection-column {grid-area:7/1/8/3!important;width:100%!important;min-width:0!important}
  html body #upgradeView .upgrade-stage>.upgrade-preview {position:relative!important;width:100%!important;max-width:none!important;min-width:0!important;height:clamp(132px,36vw,170px)!important;min-height:clamp(132px,36vw,170px)!important;max-height:clamp(132px,36vw,170px)!important;padding:0!important;margin:0!important;box-sizing:border-box!important;overflow:hidden!important;align-self:stretch!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .preview-skin.visible {position:absolute!important;inset:10px!important;display:grid!important;grid-template: minmax(0,1fr)/minmax(0,1fr)!important;width:auto!important;height:auto!important;min-height:0!important;padding:0!important;margin:0!important;gap:0!important;align-items:stretch!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .preview-name-block,
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .preview-selected-price,
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-total,
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card>em,
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card>b,
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card>span {display:none!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .preview-real-art {grid-area:1/1!important;width:100%!important;height:100%!important;min-height:0!important;margin:0!important;display:grid!important;place-items:center!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .preview-real-art img {width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;transform:none!important}
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack {width:100%!important;height:100%!important;min-height:0!important;display:block!important;padding:0!important}
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-grid {display:grid!important;height:100%!important;min-height:0!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr)!important;align-content:stretch!important;gap:5px!important}
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card {width:100%!important;max-width:none!important;min-width:0!important;height:100%!important;max-height:none!important;min-height:0!important;aspect-ratio:auto!important;box-sizing:border-box!important;grid-area:auto!important;padding:3px!important;border-radius:9px!important}
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card>div {position:relative!important;inset:auto!important;width:100%!important;height:100%!important;min-height:0!important}
  html body #upgradeView #sourcePreview #sourcePreviewSkin .source-stack-card .skin-image {position:static!important;inset:auto!important;margin:0!important;height:100%!important;width:100%!important;max-height:100%!important;object-fit:contain!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .cashback-final {max-width:100%!important;width:100%!important;padding:0!important;box-sizing:border-box!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .cashback-final>b {font-size:14px!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .cashback-final>strong {font-size:clamp(16px,5vw,22px)!important;gap:5px!important;padding:0!important}
  html body #upgradeView .upgrade-preview:is(#sourcePreview,#targetPreview) .cashback-final-icon {width:24px!important;height:24px!important;flex-basis:24px!important}
 }
}

@layer skinboost-fixes {
 @media(max-width:850px) {
  html body #upgradeView .source-column {height:auto!important;grid-template-rows:auto minmax(0,1fr)!important;row-gap:0!important}
  html body #upgradeView #shopPanel>#shopGrid {height:auto!important;max-height:none!important;flex:0 0 auto!important}
  html body #upgradeView #shopPanel>#shopFooter {flex:0 0 auto!important}
  html body #upgradeView #ownedPanel #ownedGrid.is-owned-empty {height:100%!important;min-height:0!important;max-height:none!important}
 }
}

/* Checkout stays inside the footer, with the count attached to the cart. */
@layer skinboost-fixes {
 html body #upgradeView #shopFooter .shop-buy-actions {display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;max-width:100%!important}
 html body #upgradeView #shopFooter #shopCheckout {display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-width:0!important;max-width:100%!important;min-height:44px!important;padding:10px 14px!important;overflow:visible!important}
 html body #upgradeView #shopCheckout #checkoutCurrency {position:static!important;display:block!important;width:24px!important;height:24px!important;min-width:24px!important;flex:0 0 24px!important;margin:0!important}
 html body #upgradeView #shopCheckout #checkoutTotal {position:static!important;font-size:15px!important;line-height:1.2!important;white-space:nowrap!important;margin:0!important}
 html body #upgradeView #shopCheckout [data-icon=cart] {position:static!important;display:flex!important;align-items:center!important;width:22px!important;height:22px!important;flex:0 0 22px!important;margin:0!important;color:#05281e!important;visibility:visible!important;opacity:1!important}
 html body #upgradeView #shopCheckout [data-icon=cart] svg {display:block!important;width:22px!important;height:22px!important;color:#05281e!important;stroke:#05281e!important}
 html body #upgradeView #shopCheckout #checkoutCount {position:static!important;transform:none!important;display:grid!important;place-items:center!important;flex:0 0 auto!important;min-width:20px!important;height:20px!important;padding:0 4px!important;border:0!important;border-radius:7px!important;font-size:11px!important;line-height:1!important;margin:0!important;background:#073c2c!important;color:#59ffd3!important}
 @media(max-width:700px){
  html body #upgradeView #shopFooter .shop-buy-actions {width:100%!important}
  html body #upgradeView #shopFooter #shopCheckout {flex:1 1 auto!important;width:auto!important}
  html body #upgradeView #shopFooter #shopClear {width:44px!important;height:44px!important;min-width:44px!important;flex:0 0 44px!important;margin:0!important;padding:10px!important}
 }
}
