:root {
  --lavender: #c4b2e8;
  --lavender-mid: #ddd0f2;
  --lavender-deep: #7e5fb5;
  --ink: #2d1f42;
  --header-h: 52px;
}

body {
  background: #faf9ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.top-lavender {
  background: linear-gradient(
    135deg,
    #e8dff8 0%,
    var(--lavender-mid) 45%,
    #cdb8ea 100%
  );
  border-bottom: 1px solid rgba(94, 60, 140, 0.22);
  box-shadow: 0 4px 20px rgba(45, 31, 66, 0.08);
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.top-lavender-info {
  color: var(--ink);
  font-weight: 500;
  opacity: 0.92;
}

/* Кнопки меню / кабинет */
.header-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f3ecfc 100%);
  color: #4f3a6e;
  box-shadow:
    0 2px 6px rgba(60, 40, 100, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
}

.header-icon-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #ebe3f8 100%);
  box-shadow:
    0 4px 12px rgba(60, 40, 100, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  color: #3d2a58;
}

.header-icon-btn:active {
  transform: scale(0.97);
}

.header-icon-svg {
  flex-shrink: 0;
  opacity: 0.92;
}

.header-icon-btn--menu {
  padding: 0.45rem 0.55rem;
}

.header-account-btn {
  max-width: min(52vw, 280px);
  padding: 0.35rem 0.55rem 0.35rem 0.4rem;
}

.header-account-email {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #4f3a6e;
  text-transform: none;
  max-width: 100%;
}

.header-login-btn {
  border-radius: 999px;
  font-weight: 600;
}

.user-avatar {
  flex-shrink: 0;
  display: inline-block;
  border-radius: 999px;
  object-fit: cover;
  vertical-align: middle;
}

.user-avatar--chat,
.user-avatar--xs {
  width: 32px;
  height: 32px;
}

.user-avatar--sm {
  width: 36px;
  height: 36px;
}

.user-avatar--md {
  width: 48px;
  height: 48px;
}

.user-avatar--placeholder {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95em;
  color: #fff;
  background: hsl(var(--avatar-hue, 220) 45% 48%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.user-avatar--chat.user-avatar--placeholder,
.user-avatar--xs.user-avatar--placeholder {
  font-size: 0.82rem;
}

.drawer-account-head {
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(94, 60, 140, 0.15);
}

.drawer-account-email {
  word-break: break-all;
}

.header-icon-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c4678;
}

/* Название сайта */
.site-brand {
  display: block;
  min-width: 0;
}

.site-brand-title {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 3.8vw, 1.45rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #3a2652;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  background: linear-gradient(105deg, #2f1d48 0%, #5c3d82 42%, #7b5aad 72%, #4a3268 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .site-brand-title {
    color: #3a2652;
    background: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  }
}

.side-drawer {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: min(78vw, 220px);
  max-height: calc(100vh - var(--header-h));
  background: #f4f0ff;
  border-right: 1px solid #c4b6dc;
  box-shadow: 4px 8px 24px rgba(40, 20, 80, 0.12);
  transition: transform 0.28s ease;
  z-index: 1040;
  overflow-y: auto;
  padding: 0.5rem 0.65rem 0.75rem;
}

.side-drawer .nav-link {
  padding: 0.35rem 0.5rem !important;
  font-size: 0.92rem;
}

.side-drawer > p.small {
  margin-bottom: 0.5rem !important;
  font-size: 0.75rem;
}

.side-drawer.drawer-right {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid #c4b6dc;
  box-shadow: -4px 8px 24px rgba(40, 20, 80, 0.12);
}

.side-drawer.collapsed {
  transform: translateX(-100%);
}

.side-drawer.drawer-right.collapsed {
  transform: translateX(100%);
}

.drawer-backdrop {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(30, 15, 50, 0.25);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer-link.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.sound-sticker-inline {
  vertical-align: middle;
  object-fit: contain;
  border-radius: 4px;
  margin: 0 1px;
}

.sticker-picker .sticker-btn img {
  display: block;
}

.sticker-picker {
  gap: 0.35rem;
}

.chat-composer {
  min-height: 54px;
  display: flex;
  align-items: center;
}

.chat-composer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.chat-sticker {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.chat-space {
  display: inline-block;
  width: 20px;
  height: 40px;
}

.chat-sticker-space {
  display: inline-block;
  width: 14px;
  height: 28px;
}

.sticker-builder-drop {
  min-height: 92px;
  border: 1px dashed rgba(94, 60, 140, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%);
  padding: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.sticker-builder-token {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 60, 140, 0.18);
  background: #fff;
  padding: 0.25rem 0.45rem;
  box-shadow: 0 6px 16px rgba(45, 31, 66, 0.06);
  user-select: none;
}

.sticker-builder-token[draggable="true"] {
  cursor: grab;
}

.sticker-builder-token:active {
  cursor: grabbing;
}

.sticker-builder-token img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sticker-builder-token .sb-remove {
  border: 0;
  background: transparent;
  color: #6b5b86;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  border-radius: 6px;
}

.sticker-builder-token .sb-remove:hover {
  background: rgba(126, 95, 181, 0.12);
  color: #3d2a58;
}

.sb-picker .sticker-btn img {
  width: 32px;
  height: 32px;
}

.sb-sticker {
  position: relative;
  display: inline-block;
}

.sb-sticker-token {
  position: absolute;
  left: 50%;
  bottom: -0.2rem;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.06rem 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 60, 140, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: #3d2a58;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.sb-picker .sticker-btn[data-token=""] .sb-sticker-token {
  display: none;
}

.sb-picker .sticker-btn.sb-candidate {
  outline: 2px solid rgba(40, 170, 90, 0.55);
  box-shadow: 0 0 0 4px rgba(40, 170, 90, 0.12);
}

.sb-picker .sticker-btn.sb-not-candidate {
  opacity: 0.55;
}

.sb-suggest-pill {
  border: 1px solid rgba(94, 60, 140, 0.16);
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(60, 40, 100, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f3ecfc 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(45, 31, 66, 0.08);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(60, 40, 100, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f3ecfc 100%);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #5c4678;
}

.avatar-placeholder--sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.profile-about {
  background: #fff;
  border: 1px solid rgba(60, 40, 100, 0.12);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.pay-hero {
  border: 1px solid rgba(94, 60, 140, 0.16);
  background: radial-gradient(1200px 500px at 10% 0%, #ffffff 0%, #f6f0ff 55%, #efe6ff 100%);
}

.pay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c4678;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 60, 140, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f3ecfc 100%);
  width: fit-content;
}

.pay-tariff {
  border: 1px solid rgba(94, 60, 140, 0.16);
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
  box-shadow: 0 10px 26px rgba(45, 31, 66, 0.06);
}

.pay-tariff--zero { border-color: rgba(120, 120, 140, 0.2); }
.pay-tariff--basic { border-color: rgba(94, 60, 140, 0.28); }
.pay-tariff--student { border-color: rgba(42, 143, 143, 0.28); }
.pay-tariff--teacher { border-color: rgba(184, 115, 26, 0.3); }
.pay-tariff--master { border-color: rgba(108, 75, 160, 0.35); }
.pay-tariff--scientific { border-color: rgba(60, 90, 140, 0.3); }

.pay-tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c4678;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(232, 220, 255, 0.6);
  border: 1px solid rgba(94, 60, 140, 0.15);
}

.pay-feature-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #4f4560;
}

.pay-feature-list li + li {
  margin-top: 0.25rem;
}

.pay-note {
  color: #6b5f80;
  border-left: 3px solid rgba(126, 95, 181, 0.35);
  padding-left: 0.65rem;
}

.pay-hero-lead {
  max-width: 42rem;
}

.pay-status-inline {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(94, 60, 140, 0.12);
  display: inline-block;
}

.access-gate {
  border: 1px solid rgba(94, 60, 140, 0.18);
  background: radial-gradient(900px 400px at 5% 0%, #ffffff 0%, #f6f0ff 60%, #efe6ff 100%);
}

.access-gate-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #5c4678;
  background: linear-gradient(145deg, #ede5ff, #dcd0f7);
  margin-bottom: 1rem;
}

.access-gate-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c4678;
}

.access-gate-lead {
  max-width: 36rem;
}

.access-gate-panel {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(94, 60, 140, 0.12);
}

.access-gate-mini {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 60, 140, 0.12);
  background: #fff;
}

