/* GTON Market — pixel theme overrides */

:root {
  --gton-bg: var(--px-bg, #0b0f1a);
  --gton-surface: var(--px-panel, #121a2a);
  --gton-line: var(--px-line, rgba(233, 240, 255, 0.14));
  --gton-accent: var(--px-accent, #6cf0ff);
  --gton-text: var(--px-ink, #e9f0ff);
  --gton-muted: var(--px-muted, rgba(233, 240, 255, 0.68));
  --gton-font: var(--px-font, ui-monospace);
  --gton-header-h: 64px;
  --gton-bottom-nav-h: 56px;
  /**
   * Сдвиг сайдбара вниз на десктопе = верхняя граница совпадает с верхом карточек (#grid).
   * Сумма: margin .section-title сверху + строка «Gifts»+поиск + margin снизу до сетки (~6+44+12).
   */
  --gton-sidebar-grid-offset: 62px;
}

html,
body {
  background: var(--gton-bg) !important;
  font-family: var(--gton-font) !important;
}

.app {
  background: var(--gton-bg) !important;
  max-width: 100% !important;
}

.bg {
  display: none !important;
}

/* Header */
/* TON Connect: Mini App on localhost is unusable with TON Wallet (manifest URL must be public https). */
.gton-tonconnect-warn {
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(200, 120, 0, 0.22);
  border-bottom: 1px solid rgba(200, 120, 0, 0.5);
  color: var(--gton-fg, #e8e8e8);
}
.gton-tonconnect-warn code {
  font-size: 0.9em;
}

.gton-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: var(--gton-surface);
  border-bottom: 1px solid rgba(233, 240, 255, 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  flex-shrink: 0;
}

.gton-burger {
  display: none;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gton-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gton-burger-ic {
  width: 18px;
  height: 12px;
  display: block;
  position: relative;
  opacity: 0.95;
}
.gton-burger-ic::before,
.gton-burger-ic::after,
.gton-burger-ic {
  background: linear-gradient(90deg, rgba(108, 240, 255, 0.85), rgba(124, 58, 237, 0.85));
  border-radius: 2px;
}
.gton-burger-ic::before,
.gton-burger-ic::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
}
.gton-burger-ic { height: 2px; top: 5px; }
.gton-burger-ic::before { top: -5px; }
.gton-burger-ic::after { top: 5px; }

.gton-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gton-header-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gton-header-nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.14));
  border-radius: 6px;
  background: transparent;
  color: var(--gton-muted, rgba(233, 240, 255, 0.68));
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.gton-header-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gton-text, #e9f0ff);
  border-color: rgba(255, 255, 255, 0.25);
}

.gton-header-nav-btn.active {
  background: var(--gton-accent, #6cf0ff);
  border-color: var(--gton-accent, #6cf0ff);
  color: #0b0f1a;
}

.gton-header-nav-btn .ic {
  font-size: 14px;
}


.gton-lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0px;
  overflow: hidden;
}

.gton-lang-btn {
  margin: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--gton-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.gton-lang-btn:hover,
.gton-lang-btn.is-active {
  color: var(--gton-text, #fff);
  background: rgba(108, 240, 255, 0.12);
}

.gton-brand {
  display: flex;
  align-items: center;
  gap: 0;
  line-height: 1;
  flex-shrink: 0;
  min-width: 0;
}

.gton-brand-text {
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
  margin-left: -25px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.gton-brand-g,
.gton-brand-market {
  color: #ffffff;
}

.gton-brand-ton {
  color: #60a5fa;
}

/* GLB в шапке: медленный auto-rotate задаётся в разметке (rotation-per-second) */
.gton-brand-viewer,
model-viewer.gton-brand-viewer {
  display: block;
  width: 120px;
  height: 44px;
  max-width: 38vw;
  pointer-events: none;
  background: transparent;
  --poster-color: transparent;
}

@media (min-width: 860px) {
  .gton-brand-viewer,
  model-viewer.gton-brand-viewer {
    width: 140px;
    height: 50px;
    max-width: 220px;
  }
}

/* Header section tabs: text-only (no pill chrome) */
.gton-header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex: 1 1 auto;
  min-width: 0;
}

.gton-header-text-btn {
  margin: 0;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--gton-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.gton-header-text-btn:hover {
  color: rgba(255, 255, 255, 0.88);
}

.gton-header-text-btn.active {
  color: var(--gton-text);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

@media (max-width: 520px) {
  .gton-header {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .gton-burger { display: inline-flex; }
  .gton-header-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 100%;
    order: 3;
    gap: 16px;
    padding-bottom: 2px;
  }
  .gton-header-nav::-webkit-scrollbar { display: none; }

  .gton-brand-viewer,
  model-viewer.gton-brand-viewer {
    width: 88px;
    height: 34px;
    max-width: 32vw;
  }

  .gton-brand-text {
    font-size: 12px;
    margin-left: -18px;
    letter-spacing: 0;
  }

  .gton-header-nav {
    gap: 14px;
  }

  .gton-header-text-btn {
    font-size: 13px;
  }

  .gton-header-right {
    gap: 8px;
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .gton-lang-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .gton-header-nav-btns {
    gap: 4px;
  }

  .gton-header-nav-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .gton-header-nav-btn .ic {
    font-size: 12px;
  }

  .gton-wallet-header-btn {
    margin-inline-end: 0;
    padding: 9px 10px;
    font-size: 11px;
    max-width: 100%;
    width: 100%;
    border-radius: 10px;
    order: 2;
  }

  .gton-lang {
    order: 1;
  }
}

/* Header: wallet button (TonConnect), inset from right edge */
.gton-wallet-header-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(340px, 88vw);
  margin-inline-end: 28px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 200, 170, 0.28);
  background: var(--gton-surface);
  color: var(--gton-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.gton-wallet-header-btn:hover {
  border-color: rgba(0, 200, 170, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

.gton-wallet-header-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wallet balance appended to label: keep readable */
.gton-wallet-header-btn {
  font-variant-numeric: tabular-nums;
}

/* Two-line wallet label (address + balance) */
.gton-wallet-header-btn {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
  white-space: normal;
}

.gton-wallet-balance {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--gton-muted);
  line-height: 1.1;
}

/* Кнопки Profile / Sell: тот же пиксельный шрифт и тот же приём, что у `button` в styles.css */
.gton-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: stretch;
}
.gton-btn-row--stack {
  flex-direction: column;
  align-items: stretch;
}
.gton-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  margin: 0 0 10px 0;
  font-family: var(--gton-font) !important;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0.03em;
  color: var(--gton-text);
  border: 1px solid var(--gton-line) !important;
  border-radius: var(--px-radius, 10px) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 520px) {
  .gton-btn {
    font-size: 10px;
  }
}
.gton-btn:hover {
  filter: brightness(1.05);
}
.gton-btn:active {
  transform: translateY(1px);
}
.gton-btn-primary {
  color: #0b0d10 !important;
  border-color: rgba(108, 240, 255, 0.4) !important;
  background: #45b7ff !important;
}
.gton-btn-primary:hover {
  filter: brightness(1.08);
}
.gton-btn-secondary {
  background: var(--gton-surface) !important;
  color: var(--gton-text) !important;
  border-color: var(--gton-line) !important;
}
/* Снять с продажи в модалке профиля */
.gton-btn-warning {
  color: #1a0f00 !important;
  border-color: rgba(234, 140, 0, 0.55) !important;
  background: linear-gradient(180deg, #ffc14d 0%, #f59e0b 100%) !important;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.28) !important;
}
.gton-btn-warning:hover {
  filter: brightness(1.06);
}
.gton-btn-row .gton-btn,
.gton-btn-row--stack .gton-btn {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.gton-btn-row--stack .gton-btn {
  width: 100%;
}

/* Мини-модалка: адрес TON + отключить (TonConnect) */
.gton-wallet-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.gton-wallet-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.gton-wallet-menu {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  z-index: 91;
  min-width: min(320px, calc(100vw - 32px));
  max-width: 420px;
  padding: 1.1rem 1.15rem 1.05rem;
  border-radius: 14px;
  background: var(--gton-surface);
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.1));
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.gton-wallet-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.gton-wallet-menu-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.12));
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--gton-text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.gton-wallet-menu-x:hover {
  background: rgba(255, 255, 255, 0.09);
}

.gton-wallet-menu-title {
  margin: 0 2rem 0.65rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gton-text);
}

.gton-wallet-menu-addr {
  margin: 0 0 1rem;
  padding: 0.55rem 0.6rem;
  font-size: 0.7rem;
  line-height: 1.4;
  font-family: var(--f-mono, ui-monospace, monospace);
  word-break: break-all;
  color: var(--gton-muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}

.gton-wallet-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.gton-wallet-menu-btn {
  min-height: 38px;
  padding: 0 0.95rem;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--gton-font);
  line-height: 1.3;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.14)) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18) !important;
  text-transform: none;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.12s;
}
.gton-wallet-menu-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gton-text);
}
.gton-wallet-menu-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gton-wallet-menu-btn-danger {
  background: color-mix(in srgb, #c23 88%, #000 12%) !important;
  border-color: color-mix(in srgb, #c23 50%, #fff 10%) !important;
  color: #fff;
}
.gton-wallet-menu-btn-danger:hover {
  filter: brightness(1.08);
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .gton-wallet-menu-btn-danger {
    background: #9a2a2c;
    border-color: #b33;
  }
}

/* Профиль → My NFTs: превью как в центральной модалке (квадрат, contain, лимит по высоте) */
.gton-nft-grid {
  /* Один кегль на карточку (имя + адрес — тот же Inter, не mono / не разные px на строки) */
  font-size: 11px;
  line-height: 1.35;
  font-family: var(--f-body, "Inter", ui-sans-serif, system-ui, sans-serif);
}
.gton-nft-grid .card {
  padding: 10px 10px 8px;
}
.gton-nft-grid .card .thumb {
  width: 100%;
  min-height: 0;
  max-height: 200px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 5px;
  position: relative;
  flex-shrink: 0;
}
.gton-nft-grid .card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.gton-nft-grid .card .meta {
  min-width: 0;
  flex: 0 0 auto;
  font-size: 1em; /* сетка уже 11px — имя и адрес одним кеглем */
  line-height: 1.35;
  font-family: inherit;
}
.gton-nft-grid .card .meta .title {
  font-size: inherit;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--gton-text, var(--ink, #f2f2f7));
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.gton-nft-grid .card .meta .sub {
  font-size: inherit;
  font-weight: 500;
  color: var(--gton-muted, var(--muted, rgba(255, 255, 255, 0.58)));
  font-family: inherit;
  /* до 2 строк — больше «видно» длинного адреса */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-all;
  line-height: 1.3;
}

/* P2P rules (collapsible) — i18n HTML in .gton-p2p-rules-body */
.gton-p2p-rules {
  margin: 0 0 1rem;
  max-width: 40rem;
  border: 1px solid var(--gton-line, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 0 1rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.gton-p2p-rules > summary,
.gton-p2p-rules-summary {
  list-style: none;
  padding: 0.75rem 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--gton-text, #fff);
  cursor: pointer;
  user-select: none;
}

.gton-p2p-rules > summary::-webkit-details-marker {
  display: none;
}

.gton-p2p-rules[open] > .gton-p2p-rules-summary {
  border-bottom: 1px solid var(--gton-line, rgba(255, 255, 255, 0.08));
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.gton-p2p-rules-body,
.gton-p2p-guide {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gton-text, #e8e8ef);
}

.gton-p2p-guide h3,
.gton-p2p-rules-body h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  font-weight: 600;
  color: var(--gton-text, #fff);
}

.gton-p2p-guide h3:first-child,
.gton-p2p-rules-body h3:first-child {
  margin-top: 0;
}

.gton-p2p-guide p,
.gton-p2p-rules-body p {
  margin: 0.5rem 0;
  color: var(--gton-muted, rgba(255, 255, 255, 0.7));
}

.gton-p2p-guide ul,
.gton-p2p-rules-body ul {
  margin: 0.4rem 0 0.75rem 1.1rem;
  padding: 0;
  color: var(--gton-muted, rgba(255, 255, 255, 0.7));
}

.gton-p2p-guide li,
.gton-p2p-rules-body li {
  margin: 0.2rem 0;
}

/* Legacy topbar hidden (replaced by gton-header) */
.topbar {
  display: none !important;
}

/* На десктопе сверху 16px — вровень с сеткой карточек; на узком экране без лишнего отступа */
.layout {
  padding-top: 0 !important;
}

@media (min-width: 860px) {
  .layout {
    padding-top: 16px !important;
  }
}

#mainLayout {
  height: calc(100dvh - var(--gton-header-h, 64px) - var(--gton-bottom-nav-h, 56px));
  min-height: calc(100dvh - var(--gton-header-h, 64px) - var(--gton-bottom-nav-h, 56px));
}

/* Нижний внешний отступ у контента не кладём — панель сама внизу; лишняя «подушка» убрана */
.content {
  padding-bottom: 0 !important;
}

/* One column for main content (Gifts / P2P) — fixes grid placing section #3 in sidebar column */
.gton-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width: 860px) {
  #gtonMainColumn {
    /* Ячейка грида 1fr по высоте — тянем колонку, иначе под сеткой карточек пустой фон */
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Панель Markets/Profile в потоке .app (не fixed) — под карточками не дублируем «закладку» */
    padding-bottom: 0;
  }
}

/* Default: keep sidebar visible (Gifts). */
#mainSidebar.sidebar {
  display: flex !important;
  flex-direction: column;
}

/* P2P / Numbers / Usernames: hide collections sidebar */
body.gton-route-p2p #mainSidebar.sidebar,
body.gton-route-numbers #mainSidebar.sidebar,
body.gton-route-usernames #mainSidebar.sidebar {
  display: none !important;
}

/* Profile: show sidebar like Gifts */
body.gton-route-profile #mainSidebar.sidebar {
  display: flex !important;
}
@media (min-width: 860px) {
  body.gton-route-p2p .layout,
  body.gton-route-numbers .layout,
  body.gton-route-usernames .layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.gton-route-p2p #gtonMainColumn,
  body.gton-route-numbers #gtonMainColumn,
  body.gton-route-usernames #gtonMainColumn {
    max-width: 860px;
    margin: 0 auto;
  }
  
  /* Profile: use same grid layout as Gifts (sidebar + main) */
  body.gton-route-profile .layout {
    grid-template-columns: 280px minmax(0, 1fr) !important;
  }
  body.gton-route-profile #gtonMainColumn {
    max-width: none;
    margin: 0;
  }
}

