/* ============================================================
   NULLNET — iOS-native design system
   SF Pro / Inter · OLED black · glass 20px · spring motion
   ============================================================ */

/* ---------------- 1. TOKENS ---------------- */

:root {
  color-scheme: dark;

  /* OLED-база: чистый чёрный + слоистые поверхности */
  --bg: #000000;
  --bg-2: #0a0a0c;
  --surface-1: rgba(22, 22, 24, 0.72);
  --surface-2: rgba(28, 28, 30, 0.68);
  --surface-3: rgba(44, 44, 46, 0.60);
  --surface-solid: #1c1c1e;
  --panel: rgba(22, 22, 24, 0.66);
  --panel-solid: #1c1c1e;
  --panel-hi: rgba(255, 255, 255, 0.06);

  /* iOS-подобные разделители: 0.5px hairlines */
  --line: rgba(84, 84, 88, 0.55);
  --line-soft: rgba(84, 84, 88, 0.32);
  --line-strong: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.14);
  --fill: rgba(120, 120, 128, 0.20);
  --fill-2: rgba(120, 120, 128, 0.14);
  --fill-3: rgba(120, 120, 128, 0.09);

  /* шкала текста (iOS label / secondaryLabel / tertiaryLabel) */
  --ink-0: #ffffff;
  --ink-1: rgba(235, 235, 245, 0.92);
  --ink-2: rgba(235, 235, 245, 0.60);
  --ink-3: rgba(235, 235, 245, 0.30);
  --ink-4: rgba(235, 235, 245, 0.18);

  --text: #ffffff;
  --text-dim: rgba(235, 235, 245, 0.60);
  --text-mute: rgba(235, 235, 245, 0.30);

  /* акценты: только успех и разрушительное действие, точечно */
  --green: #30d158;
  --green-bright: #7ef2a4;
  --green-12: rgba(48, 209, 88, 0.13);
  --green-24: rgba(48, 209, 88, 0.24);
  --green-40: rgba(48, 209, 88, 0.42);
  --green-glow: 0 0 0 0.5px var(--green-40), 0 6px 22px rgba(48, 209, 88, 0.14);

  --red: #ff453a;
  --red-bright: #ff8a80;
  --red-12: rgba(255, 69, 58, 0.13);
  --red-24: rgba(255, 69, 58, 0.24);
  --red-40: rgba(255, 69, 58, 0.42);
  --red-glow: 0 0 0 0.5px var(--red-40), 0 6px 22px rgba(255, 69, 58, 0.14);

  --hero-grid: rgba(255, 255, 255, 0.04);

  /* стекло */
  --glass: blur(20px) saturate(180%);
  --glass-strong: blur(30px) saturate(190%);
  --glass-thin: blur(12px) saturate(150%);

  /* непрерывные скругления iOS */
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;
  --r-pill: 999px;

  --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.7);
  --inner-hi: inset 0 0.5px 0 rgba(255, 255, 255, 0.10);

  /* пружины: iOS/SwiftUI */
  --spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --spring-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-snap: cubic-bezier(0.2, 1.2, 0.3, 1);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 0.16s var(--ease);
  --mid: 0.32s var(--ease);
  --slow: 0.55s var(--ease);
  --press: 0.14s;

  --nav-h: 52px;
  --tabbar-h: 52px;
  --shell-max: 1180px;
  --gutter: 18px;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
          'Inter', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', SFMono-Regular,
               Menlo, Consolas, monospace;
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-2: #f2f2f7;
  --surface-1: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(255, 255, 255, 0.72);
  --surface-3: rgba(118, 118, 128, 0.12);
  --surface-solid: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-hi: rgba(0, 0, 0, 0.03);

  --line: rgba(60, 60, 67, 0.20);
  --line-soft: rgba(60, 60, 67, 0.12);
  --line-strong: rgba(0, 0, 0, 0.16);
  --hairline: rgba(0, 0, 0, 0.10);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.09);
  --fill-3: rgba(118, 118, 128, 0.06);

  --ink-0: #000000;
  --ink-1: rgba(0, 0, 0, 0.90);
  --ink-2: rgba(60, 60, 67, 0.60);
  --ink-3: rgba(60, 60, 67, 0.30);
  --ink-4: rgba(60, 60, 67, 0.18);

  --text: #000000;
  --text-dim: rgba(60, 60, 67, 0.60);
  --text-mute: rgba(60, 60, 67, 0.30);

  --green: #1f9d3d;
  --green-bright: #157f30;
  --green-12: rgba(31, 157, 61, 0.11);
  --green-24: rgba(31, 157, 61, 0.20);
  --green-40: rgba(31, 157, 61, 0.36);

  --red: #d70015;
  --red-bright: #b3000f;
  --red-12: rgba(215, 0, 21, 0.10);
  --red-24: rgba(215, 0, 21, 0.20);
  --red-40: rgba(215, 0, 21, 0.36);

  --hero-grid: rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 16px 48px rgba(0, 0, 0, 0.12);
  --inner-hi: inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
}

