/* ============================================================
   АМБРЕЛЛА — базовые токены
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-deep: #04060c;
  --surface: rgba(18, 25, 43, 0.72);
  --surface-solid: #121a2c;
  --surface-soft: rgba(31, 41, 66, 0.55);
  --surface-hover: rgba(38, 50, 80, 0.72);
  --border: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e9eefb;
  --text-soft: #c0c9dd;
  --muted: #8794ad;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --sidebar-w: 252px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fc;
  --bg-deep: #e9edf7;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: rgba(226, 232, 244, 0.72);
  --surface-hover: rgba(237, 242, 252, 0.95);
  --border: rgba(71, 85, 105, 0.14);
  --border-strong: rgba(71, 85, 105, 0.26);
  --text: #172033;
  --text-soft: #3b4761;
  --muted: #64748b;
  --shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   Фон
   ============================================================ */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(139, 92, 246, 0.18), transparent 42%),
    radial-gradient(circle at 98% 4%, rgba(34, 211, 238, 0.12), transparent 38%),
    var(--bg);
}

.aurora__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite alternate;
}
.aurora__orb--one {
  width: 420px;
  height: 420px;
  background: #6d28d9;
  top: -140px;
  left: 18%;
}
.aurora__orb--two {
  width: 360px;
  height: 360px;
  background: #0891b2;
  top: 30%;
  right: -120px;
  animation-delay: -6s;
}
.aurora__orb--three {
  width: 300px;
  height: 300px;
  background: #be185d;
  bottom: -140px;
  left: 40%;
  animation-delay: -11s;
  opacity: 0.28;
}
.aurora__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 80%);
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(30px, 45px, 0) scale(1.12);
  }
}

:root[data-theme="light"] .aurora {
  background:
    radial-gradient(circle at 12% -10%, rgba(139, 92, 246, 0.12), transparent 42%),
    radial-gradient(circle at 98% 4%, rgba(34, 211, 238, 0.12), transparent 38%),
    var(--bg);
}
:root[data-theme="light"] .aurora__orb {
  opacity: 0.2;
}

/* ============================================================
   Загрузка
   ============================================================ */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}
.boot-screen__logo {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.boot-screen__bar {
  width: 180px;
  height: 3px;
  border-radius: 99px;
  background: var(--surface-soft);
  overflow: hidden;
}
.boot-screen__bar span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: loading 1.1s ease-in-out infinite;
}
@keyframes loading {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(340%);
  }
}
.boot-screen p {
  margin: 0;
  font-size: 13px;
}