/* Some WebViews weaken [hidden]; force non-active sections off the layout + hit-test */
.gton-main-column > .content[hidden] {
  display: none !important;
}

.gton-main-column > .content:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

#viewP2p:not([hidden]) {
  min-height: 120px;
}

/* --- P2P room --- */
.gton-p2p-lead {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gton-muted);
  max-width: 520px;
}

.gton-p2p-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.gton-p2p-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gton-muted);
}

.gton-p2p-field input,
.gton-p2p-field select,
.gton-p2p-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--gton-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

/* P2P select dropdown: avoid white-on-white in some WebViews */
.gton-p2p-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding-right: 38px;
  line-height: 1.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
.gton-p2p-field select option {
  /* Not all WebViews allow styling option rows */
  background: #0f172a;
  color: #ffffff;
}

.gton-p2p-field textarea {
  resize: vertical;
  min-height: 56px;
}

.gton-p2p-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--gton-accent);
}

.gton-p2p-error {
  margin: 0;
  font-size: 13px;
  color: #f87171;
}

.gton-p2p-submit,
.gton-p2p-copy,
.gton-p2p-new,
.gton-p2p-room-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: var(--gton-surface);
  color: var(--gton-text);
  font: inherit;
  font-family: var(--gton-font) !important;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18) !important;
}
.gton-p2p-copy:hover,
.gton-p2p-new:hover,
.gton-p2p-room-btn:hover,
.gton-p2p-submit:hover {
  filter: brightness(1.04);
}
.gton-p2p-copy:active,
.gton-p2p-new:active,
.gton-p2p-room-btn:active,
.gton-p2p-submit:active {
  transform: translateY(1px);
}