.access-gate-mini-title {
  font-weight: 700;
  color: #3a2652;
  margin-bottom: 0.35rem;
}

.scientific-hero {
  border: 1px solid rgba(60, 90, 140, 0.2);
  background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 55%, #f6f0ff 100%);
}


/* Лента чата: карточки и крупные стикеры в сообщениях */
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.chat-feed-scroll > .chat-feed-scroll-inner {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(94, 60, 140, 0.12) !important;
}

.chat-feed-title {
  margin-bottom: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
  color: #5c4678;
  opacity: 0.88;
}

.chat-message {
  border: 1px solid rgba(94, 60, 140, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
  box-shadow:
    0 4px 6px rgba(45, 31, 66, 0.04),
    0 14px 32px rgba(45, 31, 66, 0.07);
  padding: 1rem 1.15rem;
  overflow: hidden;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.45rem;
  padding-bottom: 0;
  border-bottom: none;
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.65rem;
  min-width: 0;
}

.chat-message-user {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.chat-message-time {
  font-size: 0.75rem;
  color: #6b5b86;
}

.chat-message-body {
  margin-top: 0.15rem;
  line-height: 1.65;
  word-break: break-word;
  padding: 0.15rem 0.15rem 0.15rem calc(32px + 0.55rem);
}

.chat-message-audio {
  margin-bottom: 0.85rem;
  margin-left: calc(32px + 0.55rem);
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(94, 60, 140, 0.1);
}

.chat-message-audio-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c4678;
  margin-bottom: 0.45rem;
}

.chat-message-audio-player {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.chat-message-stickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.45rem;
  margin-top: 0.15rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  border: 1px dashed rgba(94, 60, 140, 0.18);
}

.chat-message-stickers .sound-sticker-inline {
  width: clamp(52px, 14vw, 72px);
  height: clamp(52px, 14vw, 72px);
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(45, 31, 66, 0.12);
}

.chat-message-stickers .chat-sticker-space {
  width: 1.1rem;
  min-height: clamp(52px, 14vw, 72px);
  height: clamp(52px, 14vw, 72px);
}

.chat-message-stickers .sticker-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  border-radius: 14px;
  line-height: 0;
  transition:
    background 0.15s ease,
    transform 0.12s ease;
}

.chat-message-stickers .sticker-play:hover {
  background: rgba(126, 95, 181, 0.14);
}

.chat-message-stickers .sticker-play:active {
  transform: scale(0.97);
}

.chat-message-stickers .sticker-play:focus-visible {
  outline: 2px solid var(--lavender-deep);
  outline-offset: 2px;
}

.chat-message-body .sound-sticker-inline {
  width: clamp(44px, 11vw, 60px);
  height: clamp(44px, 11vw, 60px);
  margin: 0.2rem 0.25rem 0.2rem 0;
  vertical-align: middle;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(45, 31, 66, 0.1);
}

.chat-message-body .sticker-play {
  display: inline-flex;
  vertical-align: middle;
  margin: 0.15rem 0.2rem 0.15rem 0;
  padding: 0.1rem;
  border-radius: 12px;
  line-height: 0;
  transition: background 0.15s ease;
}

.chat-message-body .sticker-play:hover {
  background: rgba(126, 95, 181, 0.12);
}

.chat-message-body .sticker-play:focus-visible {
  outline: 2px solid var(--lavender-deep);
  outline-offset: 2px;
}

/* Чат в стиле мессенджера (форма и стикеры всегда внизу экрана) */
.page-chat-messenger footer.border-top {
  display: none;
}

.page-chat-messenger .main-chat-messenger {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 0.65rem;
  padding-bottom: 0.5rem;
  max-width: 920px;
}

.page-chat-messenger .chat-page-lead {
  line-height: 1.45;
  padding-inline: 0.15rem;
}

.page-chat-messenger .chat-register-modal .modal-body p:last-child {
  margin-bottom: 0;
}

.chat-page-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: calc(100dvh - var(--header-h) - 1.25rem);
  max-height: calc(100dvh - var(--header-h) - 1.25rem);
}

.chat-page-shell--embedded {
  height: min(72dvh, calc(100dvh - var(--header-h) - 14rem));
  max-height: min(72dvh, calc(100dvh - var(--header-h) - 14rem));
}

.chat-page-breadcrumb {
  flex-shrink: 0;
  margin-bottom: 0.5rem !important;
}

.chat-page-intro-curtain {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 60, 140, 0.12);
  background: rgba(255, 255, 255, 0.75);
  padding: 0 0.65rem;
}

.chat-page-intro-curtain summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 650;
  color: #5c4678;
  padding: 0.45rem 0;
  list-style-position: inside;
}

.chat-page-intro-curtain-body {
  padding-bottom: 0.65rem;
}