/* ============================================================
   Оболочка приложения
   ============================================================ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 21, 37, 0.82), rgba(9, 13, 24, 0.7));
  backdrop-filter: blur(22px);
}
:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 246, 252, 0.8));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.16));
  border: 1px solid rgba(139, 92, 246, 0.38);
  color: var(--accent-2);
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.18);
}
.brand__mark svg {
  width: 24px;
  height: 24px;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand__text strong {
  font-size: 16px;
  letter-spacing: 0.16em;
}
.brand__text small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 5px;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
  transform: translateX(2px);
}
.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.08));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  background: linear-gradient(var(--accent), var(--accent-2));
}
.nav-link__icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.nav-link__icon svg {
  width: 19px;
  height: 19px;
}
.nav-link__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sidebar__spacer {
  flex: 1;
}

.side-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.14), rgba(34, 211, 238, 0.06));
}
.side-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -55px;
  top: -55px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(45px);
  opacity: 0.35;
}
.side-card__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.side-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.side-card .btn {
  width: 100%;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.side-user__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.side-user__info strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user__info span {
  color: var(--muted);
  font-size: 11px;
}

.main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  padding: 14px clamp(20px, 3.4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px);
}
.topbar__left {
  min-width: 0;
}
.topbar__eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar__title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status-pill.is-online {
  color: var(--success);
}
.status-pill.is-online i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
  animation: glow 2s infinite;
}
@keyframes glow {
  50% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
}

.content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 42px) clamp(20px, 3.4vw, 48px) 72px;
  animation: fade-in 0.35s ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mobile-nav {
  display: none;
}

/* ============================================================
   Общие компоненты
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}
.btn:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
}
.btn:active {
  transform: translateY(0);
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #6d5cf6 55%, var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 28px rgba(109, 92, 246, 0.3);
}
.btn--primary:hover {
  background: linear-gradient(120deg, #9464f8, #7666f8 55%, #3ddbf0);
  box-shadow: 0 16px 34px rgba(109, 92, 246, 0.42);
}
.btn--ghost {
  border-color: var(--border-strong);
  background: transparent;
}
.btn--danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
  color: var(--danger);
}
.btn--sm {
  padding: 8px 12px;
  font-size: 12px;
}
.btn--block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-soft);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 99px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tag--accent {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.09);
}
.tag--pinned {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
}
.tag--bot {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
}
.tag--admin {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.14);
}

.avatar {
  --avatar-color: var(--accent);
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--avatar-color) 40%, transparent), color-mix(in srgb, var(--avatar-color) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--avatar-color) 45%, transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.avatar--sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 11px;
}
.avatar--lg {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
}
.avatar--online {
  position: relative;
}
.avatar--online::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface-solid);
}

.section {
  margin-top: 38px;
}
.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section__head h2 {
  margin: 0;
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.section__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
}
.section__link svg {
  width: 15px;
  height: 15px;
}
.section__link:hover {
  color: var(--text);
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state__icon {
  font-size: 30px;
  margin-bottom: 10px;
}
.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 5px;
}
.empty-state p {
  margin: 0;
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-soft), var(--surface-hover), var(--surface-soft));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ============================================================
   Главная
   ============================================================ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(26px, 4vw, 52px);
  border-radius: 30px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 85% 20%, rgba(34, 211, 238, 0.1), transparent 40%),
    linear-gradient(145deg, rgba(24, 32, 55, 0.85), rgba(11, 16, 29, 0.72));
  box-shadow: var(--shadow);
  overflow: hidden;
}
:root[data-theme="light"] .hero {
  background: radial-gradient(circle at 85% 20%, rgba(34, 211, 238, 0.12), transparent 40%), var(--surface);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.2;
}
.hero__content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 5.2vw, 66px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.hero h1 span {
  background: linear-gradient(110deg, #a78bfa, #67e8f9 55%, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  max-width: 520px;
  margin: 0 0 26px;
  color: var(--text-soft);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.7;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__trust {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
}
.avatar-stack {
  display: flex;
}
.avatar-stack .avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  margin-left: -8px;
  border: 2px solid var(--surface-solid);
}
.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.hero__visual {
  position: relative;
  min-height: 360px;
}
.hero-card {
  position: absolute;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.35);
  animation: float-card 7s ease-in-out infinite alternate;
}
@keyframes float-card {
  to {
    transform: translateY(-9px);
  }
}
.hero-card--chat {
  top: 6%;
  right: 4%;
  width: min(100%, 330px);
  padding: 16px;
}
.hero-card--topic {
  bottom: 6%;
  left: 0;
  width: min(85%, 290px);
  padding: 16px;
  animation-delay: -2.5s;
}
.hero-card--online {
  right: 0;
  bottom: 20%;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation-delay: -4s;
}
.hero-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.hero-card__head strong {
  font-size: 12px;
}
.hero-bubble {
  display: flex;
  gap: 9px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.hero-bubble:last-child {
  margin-bottom: 0;
}
.hero-bubble__body {
  min-width: 0;
}
.hero-bubble__body small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}
.hero-bubble__body p {
  margin: 0;
  padding: 8px 11px;
  border-radius: 4px 12px 12px 12px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}
.hero-bubble--own {
  flex-direction: row-reverse;
}
.hero-bubble--own .hero-bubble__body {
  text-align: right;
}
.hero-bubble--own .hero-bubble__body p {
  border-radius: 12px 4px 12px 12px;
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.3), rgba(34, 211, 238, 0.18));
  color: var(--text);
}
.hero-topic-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 8px;
}
.hero-card--topic h4 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
}
.hero-card--topic p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.hero-card--online strong {
  display: block;
  font-size: 15px;
}
.hero-card--online span {
  color: var(--muted);
  font-size: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.stat-card {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--accent-2);
}
.stat-card__icon svg {
  width: 20px;
  height: 20px;
}
.stat-card strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.category-card {
  --category-color: var(--accent);
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 18px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.22s, border-color 0.22s, background 0.22s;
}
.category-card__meta svg {
  width: 15px;
  height: 15px;
  color: var(--category-color);
}
.category-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--category-color);
  opacity: 0.8;
}
.category-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--category-color) 55%, transparent);
  background: var(--surface-hover);
}
.category-card.is-selected {
  border-color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 12%, var(--surface));
}
.category-card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--category-color) 16%, transparent);
  font-size: 20px;
  margin-bottom: 12px;
}
.category-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 700;
}
.category-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
}
.category-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
  gap: 18px;
}
.panel-pad {
  padding: 18px;
}

.topic-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.topic-row:last-child {
  border-bottom: 0;
}
.topic-row:hover {
  background: rgba(148, 163, 184, 0.04);
}
.topic-row__main {
  min-width: 0;
  flex: 1;
}
.topic-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}
.topic-row__title {
  display: inline-block;
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
.topic-row__title:hover {
  color: var(--accent-2);
}
.topic-row__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-row__stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}
.topic-row__stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topic-row__stats svg {
  width: 14px;
  height: 14px;
}

.online-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.online-card > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.online-list {
  display: grid;
  gap: 9px;
}
.online-person {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.online-person__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-person small {
  color: var(--muted);
  font-size: 10px;
}

.cta-banner {
  margin-top: 22px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(110deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.08));
}
.cta-banner h3 {
  margin: 0 0 5px;
  font-size: 17px;
}
.cta-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   Форум
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 6px 0 6px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.forum-panel {
  padding: 18px;
  margin-top: 18px;
}
.forum-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 210px;
}
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  outline: none;
  font-size: 13px;
}
.search-box input:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.select {
  padding: 10px 34px 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238794ad' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select:focus {
  border-color: rgba(139, 92, 246, 0.55);
}
.topic-list__label {
  padding: 12px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   Тема
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}
.back-link svg {
  width: 15px;
  height: 15px;
}
.back-link:hover {
  color: var(--accent-2);
}

.topic-detail {
  padding: clamp(20px, 3vw, 30px);
}
.topic-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.topic-detail h1 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.author-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-line__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.author-line__info strong {
  font-size: 13px;
}
.author-line__info span {
  color: var(--muted);
  font-size: 11px;
}
.topic-detail__body {
  margin: 22px 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}
.topic-detail__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.topic-detail__footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topic-detail__footer svg {
  width: 14px;
  height: 14px;
}

.posts-list {
  display: grid;
  gap: 12px;
}
.post-card {
  display: flex;
  gap: 14px;
  padding: 18px;
}
.post-card__content {
  min-width: 0;
  flex: 1;
}
.post-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.post-card__body {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.post-number {
  color: var(--muted);
  font-size: 11px;
}

.reply-box {
  margin-top: 18px;
  padding: 18px;
}
.reply-box__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.reply-box__head strong {
  font-size: 14px;
}

/* ============================================================
   Чат
   ============================================================ */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.chat-panel {
  height: min(74vh, 760px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.chat-header__title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.chat-header__title h2 {
  margin: 0;
  font-size: 15px;
}
.chat-header__title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.chat-header__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.guest-editor {
  display: flex;
  align-items: center;
  gap: 6px;
}
.guest-editor input {
  width: 120px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 12px;
  outline: none;
}
.guest-editor input:focus {
  border-color: rgba(139, 92, 246, 0.55);
}

.messages-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.date-divider::before,
.date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 88%;
  animation: message-in 0.25s ease;
}
@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.message.is-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message__content {
  min-width: 0;
}
.message__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px;
  font-size: 11px;
}
.message__meta strong {
  font-size: 12px;
}
.message__meta time {
  color: var(--muted);
}
.message__bubble {
  padding: 10px 13px;
  border-radius: 5px 14px 14px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.message.is-own .message__meta {
  justify-content: flex-end;
}
.message.is-own .message__bubble {
  border-radius: 14px 5px 14px 14px;
  border-color: rgba(139, 92, 246, 0.35);
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.28), rgba(34, 211, 238, 0.14));
  color: var(--text);
}
.message__guest-tag {
  color: var(--warning);
  font-size: 10px;
}