.gton-p2p-submit {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
  margin-top: 4px;
}

#p2pCreateSubmit {
  margin-bottom: 12px;
}

.gton-p2p-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gton-p2p-minilead {
  line-height: 1.45;
}
.gton-p2p-cardta {
  display: block;
  width: 100%;
  max-width: 40rem;
  min-height: 9rem;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  font-family: var(--f-mono, ui-monospace, monospace);
  background: var(--gton-surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: var(--r-sm, 10px);
  color: #e8e8ef;
  resize: vertical;
  box-sizing: border-box;
}
.gton-p2p-invite--compact {
  max-width: 40rem;
}
.gton-p2p-invite {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gton-line);
  max-width: 520px;
}

.gton-p2p-invite > p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--gton-muted);
}

.gton-p2p-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gton-p2p-linkinput {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gton-text);
  font-size: 12px;
}

.gton-p2p-copy {
  flex-shrink: 0;
}

.gton-p2p-new {
  margin-top: 12px;
  font-size: 13px;
}

.gton-p2p-room {
  max-width: 480px;
}

.gton-p2p-room-back {
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--gton-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gton-p2p-room-terms {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--gton-line);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.gton-p2p-room-terms dt {
  margin: 10px 0 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--gton-muted);
}

.gton-p2p-room-terms dt:first-child {
  margin-top: 0;
}

