@layer novaRefinement {
  /* Keep price, input and payment surfaces tied to the artwork palette. */
  html.nvx-item-page #nvxItemMain .nvx-checkout-card {
    padding: 24px !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, rgba(var(--brand-accent-rgb), .15), rgba(var(--brand-accent-rgb), .035)), var(--portal-bg) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #nvxItemMain .nvx-checkout-card h4 { margin-bottom: 12px !important; font-size: 22px !important; line-height: 1.45 !important; text-wrap: pretty; }
  #nvxItemMain .nvx-checkout-card > .d-flex { flex-wrap: wrap; gap: 6px !important; }
  #nvxItemMain .nvx-checkout-card form { gap: 18px !important; }
  #nvxItemMain .nvx-checkout-card .form-label { display: block; margin-bottom: 7px !important; font-size: 13px !important; color: rgb(var(--brand-secondary-rgb)) !important; }
  #nvxItemMain .nvx-checkout-card .form-control { min-width: 0; height: 46px; border-radius: 10px !important; border-color: rgba(var(--brand-secondary-rgb), .23) !important; background: rgba(0,0,0,.22) !important; }
  #nvxItemMain .nvx-checkout-card .abacus { margin: 16px 0 20px !important; padding: 14px 16px !important; border-radius: 12px !important; border: 1px solid rgba(var(--brand-accent-rgb), .3) !important; }
  #nvxItemMain .nvx-checkout-card .buy-divider { display: none; }
  #nvxItemMain .nvx-checkout-card .qty-group {
    display: inline-grid !important; grid-template-columns: 44px 64px 44px !important;
    flex-wrap: nowrap !important; width: 154px !important; height: 46px !important;
    padding: 0 !important; gap: 0 !important; border-radius: 10px !important;
    border: 1px solid rgba(var(--brand-secondary-rgb), .25) !important; background: rgba(0,0,0,.18) !important;
  }
  #nvxItemMain .nvx-checkout-card .qty-group > * { width: 100% !important; min-width: 0 !important; max-width: none !important; height: 44px !important; min-height: 44px !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  #nvxItemMain .nvx-checkout-card .qty-group button { display: grid !important; place-items: center; background: rgba(var(--brand-accent-rgb), .1) !important; font-size: 18px !important; font-weight: 500 !important; }
  #nvxItemMain .nvx-checkout-card .qty-group button:hover { background: rgba(var(--brand-accent-rgb), .25) !important; }
  #nvxItemMain .nvx-checkout-card .qty-group button:active { background: rgba(var(--brand-accent-rgb), .35) !important; }
  #nvxItemMain .nvx-checkout-card .qty-group input { appearance: textfield; -moz-appearance: textfield; font-size: 16px !important; background: transparent !important; }
  #nvxItemMain .qty-group input::-webkit-inner-spin-button, #nvxItemMain .qty-group input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  #nvxItemMain .nvx-checkout-card .captcha-group { display: flex !important; flex-wrap: nowrap !important; max-width: 100%; width: 100% !important; gap: 10px; }
  #nvxItemMain .nvx-checkout-card .captcha-group input { flex: 1 1 0 !important; width: 0 !important; }
  #nvxItemMain .captcha-group .input-group-append { flex: 0 0 110px; }
  #nvxItemMain .captcha-group .captcha-img { width: 110px; height: 46px; object-fit: contain; }
  html.nvx-item-page #nvxItemMain .cash-pay { padding: 0 !important; margin-top: 4px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  #nvxItemMain .nvx-checkout-card .pay-list .pay { min-height: 48px; border-radius: 10px !important; box-shadow: none !important; color: #fff !important; background: rgba(var(--brand-accent-rgb), .22) !important; }
  #nvxItemMain .nvx-checkout-card .pay-list .pay img { color: transparent; }
  /* Brand entrance is visible; motion preferences still disable it. */
  html.nvx-item-page.nvx-entering body.uc-body { background: var(--portal-bg, #071422) !important; }
  .nvx-motion-toggle, .nova-motion-toggle { display: none !important; }
  html body.uc-body #pjax-container .item-list .acg-thumb.nova-product-art { position: relative !important; }
  html body.uc-body #pjax-container .item-list .nv-card-icon { position: absolute; z-index: 2; top: 9px; left: 9px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #fff; padding: 5px; }
  html body.uc-body #pjax-container .item-list .nv-card-icon img { display: block; width: 24px; height: 24px; object-fit: contain; border-radius: 5px; }
  html body.uc-body #pjax-container .item-list .nv-card-badges { position: absolute; z-index: 2; top: 9px; right: 9px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: calc(100% - 58px); }
  html body.uc-body #pjax-container .item-list .item-card-cell .nv-card-badges .badge-soft { display: inline-flex !important; align-items: center; padding: 4px 7px !important; border: 1px solid #ffffff38 !important; border-radius: 20px !important; font-size: 11px !important; line-height: 1.3 !important; color: #fff !important; background: #10101de8 !important; white-space: nowrap; }
  html body.uc-body #pjax-container .item-list .item-card-cell .nv-card-badges .badge-soft-primary { display: inline-flex !important; background: #6551b5 !important; order: -1; }
  html body.uc-body #pjax-container .item-list .tags:empty { display: none !important; }
  @media (max-width: 980px) {
    html.nvx-item-page #nvxItemMain .nvx-showcase-shell { grid-template-columns: minmax(0,1fr); gap: 12px; min-height: 0; }
    html.nvx-item-page #nvxItemMain .nvx-living-stage { height: 280px; position: relative; top: 0; }
    html.nvx-item-page #nvxItemMain .nvx-checkout-card { max-width: none; }
  }
  @media (max-width: 640px) {
    html.nvx-item-page #nvxItemMain { padding: 10px 12px max(28px, env(safe-area-inset-bottom)); }
    html.nvx-item-page #nvxItemMain .nvx-showcase-shell { padding: 10px; border-radius: 18px; }
    html.nvx-item-page #nvxItemMain .nvx-living-stage { height: 238px; }
    html.nvx-item-page #nvxItemMain .nvx-art-img-wrap { width: min(218px, 76%); margin-top: -10px; }
    html.nvx-item-page #nvxItemMain .nvx-brand-row { margin-top: -12px; padding: 5px 10px; }
    html.nvx-item-page #nvxItemMain .nvx-checkout-card { padding: 18px 14px !important; border-radius: 14px !important; }
    #nvxItemMain .nvx-checkout-card h4 { font-size: 19px !important; }
    #nvxItemMain .nvx-checkout-card .badge-soft { padding: 4px 7px; font-size: 11px; }
    html.nvx-item-page #nvxItemMain :is(.nvx-top-pill,.nvx-detail-card) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    html body.uc-body #pjax-container .item-list .nv-card-icon { top: 7px; left: 7px; width: 27px; height: 27px; padding: 4px; border-radius: 7px; }
    html body.uc-body #pjax-container .item-list .nv-card-icon img { width: 19px; height: 19px; }
    html body.uc-body #pjax-container .item-list .nv-card-badges { top: 7px; right: 7px; gap: 3px; max-width: calc(100% - 46px); }
    html body.uc-body #pjax-container .item-list .item-card-cell .nv-card-badges .badge-soft { font-size: 9px !important; padding: 3px 5px !important; }
  }
}

@layer novaRefinement {
  /* The complete artwork fills its panel; no circular image cutout. */
  html.nvx-item-page #nvxItemMain .nvx-living-stage {
    overflow: hidden; border-radius: 16px; isolation: isolate;
  }
  html.nvx-item-page #nvxItemMain .nvx-art-img-wrap {
    position: absolute; inset: 0; width: 100% !important; height: 100%;
    margin: 0 !important; aspect-ratio: auto;
  }
  html.nvx-item-page #nvxItemMain :is(.nvx-living-shader-canvas,.nvx-living-art-img) {
    border-radius: 16px !important; mask-image: none !important;
    -webkit-mask-image: none !important; object-fit: cover;
  }
  #nvxItemMain.nvx-art-ready .nvx-art-img-wrap { animation: nvx-art-arrive 500ms cubic-bezier(.23,1,.32,1) both; }
  #nvxItemMain.nvx-art-fallback .nvx-living-art-img { animation: nvx-art-drift 6s ease-in-out infinite alternate; }
  .nvx-motion-paused #nvxItemMain.nvx-art-fallback .nvx-living-art-img { animation-play-state: paused; }
  #nvxItemMain .nvx-brand-row { bottom: 12px; }
  @media (max-width: 980px) {
    html.nvx-item-page #nvxItemMain .nvx-living-stage { height: auto !important; aspect-ratio: 1; max-height: 420px; }
  }
  @media (prefers-reduced-motion: reduce) {
    #nvxItemMain.nvx-art-ready .nvx-art-img-wrap,
    #nvxItemMain.nvx-art-fallback .nvx-living-art-img { animation: none !important; }
  }
}
@keyframes nvx-art-arrive { from { opacity: .35; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes nvx-art-drift { from { transform: scale(1.02) translateY(2px); } to { transform: scale(1.055) translateY(-3px); } }

@layer novaRefinement {
  /* Blend dark artwork pixels into the shared showcase, without a second frame. */
  html.nvx-item-page #nvxItemMain .nvx-living-stage {
    isolation: auto; overflow: visible; background: transparent;
    border: 0; border-radius: 0; box-shadow: none;
  }
  html.nvx-item-page #nvxItemMain .nvx-art-img-wrap {
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
  html.nvx-item-page #nvxItemMain :is(.nvx-living-art-img,.nvx-living-shader-canvas) {
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  }
}

