/* Общие стили веб-приложения — современный интерфейс (Plus Jakarta Sans) */

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Тонкие полосы прокрутки */
html { scrollbar-width: thin; scrollbar-color: #475569 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: #64748b; }
*::-webkit-scrollbar-corner { background: transparent; }

body {
  position: relative;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color: #e2e8f0;
  padding: 20px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1e2432 url('../1646669475_2-abrakadabra-fun-p-oboi-na-rabochii-stol-sero-sinie-3.jpg') center / cover no-repeat;
  z-index: -1;
  pointer-events: none;
}
.container {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transition: opacity 0.32s ease-out, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.container.view-leave {
  opacity: 0;
  transform: translateY(-14px);
}
.container.view-enter {
  opacity: 0;
  transform: translateY(20px);
}
.container.view-enter-active {
  opacity: 1;
  transform: translateY(0);
}

.site-header { text-align: center; margin-bottom: 0.35rem; padding: 0.15rem 0; }
.site-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.02em;
}
h1 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-top: 0;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: -0.02em;
}
h2, h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

/* Карточки */
.card {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  padding: 1.25rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: rgba(71, 85, 105, 0.6); box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22); }

/* Формы */
.form-group { margin-bottom: 1.125rem; }
.form-group:last-child { margin-bottom: 0; }
label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: -0.01em;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  color: #f1f5f9;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: #64748b; }
input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.35);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}
.btn-success:hover { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4); transform: translateY(-1px); }
.btn-secondary {
  background: rgba(51, 65, 85, 0.7);
  color: #e2e8f0;
  border: 1px solid rgba(71, 85, 105, 0.5);
}
.btn-secondary:hover { background: rgba(71, 85, 105, 0.8); transform: translateY(-1px); }

/* Индикатор загрузки на кнопках */
.btn.loading {
  position: relative;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
  cursor: not-allowed;
}
.btn.loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: settings-spin 0.65s linear infinite;
}
.btn-secondary.loading::after {
  border-color: rgba(226, 232, 240, 0.25);
  border-top-color: #e2e8f0;
}