.gton-p2p-room-terms dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.gton-p2p-parties {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gton-p2p-party {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  font-size: 13px;
}

.gton-p2p-party-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}

.gton-p2p-check {
  font-size: 18px;
}

/* Sidebar — same structure as before, GTON surfaces */
.sidebar {
  background: var(--gton-surface) !important;
  border-color: var(--gton-line) !important;
}

@media (min-width: 860px) {
  .sidebar {
    border-color: var(--gton-line) !important;
    border-radius: 16px !important;
    overflow: hidden;
  }
}

.sidebar-total {
  flex-shrink: 0;
  padding: 2px 4px 12px;
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 1.25;
  color: var(--gton-text);
  border-bottom: 1px solid var(--gton-line);
}

.sidebar-total-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.sidebar-total-countwrap {
  min-width: 0;
}

.sidebar-total-for-sale {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #22c55e;
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

/** Верхняя строка: «Collections 114» + ONLY For Sale */
.sidebar-total-collections-prefix {
  font-size: 14px;
  font-weight: 500;
  color: var(--gton-muted);
  margin-right: 6px;
}

.sidebar-total-collections-n {
  font-size: 17px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--gton-text);
}

.sidebar-collection-all-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--gton-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-collection-all-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-collection-all-btn.active {
  border-color: rgba(59, 130, 246, 0.55);
  color: var(--gton-accent);
}

/* Gifts grid: search by name prefix (server: startsWith) */
.gton-section-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

#viewGifts > .gton-section-head {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 6px 2px 14px;
  background: transparent;
  border-bottom: none;
}

.gton-section-head h3 {
  margin: 0;
}

