@font-face {
  font-family: "Manrope";
  src: url("manrope.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #08090a;
  --site-background-overlay: linear-gradient(rgba(8, 9, 10, .72), rgba(8, 9, 10, .88));
  --panel: #111214;
  --panel-2: #151619;
  --panel-3: #1b1c20;
  --border: #27292e;
  --border-bright: #35383e;
  --text: #f5f5f6;
  --muted: #a0a2a8;
  --muted-soft: #6f7279;
  --accent: #e7e7ea;
  --purple: #e7e7ea;
  --purple-dark: #242529;
  --danger: #f17979;
  --danger-bg: #251315;
  --danger-border: #5a292e;
  --success: #75c69a;
  --warning: #edb85b;
  --info: #86b8ef;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --gutter: clamp(24px, 2vw, 48px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --nav-h: 64px;
  --sidebar-w: 224px;
  --app-viewport-height: 100dvh;
  --chat-keyboard-inset: 0px;
  --chat-input-bottom-padding: calc(8px + var(--safe-bottom));
  --visual-viewport-height: 100dvh;
  --visual-viewport-offset-top: 0px;
  --ease: 190ms ease;
}

body.auth-blocked .app-shell {
  display: none;
}

body.auth-blocked .bottom-nav {
  display: none !important;
}

* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--bg);
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.has-site-background {
  background-image: var(--site-background-overlay), var(--site-background-image);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

body.modal-open {
  position: fixed;
  inset-inline: 0;
  width: 100%;
  overflow: hidden;
}

button,
input,
select,
textarea {
  min-width: 0;
  font: inherit;
  touch-action: manipulation;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .48;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--accent);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 0; box-shadow: none; border-color: var(--accent); }

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--panel-2);
  color: var(--text);
  transition: border-color var(--ease), background var(--ease);
}

input::placeholder,
textarea::placeholder { color: var(--muted); }
input:focus,
select:focus,
textarea:focus { border-color: var(--accent); background: var(--panel); }
textarea { min-height: 128px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }

img,
svg { display: block; max-width: 100%; }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3,
strong,
b { font-weight: 800; }

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

.primary-btn,
.secondary-light-btn,
.ghost-btn,
.danger-btn,
.link-btn {
  position: relative;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  transition: filter var(--ease), transform var(--ease), border-color var(--ease), background var(--ease), color var(--ease);
}

.primary-btn { background: var(--accent); color: var(--bg); }
.secondary-light-btn { background: var(--text); color: var(--bg); }
.ghost-btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.danger-btn { border: 1px solid var(--danger-border); background: var(--danger-bg); color: #ffb3b8; }
.link-btn { min-height: 40px; padding: 0; background: transparent; color: var(--muted); }
.primary-btn:hover,
.secondary-light-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ghost-btn:hover { border-color: var(--border-bright); background: var(--panel-3); }
.danger-btn:hover { border-color: #814047; background: #31191c; }
.link-btn:hover { color: var(--text); }
.primary-btn:active,
.secondary-light-btn:active,
.ghost-btn:active,
.danger-btn:active { transform: translateY(0); filter: brightness(.94); }
.small { min-height: 40px; padding-inline: 14px; font-size: 12px; }

.app-shell { width: 100%; min-height: 100dvh; }

.rail {
  position: fixed;
  z-index: 50;
  top: calc(var(--gutter) + var(--safe-top));
  left: max(var(--gutter), var(--safe-left));
  right: max(var(--gutter), var(--safe-right));
  height: var(--nav-h);
  padding: 8px 10px 8px 18px;
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(17, 18, 21, .96);
  backdrop-filter: blur(14px);
}

.rail-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: #0d0d0d;
  color: var(--bg);
  font-size: 18px;
  font-weight: 800;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.rail-nav {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  position: relative;
  min-height: 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}

.nav-btn:hover { background: var(--panel-2); color: var(--text); }
.nav-btn.active { background: var(--text); color: var(--bg); }
.line-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.line-icon svg,
.edit-profile-btn svg,
.attachment-btn svg,
.settings-icon-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.has-dot::after,
.deal-toggle.has-dot::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-btn.has-dot::after { top: 7px; right: 7px; box-shadow: 0 0 0 2px var(--panel); }
.nav-btn.active.has-dot::after { box-shadow: 0 0 0 2px var(--text); }

.account-entry {
  max-width: 224px;
  margin-left: auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  overflow: hidden;
  text-align: left;
}

.account-entry > span:last-child,
.account-entry strong,
.account-entry small { min-width: 0; }
.account-entry strong,
.account-entry small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-entry strong { color: inherit; font-size: 12px; }
.account-entry small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.account-entry.active small { color: rgba(9, 10, 11, .65); }

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--text) center / cover no-repeat;
  color: var(--bg);
  font-size: 12px;
  font-weight: 800;
}

.avatar.mini { width: 34px; height: 34px; font-size: 10px; }
.avatar.big { width: 92px; height: 92px; font-size: 24px; }
.rail-wallet { display: none; }

.stage {
  width: 100%;
  min-width: 0;
  padding: calc(var(--gutter) + var(--safe-top) + var(--nav-h) + 28px) max(var(--gutter), var(--safe-right)) 48px max(var(--gutter), var(--safe-left));
}