/* ---------------- 2. RESET & BASE ---------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.011em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}

@media (min-width: 1024px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
input, textarea, select { background: none; border: 0; }
ul, ol { list-style: none; }

::selection { background: rgba(255, 255, 255, 0.18); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--text-mute); }

/* iOS-подобные focus */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
[data-theme='light'] :focus-visible { outline-color: rgba(0, 0, 0, 0.5); }

/* ---------------- 3. BACKGROUND ---------------- */

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--slow);
}
[data-theme='light'] #bg-canvas { opacity: 0.3; }

/* мягкое свечение сверху — «живой» OLED-фон */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.055), transparent 62%),
    radial-gradient(80% 50% at 100% 0%, rgba(255, 255, 255, 0.030), transparent 60%);
}
[data-theme='light'] body::before {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(0, 0, 0, 0.045), transparent 62%),
    radial-gradient(80% 50% at 100% 0%, rgba(0, 0, 0, 0.025), transparent 60%);
}

/* ---------------- 4. HEADER (glass) ---------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 10, 12, 0.55);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  transition: background var(--mid), box-shadow var(--mid);
}
[data-theme='light'] .nav { background: rgba(250, 250, 252, 0.62); }

.nav.scrolled {
  background: rgba(10, 10, 12, 0.80);
  box-shadow: 0 0.5px 0 var(--line);
}
[data-theme='light'] .nav.scrolled {
  background: rgba(250, 250, 252, 0.86);
  box-shadow: 0 0.5px 0 var(--line);
}

.nav-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--fast);
}
.brand:active { opacity: 0.5; }

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-0);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.2);
  animation: breathe 3.6s var(--ease) infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.86); }
}

.brand-mark { font-weight: 300; color: var(--ink-2); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav-stat b { color: var(--ink-0); font-weight: 600; }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2.5px var(--green-12);
  animation: pulseDot 2.4s var(--ease) infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 var(--green-40); }
  70% { box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.icon-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  background: var(--fill-3);
  box-shadow: var(--inner-hi);
  color: var(--ink-1);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--press) var(--spring), background var(--fast), opacity var(--fast);
}
.icon-btn:active { transform: scale(0.9); opacity: 0.6; }

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  color: var(--ink-0);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--press) var(--spring), opacity var(--fast);
}
.avatar-btn:active { transform: scale(0.9); opacity: 0.6; }

/* desktop segmented control */
.nav-tabs { display: none; }

@media (min-width: 1024px) {
  .nav-inner { gap: 20px; }
  .nav-tabs {
    display: flex;
    gap: 2px;
    margin: 0 auto;
    padding: 3px;
    border-radius: var(--r-pill);
    background: var(--fill-3);
    box-shadow: var(--inner-hi);
  }
  .nav-right { margin-left: 0; }
  .nav-tab {
    position: relative;
    padding: 5px 16px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    transition: color var(--fast), transform var(--press) var(--spring);
  }
  .nav-tab.active {
    color: var(--ink-0);
    background: var(--surface-3);
    box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.3);
  }
  .nav-tab:active { transform: scale(0.95); }
}