#viewGifts {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.gton-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 24px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 859px) {
  .gton-grid-scroll {
    padding-bottom: 0;
  }
}

/* Одна строка: поиск слева (растягивается), фильтры справа */
.gton-section-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  width: 100%;
  min-width: 0;
}

.gton-gift-search-wrap {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}

.gton-market-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 1 auto;
  min-width: 0;
}

.gton-sort-dd {
  position: relative;
}

.gton-sort-dd summary {
  list-style: none;
}

.gton-sort-dd summary::-webkit-details-marker {
  display: none;
}

.gton-sort-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--gton-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.gton-sort-summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gton-muted);
  margin-left: 2px;
}

.gton-sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 188px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(22, 24, 30, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gton-sort-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gton-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.gton-sort-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .gton-market-toolbar {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .gton-sort-menu {
    left: 0;
    right: auto;
  }
}

.gton-gift-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--gton-line);
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gton-gift-search-inner:focus-within {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.gton-gift-search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gton-muted);
  pointer-events: none;
}

.gton-gift-search-icon svg {
  display: block;
}

.gton-gift-search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 0;
  height: 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--gton-text);
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
  outline: none;
}

.gton-gift-search::placeholder {
  color: var(--gton-muted);
}

.gton-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-item {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--gton-text) !important;
  padding: 8px 2px !important;
}