.chat-messenger {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(94, 60, 140, 0.16);
  background: linear-gradient(180deg, #faf8ff 0%, #f3ecfc 100%);
  box-shadow: 0 12px 40px rgba(45, 31, 66, 0.08);
  overflow: hidden;
}

.chat-messenger-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(246, 240, 255, 0.35) 100%);
}

.chat-messenger-feed-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 0.85rem;
  background: rgba(251, 248, 255, 0.92);
  border-bottom: 1px solid rgba(94, 60, 140, 0.1);
  backdrop-filter: blur(6px);
}

.chat-messenger-feed-hint {
  font-size: 0.68rem;
}

.chat-messenger-feed .chat-feed-inner {
  padding: 0.65rem 0.85rem 0.85rem;
  gap: 0.65rem;
}

.chat-messenger-panel {
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
  border-top: 1px solid rgba(94, 60, 140, 0.14);
  box-shadow: 0 -8px 28px rgba(45, 31, 66, 0.08);
}

.chat-messenger-form {
  padding: 0.65rem 0.75rem 0.75rem;
}

.chat-messenger-panel-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c4678;
  margin-bottom: 0.4rem;
  padding: 0 0.15rem;
}

.chat-messenger-panel-stickers {
  margin-bottom: 0.5rem;
}

.sticker-picker--messenger {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0.15rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.sticker-btn--messenger {
  flex-shrink: 0;
  border-radius: 14px !important;
  padding: 0.35rem !important;
}

.sticker-btn--messenger img {
  width: 44px !important;
  height: 44px !important;
}

.chat-composer--messenger {
  min-height: 48px;
  margin-bottom: 0.5rem;
  border-color: rgba(94, 60, 140, 0.2);
  background: #fff;
}

.chat-messenger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.chat-send-btn {
  font-weight: 700;
  border-radius: 999px;
}

.chat-messenger-curtain {
  border-top: 1px dashed rgba(94, 60, 140, 0.15);
  margin-top: 0.15rem;
}

.chat-messenger-curtain-summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
  color: #6b5b86;
  padding: 0.45rem 0.15rem;
  list-style-position: inside;
}

.chat-messenger-curtain-body {
  padding: 0 0.15rem 0.35rem;
}

.chat-messenger-curtain-body textarea {
  min-height: 4rem;
  font-size: 0.9rem;
}

.page-chat-messenger .chat-toast-container {
  bottom: auto;
  top: calc(var(--header-h) + 0.75rem);
}

.chat-messenger-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Legacy / общие */
.chat-feed-scroll {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 240, 255, 0.75) 100%);
  border: 1px solid rgba(94, 60, 140, 0.18);
  max-height: min(52vh, 520px);
  overflow-y: auto;
}

.chat-feed-inner {
  margin-top: 0;
}

.chat-composer-card {
  border: 1px solid rgba(94, 60, 140, 0.14);
  background: linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
  border-radius: 16px;
}

/* Групповые чаты */
.alert-soft-lavender {
  border-radius: 14px;
  border: 1px solid rgba(94, 60, 140, 0.2);
  background: rgba(232, 220, 255, 0.45);
  color: var(--ink);
}

.group-create-card,
.group-chat-header,
.group-side-card,
.group-tile {
  border: 1px solid rgba(94, 60, 140, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
  box-shadow: 0 8px 24px rgba(45, 31, 66, 0.06);
}

.group-tile {
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.group-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(45, 31, 66, 0.1);
}

.group-member-row {
  background: rgba(255, 255, 255, 0.65);
}

.chat-breadcrumb {
  font-size: 0.8125rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f3ecfc 100%);
  border: 1px solid rgba(94, 60, 140, 0.14);
  max-width: 100%;
  box-shadow: 0 4px 14px rgba(45, 31, 66, 0.05);
}

.chat-breadcrumb a {
  color: #5c4678;
  text-decoration: none;
  font-weight: 650;
}

.chat-breadcrumb a:hover {
  text-decoration: underline;
  color: #3d2a58;
}

.chat-breadcrumb-sep {
  color: rgba(94, 60, 140, 0.38);
  user-select: none;
  font-weight: 600;
}

.chat-breadcrumb-current {
  color: var(--ink);
  font-weight: 650;
  opacity: 0.95;
}

.text-bg-deep-lav {
  background: linear-gradient(135deg, #6b4fa3 0%, #533a79 98%) !important;
  color: #fff !important;
  font-weight: 650;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.group-header-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 15px;
  background: linear-gradient(145deg, #ede5ff 0%, #dcd0f7 100%);
  border: 1px solid rgba(94, 60, 140, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: #5c4678;
  flex-shrink: 0;
  line-height: 1;
}

.group-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 9px;
  background: rgba(126, 95, 181, 0.16);
  color: #4a3268;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}

.group-tile--organizer {
  border-color: rgba(108, 75, 160, 0.38);
}

.group-invite-card .card-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 238, 255, 0.92) 100%);
}

.groups-page-title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
  color: #3a2652;
}

.groups-empty-state {
  border-color: rgba(94, 60, 140, 0.22);
  background: rgba(251, 248, 255, 0.65);
}

.groups-section-heading {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.68rem;
  color: #5c4678;
  opacity: 0.9;
}

.btn-remove-member {
  border: 1px solid rgba(220, 53, 69, 0.42);
  color: #a52834;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  line-height: 1.25;
}

.btn-remove-member:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #842029;
}

.group-member-list .list-group-item {
  border-color: rgba(94, 60, 140, 0.08);
}