/* ---------------- 5. TAB BAR (iOS bottom) ---------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 10, 12, 0.62);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: 0 -0.5px 0 var(--line);
}
[data-theme='light'] .tabbar { background: rgba(250, 250, 252, 0.78); }

@media (min-width: 1024px) { .tabbar { display: none; } }

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  transition: color var(--fast);
  -webkit-tap-highlight-color: transparent;
}
.tabbar-item.active { color: var(--ink-0); }
.tabbar-item:active { opacity: 0.55; }

.tabbar-ico {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  transition: transform var(--press) var(--spring);
}
.tabbar-item.active .tabbar-ico { animation: tabPop 0.42s var(--spring); }
.tabbar-item:active .tabbar-ico { transform: scale(0.86); }
@keyframes tabPop {
  0% { transform: scale(0.78); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.tabbar-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar-lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------------- 6. SHELL & VIEWS ---------------- */

.shell {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + env(safe-area-inset-top) + 18px) var(--gutter) 40px;
}

@media (min-width: 1024px) {
  .shell { padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + 28px); }
}

.view { display: none; }
.view.active {
  display: block;
  animation: viewIn var(--slow) var(--spring-soft) backwards;
}
.view.active.back { animation-name: viewBack; }

@keyframes viewIn {
  from { opacity: 0; transform: translate3d(22px, 0, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes viewBack {
  from { opacity: 0; transform: translate3d(-22px, 0, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 7. SECTION HEADS ---------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-title {
  font-size: 30px;
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--ink-0);
}
@media (min-width: 768px) { .section-title { font-size: 34px; } }

.section-title .accent {
  font-weight: 300;
  color: var(--ink-2);
}

.section-sub {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.side-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-foot {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 0.5px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
}
.side-foot b { color: var(--ink-1); font-weight: 600; }

.inv-title { margin-bottom: 14px; }

/* ---------------- 8. CARDS / GLASS ---------------- */

.glass {
  position: relative;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-thin);
  backdrop-filter: var(--glass-thin);
  border-radius: var(--r-lg);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline), var(--shadow);
}

.side-card {
  padding: 16px;
  margin-bottom: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-thin);
  backdrop-filter: var(--glass-thin);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
}

/* ---------------- 9. LAYOUTS ---------------- */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.forum-layout,
.profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
@media (min-width: 1024px) {
  .forum-layout { grid-template-columns: minmax(0, 1fr) 316px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr) 316px; }
}
.forum-layout aside,
.profile-layout aside {
  position: sticky;
  top: calc(var(--nav-h) + env(safe-area-inset-top) + 16px);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  box-shadow: var(--inner-hi);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color var(--fast), background var(--fast), transform var(--press) var(--spring);
}
.tab.active {
  color: var(--ink-0);
  background: var(--surface-3);
}
.tab:active { transform: scale(0.94); }

/* ---------------- 10. CHIPS ---------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  box-shadow: var(--inner-hi), 0 0 0 0.5px transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  transition: background var(--fast), color var(--fast),
              transform var(--press) var(--spring), box-shadow var(--fast);
}
.chip:active { transform: scale(0.94); }

.chip.active {
  color: var(--ink-0);
  background: var(--surface-3);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
}

.chip .idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.chip.active .idx { color: var(--ink-2); }

.chip-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 11. BADGES ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--fill-3);
  color: var(--ink-2);
  box-shadow: var(--inner-hi);
}

.badge-dim { background: var(--fill-3); color: var(--ink-3); }

.badge-solid {
  background: var(--ink-0);
  color: var(--bg);
  box-shadow: none;
}

.badge-soft {
  background: var(--fill);
  color: var(--ink-1);
}

.badge-dash {
  background: transparent;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 0.5px var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  background: var(--fill-3);
  color: var(--ink-2);
  font-size: 12px;
}

/* ---------------- 12. THREAD LIST ---------------- */

.thread-list { display: flex; flex-direction: column; gap: 10px; }

.thread {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 15px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-thin);
  backdrop-filter: var(--glass-thin);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  cursor: pointer;
  transition: transform var(--fast) var(--ease-out), background var(--fast),
              box-shadow var(--fast);
}
.thread:active { transform: scale(0.985); background: var(--surface-2); }

@media (hover: hover) {
  .thread:hover {
    background: var(--surface-2);
    box-shadow: var(--inner-hi), 0 0 0 0.5px var(--line-strong), var(--shadow);
  }
}

.thread.pinned { box-shadow: var(--inner-hi), 0 0 0 0.5px var(--line-strong); }

.thread-av,
.user-av,
.post-av,
.comment-av,
.online-av {
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-0);
  display: grid;
  place-items: center;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  overflow: hidden;
}
.thread-av { width: 40px; height: 40px; font-size: 15px; }
.post-av { width: 38px; height: 38px; font-size: 15px; }
.comment-av { width: 32px; height: 32px; font-size: 13px; }
.online-av { width: 30px; height: 30px; font-size: 12px; }
.user-av { width: 38px; height: 38px; font-size: 15px; }