/* Лого коллекции: только картинка (прозрачность PNG/WebP сохраняется), без «плитки» подложки */
.sidebar-item .thumb {
  width: 40px !important;
  height: 40px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: none !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* Sale badge in sidebar: pixel-red tile with white SALE */
.sidebar-item .thumb.gton-sale-thumb {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff3b3b 0%, #b91c1c 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-family: var(--gton-font) !important;
  letter-spacing: 0.06em;
  line-height: 1;
}
.sidebar-item .thumb.gton-sale-thumb .gton-sale-thumb__text {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-align: center;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  opacity: 1;
  transform: translateY(0.5px);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.sidebar-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.sidebar-item-count {
  flex-shrink: 0;
  color: var(--gton-muted) !important;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.sidebar-item.active {
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}

.sidebar-item.active .name {
  color: var(--gton-accent) !important;
  font-weight: 800;
}

.sidebar-item.active .sidebar-item-count {
  color: var(--gton-text) !important;
}

/** Desktop: cap sidebar height so long collection lists scroll inside; column scrolls with page */
@media (min-width: 860px) {
  .sidebar {
    max-height: calc(
      100dvh - var(--safe-top) - var(--gton-header-h, 64px) - var(--gton-bottom-nav-h, 56px) - 16px -
        var(--gton-sidebar-grid-offset, 62px)
    );
  }
}

/* NFT cards */
.gton-card {
  position: relative;
  background: var(--gton-surface);
  border: 1px solid var(--gton-line);
  border-radius: 14px;
  padding: 0;
  /* Allow SALE ribbon / drop-shadow to extend past the square preview without clipping sides */
  overflow: visible;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  animation: gton-fade-up 0.42s ease backwards;
  animation-delay: calc(var(--stagger, 0) * 35ms);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Над текстом имени/цены браузер иначе ставит I‑beam и ломает ощущение «кнопки». */
.gton-card * {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/*
 * Картинка/плейсхолдер в превью не участвуют в hit-test — клик идёт в <button>.
 * Не отключать pointer-events у всей карточки: translateY на hover наезжал на соседние
 * ячейки сетки и перехватывал мышь.
 */
.gton-card__media,
.gton-card__media * {
  pointer-events: none;
}

.gton-card:hover {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 12px 28px -12px rgba(59, 130, 246, 0.35);
}

.gton-card__meta-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.gton-card__badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: #7ee2a8;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.85),
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.35);
}

.gton-card__media {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #0d0d12;
  display: block;
  position: relative;
  overflow: hidden;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.gton-card__media-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.gton-card__media-inner > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Promo / SALE tab: show full artwork (no side crop); `object-fit: cover` was cutting wide SALE graphics */
.gton-card.gton-card--contain-media .gton-card__media-inner > img {
  object-fit: contain;
  object-position: center;
  background: #0d0d12;
}

/* Corner badge is a direct child of `.gton-card` so it is not clipped by `.gton-card__media { overflow: hidden }` */
.gton-card > .gton-sale-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  pointer-events: none;
  transform: none;
}

/* Solid white “SALE” on red pill (replaces transparent PNG lettering) */
.gton-card > .gton-sale-corner.gton-sale-corner-pill {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  width: auto;
  max-width: min(52%, 128px);
  padding: 5px 11px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ff3b3b 0%, #b91c1c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gton-sale-corner-pill__text {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  opacity: 1;
  font-size: clamp(10px, 3.1vw, 14px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.gton-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gton-card__body {
  padding: 10px 10px 12px;
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
  background: var(--gton-surface);
}

.gton-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gton-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.gton-card__timer {
  min-width: 0;
  font-size: 11px;
  color: var(--gton-muted);
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.gton-card__row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gton-card__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gton-text);
  font-variant-numeric: tabular-nums;
}

.gton-card__ton-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
}

.gton-card__price small {
  font-size: 10px;
  font-weight: 600;
  color: var(--gton-muted);
  margin-left: 2px;
}

.gton-price-was {
  text-decoration: line-through;
  opacity: 0.62;
  font-weight: 600;
  color: var(--gton-muted);
  margin-right: 0.25em;
}

.gton-price-now {
  font-weight: 700;
  color: var(--gton-text);
}

@keyframes gton-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Бесконечная подгрузка: невидимая зона для IntersectionObserver */
.load-more-sentinel {
  min-height: 8px;
  width: 100%;
  pointer-events: none;
  flex-shrink: 0;
}

/*
 * Нижняя панель: в styles она fixed + left:50% + translate + max-width 390px —
 * на широком .app сетка на всю ширину, а «стекло» только по центру снизу →
 * клики слева/справа от полосы доходят до карточек, по центру — нет.
 */
.bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 28px !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  z-index: 40 !important;
  background: rgba(10, 10, 15, 0.94) !important;
  border-top: 1px solid var(--gton-line) !important;
  /* переопределяет styles: без лишнего padding-bottom / safe внизу */
  padding: 0 !important;
}

@media (min-width: 768px) and (max-width: 859px) {
  .bottom-nav {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    bottom: 28px !important;
    border-radius: 0 !important;
  }
}

/* Лист / модалки: opacity:0 без pointer-events:none = невидимый перехватчик кликов */
#backdrop:not(.open),
.sheet-backdrop:not(.open) {
  pointer-events: none !important;
}

#sheet:not(.open),
.sheet:not(.open) {
  pointer-events: none !important;
}

#modalBackdrop:not(.open),
.modal-backdrop:not(.open),
.gton-wallet-menu-backdrop:not(.open) {
  pointer-events: none !important;
}

#modal:not(.open),
.modal.nft-modal:not(.open),
.gton-wallet-menu:not(.open) {
  pointer-events: none !important;
}

.nav-item {
  color: var(--gton-muted) !important;
}

.nav-item.active {
  color: var(--gton-text) !important;
}

/* Два пункта: Маркет / Профиль — половина строки на кнопку, зазор по центру */
.bottom-nav .gton-nav-row-2,
.nav-row.gton-nav-row-2 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  gap: 14px 16px !important;
  padding: 0 !important;
  margin: 0;
  align-items: stretch;
  justify-content: stretch;
}
.bottom-nav .gton-nav-row-2 .nav-item,
.nav-row.gton-nav-row-2 .nav-item {
  min-width: 0;
  justify-content: center;
  padding: 8px 10px !important;
}
@media (min-width: 768px) {
  .bottom-nav .gton-nav-row-2,
  .nav-row.gton-nav-row-2 {
    padding: 0 !important;
    gap: 20px 24px !important;
  }
  .bottom-nav .gton-nav-row-2 .nav-item,
  .nav-row.gton-nav-row-2 .nav-item {
    padding: 8px 12px !important;
  }
}

/* Modal */
.modal.nft-modal {
  background: var(--gton-surface) !important;
  border: 1px solid var(--gton-line) !important;
  box-shadow: none !important;
}

.nft-modal-buy {
  background: #906cff !important;
}

.nft-modal-history-note {
  font-size: 10px;
  color: var(--gton-muted);
  padding: 0 16px 8px;
  line-height: 1.4;
}

.modal-close {
  border-color: var(--gton-line) !important;
  background: #906cff !important;
}

.nft-modal-attr {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--gton-line) !important;
}

.nft-modal-timer {
  color: var(--gton-muted) !important;
}

.nft-modal-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.nft-modal-ton-ic {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

.nft-modal-price span:last-child {
  color: var(--gton-muted) !important;
}

/* ---- Thin scrollbars (нейтральный серый) ---- */
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 122, 132, 0.55) var(--gton-surface);
}

.sidebar-list {
  gap: 2px !important;
  padding: 4px 2px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(120, 122, 132, 0.55) var(--gton-surface) !important;
  -ms-overflow-style: auto !important;
}

.content,
.modal.nft-modal,
.sheet {
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 122, 132, 0.55) var(--gton-surface);
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: rgba(19, 19, 26, 0.85);
  border-radius: 100px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(118, 120, 130, 0.5);
  border-radius: 100px;
  border: 1px solid rgba(10, 10, 15, 0.35);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(145, 147, 158, 0.65);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar-list::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
  height: 5px !important;
}

.sidebar-list::-webkit-scrollbar-track {
  background: rgba(19, 19, 26, 0.85);
  border-radius: 100px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(118, 120, 130, 0.5);
  border-radius: 100px;
  border: 1px solid rgba(10, 10, 15, 0.35);
  background-clip: padding-box;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(145, 147, 158, 0.65);
}