.typing-line {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}
.typing-line span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: blink 1.2s infinite;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}

.chat-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}
.composer-field {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-field:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.composer-field textarea {
  display: block;
  width: 100%;
  max-height: 130px;
  min-height: 44px;
  padding: 12px;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 13px;
  line-height: 1.5;
}
.composer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 8px;
}
.emoji-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  opacity: 0.75;
}
.emoji-btn:hover {
  background: var(--surface-hover);
  opacity: 1;
}
.send-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.3);
  transition: transform 0.18s, box-shadow 0.18s;
}
.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.42);
}
.send-btn svg {
  width: 19px;
  height: 19px;
}

/* ── Вложения в чате ─────────────────────────────────────────────── */
.composer-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}
.composer-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--border);
}
.attach-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.attach-btn svg {
  width: 17px;
  height: 17px;
}
.attach-btn--gif {
  width: 30px;
  font-size: 11px;
}
.attach-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--accent-2);
}
.attach-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.attach-btn.is-recording {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  animation: recordPulse 1.2s infinite;
}
@keyframes recordPulse {
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12); }
}
.record-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
}
.record-line::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: blink 1s infinite;
}
.pending-holder:not([hidden]) {
  padding: 7px 8px;
  border-radius: 11px;
  border: 1px dashed rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.06);
}
.pending-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pending-chip img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 7px;
  object-fit: cover;
}
.pending-voice {
  font-size: 12px;
  white-space: nowrap;
}
.pending-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.pending-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--surface-hover);
  color: var(--muted);
  cursor: pointer;
}
.pending-remove svg {
  width: 14px;
  height: 14px;
}
.pending-remove:hover {
  color: #ef4444;
}
.message-attachment--media {
  position: relative;
  display: block;
  width: min(260px, 100%);
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
}
.message-attachment--media img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  transition: transform 0.25s;
}
.message-attachment--media:hover img {
  transform: scale(1.03);
}
.media-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(280px, 100%);
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.message.is-own .voice-message {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
}
.voice-play {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.voice-track {
  position: relative;
  flex: 1;
  height: 26px;
  min-width: 0;
  overflow: hidden;
}
.voice-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(139, 92, 246, 0.18);
  border-radius: 4px;
  transition: width 0.15s linear;
}
.voice-bars {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.voice-bars i {
  flex: 1;
  min-width: 2px;
  height: 35%;
  border-radius: 2px;
  background: var(--accent-2);
  opacity: 0.6;
}
.voice-bars i:nth-child(3n) { height: 75%; }
.voice-bars i:nth-child(4n) { height: 55%; }
.voice-bars i:nth-child(5n) { height: 90%; }
.voice-message.is-playing .voice-bars i {
  animation: voiceWave 0.9s ease-in-out infinite alternate;
}
.voice-message.is-playing .voice-bars i:nth-child(2n) { animation-delay: 0.2s; }
@keyframes voiceWave {
  from { transform: scaleY(0.5); }
  to { transform: scaleY(1.25); }
}
.voice-duration {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chat-side {
  display: grid;
  gap: 14px;
}
.chat-side .panel {
  padding: 18px;
}
.chat-side h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.chat-side > .panel > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.presence-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.presence-count strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.presence-count span {
  color: var(--muted);
  font-size: 12px;
}
.chat-tips ul {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.chat-tips li::marker {
  color: var(--accent-2);
}

/* ============================================================
   О проекте
   ============================================================ */
.about-hero {
  padding: clamp(24px, 4vw, 40px);
}
.about-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.035em;
}
.about-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.75;
  font-size: 14px;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.about-card {
  padding: 20px;
}
.about-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.14);
  color: var(--accent-2);
  margin-bottom: 14px;
}
.about-card__icon svg {
  width: 20px;
  height: 20px;
}
.about-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ============================================================
   Аккаунт
   ============================================================ */
