/* ============================================================
   components.css — кнопки, карточки, формы, посты, тосты,
                    модалки, уведомления, аватарки, скелетоны
   ============================================================ */

/* ============================================================
   Кнопки
   ============================================================ */
.btn-primary,
.btn-ghost,
.btn-danger,
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.1s ease;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-2);
  color: #000;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--fg);
}

.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--fg);
  color: var(--fg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-2);
  color: #fff;
}

.btn-mini {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
}

.btn-primary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled,
.btn-mini:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-size: 72px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--fg);
  margin-bottom: 24px;
}

.hero-slogan {
  font-size: 22px;
  line-height: 1.4;
  color: var(--fg-2);
  margin: 0 0 40px;
  max-width: 640px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-note {
  font-size: 14px;
  color: var(--muted);
}

/* ============================================================
   Карточки
   ============================================================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  border-color: var(--border-2);
}

.danger-card {
  border-color: var(--danger);
}

.danger-card p {
  color: var(--fg-2);
}

.cat-card {
  display: block;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}

.cat-card:hover {
  border-color: var(--accent);
  color: var(--fg);
  transform: translateY(-2px);
}

.cat-title {
  color: var(--fg);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
}

.cat-card:hover .cat-title {
  color: var(--accent);
}

/* ============================================================
   Аватарки
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  user-select: none;
  transition: transform 0.15s ease;
}

.avatar:hover {
  transform: scale(1.06);
}

.avatar-big {
  width: 96px;
  height: 96px;
  font-size: 40px;
  flex-shrink: 0;
}

/* ============================================================
   Формы
   ============================================================ */
form label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--fg-2);
}

form input[type=text],
form input[type=email],
form input[type=password],
form input[type=url],
form input[type=search],
form input[type=color],
form textarea,
form select {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}

form textarea {
  min-height: 110px;
  resize: vertical;
  font-family: inherit;
}