/* ============================================================
   Fragment Market: Numbers & Usernames
   ============================================================ */

/* Section wrapper — full-width, no extra padding fighting with content */
.fm-section {
  padding: 0 !important;
  gap: 0 !important;
}

/* Hero block */
.fm-hero {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--gton-line);
}

.fm-hero-title {
  margin: 0 0 8px;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: var(--gton-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.fm-hero-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--gton-muted);
  line-height: 1.6;
  max-width: 600px;
}

/* Search row */
.fm-search-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--gton-surface);
  border: 1px solid var(--gton-line);
  border-radius: 10px;
  max-width: 420px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.fm-search-row:focus-within {
  border-color: var(--gton-accent);
}

.fm-search-prefix {
  padding: 0 10px 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gton-accent);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.fm-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px 10px 0;
  border: none;
  background: transparent;
  color: var(--gton-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.fm-search-input::placeholder {
  color: rgba(233, 240, 255, 0.35);
}
.fm-search-input::-webkit-search-cancel-button {
  filter: invert(0.6);
  cursor: pointer;
}

/* Sort pills + count */
.fm-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.gton-sort-pill {
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--gton-line);
  background: transparent;
  color: var(--gton-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.gton-sort-pill:hover {
  color: var(--gton-text);
  border-color: rgba(255,255,255,.28);
}
.gton-sort-pill.active {
  background: var(--gton-accent);
  border-color: var(--gton-accent);
  color: #0b0f1a;
}

.fm-count {
  margin-left: 4px;
  font-size: 12px;
  color: var(--gton-muted);
}

/* Table */
.fm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.fm-table thead tr {
  border-bottom: 1px solid var(--gton-line);
}

.fm-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gton-muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fm-th-timer { text-align: right; }

.fm-table tbody tr {
  border-bottom: 1px solid var(--gton-line);
  transition: background 0.12s;
  cursor: pointer;
}
.fm-table tbody tr:last-child { border-bottom: none; }
.fm-table tbody tr:hover {
  background: rgba(108, 240, 255, 0.05);
}

.fm-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* Item name cell */
.fm-td-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fm-td-name-main {
  font-weight: 700;
  font-size: 15px;
  color: var(--gton-accent);
  font-family: ui-monospace, monospace;
  letter-spacing: 0.01em;
}
.fm-td-name-sub {
  font-size: 11px;
  color: var(--gton-muted);
}

/* Price cell */
.fm-td-price {
  white-space: nowrap;
}
.fm-td-price-ton {
  font-weight: 700;
  font-size: 15px;
  color: var(--gton-text);
}
.fm-td-price-usd {
  font-size: 11px;
  color: var(--gton-muted);
  margin-top: 2px;
}

/* Timer cell */
.fm-td-timer {
  text-align: right;
  white-space: nowrap;
}
.fm-td-timer-main {
  font-size: 13px;
  color: var(--gton-text);
}
.fm-td-timer-date {
  font-size: 11px;
  color: var(--gton-muted);
  margin-top: 2px;
}
.fm-td-no-timer {
  font-size: 12px;
  color: var(--gton-muted);
  text-align: right;
}

/* Empty state */
.fm-empty {
  padding: 40px 24px;
  color: var(--gton-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 600px) {
  .fm-hero { padding: 20px 16px 16px; }
  .fm-table th, .fm-table td { padding: 12px 12px; }
  .fm-th-timer, .fm-td-timer { display: none; }
  .fm-td-name-main { font-size: 14px; }
  .fm-td-price-ton { font-size: 14px; }
}

/* ---- Pagination ---- */
.fm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--gton-bg, #0e1117);
  border-top: 1px solid var(--gton-line, rgba(255,255,255,.08));
  z-index: 50;
}

@media (min-width: 860px) {
  .fm-pagination {
    bottom: 0;
  }
}


.fm-pg-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--gton-line);
  background: transparent;
  color: var(--gton-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.fm-pg-btn:hover:not(.disabled):not(.active) {
  background: rgba(255,255,255,.07);
  color: var(--gton-text);
  border-color: rgba(255,255,255,.25);
}
.fm-pg-btn.active {
  background: var(--gton-accent);
  border-color: var(--gton-accent);
  color: #0b0f1a;
  cursor: default;
}
.fm-pg-btn.disabled {
  opacity: 0.3;
  cursor: default;
}

.fm-pg-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--gton-muted);
  font-size: 13px;
  line-height: 36px;
}

/* ---- Site footer ---- */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 39;
  background: rgba(10,10,15,0.97);
  border-top: 1px solid var(--gton-line, rgba(255,255,255,.08));
  padding: 5px 16px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.site-footer-links {
  display: flex;
  gap: 18px;
}