.thread-body { min-width: 0; }

.thread-title {
  font-size: 16.5px;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--ink-0);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.thread-excerpt {
  margin-top: 5px;
  font-size: 14.5px;
  line-height: 1.44;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}
.thread-foot .who { color: var(--ink-2); font-weight: 500; }

.thread-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.thread-stat { display: inline-flex; align-items: center; gap: 5px; }
.thread-stat .ic {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

/* ---------------- 13. POST & COMMENTS ---------------- */

.post {
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-thin);
  backdrop-filter: var(--glass-thin);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  margin-bottom: 14px;
}

.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-who { min-width: 0; }

.post-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-0);
}

.post-time { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }

.post-body {
  font-size: 16.5px;
  line-height: 1.56;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.post-body strong { color: var(--ink-0); font-weight: 600; }

.post-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--line-soft);
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.like-btn,
.mini-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  color: var(--ink-1);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--press) var(--spring), background var(--fast),
              color var(--fast), opacity var(--fast);
}
.like-btn:active,
.mini-action:active { transform: scale(0.93); }

.like-btn .heart { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; }
.like-btn .n,
.mini-action .n { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.like-btn.liked,
.mini-action.liked,
.mini-action.ok {
  color: var(--green);
  background: var(--green-12);
}
.like-btn.liked .n,
.mini-action.liked .n { color: var(--green); }

.mini-action.danger { color: var(--red); background: var(--red-12); }

.comment {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--line-soft);
}
.comment:last-child { border-bottom: 0; }

.comment-main { min-width: 0; }

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comment-name { font-size: 14.5px; font-weight: 600; color: var(--ink-0); }

.comment-text {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions { margin-top: 10px; display: flex; gap: 7px; flex-wrap: wrap; }
.comment-actions .mini-action { height: 28px; padding: 0 11px; font-size: 13px; }

/* ---------------- 14. MARKET ---------------- */

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 12px;
}

.num-card,
.inv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass-thin);
  backdrop-filter: var(--glass-thin);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--fast) var(--ease-out), background var(--fast),
              box-shadow var(--fast);
}
.num-card:active,
.inv-card:active { transform: scale(0.985); }

@media (hover: hover) {
  .num-card:hover,
  .inv-card:hover {
    background: var(--surface-2);
    box-shadow: var(--inner-hi), 0 0 0 0.5px var(--line-strong), var(--shadow);
  }
}

/* мягкий блик, следующий за курсором */
.num-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--mid);
  background: radial-gradient(
    180px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.055), transparent 70%);
}
@media (hover: hover) { .num-card:hover::after { opacity: 1; } }