.account-menu {
  position: relative;
}
.account-menu summary {
  list-style: none;
  cursor: pointer;
}
.account-menu summary::-webkit-details-marker {
  display: none;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
}
.user-chip:hover {
  background: var(--surface-hover);
}
.user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 11px;
}
.account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 40;
  width: 210px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}
.account-menu__panel strong {
  display: block;
  padding: 0 6px 10px;
  font-size: 13px;
}
.account-menu__panel small {
  display: block;
  padding: 0 6px 12px;
  margin-top: -9px;
  color: var(--muted);
  font-size: 11px;
}
.account-menu__panel .btn {
  width: 100%;
}

/* ============================================================
   Модальные окна
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 13, 0.68);
  backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease;
  overflow-y: auto;
}
.modal {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal--wide {
  width: min(100%, 560px);
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal__close:hover {
  background: var(--surface-soft);
  color: var(--text);
}
.modal__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.14));
  color: var(--accent-2);
  margin-bottom: 16px;
}
.modal__icon svg {
  width: 23px;
  height: 23px;
}
.modal h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.modal__subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.modal-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.modal-tabs button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.modal-tabs button.is-active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.field {
  margin-bottom: 14px;
}
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}
.input,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  outline: none;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus,
.textarea:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}
.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.form-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.1);
  color: var(--danger);
  font-size: 12px;
}
.form-error.is-visible {
  display: block;
}
.form-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   Уведомления
   ============================================================ */