.site-footer-link {
  color: var(--gton-muted, #6b7280);
  font-size: 11px;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.site-footer-link:hover {
  color: var(--gton-text, #e8eaf0);
}

/* ---- Site modals (About / Terms / Privacy) ---- */
.site-modal[hidden],
.site-modal-backdrop[hidden] { display: none !important; }

.site-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
}

.site-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--gton-card, #161b27);
  border: 1px solid var(--gton-line, rgba(255,255,255,.10));
  border-radius: 14px;
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--gton-muted, #6b7280);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.site-modal-close:hover {
  color: var(--gton-text, #e8eaf0);
  background: rgba(255,255,255,.06);
}

.site-modal-body {
  overflow-y: auto;
  padding: 28px 28px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.site-modal-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gton-text, #e8eaf0);
  padding-right: 32px;
}

.site-modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gton-text, #e8eaf0);
  margin: 20px 0 6px;
}

.site-modal-body p,
.site-modal-body ol,
.site-modal-body li {
  font-size: 14px;
  color: var(--gton-muted, #9ca3af);
  line-height: 1.65;
  margin: 0 0 8px;
}

.site-modal-body ol {
  padding-left: 20px;
}

.site-modal-body li {
  margin: 4px 0;
}

.site-modal-body em {
  color: var(--gton-muted, #9ca3af);
  font-style: italic;
}

@media (max-width: 600px) {
  .site-modal-body { padding: 20px 18px 18px; }
  .site-modal-title { font-size: 17px; }
}

/* Мобильная версия — фиксированный скролл только для сетки NFT */
@media (max-width: 768px) {
  body, html {
    overflow: hidden;
    height: 100%;
  }
  
  #app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .nft-grid-container, 
  .gifts-grid,
  #gifts-content,
  #numbers-content,
  #usernames-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .header, 
  .nav-tabs,
  .filters-bar {
    flex-shrink: 0;
  }
}
 
/* Мобильная версия — текст кнопки подключения по центру */
@media (max-width: 768px) {
  #walletConnectLabel {
    text-align: center !important;
    display: block;
    width: 100%;
  }
}
 
/* Мобильная версия — кнопка меню (гамбургер) в 2 раза больше */
@media (max-width: 768px) {
  .menu-toggle,
  .hamburger,
  .header-menu-btn,
  .nav-toggle {
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
  }
  .menu-toggle svg,
  .menu-toggle i,
  .hamburger svg,
  .hamburger i {
    width: 32px !important;
    height: 32px !important;
  }
}
 
/* Мобильная версия — кнопка гамбургер в 2 раза больше */
@media (max-width: 768px) {
  .gton-burger {
    width: 76px !important;
    height: 76px !important;
  }
  .gton-burger-ic {
    width: 36px !important;
    height: 24px !important;
  }
  .gton-burger-ic { height: 4px !important; top: 10px !important; }
  .gton-burger-ic::before { top: -10px !important; height: 4px !important; }
  .gton-burger-ic::after { top: 10px !important; height: 4px !important; }
}
 
/* Мобильное меню — скролл если длинное, уменьшены отступы */
@media (max-width: 768px) {
  .gton-sidebar,
  .main-sidebar,
  #mainSidebar {
    overflow-y: auto !important;
    max-height: 70vh !important;
    padding-bottom: 80px !important;
  }
}
 
/* Мобильное меню — отступ сверху для первой кнопки ALL */
@media (max-width: 768px) {
  .gton-sidebar,
  .main-sidebar,
  #mainSidebar,
  nav[role="sidebar"],
  .sidebar {
    padding-top: 60px !important;
  }
  
  .gton-sidebar button:first-child,
  .gton-sidebar .filter-btn:first-child,
  .main-sidebar button:first-child,
  .main-sidebar .filter-btn:first-child,
  #mainSidebar button:first-child,
  #mainSidebar .filter-btn:first-child {
    margin-top: 20px !important;
  }
}
 
/* Мобильное меню — отступ сверху для кнопки ALL, высота до низа экрана */
@media (max-width: 768px) {
  .gton-sidebar,
  .main-sidebar,
  #mainSidebar,
  nav[role="sidebar"],
  .sidebar {
    padding-top: 60px !important;
    max-height: none !important;
    height: auto !important;
  }
  
  .gton-sidebar button:first-child,
  .gton-sidebar .filter-btn:first-child,
  .main-sidebar button:first-child,
  .main-sidebar .filter-btn:first-child,
  #mainSidebar button:first-child,
  #mainSidebar .filter-btn:first-child {
    margin-top: 20px !important;
  }
}
 
/* Мобильное меню — увеличенный отступ сверху для кнопки ALL */
@media (max-width: 768px) {
  .gton-sidebar button:first-child,
  .gton-sidebar .filter-btn:first-child,
  .main-sidebar button:first-child,
  .main-sidebar .filter-btn:first-child,
  #mainSidebar button:first-child,
  #mainSidebar .filter-btn:first-child {
    margin-top: 60px !important;
  }
}
