  :root {
    --bg: #0A0A14;
    --bg-2: #11111F;
    --bg-3: #171728;
    --ink: #F2F2F7;
    --muted: #9A9AB2;
    --dim: #5E5E78;
    --line: rgba(255,255,255,0.07);
    --line-2: rgba(255,255,255,0.14);
    --glass: rgba(255,255,255,0.035);
    --glass-2: rgba(255,255,255,0.055);

    --violet: #7C3AED;
    --violet-2: #A855F7;
    --pink: #EC4899;
    --gold: #F59E0B;
    --gold-2: #FBBF24;
    --orange: #FB923C;
    --cyan: #22D3EE;
    --blue: #3B82F6;

    --r-pill: 999px;
    --r-lg: 18px;
    --r-md: 14px;
    --r-sm: 10px;

    --f-body: "Inter", ui-sans-serif, system-ui, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0;
    padding: 0;
    background: #04040A;
    height: 100%;
    min-height: 100%;
  }
  body {
    font-family: var(--f-body);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; justify-content: center;
    overscroll-behavior: none;
  }

  .app {
    position: relative;
    width: 100%; max-width: 390px;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    max-height: 100dvh;
    background: var(--bg);
    /* Mobile scroll happens inside the app container */
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    isolation: isolate;
    display: flex;
    flex-direction: column;
  }
  @media (min-width: 768px) {
    body { align-items: stretch; }
    .app { max-width: 100%; min-height: 100vh; min-height: 100dvh; max-height: none; height: 100vh; height: 100dvh; }
  }
  /* Wide layout: app fills viewport; NFT list scrolls inside #gtonMainColumn (sidebar stays put) */
  @media (min-width: 860px) {
    .app {
      height: 100dvh;
      max-height: 100dvh;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
  }

  /* ===== Fragment-like layout ===== */
  .layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    /* нижний зазор под панель — в .content / #gtonMainColumn (gton-market.css), иначе троится с 100px+110px+84px */
    padding: 10px 14px 0;
    /* .app = flex column; когда bottom-nav fixed, main должен заполнять высоту, иначе внизу остаётся «пустая полоса» */
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Mobile: collections sidebar is a drawer (not blocking the grid) */
  .gton-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
  }

  @media (max-width: 859px) {
    .sidebar {
      position: fixed;
      left: 0;
      top: calc(var(--safe-top) + 64px);
      bottom: 0;
      width: min(320px, 86vw);
      max-height: none;
      height: auto;
      z-index: 80;
      transform: translateX(-105%);
      transition: transform 0.18s ease;
      border-radius: 0 14px 14px 0;
      opacity: 1;
      pointer-events: auto;
      background: var(--px-panel, rgba(18, 26, 42, 0.96)) !important;
    }
    .app.is-sidebar-open .sidebar {
      transform: translateX(0);
    }
    .app.is-sidebar-open .gton-sidebar-backdrop {
      display: block;
    }
  }
  @media (min-width: 860px) {
    .layout {
      grid-template-columns: 280px minmax(0, 1fr);
      /* auto-строка = высота по контенту → «дыра» сетки/фона над нижним меню. 1fr заполняет main по высоте */
      grid-template-rows: minmax(0, 1fr);
      align-items: stretch;
      gap: 0;
      padding: 16px 0 0 0;
      padding-right: max(0px, env(safe-area-inset-right, 0px));
      padding-bottom: 0;
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
    }
    /* Desktop should also have Orders / Sell / Profile like mobile */
    .bottom-nav { display: block; }
    .topbar-search-row .search { max-width: 640px; }
    .search.desktop-search { display: flex !important; }
    .topbar-search-row { display: none; }
    /* Bottom padding lives on #gtonMainColumn scroll area (not whole layout) */
    main.layout,
    #mainLayout {
      padding-bottom: 0 !important;
    }
  }
  .sidebar {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    padding: 10px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  @media (min-width: 860px) {
    .sidebar {
      /* было align-self: start + max-height — панель короче ячейки, внизу пустой фон */
      margin-top: var(--gton-sidebar-grid-offset, 62px);
      min-height: 0;
      max-height: none;
      align-self: stretch;
      height: auto;
      position: sticky;
      top: calc(var(--safe-top) + var(--gton-header-h, 64px) + 16px);
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 10px 10px 12px;
      margin-left: max(12px, env(safe-area-inset-left, 0px));
      margin-right: 6px;
    }
  }
  .sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  @media (min-width: 860px) {
    .sidebar-list {
      max-height: none;
    }
  }
  .sidebar-item {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--ink);
    cursor: pointer;
  }
  .sidebar-item.active {
    border-color: rgba(124,58,237,0.55);
    box-shadow: 0 0 0 1px rgba(124,58,237,0.15) inset;
  }
  .sidebar-item .thumb {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
  }
  .sidebar-item .meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }
  .sidebar-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }
  .sidebar-item .name {
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }
  .sidebar-item-count {
    flex-shrink: 0;
    font-family: var(--px-font, var(--f-mono));
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
  }

  .content {
    z-index: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  @media (min-width: 860px) {
    .content {
      overflow: visible;
      padding: 0 20px 24px;
    }
  }

  /* Hide old horizontal collections UI (kept for compatibility) */
  .collections { display: none; }

  /* ===== Center modal (NFT card · nft_modal_mockup layout) ===== */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .modal-backdrop.open { opacity: 1; pointer-events: auto; }

  .modal.nft-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    /* Make the whole modal feel bigger (typography + spacing scale) */
    font-size: 1.18rem;
    width: min(760px, calc(100vw - 24px));
    max-height: min(90vh, 920px);
    overflow: hidden auto;
    border-radius: 20px;
    /* Enhanced glassmorphism effect */
    background: linear-gradient(180deg, rgba(30,30,60,0.85) 0%, rgba(20,20,45,0.9) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow:
      0 40px 100px -20px rgba(0,0,0,0.6),
      0 0 0 1px rgba(255,255,255,0.08) inset,
      0 0 60px -20px rgba(124,58,237,0.15);
    z-index: 81;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .modal.nft-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }
  .modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 3;
  }

  .nft-modal-top {
    display: flex;
    gap: 18px;
    padding: 18px 52px 18px 18px;
    align-items: flex-start;
  }
  .nft-modal-thumb-wrap {
    width: 190px;
    height: 190px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 0.5px solid rgba(255,255,255,0.12);
    overflow: hidden;
    position: relative;
  }
  .nft-modal-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nft-modal-thumb svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }
  .nft-modal-thumb-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
  }
  .nft-modal-thumb-fallback.show { display: block; }

  .nft-modal-info { flex: 1; min-width: 0; }
  .nft-modal-collection {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 4px;
    line-height: 1.35;
  }
  .nft-modal-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.25;
  }
  .nft-modal-price {
    font-size: 26px;
    font-weight: 600;
    color: var(--ink);
  }
  .nft-modal-price span:last-child {
    font-size: 15px;
    color: var(--muted);
    font-weight: 400;
  }
  .nft-modal-timer {
    font-size: 14px;
    color: rgba(251,191,36,0.9);
    margin-top: 4px;
    min-height: 0;
  }

  .nft-modal-divider {
    height: 0.5px;
    background: rgba(255,255,255,0.12);
  }

  .nft-modal-attrs {
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }
  .nft-modal-attr {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 0.5px solid rgba(255,255,255,0.08);
  }
  .nft-modal-attr-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .nft-modal-attr-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.25;
    word-break: break-word;
  }
  .nft-modal-attr-rarity {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
  }

  .nft-modal-section-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    padding: 10px 18px 6px;
  }

  .nft-modal-history { padding: 0 18px 10px; }
  .nft-modal-history .history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 0.5px solid rgba(255,255,255,0.1);
  }
  .nft-modal-history .history-row:last-child { border-bottom: none; }
  .nft-modal-history .history-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .nft-modal-history .history-action {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
  }
  .nft-modal-history .history-who {
    font-size: 15px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
  }
  .nft-modal-history .history-price {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
  }
  .nft-modal-history .history-date {
    font-size: 13px;
    color: var(--muted);
  }
  .nft-modal-history .history-right {
    text-align: right;
    flex-shrink: 0;
  }

  .nft-modal-buy {
    margin: 14px 18px 18px;
    display: block;
    width: calc(100% - 36px);
    padding: 16px 20px;
    font-family: var(--px-font, inherit);
    background: #906cff !important;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
      0 4px 15px rgba(59,130,246,0.4),
      0 0 0 1px rgba(255,255,255,0.1) inset;
    transition: all 0.2s ease;
  }
  .nft-modal-buy::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
  }
  .nft-modal-buy:hover {
    transform: translateY(-2px);
    box-shadow:
      0 8px 25px rgba(59,130,246,0.5),
      0 0 0 1px rgba(255,255,255,0.15) inset;
  }
  .nft-modal-buy:hover::before {
    left: 100%;
  }
  .nft-modal-buy:active {
    transform: translateY(0) scale(0.98);
  }

  /* Buy button loading state (spinner + label) */
  .nft-modal-buy.is-loading {
    cursor: progress;
    opacity: 0.92;
  }
  .nft-modal-buy .gton-loading-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }
  .nft-modal-buy .gton-loading-label {
    display: inline-block;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .nft-modal-buy .gton-loading-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(10, 13, 16, 0.25);
    border-top-color: rgba(10, 13, 16, 0.95);
    animation: gton-spin 0.8s linear infinite;
    flex-shrink: 0;
  }
  @keyframes gton-spin {
    to { transform: rotate(360deg); }
  }

  .nft-modal-chain {
    margin: 14px 18px 0;
    display: block;
    width: calc(100% - 36px);
    padding: 12px 14px;
    font-family: var(--px-font, inherit);
    background: rgba(255,255,255,0.07);
    color: var(--ink);
    border: 0.5px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
  }
  .nft-modal-chain:hover { background: rgba(255,255,255,0.09); }

  .nft-modal-more {
    font-family: var(--px-font, inherit);
  }

  /* Simple panels for Profile/Sell */
  .gton-panel {
    margin: 0 14px 14px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
  }
  .gton-panel-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .gton-panel-k { color: var(--muted); font-size: 11px; }
  .gton-panel-v { font-size: 12px; max-width: 70%; text-align: right; word-break: break-all; }
  .gton-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
  .gton-field > span { color: var(--muted); font-size: 11px; }
  /* Профиль → модалка «выставить»: цена TON — крупнее, цифры в mono + tabular nums */
  .modal-content-profile-sell .gton-field input#sellPriceTon,
  .modal-content-profile-sell .gton-field input[type="number"] {
    font-size: 17px;
    line-height: 1.35;
    font-family: var(--f-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, monospace);
    font-variant-numeric: tabular-nums;
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 10px;
  }
  .gton-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
  .gton-error { margin: 10px 0 0; color: var(--px-danger, #ff5c7a); font-size: 11px; }
  .modal-content-profile-sell .gton-sell-listed-for {
    margin: 6px 0 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gold, #f59e0b);
    text-align: center;
  }

  .gton-subtitle {
    margin: 14px 14px 8px;
    font-size: 12px;
    color: var(--ink);
  }

  .gton-nft-grid .card { cursor: pointer; }
  .gton-nft-grid .card .card-portfolio-action {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .gton-nft-grid .card .card-unlist-btn {
    width: 100%;
    margin: 0;
    padding: 6px 6px;
    font-size: inherit;
    line-height: 1.3;
    font-family: inherit;
  }

  .gton-success-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(280px, calc(100vw - 32px));
    max-width: min(340px, calc(100vw - 24px));
    padding: 14px 16px 14px 14px;
    background: var(--gton-surface, #151528);
    border: 1px solid rgba(61, 204, 133, 0.45);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    color: var(--gton-text, #f0f0f5);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .gton-success-toast.gton-success-toast--show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .gton-success-toast__ic {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
  }
  .gton-success-toast__msg {
    margin: 0;
    flex: 1;
    min-width: 0;
  }

  .gton-error-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(280px, calc(100vw - 32px));
    max-width: min(340px, calc(100vw - 24px));
    padding: 14px 16px 14px 14px;
    background: var(--gton-surface, #151528);
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    color: var(--gton-text, #f0f0f5);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .gton-error-toast.gton-error-toast--show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .gton-error-toast__ic {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
  }
  .gton-error-toast__msg {
    margin: 0;
    flex: 1;
    min-width: 0;
  }

  /* ===== Ambient bg ===== */
  .bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  }
  .bg-glow {
    position: absolute; inset: -20% -10% auto -10%; height: 700px;
    background:
      radial-gradient(55% 50% at 20% 15%, rgba(124,58,237,0.35), transparent 70%),
      radial-gradient(45% 40% at 85% 10%, rgba(236,72,153,0.22), transparent 70%),
      radial-gradient(50% 50% at 50% 80%, rgba(59,130,246,0.12), transparent 70%);
    filter: blur(40px);
  }
  .stars { position: absolute; inset: 0; }
  .stars::before, .stars::after {
    content: ""; position: absolute; inset: 0;
    background-image:
      radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.7), transparent),
      radial-gradient(1px 1px at 80px 90px, rgba(255,255,255,0.5), transparent),
      radial-gradient(1.5px 1.5px at 130px 50px, rgba(255,255,255,0.8), transparent),
      radial-gradient(1px 1px at 200px 150px, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 260px 40px, rgba(255,255,255,0.7), transparent),
      radial-gradient(1.5px 1.5px at 330px 200px, rgba(255,255,255,0.6), transparent),
      radial-gradient(1px 1px at 50px 260px, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 180px 320px, rgba(255,255,255,0.6), transparent),
      radial-gradient(1px 1px at 290px 340px, rgba(255,255,255,0.5), transparent);
    background-size: 360px 400px;
    background-repeat: repeat;
    opacity: 0.55;
  }

  /* =========================
     Pixel theme (2026-04-25)
     ========================= */
  :root {
    --px-bg: #0b0f1a;
    --px-panel: #121a2a;
    --px-panel-2: #0f1626;
    --px-ink: #e9f0ff;
    --px-muted: rgba(233, 240, 255, 0.68);
    /* borders: keep very subtle (no white frames) */
    --px-line: rgba(255, 255, 255, 0.06);
    --px-line-2: rgba(255, 255, 255, 0.09);
    --px-accent: #6cf0ff;
    --px-accent-2: #7c3aed;
    --px-danger: #ff5c7a;
    --px-gold: #ffd35a;

    --px-font: "Silkscreen", "Press Start 2P", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --px-radius: 10px;
    --px-b: 1px;
    --px-shadow: none;
  }

  html, body {
    background: #05070f !important;
    font-family: var(--px-font) !important;
  }

  body {
    color: var(--px-ink) !important;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0.005em;
  }

  /* Pixel font needs smaller sizes on narrow screens */
  @media (max-width: 520px) {
    body { font-size: 14px; }
  }

  .app {
    background: var(--px-bg) !important;
    box-shadow: none;
  }

  /* Pixel background image (static) */
  .app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: url("assets/pixel-bg.png") center / cover no-repeat;
    opacity: 0.35;
    filter: saturate(1.05) contrast(1.05);
  }

  /* Dark overlay for readability */
  .app::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(900px 520px at 20% 20%, rgba(108,240,255,0.10), transparent 55%),
      radial-gradient(900px 520px at 80% 30%, rgba(124,58,237,0.12), transparent 58%),
      linear-gradient(rgba(5,7,15,0.72), rgba(5,7,15,0.78));
  }

  /* Keep all app content above background overlays */
  .app > * {
    position: relative;
    z-index: 1;
  }

  /* Pixel rendering hints */
  body { text-rendering: geometricPrecision; }
  img, video { image-rendering: pixelated; }

  /* Collection totals / counters */
  #sidebarCollectionsNum,
  .sidebar-total-collections-n,
  .sidebar-total-collections-prefix,
  .sidebar-total-for-sale {
    font-family: var(--px-font, inherit);
  }

  /* Inputs */
  input, select, textarea {
    border-radius: var(--px-radius) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: var(--px-panel-2) !important;
    color: var(--px-ink) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  }
  input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--px-accent) !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), 0 0 0 2px rgba(108,240,255,0.22);
  }

  /* Buttons (generic) */
  button,
  .gton-btn,
  .gton-wallet-menu-btn,
  .nft-modal-buy,
  .nft-modal-chain,
  .gton-p2p-submit,
  .gton-p2p-copy,
  .gton-p2p-new,
  .gton-wallet-header-btn {
    border-radius: var(--px-radius) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.18) !important;
    text-transform: none;
    letter-spacing: 0.03em;
  }
  button:active,
  .gton-btn:active,
  .gton-wallet-header-btn:active,
  .gton-wallet-menu-btn:active,
  .nft-modal-buy:active,
  .nft-modal-chain:active {
    transform: translateY(1px);
  }

  /* Cards */
  .card, .gton-card, .sidebar, .section-title, .grid, .gton-p2p-rules, .gton-p2p-invite, .gton-p2p-instructions {
    border-radius: var(--px-radius) !important;
  }
  .sidebar {
    background: var(--px-panel) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
  }

  /* Modal: stronger pixel panel */
  .modal.nft-modal {
    border-radius: var(--px-radius) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: var(--px-panel) !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 18px 60px rgba(0,0,0,0.55);
  }
  .modal-close {
    border-radius: var(--px-radius) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.18) !important;
  }
  .stars::after {
    background-size: 280px 320px;
    opacity: 0.35;
    animation: twinkle 4s ease-in-out infinite alternate;
  }
  @keyframes twinkle { 0%{opacity:.2} 100%{opacity:.55} }

  /* ===== Top bar ===== */
  .topbar {
    position: sticky; top: 0; z-index: 30;
    flex-shrink: 0;
    padding: calc(var(--safe-top) + 10px) 14px 10px;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(10,10,20,0.72);
    border-bottom: 1px solid var(--line);
  }
  @media (min-width: 768px) {
    .topbar { padding: 16px 32px; }
    .topbar-row { grid-template-columns: auto 1fr auto; gap: 24px; justify-content: initial; }
    .topbar-search-row { display: none; }
    .topbar .desktop-search { display: flex !important; max-width: 520px; margin: 0 auto; }
    .brand { font-size: 20px; }
    .wallet-chip { max-width: 220px; height: 40px; font-size: 13px; padding: 10px 16px; }
  }
  .topbar-row {
    display: grid; grid-template-columns: auto auto; gap: 10px; align-items: center;
    justify-content: space-between;
  }
  .topbar-search-row {
    margin-top: 10px;
  }
  @media (min-width: 768px) { .topbar-search-row { display: none; } }
  .brand {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  }
  .brand .spark {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(245,158,11,0.7);
    font-size: 15px;
  }
  .search {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px; height: 48px;
    background: var(--glass-2);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: 13px;
    width: 100%;
  }
  .search input {
    flex: 1; background: transparent; border: 0; outline: 0;
    color: var(--ink); font-size: 14px; line-height: 1.2; font-family: inherit;
  }
  .search input::placeholder { color: var(--dim); }
  .search svg { flex-shrink: 0; }

  .wallet-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; height: 36px;
    border-radius: var(--r-pill);
    border: 1px solid color-mix(in oklab, var(--violet) 60%, transparent);
    background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(168,85,247,0.12));
    color: var(--ink); font-weight: 600; font-size: 12px;
    font-family: var(--f-mono);
    box-shadow: 0 0 16px -4px rgba(124,58,237,0.55);
    cursor: pointer;
    white-space: nowrap;
    max-width: 160px;
  }
  .wallet-chip.connected {
    border-color: color-mix(in oklab, var(--gold) 40%, transparent);
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(124,58,237,0.12));
    box-shadow: 0 0 14px -4px rgba(245,158,11,0.5);
  }
  .wallet-chip .diamond {
    width: 14px; height: 14px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    flex-shrink: 0;
  }

  /* ===== Filter bar ===== */
  .filters {
    position: sticky; top: calc(var(--safe-top) + 112px); z-index: 20;
    padding: 12px 0 12px;
  }
  @media (min-width: 768px) {
    .filters { top: calc(var(--safe-top) + 72px); padding: 14px 0 14px; }
    .filter-row { padding: 0 32px; max-width: 1400px; margin: 0 auto; }
  }
  .filters {
    background: linear-gradient(180deg, rgba(10,10,20,0.85) 60%, rgba(10,10,20,0));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .filter-row {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px;
  }
  .pills {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px;
    flex: 1; min-width: 0;
  }
  .pills::-webkit-scrollbar { display: none; }
  .pill {
    flex-shrink: 0;
    padding: 8px 13px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--muted);
    font-size: 12.5px; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    transition: all .2s;
    min-height: 36px;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .pill:hover { color: var(--ink); border-color: var(--line-2); }
  .pill.active {
    color: white;
    background: linear-gradient(135deg, var(--violet), var(--pink));
    border-color: transparent;
    box-shadow: 0 4px 18px -4px rgba(124,58,237,0.7);
  }

  .sort-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; min-height: 36px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
    background: var(--glass-2);
    color: var(--ink); font-size: 12.5px; font-weight: 500;
    cursor: pointer;
  }
  .sort-btn svg { opacity: 0.7; }

  /* ===== Grid ===== */
  main {
    position: relative; z-index: 1;
    padding: 0 14px 120px;
  }
  @media (min-width: 768px) {
    main { padding: 0 32px 60px; max-width: 1400px; margin: 0 auto; }
  }
  .section-title {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 6px 2px 12px;
  }
  .section-title h3 {
    font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0;
  }
  .section-title .meta {
    font-size: 11.5px; color: var(--dim); font-family: var(--f-mono);
  }

  /* ===== Collections (Fragment-like) ===== */
  .collections {
    margin: 8px 2px 14px;
  }
  .collections-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .collections-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 13.5px;
    color: var(--ink);
    opacity: 0.92;
  }
  .collections-clear {
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--muted);
    border-radius: var(--r-pill);
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
  }
  .collections-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }
  .collections-row::-webkit-scrollbar { display: none; }
  .collection-card {
    flex-shrink: 0;
    width: 138px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    padding: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .collection-card.active {
    border-color: rgba(168,85,247,0.5);
    box-shadow: 0 10px 28px -14px rgba(168,85,247,0.75);
  }
  .collection-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .collection-emoji {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    font-size: 24px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .collection-img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    display: block;
  }
  .collection-count {
    font-family: var(--px-font, var(--f-mono));
    font-size: 11px;
    color: var(--dim);
  }
  .collections-hint {
    margin: 8px 0 0;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    max-width: 720px;
  }
  .collection-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    min-width: 0;
  }
  .collection-name-row .collection-name {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
  }
  .collection-market {
    flex-shrink: 0;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: none;
    padding: 3px 6px;
    border-radius: 6px;
    color: rgba(255,255,255,0.92);
    background: linear-gradient(135deg, rgba(124,58,237,0.55), rgba(236,72,153,0.45));
    border: 1px solid rgba(255,255,255,0.2);
  }
  .collection-market-ton {
    background: linear-gradient(135deg, rgba(34,197,94,0.35), rgba(59,130,246,0.4));
  }
  .collection-tier {
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
  }
  .collection-name {
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .collection-floor {
    font-family: var(--f-mono);
    font-size: 11.5px;
    color: var(--muted);
  }
  .collection-floor b { color: var(--gold); font-weight: 800; }

  .load-more {
    margin: 14px auto 0;
    width: 100%;
    max-width: 390px;
    padding: 12px 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
    background: var(--glass-2);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
  }

  .grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  @media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
  @media (min-width: 900px)  { .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
  @media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, 1fr); gap: 20px; } }
  @media (min-width: 1500px) { .grid { grid-template-columns: repeat(6, 1fr); } }
  @media (min-width: 768px) {
    .gift-emoji { height: 140px; font-size: 76px; }
    .gift-emoji::before { width: 90px; height: 90px; }
    .gift-name { font-size: 15px; }
    .seller { font-size: 12.5px; }
    .price-ton { font-size: 17px; }
    .card { padding: 18px 16px 16px; border-radius: 20px; }
    .section-title h3 { font-size: 22px; }
  }
  .card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px 12px 12px;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    display: flex; flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease, border-color .2s;
  }
  .card:active { transform: scale(0.98); }
  
  /* Enhanced hover effect with lift and glow */
  .card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--line-2);
    box-shadow:
      0 20px 40px -15px rgba(0,0,0,0.4),
      0 0 0 1px var(--line-2) inset,
      0 0 20px -5px rgba(124,58,237,0.2);
    z-index: 2;
  }
  .card:hover .gift-emoji {
    transform: scale(1.08);
  }
  .card .gift-emoji {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* per-rarity glow rings */
  .card.legendary {
    border-color: rgba(245,158,11,0.35);
    box-shadow:
      0 0 0 1px rgba(245,158,11,0.15) inset,
      0 10px 30px -10px rgba(245,158,11,0.45),
      0 0 28px -10px rgba(251,191,36,0.6);
  }
  .card.legendary::after {
    content: ""; position: absolute; inset: -1px; border-radius: var(--r-lg);
    background: conic-gradient(from 0deg, transparent, rgba(251,191,36,0.6), transparent 40%, transparent 60%, rgba(245,158,11,0.4), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    padding: 1px; opacity: .8;
    animation: rotate 6s linear infinite;
    pointer-events: none;
  }
  @keyframes rotate { to { transform: rotate(360deg); } }

  .card.epic {
    border-color: rgba(168,85,247,0.4);
    box-shadow: 0 8px 26px -10px rgba(124,58,237,0.5);
  }
  .card.rare {
    border-color: rgba(59,130,246,0.3);
    box-shadow: 0 6px 22px -12px rgba(34,211,238,0.4);
  }

  .badge {
    position: absolute; top: 10px; right: 10px;
    font-size: 9.5px; font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    letter-spacing: 0.05em; text-transform: uppercase;
    z-index: 2;
  }
  .badge.common    { background: rgba(154,154,178,0.18); color: #C9C9DB; border: 1px solid rgba(154,154,178,0.3); }
  .badge.rare      { background: rgba(59,130,246,0.2);  color: #93C5FD; border: 1px solid rgba(59,130,246,0.45); }
  .badge.epic      { background: rgba(168,85,247,0.22); color: #D8B4FE; border: 1px solid rgba(168,85,247,0.55); }
  .badge.legendary {
    color: #1A0F00;
    background: linear-gradient(135deg, var(--gold-2), var(--gold));
    border: 1px solid rgba(251,191,36,0.9);
    box-shadow: 0 0 12px -2px rgba(251,191,36,0.8);
  }

  .gift-emoji {
    width: 100%; height: 104px;
    display: grid; place-items: center;
    font-size: 62px;
    margin-bottom: 8px;
    position: relative;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5));
  }
  .gift-preview {
    width: 92px;
    height: 92px;
    object-fit: contain;
    image-rendering: auto;
    display: block;
    transform: translateZ(0);
  }
  .lottie-box {
    width: 92px;
    height: 92px;
  }
  .gift-preview-video {
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
  }
  .gift-emoji::before {
    content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color, rgba(124,58,237,0.5)) 0%, transparent 70%);
    filter: blur(6px);
    z-index: 0;
  }
  .gift-emoji span, .gift-emoji img, .gift-emoji video { position: relative; z-index: 1; }
  .card.legendary .gift-emoji { --glow-color: rgba(251,191,36,0.55); }
  .card.epic      .gift-emoji { --glow-color: rgba(168,85,247,0.45); }
  .card.rare      .gift-emoji { --glow-color: rgba(59,130,246,0.35); }
  .card.common    .gift-emoji { --glow-color: rgba(236,72,153,0.25); }

  .gift-name {
    font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
    margin: 0 0 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .seller {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; color: var(--muted); margin-bottom: 10px;
  }
  .avatar {
    width: 16px; height: 16px; border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--pink));
    display: grid; place-items: center;
    font-size: 9px; font-weight: 700; color: white; flex-shrink: 0;
  }

  .price-row {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 4px;
  }
  .price-ton {
    font-family: var(--f-mono); font-weight: 700; font-size: 15px;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(245,158,11,0.4);
    letter-spacing: -0.01em;
  }
  .price-ton .unit { font-size: 10.5px; color: #D97706; margin-left: 2px; font-weight: 600; }
  .price-usd {
    font-family: var(--f-mono); font-size: 11px; color: var(--dim);
  }

  .avail {
    font-size: 10.5px; color: var(--muted); margin-bottom: 10px;
    font-family: var(--f-mono);
  }
  .avail.scarce {
    color: var(--orange);
    text-shadow: 0 0 8px rgba(251,146,60,0.5);
    animation: pulseOrange 1.8s ease-in-out infinite;
  }
  @keyframes pulseOrange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
  }

  .buy-btn {
    width: 100%;
    padding: 10px; min-height: 40px;
    border: 0; cursor: pointer;
    border-radius: var(--r-pill);
    font-family: inherit; font-weight: 700; font-size: 13px;
    color: white; letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.2) inset,
      0 6px 18px -6px rgba(124,58,237,0.65);
    transition: transform .15s;
  }
  .buy-btn:active { transform: scale(0.97); }

  /* ===== Bottom nav ===== */
  .bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 390px; z-index: 40;
    padding: 8px 14px calc(var(--safe-bottom) + 8px);
    background: rgba(10,10,20,0.85);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border-top: 1px solid var(--line);
  }
  @media (min-width: 768px) {
    .bottom-nav {
      left: 50%; transform: translateX(-50%);
      bottom: 18px; max-width: 560px; border-radius: 999px;
      border: 1px solid var(--line-2);
      padding: 6px 10px;
      box-shadow: 0 20px 60px -20px rgba(124,58,237,0.5);
    }
    .nav-row { gap: 4px; }
    .nav-item { flex-direction: row; gap: 8px; min-height: 44px; font-size: 13px; padding: 8px 14px; }
    .nav-item .ic { font-size: 18px; margin: 0; }
    .nav-item.sell .ic { width: 32px; height: 32px; }
    .nav-item.active::before { display: none; }
    .nav-item.active { background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(236,72,153,0.18)); border-radius: 999px; }
  }
  @media (min-width: 768px) {
    /* GTON: единственный <main> — #mainLayout; для него отступы под nav задаём в колонке с карточками */
    main:not(#mainLayout) {
      padding-bottom: 110px;
    }
  }
  .nav-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    position: relative;
  }
  .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px; min-height: 48px;
    background: transparent; border: 0; cursor: pointer;
    color: var(--dim); font-family: inherit;
    font-size: 10px; font-weight: 500;
    border-radius: var(--r-md);
    transition: color .2s;
    position: relative;
  }
  .nav-item .ic {
    font-size: 19px; line-height: 1; margin-bottom: 1px;
    filter: grayscale(0.6);
    transition: all .2s;
  }
  /* Bottom nav: more breathing room between icon and label (Markets/Profile) */
  .bottom-nav .nav-item { gap: 10px; }
  .bottom-nav .nav-item .ic { margin-bottom: 0; }
  .nav-item.active { color: var(--ink); }
  .nav-item.active .ic { filter: none; }
  .nav-item.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 28px; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--violet), var(--pink));
    box-shadow: 0 0 12px rgba(124,58,237,0.7);
  }
  .nav-item.sell .ic {
    font-size: 14px; color: white;
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--violet), var(--pink));
    box-shadow: 0 6px 18px -4px rgba(124,58,237,0.7);
    filter: none;
    margin-bottom: 0;
    font-weight: 700;
  }
  .nav-item.sell { gap: 1px; }

  /* ===== Bottom sheet ===== */
  .sheet-backdrop {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(4,4,10,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s;
  }
  .sheet-backdrop.open { opacity: 1; pointer-events: auto; }

  .sheet {
    position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
    /* Bigger bottom sheet */
    width: 100%; max-width: 720px; z-index: 60;
  }
  @media (min-width: 768px) {
    .sheet {
      max-width: 980px; bottom: 50%; transform: translate(-50%, 50%) scale(0.96);
      border-radius: 24px;
      border: 1px solid var(--line-2);
      max-height: 85vh; opacity: 0;
      transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .25s;
    }
    .sheet.open { transform: translate(-50%, 50%) scale(1); opacity: 1; }
    .sheet-handle { display: none; }
  }
  .sheet {
    background: linear-gradient(180deg, #15152A 0%, #0E0E1E 100%);
    border-top-left-radius: 24px; border-top-right-radius: 24px;
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -20px 60px -10px rgba(124,58,237,0.35);
    /* Scale up the whole sheet (fonts, spacing, controls), not only width */
    font-size: 1.18rem;
    padding: 14px 22px calc(var(--safe-bottom) + 22px);
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
    max-height: 88vh; overflow-y: auto;
  }
  .sheet.open { transform: translate(-50%, 0); }
  .sheet-handle {
    width: 40px; height: 4px; border-radius: 999px;
    background: rgba(255,255,255,0.18);
    margin: 4px auto 14px;
  }

  .sheet-hero {
    display: grid; place-items: center;
    padding: 20px 0 16px;
    position: relative;
  }
  .sheet-hero .big-emoji {
    font-size: 84px; line-height: 1;
    filter: drop-shadow(0 10px 24px rgba(124,58,237,0.5));
    position: relative;
  }
  .sheet-hero .sheet-preview-img,
  .sheet-hero .sheet-preview-video {
    width: 120px;
    height: 120px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 16px;
  }
  /* Bigger ONLY for animated Lottie in the sheet */
  .sheet-hero .sheet-preview-lottie {
    width: 320px;
    height: 320px;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
  }
  /* Force Lottie SVG to scale with container */
  .sheet-hero .sheet-preview-lottie svg,
  .sheet-hero .sheet-preview-lottie > svg,
  .sheet-hero .sheet-preview-lottie * {
    max-width: 100% !important;
    max-height: 100% !important;
  }
  .sheet-hero .sheet-preview-lottie svg,
  .sheet-hero .sheet-preview-lottie > svg {
    width: 100% !important;
    height: 100% !important;
  }
  .sheet-hero::before {
    content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, var(--sheet-glow, rgba(124,58,237,0.4)) 0%, transparent 65%);
    filter: blur(8px);
  }

  .sheet h2 {
    font-size: 28px; font-weight: 800; margin: 0 0 8px;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px;
  }
  .sheet .desc {
    font-size: 16px; color: var(--muted); line-height: 1.5;
    margin: 10px 0 18px; text-wrap: pretty;
  }
  .sheet-seller {
    display: flex; align-items: center; gap: 10px;
    padding: 14px; border-radius: var(--r-md);
    background: var(--glass);
    border: 1px solid var(--line);
    margin-bottom: 18px;
  }
  .sheet-seller .avatar { width: 42px; height: 42px; font-size: 15px; }
  .sheet-seller .name { font-weight: 700; font-size: 16px; }
  .sheet-seller .rating {
    display: flex; align-items: center; gap: 3px;
    font-size: 13px; color: var(--muted); margin-top: 3px;
  }
  .sheet-seller .rating .s { color: var(--gold); }

  .price-box {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02));
    border-radius: var(--r-md);
    padding: 16px;
    margin-bottom: 18px;
  }
  .price-box .row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 4px 0;
    font-size: 15px;
  }
  .price-box .row.big {
    font-size: 22px; font-weight: 700;
    border-bottom: 1px dashed var(--line-2);
    padding-bottom: 12px; margin-bottom: 8px;
  }
  .price-box .row.total {
    font-size: 18px; font-weight: 700;
    padding-top: 12px;
    border-top: 1px dashed var(--line-2);
    margin-top: 4px;
  }
  .price-box .lbl { color: var(--muted); font-family: var(--f-body); }
  .price-box .val { font-family: var(--f-mono); color: var(--ink); }
  .price-box .val.gold { color: var(--gold); text-shadow: 0 0 12px rgba(245,158,11,0.4); }

  .field {
    margin-bottom: 14px;
  }
  .field label {
    font-size: 13px; color: var(--muted); font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase;
    display: block; margin-bottom: 6px;
  }
  .field input {
    width: 100%; padding: 15px 16px; min-height: 56px;
    background: var(--glass-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--ink); font-size: 16px; font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .field input:focus {
    border-color: color-mix(in oklab, var(--violet) 70%, transparent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
  }

  .sheet-cta {
    width: 100%; padding: 18px; min-height: 62px;
    border: 0; cursor: pointer;
    border-radius: var(--r-pill);
    font-family: inherit; font-weight: 700; font-size: 18px;
    color: white; letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.25) inset,
      0 10px 30px -8px rgba(124,58,237,0.7);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  }
  .sheet-cta:active { transform: scale(0.98); }
  .sheet-cta .diamond {
    width: 14px; height: 14px;
    background: linear-gradient(135deg, var(--cyan), white);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  }

  .sheet-foot {
    text-align: center; font-size: 13px; color: var(--muted);
    margin-top: 12px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }

  .sheet-close {
    position: absolute; top: 18px; right: 18px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--glass-2); border: 1px solid var(--line);
    display: grid; place-items: center;
    cursor: pointer; color: var(--muted);
  }