#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.25s ease;
}
.toast.is-leaving {
  animation: toast-out 0.25s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}
.toast__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.16);
  color: var(--accent-2);
  font-size: 12px;
}
.toast--success .toast__icon {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}
.toast--error .toast__icon {
  background: rgba(251, 113, 133, 0.14);
  color: var(--danger);
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    min-height: 300px;
  }
  .split-section {
    grid-template-columns: 1fr;
  }
  .chat-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    min-height: 66px;
    padding: 10px 18px;
  }
  .content {
    padding: 22px 18px 96px;
  }
  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 7px;
    border-radius: 18px;
    border: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  }
  .mobile-nav__item {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10px;
  }
  .mobile-nav__item svg {
    width: 19px;
    height: 19px;
  }
  .mobile-nav__item.is-active {
    background: rgba(139, 92, 246, 0.16);
    color: var(--accent-2);
  }
  .mobile-nav__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .status-pill span {
    display: none;
  }
  .status-pill {
    padding: 8px;
  }
}

@media (max-width: 620px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    padding: 22px;
    border-radius: 22px;
  }
  .hero h1 {
    font-size: clamp(32px, 9vw, 44px);
  }
  .hero__visual {
    min-height: 270px;
  }
  .hero-card--chat {
    right: 0;
    width: 92%;
  }
  .hero-card--topic {
    width: 80%;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .forum-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .forum-toolbar .btn {
    width: 100%;
  }
  .topic-row {
    flex-wrap: wrap;
  }
  .topic-row__stats {
    width: 100%;
    padding-left: 50px;
  }
  .chat-side {
    grid-template-columns: 1fr;
  }
  .chat-panel {
    height: 68vh;
    min-height: 460px;
  }
  .chat-composer {
    gap: 7px;
    padding: 12px 12px 14px;
  }
  .composer-actions {
    padding: 0 6px 6px;
  }
  .message-attachment--media,
  .voice-message {
    width: min(230px, 100%);
  }
  .guest-editor {
    display: none;
  }
  .chat-header__meta {
    gap: 6px;
  }
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .modal {
    padding: 22px;
  }
  #toast-root {
    right: 12px;
    bottom: 84px;
  }
}