/* Сообщения и подсказки */
.msg {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  font-weight: 500;
}
.msg.error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.msg.success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.hint { font-size: 0.875rem; color: #94a3b8; margin-top: 0.35rem; line-height: 1.45; }
a:not(.btn) { color: #38bdf8; text-decoration: none; font-weight: 500; transition: color 0.15s; }
a:not(.btn):hover { color: #7dd3fc; }
code { background: rgba(51, 65, 85, 0.6); padding: 0.2em 0.45em; border-radius: 8px; font-size: 0.9em; }
footer { margin-top: 2rem; font-size: 0.8125rem; color: #64748b; text-align: center; }
.hidden { display: none; }

/* OAuth: кнопки входа через Yandex / VK */
.oauth-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.btn-oauth {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-oauth:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-yandex {
  background: #fc3f1d;
  color: #fff;
  border: none;
  box-shadow: 0 2px 12px rgba(252, 63, 29, 0.35);
}
.btn-yandex:hover { box-shadow: 0 4px 16px rgba(252, 63, 29, 0.45); }
.btn-vk {
  background: #0077ff;
  color: #fff;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 119, 255, 0.35);
}
.btn-vk:hover { box-shadow: 0 4px 16px rgba(0, 119, 255, 0.45); }
.oauth-divider {
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
  margin: 0.75rem 0 1rem;
  position: relative;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: rgba(71, 85, 105, 0.5);
}
.oauth-divider::before { left: 0; }
.oauth-divider::after { right: 0; }

.oauth-hint {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.oauth-vkid-label {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0.5rem 0 0.35rem;
}
.vkid-widget-wrap {
  margin-bottom: 1rem;
  min-height: 44px;
}

/* Табы */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 16px;
  border: 1px solid rgba(51, 65, 85, 0.4);
}
.tabs a {
  flex: 1;
  padding: 0.6rem 0.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  border-radius: 12px;
  text-align: center;
  transition: color 0.15s, background 0.15s;
}
.tabs a:hover { color: #e2e8f0; background: rgba(51, 65, 85, 0.4); }
.tabs a.active { color: #f8fafc; background: rgba(14, 165, 233, 0.25); border: none; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.subscription-server-choice { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subscription-server-btn-active { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important; color: #fff !important; box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3); }
.subscription-server-btn-active:hover { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4); }
.subscription-server-links { border-left: 3px solid rgba(14, 165, 233, 0.5); padding-left: 0.875rem; border-radius: 2px; }

/* Новости */
.news-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.news-nav.hidden { display: none; }
.news-nav-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.news-nav-btn:hover:not(:disabled) { background: rgba(51, 65, 85, 0.6); transform: scale(1.05); }
.news-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.news-nav-counter { font-size: 0.9375rem; font-weight: 500; color: #94a3b8; min-width: 4rem; text-align: center; }
.news-current { min-height: 120px; }
#news-empty { text-align: center; padding: 2rem 0.5rem; margin: 0; color: #64748b; font-size: 0.9375rem; }

/* Плавное появление карточки новости */
.news-post-card {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.news-post-card.news-post-card-visible {
  opacity: 1;
}
/* Скелетон только под картинку: по размеру (пропорции 16:9), потом подстраивается под изображение */
.news-post-media {
  margin-bottom: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.news-post-media.news-post-media-loading {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, rgba(51, 65, 85, 0.35) 0%, rgba(71, 85, 105, 0.25) 50%, rgba(51, 65, 85, 0.35) 100%);
  background-size: 200% 100%;
  animation: news-media-shimmer 1.4s ease-in-out infinite;
}
@keyframes news-media-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.news-post-media .news-post-img {
  display: block;
  max-width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.news-post-media.news-post-media-loaded .news-post-img {
  opacity: 1;
}
.news-post-media.news-post-media-loaded {
  aspect-ratio: auto;
  background: transparent;
  animation: none;
}
.news-post-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.news-post-date { font-size: 0.8125rem; color: #94a3b8; }
.news-test-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.news-post-video { display: block; max-width: 100%; }
.news-post-text { margin-bottom: 0.75rem; word-wrap: break-word; line-height: 1.55; font-size: 0.9375rem; }
.news-post-text b, .news-post-text strong { font-weight: 700; color: #f8fafc; }
.news-post-text i, .news-post-text em { font-style: italic; }
.news-post-text a { color: #38bdf8; text-decoration: none; font-weight: 500; }
.news-post-text a:hover { text-decoration: underline; }
.news-post-text code { background: rgba(51, 65, 85, 0.6); padding: 0.2em 0.45em; border-radius: 8px; font-size: 0.9em; }
.news-post-text pre { background: rgba(15, 23, 42, 0.6); padding: 0.875rem; border-radius: 12px; overflow-x: auto; font-size: 0.875rem; margin: 0.5rem 0; white-space: pre-wrap; }
.news-post-actions { margin-top: 0.6rem; display: flex; justify-content: flex-end; }
.news-like-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.news-like-btn-liked { color: #f43f5e; background: rgba(244, 63, 94, 0.2) !important; border-radius: 10px; }

/* Модальное окно */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.show { display: flex; }
html.modal-open, html.modal-open body { overflow: hidden !important; height: 100%; }
body.modal-open { position: fixed; left: 0; right: 0; }
.modal-content {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.modal-content table { color: #cbd5e1; font-size: 0.9375rem; }
.modal-content table td { padding: 0.5rem 0.6rem; vertical-align: top; }

/* Карточки тарифов и подписок */
.tariff-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 16px;
  transition: border-color 0.2s, transform 0.15s;
}
.tariff-card:hover { border-color: rgba(71, 85, 105, 0.6); transform: translateY(-2px); }
.tariff-card strong { color: #f8fafc; font-weight: 600; }
.tariff-card .btn { flex-shrink: 0; }
.trial-card-text { flex: 1; min-width: 0; line-height: 1.45; font-size: 0.9375rem; }
.trial-card-wrap .btn { margin-left: auto; flex-shrink: 0; }
.sub-card {
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 16px;
  transition: border-color 0.2s;
}
.sub-card strong { color: #f8fafc; font-weight: 600; }
.sub-card .btn { margin-top: 0.5rem; margin-right: 0.5rem; }
.subscription-links { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.manual-insert { margin-top: 0.875rem; }
.manual-insert label { font-size: 0.875rem; font-weight: 600; color: #94a3b8; margin-bottom: 0.35rem; }
.manual-insert-row { display: flex; gap: 0.5rem; align-items: stretch; margin-top: 0.4rem; }
.manual-insert-row input { flex: 1; font-size: 0.875rem; border-radius: 14px; }
.manual-insert-row .btn-copy { flex-shrink: 0; }

/* Секции и статистика */
.section-title { font-size: 1rem; font-weight: 600; color: #f8fafc; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.stats { display: flex; flex-direction: column; gap: 0.5rem; }
.stat { display: flex; justify-content: space-between; align-items: center; font-size: 0.9375rem; padding: 0.4rem 0; }
.stat-left { color: #94a3b8; font-weight: 500; }
.stat-right { color: #e2e8f0; font-weight: 600; }
.stat-right.stat-active { color: #4ade80; }
.stat-right.stat-inactive { color: #94a3b8; }
.progress-wrap { height: 8px; background: rgba(51, 65, 85, 0.5); border-radius: 999px; overflow: hidden; margin: 0.35rem 0; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); border-radius: 999px; transition: width 0.25s ease; }
.progress-bar.progress-bar-warning { background: linear-gradient(90deg, #eab308, #facc15); }
.progress-bar.progress-bar-danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.top-stats-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.4s ease-out, opacity 0.35s ease-out, margin-bottom 0.35s ease-out;
}
.top-stats-wrap.top-stats-wrap-visible {
  max-height: 220px;
  opacity: 1;
  margin-bottom: 1.25rem;
}
.top-stats-sticky {
  margin-bottom: 0;
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Детали подписки */
.sub-info-card { padding: 1.25rem 1.5rem; }
.sub-info-card .section-title { margin-bottom: 1rem; font-size: 1rem; }
.sub-info-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.sub-info-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600;
  background: rgba(51, 65, 85, 0.5); border: 1px solid rgba(71, 85, 105, 0.5);
  color: #cbd5e1;
}
.sub-info-badge .badge-label { color: #94a3b8; }
.sub-info-badge.sub-info-badge-status { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.4); color: #86efac; }
.sub-info-badge.sub-info-badge-status .badge-label { color: #4ade80; }
.sub-info-badge.sub-info-badge-status-inactive { background: rgba(100, 116, 139, 0.3); border-color: rgba(100, 116, 139, 0.5); color: #94a3b8; }
.sub-info-badge.sub-info-badge-status-inactive .badge-label { color: #64748b; }
.sub-info-stats { margin-bottom: 1rem; }
.sub-info-details {
  display: grid; gap: 0;
  background: rgba(15, 23, 42, 0.4); border-radius: 16px;
  overflow: hidden; border: 1px solid rgba(51, 65, 85, 0.5);
}
.sub-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; gap: 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  font-size: 0.9375rem;
}
.sub-info-row:last-child { border-bottom: none; }
.sub-info-label { color: #94a3b8; flex-shrink: 0; font-weight: 500; }
.sub-info-value { color: #e2e8f0; font-weight: 600; text-align: right; word-break: break-all; }
.sub-info-value.sub-id { font-family: ui-monospace, monospace; font-size: 0.8125rem; }

/* Бонусы и рефералы */
.bonuses-section { margin-bottom: 1.25rem; }
.bonuses-section .section-title { margin-bottom: 0.5rem; }
.referral-link-row { display: flex; gap: 0.5rem; align-items: stretch; margin-top: 0.5rem; }
.referral-link-input { flex: 1; padding: 0.65rem 1rem; font-size: 0.875rem; background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 14px; color: #e2e8f0; }
.referral-link-row .btn-copy-referral { flex-shrink: 0; }
.bonuses-referrals-list .sub-info-row { border-bottom: 1px solid rgba(51, 65, 85, 0.4); }
.bonuses-referrals-list .sub-info-row:last-child { border-bottom: none; }
.bonuses-referrals-list .bonuses-total { font-weight: 700; background: rgba(51, 65, 85, 0.35); }
.bonuses-medals-count { margin-bottom: 0.5rem; }
.bonuses-medals-msg { display: block; opacity: 0; transition: opacity 0.35s ease; margin-bottom: 0.75rem; }
.bonuses-medals-msg.bonuses-medals-msg-visible { opacity: 1; }
.bonuses-medals-msg.hidden { display: none !important; }
.settings-avatar-msg { display: block; opacity: 0; transition: opacity 0.35s ease; }
.settings-avatar-msg.settings-avatar-msg-visible { opacity: 1; }
.settings-avatar-msg.hidden { display: none !important; }
.bonuses-exchange-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bonuses-exchange-buttons .btn { flex: 1; min-width: 140px; border-radius: 14px; }
.bonuses-exchange-buttons .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bonuses-exchange-buttons .btn { display: inline-flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.bonuses-exchange-buttons .bonuses-btn-top { font-size: 0.85em; }
.bonuses-exchange-buttons .bonuses-btn-bottom { font-weight: 600; }
.referrals-list-blocks { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.75rem; }
.referral-card {
  display: flex; flex-direction: row; align-items: flex-start; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 18px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
  transition: border-color 0.2s, transform 0.15s;
}
.referral-card:hover { border-color: rgba(71, 85, 105, 0.6); transform: translateY(-2px); }
.referral-card-avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.referral-card-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.referral-avatar-placeholder { width: 56px; height: 56px; border-radius: 50%; background: #475569; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 1.5rem; }
.referral-avatar-placeholder::before { content: '👤'; }
.referral-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.referral-card-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.referral-label { font-size: 0.8125rem; color: #94a3b8; flex-shrink: 0; font-weight: 500; }
.referral-value { font-size: 0.9375rem; font-weight: 600; color: #e2e8f0; word-break: break-word; }
.referral-card-row:nth-child(2) .referral-value { font-weight: 700; }
.referral-card-row:last-child .referral-value { color: #38bdf8; }
.badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: rgba(34, 197, 94, 0.25); color: #86efac; }
.badge-secondary { background: rgba(51, 65, 85, 0.6); color: #94a3b8; }
.badge-medal { background: rgba(234, 179, 8, 0.25); color: #facc15; }

/* Утилиты и настройки */
.mt-1 { margin-top: 1rem; }
.msg.mb-1 { margin-bottom: 1rem; }
.trial-hint { margin: 0.35rem 0 0.5rem; font-size: 0.875rem; color: #94a3b8; }
.referral-debug-hint { margin-bottom: 0.5rem; font-size: 0.75rem; color: #64748b; }
.user-info-text { margin: 0 0 1rem; color: #94a3b8; font-size: 0.9375rem; }
.user-card-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* ——— Настройки личного кабинета (модальное окно) ——— */
.settings-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-modal-title {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.settings-section {
  margin-bottom: 0;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.settings-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.settings-section:first-of-type { padding-top: 0; }
.settings-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}
.settings-section .hint {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}
/* Имя: строка ввода и кнопка */
.settings-display-name-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.settings-display-name-input {
  flex: 1;
  min-width: 180px;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.6);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  font-size: 0.9375rem;
  font-family: inherit;
}
.settings-display-name-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.settings-display-name-row .btn {
  flex-shrink: 0;
  align-self: center;
}
#settings-display-name-msg { margin-top: 0.75rem; margin-bottom: 0; }
/* Аватар: превью и кнопки в одну линию */
.settings-avatar-block {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.settings-avatar-preview-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(51, 65, 85, 0.5);
  border: 2px solid rgba(71, 85, 105, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.settings-avatar-preview { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.settings-avatar-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-avatar-preview img.hidden { display: none; }
.settings-avatar-placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%; background: #475569;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 2rem;
}
.settings-avatar-placeholder::before { content: '👤'; }
.settings-avatar-preview img:not(.hidden) ~ .settings-avatar-placeholder { display: none; }
.settings-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 140px;
}
.settings-avatar-actions label.disabled { opacity: 0.6; pointer-events: none; cursor: not-allowed; }
.settings-avatar-input { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; }
.settings-avatar-hint { margin: 0 0 0.5rem; font-size: 0.8125rem; color: #94a3b8; }
#settings-avatar-msg { margin-top: 0.75rem; margin-bottom: 0; }
/* Кнопка «Закрыть» */
.settings-modal-close {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(51, 65, 85, 0.5);
}
.settings-modal-close:hover {
  background: rgba(71, 85, 105, 0.6);
}
.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.875rem; border-radius: 12px; }
.settings-avatar-loading {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; z-index: 2;
}
.settings-avatar-loading.hidden { display: none !important; }
.settings-avatar-loading-text { font-size: 0.75rem; color: #94a3b8; }
.settings-avatar-progress-wrap { width: 90%; max-width: 64px; height: 6px; background: rgba(51, 65, 85, 0.6); border-radius: 999px; overflow: hidden; }
.settings-avatar-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); border-radius: 999px; transition: width 0.15s ease; }
.settings-avatar-spinner { width: 24px; height: 24px; border: 2px solid rgba(51, 65, 85, 0.6); border-top-color: #0ea5e9; border-radius: 50%; animation: settings-spin 0.7s linear infinite; }
@keyframes settings-spin { to { transform: rotate(360deg); } }
.page-version-hint { font-size: 0.7rem; color: #475569; margin-bottom: 0.5rem; }

/* ——— Адаптация под мобильные: поведение как у приложения (без подпрыгивания при скролле) ——— */
@media (max-width: 768px) {
  body { padding: 14px; min-height: 100dvh; overscroll-behavior-y: none; touch-action: pan-y; }
  .container { max-width: 100%; }
  .site-brand { font-size: 1.15rem; }
  h1 { font-size: 1.0625rem; margin-bottom: 1rem; }
  h2, h3 { font-size: 1rem; }
  .card { padding: 1.125rem 1.25rem; border-radius: 18px; margin-bottom: 0.875rem; }
  .tabs { padding: 0.2rem; margin-bottom: 1rem; border-radius: 14px; }
  .tabs a { padding: 0.55rem 0.4rem; font-size: 0.8125rem; }
  .btn { padding: 0.7rem 1.1rem; font-size: 0.9rem; border-radius: 12px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"] { padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 1rem; }
  .tariff-card { padding: 1rem 1.25rem; border-radius: 14px; flex-wrap: wrap; gap: 0.75rem; }
  .tariff-card .btn { width: 100%; }
  .sub-card { padding: 1rem 1.25rem; border-radius: 14px; }
  .subscription-links .btn { width: 100%; }
  .sub-info-details { border-radius: 14px; }
  .sub-info-row { padding: 0.65rem 0.9rem; font-size: 0.875rem; }
  .top-stats-sticky { padding: 0.875rem 1rem; border-radius: 18px; margin-bottom: 1rem; }
  .modal-content { padding: 1.25rem 1.5rem; border-radius: 18px; margin: 0.5rem; }
  .settings-modal-title { padding-bottom: 0.875rem; margin-bottom: 1rem; font-size: 1.0625rem; }
  .settings-section { padding: 1rem 0; }
  .settings-display-name-row { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .settings-display-name-input { min-width: 0; }
  .settings-display-name-row .btn { width: 100%; align-self: stretch; }
  .settings-avatar-block { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .settings-modal-close { margin-top: 1rem; }
  .news-nav-btn { width: 40px; height: 40px; border-radius: 12px; }
  .news-post-card { padding: 0.875rem; border-radius: 14px; }
  .referral-card { padding: 1rem 1.25rem; border-radius: 16px; }
  .referral-card-avatar, .referral-avatar-placeholder { width: 48px; height: 48px; font-size: 1.35rem; }
  .bonuses-exchange-buttons .btn { min-width: 100%; }
}

@media (max-width: 480px) {
  body { padding: 12px; }
  .container { max-width: 100%; }
  .card { padding: 1rem 1.125rem; border-radius: 16px; }
  h1 { font-size: 1rem; margin-bottom: 0.875rem; }
  h2 { font-size: 0.9375rem; }
  .tabs a { padding: 0.5rem 0.35rem; font-size: 0.75rem; }
  .tariff-card { padding: 0.875rem 1rem; }
  .sub-card { padding: 0.875rem 1rem; }
  .manual-insert-row { flex-direction: column; }
  .manual-insert-row .btn-copy { width: 100%; }
  .sub-info-card { padding: 1rem; }
  .sub-info-badges { margin-bottom: 0.75rem; }
  .sub-info-badge { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
  .sub-info-row { padding: 0.5rem 0.75rem; }
  .stats .stat { flex-wrap: wrap; }
  .section-title { font-size: 0.9375rem; }
  .referral-card { padding: 0.875rem 1rem; gap: 0.75rem; }
  .referral-card-avatar, .referral-avatar-placeholder { width: 44px; height: 44px; font-size: 1.25rem; }
  .referral-link-row { flex-direction: column; }
  .referral-link-row .btn-copy-referral { width: 100%; }
  .user-card-buttons .btn { width: 100%; }
  .modal-content { padding: 1rem 1.25rem; border-radius: 16px; }
  .settings-modal-title { font-size: 1rem; padding-bottom: 0.75rem; margin-bottom: 0.875rem; }
  .settings-section { padding: 0.875rem 0; }
  .settings-avatar-preview-wrap { width: 72px; height: 72px; }
  .settings-modal-close { margin-top: 1rem; padding: 0.65rem 1rem; }
}

/* Поддержка: та же ширина колонки, что и на dashboard (480px) */
body.page-support-body { padding: 0 20px; }
.container-support {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}
.container-support .site-header { flex-shrink: 0; padding: 0.35rem 1rem; margin-bottom: 0.25rem; }
.page-support {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.4s ease-out, transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
body.support-page-visible .page-support {
  opacity: 1;
  transform: translateY(0);
}
.page-support .support-page-title,
.page-support .support-back-dashboard {
  flex-shrink: 0;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.page-support .support-page-title { margin-top: 0; margin-bottom: 0.5rem; text-align: center; }
.page-support .support-back-dashboard { margin-bottom: 0.5rem; text-align: center; }
.page-support .support-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: auto;
  max-width: 100%;
}
@media (min-width: 769px) {
  .page-support .support-wrap { max-width: 480px; margin: auto; width: 100%; }
}
.page-support .support-chat-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.page-support .support-chat-header { flex-shrink: 0; }
.page-support .support-chat-pane { padding: 0.5rem 0.3rem 0.3rem 0.3rem; }
.page-support .support-list-pane { padding: 1.25rem 1.3rem; }
.page-support .support-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: transparent;
  border-radius: 16px;
  margin: 0 0.25rem;
}
.page-support .support-input-wrap { flex-shrink: 0; }
.page-support .support-empty-chat { flex: 1; display: flex; align-items: center; justify-content: center; }
.page-support .support-empty-chat.hidden { display: none !important; }

/* ——— Поддержка: современный интерфейс чата (мессенджер) ——— */
.support-chat-pane,
.support-chat-pane * {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.support-back-dashboard { margin-bottom: 1rem; }
.support-back-dashboard .btn { text-decoration: none; }
.support-wrap { max-width: 480px; margin: 3rem 2rem; }

/* Список обращений */
.support-list-pane h2 {
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.support-thread-item {
  display: block;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 16px;
  color: #f1f5f9;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.support-thread-item:hover {
  border-color: rgba(71, 85, 105, 0.8);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-1px);
}
.support-thread-user { display: block; font-size: 0.9375rem; font-weight: 600; color: #f8fafc; margin-bottom: 0.25rem; letter-spacing: -0.01em; }
.support-thread-preview { display: block; font-size: 0.875rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.support-thread-meta { font-size: 0.8125rem; color: #64748b; margin-top: 0.35rem; display: block; }
.support-thread-unread {
  display: inline-block;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.35rem;
}

/* Блок чата — цветовая схема и скругления как на сайте (.card) */
.support-chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  background: url('../ghghfgh5.jfif') center / cover no-repeat #1e293b;
  border-radius: 20px;
  border: 2px solid rgba(100, 116, 139, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.support-chat-pane:hover {
  border-color: rgba(100, 116, 139, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.container-support .support-chat-pane { min-height: 0; }
.page-support .support-chat-pane.hidden { display: none !important; }

/* Шапка чата (выше блока чата) */
.support-chat-header {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0.5rem 1.25rem;
  margin-bottom: 0rem;
  font-weight: 500;
  font-size: 1rem;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.support-back-link {
  flex-shrink: 0;
  margin-left: 0.75rem;
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}
.support-back-link.hidden { display: none; }
#support-chat-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.support-back-link:hover { color: #7dd3fc; }

/* Лента сообщений */
.support-messages {
  flex: 1;
  min-height: 200px;
  max-height: none;
  overflow-y: auto;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: transparent;
  border-radius: 16px;
  margin: 0 0.25rem;
}
.support-msg { display: flex; cursor: pointer; transition: opacity 0.15s; }
.support-msg:hover { opacity: 0.92; }
.support-msg-new {
  animation: support-msg-in 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes support-msg-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.support-msg-mine { justify-content: flex-end; }
.support-msg-theirs { justify-content: flex-start; }
.support-msg-inner {
  max-width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  background: rgb(15 65 127);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.support-msg-theirs .support-msg-inner {
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
  border-top-left-radius: 6px;
}
.support-msg-mine .support-msg-inner {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: none;
  color: #fff;
  border-top-right-radius: 6px;
}
.support-msg-body { word-wrap: break-word; margin-bottom: 0.25rem; }
.support-msg-meta {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
}
.support-msg-theirs .support-msg-meta { color: #94a3b8; }
.support-msg-img-wrap { margin-top: 0.5rem; }
.support-msg-img { max-width: 100%; border-radius: 12px; display: block; }
.support-msg-reply {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  border-left: 3px solid rgba(255, 255, 255, 0.4);
}
.support-msg-theirs .support-msg-reply { color: #94a3b8; background: rgba(15, 23, 42, 0.5); border-left-color: #64748b; }

/* Скелетон загрузки чата */
.support-chat-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0.5rem;
  min-height: 120px;
}
.support-skeleton-msg {
  display: flex;
  max-width: 85%;
}
.support-skeleton-msg.support-skeleton-theirs { justify-content: flex-start; }
.support-skeleton-msg.support-skeleton-mine { justify-content: flex-end; margin-left: auto; }
.support-skeleton-inner {
  padding: 0.75rem 1rem;
  border-radius: 18px;
  min-width: 80px;
}
.support-skeleton-theirs .support-skeleton-inner {
  border-top-left-radius: 6px;
  background: rgba(51, 65, 85, 0.4);
}
.support-skeleton-mine .support-skeleton-inner {
  border-top-right-radius: 6px;
  background: rgba(14, 165, 233, 0.25);
}
.support-skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  animation: support-skeleton-pulse 1.2s ease-in-out infinite;
  margin-bottom: 0.4rem;
}
.support-skeleton-line:last-child { margin-bottom: 0; }
.support-skeleton-line.short { max-width: 60%; }
.support-skeleton-line.meta { height: 8px; max-width: 45%; margin-top: 0.35rem; }
@keyframes support-skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.support-msg-reply-preview {
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: inline-block;
  vertical-align: bottom;
}

/* Ответ на сообщение (бар над полем ввода) */
.support-reply-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  font-size: 0.875rem;
}
.support-reply-bar.hidden { display: none; }
.support-reply-label { color: #94a3b8; flex-shrink: 0; font-weight: 500; }
.support-reply-preview { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.support-reply-cancel { flex-shrink: 0; background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; color: #94a3b8; padding: 0 0.25rem; border-radius: 6px; transition: background 0.15s, color 0.15s; }
.support-reply-cancel:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }

/* Область ввода */
.support-input-wrap { margin-top: 0.5rem; position: relative; padding: 0 0 0.25rem; }
.support-input-wrap.hidden { display: none; }
.support-attach-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.4);
  padding: 0.75rem;
}
.support-attach-preview.hidden { display: none; }
.support-attach-thumb-wrap { position: relative; flex-shrink: 0; }
.support-attach-thumb {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
}
.support-attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #475569;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.15s;
}
.support-attach-remove:hover { background: #ef4444; }
.support-attach-hint { font-size: 0.8125rem; color: #94a3b8; }
.support-upload-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.support-upload-progress.hidden { display: none; }
.support-upload-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(51, 65, 85, 0.6);
  border-radius: 999px;
  overflow: hidden;
}
.support-upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.support-upload-progress-text { font-size: 0.8125rem; color: #94a3b8; white-space: nowrap; }
.support-input-row {
  display: flex;
  gap: 0.35rem;
  align-items: flex-end;
  margin-bottom: 0;
  position: relative;
  flex-wrap: nowrap;
}

/* Строка ввода (мессенджер-стиль) */
.support-input-row-telegram {
  align-items: center;
  gap: 0;
  padding: 6px 8px 6px 12px;
  background: rgba(49, 56, 72, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 24px;
  margin-bottom: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.support-input-row-telegram .support-icon-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.support-input-row-telegram .support-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
.support-icon-svg { display: block; }
.support-input-row-telegram .support-text-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  margin: 0 6px;
  padding: 10px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #f1f5f9;
  font-size: 0.9375rem;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  transition: height 0.1s ease-out;
  box-sizing: border-box;
  font-family: inherit;
}
.support-input-row-telegram .support-text-input::placeholder { color: #64748b; }
.support-input-row-telegram .support-text-input:focus { outline: none; box-shadow: none; }
.support-input-row-telegram .support-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}
.support-input-row-telegram .support-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5);
}
.support-input-row-telegram .support-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.support-send-btn.loading .support-send-icon { visibility: hidden; }
.support-send-btn.loading {
  position: relative;
  pointer-events: none;
  cursor: not-allowed;
}
.support-send-btn.loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: settings-spin 0.65s linear infinite;
}
.support-send-icon { display: block; margin-left: 2px; }

.support-icon-btn { flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: none; border-radius: 50%; background: transparent; color: #94a3b8; font-size: 1.25rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.support-emoji-btn { order: 0; }
.support-attach-btn { order: 2; }
.support-text-input { flex: 1; min-width: 0; min-height: 40px; max-height: 72px; padding: 0.5rem 0.75rem; border: 1px solid #334155; border-radius: 10px; background: #0f172a; color: #e2e8f0; font-size: 1rem; line-height: 1.35; resize: none; overflow-y: auto; box-sizing: border-box; order: 1; }
.support-text-input::placeholder { color: #64748b; }
.support-text-input:focus { outline: none; border-color: #3b82f6; }
.support-send-btn { flex-shrink: 0; order: 3; }

/* Панель эмодзи */
.support-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.support-emoji-picker.hidden { display: none; }
.support-emoji-picker span {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.35rem;
  text-align: center;
  border-radius: 12px;
  transition: background 0.15s, transform 0.1s;
}
.support-emoji-picker span:hover { background: rgba(51, 65, 85, 0.6); transform: scale(1.08); }
.support-input-wrap input.hidden { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.support-empty-chat {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.support-hint { font-size: 0.75rem; color: #64748b; margin: 0; }

.support-unread-badge {
  display: inline-block;
  min-width: 1.1em;
  padding: 0.2em 0.45em;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #0ea5e9;
  color: #fff;
  border-radius: 999px;
  margin-left: 0.25rem;
}
.support-unread-badge.hidden { display: none; }

/* Поддержка: мобильная адаптация — тот же стиль, что и на десктопе */
@media (max-width: 768px) {
  body.page-support-body { padding: 0 16px; }
  .container-support { padding: 0; }
  .page-support { padding: 0; }
  .page-support .support-page-title { margin-bottom: 0.5rem; }
  .page-support .support-back-dashboard { margin-bottom: 0.5rem; }
  .support-chat-pane { padding-bottom: max(0.3rem, env(safe-area-inset-bottom)); }
  .support-input-row-telegram .support-icon-btn,
  .support-input-row-telegram .support-send-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .support-input-row-telegram .support-text-input { min-height: 44px; }
}

@media (max-width: 480px) {
  body.page-support-body { padding: 0 12px; }
  .support-chat-pane { padding-bottom: max(0.3rem, env(safe-area-inset-bottom)); }
  .support-msg-reply-preview { max-width: 140px; }
}

.user-card-buttons .btn { margin-right: 0.5rem; margin-bottom: 0.35rem; }
.user-card-buttons a.btn { text-decoration: none; }