.num-card.sold { opacity: 0.44; }
.num-card.sold .buy-btn { pointer-events: none; }

.num-head,
.inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.num-code,
.inv-number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}

.cc {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--ink-1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.num-meta { display: flex; flex-direction: column; gap: 1px; }

.num-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13.5px;
  min-width: 0;
}
.num-row .k { color: var(--ink-3); white-space: nowrap; }
.num-row .v {
  color: var(--ink-1);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.bar {
  height: 3px;
  margin-top: 11px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--ink-2);
  transition: width var(--slow) var(--ease-out);
}

.num-foot {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 0.5px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.num-price { display: flex; align-items: baseline; gap: 5px; }
.num-price .val {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.num-price .cur {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.buy-btn {
  height: 36px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--ink-0);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: var(--inner-hi);
  transition: transform var(--press) var(--spring), background var(--fast), opacity var(--fast);
}
.buy-btn:active { transform: scale(0.93); opacity: 0.7; }
.buy-btn:disabled { opacity: 0.4; }

@media (hover: hover) { .buy-btn:hover { background: var(--surface-3); } }

.sep { height: 0.5px; background: var(--line-soft); margin: 14px 0; border: 0; }

/* ---------------- 15. INVENTORY ---------------- */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.inv-card { cursor: default; }
.inv-card.inv-dead { opacity: 0.5; }

.inv-actions {
  margin-top: 14px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ---------------- 16. PROFILE HERO ---------------- */

.profile-hero {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline), var(--shadow);
  margin-bottom: 22px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 55%),
    var(--hero-grid);
  background-size: auto, 26px 26px;
  pointer-events: none;
}
.hero-bg video { width: 100%; height: 100%; object-fit: cover; }

.hero-body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 24px 22px 20px;
  flex-wrap: wrap;
}

.hero-av {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-0);
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
}
.hero-av video { width: 100%; height: 100%; object-fit: cover; }

.hero-id { flex: 1; min-width: 0; padding-top: 2px; }

.hero-name {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.026em;
  color: var(--ink-0);
}

.hero-handle {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-2);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.hero-bio {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.48;
  color: var(--ink-2);
  max-width: 54ch;
  white-space: pre-wrap;
  word-break: break-word;
}

.hero-tags { margin-top: 12px; display: flex; gap: 7px; flex-wrap: wrap; }

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0.5px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.18);
}
[data-theme='light'] .hero-stats { background: rgba(0, 0, 0, 0.02); }

.hstat {
  padding: 14px 8px;
  text-align: center;
  border-right: 0.5px solid var(--line-soft);
}
.hstat:last-child { border-right: 0; }

.hstat .n {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.hstat .l { margin-top: 2px; font-size: 11px; color: var(--ink-3); }

/* ---------------- 17. AVATAR FRAMES (nf-*) ---------------- */

.nf-none { border: 0; }
.nf-thin { box-shadow: 0 0 0 1px var(--line-strong); }
.nf-solid { box-shadow: 0 0 0 2px var(--ink-0); }
.nf-double { box-shadow: 0 0 0 1px var(--ink-0), 0 0 0 3px var(--line-strong); }
.nf-dashed { box-shadow: 0 0 0 1px var(--line-strong); border: 1px dashed var(--ink-2); }
.nf-glow { box-shadow: 0 0 0 1px var(--line-strong), 0 0 22px rgba(255, 255, 255, 0.16); }
.nf-bright { box-shadow: 0 0 0 2px var(--ink-0), 0 0 18px rgba(255, 255, 255, 0.24); }
.nf-offset { box-shadow: 3px 3px 0 0 var(--line-strong); }
.nf-dot {
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 0 4px transparent;
  outline: 1px dotted var(--ink-2);
  outline-offset: 2px;
}

.frame-picker,
.presets,
.badge-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 9px;
}