.modal-content-soft {
  border-radius: 18px;
  border: 1px solid rgba(94, 60, 140, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
  box-shadow: 0 24px 60px rgba(45, 31, 66, 0.18);
}

.group-danger-zone {
  background: linear-gradient(
    180deg,
    rgba(255, 240, 240, 0.55) 0%,
    rgba(252, 245, 255, 0.35) 100%
  );
}

.chat-composer-card > .card-header {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: #4f3a6e;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 240, 255, 0.6) 100%);
  border-bottom: 1px solid rgba(94, 60, 140, 0.1);
  border-radius: 16px 16px 0 0 !important;
}

.chat-page-title {
  color: #3a2652;
}

.organiser-badge {
  font-weight: 600;
}

/* Dictionary (Slovo) */
.dict-hero {
  background: radial-gradient(1200px 520px at 10% 0%, #ffffff 0%, #f6f0ff 55%, #efe6ff 100%);
  border: 1px solid rgba(94, 60, 140, 0.16);
}

.page-dictionary .dict-hero {
  background: radial-gradient(1100px 480px at 15% 0%, #fff9f0 0%, #f5faf9 45%, #f6f0ff 100%);
  border-color: rgba(42, 143, 143, 0.18);
}

.page-dictionary .dict-page-lead {
  line-height: 1.45;
  padding-inline: 0.15rem;
}

.page-dictionary .dict-register-modal .modal-body p:last-child {
  margin-bottom: 0;
}

.dict-word-pair {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.35rem 0.15rem;
}

.dict-word-stickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.25rem;
  padding: 0.35rem 0;
}

.dict-word-sticker {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(94, 60, 140, 0.12);
  box-shadow: 0 2px 8px rgba(45, 31, 66, 0.06);
}

.dict-run-fallback {
  font-family: "Dao Rus", Georgia, serif;
  opacity: 0.55;
}

.dict-run-glow {
  font-family: "Dao Rus", Georgia, serif;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
  color: #b8731a;
  text-shadow:
    0 0 8px rgba(232, 168, 74, 0.65),
    0 0 18px rgba(184, 115, 26, 0.35),
    0 0 32px rgba(232, 168, 74, 0.2);
  word-break: break-word;
}

.dict-rus-glow {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  line-height: 1.35;
  font-weight: 700;
  color: #1a6b6b;
  text-shadow:
    0 0 8px rgba(42, 143, 143, 0.55),
    0 0 16px rgba(42, 143, 143, 0.28),
    0 0 28px rgba(42, 143, 143, 0.15);
  word-break: break-word;
}

.dict-ss-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.dict-ss-label {
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.dict-meta-row {
  opacity: 0.85;
}

.dict-run {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #2f1d48;
  font-size: 1.05rem;
}

.dict-rus {
  font-weight: 600;
  color: var(--ink);
}

.dict-ss-code {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px dashed rgba(94, 60, 140, 0.28);
  background: rgba(255, 255, 255, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.85em;
}

.dict-item {
  border: 1px solid rgba(94, 60, 140, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);
}

.dict-details-summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  color: #4f3a6e;
}

.dict-details summary::marker {
  color: #7b5aad;
}

.dict-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  padding-top: 0.35rem;
}

.dict-kv {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(94, 60, 140, 0.12);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  overflow: hidden;
}

.dict-v {
  word-break: break-word;
}

@media (max-width: 768px) {
  .dict-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Словарь: шрифт Дао, образы */
.dict-script-ys,
.dict-script-dao,
.dict-input-dao {
  font-family: "Dao Rus", Georgia, serif;
  font-size: 1.1em;
}

.dict-script-ys {
  font-size: 1.35em;
  font-weight: 700;
  min-width: 2.5rem;
}

.dict-script-row {
  display: flex;
  align-items: center;
}

.dict-filter-modes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dict-filter-mode {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
}

.dict-filter-mode input {
  flex-shrink: 0;
}

.dict-filter-mode-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dict-empty-result {
  font-size: 1rem;
  color: #6b5f80;
  text-align: center;
}

.dict-input-row .form-control {
  min-height: 2.65rem;
}

.dict-field-hint {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a7da0;
}

.dict-eq-col {
  align-self: flex-end;
  padding-bottom: 0.55rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #6b5f80;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dict-filter5-hint {
  line-height: 1.45;
}

.dict-obrazy-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.dict-obraz-card {
  margin: 0;
  text-align: center;
  width: 7.5rem;
}

.dict-obraz-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(94, 60, 140, 0.18);
  background: #fff;
  box-shadow: 0 4px 14px rgba(45, 31, 66, 0.08);
}

.dict-obraz-num {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5c4678;
}

.dict-scientific-filters summary {
  cursor: pointer;
}

/* Сад слов */
.page-garden .garden-hero {
  border: 1px solid rgba(42, 143, 143, 0.22);
  background: linear-gradient(145deg, #f8fffe 0%, #eefaf5 50%, #f6f0ff 100%);
}

.garden-panel {
  border: 1px solid rgba(42, 143, 143, 0.16);
  border-radius: 14px;
  overflow: hidden;
}

.garden-rune,
.garden-rune-lg {
  font-family: "Dao Rus", Georgia, serif;
  font-weight: 700;
  color: #b8731a;
}

.garden-rune-lg {
  font-size: 1.5rem;
}

.garden-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.garden-tree-label {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
}

.garden-pair {
  font-family: "Dao Rus", Georgia, serif;
  font-weight: 700;
  color: #2a8f8f;
  letter-spacing: 0.04em;
}

.garden-word-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.garden-word-row {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(42, 143, 143, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.garden-word-stickers {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.garden-word-stickers img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(42, 143, 143, 0.15);
}

.garden-word-run {
  font-family: "Dao Rus", Georgia, serif;
  color: #b8731a;
}

.garden-word-meaning {
  color: var(--ink);
}

.garden-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 100%;
}

.garden-breadcrumb-rune {
  font-family: "Dao Rus", Georgia, serif;
  font-size: 1.15rem;
  text-decoration: none;
  color: #b8731a;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.garden-breadcrumb-sep {
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
}

.garden-breadcrumb-rune.active,
.garden-breadcrumb-rune:hover {
  background: rgba(184, 115, 26, 0.12);
}

@media (max-width: 768px) {
  .page-garden .garden-breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.2rem;
    margin-right: -0.25rem;
    margin-left: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

.shop-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  font-size: 0.95rem;
}

.shop-breadcrumb a {
  text-decoration: none;
  color: var(--ink);
}

.shop-breadcrumb-current {
  font-weight: 600;
  color: var(--deep-lavender, #5c4d7a);
}

.shop-breadcrumb-sep {
  color: var(--muted);
}

.shop-rune-photo {
  max-width: 100%;
  width: 160px;
  height: auto;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .group-tile:hover {
    transform: none;
  }
}
/* Телефон: крупнее зона нажатия, подписи компактнее */
@media (max-width: 576px) {
  :root {
    --header-h: 58px;
  }

  .header-icon-btn {
    min-height: 44px;
    padding: 0.4rem 0.55rem;
    border-radius: 14px;
  }

  .header-account-btn {
    max-width: none;
    padding: 0.35rem;
  }

  .header-account-email {
    display: none !important;
  }

  .header-icon-label {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }

  .top-lavender-info {
    font-size: 0.78rem;
    line-height: 1.25;
    max-width: 100%;
    order: 3;
    flex-basis: 100%;
  }

  .top-lavender {
    flex-wrap: wrap;
  }

  .site-brand-title {
    font-size: 1.2rem;
  }

  .chat-page-shell {
    height: calc(100dvh - var(--header-h) - 0.5rem);
    max-height: calc(100dvh - var(--header-h) - 0.5rem);
  }

  .chat-page-shell--embedded {
    height: min(58dvh, calc(100dvh - var(--header-h) - 18rem));
    max-height: min(58dvh, calc(100dvh - var(--header-h) - 18rem));
  }

  .chat-messenger-feed .chat-message {
    padding: 0.75rem 0.85rem;
  }

  #mic-status {
    display: block !important;
    width: 100%;
    font-size: 0.72rem;
    margin-top: 0.15rem;
  }
}

/* ——— Темы (отдельный визуал: тёплый янтарь / бирюза) ——— */
:root {
  --topic-amber: #e8a84a;
  --topic-amber-deep: #b8731a;
  --topic-teal: #2a8f8f;
  --topic-teal-soft: #d4f0ef;
  --topic-ink: #2a3d3a;
}

.topic-font-rubik { font-family: "Rubik", system-ui, sans-serif; }
.topic-font-philosopher { font-family: "Philosopher", Georgia, serif; }
.topic-font-caveat { font-family: "Caveat", cursive; font-size: 1.35em; line-height: 1.2; }
.topic-font-marck { font-family: "Marck Script", cursive; font-size: 1.25em; }
.topic-font-playfair { font-family: "Playfair Display", Georgia, serif; }
.topic-font-comfortaa { font-family: "Comfortaa", system-ui, sans-serif; }
.topic-font-default { font-family: inherit; }

.page-topics,
.page-topic-chat {
  --lavender: var(--topic-teal-soft);
}

.page-topics .top-lavender,
.page-topic-chat .top-lavender {
  background: linear-gradient(135deg, #fff6e8 0%, #fde8c8 40%, #f5d4a0 100%);
  border-bottom-color: rgba(184, 115, 26, 0.25);
}

.topics-hero {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff9f0 0%, #ffefd6 55%, #e8f6f5 100%);
  border: 1px solid rgba(42, 143, 143, 0.15);
  overflow: hidden;
}

.topics-hero-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 50%;
  height: 120%;
  background: radial-gradient(circle, rgba(232, 168, 74, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.topics-hero-title {
  color: var(--topic-ink);
  font-weight: 700;
}

.text-topic-accent {
  color: var(--topic-amber-deep);
  font-weight: 600;
}

.topic-create-card,
.topic-side-card {
  border: 1px solid rgba(42, 143, 143, 0.2);
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(42, 61, 58, 0.06);
}

.topic-close-card {
  border-radius: 1rem;
  border: 2px solid rgba(232, 168, 74, 0.55);
  background: linear-gradient(145deg, #fff9f0 0%, #f0faf9 100%);
  box-shadow: 0 8px 24px rgba(184, 115, 26, 0.1);
}

.topic-create-card .card-header {
  background: linear-gradient(90deg, #fff6e8, #e8f6f5);
  border-bottom: 1px solid rgba(42, 143, 143, 0.12);
  font-weight: 600;
  color: var(--topic-ink);
}

.topic-mini-icon {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--topic-amber), var(--topic-teal));
  color: #fff;
  font-size: 0.85rem;
}

.topic-tile {
  border-radius: 1rem;
  border: 1px solid rgba(232, 168, 74, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(184, 115, 26, 0.12);
}

.topic-tile--closed {
  opacity: 0.92;
  background: #fafafa;
}

.topic-badge-open {
  background: var(--topic-teal-soft);
  color: var(--topic-teal);
  font-weight: 600;
}

.topic-badge-closed {
  background: #f0ebe3;
  color: #6b5d4f;
}

.topic-badge-author,
.topic-badge-count {
  background: rgba(232, 168, 74, 0.25);
  color: var(--topic-amber-deep);
}

.btn-topic-send {
  background: linear-gradient(135deg, var(--topic-amber) 0%, var(--topic-teal) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-topic-send:hover {
  filter: brightness(1.05);
  color: #fff;
}

.btn-outline-topic {
  border-color: var(--topic-teal);
  color: var(--topic-teal);
}

.btn-outline-topic:hover {
  background: var(--topic-teal-soft);
  color: var(--topic-teal);
}

.topic-chat-header {
  border: 1px solid rgba(232, 168, 74, 0.4);
  border-radius: 1rem;
  background: linear-gradient(120deg, #fffcf7 0%, #f0faf9 100%);
}

.topic-header-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(145deg, var(--topic-amber), var(--topic-teal));
  color: #fff;
  flex-shrink: 0;
}

.chat-messenger--topic .chat-messenger-panel {
  border-top-color: rgba(42, 143, 143, 0.2);
  background: linear-gradient(180deg, #fffcf9 0%, #f5faf9 100%);
}

.chat-message--topic .chat-message-body {
  font-size: 1.05rem;
  line-height: 1.45;
}

.topic-font-preview {
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px dashed rgba(42, 143, 143, 0.35);
  font-size: 1rem;
}

.topic-body-input,
.topic-compose-text textarea {
  min-height: 2.5rem;
  max-height: 5rem;
  resize: vertical;
  font-size: 0.9rem;
}

.topic-closed-banner {
  background: #f8f4ee;
  border-top: 1px solid rgba(184, 115, 26, 0.2);
}

.topics-breadcrumb a {
  color: var(--topic-teal);
  text-decoration: none;
}

.topics-breadcrumb a:hover {
  text-decoration: underline;
}

.topics-breadcrumb-sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.modal-content-topic {
  border-radius: 1rem;
  border: 1px solid rgba(232, 168, 74, 0.35);
}

.topics-empty-state {
  border-color: rgba(42, 143, 143, 0.25) !important;
  color: var(--topic-ink);
}

/* ——— Магазин ——— */
.page-shop .top-lavender {
  background: linear-gradient(135deg, #f5f0ff 0%, #e8e0f8 50%, #ddd0f2 100%);
}

.shop-hero-title {
  color: var(--ink);
  font-weight: 700;
}

.shop-tile {
  border-radius: 1rem;
  border: 1px solid rgba(126, 95, 181, 0.2);
  transition: box-shadow 0.15s ease;
}

.shop-tile:hover {
  box-shadow: 0 10px 28px rgba(94, 60, 140, 0.12);
}

.shop-tile-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--lavender-deep);
}

.btn-shop {
  background: var(--lavender-deep);
  color: #fff;
  border: none;
}

.btn-shop:hover:not(:disabled) {
  background: #6a4d9a;
  color: #fff;
}

.shop-product-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--lavender-deep);
}

.shop-product-header {
  border-radius: 1rem;
  border: 1px solid rgba(126, 95, 181, 0.25);
}

.shop-preview-feed {
  border-radius: 1rem;
  border: 1px solid rgba(126, 95, 181, 0.15);
}

.shop-empty {
  border: 1px dashed rgba(126, 95, 181, 0.3);
  background: #faf9ff;
}

.shop-breadcrumb a {
  color: var(--lavender-deep);
}

/* Шрифт Дао + комбо-сообщения */
@font-face {
  font-family: "Dao Rus";
  src: url("../fonts/Dao_Rus.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.chat-font-dao {
  font-family: "Dao Rus", serif;
  font-size: 1.15em;
  line-height: 1.25;
}

.chat-font-default {
  font-family: inherit;
}

.chat-message-combo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.12rem 0.18rem;
  line-height: 1.45;
  font-size: 1.02rem;
}

.chat-message--topic .chat-message-combo {
  font-size: 1.05rem;
}

.chat-combo-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: inherit;
}

.chat-combo-sticker,
.chat-message-combo .chat-combo-sticker .sticker-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 0;
}

.chat-message-combo .chat-sticker--combo,
.chat-message-combo .chat-combo-sticker .chat-sticker--combo {
  width: 1.35em;
  height: 1.35em;
  min-width: 1.35em;
  min-height: 1.35em;
  margin: 0;
  border-radius: 0.28em;
  box-shadow: 0 1px 3px rgba(45, 31, 66, 0.1);
  object-fit: contain;
}

.chat-message-combo .chat-combo-sticker .sticker-play {
  margin: 0;
  padding: 0;
  border-radius: 0.28em;
}

.chat-message-combo .chat-sticker-space {
  width: 0.35em;
  height: 1em;
  flex-shrink: 0;
}

.combo-composer {
  margin-bottom: 0;
}

.combo-messenger-form {
  padding: 0.5rem 0.65rem 0.65rem;
}

.combo-compose-card--compact {
  padding: 0.45rem 0.55rem 0.55rem;
  gap: 0.35rem;
}

.combo-compose-card--compact .combo-composer-line {
  min-height: 2.35rem;
  max-height: 4.5rem;
  padding: 0.4rem 0.55rem;
}

.combo-compose-card--compact .combo-live-input {
  min-height: 1.65rem;
  max-height: 88px;
  font-size: 0.95rem;
}

.combo-compose-card--compact .combo-toolbar-row {
  padding-top: 0.35rem;
  gap: 0.35rem;
}

.combo-style-row--toolbar {
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding-bottom: 0;
  border-bottom: none;
  margin-left: 0.15rem;
}

.combo-style-row--toolbar .combo-font-select {
  min-width: 4.75rem;
  max-width: 6.5rem;
  font-size: 0.78rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.combo-style-row--toolbar .combo-color-btn {
  width: 1.05rem;
  height: 1.05rem;
}

.combo-style-row--toolbar .combo-style-group {
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
}

.combo-style-row--toolbar .combo-style-group--colors {
  flex: 0 1 auto;
}

.page-news .combo-composer-panel {
  margin: 0;
}

.page-news .combo-messenger-form {
  padding: 0;
}

/* ——— Страница «Новости» ——— */
.page-news .container-fluid {
  max-width: 820px;
}

.news-hero {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(94, 60, 140, 0.12);
}

.news-hero-title {
  font-size: 1.65rem;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.news-hero-lead {
  margin: 0;
  font-size: 0.92rem;
  color: #6b5f80;
  line-height: 1.5;
}

.news-editor {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: 1.15rem;
  background: linear-gradient(165deg, #ffffff 0%, #f9f6ff 55%, #f3ecfc 100%);
  border: 1px solid rgba(126, 95, 181, 0.2);
  box-shadow:
    0 8px 28px rgba(45, 31, 66, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.news-editor-head {
  margin-bottom: 1.1rem;
}

.news-editor-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.news-editor-sub {
  margin: 0;
  font-size: 0.82rem;
  color: #7a6d92;
}

.news-title-wrap {
  margin-bottom: 1rem;
}

.news-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.news-title-row .news-title-field {
  flex: 1 1 12rem;
  min-width: 0;
}

.news-title-colors {
  flex: 0 0 auto;
}

.news-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b5f80;
}

.news-title-field {
  border-radius: 0.75rem;
  border: 1px solid rgba(94, 60, 140, 0.18);
  padding: 0.65rem 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(45, 31, 66, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-title-field:focus {
  border-color: rgba(126, 95, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(126, 95, 181, 0.14);
}

.combo-composer-panel--news .combo-compose-card--news {
  padding: 0;
  gap: 0.85rem;
  border: none;
  background: transparent;
  box-shadow: none;
}

.news-style-bar {
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(94, 60, 140, 0.1);
}

.news-style-bar .combo-style-row {
  border-bottom: none;
  padding-bottom: 0;
  gap: 0.75rem 1.25rem;
}

.news-style-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: #9a8fb0;
  line-height: 1.35;
}

.combo-compose-card--news .combo-composer-line {
  min-height: 6.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 2px solid rgba(126, 95, 181, 0.22);
  background: #fff;
  box-shadow: inset 0 2px 6px rgba(45, 31, 66, 0.04);
}

.combo-compose-card--news .combo-composer-line:focus-within {
  border-color: rgba(126, 95, 181, 0.5);
  box-shadow:
    inset 0 2px 6px rgba(45, 31, 66, 0.04),
    0 0 0 3px rgba(126, 95, 181, 0.12);
}

.combo-compose-card--news .combo-live-input {
  min-height: 3rem;
  font-size: 1.08rem;
}

.news-stickers-strip {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.news-stickers-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b5f80;
}

.news-stickers-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.15rem 0.5rem;
  margin: 0 -0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 95, 181, 0.35) transparent;
}

.news-stickers-scroll::-webkit-scrollbar {
  height: 5px;
}

.news-stickers-scroll::-webkit-scrollbar-thumb {
  background: rgba(126, 95, 181, 0.35);
  border-radius: 999px;
}

.sticker-picker--news {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  padding: 0.15rem 0.1rem;
}

.sticker-btn--news {
  flex-shrink: 0;
  padding: 0.35rem;
  border-radius: 0.75rem !important;
  border-color: rgba(94, 60, 140, 0.12) !important;
  background: #fff !important;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.sticker-btn--news:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 31, 66, 0.12);
}

.sticker-btn--news img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.combo-toolbar-row--news {
  padding-top: 0.5rem;
  margin-top: 0.15rem;
  border-top: 1px solid rgba(94, 60, 140, 0.1);
}

.combo-toolbar-row--news .combo-tool-btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.6rem;
}

.news-publish-btn {
  font-weight: 700;
  padding: 0.45rem 1.35rem !important;
  min-width: 8.5rem;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.28);
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-post {
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(94, 60, 140, 0.1);
  border-left: 4px solid var(--lavender-deep);
  box-shadow: 0 4px 16px rgba(45, 31, 66, 0.05);
}

.news-post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(94, 60, 140, 0.08);
}

.news-post-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  flex: 1 1 12rem;
}

.news-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #8a7da0;
  white-space: nowrap;
}

.news-post-author {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(196, 178, 232, 0.35);
  color: #5c4678;
  font-weight: 600;
}

.news-post-body .chat-message-combo {
  font-size: 1.05rem;
  line-height: 1.55;
}

.news-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: 1rem;
  border: 1px dashed rgba(94, 60, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
}

.news-empty-text {
  margin: 0;
  font-size: 0.92rem;
  color: #8a7da0;
}

@media (max-width: 575.98px) {
  .news-editor {
    padding: 1rem 1rem 1.15rem;
    border-radius: 1rem;
  }

  .combo-compose-card--news .combo-composer-line {
    min-height: 5rem;
    padding: 0.7rem 0.85rem;
  }

  .news-publish-btn {
    min-width: 0;
    flex: 1 1 auto;
  }

  .combo-toolbar-row--news {
    flex-direction: column;
    align-items: stretch;
  }

  .combo-toolbar-row--news .combo-toolbar-right {
    justify-content: stretch;
  }

  .combo-toolbar-row--news .combo-toolbar-right .news-publish-btn {
    width: 100%;
  }
}

.combo-compose-card {
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
  border: 1px solid rgba(94, 60, 140, 0.14);
  box-shadow: 0 4px 18px rgba(45, 31, 66, 0.07);
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.page-topic-chat .combo-compose-card {
  background: linear-gradient(180deg, #fffcf9 0%, #f5faf9 100%);
  border-color: rgba(42, 143, 143, 0.22);
}

.combo-style-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px dashed rgba(94, 60, 140, 0.12);
}

.combo-style-hint {
  margin-top: 0.35rem;
  line-height: 1.35;
}

.combo-style-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.combo-style-group--colors {
  flex: 1 1 auto;
  min-width: 0;
}

.combo-compose-field {
  width: 100%;
}

.combo-composer-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-height: 5.5rem;
  padding: 0.7rem 0.85rem;
  cursor: text;
  border: 2px solid rgba(94, 60, 140, 0.18);
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(45, 31, 66, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-topic-chat .combo-composer-line {
  border-color: rgba(42, 143, 143, 0.28);
}

.combo-composer-line:focus-within {
  border-color: rgba(94, 60, 140, 0.45);
  box-shadow: 0 0 0 3px rgba(126, 95, 181, 0.14);
}

.page-topic-chat .combo-composer-line:focus-within {
  border-color: rgba(42, 143, 143, 0.55);
  box-shadow: 0 0 0 3px rgba(42, 143, 143, 0.12);
}

.combo-blocks-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.12rem 0.18rem;
  width: 100%;
  font-size: 1.02rem;
  line-height: 1.45;
}

.page-topic-chat .combo-blocks-wrap {
  font-size: 1.05rem;
}

.combo-blocks-wrap .chat-sticker {
  width: 1.35em;
  height: 1.35em;
  min-width: 1.35em;
  min-height: 1.35em;
  border-radius: 0.28em;
  box-shadow: 0 1px 3px rgba(45, 31, 66, 0.08);
  object-fit: contain;
}

.combo-blocks-wrap .combo-compose-text {
  line-height: inherit;
}

.combo-blocks-wrap:empty {
  display: none;
}

.combo-live-input {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  max-height: 140px;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 1.02rem;
  line-height: 1.45;
  padding: 0.2rem 0;
  overflow-y: auto;
  box-sizing: border-box;
}

.combo-live-input::placeholder {
  color: #9a8fb0;
  opacity: 0.95;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.combo-stickers-row {
  padding-top: 0.1rem;
}

.combo-stickers-row .chat-messenger-panel-label {
  margin-bottom: 0.35rem;
}

.combo-stickers-row .sticker-picker--messenger {
  padding: 0.25rem 0.1rem 0.35rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.65);
}

.sticker-picker--extra {
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 0.35rem 0.15rem;
  border-radius: 0.65rem;
  background: rgba(255, 248, 230, 0.75);
  border: 1px dashed rgba(184, 115, 26, 0.35);
}

.combo-stickers-subhead {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.combo-fold-count {
  font-weight: 500;
  color: #7a6d92;
}

.news-stickers-label--sub {
  display: block;
  font-size: 0.68rem;
  margin-bottom: 0.25rem;
}

.combo-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(94, 60, 140, 0.1);
}

.combo-toolbar-left,
.combo-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.combo-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
}

.combo-tool-btn {
  border-radius: 999px !important;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-color: rgba(94, 60, 140, 0.15) !important;
}

.combo-send-btn {
  font-weight: 700;
  border-radius: 999px;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
  min-width: 6.5rem;
}

.voice-preview-bar {
  margin-bottom: 0.45rem;
}

.voice-preview-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef8f8 0%, #f3ecfc 100%);
  border: 1px solid rgba(42, 143, 143, 0.25);
}

.voice-preview-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #2a8f8f;
  white-space: nowrap;
}

.voice-preview-audio {
  height: 32px;
  min-width: 160px;
  max-width: min(280px, 55vw);
}

.voice-preview-clear {
  line-height: 1;
  padding: 0.15rem 0.45rem;
}

.combo-mic-status {
  min-width: 0;
}

.chat-composer--messenger {
  min-height: auto;
  margin-bottom: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.combo-style-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c4678;
}

.combo-font-select {
  min-width: 6.5rem;
  max-width: 9rem;
}

.combo-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.combo-color-btn {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(45, 31, 66, 0.22);
  background: var(--combo-color, #2d1f42);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.combo-color-btn.is-active {
  box-shadow: 0 0 0 2px var(--lavender-deep);
  transform: scale(1.1);
}

.combo-compose-text {
  white-space: pre-wrap;
}

.combo-composer-line .chat-sticker {
  vertical-align: middle;
}

@media (max-width: 575.98px) {
  .combo-compose-card {
    padding: 0.55rem 0.6rem 0.65rem;
    gap: 0.4rem;
  }

  .combo-composer-line {
    min-height: 2.85rem;
    max-height: 5.5rem;
    padding: 0.55rem 0.65rem;
  }

  .combo-send-btn {
    min-width: 5.5rem;
  }

  .sticker-btn--messenger img {
    width: 36px !important;
    height: 36px !important;
  }
}

/* Сворачиваемые блоки composer (мобильный режим) */
.combo-fold {
  border: 1px dashed rgba(94, 60, 140, 0.18);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.65);
}

.combo-fold-summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c4678;
  padding: 0.45rem 0.55rem;
  list-style-position: inside;
}

.combo-fold-body {
  padding: 0 0.55rem 0.55rem;
}

.page-topic-chat .combo-fold {
  border-color: rgba(42, 143, 143, 0.22);
}

@media (min-width: 768px) {
  .combo-fold {
    border: none;
    background: transparent;
    border-radius: 0;
  }

  .combo-fold > summary {
    display: none;
  }

  .combo-compose-card--compact .combo-fold {
    border: 1px dashed rgba(94, 60, 140, 0.18);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.65);
  }

  .combo-compose-card--compact .combo-fold > summary {
    display: list-item;
  }

  .combo-fold-body {
    padding: 0;
  }

  .combo-compose-card--compact .combo-fold-body {
    padding: 0 0.55rem 0.55rem;
  }

  .combo-fold--style .combo-fold-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .combo-compose-card--news .combo-fold > summary {
    display: none;
  }

  .combo-compose-card--news .combo-fold-body {
    padding: 0;
  }
}

/* Мобильный чат: лента прокручивается, composer компактный внизу */
@media (max-width: 991.98px) {
  body.page-chat-messenger,
  body.page-topic-chat {
    min-height: 100dvh;
  }

  body.page-chat-messenger .container-fluid,
  body.page-topic-chat .container-fluid {
    flex: 1 1 auto;
    min-height: 0;
  }

  .page-chat-messenger .main-chat-messenger,
  .page-topic-chat .main-chat-messenger {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - var(--header-h));
    display: flex;
    flex-direction: column;
    padding-bottom: 0.25rem;
  }

  .chat-page-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
  }

  .chat-page-breadcrumb,
  .chat-page-intro-curtain {
    flex-shrink: 0;
  }

  .chat-messenger {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  .chat-messenger-feed {
    flex: 1 1 0;
    min-height: 9rem;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .chat-messenger-panel {
    flex: 0 0 auto;
    max-height: min(38dvh, 280px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .combo-compose-card--compact .combo-composer-line {
    min-height: 2rem;
    max-height: 3.75rem;
    padding: 0.35rem 0.5rem;
  }

  .combo-style-row--toolbar .combo-color-picker {
    gap: 0.2rem;
  }

  .combo-style-row--toolbar .combo-font-select {
    min-width: 4.25rem;
    max-width: 5.5rem;
  }

  .page-topic-chat .topic-chat-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .page-topic-chat .topic-chat-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .page-topic-chat .topic-chat-col-messenger {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .page-topic-chat .topic-chat-bar {
    flex-shrink: 0;
  }

  .page-topic-chat .chat-page-shell--topic {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .page-topic-chat .topic-chat-col-side {
    flex: 0 0 auto;
    max-height: 8.5rem;
    overflow: hidden;
  }

  .page-topic-chat .topic-chat-side-inner {
    max-height: 8.5rem;
    overflow-y: auto;
  }
}


/* Тема: чат на весь экран, поле ввода сразу внизу */
body.page-topic-chat {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.page-topic-chat {
  overflow: hidden;
}

.page-topic-chat .main-chat-messenger {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - var(--header-h));
  overflow: hidden;
  padding-top: 0.35rem;
  padding-bottom: 0.25rem;
}

.page-topic-chat .topic-chat-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.page-topic-chat .topic-chat-breadcrumb {
  flex-shrink: 0;
}

.page-topic-chat .topic-chat-main {
  flex: 1 1 auto;
  min-height: 0;
}

.page-topic-chat .topic-chat-col-messenger {
  min-height: 0;
}

.page-topic-chat .chat-page-shell--topic {
  height: auto;
  flex: 1 1 auto;
  min-height: 14rem;
  max-height: none;
}

.topic-chat-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(232, 168, 74, 0.35);
  background: linear-gradient(120deg, #fffcf7 0%, #f0faf9 100%);
}

.topic-chat-bar-title {
  font-weight: 700;
  color: var(--topic-ink);
}

.topic-chat-bar-meta {
  font-size: 0.72rem;
}

.topic-chat-col-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topic-chat-side-inner {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(38dvh, 320px);
}

@media (min-width: 992px) {
  .page-topic-chat .topic-chat-main {
    flex-wrap: nowrap;
  }

  .page-topic-chat .topic-chat-col-side {
    align-self: stretch;
  }

  .topic-chat-side-inner {
    max-height: 100%;
    height: 100%;
  }
}

@media (max-width: 991.98px) {
  .page-topic-chat .topic-chat-col-side {
    flex-shrink: 0;
  }
}

/* Мессенджер: сначала лента, поле ввода по нажатию */
.messenger-compose-teaser {
  display: block;
  width: 100%;
  border: 1px solid rgba(94, 60, 140, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #7a6d92;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 31, 66, 0.06);
}

.combo-composer-panel--messenger {
  flex-shrink: 0;
  border-top: 1px solid rgba(94, 60, 140, 0.1);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 0.5rem 0.35rem;
}

.chat-messenger-feed {
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-attached-image {
  max-width: min(100%, 320px);
  height: auto;
  border-radius: 12px;
  display: block;
}

.chat-message-image {
  margin: 0.35rem 0 0.5rem;
}

.image-preview-bar,
.image-preview-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.image-preview-bar {
  margin-bottom: 0.35rem;
}

.image-preview-thumb {
  object-fit: cover;
  border-radius: 8px;
}

.combo-fold--inline {
  display: inline-block;
  position: relative;
}

.combo-fold--inline > summary {
  list-style: none;
}

.combo-fold--inline > summary::-webkit-details-marker {
  display: none;
}

.combo-fold-body--inline {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  min-width: 12rem;
  padding: 0.5rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(94, 60, 140, 0.15);
  box-shadow: 0 8px 24px rgba(45, 31, 66, 0.12);
}

.news-post-edit-link {
  margin-left: 0.5rem;
  font-size: 0.78rem;
}

body {
  touch-action: manipulation;
}

main {
  -webkit-overflow-scrolling: touch;
}