.view { display: none; min-width: 0; animation: view-in var(--ease) both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-hero {
  min-height: 104px;
  margin-bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.view-hero > div { min-width: 0; }
.view-hero.compact-view-hero { min-height: 0; }
.view-hero span,
.eyebrow,
.section-heading span,
.panel-heading > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.view-hero h1 { margin: 0; font-size: clamp(32px, 3.1vw, 44px); line-height: 1; letter-spacing: -.04em; }
.view-hero p { max-width: 640px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.market-toolbar {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.filter-toggle {
  min-width: 50px;
  min-height: 50px;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
}
.filter-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.market-account {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}
.market-toolbar > .primary-btn,
.market-account { display: none; }

.search-field {
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  transition: border-color var(--ease), background var(--ease);
}
.search-field:focus-within { border-color: var(--accent); background: var(--panel-2); }
.search-field > span { position: relative; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; color: transparent; font-size: 0; }
.search-field > span::before,
.search-field > span::after { display: none; }
.search-brand-icon img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.search-field input,
.search-field input:focus,
.search-field input:focus-visible { min-height: 48px; padding-left: 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.search-field input[type="search"] { appearance: none; -webkit-appearance: none; }
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }

.market-hero {
  position: relative;
  min-height: 290px;
  padding: clamp(28px, 3vw, 44px);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.hero-copy { position: relative; z-index: 2; max-width: min(620px, 62%); }
.market-hero span { color: var(--accent); }
.market-hero h1 { font-size: clamp(40px, 4.2vw, 58px); line-height: .98; }
.market-hero p { max-width: 520px; margin: 16px 0 22px; }
.hero-art {
  position: absolute;
  z-index: 1;
  top: 24px;
  right: clamp(24px, 4vw, 70px);
  width: min(31vw, 370px);
  height: calc(100% - 48px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  border-radius: 80px 28px 80px 28px;
  background: var(--purple-dark);
  transform: rotate(-2deg);
}
.hero-art::before { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(140, 97, 250, .34); border-radius: inherit; }
.hero-art strong { color: rgba(9, 10, 11, .62); font-size: clamp(70px, 9vw, 136px); line-height: .8; letter-spacing: -.08em; }
.hero-art img { width: min(68%, 180px); height: auto; max-height: 72%; object-fit: contain; opacity: .72; filter: grayscale(1) contrast(1.1); }

.search-panel { min-width: 0; margin-bottom: 18px; }
.category-panel { padding: 8px; display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.filters,
.subfilters,
.review-filters { min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 0; scrollbar-width: none; overscroll-behavior-inline: contain; }
.filters::-webkit-scrollbar,
.subfilters::-webkit-scrollbar,
.review-filters::-webkit-scrollbar,
.gallery-thumbs::-webkit-scrollbar { display: none; }
.chip,
.subchip {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.chip:hover,
.subchip:hover { border-color: var(--border-bright); color: var(--text); }
.chip.active,
.subchip.active { border-color: var(--text); background: var(--text); color: var(--bg); }
.subchip { min-height: 36px; font-size: 12px; }

.following-strip { min-width: 0; margin-bottom: 18px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: start; gap: 8px; }
.follow-list { min-width: 0; display: flex; justify-content: flex-start; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.following-strip > .circle-arrow { margin-top: 12px; }
.circle-arrow,
.gallery-arrow,
.close-btn,
.attachment-btn,
.settings-icon-btn,
.like-btn,
.chat-back {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text);
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.circle-arrow:hover,
.gallery-arrow:hover,
.close-btn:hover,
.attachment-btn:hover,
.like-btn:hover,
.chat-back:hover { border-color: var(--border-bright); background: var(--panel-3); }
.circle-arrow svg,
.gallery-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.close-btn svg,
.chat-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.follow-card { position: relative; flex: 0 0 92px; min-height: 96px; padding: 10px 8px; display: grid; grid-template-rows: 46px auto; justify-items: center; align-content: start; gap: 7px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel); text-align: center; }
.follow-card .avatar { width: 46px; height: 46px; }
.follow-card-tag { max-width: 100%; display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.follow-new-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border: 2px solid var(--panel); border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px rgba(241, 121, 121, .16); }
.follow-empty { width: 100%; min-height: 54px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }

.seller-result { margin-bottom: 18px; }
.seller-line { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel); }
.seller-line > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.seller-line strong,
.seller-line span { display: block; min-width: 0; }
.seller-line span { color: var(--muted); font-size: 12px; }
.market-suggest-panel { padding: 14px; display: grid; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); box-shadow: var(--shadow-soft); }
.suggest-section { display: grid; gap: 8px; }
.suggest-title { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.suggest-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.suggest-card { min-width: 0; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); color: var(--text); text-align: left; transition: border-color var(--ease), background var(--ease), transform var(--ease); }
.suggest-card:hover { border-color: var(--border-bright); background: var(--panel-2); transform: translateY(-1px); }
.suggest-card > span { min-width: 0; display: grid; gap: 2px; }
.suggest-card strong,
.suggest-card small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-card small { color: var(--muted); font-size: 11px; }
.suggest-product { justify-content: space-between; }
.suggest-product > button:first-child { min-width: 0; flex: 1; padding: 0; display: flex; align-items: center; gap: 10px; background: transparent; color: inherit; text-align: left; }
.suggest-product img { width: 44px; height: 44px; flex: 0 0 44px; object-fit: cover; border-radius: 12px; background: var(--panel-2); }
.ghost-btn.tiny { min-height: 32px; padding: 7px 10px; border-radius: 999px; font-size: 11px; white-space: nowrap; }

.section-heading { margin: 24px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.section-heading small { color: var(--muted); }

.market-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.product-card:hover { border-color: var(--border-bright); background: #131419; transform: translateY(-1px); }
.product-media { position: relative; margin: 11px 11px 0; overflow: hidden; border-radius: 16px; background: var(--panel-2); }
.product-open-media { width: 100%; padding: 0; display: block; background: transparent; }
.product-media img { width: 100%; aspect-ratio: 1 / 1.04; object-fit: cover; transition: filter var(--ease); }
.product-card:hover .product-media img { filter: brightness(1.04); }
.product-body { width: 100%; min-width: 0; padding: 14px 15px 16px; display: grid; gap: 5px; background: transparent; text-align: left; }
.product-body h3 { min-width: 0; min-height: 2.7em; margin: 0; display: -webkit-box; overflow: hidden; color: var(--text); font-size: 14px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-body .price { margin-top: 2px; }
.price { color: var(--accent); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price.large { display: block; margin: 10px 0 14px; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.03em; }
.product-meta { color: var(--muted); font-size: 11px; }
.like-btn { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; flex-basis: 38px; font-size: 19px; }
.like-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.like-btn.liked { border-color: rgba(216, 219, 226, .42); color: var(--accent); }
.like-btn.liked svg { fill: currentColor; }
.owner-badge,
.reserved-badge { position: absolute; z-index: 2; left: 10px; padding: 7px 9px; border-radius: 11px; font-size: 10px; font-weight: 800; }
.owner-badge { top: 10px; background: var(--text); color: var(--bg); }
.pinned-badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 242, 247, .32);
  border-radius: 12px;
  background: rgba(17, 18, 21, .9);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
  backdrop-filter: blur(12px);
}
.pinned-badge.owner-pin { right: 10px; left: auto; }
.pinned-badge svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.reserved-badge { right: auto; bottom: 10px; left: 50%; max-width: calc(100% - 20px); border: 1px solid var(--border); background: rgba(17, 18, 21, .94); color: var(--muted); text-align: center; white-space: nowrap; transform: translateX(-50%); }
.product-card.reserved .product-media img { filter: saturate(.5) brightness(.7); }

.trust-strip { margin-top: 24px; padding: clamp(24px, 3vw, 36px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); align-items: center; gap: 32px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--panel); }
.trust-strip h2 { max-width: 680px; margin: 0; font-size: clamp(22px, 2.2vw, 34px); line-height: 1.12; letter-spacing: -.03em; }
.trust-strip p { max-width: 620px; margin: 12px 0 0; color: var(--muted); }
.trust-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.trust-facts article { min-width: 0; min-height: 100px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); }
.trust-facts strong { color: var(--accent); font-size: 18px; }
.trust-facts span { color: var(--muted); font-size: 11px; }

.empty-state { min-height: 150px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 6px; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text); font-size: 16px; }
.grid-empty { grid-column: 1 / -1; }

.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats-row article { min-height: 112px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.stats-row span { color: var(--muted); font-size: 12px; }
.stats-row strong { font-size: 28px; }
.inventory-layout { display: grid; gap: 16px; }
.deals-tabs { min-width: 0; padding: 6px; display: flex; gap: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); scrollbar-width: none; }
.deals-tabs::-webkit-scrollbar { display: none; }
.deals-tabs button { flex: 1 0 auto; min-height: 46px; padding: 0 18px; border-radius: 13px; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.deals-tabs button span { min-width: 24px; margin-left: 5px; padding: 3px 7px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--panel-2); color: var(--text); font-size: 10px; }
.deals-tabs button.active { background: var(--text); color: var(--bg); }
.deals-tabs button.active span { background: var(--bg); color: var(--accent); }
.deal-tab-panel { min-width: 0; display: none; gap: 12px; }
.deal-tab-panel.active { display: grid; }
.deal-tab-panel > .order-list,
.deal-tab-panel > .deal-list { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.active-orders-panel,
.active-deals-panel,
.deal-history,
.rules-list,
.inventory-list { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.active-orders-panel > strong,
.active-deals-panel > div > strong { display: block; margin-bottom: 14px; font-size: 18px; }
.inventory-toolbar { display: flex; justify-content: center; }
.inventory-toolbar .primary-btn { min-width: min(280px, 100%); }
.inventory-list,
.order-list,
.deal-list { display: grid; gap: 10px; }
.inventory-item,
.order-row,
.deal-row {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-2);
}
.inventory-item { grid-template-columns: 88px minmax(0, 1fr) auto; align-items: start; }
.inventory-media-link { width: 88px; padding: 0; align-self: start; overflow: hidden; border-radius: 13px; background: transparent; }
.inventory-media-link img,
.order-product-link img,
.deal-product-link img { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 13px; object-fit: cover; }
.inventory-info { min-width: 0; display: grid; gap: 3px; }
.inventory-info span { color: var(--muted); font-size: 11px; }
.inventory-info .inventory-status.pending { color: var(--accent); }
.inventory-title-link { padding: 0; overflow: hidden; background: transparent; color: var(--text); font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.item-actions,
.order-side,
.deal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.order-side,
.deal-actions { flex-direction: column; align-items: flex-end; }
.order-product-link,
.deal-product-link { min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.order-product-link > span,
.deal-product-link > span { min-width: 0; }
.order-product-link strong,
.order-product-link small,
.deal-product-link strong,
.deal-product-link small { display: block; }
.order-product-link small,
.deal-product-link small { color: var(--muted); font-size: 11px; }
.inline-peer,
.tag-btn,
.inventory-title-link { background: transparent; color: inherit; }
.inline-peer { padding: 0; color: var(--text); font-weight: 700; }
.status-badge { padding: 6px 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: 10px; }
.status-badge.active, .status-tone.active { color: var(--info); }
.status-badge.done, .status-tone.done { color: var(--success); }
.status-badge.cancel, .status-tone.cancel { color: var(--danger); }
.status-badge.hold, .status-tone.hold { color: var(--warning); }
.status-tone { font-weight: 600; }
.deal-toggle { position: relative; width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-weight: 700; }
.deal-history .deal-list { margin-top: 12px; }
.rules-list { margin-top: 12px; display: grid; gap: 10px; }
.rules-list article { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); }
.rules-list h3 { margin-bottom: 6px; font-size: 14px; }
.rules-list p { margin: 0; color: var(--muted); font-size: 12px; }

.messenger {
  height: calc(100dvh - var(--nav-h) - (var(--gutter) * 2) - 28px);
  min-height: 420px;
  display: grid;
  grid-template-columns: clamp(320px, 26vw, 372px) minmax(0, 1fr);
  gap: 16px;
}
.chat-list-wrap,
.chat-pane { max-width: 100%; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: var(--panel); }
.chat-list-wrap { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.chat-list-head { min-height: 64px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.chat-list-head > * { min-width: 0; }
.chat-search { margin: 12px 12px 4px; background: var(--panel-2); }
.chat-list { min-width: 0; min-height: 0; padding: 8px; overflow-x: clip; overflow-y: auto; contain: inline-size; }
.chat-row { box-sizing: border-box; position: relative; isolation: isolate; width: 100%; max-width: 100%; min-width: 0; min-height: 78px; padding: 12px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; text-align: left; touch-action: pan-y; transform: translateX(var(--swipe-x, 0)); transition: transform .18s ease, background var(--ease), border-color var(--ease); }
.chat-row::before { content: "В архив"; position: absolute; z-index: -1; inset: 0 0 0 auto; width: 94px; display: grid; place-items: center; border-radius: inherit; background: var(--panel-3); color: var(--text); font-size: 11px; font-weight: 800; opacity: 0; transform: translateX(12px); transition: opacity .18s ease, transform .18s ease; }
.chat-row.swiping::before { opacity: 1; transform: translateX(0); }
.chat-row:hover { background: var(--panel-2); }
.chat-row.active { border-color: var(--border-bright); background: var(--panel-2); }
.chat-row.marked { box-shadow: inset 3px 0 0 var(--chat-tint, var(--purple)); }
.chat-row-copy { min-width: 0; }
.chat-row h3 { margin: 0 0 3px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-preview { min-width: 0; margin: 5px 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 7px; }
.chat-product-preview img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.chat-product-preview > span { min-width: 0; }
.chat-product-preview b,
.chat-product-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-preview b { color: var(--text); font-size: 10px; }
.chat-product-preview small { color: var(--accent); font-size: 9px; }
.chat-row.unread h3 { color: var(--text); }
.chat-row.unread .chat-preview { color: #c8ccd4; font-weight: 700; }
.chat-state { min-width: 14px; display: grid; place-items: center; gap: 5px; }
.chat-unread-dot { width: 9px; height: 9px; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); }
.chat-row.active .chat-unread-dot { border-color: var(--panel-2); }
.chat-pin-mini { width: 13px; height: 13px; color: var(--muted); }
.chat-pin-mini svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-empty { padding: 22px; color: var(--muted); text-align: center; }
.chat-pane { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.chat-head { min-height: 72px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.chat-head-main { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 10px; }
.chat-head-main > div { min-width: 0; }
.chat-head-main strong,
.chat-head-main > div > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-main > div > span { color: var(--muted); font-size: 11px; }
.chat-head-main .verified-mark { display: inline-grid; overflow: visible; vertical-align: -4px; }
.chat-head-main .presence-online { color: var(--accent); }
.chat-profile-link { cursor: pointer; }
.chat-context-head { min-width: 180px; max-width: 290px; padding: 7px 10px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); text-align: left; }
.chat-context-head img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.chat-context-head span { min-width: 0; }
.chat-context-head strong,
.chat-context-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-context-head strong { font-size: 10px; }
.chat-context-head small { color: var(--accent); font-size: 9px; }
.chat-tools { flex: 0 0 auto; display: flex; gap: 8px; }
.chat-tools button { display: inline-flex; align-items: center; gap: 7px; }
.chat-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.chat-back { display: none; }
.chat-messages { min-height: 0; padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.chat-pinned-message { min-height: 54px; padding: 8px 14px; display: grid; grid-template-columns: 3px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--panel-2) 92%, var(--accent)); text-align: left; }
.chat-pinned-message > i { width: 3px; height: 32px; border-radius: 999px; background: var(--accent); }
.chat-pinned-message span,
.chat-pinned-message strong,
.chat-pinned-message small { min-width: 0; display: block; }
.chat-pinned-message strong { font-size: 11px; }
.chat-pinned-message small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message { width: fit-content; max-width: min(680px, 74%); margin: 0 auto 10px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 17px 17px 17px 6px; background: var(--panel-2); color: var(--text); }
.message.me { margin-right: 0; margin-left: auto; border-color: rgba(255,255,255,.14); border-radius: 17px 17px 6px 17px; background: linear-gradient(135deg, #5b35d6, #392083); color: #fff; }
.message.system { margin: 14px auto; padding: 8px 12px; border-radius: 12px; background: var(--panel-2); color: var(--accent); font-size: 11px; text-align: center; }
.message.system.has-product { width: min(380px, 90%); max-width: min(380px, 90%); padding: 12px; }
.message.system.has-product .pinned-product { width: 100%; margin: 9px auto 0; }
.message.announcement { width: min(520px, 88%); max-width: min(520px, 88%); border-color: color-mix(in srgb, #2aabee 38%, var(--border)); background: color-mix(in srgb, #2aabee 7%, var(--panel-2)); }
.message.is-pinned { box-shadow: inset 3px 0 0 var(--accent); }
.message-actions { position: absolute; z-index: 2; top: -13px; right: 8px; padding: 2px; display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); opacity: 0; transform: translateY(3px); transition: opacity var(--ease), transform var(--ease); }
.message { position: relative; }
.message:hover .message-actions,
.message:focus-within .message-actions { opacity: 1; transform: none; }
.message-actions button { min-height: 28px; padding: 0 8px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; }
.message-actions button:hover { background: var(--panel-3); color: var(--text); }
.message-reply-quote { width: 100%; margin-bottom: 8px; padding: 6px 8px; display: grid; gap: 1px; border-left: 3px solid var(--accent); border-radius: 6px; background: rgba(9,10,11,.24); color: inherit; text-align: left; }
.message-reply-quote strong,
.message-reply-quote span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-quote span { opacity: .7; }
.telegram-link-preview { width: min(430px, 100%); margin-top: 10px; padding: 10px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid rgba(42,171,238,.34); border-radius: 14px; background: rgba(42,171,238,.09); color: var(--text); text-decoration: none; }
.telegram-preview-avatar { width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: #111; }
.telegram-preview-avatar img { width: 100%; height: 100%; object-fit: cover; }
.telegram-link-preview > span:nth-child(2),
.telegram-link-preview strong,
.telegram-link-preview small,
.telegram-link-preview em { min-width: 0; display: block; }
.telegram-link-preview small { color: #74c7f3; font-size: 9px; }
.telegram-link-preview em { overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.telegram-link-preview > b { color: #74c7f3; font-size: 10px; }
.message > span { white-space: pre-wrap; overflow-wrap: anywhere; }
.message time { display: block; margin-top: 5px; color: rgba(242, 242, 247, .62); font-size: 9px; text-align: right; }
.message.me time { width: fit-content; margin-left: auto; padding: 2px 6px; border-radius: 8px; background: rgba(9,10,11,.72); color: #fff; text-shadow: 0 1px 2px #000; }
.message-context { display: block; margin-bottom: 5px; color: var(--accent); }
.message.has-media { width: min(360px, 74%); padding: 8px; }
.message.media-only { border-color: transparent; background: transparent; padding: 0; }
.message.media-only time { margin: -22px 7px 6px auto; position: relative; z-index: 1; width: fit-content; padding: 2px 6px; border-radius: 8px; background: rgba(9, 10, 11, .72); color: var(--text); }
.message-attachments { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: hidden; border-radius: 12px; }
.message.media-only .message-attachments { margin-top: 0; }
.message-attachments.single { grid-template-columns: minmax(0, 1fr); }
.message-attachments img { width: 100%; height: auto; max-height: 340px; border-radius: 11px; background: var(--panel-2); object-fit: contain; }
.pinned-product { width: min(300px, 100%); margin-top: 8px; padding: 8px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(9,10,11,.32); text-align: left; }
.pinned-product img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; }
.pinned-product span { min-width: 0; }
.pinned-product strong,
.pinned-product small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned-product small { color: var(--accent); }
.support-actions { padding: 10px 16px; display: flex; justify-content: center; gap: 8px; border-top: 1px solid var(--border); }
.message-form { padding: 10px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--border); background: var(--panel); }
.message-reply-draft { grid-column: 1 / -1; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 8px; border-left: 3px solid var(--accent); border-radius: 10px; background: var(--panel-2); }
.message-reply-draft span,
.message-reply-draft strong,
.message-reply-draft small { min-width: 0; display: block; }
.message-reply-draft strong { font-size: 10px; }
.message-reply-draft small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-draft button { width: 32px; height: 32px; border-radius: 9px; background: var(--panel-3); color: var(--muted); }
.message-form input { background: var(--panel-2); }
.message-form .primary-btn svg { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.attachment-btn svg { width: 20px; height: 20px; }
.attachment-preview { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-preview-item { position: relative; width: 70px; height: 70px; }
.attachment-preview-item img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.attachment-preview-item button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); }

.account-page { min-width: 0; display: grid; grid-template-columns: minmax(330px, .9fr) minmax(480px, 1.35fr); grid-template-areas: "profile balance" "twofa telegram" "reviews reviews" "rules rules"; gap: 16px; }
.profile-card,
.balance-card,
.account-settings-panel { min-width: 0; padding: clamp(20px, 2.4vw, 30px); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--panel); }
.profile-card { grid-area: profile; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px; }
.profile-copy { min-width: 0; }
.profile-copy h2 { margin: 0 0 5px; overflow-wrap: anywhere; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.05; }
.profile-name-row { display: flex; align-items: center; gap: 10px; }
.profile-name-row h2 { min-width: 0; margin-bottom: 0; }
.notification-bell { position: relative; width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--panel-2); color: var(--muted); }
.notification-bell svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-bell:hover { border-color: var(--border-bright); color: var(--text); }
.notification-bell-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border: 2px solid var(--panel-2); border-radius: 50%; background: var(--danger); opacity: 0; }
.notification-bell.has-dot .notification-bell-dot { opacity: 1; }
.tag-btn { padding: 0; color: var(--muted); font-weight: 700; }
.public-id { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.profile-bio { max-width: 48ch; margin: 12px 0 0; color: var(--text); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-bio.empty { color: var(--muted); }
.account-metrics { grid-column: 1 / -1; margin-top: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.account-metrics span { min-width: 0; }
.account-metrics strong,
.account-metrics small { display: block; }
.account-metrics small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.profile-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.edit-profile-btn { width: 100%; }
.edit-profile-btn svg,
.logout-account-btn svg { width: 18px; height: 18px; }
.logout-account-btn { min-width: 112px; border-color: color-mix(in srgb, var(--danger) 38%, var(--border)); color: var(--danger); }
.logout-account-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logout-account-btn:hover { border-color: var(--danger); background: var(--danger-bg); }
.balance-card { grid-area: balance; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.balance-top > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.balance-top > strong { display: block; margin-top: 10px; font-size: clamp(30px, 3vw, 42px); line-height: 1; letter-spacing: -.04em; }
.balance-top em { display: block; margin-top: 10px; color: var(--accent); font-size: 13px; font-style: normal; letter-spacing: 0; }
.balance-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.account-reviews-panel { grid-area: reviews; min-width: 0; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.account-reviews-panel span,
.account-reviews-panel strong { display: block; }
.account-reviews-panel span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.account-reviews-panel strong { margin-top: 3px; font-size: 18px; }
.twofa-banner { grid-area: twofa; min-width: 0; padding: 16px 18px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.security-orbit { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--text); color: var(--bg); }
.security-orbit svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.twofa-banner strong,
.twofa-banner small { display: block; }
.twofa-banner small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.text-action { min-height: 36px; padding: 0 4px; background: transparent; color: var(--accent); font-size: 11px; font-weight: 800; }
.text-action:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.telegram-profile-banner { grid-area: telegram; min-width: 0; padding: 16px 18px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 13px; border: 1px solid rgba(42,171,238,.26); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(42,171,238,.13), rgba(42,171,238,.04)), var(--panel); color: var(--text); text-decoration: none; transition: border-color var(--ease), transform var(--ease); }
.telegram-profile-banner:hover { border-color: rgba(42,171,238,.55); transform: translateY(-1px); }
.telegram-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #2aabee; color: #fff; }
.telegram-mark svg { width: 23px; height: 23px; fill: currentColor; }
.telegram-profile-banner strong,
.telegram-profile-banner small { display: block; }
.telegram-profile-banner small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.rules-profile-link { grid-area: rules; width: fit-content; min-height: 36px; justify-self: center; padding: 0 8px; background: transparent; color: var(--muted); font-size: 11px; }
.rules-profile-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.active-deals-panel { grid-area: orders; }
.account-settings-panel { grid-area: settings; padding: 18px; }
.panel-heading { margin-bottom: 10px; }
.panel-heading strong { display: block; font-size: 18px; }
.account-settings-panel > button { position: relative; width: 100%; min-height: 62px; padding: 12px 44px 12px 14px; display: grid; gap: 2px; border-top: 1px solid var(--border); background: transparent; text-align: left; }
.account-settings-panel > button::after { content: ""; position: absolute; top: 50%; right: 17px; width: 7px; height: 7px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: translateY(-50%) rotate(45deg); }
.account-settings-panel > button:hover { background: var(--panel-2); }
.account-settings-panel > button span { font-weight: 700; }
.account-settings-panel > button small { color: var(--muted); }
.deal-history { grid-area: history; }
.account-disclaimer { grid-area: disclaimer; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.account-disclaimer button { background: transparent; color: var(--text); font-weight: 700; }
.account-page > .rules-list { grid-area: rules; }

.modal-backdrop {
  position: fixed;
  z-index: 160;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, .46);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: opacity 180ms ease, background 180ms ease, backdrop-filter 180ms ease, -webkit-backdrop-filter 180ms ease;
}
.modal-backdrop.is-open {
  pointer-events: auto;
  opacity: 1;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.modal-backdrop.is-closing { pointer-events: none; opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
.modal {
  width: min(680px, calc(100vw - 48px));
  max-height: calc(var(--app-viewport-height, 100dvh) - 48px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  opacity: 0;
  transform: translateY(10px) scale(.985);
  transition: opacity 180ms ease, transform 180ms ease;
}
.modal-backdrop.is-open .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-backdrop.is-closing .modal { opacity: 0; transform: translateY(8px) scale(.985); }
.modal-head { position: sticky; z-index: 4; top: 0; min-height: 68px; padding: 12px 14px 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.modal-head > strong { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-body { padding: 22px; display: grid; gap: 14px; }
.confirm-body h2 { margin: 0; }
.notice { padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--muted); font-size: 12px; }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid var(--danger-border); border-radius: 12px; background: var(--danger-bg); color: #ffb3b8; }

.product-modal-backdrop { z-index: 100; padding: max(24px, var(--safe-top)) max(24px, var(--safe-right)) max(24px, var(--safe-bottom)) max(24px, var(--safe-left)); place-items: center; background: rgba(8, 9, 10, .9); }
.product-modal { width: min(1560px, 100%); height: min(760px, calc(var(--app-viewport-height, 100dvh) - 48px)); max-height: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); }
.product-detail { min-width: 0; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 58fr) minmax(360px, 42fr); gap: 24px; }
.gallery,
.detail-info { min-width: 0; min-height: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--panel); }
.gallery { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.gallery-stage { position: relative; min-height: 0; overflow: hidden; border-radius: 20px; background: var(--panel-2); }
.gallery-main-btn { width: 100%; height: 100%; padding: 0; display: block; background: transparent; }
.gallery-main { width: 100%; height: 100%; max-height: 680px; object-fit: cover; object-position: center; }
.product-close-btn { position: absolute; z-index: 3; top: 14px; right: 14px; }
.gallery-controls { position: absolute; inset-inline: 14px; top: 50%; display: flex; justify-content: space-between; pointer-events: none; transform: translateY(-50%); }
.gallery-controls button { pointer-events: auto; }
.gallery-thumbs { min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumb { width: 78px; height: 78px; flex: 0 0 78px; padding: 5px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.gallery-thumb.active { border-color: var(--text); background: var(--text); }
.gallery-thumb img { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; }
.detail-info { height: 100%; padding: clamp(20px, 2.2vw, 34px); align-self: stretch; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none; }
.detail-eyebrow { margin-bottom: 10px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail-info h2 { max-width: 680px; margin: 0; font-size: clamp(30px, 3vw, 42px); line-height: 1.03; letter-spacing: -.04em; }
.detail-info p { margin: 18px 0; color: var(--muted); }
.detail-info > .primary-btn { width: 100%; margin-top: 6px; }
.detail-info > .ghost-btn,
.detail-info > .danger-btn { width: 100%; margin-top: 8px; }
.variant-panel { margin: 12px 0 0; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.variant-copy { min-height: 42px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.variant-copy > span { font-size: 13px; font-weight: 700; line-height: 1.2; }
.variant-copy small { color: var(--muted); line-height: 1.2; }
.variant-option { min-width: 42px; min-height: 42px; padding: 0; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 17px; font-weight: 800; line-height: 1; }
.detail-description { padding-top: 12px; }
.detail-description h3 { margin: 0; font-size: 16px; }
.detail-description p { margin: 8px 0 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-secondary-actions { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-secondary-actions > * { width: 100%; }
.seller-card { width: 100%; min-height: 66px; margin-top: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); text-align: left; }
.seller-card > span:nth-child(2) { display: grid; gap: 3px; }
.seller-card-copy strong,
.seller-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-card small { color: var(--muted); }
.seller-card svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.escrow-note { margin-top: 10px; padding: 14px 16px; display: grid; gap: 4px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 5%, var(--panel-2)); }
.escrow-note strong { color: var(--accent); font-size: 12px; }
.escrow-note span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.seller-label { margin-top: 8px; color: var(--muted); }

.listing-form { padding: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.listing-form label { min-width: 0; display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.listing-form input,
.listing-form select { min-height: 50px; }
.character-field { align-content: start; }
.character-count { justify-self: end; margin-top: -3px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; transition: color var(--ease); }
.character-count.near-limit { color: var(--warning, #ffc861); }
.listing-form .wide,
.listing-form > .primary-btn,
.listing-form > .danger-btn { grid-column: 1 / -1; }
.fee-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.fee-preview span,
.listing-monetization {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
}
.fee-preview small,
.listing-monetization small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.fee-preview strong { display: block; margin-top: 4px; color: var(--text); font-size: 13px; }
.listing-monetization-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-builder { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-2); }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo-grid.single-photo-grid { grid-template-columns: minmax(0, min(220px, 100%)); justify-content: center; }
.photo-slot,
.photo-add { position: relative; min-height: 118px; overflow: hidden; border: 1px dashed var(--border-bright); border-radius: var(--radius-sm); background: var(--panel); }
.photo-slot { display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.photo-slot img { width: 100%; height: 100%; min-height: 118px; object-fit: cover; }
.photo-slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-actions { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; gap: 5px; }
.photo-actions button { min-width: 32px; min-height: 32px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; background: rgba(9,10,11,.9); font-size: 10px; }
.photo-add { width: 100%; margin-top: 8px; min-height: 46px; color: var(--muted); font-size: 20px; }
.attachment-field { grid-column: 1 / -1; display: grid; gap: 8px; }
.attachment-label { color: var(--muted); font-size: 12px; font-weight: 700; }

.seller-profile { padding: 22px; }
.profile-customization { --cover-shade-top: .3; --cover-shade-mid: .5; --cover-shade-mid-stop: .56; --cover-shade-end: 1; --cover-fade-color: var(--panel); }
.profile-customization.has-background { position: relative; overflow: hidden; isolation: isolate; }
.profile-customization.has-background::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background-image: linear-gradient(to bottom, rgba(17,18,20,var(--cover-shade-top)) 0%, rgba(17,18,20,var(--cover-shade-mid)) calc(var(--cover-shade-mid-stop) * 100%), var(--cover-fade-color) calc(var(--cover-shade-end) * 100%)), var(--profile-background-image); background-position: center; background-size: cover; }
.profile-customization .profile-cover-text { color: #fff; }
.profile-customization.has-background .profile-cover-text { text-shadow: 0 1px 4px rgba(0,0,0,.48), 0 3px 14px rgba(0,0,0,.3); }
.seller-profile-intro.has-background { margin: -22px -22px 0; padding: 22px 22px 0; }
.profile-card.has-background { --cover-shade-top: .5; --cover-shade-mid: .65; }
.profile-metric-icon { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-icon-followers { color: #70a9ff; }
.profile-icon-rating { color: #f1c65b; }
.profile-icon-sales { color: #75c69a; }
.profile-icon-purchases,
.profile-icon-reviews { color: #b395ef; }
.account-metrics strong { display: flex; align-items: center; gap: 6px; }
.account-metrics b { font-weight: inherit; }
.account-metrics [data-profile-metric-icon] { display: inline-flex; flex: 0 0 auto; }
.account-metrics .profile-metric-icon { width: 24px; height: 24px; }
.avatar > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.profile-loading { min-height: 210px; padding: 28px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.profile-loading strong,
.profile-loading small { display: block; }
.profile-loading small { margin-top: 4px; color: var(--muted); }
.seller-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.seller-main { min-width: 0; }
.seller-main h2 { width: fit-content; max-width: 100%; margin: 0 0 5px; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; font-size: 28px; }
.seller-main h2 > span { min-width: 0; }
.seller-main h2 .verified-mark { margin: 0; flex: 0 0 auto; vertical-align: 0; transform: none; }
.seller-main > span { display: block; }
.seller-followers,
.official-label { margin-top: 7px; color: var(--muted); font-size: 11px; }
.seller-bio { margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.seller-actions { display: flex; flex-direction: column; gap: 8px; }
.seller-stats { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seller-stats > * { min-height: 82px; padding: 13px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); }
.seller-stats small { color: var(--muted); }
.seller-rating-card { text-align: left; }
.subhead { margin: 22px 0 12px; }
.seller-products-section { margin-top: 20px; display: grid; gap: 12px; }
.seller-products-tabs { padding: 5px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.seller-products-tabs button { min-height: 42px; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 900; }
.seller-products-tabs button.active { background: var(--panel-2); color: var(--text); }
.seller-products-panel { display: none; }
.seller-products-panel.active { display: block; }
.stock-note { display: block; margin-top: -6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.sold-history-card { cursor: default; }
.sold-history-card .product-media { display: grid; }
.sold-history-card .product-media > img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.sold-history-body { cursor: default; }
.sold-badge { background: rgba(9,10,11,.92); color: var(--success); }
.sold-buyer { width: 100%; min-width: 0; margin-top: 8px; padding: 8px 0 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.sold-buyer .avatar { width: 28px; height: 28px; flex: 0 0 28px; }
.sold-buyer > span:last-child,
.sold-buyer small,
.sold-buyer strong { min-width: 0; display: block; }
.sold-buyer small { color: var(--muted); font-size: 9px; font-weight: 700; }
.sold-buyer strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.verified-mark { width: 17px; height: 17px; margin-left: 5px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--bg); vertical-align: -3px; }
.verified-mark svg { width: 12px; height: 12px; fill: currentColor; }

.typing-indicator {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(78%, 360px);
  margin: 2px 0 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
  box-shadow: var(--shadow-soft);
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  animation: typingPulse 1.05s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.14s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.28s; }
.typing-indicator b { font-weight: 700; color: var(--text); }

@keyframes typingPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 0.95; }
}

.deal-detail-shell { max-width: 720px; }
.deal-detail-modal { display: grid; gap: 16px; }
.deal-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deal-detail-summary div,
.deal-finance-list article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--card);
}

.deal-detail-summary span,
.deal-finance-list span,
.deal-finance-list small,
.deal-timeline small,
.deal-timeline p {
  color: var(--muted);
}

.deal-detail-summary strong,
.deal-finance-list strong { display: block; margin-top: 4px; }

.deal-timeline {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.deal-timeline article {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  position: relative;
}

.deal-timeline article + article::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -10px;
  bottom: calc(100% - 8px);
  width: 1px;
  background: var(--line);
}

.deal-timeline i {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: inset 0 0 0 5px var(--card);
  border: 1px solid var(--text);
}

.deal-finance-list { display: grid; gap: 8px; }
.deal-finance-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
}
.deal-finance-list small { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .deal-detail-summary { grid-template-columns: 1fr; }
}
.review-list,
.archive-list,
.ledger-list { padding: 18px; display: grid; gap: 8px; }
.review-row,
.archive-row,
.ledger-row { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); }
.review-row p { margin: 8px 0; color: var(--muted); }
.marketplace-review { display: grid; gap: 10px; }
.review-row-head { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.review-author { min-width: 0; display: grid; gap: 2px; }
.review-author strong,
.review-author small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-author small { color: var(--muted); font-size: 10px; }
.review-rating { padding: 6px 8px; border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.review-rating.rating-good { color: #ffd666; }
.review-rating.rating-middle { color: #ff9d42; }
.review-rating.rating-bad { color: #ff6b72; }
.review-attachments { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.review-attachments::-webkit-scrollbar { display: none; }
.review-attachments button { width: 74px; height: 74px; flex: 0 0 74px; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.review-attachments img { width: 100%; height: 100%; object-fit: cover; }
.review-row-actions { display: flex; justify-content: flex-end; }
.archive-row { display: grid; text-align: left; }
.archive-row small,
.ledger-row small { color: var(--muted); }
.ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ledger-row span,
.ledger-row small { display: block; }
.ledger-row.positive > strong { color: var(--success); }
.ledger-row.negative > strong { color: var(--danger); }
.missing-product-thumb { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-2); color: var(--muted); font-weight: 900; }
.deal-product-link.is-missing { cursor: default; opacity: .86; }

.balance-modal { width: min(620px, calc(100vw - 48px)); }
.payment-methods { display: grid; gap: 8px; }
.payment-selected,
.payment-method,
.payment-box { min-width: 0; min-height: 64px; padding: 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.payment-selected { cursor: pointer; list-style: none; }
.payment-selected::-webkit-details-marker { display: none; }
.payment-method { cursor: pointer; }
.payment-method.active { border-color: var(--accent); }
.payment-method input { position: absolute; opacity: 0; pointer-events: none; }
.payment-method strong,
.payment-method small,
.payment-selected strong,
.payment-selected small { display: block; }
.payment-method small,
.payment-selected small { color: var(--muted); font-size: 10px; }
.coin-logo { position: relative; width: 38px; height: 38px; display: grid; place-items: center; overflow: visible; border-radius: 50%; background: var(--panel-3); font-size: 9px; font-weight: 800; }
.coin-logo img { width: 100%; height: 100%; object-fit: contain; }
.coin-logo .network-badge { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--panel-2); border-radius: 50%; background: #fff; color: #111; font-size: 7px; font-weight: 900; line-height: 1; }
.coin-logo .network-badge.tron { background: #eb0029; color: #fff; }
.coin-logo .network-badge.tron svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.coin-logo .network-badge.bsc { background: #f3ba2f; color: #111; font-size: 5px; }
.payment-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-box > span { min-width: 0; }
.payment-box small,
.payment-box strong { display: block; }
.payment-box small { color: var(--muted); }
.payment-box .wide { grid-column: 1 / -1; }
.copy-address { overflow-wrap: anywhere; }
.amount-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.deposit-action-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deposit-action-row > div { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.deposit-proof-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.deposit-proof-preview { grid-column: auto; }
.deposit-proof-note { border-color: color-mix(in srgb, var(--accent) 24%, var(--border)); }
.deposit-hash-field { display: grid; gap: 6px; }
.deposit-hash-field input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.deposit-hash-field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.recovery-code-grid { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--panel-2); }
.recovery-code-grid code { color: var(--text); font-size: 12px; text-align: center; }
.reviews-modal .review-filters { margin: 0 18px; padding-top: 16px; }
.image-preview-modal { padding: 12px; display: grid; place-items: center; }
.image-preview-modal img { width: 100%; max-height: min(72dvh, 760px); border-radius: 18px; object-fit: contain; background: var(--panel-2); }

.settings-modal { width: min(860px, calc(100vw - 48px)); }
.settings-shell { min-height: 470px; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.settings-tabs { padding: 12px; display: grid; align-content: start; gap: 5px; border-right: 1px solid var(--border); }
.settings-tabs button { min-height: 46px; padding: 0 12px; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 700; text-align: left; }
.settings-tabs button:hover { background: var(--panel-2); color: var(--text); }
.settings-tabs button.active { background: var(--text); color: var(--bg); }
.settings-panel { padding: 22px; display: grid; align-content: start; gap: 14px; }
.settings-panel label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.settings-panel textarea[name="bio"] { min-height: 104px; }
.avatar-picker { grid-template-columns: auto 1fr; align-items: center; }
.avatar-picker > span { grid-column: 1 / -1; }
.avatar-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-avatar { padding: 0; aspect-ratio: 1; }
.toggle-line { min-height: 58px; padding: 10px 12px; grid-template-columns: minmax(0, 1fr) auto !important; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.modern-check { position: relative; width: 46px; min-height: 26px; height: 26px; appearance: none; border: 1px solid var(--border-bright); border-radius: 999px; background: var(--panel-3); cursor: pointer; }
.modern-check::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--ease), background var(--ease); }
.modern-check:checked { border-color: var(--accent); background: var(--accent); }
.modern-check:checked::after { background: var(--bg); transform: translateX(20px); }

.security-status-card { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.security-status-card.enabled { border-color: color-mix(in srgb, var(--success) 34%, var(--border)); }
.security-status-card.enabled small { color: var(--success); }
.security-status-card strong,
.security-status-card small,
.devices-heading strong,
.devices-heading small { display: block; }
.security-status-card small,
.devices-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.devices-heading { margin-top: 6px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.device-sessions { display: grid; gap: 8px; }
.device-session { min-width: 0; padding: 11px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.device-session.current { border-color: var(--border-bright); }
.device-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-3); color: var(--muted); }
.device-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.device-session > span:nth-child(2),
.device-session strong,
.device-session small,
.device-session em { min-width: 0; display: block; }
.device-session small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.device-session em { margin-top: 3px; color: #ffc861; font-size: 9px; font-style: normal; }
.device-session > b { color: var(--accent); font-size: 10px; }

.customization-categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.customization-categories button { min-height: 42px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); color: var(--muted); font-size: 9px; font-weight: 800; }
.customization-categories button.active { border-color: var(--border-bright); background: var(--text); color: var(--bg); opacity: 1; }
.custom-profile-preview { position: relative; min-height: 260px; overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: var(--panel-2); }
.custom-profile-preview { --cover-shade-top: .08; --cover-shade-mid: .38; --cover-shade-mid-stop: .44; --cover-shade-end: .84; --cover-fade-color: var(--panel-2); }
.custom-profile-content { position: relative; z-index: 1; min-height: 260px; padding: 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; align-items: center; gap: 16px; }
.custom-profile-content h2 { margin: 0; font-size: 28px; }
.custom-profile-content strong,
.custom-profile-content small { display: block; }
.custom-profile-content > div > strong,
.custom-profile-content small { color: var(--muted); font-size: 10px; }
.custom-profile-content p { max-width: 52ch; margin: 16px 0 0; grid-column: 1 / -1; line-height: 1.6; }
.site-background-control,
.profile-background-control { padding: 14px; display: grid; gap: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel-2); }
.site-background-control strong,
.site-background-control small,
.profile-background-control strong,
.profile-background-control small { display: block; }
.site-background-control small,
.profile-background-control small { color: var(--muted); font-size: 10px; }
.site-background-control > div:last-of-type,
.profile-background-control > div:last-of-type { display: flex; flex-wrap: wrap; gap: 8px; }

.rules-modal-intro { padding: 18px 18px 4px; }
.rules-modal-intro span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rules-modal-intro p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.numbered-rules { padding: 8px 18px 18px; }
.numbered-rules article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.rule-number { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 800; }
.notification-center { min-height: 0; }
.notification-toolbar { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.notification-list { padding: 10px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 6px; }
.notification-item { width: 100%; min-width: 0; padding: 13px; display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); color: var(--text); text-align: left; }
.notification-item > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.notification-item.is-read { opacity: .62; }
.notification-item.is-read > i { background: var(--muted); }
.notification-item.telegram { border-color: rgba(42,171,238,.32); background: linear-gradient(135deg, rgba(42,171,238,.13), rgba(42,171,238,.04)), var(--panel-2); }
.notification-item.telegram > i { background: #2aabee; box-shadow: 0 0 0 4px rgba(42,171,238,.1); }
.notification-item.security > i { background: #ffc861; }
.notification-item strong,
.notification-item small,
.notification-item time { display: block; }
.notification-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.notification-item time { color: var(--muted); font-size: 9px; }
.notification-meta { max-width: 88px; text-align: right; align-self: center; }
.notification-item > span { min-width: 0; overflow-wrap: anywhere; }
.notification-settings { min-height: 0; }
.notification-settings .toggle-line { min-height: 46px; padding: 8px 12px; }
.notification-settings .modern-check { margin: 0; }
.settings-control-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.settings-control-row > span { min-width: 0; }
.settings-control-row strong, .settings-control-row small { display: block; }
.settings-control-row strong { font-size: 11px; }
.settings-control-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.settings-control-row button { flex: 0 0 auto; }

.twofa-hero-visual { position: relative; min-height: 190px; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(216,219,226,.12), transparent 58%); }
.phone-illustration { position: relative; width: 126px; height: 166px; padding: 42px 12px 12px; display: grid; align-content: center; justify-items: center; gap: 6px; border: 2px solid var(--border-bright); border-radius: 26px; background: var(--panel-2); box-shadow: 0 24px 60px rgba(0,0,0,.32); }
.phone-illustration::before { content: ""; position: absolute; top: 10px; width: 42px; height: 5px; border-radius: 999px; background: var(--border-bright); }
.phone-illustration i { font-size: 22px; font-style: normal; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .06em; }
.phone-illustration b { color: var(--muted); font-size: 9px; }
.shield-illustration { position: absolute; margin: 82px 0 0 128px; width: 58px; height: 58px; display: grid; place-items: center; border: 5px solid var(--panel); border-radius: 18px; background: var(--text); color: var(--bg); transform: rotate(7deg); }
.shield-illustration img { width: 30px; height: 30px; object-fit: contain; filter: invert(1); }
.twofa-steps { padding: 0 22px 22px; display: grid; gap: 8px; }
.twofa-steps article { padding: 12px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.twofa-steps article > b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 11px; }
.twofa-steps strong { font-size: 12px; }
.twofa-steps p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.twofa-guide-actions { padding: 0 22px 22px; display: grid; }
.twofa-setup { padding: 22px; display: grid; gap: 14px; }
.twofa-setup label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.setup-key { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.setup-key small { display: block; color: var(--muted); }
.setup-key button { width: 100%; margin-top: 6px; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; text-align: left; }
.setup-key code { overflow-wrap: anywhere; color: var(--text); }
.setup-key span { color: var(--accent); font-size: 10px; }
.authenticator-visual.compact { min-height: 100px; display: grid; place-items: center; }
.authenticator-visual.compact span { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.authenticator-visual.compact b { color: var(--muted); font-size: 10px; }

.auth-gate { width: 100%; }
.ban-gate { position: fixed; z-index: 3000; inset: 0; padding: 20px; display: grid; place-items: center; background: var(--bg); }
.ban-panel { width: min(520px, 100%); padding: clamp(28px, 5vw, 44px); display: grid; gap: 14px; border: 1px solid var(--danger-border); border-radius: 24px; background: var(--panel); text-align: center; }
.ban-panel .brand-mark { margin: 0 auto 8px; }
.ban-panel h1 { margin: 0; font-size: clamp(30px, 6vw, 42px); line-height: 1.05; }
.ban-panel p { margin: 0; color: #ffb3b8; font-size: 15px; }
.ban-panel small { color: var(--muted); }
.auth-panel { position: relative; width: 100%; padding: clamp(24px, 4vw, 38px); display: grid; gap: 24px; }
.auth-panel > .close-btn { position: absolute; top: 12px; right: 12px; }
.modal.auth-modal { width: min(500px, 100%); }
.auth-modal-backdrop.is-open { background: rgba(0, 0, 0, .46); }
body.is-guest .rail .account-entry { display: flex; justify-content: center; background: var(--accent); color: var(--bg); }
body.is-guest .rail .account-entry > span:last-child { display: block; }
body.is-guest .account-entry strong { color: inherit; font-weight: 800; }
body.is-guest .account-entry .avatar,
body.is-guest .account-entry small,
body.is-guest .bottom-nav [data-view="account"] .avatar { display: none; }
body.is-guest .bottom-nav [data-view="account"] { justify-content: center; }
body.is-guest .bottom-nav [data-view="account"] small { font-size: 11px; font-weight: 800; color: var(--text); }
.auth-brand { width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border-bright); border-radius: 20px; background: #0d0d0d; box-shadow: 0 14px 34px rgba(0, 0, 0, .28); }
.auth-brand img { width: 100%; height: 100%; object-fit: cover; }
.auth-panel h1 { margin: 4px 0 8px; font-size: clamp(28px, 5vw, 38px); line-height: 1.08; letter-spacing: -.03em; }
.auth-panel p { margin: 0; color: var(--muted); }
.auth-kicker { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-form { display: none; gap: 14px; }
.auth-form.active { display: grid; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 50px; }
.password-field > button { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; padding: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.password-field > button:hover { background: var(--panel-3); color: var(--text); }
.password-field svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.check-label { grid-template-columns: 22px minmax(0, 1fr) !important; align-items: start; gap: 10px !important; line-height: 1.45; }
.check-label input { width: 22px; min-height: 22px; height: 22px; margin: 0; padding: 0; appearance: none; border-radius: 7px; cursor: pointer; }
.check-label input:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 5px var(--accent); }
.check-label input:checked::after { content: ""; width: 8px; height: 4px; margin: 6px auto 0; display: block; border-bottom: 2px solid var(--bg); border-left: 2px solid var(--bg); transform: rotate(-45deg); }
.turnstile-slot { min-height: 0; display: flex; justify-content: center; }

.toast-layer { position: fixed; z-index: 2200; inset-inline: 0; bottom: calc(18px + var(--safe-bottom)); display: grid; place-items: center; pointer-events: none; }
.toast { max-width: min(460px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid var(--border-bright); border-radius: 14px; background: var(--panel-2); color: var(--text); opacity: 0; transform: translateY(12px); transition: opacity var(--ease), transform var(--ease); }
.toast.show { opacity: 1; transform: none; }
.bottom-nav { display: none; }

@media (min-width: 1200px) {
  .rail {
    right: auto;
    width: var(--sidebar-w);
    height: calc(100dvh - (var(--gutter) * 2) - var(--safe-top) - var(--safe-bottom));
    padding: 18px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    border-radius: var(--radius-xl);
  }
  .rail-brand { gap: 12px; padding: 3px 5px 12px; font-size: 21px; }
  .rail-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .rail-nav { flex-direction: column; align-items: stretch; gap: 4px; }
  .rail .nav-btn { width: 100%; }
  .account-entry { max-width: none; margin: 8px 0 0; }
  .rail-wallet { margin-top: auto; padding: 16px; display: grid; gap: 7px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); }
  .rail-wallet > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
  .rail-wallet strong { overflow-wrap: anywhere; font-size: 16px; }
  .stage { padding-top: calc(var(--gutter) + var(--safe-top)); padding-left: calc(max(var(--gutter), var(--safe-left)) + var(--sidebar-w) + clamp(24px, 2.2vw, 32px)); }
  .messenger { height: calc(var(--app-viewport-height, 100dvh) - (var(--gutter) * 2) - var(--safe-top) - var(--safe-bottom)); }
}

@media (max-width: 1199px) {
  :root { --gutter: 20px; }
  .rail { gap: 12px; }
  .rail-nav { gap: 2px; }
  .nav-btn { padding-inline: 10px; }
  .nav-btn > span:not(.line-icon):not(.avatar) { display: none; }
  .account-entry > span:last-child { display: none; }
  .account-entry { max-width: none; margin-left: auto; display: flex; padding: 5px; }
  .trust-strip { grid-template-columns: 1fr; }
  .account-page { grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.2fr); }
  .messenger { grid-template-columns: 320px minmax(0, 1fr); }
  .gallery-stage { min-height: 480px; }
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --radius-xl: 22px;
    --radius-lg: 20px;
    --mobile-nav-gap: max(10px, var(--safe-bottom));
    --mobile-nav-height: 66px;
    --mobile-stage-bottom: 96px;
  }
  html,
  body { max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
  body { font-size: 13px; touch-action: pan-y; }
  input,
  select,
  textarea { font-size: 16px; }
  body[data-app-view="messages"] { height: var(--app-viewport-height, 100dvh); min-height: 0; overflow: hidden; overscroll-behavior: none; }
  body.standalone-app { --mobile-nav-gap: max(10px, var(--safe-bottom)); --mobile-stage-bottom: 96px; --chat-input-bottom-padding: 8px; }
  .rail { display: none; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand-word { font-size: 14px; }
  .rail-nav { justify-content: flex-end; }
  .rail-nav > .nav-btn:not(.account-entry) { display: none; }
  .stage { min-height: 100dvh; padding: calc(12px + var(--safe-top)) max(var(--gutter), var(--safe-right)) calc(18px + var(--safe-bottom)) max(var(--gutter), var(--safe-left)); }
  .view.active:not(#messagesView) { padding-bottom: var(--mobile-stage-bottom); }
  .bottom-nav { position: fixed !important; z-index: 120; left: 12px; right: 12px; top: auto !important; bottom: var(--mobile-nav-gap) !important; min-height: var(--mobile-nav-height); padding: 7px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; border: 1px solid var(--border-bright); border-radius: 22px; background: rgba(17,18,21,.94); box-shadow: 0 18px 44px rgba(0,0,0,.46); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transform: none !important; transition: none; touch-action: pan-y; will-change: auto; }
  body.standalone-app .bottom-nav { left: 12px; right: 12px; bottom: var(--mobile-nav-gap) !important; min-height: var(--mobile-nav-height); padding: 7px; border: 1px solid var(--border-bright); border-radius: 22px; }
  .bottom-nav .nav-btn { min-width: 0; min-height: 52px; padding: 4px 2px; flex-direction: column; justify-content: center; gap: 3px; border-radius: 14px; font-size: 10px; }
  .bottom-nav .line-icon { width: 20px; height: 20px; flex-basis: 20px; }
  .bottom-nav small { display: block; min-width: 0; max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav .avatar.mini { width: 22px; height: 22px; }
  .view-hero { min-height: 78px; margin-bottom: 18px; }
  .view-hero h1 { font-size: 32px; }
  .view-hero p { font-size: 12px; }
  .market-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .filter-toggle { display: grid; }
  .market-toolbar > .primary-btn { display: none; }
  .market-account { display: none; }
  .category-panel { padding: 0; border: 0; background: transparent; }
  .filters.mobile-collapsed { display: none; }
  .filters { padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
  .suggest-list { grid-template-columns: 1fr; }
  .suggest-product { align-items: stretch; flex-direction: column; }
  .suggest-product > button:first-child { width: 100%; }
  .suggest-product .ghost-btn { width: 100%; }
  .market-hero { min-height: 310px; padding: 24px; align-items: flex-start; }
  .hero-copy { max-width: 100%; }
  .market-hero h1 { font-size: clamp(34px, 10vw, 40px); }
  .market-hero p { max-width: 92%; }
  .hero-art { top: auto; right: 18px; bottom: 18px; width: 44%; height: 118px; padding: 15px; border-radius: 38px 18px 38px 18px; }
  .hero-art strong { font-size: 64px; }
  .section-heading { align-items: start; }
  .section-heading small { display: none; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-media { margin: 8px 8px 0; border-radius: 13px; }
  .product-body { padding: 11px 11px 13px; }
  .product-body h3 { font-size: 12px; }
  .price { font-size: 12px; }
  .like-btn { top: 7px; right: 7px; width: 34px; height: 34px; flex-basis: 34px; }
  .owner-badge,
  .reserved-badge { max-width: calc(100% - 14px); }
  .trust-strip { padding: 22px; gap: 22px; }
  .trust-strip h2 { font-size: 24px; }
  .trust-facts { grid-template-columns: 1fr; }
  .trust-facts article { min-height: 74px; }
  .following-strip { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .circle-arrow { width: 38px; height: 38px; flex-basis: 38px; }
  .stats-row { grid-template-columns: 1fr; }
  .inventory-item,
  .order-row,
  .deal-row { grid-template-columns: 1fr; }
  .inventory-item { grid-template-columns: 72px minmax(0, 1fr); }
  .inventory-item .item-actions { grid-column: 2; justify-content: flex-end; }
  .item-actions,
  .order-side,
  .deal-actions { align-items: stretch; justify-content: flex-start; flex-wrap: wrap; }
  .inventory-item .item-actions { grid-column: 1 / -1; justify-content: flex-end; align-items: center; }
  .order-side,
  .deal-actions { flex-direction: row; }
  body[data-app-view="messages"] .stage { position: fixed; inset: var(--visual-viewport-offset-top, 0px) 0 auto 0; height: var(--app-viewport-height, 100dvh); padding: calc(6px + var(--safe-top)) max(var(--safe-right), 0px) 0 max(var(--safe-left), 0px); overflow: hidden; overscroll-behavior: none; touch-action: pan-y; }
  body[data-app-view="messages"] .view.active { height: 100%; min-height: 0; overflow: hidden; }
  .messenger { width: 100%; max-width: 100%; height: calc(100dvh - 12px - var(--safe-top) - 92px - var(--safe-bottom)); min-height: 0; display: block; overflow: hidden; overscroll-behavior: contain; }
  body[data-app-view="messages"] .messenger { height: calc(var(--app-viewport-height, 100dvh) - var(--safe-top) - 6px - var(--mobile-stage-bottom) - var(--safe-bottom)); }
  body[data-app-view="messages"].chat-open-mobile .messenger { height: calc(var(--app-viewport-height, 100dvh) - var(--safe-top) - 6px - var(--mobile-stage-bottom) - var(--safe-bottom)); }
  body[data-app-view="messages"].chat-open-mobile { --mobile-stage-bottom: 0px; }
  body[data-app-view="messages"].chat-open-mobile .bottom-nav { display: none !important; }
  .chat-list-wrap,
  .chat-pane { width: 100%; max-width: 100%; height: 100%; border-inline: 0; border-radius: 0; }
  .chat-list-head,
  .chat-head { padding-inline: 10px; }
  .chat-search { margin-inline: 10px; }
  .chat-list { touch-action: pan-y; }
  .chat-pane { display: none; }
  .messenger.chat-open .chat-list-wrap { display: none; }
  .messenger.chat-open .chat-pane { display: grid; }
  .chat-back { display: grid; }
  .chat-tools .ghost-btn { width: 42px; padding: 0; overflow: hidden; }
  .chat-tools .ghost-btn span { display: none; }
  .chat-context-head { min-width: 0; max-width: 42px; width: 42px; padding: 2px; grid-template-columns: 1fr; border-radius: 11px; }
  .chat-context-head img { width: 36px; height: 36px; }
  .chat-context-head span { display: none; }
  .chat-messages { padding: 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .message { max-width: 86%; }
  .message.has-media { width: min(310px, 86%); max-width: 86%; }
  .message-form { grid-template-columns: 44px minmax(0, 1fr) 48px; padding-inline: 8px; padding-bottom: var(--chat-input-bottom-padding, 8px); }
  .message-form .primary-btn { width: 48px; padding: 0; overflow: hidden; }
  .message-form .primary-btn span { display: none; }
  .message-form .primary-btn svg { display: block; }
  .account-page { display: grid; grid-template-columns: 1fr; grid-template-areas: "profile" "balance" "twofa" "telegram" "reviews" "rules"; }
  .profile-card { grid-template-columns: 72px minmax(0, 1fr); padding: 20px; }
  .avatar.big { width: 72px; height: 72px; }
  .account-metrics { grid-column: 1 / -1; }
  .balance-actions { grid-template-columns: 1fr 1fr; }
  .balance-actions .primary-btn { grid-column: 1 / -1; }
  .deposit-action-row { align-items: stretch; flex-direction: column; }
  .deposit-action-row > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .deposit-action-row > .ghost-btn { width: 100%; }
  .deposit-proof-button,
  .deposit-action-row .primary-btn { width: 100%; min-height: 48px; padding-inline: 10px; }
  .account-reviews-panel { align-items: stretch; flex-direction: column; }
  .deals-tabs { padding: 4px; gap: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .deals-tabs button { width: 100%; min-width: 0; padding-inline: 4px; flex: initial; font-size: 10px; white-space: normal; }
  .deals-tabs button span { min-width: 19px; margin-left: 2px; padding-inline: 3px; }
  .deal-tab-panel > .order-list,
  .deal-tab-panel > .deal-list { padding: 12px; }
  .account-disclaimer { align-items: flex-start; }
  .modal-backdrop { padding: calc(10px + var(--safe-top)) 12px 0; overflow: hidden; overscroll-behavior: contain; }
  .modal { width: calc(100vw - 24px); max-height: calc(var(--app-viewport-height, 100dvh) - 10px - var(--safe-top)); padding-bottom: calc(var(--mobile-stage-bottom) + var(--safe-bottom)); border-radius: 22px 22px 0 0; }
  .modal-head { min-height: 58px; padding-top: 10px; }
  .product-modal-backdrop { z-index: 90; padding: calc(10px + var(--safe-top)) max(var(--gutter), var(--safe-right)) 0 max(var(--gutter), var(--safe-left)); }
  .product-modal { height: calc(var(--app-viewport-height, 100dvh) - 10px - var(--safe-top)); max-height: none; padding-bottom: 0; overflow-y: auto; }
  .product-detail { height: auto; padding-bottom: calc(var(--mobile-stage-bottom) + var(--safe-bottom)); grid-template-columns: 1fr; gap: 12px; }
  .gallery,
  .detail-info { padding: 12px; border-radius: 22px; }
  .gallery-stage { min-height: clamp(210px, 72vw, 340px); }
  .detail-info { height: auto; padding: 22px; overflow: visible; }
  .detail-info h2 { font-size: 30px; }
  .listing-form { grid-template-columns: 1fr; padding: 18px; }
  .listing-form > *,
  .listing-form .wide { grid-column: 1; }
  .fee-preview { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid.single-photo-grid { grid-template-columns: minmax(0, min(210px, 100%)); justify-content: center; }
  .seller-profile { padding: 14px; }
  .seller-hero { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; }
  .seller-profile .avatar.big { width: 64px; height: 64px; }
  .seller-main h2 { font-size: 21px; line-height: 1.08; }
  .official-profile .seller-main h2 { font-size: 26px; }
  .seller-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex-direction: initial; gap: 7px; }
  .seller-actions button { min-height: 42px; padding-inline: 8px; font-size: 11px; }
  .seller-stats { margin-top: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .seller-stats > * { min-height: 58px; padding: 8px 6px; align-items: center; text-align: center; }
  .seller-stats small { font-size: 9px; }
  .seller-stats strong { font-size: 12px; line-height: 1.15; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-tabs { padding: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .settings-tabs button { min-width: 0; padding: 8px; text-align: center; }
  .ledger-row { align-items: flex-start; flex-direction: column; }
  .auth-panel { padding: 24px 20px; border-radius: 22px; }
  .toast-layer { bottom: calc(90px + var(--safe-bottom)); }
  body.keyboard-open .bottom-nav { display: none !important; }
  body.keyboard-open { --chat-input-bottom-padding: 8px; }
  body.keyboard-open .messenger { height: calc(var(--app-viewport-height, 100dvh) - var(--safe-top) - 6px); }
  body.keyboard-open .toast-layer { bottom: calc(8px + var(--safe-bottom)); }
  .message-actions { position: static; width: fit-content; margin: -4px -6px 6px auto; opacity: 1; transform: none; }
  .message.announcement { width: 94%; max-width: 94%; }
  .telegram-link-preview { grid-template-columns: 38px minmax(0, 1fr); }
  .telegram-link-preview > b { display: none; }
  .telegram-preview-avatar { width: 38px; height: 38px; }
  .twofa-banner { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 14px; }
  .telegram-profile-banner { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; }
  .security-orbit,
  .telegram-mark { width: 40px; height: 40px; }
  .customization-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-profile-content { padding: 22px; grid-template-columns: 64px minmax(0, 1fr); }
  .device-session { grid-template-columns: 36px minmax(0, 1fr); }
  .device-session > button,
  .device-session > b { grid-column: 2; justify-self: start; }
}

@media (display-mode: standalone) and (max-width: 767px) {
  body {
    --mobile-nav-gap: max(10px, var(--safe-bottom));
    --mobile-stage-bottom: 96px;
    --chat-input-bottom-padding: 8px;
  }

  .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: var(--mobile-nav-gap) !important;
    min-height: var(--mobile-nav-height, 66px);
    padding: 7px;
    border: 1px solid var(--border-bright);
    border-radius: 22px;
  }
}

@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .market-grid { grid-template-columns: 1fr; }
  .hero-art { width: 48%; }
  .account-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .balance-actions { grid-template-columns: 1fr; }
  .balance-actions .primary-btn { grid-column: auto; }
}

@media (min-width: 768px) and (max-height: 600px) {
  .messenger {
    height: calc(var(--app-viewport-height, 100dvh) - var(--nav-h) - (var(--gutter) * 2) - 28px);
    min-height: 0;
  }
}

@media (min-width: 768px) and (max-height: 780px) {
  .product-modal-backdrop { padding: 18px; }
  .product-modal { height: calc(var(--app-viewport-height, 100dvh) - 36px); }
  .product-detail { gap: 16px; }
  .gallery,
  .detail-info { padding: 12px; border-radius: 22px; }
  .gallery { gap: 8px; }
  .gallery-thumb { width: 58px; height: 58px; flex-basis: 58px; }
  .detail-info { padding: 18px 22px; }
  .detail-info h2 { font-size: 30px; }
  .price.large { margin: 7px 0 10px; font-size: 30px; }
  .detail-info p { margin: 8px 0; }
  .detail-description { padding-top: 8px; }
  .seller-card { margin-top: 8px; }
  .escrow-note { padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Cohesive application surfaces: hierarchy and dividers replace card nesting. */
.line-icon img,
.like-btn img,
.pinned-badge img,
.circle-arrow img,
.gallery-arrow img,
.chat-back img,
.attachment-btn img,
.notification-bell img,
.edit-profile-btn img,
.logout-account-btn img,
.security-orbit img,
.chat-tool-btn img,
.chat-overflow-menu img,
.chat-pin-mini img,
.seller-card > img,
.escrow-note > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.line-icon img { opacity: .68; }
.like-btn img { width: 18px; height: 18px; object-fit: contain; }
.pinned-badge img { width: 17px; height: 17px; object-fit: contain; }
.like-btn img { opacity: .82; }
.like-btn.liked, .like-btn.liked:hover { border-color: transparent; background: transparent; color: #f05d72; box-shadow: none; }
.like-btn.liked img { display: none; }
.like-btn.liked::after { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: url("assets/icons/favorite_filled.svg") center / contain no-repeat; mask: url("assets/icons/favorite_filled.svg") center / contain no-repeat; }
.like-btn::before { content: ""; position: absolute; width: 44px; height: 44px; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.nav-btn:hover .line-icon img { opacity: 1; }
.nav-btn.active .line-icon img { filter: invert(1); opacity: 1; }
.notification-bell img,
.edit-profile-btn img,
.logout-account-btn img { width: 19px; height: 19px; opacity: .82; }
.security-orbit img { width: 23px; height: 23px; filter: invert(1); }

.category-panel,
.market-suggest-panel,
.seller-line,
.follow-card,
.suggest-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.category-panel { padding: 0; background: transparent; }
.follow-list { gap: 14px; }
.follow-card { flex-basis: 82px; padding-inline: 4px; background: transparent; }
.seller-line { border: 0; border-radius: var(--radius-sm); background: var(--panel); }
.market-suggest-panel { padding-inline: 0; background: transparent; }
.suggest-list { gap: 8px; }
.suggest-card { border: 0; border-radius: var(--radius-sm); background: var(--panel); }
.suggest-card:hover { border-color: var(--border); background: var(--panel); transform: none; }

.product-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.product-card:hover { border-color: var(--border-bright); background: var(--panel); transform: translateY(-1px); }
.product-media { margin: 0; border-radius: 10px; }
.product-body { padding: 12px 12px 16px; gap: 4px; }
.product-body h3 { min-height: auto; font-size: 15px; font-weight: 800; letter-spacing: -.015em; }
.product-body .price { margin-top: 1px; color: var(--text); font-size: 14px; }
.product-seller { min-width: 0; overflow: hidden; color: #c2c4c9; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.product-seller .verified-mark { width: 13px; height: 13px; vertical-align: -2px; }
.product-meta { color: var(--muted-soft); font-size: 10px; }

.stats-row article,
.deal-tab-panel > .order-list,
.deal-tab-panel > .deal-list,
.active-orders-panel,
.active-deals-panel,
.deal-history,
.rules-list,
.inventory-list {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.deal-tab-panel > .order-list,
.deal-tab-panel > .deal-list { padding: 0; background: transparent; }
.stats-row { gap: 0; border-block: 1px solid var(--border); }
.stats-row article { min-height: 96px; background: transparent; }
.stats-row article + article { border-left: 1px solid var(--border); }
.inventory-list,
.order-list,
.deal-list { gap: 10px; }
.inventory-list { padding: 0; background: transparent; }
.inventory-list.is-empty { padding: 0; background: transparent; }
.inventory-item,
.order-row,
.deal-row { padding: 16px; border: 0; border-radius: var(--radius-sm); background: var(--panel); }
.inventory-item:last-child,
.order-row:last-child,
.deal-row:last-child { border-bottom: 0; }
.deals-tabs { padding: 0 0 8px; gap: 4px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.deals-tabs button { border-radius: 10px; }
.deals-tabs button.active { background: var(--panel-2); color: var(--text); }
.deals-tabs button.active span { background: var(--border); color: var(--text); }
.locked-listing-label,
.transaction-lock-copy { color: var(--muted); font-size: 10px; font-weight: 700; }
.danger-text { color: var(--danger); }

.profile-card,
.balance-card { border: 1px solid var(--border); border-radius: 20px; background: var(--panel); }
.account-reviews-panel,
.account-settings-panel { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.twofa-banner,
.telegram-profile-banner { border-radius: 16px; }
.notification-bell { border: 0; background: transparent; }
.notification-bell-dot { border-color: var(--panel); }

/* Messenger is three application regions, not nested dashboard cards. */
.messenger { gap: 0; }
.messenger:not(.chat-open) { grid-template-columns: minmax(0, 1fr); }
.chat-pane[hidden] { display: none !important; }
.chat-list-wrap,
.chat-pane {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--panel);
}
.chat-list-wrap { border-right: 1px solid var(--border); }
.chat-search { margin: 10px 12px; border: 0; border-radius: 10px; }
.chat-list { padding: 8px; }
.chat-row { min-height: 70px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent; }
.chat-row:hover { border-color: var(--border); background: var(--panel-2); }
.chat-row.active { border-color: var(--border); background: var(--panel-2); box-shadow: none; }
.chat-head { position: relative; min-height: 66px; }
.chat-tools { margin-left: auto; gap: 4px; }
.chat-tool-btn {
  width: 40px;
  height: 40px;
  padding: 10px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .08em;
}
.chat-tool-btn:hover { background: var(--panel-2); }
.overflow-glyph { display: block; font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: 0; transform: translateY(-1px); }
.chat-overflow { position: relative; }
.chat-overflow > summary { list-style: none; cursor: pointer; }
.chat-overflow > summary::-webkit-details-marker { display: none; }
.chat-overflow-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 6px;
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: 0 16px 44px rgba(0,0,0,.4);
}
.chat-overflow-menu button { min-height: 42px; padding: 0 10px; display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 10px; border-radius: 8px; background: transparent; text-align: left; }
.chat-overflow-menu button:hover { background: var(--panel-3); }
.chat-overflow-menu img { width: 18px; height: 18px; }
.chat-message-search { position: absolute; z-index: 12; inset: 8px 10px; display: grid; grid-template-columns: 20px minmax(0,1fr) 34px; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.chat-message-search > img { width: 18px; height: 18px; margin-left: 8px; opacity: .7; }
.chat-message-search input,
.chat-message-search input:focus { min-height: 44px; padding: 0; border: 0; background: transparent; }
.chat-message-search button { width: 34px; height: 34px; background: transparent; color: var(--muted); }
.chat-messages { padding-inline: max(22px, calc((100% - 880px) / 2)); }
.message { max-width: min(720px, 78%); border: 0; background: #242529; }
.message.me { border: 0; background: #e7e7ea; color: #111214; }
.message.system { border: 0; background: transparent; color: var(--muted); }
.message.announcement { border: 1px solid var(--border); background: var(--panel-2); }
.message.search-hidden { display: none; }
.message-action-menu { display: flex; gap: 2px; }
.message-more { display: none; }
.message-form { padding-inline: max(10px, calc((100% - 920px) / 2)); background: var(--panel); }
.message-form input { border: 0; border-radius: 10px; }
.chat-pane > .message-form { align-self: end; }

/* Product image remains dominant; secondary information uses dividers. */
.product-modal-backdrop { z-index: 100; }
.product-detail { gap: 0; background: transparent; }
.gallery,
.detail-info { border: 0; border-radius: 0; }
.gallery { background: transparent; }
.detail-info { padding-top: 18px; border-left: 1px solid var(--border); background: transparent; }
.gallery-stage { border-radius: 12px; background: transparent; }
.gallery-thumb { padding: 0; border: 0; border-radius: 8px; background: transparent; opacity: .55; }
.gallery-thumb.active { border: 0; background: transparent; opacity: 1; box-shadow: 0 0 0 1px var(--text); }
.gallery-thumb img { border-radius: 8px; }
.detail-secondary-actions { grid-template-columns: 1fr auto; align-items: center; }
.product-report-action { min-height: 40px; padding: 0 8px; background: transparent; color: var(--danger); font-size: 11px; font-weight: 700; }
.product-report-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.seller-card { border: 0; border-block: 1px solid var(--border); border-radius: 0; background: transparent; }
.seller-card:hover { background: var(--panel-2); }
.seller-card > img { width: 18px; height: 18px; opacity: .66; }
.escrow-note { padding: 11px 0; grid-template-columns: 20px minmax(0,1fr); align-items: center; border: 0; border-radius: 0; background: transparent; }
.escrow-note > img { width: 20px; height: 20px; opacity: .7; }
.escrow-note span,
.escrow-note strong,
.escrow-note small { display: block; }
.escrow-note strong { color: var(--text); }
.escrow-note small { margin-top: 2px; color: var(--muted); font-size: 10px; }

@media (min-width: 768px) and (max-width: 900px),
       (min-width: 768px) and (max-height: 600px) {
  .product-modal { overflow-y: auto; }
  .product-detail { height: auto; min-height: 100%; grid-template-columns: minmax(0, 1fr); }
  .gallery { min-height: 360px; grid-template-rows: minmax(280px, 1fr) auto; }
  .gallery-stage { min-height: 280px; }
  .detail-info { height: auto; overflow: visible; border-top: 1px solid var(--border); border-left: 0; }
}

/* Public profile composition; these styles do not change marketplace cards. */
.seller-profile-modal .modal-head { min-height: 56px; padding: 10px 22px; }
.seller-profile-modal .modal-head .close-btn { width: 34px; height: 34px; }
.seller-profile:not(.official-profile) .seller-hero { min-height: 160px; }
.seller-profile:not(.official-profile) .seller-main h2 { font-size: 26px; }
.seller-profile:not(.official-profile) .avatar.big { width: 112px; height: 112px; }
.seller-profile:not(.official-profile) .seller-actions { align-self: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 48px; width: 224px; }
.seller-profile:not(.official-profile) .seller-actions .primary-btn { grid-column: 1 / -1; }
.seller-profile:not(.official-profile) .seller-actions .ghost-btn { grid-column: 1 / -1; }
.seller-profile:not(.official-profile) .seller-actions:has(#reviewSeller) .ghost-btn { grid-column: auto; }
.seller-profile:not(.official-profile) .seller-actions button { min-width: 0; min-height: 0; padding: 6px 9px; }
.seller-profile:not(.official-profile) .seller-actions .danger-btn { grid-column: 1 / -1; }
.seller-main { align-self: center; padding-top: 12px; }
.seller-avatar { position: relative; overflow: visible; align-self: start; margin-top: 8px; }
.profile-presence-dot { position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; border: 3px solid var(--panel); border-radius: 50%; background: #75c69a; }
.seller-followers.presence-online { color: #75c69a; }
.seller-bio { padding: 0; border: 0; border-radius: 0; background: transparent; }
.seller-stats, .account-metrics { gap: 10px; border: 0; container-type: inline-size; }
.seller-stats > *, .account-metrics > * { min-width: 0; min-height: 70px; padding: 12px; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; background: rgba(21,22,25,.88); text-align: left; color: var(--text); }
.profile-metric-copy { min-width: 0; overflow-wrap: anywhere; }
.seller-stats small, .account-metrics small { display: block; margin: 0; font-size: 10px; }
.seller-stats strong, .account-metrics strong { display: block; margin-top: 5px; font-size: 15px; }
.seller-stats .profile-review-count { color: var(--muted); font-size: 10px; font-weight: 500; }
.seller-stats button:hover, .account-metrics button:hover { background: var(--panel-3); }
/* The same compact layout follows the available profile width, including the
   narrower account column on desktop; labels never squeeze beside an icon. */
@container (max-width: 520px) {
  .seller-stats > *, .account-metrics > * { min-height: 82px; padding: 8px 4px; flex-direction: column; gap: 3px; text-align: center; }
  .seller-stats .profile-metric-icon, .account-metrics .profile-metric-icon { width: 20px; height: 20px; }
  .seller-stats small, .account-metrics small { min-height: 24px; font-size: 9px; line-height: 12px; }
  .seller-stats strong, .account-metrics strong { margin-top: 2px; font-size: 13px; line-height: 17px; }
}
.seller-actions .ghost-btn,
.seller-actions .danger-btn { border-color: transparent; background: transparent; }
.seller-actions .danger-btn { color: var(--danger); }
.seller-products-tabs { padding: 0 0 8px; gap: 8px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.seller-products-tabs button { border-radius: 10px; }
.seller-products-tabs small { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 5px; padding-inline: 6px; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 10px; }
.seller-products-tabs .active small { background: var(--border); color: var(--text); }
.followers-list { display: grid; gap: 8px; padding: 18px; }
.follower-row { width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--panel-2); text-align: left; }
.follower-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.follower-row strong, .follower-row small { display: block; }
.follower-row small { margin-top: 3px; color: var(--muted); }

/* Promotion actions belong to listing management, not a nested explainer card. */
.listing-promotion-menu[open] { z-index: 16; }
.listing-promotion-menu.opens-up .chat-overflow-menu { top: auto; bottom: calc(100% + 6px); }
.listing-monetization-actions { margin-top: 0; align-items: center; }
.listing-monetization-actions .ghost-btn { display: block; min-height: 42px; padding: 8px 10px; border: 0; border-radius: 8px; font-size: 11px; }

/* Notifications form one timeline and retain the modal's complete rounding. */
.notifications-modal { overflow: hidden; }
.notification-center { max-height: calc(var(--app-viewport-height) - 120px); display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
.notification-list { padding: 0 12px 12px; gap: 8px; overflow-y: auto; }
.notification-item { padding: 10px 12px; grid-template-columns: 8px minmax(0,1fr) auto; border: 0; border-radius: var(--radius-sm); background: var(--panel-2); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.telegram { border-color: var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb, #2aabee 8%, transparent); }
.notification-item.telegram > i { box-shadow: none; }

.site-background-control,
.profile-background-control { padding: 0; border: 0; border-radius: 0; background: transparent; }
.site-background-preview { width: 132px; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 10px; }
.site-background-preview img { width: 100%; height: 100%; object-fit: cover; }
.site-background-control > div:last-of-type,
.profile-background-control > div:last-of-type { align-items: center; }
.photo-builder-hint { color: var(--muted); font-size: 10px; }
.photo-add.empty { min-height: 118px; font-size: 13px; }

@media (min-width: 1200px) {
  .rail {
    top: 0;
    left: 0;
    height: 100dvh;
    width: 252px;
    padding: 24px 18px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: var(--panel);
  }
  .rail-brand { font-size: 24px; }
  .rail-brand .brand-mark { width: 52px; height: 52px; border-radius: 13px; }
  .stage { padding-left: calc(252px + clamp(24px, 2.2vw, 36px)); }
  body[data-app-view="messages"] .stage { height: 100dvh; padding: 0 0 0 252px; }
  body[data-app-view="messages"] .messenger { height: 100dvh; min-height: 0; }
}

@media (max-width: 767px) {
  html { min-height: 100%; background: var(--bg); }
  html[data-app-view="messages"] { background: var(--panel); }
  body { min-height: 100dvh; background-color: var(--bg); }
  body.modal-open { position: fixed; width: 100%; overflow: hidden; }
  .stage { min-height: 100dvh; padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-nav-gap) + 18px); }
  .view.active:not(#messagesView) { padding-bottom: 0; }
  .bottom-nav,
  body.standalone-app .bottom-nav {
    bottom: max(10px, var(--safe-bottom)) !important;
    border: 1px solid var(--border);
    border-radius: 24px !important;
    background: rgba(17,18,20,.9);
    overflow: hidden;
  }
  .bottom-nav .nav-btn { border-radius: 17px; }

  body[data-app-view="messages"] { height: min(var(--app-viewport-height, 100dvh), 100dvh); background: var(--panel); }
  body[data-app-view="messages"] .app-shell { height: 100%; min-height: 0; overflow: hidden; }
  body[data-app-view="messages"] .stage {
    top: var(--visual-viewport-offset-top, 0px);
    bottom: auto;
    height: min(var(--app-viewport-height, 100dvh), 100dvh);
    /* dvh can stay unchanged behind a software keyboard. Do not let the
       normal page's min-height override the measured visual viewport. */
    min-height: 0;
    padding: 0;
    background: var(--panel);
  }
  body[data-app-view="messages"] #messagesView { background: var(--panel); }
  body[data-app-view="messages"] .view.active { height: 100%; }
  .messenger,
  body[data-app-view="messages"] .messenger,
  body[data-app-view="messages"].chat-open-mobile .messenger,
  body.keyboard-open .messenger { height: 100%; }
  .chat-list-wrap,
  .chat-pane { height: 100%; }
  .chat-list { padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-nav-gap) + 18px); }
  .messenger.chat-open .chat-pane { grid-template-rows: auto auto minmax(0,1fr) auto auto; }
  body.keyboard-open .messenger.chat-open .chat-pane { grid-template-rows: auto minmax(0,auto) minmax(0,1fr) minmax(0,auto) auto; }
  body.keyboard-open .chat-pinned-message,
  body.keyboard-open .support-actions { min-height: 0; overflow-y: auto; }
  .chat-head { min-height: 58px; padding: 7px 8px; }
  .chat-head-main { gap: 8px; }
  .chat-head-main .avatar { width: 36px; height: 36px; }
  .chat-head-main > div > span { max-width: 150px; }
  .chat-context-head { width: 38px; max-width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; }
  .chat-context-head img { width: 38px; height: 38px; border-radius: 8px; }
  .chat-tools { gap: 0; }
  .chat-tool-btn { width: 40px; height: 40px; padding: 10px; }
  .chat-overflow .overflow-glyph { font-size: 20px; }
  .chat-overflow-menu { right: 0; width: min(220px, calc(100vw - 24px)); }
  .chat-message-search { inset: 6px 8px; }
  .chat-messages { padding: 12px 10px; }
  .message { max-width: 84%; padding: 10px 12px; border-radius: 15px 15px 15px 5px; }
  .message.me { border-radius: 15px 15px 5px 15px; }
  .message.has-media { width: min(310px, 84%); max-width: 84%; }
  .message-actions { position: absolute; top: 3px; right: 3px; width: auto; margin: 0; padding: 0; border: 0; background: transparent; opacity: 1; transform: none; }
  .message-more { width: 28px; height: 24px; padding: 0; display: grid; place-items: center; color: currentColor; opacity: .6; }
  .message-action-menu { position: absolute; z-index: 8; top: 27px; right: 0; min-width: 132px; padding: 4px; display: none; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
  .message.context-open .message-action-menu { display: grid; }
  .message-action-menu button { min-height: 36px; padding: 0 10px; text-align: left; }
  .message:not(.system) > span:first-of-type { padding-right: 20px; }
  .message-form { position: relative; z-index: 4; align-self: end; padding: 8px 8px var(--chat-input-bottom-padding, max(8px, var(--safe-bottom))); border-top: 1px solid var(--border); }
  body.keyboard-open { --chat-input-bottom-padding: 8px; }

  .following-strip { align-items: start; }
  .following-strip > .circle-arrow { margin-top: 14px; }
  .follow-card { grid-template-rows: 46px auto; align-content: start; }

  .modal-backdrop {
    inset: auto 0 auto 0;
    top: var(--visual-viewport-offset-top, 0px);
    height: min(var(--app-viewport-height, 100dvh), 100dvh);
    padding: max(8px, var(--safe-top)) 10px max(8px, var(--safe-bottom));
    place-items: center;
    overflow: hidden;
  }
  .modal {
    width: 100%;
    max-height: 100%;
    padding-bottom: 0;
    border-radius: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-block: 72px max(24px, var(--safe-bottom));
  }
  .product-modal-backdrop {
    top: var(--visual-viewport-offset-top, 0px);
    height: min(var(--app-viewport-height, 100dvh), 100dvh);
    padding: 0;
    place-items: stretch;
  }
  .product-modal-backdrop .product-modal,
  .product-modal-backdrop.is-open .product-modal,
  .product-modal-backdrop.is-closing .product-modal { transform: none; }
  .product-modal { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
  .product-detail { height: auto; min-height: 100%; padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-nav-gap) + 18px); gap: 0; }
  .gallery,
  .detail-info { padding: 12px; border-radius: 0; }
  .detail-info { padding: 22px 18px; border-top: 1px solid var(--border); border-left: 0; }
  .gallery-stage { min-height: clamp(240px, 86vw, 390px); }
  .detail-secondary-actions { grid-template-columns: 1fr auto; }

  .seller-profile { padding: 18px 14px max(26px, var(--safe-bottom)); }
  .seller-profile-intro.has-background { margin: -18px -14px 0; padding: 18px 14px 0; }
  .seller-profile-modal .modal-head { padding-inline: 14px; }
  .seller-profile:not(.official-profile) .seller-hero { min-height: 0; grid-template-columns: 80px minmax(0, 1fr); }
  .seller-profile:not(.official-profile) .avatar.big { width: 80px; height: 80px; }
  .seller-profile:not(.official-profile) .seller-main h2 { font-size: 22px; }
  .seller-profile:not(.official-profile) .seller-actions { grid-column: 1 / -1; width: 100%; min-height: 91px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 42px 42px; align-content: start; }
  .seller-profile:not(.official-profile) .seller-actions .primary-btn { grid-column: 1 / -1; }
  .seller-profile:not(.official-profile) .seller-actions .ghost-btn { grid-column: auto; }
  .seller-profile:not(.official-profile) .seller-actions .danger-btn { grid-column: auto; }
  .seller-stats, .account-metrics { gap: 6px; }
  .seller-stats > *, .account-metrics > * { min-height: 82px; padding: 8px 4px; flex-direction: column; justify-content: flex-start; gap: 3px; text-align: center; border-radius: 10px; }
  .seller-stats .profile-metric-icon, .account-metrics .profile-metric-icon { width: 20px; height: 20px; }
  .seller-stats strong, .account-metrics strong { margin-top: 2px; font-size: 13px; line-height: 17px; }
  .seller-stats small,
  .account-metrics small,
  .seller-stats .profile-review-count { font-size: 9px; }
  .seller-stats small, .account-metrics small { min-height: 24px; line-height: 12px; }

  .reviews-modal .review-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }
  .reviews-modal .review-filters .chip { width: 100%; min-width: 0; padding-inline: 8px; }

  .notifications-modal { border-radius: 18px; }
  .notification-center { max-height: calc(var(--app-viewport-height) - 82px - var(--safe-top) - var(--safe-bottom)); }
  .notification-list { padding-bottom: max(10px, var(--safe-bottom)); }
  .customization-categories { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