form input[type=color] {
  height: 48px;
  padding: 4px;
  cursor: pointer;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox input {
  width: auto;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ============================================================
   Пост
   ============================================================ */
.post {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s ease;
}

.post:hover {
  border-color: var(--border-2);
}

.post-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.post-head .avatar {
  width: 40px;
  height: 40px;
}

.post-head > div {
  min-width: 0;
  flex: 1;
}

.post-author {
  font-weight: 700;
  color: var(--fg);
  display: inline-block;
  font-size: 15px;
}

.post-author:hover {
  color: var(--accent);
}

.post-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.post-cat {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.post-text {
  margin: 12px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
}

.post-video {
  margin: 14px 0;
}

.post-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  background: #000;
}

.post-actions {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}

.post-actions button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.post-actions button:hover {
  color: var(--accent);
}

.post-actions button.liked {
  color: var(--accent);
  font-weight: 500;
}

.post-actions button.faved {
  color: var(--accent);
  font-weight: 500;
}

.post-meta-edited {
  font-style: italic;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.comment {
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: 0;
}

.comment-author {
  color: var(--accent);
  font-weight: 700;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--fg-2);
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-form input {
  flex: 1;
  margin-top: 0;
}

/* ============================================================
   Лента
   ============================================================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.filters button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filters button:hover {
  border-color: var(--border-2);
  color: var(--fg);
}

.filters button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.search-wrap {
  margin-bottom: 20px;
}

.search-wrap input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 15px;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-sentinel {
  height: 1px;
  margin-top: 24px;
}

.feed-end {
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
}

.loader {
  text-align: center;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.post-form textarea {
  margin-bottom: 12px;
}

.post-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-form-row input,
.post-form-row select {
  margin-top: 0;
  flex: 1;
  min-width: 160px;
}

/* ============================================================
   Скелетоны загрузки
   ============================================================ */
.skeleton {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.4s infinite;
}

.skeleton-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-3);
  flex-shrink: 0;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  height: 12px;
  background: var(--bg-3);
  border-radius: 6px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.mid   { width: 70%; }
.skeleton-line.full  { width: 100%; }

.skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

@keyframes skeleton-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ============================================================
   Профиль
   ============================================================ */
.profile-head {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info h1 {
  margin-bottom: 6px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   Статистика
   ============================================================ */
.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.stat-num {
  font-size: 24px;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq details {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

.faq details[open] {
  border-color: var(--border-2);
}

.faq summary {
  cursor: pointer;
  color: var(--fg);
  font-weight: 500;
  list-style: none;
  padding-right: 28px;
  position: relative;
  font-size: 15px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  content: '−';
}

.faq p {
  margin-top: 12px;
  color: var(--fg-2);
  line-height: 1.6;
}

/* ============================================================
   Правила
   ============================================================ */
.rules-list {
  list-style: none;
  padding: 0;
}

.rules-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--fg-2);
}

.rules-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ============================================================
   Уведомления (колокольчик)
   ============================================================ */
.bell-wrap {
  position: relative;
}

.bell {
  position: relative;
  background: none;
  border: 0;
  color: var(--fg-2);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bell:hover {
  background: var(--bg-2);
  color: var(--fg);
}

.bell-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  max-width: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bell-dropdown {
  position: absolute;
  right: 0;
  top: 48px;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  z-index: 60;
  max-height: 440px;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
}

.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
}

.bell-head strong {
  font-size: 14px;
  font-weight: 600;
}

.bell-head .btn-mini {
  padding: 5px 10px;
  font-size: 11px;
}

.bell-list .notif {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.15s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.bell-list .notif:last-child {
  border-bottom: 0;
}

.bell-list .notif:hover {
  background: var(--bg-3);
}

.bell-list .notif.unread {
  background: var(--accent-bg);
}

.notif-time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

@media (max-width: 600px) {
  .bell-dropdown {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 90px);
    border-radius: var(--radius-sm);
  }

  .bell-head {
    padding: 10px 12px;
  }

  .bell-head strong {
    font-size: 13px;
  }

  .bell-head .btn-mini {
    padding: 4px 8px;
    font-size: 10px;
  }

  .bell-list .notif {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
  }

  .notif-time {
    font-size: 11px;
    margin-top: 2px;
  }
}

/* ============================================================
   Админка
   ============================================================ */
.report-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: flex-start;
}

.report-row:last-child {
  border-bottom: 0;
}

.report-info {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

.report-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  margin: 0 -22px;
  padding: 0 22px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 14px; }

/* ============================================================
   Кнопка «наверх»
   ============================================================ */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--accent);
  color: #000;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 40;
  box-shadow: var(--shadow-2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.to-top:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 14px 22px;
  font-size: 14px;
  color: var(--fg);
  z-index: 200;
  box-shadow: var(--shadow-3);
  max-width: calc(100vw - 32px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--accent); }
.toast.error   { border-color: var(--danger); }

/* ============================================================
   Модалка
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  animation: slideUp 0.2s ease;
}

.modal h3 {
  margin-bottom: 14px;
  color: var(--fg);
  font-size: 20px;
}

.modal p {
  color: var(--fg-2);
  margin-bottom: 18px;
  line-height: 1.6;
}

.modal textarea,
.modal input[type=text] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 15px;
  margin-bottom: 18px;
  font-family: inherit;
}

.modal textarea {
  min-height: 90px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

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

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   CTA-секция
   ============================================================ */
.cta-section {
  text-align: center;
  padding: 80px 0;
}

.cta-section h2 {
  margin-top: 0;
  font-size: 32px;
}

.cta-section p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 17px;
}

/* ============================================================
   Медиа в постах (переименовано: .media-grid → .post-media-grid)
   ============================================================ */
.post-media-grid {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-media-grid-1 {
  grid-template-columns: 1fr;
  max-width: 560px;
}

.post-media-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.post-media-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.post-media-grid-3 .media-item:first-child {
  grid-row: span 2;
}

.post-media-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.media-item {
  display: block;
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 1 / 1;
}

.post-media-grid-1 .media-item {
  aspect-ratio: auto;
  max-height: 500px;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.media-item:hover img {
  transform: scale(1.02);
}

.post-video {
  margin: 12px 0;
}

.post-video video {
  width: 100%;
  max-height: 500px;
  border-radius: var(--radius-sm);
  background: #000;
  display: block;
}

.post-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  background: #000;
}

.video-note {
  font-size: 12px;
  margin-top: 4px;
}

/* Превью прикреплённых файлов в форме */
.media-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.media-preview:empty {
  display: none;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-file {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px;
  font-size: 12px;
  text-align: center;
  color: var(--fg-2);
  word-break: break-all;
}

.media-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-remove:hover {
  background: var(--danger);
}

.media-preview-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
}

.media-preview-bar {
  height: 100%;
  background: var(--accent);
  transition: width .15s ease;
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s ease, color .15s ease;
}

.attach-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Чат (общий)
   ============================================================ */
.chat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.chat-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-2);
}