.frame-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 11px 6px;
  border-radius: var(--r);
  background: var(--fill-3);
  font-size: 11.5px;
  color: var(--ink-2);
  transition: background var(--fast), transform var(--press) var(--spring);
}
.frame-opt:active { transform: scale(0.94); }
.frame-opt.sel { background: var(--surface-3); color: var(--ink-0); }

.frame-opt i {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface-3);
  display: block;
}

.preset {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--fill-3);
  transition: transform var(--press) var(--spring);
}
.preset:active { transform: scale(0.94); }
.preset canvas { display: block; width: 100%; height: 58px; }
.preset .nm {
  display: block;
  padding: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--fill-3);
}

.badge-opt {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--fill-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  transition: background var(--fast), color var(--fast), transform var(--press) var(--spring);
}
.badge-opt:active { transform: scale(0.94); }
.badge-opt.sel { background: var(--ink-0); color: var(--bg); }

.video-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 116px;
  padding: 18px;
  border-radius: var(--r);
  background: var(--fill-3);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  text-align: center;
  color: var(--ink-1);
  cursor: pointer;
  transition: background var(--fast), transform var(--press) var(--spring);
}
.video-drop:active { transform: scale(0.985); }
.video-drop.over { background: var(--fill); }
.video-drop .ic {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* ---------------- 18. PEOPLE / SIDEBAR ---------------- */

.user-list { display: flex; flex-direction: column; gap: 3px; }

.user-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 9px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--fast), transform var(--press) var(--spring);
}
.user-row:active { transform: scale(0.98); }
@media (hover: hover) { .user-row:hover { background: var(--fill-3); } }
.user-row.is-me { background: var(--fill-3); }

.user-main { min-width: 0; }

.user-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.user-handle { font-size: 14.5px; font-weight: 600; color: var(--ink-0); }
.user-handle b { color: var(--ink-0); font-weight: 700; }
.user-tg { font-size: 13px; color: var(--ink-2); font-family: var(--font-mono); }
.user-tg b { color: var(--ink-1); font-weight: 600; }
.user-tg-none { color: var(--ink-4); font-style: italic; font-family: var(--font); }

.user-bio {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.38;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-foot {
  margin-top: 5px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-3);
}

.user-go { color: var(--ink-4); font-size: 15px; padding-right: 3px; }

.user-card-big { display: flex; align-items: center; gap: 15px; }
.user-av-big { width: 62px; height: 62px; font-size: 24px; border-radius: 20px; }
.user-card-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-0); }
.user-card-handle { font-size: 14px; color: var(--ink-2); font-family: var(--font-mono); }
.user-card-tg {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-0);
  font-family: var(--font-mono);
  box-shadow: 0 0 0 0.5px var(--line-strong);
  border-radius: var(--r-xs);
  padding: 2px 7px;
}

.tg-empty {
  padding: 16px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
}

.online-list { display: flex; flex-direction: column; gap: 9px; }
.online-item { display: flex; align-items: center; gap: 10px; }
.online-name { font-size: 14px; font-weight: 500; color: var(--ink-1); }
.online-role { font-size: 12px; color: var(--ink-3); }

/* ---------------- 19. TELEGRAM CARD ---------------- */

.tg-user { display: flex; align-items: center; gap: 12px; }
.tg-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline);
  flex-shrink: 0;
}
.tg-photo-empty {
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-0);
}
.tg-user-info { flex: 1; min-width: 0; }
.tg-name { font-size: 15.5px; font-weight: 600; color: var(--ink-0); }
.tg-username {
  font-size: 13.5px;
  color: var(--ink-2);
  font-family: var(--font-mono);
}

.tg-setup { display: flex; flex-direction: column; gap: 13px; }