@layer novaRefinement {
  /* One scene spans the complete showcase behind the art and checkout. */
  html.nvx-item-page #nvxItemMain .nvx-showcase-shell::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: var(--nvx-scene-image); background-position: center;
    background-repeat: no-repeat; background-size: 100% 100%;
    opacity: .24; mix-blend-mode: screen;
  }
}

@layer novaRefinement {
  html.nvx-item-page #nvxItemMain .nvx-living-stage {
    isolation: auto !important; z-index: auto !important;
    position: relative !important; overflow: visible !important;
    background: transparent !important; border: 0 !important;
    border-radius: 0 !important; box-shadow: none !important;
  }
  html.nvx-item-page #nvxItemMain .nvx-art-img-wrap {
    position: absolute !important; inset: 0 !important;
    width: 100% !important; height: 100% !important;
    aspect-ratio: auto !important; mix-blend-mode: screen !important;
  }
}

@layer novaRefinement {
  html.nvx-item-page #nvxItemMain .nvx-showcase-shell { position: relative; overflow: hidden; }
  html.nvx-item-page #nvxItemMain .nvx-living-stage {
    position: absolute !important; inset: 0 !important; z-index: 1 !important;
    width: 100% !important; height: 100% !important; max-height: none !important;
    aspect-ratio: auto !important; overflow: hidden !important;
  }
  html.nvx-item-page #nvxItemMain .nvx-art-img-wrap {
    mix-blend-mode: screen !important;
    -webkit-mask-image: none !important; mask-image: none !important;
  }
  html.nvx-item-page #nvxItemMain .nvx-showcase-shell::before { content: none !important; background-image: none !important; }
  html.nvx-item-page #nvxItemMain .nvx-checkout-card { grid-column: 2; position: relative; z-index: 4; }
  #nvxItemMain .nvx-brand-row { left: 24px; bottom: 20px; transform: none; }
  html.nvx-item-page #nvxItemMain .nvx-art-aura { display: none; }
  @media (max-width: 980px) {
    html.nvx-item-page #nvxItemMain .nvx-checkout-card { grid-column: 1; margin-top: min(90vw, 390px) !important; }
    html.nvx-item-page #nvxItemMain .nvx-art-img-wrap { height: min(90vw, 390px) !important; }
    #nvxItemMain .nvx-brand-row { top: calc(min(90vw, 390px) - 48px); bottom: auto; left: 50%; transform: translateX(-50%); }
  }
}

@layer novaRefinement {
  /* One artwork on the left, with brand-specific particles across the showcase. */
  html.nvx-item-page #nvxItemMain .nvx-living-stage {
    position: relative !important; inset: auto !important; z-index: auto !important;
    width: auto !important; height: 570px !important; max-height: none !important;
    isolation: auto !important; aspect-ratio: auto !important;
  }
  html.nvx-item-page #nvxItemMain .nvx-art-img-wrap {
    height: 100% !important;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent) !important;
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent) !important;
  }
  #nvxItemMain .nvx-brand-row { left: 50%; bottom: 12px; top: auto; transform: translateX(-50%); }
  @media (max-width: 980px) {
    html.nvx-item-page #nvxItemMain .nvx-living-stage { height: min(90vw,390px) !important; width: 100% !important; }
    html.nvx-item-page #nvxItemMain .nvx-checkout-card { margin-top: 0 !important; }
    html.nvx-item-page #nvxItemMain .nvx-art-img-wrap { height: 100% !important; }
    #nvxItemMain .nvx-brand-row { top: auto; bottom: 12px; }
  }
}