.chat-head h2 {
  margin: 0;
  font-size: 17px;
}

.chat-head .chat-online {
  font-size: 13px;
  color: var(--muted);
}

.chat-messages {
  padding: 12px 18px;
  height: 400px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}

.chat-message {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  align-items: flex-start;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.chat-body {
  flex: 1;
  min-width: 0;
}

.chat-head-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 2px;
}

.chat-author {
  font-weight: 700;
  font-size: 13px;
  color: var(--fg);
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
}

.chat-text {
  font-size: 14px;
  color: var(--fg-2);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.chat-mine .chat-author {
  color: var(--accent);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.chat-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 14px;
  margin-top: 0;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   Аватарка с картинкой
   ============================================================ */
.avatar-img {
  padding: 0;
  overflow: hidden;
  background: var(--bg-3) !important;
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar-edit {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.avatar-preview {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.avatar-preview .avatar-big {
  width: 100%;
  height: 100%;
  font-size: 40px;
}

.avatar-edit-actions {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-edit-actions .btn-ghost {
  align-self: flex-start;
}

/* ============================================================
   Мобильная адаптация (общая)
   ============================================================ */
@media (max-width: 600px) {
  .chat-messages {
    height: 320px;
    padding: 10px 14px;
  }
  .chat-form {
    padding: 10px 14px;
  }
  .chat-head {
    padding: 12px 14px;
  }

  .avatar-edit {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .avatar-edit-actions {
    align-items: center;
  }
  .avatar-edit-actions .btn-ghost {
    align-self: center;
  }

  .post {
    padding: 14px;
  }
  .card {
    padding: 16px;
  }
  .profile-actions {
    flex-direction: column;
  }
  .profile-actions .btn-ghost,
  .profile-actions .btn-primary {
    width: 100%;
  }
  .post-actions {
    gap: 10px;
    font-size: 12px;
  }
  .post-actions button {
    font-size: 12px;
  }
}

/* ============================================================
   Кнопка «Показать новые посты»
   ============================================================ */
.new-posts-btn {
  position: sticky;
  top: 70px;
  z-index: 30;
  display: block;
  width: 100%;
  padding: 12px 20px;
  margin-bottom: 14px;
  background: var(--accent);
  color: #000;
  border: 0;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.new-posts-btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .new-posts-btn {
    top: 60px;
    padding: 11px 16px;
    font-size: 13px;
  }
}

/* ============================================================
   Вкладки профиля
   ============================================================ */
.profile-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
  margin-bottom: -1px;
}

.profile-tab:hover {
  color: var(--fg);
}

.profile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profile-tab-panel {
  min-height: 100px;
}

/* ============================================================
   Личные сообщения
   ============================================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  min-height: 500px;
}

.dialogs {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  max-height: 600px;
}

.dialog-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  transition: background .15s ease;
}

.dialog-item:hover {
  background: var(--bg-3);
  color: var(--fg);
}

.dialog-item.active {
  background: var(--accent-bg);
}

.dialog-item-body {
  flex: 1;
  min-width: 0;
}

.dialog-item-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

.dialog-item-last {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-item-badge {
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 18px;
  text-align: center;
}

.dialog {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: 600px;
  position: relative;
}

.dialog-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dialog-back-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--fg-2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: -8px;
  line-height: 1;
}

.dialog-back-btn:hover {
  color: var(--accent);
}

.dialog-head-name {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.dialog-head-name:hover {
  color: var(--accent);
}

.dialog-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.dialog-msg {
  max-width: 75%;
  align-self: flex-start;
}

.dialog-msg.mine {
  align-self: flex-end;
}

.dialog-msg-text {
  background: var(--bg-3);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--fg-2);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.dialog-msg.mine .dialog-msg-text {
  background: var(--accent);
  color: #000;
}

.dialog-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-2);
}

.dialog-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 16px; /* важно: 16px, иначе iOS зумит при фокусе */
  margin-top: 0;
  min-width: 0;
}

.dialog-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   Мобильная версия ЛС
   ============================================================ */
@media (max-width: 700px) {
  .messages-layout {
    display: block;
    min-height: auto;
  }

  .dialogs {
    max-height: none;
    border-radius: var(--radius);
  }

  .dialog {
    min-height: auto;
    max-height: none;
    border-radius: var(--radius);
    display: none; /* скрыт, пока не выбран диалог */
  }

  /* Когда диалог открыт — показываем чат, прячем список */
  .messages-layout.mobile-chat-open .dialogs {
    display: none;
  }

  .messages-layout.mobile-chat-open .dialog {
    display: flex;
    height: calc(100dvh - 140px);
    min-height: 400px;
  }

  .messages-layout.mobile-chat-open .dialog-empty {
    display: none;
  }

  .dialog-back-btn {
    display: inline-block;
  }

  .dialog-head {
    padding: 10px 12px;
  }

  .dialog-messages {
    padding: 10px 12px;
  }

  .dialog-form {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .dialog-form button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* ============================================================
   Соцсети в подвале
   ============================================================ */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}

.footer-social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.footer-social-btn svg {
  flex-shrink: 0;
}

/* QR-код в подвале */
.footer-qr {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-qr-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-qr-box img {
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
  flex-shrink: 0;
}

.footer-qr-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-qr-text strong {
  color: var(--fg);
  font-size: 15px;
}

.footer-qr-text .muted {
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .footer-social {
    width: 100%;
  }
  .footer-social-btn {
    flex: 1;
    justify-content: center;
  }
  .footer-qr-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* ============================================================
   Пагинация ленты
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0 16px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .1s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  min-width: 40px;
  text-align: center;
}

.open-post-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.open-post-btn:hover {
  color: var(--accent);
}

.post-single {
  margin-top: 8px;
}

/* ============================================================
   Статьи
   ============================================================ */
.article-card {
  transition: border-color .15s ease;
}

.article-card:hover {
  border-color: var(--border-2);
}

.article-cover {
  display: block;
  margin: -22px -22px 16px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  max-height: 300px;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.article-title a {
  color: var(--fg);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--accent);
}

.article-excerpt {
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 15px;
}

.article-single {
  margin-top: 8px;
}

.article-header {
  margin-bottom: 24px;
}

.article-header h1 {
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-cover-full {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-cover-full img {
  width: 100%;
  display: block;
}

.article-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--fg-2);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content h2 {
  font-size: 24px;
  color: var(--fg);
  margin: 32px 0 16px;
}

.article-content h3 {
  font-size: 20px;
  color: var(--fg);
  margin: 24px 0 12px;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 20px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .article-header h1 {
    font-size: 24px;
  }
  .article-title {
    font-size: 20px;
  }
  .article-content {
    font-size: 16px;
  }
  .article-cover {
    margin: -16px -16px 12px;
  }
}

/* ============================================================
   Загрузка обложки статьи
   ============================================================ */
.cover-upload {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cover-preview {
  flex-shrink: 0;
  width: 200px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview-empty {
  font-size: 13px;
  color: var(--muted);
}

.cover-actions {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-actions .btn-ghost {
  align-self: flex-start;
}

@media (max-width: 600px) {
  .cover-upload {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cover-actions {
    align-items: center;
  }
  .cover-actions .btn-ghost {
    align-self: center;
  }
}

/* ============================================================
   Обложки статей — 16:9
   ============================================================ */

.cover-upload {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cover-preview {
  flex-shrink: 0;
  width: 320px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview-empty {
  font-size: 13px;
  color: var(--muted);
}

.cover-actions {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-actions .btn-ghost {
  align-self: flex-start;
}

.article-cover {
  display: block;
  margin: -22px -22px 16px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}

.article-card:hover .article-cover img {
  transform: scale(1.02);
}

.article-cover-full {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}

.article-cover-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 600px) {
  .cover-upload {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cover-preview {
    width: 100%;
  }
  .cover-actions {
    align-items: center;
    width: 100%;
  }
  .cover-actions .btn-ghost {
    align-self: center;
  }
}

/* ============================================================
   Обложка статьи в редакторе — новая версия
   ============================================================ */
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--fg-2);
}

.cover-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cover-preview {
  flex-shrink: 0;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.cover-preview-empty span {
  font-size: 20px;
  font-weight: 700;
  color: var(--border-2);
}

.cover-preview-empty small {
  font-size: 12px;
}

.cover-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-info .btn-ghost,
.cover-info .cover-remove-btn {
  align-self: flex-start;
}

.cover-remove-btn {
  color: var(--danger);
  border-color: var(--danger);
}

.cover-remove-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.cover-hint {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.article-author-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-back {
  margin-top: 20px;
}

@media (max-width: 700px) {
  .cover-block {
    flex-direction: column;
    align-items: stretch;
  }

  .cover-preview {
    width: 100%;
  }

  .cover-info {
    width: 100%;
  }

  .cover-info .btn-ghost,
  .cover-info .cover-remove-btn {
    align-self: stretch;
    text-align: center;
    justify-content: center;
  }
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn-primary,
  .form-actions .btn-ghost,
  .form-actions .btn-danger {
    width: 100%;
  }
  .form-actions .btn-danger {
    margin-left: 0 !important;
    order: 10;
  }
}

/* ============================================================
   Ответы на комментарии
   ============================================================ */

.comment {
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.comment:last-child {
  border-bottom: 0;
}

.comment-children {
  margin-left: 32px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-top: 6px;
}

.comment-depth-0 { padding-left: 0; }
.comment-depth-1 { padding-left: 8px; }
.comment-depth-2 { padding-left: 8px; }
.comment-depth-3 { padding-left: 8px; }

.comment-author {
  color: var(--accent);
  font-weight: 700;
}

.comment-reply-to {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.comment-time {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--fg-2);
}

.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.comment-actions button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}

.comment-actions button:hover {
  color: var(--accent);
}

.comment-reply-form-wrap {
  margin-top: 10px;
}

.comment-reply-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-reply-form input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 14px;
}

.comment-reply-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-form input {
  flex: 1;
  margin-top: 0;
}

.comment-highlight {
  animation: comment-flash 2s ease;
}

@keyframes comment-flash {
  0%   { background: var(--accent-bg); }
  100% { background: transparent; }
}

@media (max-width: 600px) {
  .comment-children {
    margin-left: 16px;
    padding-left: 8px;
  }
  .comment-reply-form {
    flex-direction: column;
  }
}

/* ============================================================
   VK ID авторизация
   ============================================================ */
.auth-vk-card {
  padding: 20px 22px;
}

.auth-divider {
  position: relative;
  text-align: center;
  margin-bottom: 16px;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: var(--bg-2);
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   Опросы
   ============================================================ */
.poll {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}

.poll-question {
  font-weight: 700;
  font-size: 16px;
  color: var(--fg);
  margin-bottom: 12px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poll-option {
  position: relative;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease;
}

.poll-option:hover {
  border-color: var(--accent);
}

.poll-option.voted {
  cursor: default;
}

.poll-option.voted:hover {
  border-color: var(--border);
}

.poll-option-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--accent-bg);
  transition: width .3s ease;
  z-index: 0;
}

.poll-option-text {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-2);
}

.poll-option-count {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.poll-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.poll-builder {
  margin: 12px 0;
  padding: 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.poll-builder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.poll-builder-head strong {
  color: var(--fg);
  font-size: 14px;
}

.poll-builder input[type=text] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 14px;
  margin-bottom: 10px;
}

.poll-option-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.poll-option-input input {
  flex: 1;
  margin-bottom: 0 !important;
}

.poll-option-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
}

/* ============================================================
   Фикс клика по опросу
   ============================================================ */
.poll-option,
.poll-option-bar,
.poll-option-text,
.poll-option-count {
  user-select: none;
  -webkit-user-select: none;
}

.poll-option-bar,
.poll-option-text,
.poll-option-count {
  pointer-events: none;
}

.poll-option {
  cursor: pointer;
}

.poll-option.voted {
  cursor: default;
}