.tg-mount {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tg-mount-label {
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tg-note {
  margin: 12px 0;
  padding: 12px 13px;
  border-radius: var(--r);
  background: var(--fill-3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.code-box {
  padding: 15px;
  border-radius: var(--r);
  background: var(--fill-3);
  box-shadow: inset 0 0 0 0.5px var(--line-soft);
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink-0);
}

/* ---------------- 20. BUTTONS ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.011em;
  white-space: nowrap;
  background: var(--fill-3);
  color: var(--ink-0);
  box-shadow: var(--inner-hi);
  transition: transform var(--press) var(--spring), background var(--fast),
              opacity var(--fast), box-shadow var(--fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.955); opacity: 0.65; }

.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn-block { display: flex; width: 100%; }

.btn-primary {
  background: var(--ink-0);
  color: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
@media (hover: hover) { .btn-primary:hover { background: #ebebf0; } }
[data-theme='light'] .btn-primary:hover { background: #1c1c1e; }
.btn-primary:active { background: var(--ink-2); }

.btn-ghost {
  background: var(--fill-3);
  color: var(--ink-1);
}
@media (hover: hover) { .btn-ghost:hover { background: var(--fill); } }

.btn-ok {
  background: var(--green-12);
  color: var(--green);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--green-24);
}
@media (hover: hover) { .btn-ok:hover { background: var(--green-24); } }

.btn-danger {
  background: var(--red-12);
  color: var(--red);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--red-24);
}
@media (hover: hover) { .btn-danger:hover { background: var(--red-24); } }

/* ---------------- 21. FORMS ---------------- */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.003em;
  padding-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--r);
  background: var(--fill-3);
  box-shadow: inset 0 0 0 0.5px var(--line-soft);
  color: var(--ink-0);
  font-size: 16px;
  letter-spacing: -0.011em;
  transition: background var(--fast), box-shadow var(--fast);
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--ink-4); }

.input:focus,
.select:focus,
.textarea:focus {
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.select {
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select option { background: var(--surface-solid); color: var(--ink-0); }

.search-box { position: relative; flex: 1; min-width: 190px; }
.search-box .input { padding-left: 15px; }

/* iOS switch */
.switch {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  padding: 3px 0;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch .track {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: var(--r-pill);
  background: var(--fill);
  flex-shrink: 0;
  transition: background var(--mid) var(--ease);
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform var(--mid) var(--spring-soft);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch .lbl { font-size: 15px; color: var(--ink-1); }
.switch:active .track::after { width: 30px; }

/* ---------------- 22. MODAL ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--mid) var(--ease), visibility var(--mid);
}
.overlay.open { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: min(86vh, 780px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  border-radius: var(--r-xl);
  background: rgba(28, 28, 30, 0.86);
  -webkit-backdrop-filter: var(--glass-strong);
  backdrop-filter: var(--glass-strong);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline), var(--shadow-lift);
  color: var(--text);
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  transition: transform var(--mid) var(--spring-soft), opacity var(--fast);
  overscroll-behavior: contain;
}
[data-theme='light'] .modal { background: rgba(250, 250, 252, 0.9); }
.overlay.open .modal { transform: none; opacity: 1; }

/* свайп вниз для закрытия */
.modal.dragging { transition: none; }
.modal.dragged { transform: scale(0.94) translateY(var(--drag-y, 0px)); opacity: var(--drag-o, 1); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.modal-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink-0);
}

.modal-close {
  flex-shrink: 0;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform var(--press) var(--spring), opacity var(--fast);
}
.modal-close:active { transform: scale(0.9); opacity: 0.6; }

.modal-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 0.5px solid var(--line-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-foot .btn { flex: 1; max-width: 168px; }

/* ---------------- 23. TOASTS ---------------- */

.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + var(--nav-h) + 12px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 17px;
  border-radius: var(--r-pill);
  background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline), var(--shadow);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-0);
  animation: toastIn 0.44s var(--spring) both;
}
[data-theme='light'] .toast { background: rgba(250, 250, 252, 0.9); }

.toast.out { animation: toastOut 0.34s var(--ease) both; }

.toast .ic {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--fill);
  color: var(--ink-1);
  flex-shrink: 0;
}
.toast.ok .ic { background: var(--green-12); color: var(--green); }
.toast.err .ic { background: var(--red-12); color: var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

/* ---------------- 24. EMPTY STATE ---------------- */

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty-state .ic {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}
.empty-state p { font-size: 14px; color: var(--ink-3); }

/* ---------------- 25. DROP ANIMATION ---------------- */

.drop-stage {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
}
.drop-stage.open { display: flex; animation: fadeIn 0.3s var(--ease) both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 45%, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 15%, transparent 72%);
}

.drop-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  animation: scanY 2.2s var(--ease) infinite;
}
@keyframes scanY {
  0% { top: -2%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 102%; opacity: 0; }
}

.drop-caption {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  text-align: center;
}
.drop-caption-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.drop-caption-sub { margin-top: 5px; font-size: 13px; color: var(--ink-3); }

.drop-slot {
  position: relative;
  width: 268px;
  height: 172px;
  display: grid;
  place-items: center;
}

.drop-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.drop-ring-2 { border-color: rgba(255, 255, 255, 0.13); }

.drop-shadow {
  position: absolute;
  bottom: 16px;
  width: 190px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  filter: blur(9px);
  opacity: 0;
}

.drop-card {
  position: relative;
  width: 244px;
  padding: 16px;
  border-radius: var(--r-xl);
  background: rgba(28, 28, 30, 0.9);
  -webkit-backdrop-filter: var(--glass-strong);
  backdrop-filter: var(--glass-strong);
  box-shadow: var(--inner-hi), 0 0 0 0.5px var(--hairline), var(--shadow-lift);
  will-change: transform, opacity;
}

.drop-stage.shake .drop-slot { animation: shakeIt 0.28s var(--ease); }
@keyframes shakeIt {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-7px); }
  46% { transform: translateX(6px); }
  72% { transform: translateX(-3px); }
}

.drop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.drop-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--ink-2);
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--fill);
}
.drop-number {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink-0);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.drop-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.drop-meta-item { font-size: 11.5px; color: var(--ink-3); }
.drop-bar { height: 3px; border-radius: var(--r-pill); background: var(--fill-3); overflow: hidden; }
.drop-bar-fill { height: 100%; background: var(--ink-0); border-radius: var(--r-pill); }

/* ---------------- 26. MOTION UTILITIES ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--spring-soft);
}
.reveal.shown { opacity: 1; transform: none; }

.stagger > * {
  animation: viewIn 0.5s var(--spring-soft) backwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }
.stagger > *:nth-child(n+9) { animation-delay: 0.34s; }

/* ---------------- 27. A11Y / GUARDS ---------------- */

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

@media (hover: none) {
  .num-card::after { display: none; }
}

::placeholder { color: var(--ink-4); }

/* ---------------- 28. RESPONSIVE ---------------- */

@media (max-width: 560px) {
  :root { --gutter: 15px; }
  .section-title { font-size: 27px; }
  .market-grid,
  .inv-grid { grid-template-columns: 1fr; }
  .thread { grid-template-columns: 36px minmax(0, 1fr); }
  .thread-av { width: 36px; height: 36px; font-size: 14px; }
  .thread-stats {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    padding-top: 2px;
  }
  .hero-body { padding: 20px 17px 17px; gap: 14px; }
  .hero-av { width: 64px; height: 64px; border-radius: 50%; font-size: 25px; }
  .hero-name { font-size: 21px; }
  .hstat .n { font-size: 18px; }
  .hstat .l { font-size: 10px; }
  .modal { padding: 17px; border-radius: var(--r-xl); }
  .modal-foot .btn { max-width: none; }
  .toasts { top: calc(env(safe-area-inset-top) + var(--nav-h) + 8px); }
}

/* ---------------- 29. PRESS OVERRIDES ---------------- */
/* .reveal / stagger задают transform — нажатия должны быть выше по каскаду */

.num-card.shown:active,
.num-card:active { transform: scale(0.985); }

.reveal.shown:active { transform: scale(0.99); }

.thread:active { transform: scale(0.985); }

.side-card:active,
.post:active { transform: scale(0.994); }
